Name: capi-network-stc
Summary: A Smart Traffic Control (STC) libraries in Native API
-Version: 0.0.38
+Version: 0.0.39
Release: 1
Group: Network & Connectivity/API
License: Apache-2.0
stc_handle->dbus_connection.connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (stc_handle->dbus_connection.connection == NULL) {
- if (err != NULL) {
+ if (err != NULL) { //LCOV_EXCL_LINE
STC_LOGE("Failed to connect to the D-BUS daemon [%s]", err->message); //LCOV_EXCL_LINE
g_error_free(err); //LCOV_EXCL_LINE
}
GVariant *value = NULL;
if (!cb)
- return;
+ return; //LCOV_EXCL_LINE
while (g_variant_iter_loop(iter, "{sv}", &key, &value)) {
/* STC_DEBUG_GDBUS_KEY_VALUE(key, value); */
&error);
if (reply == NULL) {
- if (error != NULL) {
+ if (error != NULL) { //LCOV_EXCL_LINE
STC_LOGE("g_dbus_connection_call_sync() failed " //LCOV_EXCL_LINE
"error [%d: %s]", error->code, error->message);
*dbus_error = _stc_convert_error_string_to_enum(error->message); //LCOV_EXCL_LINE
g_slist_free_full(info_data, g_free);
} else {
- ((stc_stats_info_cb)user_callback)(error, NULL, NULL);
+ ((stc_stats_info_cb)user_callback)(error, NULL, NULL); //LCOV_EXCL_LINE
}
} else {
- ((stc_stats_info_cb)user_callback)(error, NULL, NULL);
+ ((stc_stats_info_cb)user_callback)(error, NULL, NULL); //LCOV_EXCL_LINE
}
break;
case STC_EVENT_STATS_GET_ALL_RSP:
g_slist_free_full(info_data, g_free);
} else {
- ((stc_get_all_stats_finished_cb)user_callback)(error, NULL, NULL);
+ ((stc_get_all_stats_finished_cb)user_callback)(error, NULL, NULL); //LCOV_EXCL_LINE
}
} else {
- ((stc_get_all_stats_finished_cb)user_callback)(error, NULL, NULL);
+ ((stc_get_all_stats_finished_cb)user_callback)(error, NULL, NULL); //LCOV_EXCL_LINE
}
break;
+ //LCOV_EXCL_START
case STC_EVENT_RESTRICTION_GET_RSP:
case STC_EVENT_RESTRICTION_GET_ALL_RSP:
if (error == STC_ERROR_NONE) {
g_free(info_data);
}
break;
+ //LCOV_EXCL_STOP
default:
break;
}
handle->stats_total_user_data = NULL;
}
break;
+ //LCOV_EXCL_START
case STC_EVENT_RESTRICTION_GET_RSP:
if (handle->restriction_cb) {
__stc_call_callback(event_info->event, event_info->error,
handle->pcap_info_user_data = NULL;
}
break;
- //LCOV_EXCL_START
case STC_EVENT_WARN_THRESHOLD_CROSSED_RSP:
if (handle->warn_crossed_cb) {
__stc_call_callback(event_info->event, STC_ERROR_NONE,
stc_stats_info_s *stats_info = MALLOC0(stc_stats_info_s, 1);
if (!stats_info) {
- STC_LOGE("Memory allocation failed");
- return STC_ERROR_OUT_OF_MEMORY;
+ STC_LOGE("Memory allocation failed"); //LCOV_EXCL_LINE
+ return STC_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
stc_stats_info_s *origin_info = (stc_stats_info_s *)info;
if (info_cb == NULL) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Invalid stats rule [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Failed to request stats info [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
if (info_cb == NULL) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Invalid stats rule [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Failed to request stats all info [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
if (finished_cb == NULL) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Invalid stats rule [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Failed to request stats all info [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
if (info_cb == NULL) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Failed to get all stats info [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
- return ret;
+ STC_UNLOCK; //LCOV_EXCL_LINE
+ return ret; //LCOV_EXCL_LINE
}
STC_UNLOCK;
if (info_cb == NULL) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Invalid stats rule [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Failed to request stats total info [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}
g_variant_new_uint64(stats_rule->interval.to));
if (stats_rule->iface_type != STC_IFACE_UNKNOWN) {
- g_variant_builder_add(builder, "{sv}",
+ g_variant_builder_add(builder, "{sv}", //LCOV_EXCL_LINE
STC_STATS_RULE_IFTYPE,
g_variant_new_uint16(stats_rule->iface_type));
}
if (stats_rule->time_period != STC_TIME_PERIOD_UNKNOWN) {
- g_variant_builder_add(builder, "{sv}",
+ g_variant_builder_add(builder, "{sv}", //LCOV_EXCL_LINE
STC_STATS_RULE_TIME_PERIOD,
g_variant_new_int32(stats_rule->time_period));
}
g_variant_new_uint64(stats_rule->interval.to));
if (stats_rule->iface_type != STC_IFACE_UNKNOWN) {
- g_variant_builder_add(builder, "{sv}",
+ g_variant_builder_add(builder, "{sv}", //LCOV_EXCL_LINE
STC_STATS_RULE_IFTYPE,
g_variant_new_uint16(stats_rule->iface_type));
}
if (stats_rule->time_period != STC_TIME_PERIOD_UNKNOWN) {
- g_variant_builder_add(builder, "{sv}",
+ g_variant_builder_add(builder, "{sv}", //LCOV_EXCL_LINE
STC_STATS_RULE_TIME_PERIOD,
g_variant_new_int32(stats_rule->time_period));
}
conn = G_DBUS_CONNECTION(source_object);
dbus_data = g_dbus_connection_call_finish(conn, res, &dbus_error);
if (dbus_error != NULL) {
- error = _stc_convert_error_string_to_enum(dbus_error->message);
- g_error_free(dbus_error);
+ error = _stc_convert_error_string_to_enum(dbus_error->message); //LCOV_EXCL_LINE
+ g_error_free(dbus_error); //LCOV_EXCL_LINE
}
if (_stc_event_get_request_table_state(STC_REQUEST_TABLE_STATS_FOREACH))
conn = G_DBUS_CONNECTION(source_object);
dbus_data = g_dbus_connection_call_finish(conn, res, &dbus_error);
if (dbus_error != NULL) {
- error = _stc_convert_error_string_to_enum(dbus_error->message);
- g_error_free(dbus_error);
+ error = _stc_convert_error_string_to_enum(dbus_error->message); //LCOV_EXCL_LINE
+ g_error_free(dbus_error); //LCOV_EXCL_LINE
}
if (_stc_event_get_request_table_state(STC_REQUEST_TABLE_STATS_GET_ALL))
GSList *stats_list = (GSList *)info;
if (g_slist_length(stats_list) == 0) {
- STC_LOGD("There is no stats info");
- return STC_ERROR_NONE;
+ STC_LOGD("There is no stats info"); //LCOV_EXCL_LINE
+ return STC_ERROR_NONE; //LCOV_EXCL_LINE
}
for (list = stats_list; list; list = list->next) {
if (rule == NULL) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
stc_stats_rule_s *stats_rule = g_try_malloc0(sizeof(stc_stats_rule_s));
if (stats_rule == NULL) {
STC_LOGE("Memory allocation failed"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
if (from < 0 || to < 0) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
break;
default:
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
break;
default:
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
}
if (app_id == NULL) {
- STC_LOGE("Invalid parameter");
- STC_UNLOCK;
- return STC_ERROR_INVALID_PARAMETER;
+ STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
+ STC_UNLOCK; //LCOV_EXCL_LINE
+ return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
stc_stats_rule_s *stats_rule = (stc_stats_rule_s *)rule;
*app_id = g_strdup(stats_rule->app_id);
if (*app_id == NULL) {
- STC_UNLOCK;
- return STC_ERROR_OUT_OF_MEMORY;
+ STC_UNLOCK; //LCOV_EXCL_LINE
+ return STC_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
STC_LOGI("App id [%s]", *app_id);
if (stc == NULL) {
STC_LOGE("Invalid parameter"); //LCOV_EXCL_LINE
- STC_UNLOCK;
+ STC_UNLOCK; //LCOV_EXCL_LINE
return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
if (ret != STC_ERROR_NONE) {
STC_LOGE("Init failed [%s]", //LCOV_EXCL_LINE
_stc_convert_error_type_to_string(ret));
- FREE(*stc);
- *stc = NULL;
- STC_UNLOCK;
+ FREE(*stc); //LCOV_EXCL_LINE
+ *stc = NULL; //LCOV_EXCL_LINE
+ STC_UNLOCK; //LCOV_EXCL_LINE
return ret; //LCOV_EXCL_LINE
}