Fix module circular dependency 60/188060/1 accepted/tizen/unified/20180905.060822 submit/tizen/20180831.123807 submit/tizen/20180903.055755 submit/tizen/20180904.101926
authorhyunuktak <hyunuk.tak@samsung.com>
Fri, 31 Aug 2018 01:33:02 +0000 (10:33 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Fri, 31 Aug 2018 01:33:04 +0000 (10:33 +0900)
Change-Id: I3adf1aa62e2ad88a415766e3913843d20ec18b8a
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
12 files changed:
include/stc-iptables-error.h [new file with mode: 0755]
include/stc-iptables-gdbus.h
include/stc-iptables-util.h
include/stc-iptables.h
packaging/stc-iptables.spec
src/helper/helper-ip6tables.c
src/helper/helper-iptables.c
src/helper/helper-log.c [moved from src/stc-iptables-log.c with 95% similarity]
src/helper/helper-log.h [moved from include/stc-iptables-log.h with 74% similarity]
src/stc-iptables-gdbus.c
src/stc-iptables-util.c
src/stc-iptables.c

diff --git a/include/stc-iptables-error.h b/include/stc-iptables-error.h
new file mode 100755 (executable)
index 0000000..42ba0f8
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ *  Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __STC_IPTABLES_ERROR_H__
+#define __STC_IPTABLES_ERROR_H__
+
+typedef enum {
+       STC_ERROR_OPERATION_FAILED = -6,   /**< Operation failed */
+       STC_ERROR_INVALID_PARAMETER = -5,  /**< Invalid function parameter */
+       STC_ERROR_INVALID_OPERATION = -4,  /**< Invalid operation */
+       STC_ERROR_PERMISSION_DENIED = -3,  /**< Permission denied */
+       STC_ERROR_OUT_OF_MEMORY = -2,      /**< Out of memory */
+       STC_ERROR_NOT_PERMITTED = -1,      /**< Operation not permitted */
+       STC_ERROR_NONE = 0                 /**< Successful */
+} stc_error_e;
+
+#endif /* __STC_IPTABLES_ERROR_H__ */
index 221ecd3..37afb06 100755 (executable)
@@ -20,7 +20,6 @@
 
 #include <glib.h>
 
-#include "stc-iptables-util.h"
 #include "generated-code.h"
 
 #define STC_IPTABLES_DBUS_SERVICE               "net.stc.iptables"
index b79f86c..41d929d 100755 (executable)
@@ -22,8 +22,8 @@
 #include <gio/gio.h>
 #include <stdio.h>
 
-#include "stc-iptables-log.h"
 #include "stc-iptables-gdbus.h"
+#include "helper-log.h"
 
 #define MALLOC0(t, n) ((t*) g_try_malloc0((n) * sizeof(t)))
 #define FREE(p) do { \
                        } \
                } while (0)
 
-typedef enum {
-       STC_ERROR_OPERATION_FAILED = -6,   /**< Operation failed */
-       STC_ERROR_INVALID_PARAMETER = -5,  /**< Invalid function parameter */
-       STC_ERROR_INVALID_OPERATION = -4,  /**< Invalid operation */
-       STC_ERROR_PERMISSION_DENIED = -3,  /**< Permission denied */
-       STC_ERROR_OUT_OF_MEMORY = -2,      /**< Out of memory */
-       STC_ERROR_NOT_PERMITTED = -1,      /**< Operation not permitted */
-       STC_ERROR_NONE = 0                 /**< Successful */
-} stc_error_e;
-
 gboolean handle_iptables_stop(StcManager *object,
                                   GDBusMethodInvocation *invocation);
 
index a7d55a5..b2ce018 100755 (executable)
@@ -21,8 +21,7 @@
 #include <glib.h>
 #include <gio/gio.h>
 
