* @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()
* @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()
* @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()
*/
* @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()
* @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()
* @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()
* @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()
* @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()
* @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()
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
* @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.
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
* @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.
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
* @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.
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
* @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
* @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.
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
* @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.
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
#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"
#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 */
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;
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;
#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;
#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"
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;
*****************************************************************************/
#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) { \
}
//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;
}
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;
}
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;
}
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;
}
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) {
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);
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;
}
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;
}
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)
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,
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 =
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));
"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;
}
"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;
}
"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;
}
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);
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;
}
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;
}
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;
}
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
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);
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";
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;
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)
g_free(app_id);
g_free(iface_name);
- g_free(imsi);
+ g_free(subscriber_id);
return STC_CALLBACK_CONTINUE;
}
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;
}
}
- 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;
}
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);
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},
#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] = "";
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;
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)
g_free(app_id);
g_free(iface_name);
- g_free(imsi);
+ g_free(subscriber_id);
return STC_CALLBACK_CONTINUE;
}
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)
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;
}
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);
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, },
#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[];