Merge "Fix to delete iptables rule while unsetting restrictions" into tizen submit/tizen/20200520.034654
authorhyunuk tak <hyunuk.tak@samsung.com>
Wed, 20 May 2020 03:46:26 +0000 (03:46 +0000)
committerGerrit Code Review <gerrit@review>
Wed, 20 May 2020 03:46:26 +0000 (03:46 +0000)
packaging/stc-manager.spec
src/database/tables/table-statistics.c
src/stc-statistics.c

index f96b7cf..6a86074 100644 (file)
@@ -1,6 +1,6 @@
 Name:       stc-manager
 Summary:    STC(Smart Traffic Control) manager
-Version:    0.0.98
+Version:    0.0.99
 Release:    0
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index b631d47..2bfff70 100755 (executable)
 
 #define SELECT_CHUNKS_APP "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics " \
-       "group by iftype, ifname, time_stamp, hw_net_protocol_type, is_roaming  " \
-       "order by time_stamp, iftype, ifname, hw_net_protocol_type, is_roaming"
+       "group by iftype, ifname, timestamp, hw_net_protocol_type, is_roaming  " \
+       "order by timestamp, iftype, ifname, hw_net_protocol_type, is_roaming"
 
 #define SELECT_CHUNKS_APP_IFACE "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics where time_stamp between ? and ? and binpath = ? " \
        "and iftype = ? " \
-       "group by time_stamp, hw_net_protocol_type, is_roaming, " \
+       "group by timestamp, hw_net_protocol_type, is_roaming, " \
        "iftype, ifname, subscriber_id " \
-       "order by time_stamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
+       "order by timestamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
        "is_roaming"
 
 #define SELECT_TOTAL "select iftype, hw_net_protocol_type, " \
 
 #define SELECT_CHUNKS_TOTAL "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics where time_stamp between ? and ? " \
        "and binpath NOT LIKE 'TOTAL_%' " \
-       "group by time_stamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
+       "group by timestamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
        "is_roaming " \
-       "order by time_stamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
+       "order by timestamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
        "is_roaming"
 
 #define SELECT_CHUNKS_TOTAL_IFACE "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics where time_stamp between ? and ? " \
        "and iftype = ? " \
        "and binpath NOT LIKE 'TOTAL_%' " \
-       "group by time_stamp, hw_net_protocol_type, is_roaming, iftype, ifname, subscriber_id " \
-       "order by time_stamp, hw_net_protocol_type, is_roaming, iftype, " \
+       "group by timestamp, hw_net_protocol_type, is_roaming, iftype, ifname, subscriber_id " \
+       "order by timestamp, hw_net_protocol_type, is_roaming, iftype, " \
        "ifname, subscriber_id"
 
 /* INSERT statement */
index a0b5a07..0e26464 100755 (executable)
@@ -39,19 +39,6 @@ static const gchar *stc_err_strs[] = {
        "NOTIMPL"
 };
 
-void __stc_statistics_print_app_info(const table_statistics_info *info)
-{
-       if (!info)
-               return;
-
-       STC_LOGD("========== App data (Statistics) ==========");
-       STC_LOGD("app_id   : [%s]", info->app_id ? info->app_id : "NULL");
-       STC_LOGD("ifname   : [%s]", info->ifname ? info->ifname : "NULL");
-       STC_LOGD("Sent     : [%lld] bytes", info->cnt.out_bytes);
-       STC_LOGD("Received : [%lld] bytes", info->cnt.in_bytes);
-       STC_LOGD("===========================================");
-}
-
 void __stc_extract_select_rule(const char *key, GVariant *value,
                               void *user_data)
 {
@@ -213,7 +200,6 @@ stc_cb_ret_e __table_statistics_foreach_app_cb(const table_statistics_info *info
 
        g_variant_builder_init(&sub_builder, G_VARIANT_TYPE("a{sv}"));
        __stc_statistics_app_info_builder_add(&sub_builder, info);
-       __stc_statistics_print_app_info(info);
        g_variant_builder_add_value(builder,
                                    g_variant_builder_end(&sub_builder));
 
@@ -235,7 +221,6 @@ stc_cb_ret_e __table_statistics_per_app_cb(const table_statistics_info *info,
 
        g_variant_builder_init(&sub_builder, G_VARIANT_TYPE("a{sv}"));
        __stc_statistics_app_info_builder_add(&sub_builder, info);
-       __stc_statistics_print_app_info(info);
        g_variant_builder_add_value(builder,
                                    g_variant_builder_end(&sub_builder));