-#include "stc-iptables-log.h"
-#include "stc-iptables-util.h"
+#include "stc-iptables-error.h"
 
 typedef struct {
        GMainLoop *main_loop;
index d0e83a6..1275237 100644 (file)
@@ -1,6 +1,6 @@
 Name:       stc-iptables
 Summary:    STC(Smart Traffic Control) iptables
-Version:    0.0.20
+Version:    0.0.21
 Release:    0
 Group:      Network & Connectivity/Other
 License:    GPL-2.0 and Apache-2.0
index 352bca7..35e6269 100755 (executable)
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
+#include <glib.h>
 #include <arpa/inet.h>
 #include <xtables.h>
 
@@ -28,8 +29,9 @@
 #include <linux/netfilter/xt_NFLOG.h>
 #include <linux/netfilter_ipv6/ip6t_LOG.h>
 
+#include "stc-iptables-error.h"
 #include "helper-ip6tables.h"
-#include "stc-iptables-util.h"
+#include "helper-log.h"
 
 #define IP6T_ALIGN    XT_ALIGN
 #define IP6TC_TABLE   "filter"
index 7fd5a73..e43cc0d 100755 (executable)
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
+#include <glib.h>
 #include <arpa/inet.h>
 
 #include <linux/netfilter.h>
@@ -27,8 +28,9 @@
 #include <linux/netfilter/xt_NFLOG.h>
 #include <linux/netfilter_ipv4/ipt_LOG.h>
 
+#include "stc-iptables-error.h"
 #include "helper-iptables.h"
-#include "stc-iptables-util.h"
+#include "helper-log.h"
 
 #define IPT_ALIGN    XT_ALIGN
 #define IPTC_TABLE   "filter"
similarity index 95%
rename from src/stc-iptables-log.c
rename to src/helper/helper-log.c
index bb07f7c..b745a10 100755 (executable)
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include <sys/stat.h>
 
-#include "stc-iptables-log.h"
+#include "helper-log.h"
 
 #define LOG_FILE_PATH   "/opt/usr/data/network/stc-iptables.log"
 #define MAX_LOG_SIZE    1 * 1024 * 1024
@@ -86,7 +86,7 @@ static void __stc_iptables_log_get_local_time(char *strtime, const int size)
                strftime(strtime, size, "%m/%d %H:%M:%S", local_ptm);
 }
 
-void stc_iptables_log(const char *format, ...)
+void helper_log(const char *format, ...)
 {
        va_list ap;
        int log_size = 0;
@@ -129,7 +129,7 @@ void stc_iptables_log(const char *format, ...)
        va_end(ap);
 }
 
