Replaced imsi to subscriber ID 03/151203/1 accepted/tizen/unified/20170927.063136 submit/tizen/20170922.065607 submit/tizen/20170926.021226
authorhyunuktak <hyunuk.tak@samsung.com>
Wed, 20 Sep 2017 07:40:32 +0000 (16:40 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Wed, 20 Sep 2017 07:40:48 +0000 (16:40 +0900)
Change-Id: I68c4acc2312b975f2f27cace6052660bd9381e7e
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
14 files changed:
include/stc.h
include/stc_internal.h
packaging/capi-network-stc.spec
src/include/stc-info.h
src/include/stc-reset.h
src/include/stc-restriction.h
src/internal/include/stc-util.h
src/stc-info.c
src/stc-reset.c
src/stc-restriction.c
src/stc-statistics.c
test/restriction.c
test/statistics.c
test/stc_test.c

index 08cb422..5a8ba11 100755 (executable)
@@ -233,7 +233,6 @@ typedef enum {
  * @pre stc_get_total_stats() will invoke this callback.
  * @see stc_stats_info_get_app_id()
  * @see stc_stats_info_get_iface_name()
- * @see stc_stats_info_get_imsi()
  * @see stc_stats_info_get_time_interval()
  * @see stc_stats_info_get_iface_type()
  * @see stc_stats_info_get_counter()
index d94916b..d529a4d 100755 (executable)
@@ -125,7 +125,7 @@ typedef enum {
  * @pre        stc_foreach_restriction() will invoke this callback.
  * @see stc_restriction_info_get_app_id()
  * @see stc_restriction_info_get_iface_name()
- * @see stc_restriction_info_get_imsi()
+ * @see stc_restriction_info_get_subscriber_id()
  * @see stc_restriction_info_get_status()
  * @see stc_restriction_info_get_iface_type()
  * @see stc_restriction_info_get_limit()
@@ -179,11 +179,11 @@ typedef void (*stc_threshold_crossed_cb)(stc_restriction_info_h info,
  * @see stc_reset_rule_create()
  * @see stc_reset_rule_destroy()
  * @see stc_reset_rule_set_app_id()
- * @see stc_reset_rule_set_imsi()
+ * @see stc_reset_rule_set_subscriber_id()
  * @see stc_reset_rule_set_iface_type()
  * @see stc_reset_rule_set_time_interval()
  * @see stc_reset_rule_get_app_id()
- * @see stc_reset_rule_get_imsi()
+ * @see stc_reset_rule_get_subscriber_id()
  * @see stc_reset_rule_get_iface_type()
  * @see stc_reset_rule_get_time_interval()
  */
@@ -222,13 +222,13 @@ int stc_reset_stats(stc_h stc, stc_reset_rule_h rule);
  * @see stc_restriction_rule_set_limit()
  * @see stc_restriction_rule_set_warning_limit()
  * @see stc_restriction_rule_set_roaming_type()
- * @see stc_restriction_rule_set_imsi()
+ * @see stc_restriction_rule_set_subscriber_id()
  * @see stc_restriction_rule_get_app_id()
  * @see stc_restriction_rule_get_iface_type()
  * @see stc_restriction_rule_get_limit()
  * @see stc_restriction_rule_get_warning_limit()
  * @see stc_restriction_rule_get_roaming_type()
- * @see stc_restriction_rule_get_imsi()
+ * @see stc_restriction_rule_get_subscriber_id()
  * @see stc_restriction_rule_get_process_state()
  * @see stc_get_restriction()
  * @see stc_foreach_restriction()
@@ -270,13 +270,13 @@ int stc_set_restriction(stc_h stc, stc_restriction_rule_h rule);
  * @see stc_restriction_rule_set_limit()
  * @see stc_restriction_rule_set_warning_limit()
  * @see stc_restriction_rule_set_roaming_type()
- * @see stc_restriction_rule_set_imsi()
+ * @see stc_restriction_rule_set_subscriber_id()
  * @see stc_restriction_rule_get_app_id()
  * @see stc_restriction_rule_get_iface_type()
  * @see stc_restriction_rule_get_limit()
  * @see stc_restriction_rule_get_warning_limit()
  * @see stc_restriction_rule_get_roaming_type()
- * @see stc_restriction_rule_get_imsi()
+ * @see stc_restriction_rule_get_subscriber_id()
  * @see stc_restriction_rule_get_process_state()
  * @see stc_set_restriction()
  * @see stc_get_restriction()
@@ -318,13 +318,13 @@ int stc_exclude_restriction(stc_h stc, stc_restriction_rule_h rule);
  * @see stc_restriction_rule_set_limit()
  * @see stc_restriction_rule_set_warning_limit()
  * @see stc_restriction_rule_set_roaming_type()
- * @see stc_restriction_rule_set_imsi()
+ * @see stc_restriction_rule_set_subscriber_id()
  * @see stc_restriction_rule_get_app_id()
  * @see stc_restriction_rule_get_iface_type()
  * @see stc_restriction_rule_get_limit()
  * @see stc_restriction_rule_get_warning_limit()
  * @see stc_restriction_rule_get_roaming_type()
- * @see stc_restriction_rule_get_imsi()
+ * @see stc_restriction_rule_get_subscriber_id()
  * @see stc_restriction_rule_get_process_state()
  * @see stc_set_restriction()
  * @see stc_get_restriction()
@@ -368,13 +368,13 @@ int stc_unset_restriction(stc_h stc, stc_restriction_rule_h rule);
  * @see stc_restriction_rule_set_limit()
  * @see stc_restriction_rule_set_warning_limit()
  * @see stc_restriction_rule_set_roaming_type()
- * @see stc_restriction_rule_set_imsi()
+ * @see stc_restriction_rule_set_subscriber_id()
  * @see stc_restriction_rule_get_app_id()
  * @see stc_restriction_rule_get_iface_type()
  * @see stc_restriction_rule_get_limit()
  * @see stc_restriction_rule_get_warning_limit()
  * @see stc_restriction_rule_get_roaming_type()
- * @see stc_restriction_rule_get_imsi()
+ * @see stc_restriction_rule_get_subscriber_id()
  * @see stc_restriction_rule_get_process_state()
  * @see stc_restriction_info_cb()
  * @see stc_set_restriction()
@@ -430,13 +430,13 @@ int stc_unset_warn_threshold_crossed_cb(stc_h stc);
  * @see stc_restriction_rule_set_limit()
  * @see stc_restriction_rule_set_warning_limit()
  * @see stc_restriction_rule_set_roaming_type()
- * @see stc_restriction_rule_set_imsi()
+ * @see stc_restriction_rule_set_subscriber_id()
  * @see stc_restriction_rule_get_app_id()
  * @see stc_restriction_rule_get_iface_type()
  * @see stc_restriction_rule_get_limit()
  * @see stc_restriction_rule_get_warning_limit()
  * @see stc_restriction_rule_get_roaming_type()
- * @see stc_restriction_rule_get_imsi()
+ * @see stc_restriction_rule_get_subscriber_id()
  * @see stc_restriction_rule_get_process_state()
  * @see stc_restriction_info_cb()
  * @see stc_set_restriction()
@@ -480,13 +480,13 @@ int stc_foreach_restriction(stc_h stc, stc_restriction_rule_h rule,
  * @see stc_restriction_rule_set_limit()
  * @see stc_restriction_rule_set_warning_limit()
  * @see stc_restriction_rule_set_roaming_type()
- * @see stc_restriction_rule_set_imsi()
+ * @see stc_restriction_rule_set_subscriber_id()
  * @see stc_restriction_rule_get_app_id()
  * @see stc_restriction_rule_get_iface_type()
  * @see stc_restriction_rule_get_limit()
  * @see stc_restriction_rule_get_warning_limit()
  * @see stc_restriction_rule_get_roaming_type()
- * @see stc_restriction_rule_get_imsi()
+ * @see stc_restriction_rule_get_subscriber_id()
  * @see stc_restriction_rule_get_process_state()
  * @see stc_set_restriction()
  * @see stc_get_restriction()
@@ -583,13 +583,13 @@ int stc_reset_rule_destroy(stc_reset_rule_h rule);
 int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_id);
 
 /**
- * @brief Sets the imsi for reset rule.
+ * @brief Sets the subscriber ID for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
- * @param[in] imsi The imsi
+ * @param[in] subscriber_id The subscriber ID
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #STC_ERROR_NONE Successful
@@ -604,9 +604,9 @@ int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_id);
  * @see #stc_reset_rule_h
  * @see stc_reset_rule_create()
  * @see stc_reset_rule_destroy()
- * @see stc_reset_rule_get_imsi()
+ * @see stc_reset_rule_get_subscriber_id()
  */
-int stc_reset_rule_set_imsi(stc_reset_rule_h rule, const char *imsi);
+int stc_reset_rule_set_subscriber_id(stc_reset_rule_h rule, const char *subscriber_id);
 
 /**
  * @brief Sets the interface type for reset rule.
@@ -691,13 +691,13 @@ int stc_reset_rule_set_time_interval(stc_reset_rule_h rule,
 int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id);
 
 /**
- * @brief Gets the imsi for reset rule.
+ * @brief Gets the subscriber ID for reset rule.
  * @since_tizen 4.0
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The reset rule handle
- * @param[out] imsi The imsi
+ * @param[out] subscriber_id The subscriber ID
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #STC_ERROR_NONE Successful
@@ -712,9 +712,9 @@ int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id);
  * @see #stc_reset_rule_h
  * @see stc_reset_rule_create()
  * @see stc_reset_rule_destroy()
- * @see stc_reset_rule_set_imsi()
+ * @see stc_reset_rule_set_subscriber_id()
  */
-int stc_reset_rule_get_imsi(stc_reset_rule_h rule, char **imsi);
+int stc_reset_rule_get_subscriber_id(stc_reset_rule_h rule, char **subscriber_id);
 
 /**
  * @brief Gets the interface type for reset rule.
@@ -997,13 +997,13 @@ int stc_restriction_rule_set_roaming_type(stc_restriction_rule_h rule,
                stc_roaming_type_e roaming_type);
 
 /**
- * @brief Sets the imsi for restriction rule.
+ * @brief Sets the subscriber ID for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
- * @param[in] imsi The imsi
+ * @param[in] subscriber_id The subscriber ID
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #STC_ERROR_NONE Successful
@@ -1018,9 +1018,9 @@ int stc_restriction_rule_set_roaming_type(stc_restriction_rule_h rule,
  * @see #stc_restriction_rule_h
  * @see stc_restriction_rule_create()
  * @see stc_restriction_rule_destroy()
- * @see stc_restriction_rule_get_imsi()
+ * @see stc_restriction_rule_get_subscriber_id()
  */
-int stc_restriction_rule_set_imsi(stc_restriction_rule_h rule, const char *imsi);
+int stc_restriction_rule_set_subscriber_id(stc_restriction_rule_h rule, const char *subscriber_id);
 
 /**
  * @brief Gets the application ID for restriction rule.
@@ -1187,13 +1187,13 @@ int stc_restriction_rule_get_roaming_type(stc_restriction_rule_h rule,
                stc_roaming_type_e *roaming_type);
 
 /**
- * @brief Gets the imsi for restriction rule.
+ * @brief Gets the subscriber ID for restriction rule.
  * @since_tizen 4.0
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] rule The restriction rule handle
- * @param[out] imsi The imsi
+ * @param[out] subscriber_id The subscriber ID
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #STC_ERROR_NONE Successful
@@ -1208,17 +1208,17 @@ int stc_restriction_rule_get_roaming_type(stc_restriction_rule_h rule,
  * @see #stc_restriction_rule_h
  * @see stc_restriction_rule_create()
  * @see stc_restriction_rule_destroy()
- * @see stc_restriction_rule_set_imsi()
+ * @see stc_restriction_rule_set_subscriber_id()
  */
-int stc_restriction_rule_get_imsi(stc_restriction_rule_h rule, char **imsi);
+int stc_restriction_rule_get_subscriber_id(stc_restriction_rule_h rule, char **subscriber_id);
 
 /**
- * @brief Gets the IMSI from statistics information.
+ * @brief Gets the subscriber ID from statistics information.
  * @since_tizen 4.0
- * @remarks You must release @a imsi using free().
+ * @remarks You must release @a subscriber ID using free().
  *
- * @param[in] info          The statistics information handle
- * @param[out] imsi         The IMSI
+ * @param[in] info The statistics information handle
+ * @param[out] subscriber_id The subscriber ID
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #STC_ERROR_NONE                    Successful
@@ -1233,7 +1233,7 @@ int stc_restriction_rule_get_imsi(stc_restriction_rule_h rule, char **imsi);
  * @see stc_stats_info_h
  * @see stc_stats_info_cb()
  */
-int stc_stats_info_get_imsi(stc_stats_info_h info, char **imsi);
+int stc_stats_info_get_subscriber_id(stc_stats_info_h info, char **subscriber_id);
 
 /**
  * @brief Gets the application ID for restriction information.
@@ -1285,13 +1285,13 @@ int stc_restriction_info_get_iface_name(stc_restriction_info_h info,
                char **iface_name);
 
 /**
- * @brief Gets the imsi for restriction information.
+ * @brief Gets the subscriber ID for restriction information.
  * @since_tizen 4.0
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/network.get
  *
  * @param[in] info The restriction information handle
- * @param[out] imsi The imsi
+ * @param[out] subscriber_id The subscriber ID
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #STC_ERROR_NONE Successful
@@ -1306,7 +1306,7 @@ int stc_restriction_info_get_iface_name(stc_restriction_info_h info,
  * @see #stc_restriction_info_h
  * @see stc_restriction_info_cb()
  */
-int stc_restriction_info_get_imsi(stc_restriction_info_h info, char **imsi);
+int stc_restriction_info_get_subscriber_id(stc_restriction_info_h info, char **subscriber_id);
 
 /**
  * @brief Gets the restriction status for restriction information.
index 93f4d73..62eff2a 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-network-stc
 Summary:    A Smart Traffic Control (STC) libraries in Native API
-Version:    0.0.20
+Version:    0.0.21
 Release:    1
 Group:      Network & Connectivity/API
 License:    Apache-2.0
index 8cef4eb..b5d4ac9 100755 (executable)
@@ -54,7 +54,7 @@ extern "C" {
 #define STC_STATS_INFO_APP_ID                          "app_id"
 #define STC_STATS_INFO_IFTYPE                          "iftype"
 #define STC_STATS_INFO_IFNAME                          "ifname"
-#define STC_STATS_INFO_IMSI                                    "imsi"
+#define STC_STATS_INFO_SUBSCRIBER_ID           "subscriber_id"
 #define STC_STATS_INFO_INTERVAL_FROM           "interval_from"
 #define STC_STATS_INFO_INTERVAL_TO                     "interval_to"
 #define STC_STATS_INFO_OUTGOING_BYTES          "cnt_out_bytes"
@@ -67,10 +67,10 @@ extern "C" {
 #define STC_RESTRICTION_INFO_IFTYPE                            "iftype"
 #define STC_RESTRICTION_INFO_IFNAME                            "ifname"
 #define STC_RESTRICTION_INFO_DATA_LIMIT                        "data_limit"
-#define STC_RESTRICTION_INFO_DATA_WARN_LIMIT           "data_warn_limit"
+#define STC_RESTRICTION_INFO_DATA_WARN_LIMIT   "data_warn_limit"
 #define STC_RESTRICTION_INFO_RST_STATUS                        "rst_state"
 #define STC_RESTRICTION_INFO_ROAMING                   "roaming"
-#define STC_RESTRICTION_INFO_IMSI                              "imsi"
+#define STC_RESTRICTION_INFO_SUBSCRIBER_ID             "subscriber_id"
 
 typedef struct {
        int64_t incoming_bytes; /** <incoming_bytes is the Total bytes =  Incoming + outgoing */
@@ -80,7 +80,7 @@ typedef struct {
 typedef struct {
        char app_id[STC_APP_ID_LEN];
        char iface_name[STC_IFNAME_LEN];
-       char imsi[STC_IMSI_LEN];
+       char subscriber_id[STC_SUBSCRIBER_ID_LEN];
        stc_time_interval_s interval;
        stc_iface_type_e iface_type;
        stc_data_counters_s cnt;
@@ -92,7 +92,7 @@ typedef struct {
 typedef struct {
        char app_id[STC_APP_ID_LEN];
        char iface_name[STC_IFNAME_LEN];
-       char imsi[STC_IMSI_LEN];
+       char subscriber_id[STC_SUBSCRIBER_ID_LEN];
        stc_iface_type_e iface_type;
        stc_restriction_status_e rst_status;
        int64_t data_limit;
index 20c4f3b..cc12ee7 100755 (executable)
@@ -54,14 +54,14 @@ extern "C" {
 #define RESET_INTERVAL 3600 * 24 * 40  /* 40 days */
 
 #define STC_RESET_RULE_APP_ID                  "app_id"
-#define STC_RESET_RULE_IMSI                            "imsi"
+#define STC_RESET_RULE_SUBSCRIBER_ID   "subscriber_id"
 #define STC_RESET_RULE_IFTYPE                  "iftype"
 #define STC_RESET_RULE_INTERVAL_FROM   "from"
 #define STC_RESET_RULE_INTERVAL_TO             "to"
 
 typedef struct {
        char app_id[STC_APP_ID_LEN];
-       char imsi[STC_IMSI_LEN];
+       char subscriber_id[STC_SUBSCRIBER_ID_LEN];
        stc_iface_type_e iface_type;
        stc_time_interval_s interval;
 } stc_reset_rule_s;
index 3532233..1821b63 100755 (executable)
@@ -52,7 +52,7 @@ extern "C" {
 #define STC_RESTRICTION_RULE_IFNAME                            "ifname"
 #define STC_RESTRICTION_RULE_IFTYPE                            "iftype"
 #define STC_RESTRICTION_RULE_ROAMING                   "roaming"
-#define STC_RESTRICTION_RULE_IMSI                              "imsi"
+#define STC_RESTRICTION_RULE_SUBSCRIBER_ID             "subscriber_id"
 #define STC_RESTRICTION_RULE_DATA_LIMIT                        "data_limit"
 #define STC_RESTRICTION_RULE_DATA_WARN_LIMIT           "data_warn_limit"
 
@@ -67,7 +67,7 @@ typedef enum {
 typedef struct {
        char app_id[STC_APP_ID_LEN];
        char iface_name[STC_IFNAME_LEN];
-       char imsi[STC_IMSI_LEN];
+       char subscriber_id[STC_SUBSCRIBER_ID_LEN];
        stc_iface_type_e iface_type;
        stc_restriction_status_e rst_state;
        int64_t data_limit;
index 631d02f..3c26d70 100755 (executable)
@@ -47,7 +47,7 @@
  *****************************************************************************/
 #define STC_APP_ID_LEN 128
 #define STC_IFNAME_LEN 16
-#define STC_IMSI_LEN 64
+#define STC_SUBSCRIBER_ID_LEN 128
 
 #define STC_RETURN_VAL_IF(expr, val, fmt, arg...) do { \
        if (expr) { \
index 7f9dc3e..e079757 100755 (executable)
@@ -105,11 +105,12 @@ EXPORT_API int stc_stats_info_get_iface_name(stc_stats_info_h info, char **iface
 }
 
 //LCOV_EXCL_START
-EXPORT_API int stc_stats_info_get_imsi(stc_stats_info_h info, char **imsi)
+EXPORT_API int stc_stats_info_get_subscriber_id(stc_stats_info_h info,
+               char **subscriber_id)
 {
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
 
-       if (info == NULL || imsi == NULL) {
+       if (info == NULL || subscriber_id == NULL) {
                STC_LOGE("Invalid parameter");
                return STC_ERROR_INVALID_PARAMETER;
        }
@@ -117,11 +118,11 @@ EXPORT_API int stc_stats_info_get_imsi(stc_stats_info_h info, char **imsi)
        stc_stats_info_s *stats_info =
                (stc_stats_info_s *)info;
 
-       *imsi = g_strdup(stats_info->imsi);
-       if (*imsi == NULL)
+       *subscriber_id = g_strdup(stats_info->subscriber_id);
+       if (*subscriber_id == NULL)
                return STC_ERROR_OUT_OF_MEMORY;
 
-       STC_LOGI("Imsi [%s]", *imsi);
+       STC_LOGI("Subscriber ID [%s]", *subscriber_id);
 
        return STC_ERROR_NONE;
 }
@@ -298,11 +299,12 @@ EXPORT_API int stc_restriction_info_get_iface_name(stc_restriction_info_h info,
        return STC_ERROR_NONE;
 }
 
-EXPORT_API int stc_restriction_info_get_imsi(stc_restriction_info_h info, char **imsi)
+EXPORT_API int stc_restriction_info_get_subscriber_id(stc_restriction_info_h info,
+               char **subscriber_id)
 {
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
 
-       if (info == NULL || imsi == NULL) {
+       if (info == NULL || subscriber_id == NULL) {
                STC_LOGE("Invalid parameter");
                return STC_ERROR_INVALID_PARAMETER;
        }
@@ -310,11 +312,11 @@ EXPORT_API int stc_restriction_info_get_imsi(stc_restriction_info_h info, char *
        stc_restriction_info_s *restriction_info =
                (stc_restriction_info_s *)info;
 
-       *imsi = g_strdup(restriction_info->imsi);
-       if (*imsi == NULL)
+       *subscriber_id = g_strdup(restriction_info->subscriber_id);
+       if (*subscriber_id == NULL)
                return STC_ERROR_OUT_OF_MEMORY;
 
-       STC_LOGI("Imsi [%s]", *imsi);
+       STC_LOGI("Subscriber ID [%s]", *subscriber_id);
 
        return STC_ERROR_NONE;
 }
index 2e407a7..4a56fcd 100755 (executable)
@@ -98,10 +98,10 @@ static void __stc_reset_stats_make_params(
                        g_variant_new_string(reset_rule->app_id));
        }
 
-       if (reset_rule->imsi[0] != '\0') {
+       if (reset_rule->subscriber_id[0] != '\0') {
                g_variant_builder_add(builder, "{sv}",
-                       STC_RESET_RULE_IMSI,
-                       g_variant_new_string(reset_rule->imsi));
+                       STC_RESET_RULE_SUBSCRIBER_ID,
+                       g_variant_new_string(reset_rule->subscriber_id));
        }
 
        if (reset_rule->iface_type != STC_IFACE_UNKNOWN) {
@@ -223,7 +223,8 @@ EXPORT_API int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_
        return STC_ERROR_NONE;
 }
 
-EXPORT_API int stc_reset_rule_set_imsi(stc_reset_rule_h rule, const char *imsi)
+EXPORT_API int stc_reset_rule_set_subscriber_id(stc_reset_rule_h rule,
+               const char *subscriber_id)
 {
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
 
@@ -234,12 +235,12 @@ EXPORT_API int stc_reset_rule_set_imsi(stc_reset_rule_h rule, const char *imsi)
 
        stc_reset_rule_s *reset_rule = rule;
 
-       if (imsi == NULL)
-               reset_rule->imsi[0] = '\0';
+       if (subscriber_id == NULL)
+               reset_rule->subscriber_id[0] = '\0';
        else
-               g_strlcpy(reset_rule->imsi, imsi, STC_IMSI_LEN);
+               g_strlcpy(reset_rule->subscriber_id, subscriber_id, STC_SUBSCRIBER_ID_LEN);
 
-       STC_LOGI("Imsi [%s]", reset_rule->imsi);
+       STC_LOGI("Subscriber ID [%s]", reset_rule->subscriber_id);
 
        return STC_ERROR_NONE;
 }
@@ -321,22 +322,23 @@ EXPORT_API int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id)
        return STC_ERROR_NONE;
 }
 
-EXPORT_API int stc_reset_rule_get_imsi(stc_reset_rule_h rule, char **imsi)
+EXPORT_API int stc_reset_rule_get_subscriber_id(stc_reset_rule_h rule,
+               char **subscriber_id)
 {
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
 
-       if (rule == NULL || imsi == NULL) {
+       if (rule == NULL || subscriber_id == NULL) {
                STC_LOGE("Invalid parameter");
                return STC_ERROR_INVALID_PARAMETER;
        }
 
        stc_reset_rule_s *reset_rule = (stc_reset_rule_s *)rule;
 
-       *imsi = g_strdup(reset_rule->imsi);
-       if (*imsi == NULL)
+       *subscriber_id = g_strdup(reset_rule->subscriber_id);
+       if (*subscriber_id == NULL)
                return STC_ERROR_OUT_OF_MEMORY;
 
-       STC_LOGI("Imsi [%s]", *imsi);
+       STC_LOGI("Subscriber ID [%s]", *subscriber_id);
 
        return STC_ERROR_NONE;
 }
index 99cdf2f..45c4c1d 100755 (executable)
@@ -72,7 +72,7 @@ static void __stc_restriction_init_rule(stc_restriction_rule_s *rule)
        rule->data_limit = 0;
        rule->data_warn_limit = 0;
        rule->roaming_type = STC_ROAMING_DISABLED;
-       rule->imsi[0] = '\0';
+       rule->subscriber_id[0] = '\0';
 }
 
 static void __stc_restriction_deinit_rule(stc_restriction_rule_h rule)
@@ -106,8 +106,8 @@ static void __stc_restriction_rule_make_params(
                g_variant_new_uint16(restriction_rule->roaming_type));
 
        g_variant_builder_add(builder, "{sv}",
-               STC_RESTRICTION_RULE_IMSI,
-               g_variant_new_string(restriction_rule->imsi));
+               STC_RESTRICTION_RULE_SUBSCRIBER_ID,
+               g_variant_new_string(restriction_rule->subscriber_id));
 
        g_variant_builder_add(builder, "{sv}",
                STC_RESTRICTION_RULE_DATA_LIMIT,
@@ -158,10 +158,10 @@ static void __stc_restriction_extract_info_cb(const char *key,
                if (iface_name != NULL)
                        g_strlcpy(restriction_info->iface_name, iface_name, STC_IFNAME_LEN);
 
-       } else if (!g_strcmp0(key, STC_RESTRICTION_INFO_IMSI)) {
-               const char *imsi = g_variant_get_string(value, NULL);
-               if (imsi != NULL)
-                       g_strlcpy(restriction_info->imsi, imsi, STC_IMSI_LEN);
+       } else if (!g_strcmp0(key, STC_RESTRICTION_INFO_SUBSCRIBER_ID)) {
+               const char *subscriber_id = g_variant_get_string(value, NULL);
+               if (subscriber_id != NULL)
+                       g_strlcpy(restriction_info->subscriber_id, subscriber_id, STC_SUBSCRIBER_ID_LEN);
 
        } else if (!g_strcmp0(key, STC_RESTRICTION_INFO_IFTYPE)) {
                restriction_info->iface_type =
@@ -196,8 +196,8 @@ static void __stc_restriction_print_info(
        if (info->iface_type != STC_IFACE_UNKNOWN)
                STC_LOGD("Iftype:    [%s]", _stc_convert_iface_type_to_string(info->iface_type));
 
-       if (info->imsi[0] != '\0')
-               STC_LOGD("Imsi:      [%s]", info->imsi);
+       if (info->subscriber_id[0] != '\0')
+               STC_LOGD("Sub_id:    [%s]", info->subscriber_id);
 
        if (info->roaming_type != STC_ROAMING_UNKNOWN)
                STC_LOGD("Roaming:   [%s]", _stc_convert_roaming_to_string(info->roaming_type));
@@ -483,9 +483,9 @@ stc_error_e _stc_restriction_check_set_rule(
                "Roaming type is not valid [%s]",
                _stc_convert_roaming_to_string(restriction_rule->roaming_type));
 
-       STC_RETURN_VAL_IF(restriction_rule->imsi[0] == '\0',
+       STC_RETURN_VAL_IF(restriction_rule->subscriber_id[0] == '\0',
                STC_ERROR_INVALID_PARAMETER,
-               "Imsi is not valid");
+               "Subscriber ID is not valid");
 
        return STC_ERROR_NONE;
 }
@@ -587,9 +587,9 @@ stc_error_e _stc_restriction_check_remove_rule(
                "Roaming type is not valid [%d]",
                restriction_rule->roaming_type);
 
-       STC_RETURN_VAL_IF(restriction_rule->imsi[0] == '\0',
+       STC_RETURN_VAL_IF(restriction_rule->subscriber_id[0] == '\0',
                STC_ERROR_INVALID_PARAMETER,
-               "Imsi is not valid");
+               "Subscriber ID is not valid");
 
        return STC_ERROR_NONE;
 }
@@ -629,9 +629,9 @@ stc_error_e _stc_restriction_check_exclude_rule(
                "Roaming type is not valid [%d]",
                restriction_rule->roaming_type);
 
-       STC_RETURN_VAL_IF(restriction_rule->imsi[0] == '\0',
+       STC_RETURN_VAL_IF(restriction_rule->subscriber_id[0] == '\0',
                STC_ERROR_INVALID_PARAMETER,
-               "Imsi is not valid");
+               "Subscriber ID is not valid");
 
        return STC_ERROR_NONE;
 }
@@ -964,7 +964,8 @@ EXPORT_API int stc_restriction_rule_set_roaming_type(stc_restriction_rule_h rule
        return STC_ERROR_NONE;
 }
 
-EXPORT_API int stc_restriction_rule_set_imsi(stc_restriction_rule_h rule, const char *imsi)
+EXPORT_API int stc_restriction_rule_set_subscriber_id(stc_restriction_rule_h rule,
+               const char *subscriber_id)
 {
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
 
@@ -976,12 +977,12 @@ EXPORT_API int stc_restriction_rule_set_imsi(stc_restriction_rule_h rule, const
        stc_restriction_rule_s *restriction_rule =
                (stc_restriction_rule_s *)rule;
 
-       if (imsi == NULL || strlen(imsi) == 0)
-               restriction_rule->imsi[0] = '\0';
+       if (subscriber_id == NULL || strlen(subscriber_id) == 0)
+               restriction_rule->subscriber_id[0] = '\0';
        else
-               g_strlcpy(restriction_rule->imsi, imsi, STC_IMSI_LEN);
+               g_strlcpy(restriction_rule->subscriber_id, subscriber_id, STC_SUBSCRIBER_ID_LEN);
 
-       STC_LOGI("Imsi [%s]", restriction_rule->imsi);
+       STC_LOGI("Subscriber ID [%s]", restriction_rule->subscriber_id);
 
        return STC_ERROR_NONE;
 }
@@ -1110,11 +1111,12 @@ EXPORT_API int stc_restriction_rule_get_roaming_type(stc_restriction_rule_h rule
        return STC_ERROR_NONE;
 }
 
-EXPORT_API int stc_restriction_rule_get_imsi(stc_restriction_rule_h rule, char **imsi)
+EXPORT_API int stc_restriction_rule_get_subscriber_id(stc_restriction_rule_h rule,
+               char **subscriber_id)
 {
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_STC);
 
-       if (rule == NULL || imsi == NULL) {
+       if (rule == NULL || subscriber_id == NULL) {
                STC_LOGE("Invalid parameter");
                return STC_ERROR_INVALID_PARAMETER;
        }
@@ -1122,11 +1124,11 @@ EXPORT_API int stc_restriction_rule_get_imsi(stc_restriction_rule_h rule, char *
        stc_restriction_rule_s *restriction_rule =
                (stc_restriction_rule_s *)rule;
 
-       *imsi = g_strdup(restriction_rule->imsi);
-       if (*imsi == NULL)
+       *subscriber_id = g_strdup(restriction_rule->subscriber_id);
+       if (*subscriber_id == NULL)
                return STC_ERROR_OUT_OF_MEMORY;
 
-       STC_LOGI("Imsi [%s]", *imsi);
+       STC_LOGI("Subscriber ID [%s]", *subscriber_id);
 
        return STC_ERROR_NONE;
 }
index 2e20cd0..36d4ba7 100755 (executable)
@@ -194,10 +194,10 @@ static void __stc_stats_extract_info_cb(const char *key,
                if (iface_name != NULL)
                        g_strlcpy(stats_info->iface_name, iface_name, STC_IFNAME_LEN);
 
-       } else if (!g_strcmp0(key, STC_STATS_INFO_IMSI)) {
-               const char *imsi = g_variant_get_string(value, NULL);
-               if (imsi != NULL)
-                       g_strlcpy(stats_info->imsi, imsi, STC_IMSI_LEN);
+       } else if (!g_strcmp0(key, STC_STATS_INFO_SUBSCRIBER_ID)) {
+               const char *subscriber_id = g_variant_get_string(value, NULL);
+               if (subscriber_id != NULL)
+                       g_strlcpy(stats_info->subscriber_id, subscriber_id, STC_SUBSCRIBER_ID_LEN);
 
        } else if (!g_strcmp0(key, STC_STATS_INFO_INTERVAL_FROM)) {
                stats_info->interval.from = g_variant_get_uint64(value); //LCOV_EXCL_LINE
@@ -242,8 +242,8 @@ static void __stc_stats_print_info(stc_stats_info_s *info)
        if (info->iface_type != STC_IFACE_UNKNOWN)
                STC_LOGD("Iftype:   [%d]", info->iface_type);
 
-       if (info->imsi[0] != '\0')
-               STC_LOGD("Imsi:     [%s]", info->imsi);
+       if (info->subscriber_id[0] != '\0')
+               STC_LOGD("Sub_id:   [%s]", info->subscriber_id);
 
        if (info->roaming_type != STC_ROAMING_UNKNOWN)
                STC_LOGD("Roaming:  [%d]", info->roaming_type);
index 95503f9..1cb93f1 100755 (executable)
@@ -46,7 +46,7 @@ static char g_app_id[MENU_DATA_SIZE] = "";
 static char g_iface_name[MENU_DATA_SIZE] = "";
 static char g_iface_type[MENU_DATA_SIZE] = "0";
 static char g_roaming[MENU_DATA_SIZE] = "0";
-static char g_imsi[MENU_DATA_SIZE] = "";
+static char g_subscriber_id[MENU_DATA_SIZE] = "";
 static char g_data_limit[MENU_DATA_SIZE] = "0";
 static char g_data_warn_limit[MENU_DATA_SIZE] = "0";
 
@@ -65,7 +65,7 @@ static stc_callback_ret_e __test_stc_restriction_info_cb(
        int ret = STC_ERROR_NONE;
        char *app_id = NULL;
        char *iface_name = NULL;
-       char *imsi = NULL;
+       char *subscriber_id = NULL;
        stc_restriction_status_e rst_status;
        stc_iface_type_e iface_type;
        int64_t data_limit;
@@ -82,9 +82,9 @@ static stc_callback_ret_e __test_stc_restriction_info_cb(
        if (ret == STC_ERROR_NONE)
                msg("Ifname:    [%s]", iface_name);
 
-       ret = stc_restriction_info_get_imsi(info, &imsi);
+       ret = stc_restriction_info_get_subscriber_id(info, &subscriber_id);
        if (ret == STC_ERROR_NONE)
-               msg("Imsi:      [%s]", imsi);
+               msg("Sub_id:    [%s]", subscriber_id);
 
        ret = stc_restriction_info_get_status(info, &rst_status);
        if (ret == STC_ERROR_NONE)
@@ -110,7 +110,7 @@ static stc_callback_ret_e __test_stc_restriction_info_cb(
 
        g_free(app_id);
        g_free(iface_name);
-       g_free(imsi);
+       g_free(subscriber_id);
 
        return STC_CALLBACK_CONTINUE;
 }
@@ -154,7 +154,7 @@ static int __test_stc_set_restriction_rule(MManager *mm, struct menu_data *menu)
        int64_t data_limit = (int64_t)strtol(g_data_limit, NULL, 10);
        int64_t data_warn_limit = (int64_t)strtol(g_data_warn_limit, NULL, 10);
        char *app_id = NULL;
-       char *imsi = NULL;
+       char *subscriber_id = NULL;
        char *iface_name = NULL;
        int ret = STC_ERROR_NONE;
 
@@ -198,11 +198,11 @@ static int __test_stc_set_restriction_rule(MManager *mm, struct menu_data *menu)
                }
        }
 
-       ret = stc_restriction_rule_set_imsi(g_restriction_rule, g_imsi);
+       ret = stc_restriction_rule_set_subscriber_id(g_restriction_rule, g_subscriber_id);
        if (ret == STC_ERROR_NONE)
-               msg(LOG_GREEN "Success to set imsi" LOG_END);
+               msg(LOG_GREEN "Success to set subscriber ID" LOG_END);
        else {
-               msg("Fail to set imsi " LOG_RED "[%s]" LOG_END,
+               msg("Fail to set subscriber ID " LOG_RED "[%s]" LOG_END,
                        test_stc_convert_error_type_to_string(ret));
                return ret;
        }
@@ -239,10 +239,10 @@ static int __test_stc_set_restriction_rule(MManager *mm, struct menu_data *menu)
                g_free(app_id);
        }
 
-       ret = stc_restriction_rule_get_imsi(g_restriction_rule, &imsi);
+       ret = stc_restriction_rule_get_subscriber_id(g_restriction_rule, &subscriber_id);
        if (ret == STC_ERROR_NONE) {
-               msg("Imsi:      " LOG_CYAN "[%s]" LOG_END, imsi);
-               g_free(imsi);
+               msg("Sub_id:    " LOG_CYAN "[%s]" LOG_END, subscriber_id);
+               g_free(subscriber_id);
        }
 
        ret = stc_restriction_rule_get_iface_type(g_restriction_rule, &iface_type);
@@ -453,7 +453,7 @@ int test_stc_restriction_unregister_cb(void)
 
 static struct menu_data menu_restriction_rule[] = {
        { "1", "Application ID", NULL, NULL, g_app_id},
-       { "2", "Imsi", NULL, NULL, g_imsi},
+       { "2", "Subscriber ID", NULL, NULL, g_subscriber_id},
        { "3", "Interface type(1.Tel/2.Wifi/3.Wired/4.BT/5.All)", NULL, NULL, g_iface_type},
        { "4", "Interface name", NULL, NULL, g_iface_name},
        { "5", "Roaming(1.Enable/2.Disable)", NULL, NULL, g_roaming},
index cb8be27..73c7937 100755 (executable)
@@ -43,7 +43,7 @@
 #include "stc_menu.h"
 
 static char g_reset_app_id[MENU_DATA_SIZE] = "";
-static char g_reset_imsi[MENU_DATA_SIZE] = "";
+static char g_reset_subscriber_id[MENU_DATA_SIZE] = "";
 static char g_reset_iface_type[MENU_DATA_SIZE] = "0";
 
 static char g_stats_app_id[MENU_DATA_SIZE] = "";
@@ -77,7 +77,7 @@ static stc_callback_ret_e __test_stc_stats_info_cb(
        int ret = STC_ERROR_NONE;
        char *app_id = NULL;
        char *iface_name = NULL;
-       char *imsi = NULL;
+       char *subscriber_id = NULL;
        time_t from;
        time_t to;
        stc_iface_type_e iface_type;
@@ -97,9 +97,9 @@ static stc_callback_ret_e __test_stc_stats_info_cb(
        if (ret == STC_ERROR_NONE)
                msg("Ifname:   [%s]", iface_name);
 
-       ret = stc_stats_info_get_imsi(info, &imsi);
+       ret = stc_stats_info_get_subscriber_id(info, &subscriber_id);
        if (ret == STC_ERROR_NONE)
-               msg("Imsi:     [%s]", imsi);
+               msg("Sub_id:   [%s]", subscriber_id);
 
        ret = stc_stats_info_get_iface_type(info, &iface_type);
        if (ret == STC_ERROR_NONE)
@@ -133,7 +133,7 @@ static stc_callback_ret_e __test_stc_stats_info_cb(
 
        g_free(app_id);
        g_free(iface_name);
-       g_free(imsi);
+       g_free(subscriber_id);
 
        return STC_CALLBACK_CONTINUE;
 }
@@ -143,7 +143,7 @@ static int __test_stc_set_reset_rule(MManager *mm, struct menu_data *menu)
        int ret = STC_ERROR_NONE;
        stc_iface_type_e iface_type = (int)strtol(g_reset_iface_type, NULL, 10);
        char *app_id = NULL;
-       char *imsi = NULL;
+       char *subscriber_id = NULL;
 
        ret = stc_reset_rule_set_app_id(g_reset_rule, g_reset_app_id);
        if (ret == STC_ERROR_NONE)
@@ -154,11 +154,11 @@ static int __test_stc_set_reset_rule(MManager *mm, struct menu_data *menu)
                return ret;
        }
 
-       ret = stc_reset_rule_set_imsi(g_reset_rule, g_reset_imsi);
+       ret = stc_reset_rule_set_subscriber_id(g_reset_rule, g_reset_subscriber_id);
        if (ret == STC_ERROR_NONE)
-               msg(LOG_GREEN "Success to set imsi" LOG_END);
+               msg(LOG_GREEN "Success to set subscriber ID" LOG_END);
        else {
-               msg("Fail to set imsi " LOG_RED "[%s]" LOG_END,
+               msg("Fail to set subscriber ID " LOG_RED "[%s]" LOG_END,
                        test_stc_convert_error_type_to_string(ret));
                return ret;
        }
@@ -182,10 +182,10 @@ static int __test_stc_set_reset_rule(MManager *mm, struct menu_data *menu)
                g_free(app_id);
        }
 
-       ret = stc_reset_rule_get_imsi(g_reset_rule, &imsi);
+       ret = stc_reset_rule_get_subscriber_id(g_reset_rule, &subscriber_id);
        if (ret == STC_ERROR_NONE) {
-               msg("Imsi:        " LOG_CYAN "[%s]" LOG_END, imsi);
-               g_free(imsi);
+               msg("Sub_id:      " LOG_CYAN "[%s]" LOG_END, subscriber_id);
+               g_free(subscriber_id);
        }
 
        ret = stc_reset_rule_get_iface_type(g_reset_rule, &iface_type);
@@ -447,7 +447,7 @@ int test_stc_stats_rule_destroy(void)
 
 static struct menu_data menu_reset_rule[] = {
        { "1", "Application ID", NULL, NULL, g_reset_app_id},
-       { "2", "Imsi", NULL, NULL, g_reset_imsi},
+       { "2", "Subscriber ID", NULL, NULL, g_reset_subscriber_id},
        { "3", "Interface type (1.Tel/2.Wifi/3.Wired/4.BT/5.All)", NULL, NULL, g_reset_iface_type},
        { "s", LOG_LIGHTMAGENTA "[Set]" LOG_END, NULL, __test_stc_set_reset_rule, NULL},
        { NULL, NULL, },
index fbe3d46..63ab417 100755 (executable)
@@ -43,7 +43,7 @@
 
 #define STC_APP_ID_LEN 128
 #define STC_IFNAME_LEN 16
-#define STC_IMSI_LEN 64
+#define STC_SUBSCRIBER_ID_LEN 128
 
 extern struct menu_data menu_statistics[];
 extern struct menu_data menu_restriction[];