-gboolean stc_iptables_log_sync(gpointer data)
+gboolean helper_log_sync(gpointer data)
 {
        if (log_file) {
                fflush(log_file);
@@ -144,7 +144,7 @@ gboolean stc_iptables_log_sync(gpointer data)
        return TRUE;
 }
 
-void stc_iptables_log_cleanup(void)
+void helper_log_cleanup(void)
 {
        if (log_file == NULL)
                return;
similarity index 74%
rename from include/stc-iptables-log.h
rename to src/helper/helper-log.h
index 80f3866..5599ae8 100755 (executable)
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef __STC_IPTABLES_LOG_H__
-#define __STC_IPTABLES_LOG_H__
+#ifndef __STC_HELPER_LOG_H__
+#define __STC_HELPER_LOG_H__
 
-void stc_iptables_log(const char *format, ...);
-gboolean stc_iptables_log_sync(gpointer data);
-void stc_iptables_log_cleanup(void);
+void helper_log(const char *format, ...);
+gboolean helper_log_sync(gpointer data);
+void helper_log_cleanup(void);
 
 #define __LOG(level, format, arg...) \
        do { \
-               stc_iptables_log("[%s] %s(%d) "format"\n", level, \
+               helper_log("[%s] %s(%d) "format"\n", level, \
                        __FUNCTION__, __LINE__, ##arg); \
        } while(0)
 
@@ -40,7 +40,7 @@ void stc_iptables_log_cleanup(void);
 #define STC_LOGW(format, args...) __LOG(LOG_WARN, format, ##args)
 #define STC_LOGE(format, args...) __LOG(LOG_ERROR, format, ##args)
 
-#define __STC_LOG_FUNC_ENTER__ /* __LOG(LOG_DEBUG, "Enter") */
-#define __STC_LOG_FUNC_EXIT__ /* __LOG(LOG_DEBUG, "Quit") */
+#define __LOG_FUNC_ENTER__ /* __LOG(LOG_DEBUG, "Enter") */
+#define __LOG_FUNC_EXIT__ /* __LOG(LOG_DEBUG, "Quit") */
 
-#endif /* __STC_IPTABLES_LOG_H__ */
+#endif /* __STC_HELPER_LOG_H__ */
index 7e5c219..01c1537 100755 (executable)
 
 #include "stc-iptables.h"
 #include "stc-iptables-gdbus.h"
+#include "stc-iptables-util.h"
 
 static gboolean __stc_iptables_gdbus_manager_init(stc_iptables_s *stc_iptables)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        gboolean ret = TRUE;
        gchar *s = NULL;
 
@@ -46,13 +47,13 @@ static gboolean __stc_iptables_gdbus_manager_init(stc_iptables_s *stc_iptables)
 
        stc_iptables->manager_obj = (gpointer)manager;
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return ret;
 }
 
 static gboolean __stc_iptables_gdbus_chain_init(stc_iptables_s *stc_iptables)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        gboolean ret = TRUE;
        gchar *s = NULL;
 
@@ -98,13 +99,13 @@ static gboolean __stc_iptables_gdbus_chain_init(stc_iptables_s *stc_iptables)
 
        stc_iptables->chain_obj = (gpointer)chain;
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return ret;
 }
 
 static gboolean __stc_iptables_gdbus_rule_init(stc_iptables_s *stc_iptables)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        gboolean ret = TRUE;
        gchar *s = NULL;
 
@@ -150,7 +151,7 @@ static gboolean __stc_iptables_gdbus_rule_init(stc_iptables_s *stc_iptables)
 
        stc_iptables->rule_obj = (gpointer)rule;
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return ret;
 }
 
@@ -158,7 +159,7 @@ static void __stc_iptables_gdbus_on_bus_acquired(GDBusConnection *connection,
                                                const gchar *name,
                                                gpointer user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_iptables_s* stc_iptables = (stc_iptables_s*)user_data;
 
        stc_iptables->obj_mgr = g_dbus_object_manager_server_new("/net/stc");
@@ -185,7 +186,7 @@ static void __stc_iptables_gdbus_on_bus_acquired(GDBusConnection *connection,
        g_dbus_object_manager_server_set_connection(stc_iptables->obj_mgr,
                                                    stc_iptables->connection);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
 }
 
 static void __stc_iptables_gdbus_on_name_acquired(GDBusConnection *connection,
@@ -206,7 +207,7 @@ static void __stc_iptables_gdbus_on_name_lost(GDBusConnection *connection,
 
 void stc_iptables_gdbus_init(gpointer stc_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
 
        stc_iptables_s *stc_iptables = (stc_iptables_s *)stc_data;
 
@@ -219,12 +220,12 @@ void stc_iptables_gdbus_init(gpointer stc_data)
                                             stc_iptables,
                                             NULL);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
 }
 
 void stc_iptables_gdbus_deinit(gpointer stc_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
 
        stc_iptables_s *stc_iptables = (stc_iptables_s *)stc_data;
 
@@ -234,19 +235,19 @@ void stc_iptables_gdbus_deinit(gpointer stc_data)
        stc_iptables->rule_obj = NULL;
        stc_iptables->chain_obj = NULL;
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
 }
 
 void stc_iptables_gdbus_dict_foreach(GVariantIter *iter,
                                     dbus_dict_cb cb, void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
 
        gchar *key = NULL;
        GVariant *value = NULL;
 
        if (!cb) {
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return; //LCOV_EXCL_LINE
        }
 
@@ -256,5 +257,5 @@ void stc_iptables_gdbus_dict_foreach(GVariantIter *iter,
                        cb(key, value, user_data);
        }
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
 }
index 69ee885..8d57f4b 100755 (executable)
@@ -21,6 +21,7 @@
 #include "stc-iptables-util.h"
 #include "helper-iptables.h"
 #include "helper-ip6tables.h"
+#include "helper-log.h"
 
 #define BUF_SIZE_FOR_IP 64
 
@@ -431,7 +432,7 @@ static void __free_6_rule(ip6tables_rule_s *rule)
 gboolean handle_iptables_stop(StcManager *object,
                                   GDBusMethodInvocation *invocation)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        GVariant *return_parameters = NULL;
 
        STC_LOGI("stc manager stop");
@@ -443,7 +444,7 @@ gboolean handle_iptables_stop(StcManager *object,
 
        stc_stop_iptables();
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -452,7 +453,7 @@ gboolean handle_iptables_add_rule(StcRule *object,
                               GVariant *rules,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
@@ -480,7 +481,7 @@ gboolean handle_iptables_add_rule(StcRule *object,
                                g_variant_iter_free(iter);
 
                                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret);
-                               __STC_LOG_FUNC_EXIT__;
+                               __LOG_FUNC_EXIT__;
                                return TRUE;
                                 //LCOV_EXCL_STOP
                        }
@@ -492,7 +493,7 @@ gboolean handle_iptables_add_rule(StcRule *object,
        } else {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
                                              STC_ERROR_INVALID_PARAMETER);
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -501,7 +502,7 @@ gboolean handle_iptables_add_rule(StcRule *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -510,7 +511,7 @@ gboolean handle_iptables_insert_rule(StcRule *object,
                               GVariant *rules,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
@@ -538,7 +539,7 @@ gboolean handle_iptables_insert_rule(StcRule *object,
                                g_variant_iter_free(iter);
 
                                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret);
-                               __STC_LOG_FUNC_EXIT__;
+                               __LOG_FUNC_EXIT__;
                                return TRUE;
                                 //LCOV_EXCL_STOP
                        }
@@ -550,7 +551,7 @@ gboolean handle_iptables_insert_rule(StcRule *object,
        } else {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
                                              STC_ERROR_INVALID_PARAMETER);
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -559,7 +560,7 @@ gboolean handle_iptables_insert_rule(StcRule *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -568,7 +569,7 @@ gboolean handle_iptables_remove_rule(StcRule *object,
                               GVariant *rules,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
@@ -595,7 +596,7 @@ gboolean handle_iptables_remove_rule(StcRule *object,
                                g_variant_iter_free(iter);
 
                                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret);
-                               __STC_LOG_FUNC_EXIT__;
+                               __LOG_FUNC_EXIT__;
                                return TRUE;
                                 //LCOV_EXCL_STOP
                        }
@@ -607,7 +608,7 @@ gboolean handle_iptables_remove_rule(StcRule *object,
        } else {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
                                              STC_ERROR_INVALID_PARAMETER);
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -616,7 +617,7 @@ gboolean handle_iptables_remove_rule(StcRule *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -625,14 +626,14 @@ gboolean handle_iptables_add_chain(StcChain *object,
                                   const gchar *chain,
                                   void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
        ret = iptables_add_chain(chain);
        if (ret < STC_ERROR_NONE) {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -641,7 +642,7 @@ gboolean handle_iptables_add_chain(StcChain *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -650,14 +651,14 @@ gboolean handle_iptables_remove_chain(StcChain *object,
                               const gchar *chain,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
        ret = iptables_remove_chain(chain);
        if (ret < STC_ERROR_NONE) {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -666,7 +667,7 @@ gboolean handle_iptables_remove_chain(StcChain *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -675,14 +676,14 @@ gboolean handle_iptables_flush_chain(StcChain *object,
                               const gchar *chain,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
        ret = iptables_flush_chain(chain);
        if (ret < STC_ERROR_NONE) {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -691,7 +692,7 @@ gboolean handle_iptables_flush_chain(StcChain *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -700,7 +701,7 @@ gboolean handle_ip6tables_add_rule(StcRule *object,
                               GVariant *rules,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
@@ -728,7 +729,7 @@ gboolean handle_ip6tables_add_rule(StcRule *object,
                                g_variant_iter_free(iter);
 
                                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret);
-                               __STC_LOG_FUNC_EXIT__;
+                               __LOG_FUNC_EXIT__;
                                return TRUE;
                                 //LCOV_EXCL_STOP
                        }
@@ -740,7 +741,7 @@ gboolean handle_ip6tables_add_rule(StcRule *object,
        } else {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
                                              STC_ERROR_INVALID_PARAMETER);
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -749,7 +750,7 @@ gboolean handle_ip6tables_add_rule(StcRule *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -758,7 +759,7 @@ gboolean handle_ip6tables_insert_rule(StcRule *object,
                               GVariant *rules,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
@@ -786,7 +787,7 @@ gboolean handle_ip6tables_insert_rule(StcRule *object,
                                g_variant_iter_free(iter);
 
                                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret);
-                               __STC_LOG_FUNC_EXIT__;
+                               __LOG_FUNC_EXIT__;
                                return TRUE;
                                 //LCOV_EXCL_STOP
                        }
@@ -798,7 +799,7 @@ gboolean handle_ip6tables_insert_rule(StcRule *object,
        } else {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
                                              STC_ERROR_INVALID_PARAMETER);
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -807,7 +808,7 @@ gboolean handle_ip6tables_insert_rule(StcRule *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -816,7 +817,7 @@ gboolean handle_ip6tables_remove_rule(StcRule *object,
                               GVariant *rules,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
@@ -843,7 +844,7 @@ gboolean handle_ip6tables_remove_rule(StcRule *object,
                                g_variant_iter_free(iter);
 
                                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret);
-                               __STC_LOG_FUNC_EXIT__;
+                               __LOG_FUNC_EXIT__;
                                return TRUE;
                                 //LCOV_EXCL_STOP
                        }
@@ -855,7 +856,7 @@ gboolean handle_ip6tables_remove_rule(StcRule *object,
        } else {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, //LCOV_EXCL_LINE
                                              STC_ERROR_INVALID_PARAMETER);
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -864,7 +865,7 @@ gboolean handle_ip6tables_remove_rule(StcRule *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -873,14 +874,14 @@ gboolean handle_ip6tables_add_chain(StcChain *object,
                               const gchar *chain,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
        ret = ip6tables_add_chain(chain);
        if (ret < STC_ERROR_NONE) {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -889,7 +890,7 @@ gboolean handle_ip6tables_add_chain(StcChain *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -898,14 +899,14 @@ gboolean handle_ip6tables_remove_chain(StcChain *object,
                               const gchar *chain,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
        ret = ip6tables_remove_chain(chain);
        if (ret < STC_ERROR_NONE) {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -914,7 +915,7 @@ gboolean handle_ip6tables_remove_chain(StcChain *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
 
@@ -923,14 +924,14 @@ gboolean handle_ip6tables_flush_chain(StcChain *object,
                               const gchar *chain,
                               void *user_data)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_error_e ret = STC_ERROR_NONE;
        GVariant *return_parameters = NULL;
 
        ret = ip6tables_flush_chain(chain);
        if (ret < STC_ERROR_NONE) {
                STC_IPTABLES_DBUS_REPLY_ERROR(invocation, ret); //LCOV_EXCL_LINE
-               __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+               __LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
                return TRUE; //LCOV_EXCL_LINE
        }
 
@@ -939,6 +940,6 @@ gboolean handle_ip6tables_flush_chain(StcChain *object,
        STC_DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
        STC_IPTABLES_DBUS_REPLY(invocation, return_parameters);
 
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return TRUE;
 }
index 32fd285..b93621b 100755 (executable)
 #include "stc-iptables.h"
 #include "stc-iptables-util.h"
 #include "stc-iptables-gdbus.h"
-#include "helper-iptables.h"
+#include "helper-log.h"
 
 static stc_iptables_s *g_stc_iptables = NULL;
 
 static void __stc_iptables_deinit(void)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
 
        if (!g_stc_iptables) {
                STC_LOGE("Memory for iptables structure is not allocated"); //LCOV_EXCL_LINE
@@ -37,12 +37,12 @@ static void __stc_iptables_deinit(void)
 
        STC_LOGI("stc iptables deinitialized");
        FREE(g_stc_iptables);
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
 }
 
 static stc_iptables_s *__stc_iptables_init(void)
 {
-       __STC_LOG_FUNC_ENTER__;
+       __LOG_FUNC_ENTER__;
        stc_iptables_s *stc_iptables;
 
        stc_iptables = MALLOC0(stc_iptables_s, 1);
@@ -55,7 +55,7 @@ static stc_iptables_s *__stc_iptables_init(void)
        stc_iptables_gdbus_init((gpointer)g_stc_iptables);
 
        STC_LOGI("stc iptables initialized");
-       __STC_LOG_FUNC_EXIT__;
+       __LOG_FUNC_EXIT__;
        return g_stc_iptables;
 }
 
@@ -80,7 +80,7 @@ gint32 main(gint32 argc, gchar *argv[])
 #endif
 
        sync_timer = g_timeout_add(LOG_SYNC_TIME,
-                                       stc_iptables_log_sync, NULL);
+                                       helper_log_sync, NULL);
 
        /* Crate the GLIB main loop */
        main_loop = g_main_loop_new(NULL, FALSE);
@@ -100,7 +100,7 @@ fail:
        if (sync_timer > 0)
                g_source_remove(sync_timer);
 
-       stc_iptables_log_cleanup();
+       helper_log_cleanup();
        __stc_iptables_deinit();
 
        if (main_loop)