#ifndef __TABLE_COUNTERS_H__
#define __TABLE_COUNTERS_H__
+#include <stdint.h>
+#include <sqlite3.h>
+#include "stc.h"
+
typedef struct {
long long int restriction_id;
long long int data_counter;
#define __TABLE_FIREWALL_H__
#include <arpa/inet.h>
+#include <sqlite3.h>
+#include "stc-firewall.h"
#include "helper-firewall.h"
typedef stc_cb_ret_e
#ifndef __TABLE_RESTRICTIONS_H__
#define __TABLE_RESTRICTIONS_H__
+#include <sqlite3.h>
+
typedef struct {
char *app_id;
char *ifname;
#ifndef __TABLE_STATISTICS_H__
#define __TABLE_STATISTICS_H__
+#include "stc-db.h"
+#include <sqlite3.h>
+
typedef struct {
char *app_id;
char *ifname;
#ifndef __STC_DB_H__
#define __STC_DB_H__
-#include "stc-manager.h"
+#include "stc.h"
#define MAX_DB_RETRY_COUNT 5
#define MAX_USLEEP_TIMEOUT 500000
#define __STC_FIREWALL_H__
#include <glib.h>
-#include "stc-manager.h"
-#include "stc-manager-gdbus.h"
+#include "stc.h"
+#include "stc-gdbus.h"
#include "table-firewall.h"
/*****************************************************************************
#ifndef __STC_MANAGER_GDBUS_H__
#define __STC_MANAGER_GDBUS_H__
-#include "stc-manager.h"
+#include "stc.h"
#include "generated-code.h"
#define STC_DBUS_SERVICE "net.stc"
#define __STC_PCAP_H__
#include <glib.h>
-#include "stc-manager.h"
-#include "stc-manager-gdbus.h"
+#include "stc.h"
+#include "stc-gdbus.h"
/*****************************************************************************
* Macros and Typedefs
#define STC_PLUGIN_APPSTATUS_FILEPATH "/usr/lib/stc-plugin-appstatus.so"
-#include "stc-plugin-appstatus.h"
+#include "stc-plugin-iface-appstatus.h"
int stc_plugin_appstatus_init(void);
int stc_plugin_appstatus_deinit(void);
#define STC_PLUGIN_EXCEPTION_FILEPATH "/usr/lib/stc-plugin-exception.so"
-#include "stc-plugin-exception.h"
+#include "stc-plugin-iface-exception.h"
int stc_plugin_exception_init(void);
int stc_plugin_exception_deinit(void);
#define STC_PLUGIN_FIREWALL_FILEPATH "/usr/lib/stc-plugin-firewall.so"
-#include "stc-plugin-firewall.h"
+#include "stc-plugin-iface-firewall.h"
int stc_plugin_firewall_init(void);
int stc_plugin_firewall_deinit(void);
#define __STC_PLUGIN_APPSTATUS_H__
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
+#include "stc.h"
typedef stc_error_e (*stc_plugin_app_state_changed_cb)(stc_cmd_type_e cmd,
pid_t pid,
#define __STC_PLUGIN_EXCEPTION_H__
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
+#include "stc.h"
typedef struct {
int (*initialize_plugin) (void);
#include <signal.h>
#include <errno.h>
-#include "stc-error.h"
-#include "stc-manager.h"
-#include "stc-manager-gdbus.h"
+#include "stc.h"
+#include "stc-gdbus.h"
typedef struct {
stc_fw_chain_target_e target;
#define __STC_PLUGIN_MONITOR_H__
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
-#include "stc-manager-util.h"
-#include "stc-plugin-monitor-context.h"
-#include "stc-plugin-monitor-app.h"
-#include "stc-plugin-monitor-proc.h"
-#include "stc-plugin-monitor-rstn.h"
+#include "stc.h"
#include "helper-nl.h"
+#include "db/table-restrictions.h"
/* 1 seconds */
#define CONTR_TIMER_INTERVAL 1
#define VCONFKEY_SETAPPL_DATA_RESTRICTION_INT "db/setting/data_restriction"
#endif
+#define MAC_ADDRESS_LEN 18
+
typedef void (*stc_manager_stop_cb)(void);
typedef struct {
+ uint32_t classid; /**< classid for a package */
+ gchar *pkg_id; /**< package id */
+ gchar *app_id; /**< application id */
+ stc_app_type_e type; /**< type of application */
+ stc_app_state_e state;
+ stc_data_counter_s data_usage;
+ stc_data_counter_s counter;
+ GHashTable *processes; /**< applications instances */
+ char mac[MAC_ADDRESS_LEN + 1]; /**< application mac address */
+} stc_app_value_s;
+
+typedef struct {
+ pid_t pid;
+ stc_app_state_e ground;
+} stc_proc_value_s;
+
+typedef struct {
int (*initialize_plugin) (stc_manager_stop_cb stop_cb);
int (*deinitialize_plugin) (void);
#define __STC_PLUGIN_PROCFS_H__
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
+#include "stc.h"
typedef struct {
int (*initialize_plugin) (void);
#include <glib.h>
#include <arpa/inet.h>
-#include "stc-error.h"
-#include "stc-manager.h"
+#include "stc.h"
#define TETHERING_SERVICE_INTERFACE "org.tizen.tethering"
#define SIGNAL_NAME_DHCP_STATUS "dhcp_status"
#define STC_PLUGIN_MONITOR_FILEPATH "/usr/lib/stc-plugin-monitor.so"
-#include "stc-plugin-monitor.h"
+#include "db/table-restrictions.h"
+#include "stc-plugin-iface-monitor.h"
int stc_plugin_monitor_init(stc_manager_stop_cb stop_cb);
int stc_plugin_monitor_deinit(void);
#define STC_PLUGIN_PCAP_FILEPATH "/usr/lib/stc-plugin-pcap.so"
-#include "stc-plugin-pcap.h"
+#include "stc-plugin-iface-pcap.h"
int stc_plugin_pcap_init(void);
int stc_plugin_pcap_deinit(void);
#define STC_PLUGIN_PROCFS_FILEPATH "/usr/lib/stc-plugin-procfs.so"
-#include "stc-plugin-procfs.h"
+#include "stc-plugin-iface-procfs.h"
int stc_plugin_procfs_init(void);
int stc_plugin_procfs_deinit(void);
#define STC_PLUGIN_TETHER_FILEPATH "/usr/lib/stc-plugin-tether.so"
-#include "stc-plugin-tether.h"
+#include "stc-plugin-iface-tether.h"
int stc_plugin_tether_init(void);
int stc_plugin_tether_deinit(void);
#define __STC_RESTRICTION_H__
#include <glib.h>
-#include "stc-manager.h"
-#include "stc-manager-gdbus.h"
-#include "table-restrictions.h"
-#include "transmission.h"
+#include "stc.h"
+#include "stc-gdbus.h"
+#include "db/table-restrictions.h"
+#include "stc-transmission.h"
/*****************************************************************************
* Macros and Typedefs
#define __STC_STATISTICS_H__
#include <glib.h>
-#include "stc-manager.h"
-#include "stc-manager-gdbus.h"
+#include "stc.h"
+#include "stc-gdbus.h"
/*****************************************************************************
* Macros and Typedefs
#define __STC_MANAGER_H__
#include "stc-error.h"
-#include "stc-manager-util.h"
+#include "stc-util.h"
#define NET_RELEASE_AGENT "/usr/bin/net-cls-release"
#define NET_CLS_SUBSYS "net_cls"
#include <sys/stat.h>
#include "stc-db.h"
+#include "db/table-statistics.h"
+#include "db/table-restrictions.h"
+#include "db/table-counters.h"
+#include "db/table-firewall.h"
#include "db-internal.h"
-#include "table-statistics.h"
-#include "table-restrictions.h"
-#include "table-counters.h"
-#include "table-firewall.h"
#define SQLITE_BUSY_TIMEOUT 500000
#include <sys/stat.h>
#include "stc-db.h"
-#include "table-statistics.h"
+#include "db/table-statistics.h"
#define VCONF_KEY_DB_ENTRIES_COUNT "db/stc-manager/datausage_timer"
#define ENTRY_SIZE 128
*/
#include "stc-db.h"
+#include "db/table-counters.h"
#include "db-internal.h"
-#include "table-counters.h"
#define DELETE_COUNTER "DELETE FROM counters WHERE restriction_id=?"
*/
#include "stc-db.h"
+#include "db/table-firewall.h"
#include "db-internal.h"
-#include "table-firewall.h"
#define BUF_SIZE_FOR_IP 64
*/
#include "stc-db.h"
+#include "db/table-restrictions.h"
#include "db-internal.h"
-#include "table-restrictions.h"
/* DELETE statements */
#define DELETE_RESTRICTIONS "DELETE FROM restrictions " \
* @file table-statistics.c
*/
+#include "stc.h"
#include "stc-db.h"
-#include "table-statistics.h"
+#include "db/table-statistics.h"
#include "db-internal.h"
/* DELETE statements */
#include <sys/mount.h>
#include <stdlib.h>
-#include "stc-manager.h"
+#include "stc.h"
#include "helper-file.h"
#define DEFAULT_CGROUP "/sys/fs/cgroup"
#include <stdlib.h>
#include <sys/stat.h>
-#include "stc-manager.h"
+#include "stc.h"
/**
* @desc write string to the file
* limitations under the License.
*/
-#include "stc-manager-gdbus.h"
+#include "stc-gdbus.h"
#include "helper-firewall.h"
#define STC_FIREWALL_DBUS_SERVICE "net.stc.iptables"
#include <arpa/inet.h>
-#include "stc-manager.h"
-#include "stc-error.h"
+#include "stc.h"
#define FIREWALL_CHAIN_TARGET_IN "INPUT"
#define FIREWALL_CHAIN_TARGET_OUT "OUTPUT"
* limitations under the License.
*/
-#include "stc-manager-gdbus.h"
+#include "stc-gdbus.h"
#include "helper-iptables.h"
#define STC_IPTABLES_DBUS_SERVICE "net.stc.iptables"
#define __STC_HELPER_IPTABLES_H__
#include <arpa/inet.h>
-#include "stc-manager.h"
-#include "stc-error.h"
+#include "stc.h"
#define STC_IN_CHAIN "STC_IN"
#define STC_OUT_CHAIN "STC_OUT"
#include <unistd.h>
#include "helper-cgroup.h"
-#include "counter.h"
+#include "stc-counter.h"
#include "stc-db.h"
#include "helper-file.h"
#include "helper-net-cls.h"
#include <glib.h>
#include <stdbool.h>
-#include "stc-manager.h"
+#include "stc.h"
#define PATH_TO_NET_CGROUP_DIR CGROUP_NETWORK
#include <unistd.h>
#include <arpa/inet.h>
-#include "counter.h"
+#include "stc-counter.h"
#include "helper-nfacct-rule.h"
#include "helper-iptables.h"
#include <linux/genetlink.h>
#include <linux/rtnetlink.h>
-#include "stc-manager.h"
+#include "stc.h"
#define NLA_BUF_MAX 65560 /*(65 * 1024) - used in tc_common,
we'll do the same */
#include <sys/stat.h>
#include <fcntl.h>
-#include "stc-error.h"
-#include "stc-manager-util.h"
+#include "stc.h"
#include "helper-procfs.h"
#define USRAPPS "/usr/apps/"
*/
#include "stc-db.h"
-#include "table-firewall.h"
-#include "helper-firewall.h"
#include "stc-firewall.h"
-#include "stc-manager-gdbus.h"
-#include "stc-manager-plugin-firewall.h"
+#include "db/table-firewall.h"
+#include "helper-firewall.h"
+#include "stc-gdbus.h"
+#include "stc-plugin-firewall.h"
#define FIREWALL_DBUS_ERROR_NAME "net.stc.firewall.Error.Failed"
* limitations under the License.
*/
-#include "stc-manager-gdbus.h"
-#include "stc-manager.h"
+#include "stc.h"
+#include "stc-gdbus.h"
+#include "helper-iptables.h"
#include "stc-statistics.h"
#include "stc-restriction.h"
#include "stc-firewall.h"
#include "stc-pcap.h"
-#include "stc-manager-util.h"
-#include "stc-manager-plugin-appstatus.h"
-#include "stc-manager-plugin-procfs.h"
-#include "stc-manager-plugin-monitor.h"
-#include "stc-manager-plugin-firewall.h"
-#include "helper-iptables.h"
+#include "stc-plugin-appstatus.h"
+#include "stc-plugin-procfs.h"
+#include "stc-plugin-monitor.h"
+#include "stc-plugin-firewall.h"
#define MANAGER_DBUS_ERROR_NAME "net.stc.manager.Error.Failed"
#include "stc-db.h"
#include "stc-pcap.h"
-#include "stc-manager-plugin-pcap.h"
+#include "stc-plugin-pcap.h"
#define PCAP_DBUS_ERROR_NAME "net.stc.pcap.Error.Failed"
#include <dlfcn.h>
-#include "stc-manager.h"
-#include "stc-manager-plugin-appstatus.h"
+#include "stc.h"
+#include "stc-plugin-appstatus.h"
static gboolean stc_plugin_enabled = FALSE;
static void *handle_plugin;
#include <dlfcn.h>
-#include "stc-manager.h"
-#include "stc-manager-plugin-exception.h"
+#include "stc.h"
+#include "stc-plugin-exception.h"
static gboolean stc_plugin_enabled = FALSE;
static void *handle_plugin;
#include <dlfcn.h>
-#include "stc-manager.h"
-#include "stc-manager-plugin-firewall.h"
+#include "stc.h"
+#include "stc-plugin-firewall.h"
static gboolean stc_plugin_enabled = FALSE;
static void *handle_plugin;
#include <dlfcn.h>
-#include "stc-manager.h"
-#include "stc-manager-plugin-monitor.h"
+#include "stc.h"
+#include "stc-plugin-monitor.h"
static gboolean stc_plugin_enabled = FALSE;
static void *handle_plugin;
#include <dlfcn.h>
-#include "stc-manager.h"
-#include "stc-manager-plugin-pcap.h"
+#include "stc.h"
+#include "stc-plugin-pcap.h"
static gboolean stc_plugin_enabled = FALSE;
static void *handle_plugin;
#include <dlfcn.h>
-#include "stc-manager.h"
-#include "stc-manager-plugin-procfs.h"
+#include "stc.h"
+#include "stc-plugin-procfs.h"
static gboolean stc_plugin_enabled = FALSE;
static void *handle_plugin;
#include <dlfcn.h>
-#include "stc-manager.h"
-#include "stc-manager-plugin-tether.h"
+#include "stc.h"
+#include "stc-plugin-tether.h"
static gboolean stc_tether_plugin_enabled = FALSE;
static void *tether_plugin_handle;
*/
#include "stc-db.h"
-#include "table-restrictions.h"
#include "stc-restriction.h"
-#include "stc-manager-gdbus.h"
-#include "stc-manager-plugin-monitor.h"
+#include "db/table-restrictions.h"
+#include "stc-gdbus.h"
+#include "stc-plugin-monitor.h"
#define RESTRICTION_DBUS_ERROR_NAME "net.stc.restriction.Error.Failed"
*/
#include "stc-db.h"
-#include "table-statistics.h"
#include "stc-statistics.h"
-#include "stc-manager-gdbus.h"
+#include "db/table-statistics.h"
+#include "stc-gdbus.h"
#define STATISTICS_DBUS_ERROR_NAME "net.stc.statistics.Error.Failed"
#include <signal.h>
#include <errno.h>
#include <sys/wait.h>
-#include "stc-manager.h"
-#include "stc-manager-gdbus.h"
+#include "stc.h"
+#include "stc-gdbus.h"
#include "stc-db.h"
-#include "counter.h"
-#include "table-restrictions.h"
+#include "stc-counter.h"
+#include "stc-util-inotify.h"
+#include "db/table-restrictions.h"
#include "helper-cgroup.h"
#include "helper-nfacct-rule.h"
#include "helper-iptables.h"
-#include "helper-inotify.h"
#include "stc-firewall.h"
-#include "stc-manager-plugin-appstatus.h"
-#include "stc-manager-plugin-exception.h"
-#include "stc-manager-plugin-procfs.h"
-#include "stc-manager-plugin-tether.h"
-#include "stc-manager-plugin-pcap.h"
-#include "stc-manager-plugin-monitor.h"
-#include "stc-manager-plugin-firewall.h"
+#include "stc-plugin-appstatus.h"
+#include "stc-plugin-exception.h"
+#include "stc-plugin-procfs.h"
+#include "stc-plugin-tether.h"
+#include "stc-plugin-pcap.h"
+#include "stc-plugin-monitor.h"
+#include "stc-plugin-firewall.h"
#define BUF_SIZE_FOR_ERR 100
#include <glib.h>
-#include "helper-inotify.h"
-#include "stc-manager-util.h"
+#include "stc-util.h"
+#include "stc-util-inotify.h"
typedef struct {
GIOChannel *channel;
* limitations under the License.
*/
-#include "stc-manager-util.h"
+#include "stc-util.h"
typedef struct {
int state;
cp res/dbus/stc-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/stc-manager.conf
mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
-cp res/dbus/net.stc-manager.service %{buildroot}%{_datadir}/dbus-1/system-services/net.stc.service
+cp res/dbus/net.stc.service %{buildroot}%{_datadir}/dbus-1/system-services/net.stc.service
#OS Upgrade
mkdir -p %{buildroot}%{upgrade_script_path}
ADD_DEFINITIONS("-DUSE_DLOG")
SET(SRCS_PLUGIN
- stc-plugin-appstatus.c
+ stcplugin-appstatus.c
)
# library build
#include <dlog.h>
#include <gio/gio.h>
-#include "stc-plugin-appstatus.h"
+#include "stc-plugin-iface-appstatus.h"
//LCOV_EXCL_START
#define AUL_APP_STATUS_DBUS_PATH "/Org/Tizen/Aul/AppStatus"
ADD_DEFINITIONS("-DUSE_DLOG")
SET(SRCS_PLUGIN
- stc-plugin-exception.c
+ stcplugin-exception.c
)
# library build
#include <gio/gio.h>
#include <pkgmgr-info.h>
-#include "stc-plugin-exception.h"
+#include "stc.h"
+#include "stc-plugin-iface-exception.h"
//LCOV_EXCL_START
#define EXE_TYPE_APPLICATION "app"
ADD_DEFINITIONS("-DUSE_DLOG")
SET(SRCS_PLUGIN
- stc-plugin-firewall.c
+ stcplugin-firewall.c
)
# library build
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-#include "stc-plugin-firewall.h"
-#include "table-firewall.h"
+#include "stc.h"
+#include "stc-plugin-iface-firewall.h"
+#include "db/table-firewall.h"
#include "helper-firewall.h"
#define LOCK_NAME "admin"
ADD_DEFINITIONS("-DUSE_DLOG")
SET(SRCS_PLUGIN
- stc-plugin-monitor.c
- stc-plugin-monitor-proc.c
- stc-plugin-monitor-connection.c
- stc-plugin-monitor-rstn.c
- stc-plugin-monitor-app.c
- stc-plugin-monitor-ipt.c
- stc-plugin-monitor-time.c
+ stcplugin-monitor.c
+ stcplugin-monitor-proc.c
+ stcplugin-monitor-connection.c
+ stcplugin-monitor-rstn.c
+ stcplugin-monitor-app.c
+ stcplugin-monitor-ipt.c
+ stcplugin-monitor-time.c
)
# library build
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stcplugin-monitor-app.h"
+#include "stc.h"
#include "stc-db.h"
-#include "counter.h"
-#include "stc-manager.h"
-#include "stc-plugin-monitor.h"
-#include "stc-plugin-monitor-app.h"
-#include "stc-plugin-monitor-rstn.h"
-#include "stc-plugin-monitor-proc.h"
-#include "stc-plugin-monitor-ipt.h"
-#include "table-statistics.h"
+#include "stc-counter.h"
+#include "stc-plugin-tether.h"
+#include "db/table-statistics.h"
#include "helper-net-cls.h"
-#include "stc-manager-plugin-tether.h"
+#include "stc-plugin-iface-monitor.h"
+#include "stcplugin-monitor-rstn.h"
+#include "stcplugin-monitor-proc.h"
+#include "stcplugin-monitor-ipt.h"
static void __print_app(gpointer key, gpointer value,
gpointer data)
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
-#include "stc-plugin-monitor-context.h"
-#include "stc-plugin-monitor-connection.h"
+#include "stc.h"
+#include "stc-plugin-iface-monitor.h"
+#include "stcplugin-monitor-context.h"
+#include "stcplugin-monitor-connection.h"
-#define MAC_ADDRESS_LEN 18
#define SUBSCRIBERID_NONE "none_subid"
-typedef struct {
- uint32_t classid; /**< classid for a package */
- gchar *pkg_id; /**< package id */
- gchar *app_id; /**< application id */
- stc_app_type_e type; /**< type of application */
- stc_app_state_e state;
- stc_data_counter_s data_usage;
- stc_data_counter_s counter;
- GHashTable *processes; /**< applications instances */
- char mac[MAC_ADDRESS_LEN+1]; /**< application mac address */
-} stc_app_value_s;
-
stc_error_e stc_plugin_monitor_app_add(uint32_t classid,
const char *app_id,
#include <vconf/vconf.h>
#include <openssl/sha.h>
+#include "stc-gdbus.h"
#include "stc-firewall.h"
-#include "stc-manager-gdbus.h"
+#include "stc-plugin-firewall.h"
#include "stc-plugin-monitor.h"
-#include "stc-plugin-monitor-connection.h"
-#include "stc-manager-plugin-firewall.h"
+#include "stcplugin-monitor-connection.h"
/* connman service dbus details */
#define CONNMAN_SERVICE "net.connman"
#define __STC_PLUGIN_MONITOR_CONNECTION_H__
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
-#include "stc-manager-util.h"
+#include "stc.h"
#define IMSI_LENGTH 16
#define SHA256_DIGEST_LENGTH 32
#ifndef __STC_PLUGIN_MONITOR_CONTEXT_H__
#define __STC_PLUGIN_MONITOR_CONTEXT_H__
-#include "stc-manager.h"
+#include "stc.h"
typedef struct {
time_t now;
* limitations under the License.
*/
-#include "stc-plugin-monitor-ipt.h"
-#include "stc-plugin-monitor-context.h"
+#include "stcplugin-monitor-ipt.h"
+#include "stcplugin-monitor-context.h"
static nfacct_rule_jump __get_jump_by_intend(struct nfacct_rule *counter)
{
* limitations under the License.
*/
-#include "stc-plugin-monitor.h"
-#include "stc-plugin-monitor-proc.h"
-#include "stc-plugin-monitor-connection.h"
#include "helper-net-cls.h"
+#include "db/table-restrictions.h"
+#include "stc-plugin-iface-monitor.h"
+#include "stcplugin-monitor-proc.h"
+#include "stcplugin-monitor-app.h"
+#include "stcplugin-monitor-rstn.h"
+#include "stcplugin-monitor-connection.h"
static void __print_proc(gpointer key, gpointer value,
gpointer data)
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
-
-typedef struct {
- pid_t pid;
- stc_app_state_e ground;
-} stc_proc_value_s;
+#include "stc.h"
+#include "stc-plugin-iface-monitor.h"
typedef struct {
pid_t pid;
#include <bundle_internal.h>
#include <syspopup_caller.h>
-#include "counter.h"
-#include "stc-plugin-monitor.h"
-#include "stc-plugin-monitor-rstn.h"
-#include "stc-plugin-monitor-ipt.h"
-#include "stc-plugin-monitor-time.h"
-#include "table-counters.h"
-#include "table-restrictions.h"
-#include "table-statistics.h"
+#include "stc-counter.h"
+#include "stc-plugin-tether.h"
+#include "db/table-counters.h"
+#include "db/table-restrictions.h"
+#include "db/table-statistics.h"
#include "helper-net-cls.h"
-#include "stc-manager-plugin-tether.h"
+#include "stc-plugin-iface-monitor.h"
+#include "stcplugin-monitor-rstn.h"
+#include "stcplugin-monitor-ipt.h"
+#include "stcplugin-monitor-time.h"
static void __print_rstn(stc_rstn_data_s *rstn_data)
{
#include <glib.h>
-#include "stc-error.h"
-#include "stc-manager.h"
-#include "stc-plugin-monitor-context.h"
-#include "stc-plugin-monitor-connection.h"
+#include "stc.h"
#include "stc-restriction.h"
-#include "table-restrictions.h"
+#include "db/table-restrictions.h"
+#include "stcplugin-monitor-context.h"
+#include "stcplugin-monitor-connection.h"
#define GRANULARITY 10
#include <vconf.h>
#include <vconf-keys.h>
+#include "stc-counter.h"
#include "helper-nl.h"
#include "helper-nfacct-rule.h"
#include "helper-net-cls.h"
#include "helper-cgroup.h"
#include "helper-iptables.h"
-#include "counter.h"
-#include "table-statistics.h"
-#include "table-counters.h"
-#include "stc-plugin-monitor.h"
-#include "stc-plugin-monitor-connection.h"
-#include "stc-plugin-monitor-rstn.h"
-#include "stc-manager-plugin-exception.h"
+#include "db/table-statistics.h"
+#include "db/table-counters.h"
+#include "stc-plugin-exception.h"
+#include "stc-plugin-iface-monitor.h"
+#include "stcplugin-monitor-connection.h"
+#include "stcplugin-monitor-rstn.h"
+#include "stcplugin-monitor-context.h"
+#include "stcplugin-monitor-app.h"
+#include "stcplugin-monitor-proc.h"
+
static stc_system_s *g_system = NULL;
static stc_manager_stop_cb g_stop_cb = NULL;
stc_plugin_monitor_deinitialize,
.add_application =
stc_plugin_monitor_app_add,
- .remove_application =
- stc_plugin_monitor_app_remove,
- .lookup_application =
- stc_plugin_monitor_app_lookup,
+ .remove_application =
+ stc_plugin_monitor_app_remove,
+ .lookup_application =
+ stc_plugin_monitor_app_lookup,
.add_restriction =
stc_plugin_monitor_rstn_add,
.remove_restriction =
ADD_DEFINITIONS("-DUSE_DLOG")
SET(SRCS_PLUGIN
- stc-plugin-pcap.c
+ stcplugin-pcap.c
)
# library build
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stcplugin-pcap.h"
-#include "stc-plugin-pcap.h"
-#include "stc-plugin-pcap-internal.h"
+#include "stc-plugin-iface-pcap.h"
#define ENCAPTYPE_ETHERNET 1
#define ENCAPTYPE_NFLOG 141
#include <netinet/tcp.h>
#include <netinet/udp.h>
-#include "stc-error.h"
-#include "stc-manager.h"
+#include "stc.h"
#define BUFF_SIZE_IP 16
#define BUFF_SIZE_IP6 46
ADD_DEFINITIONS("-DUSE_DLOG")
SET(SRCS_PLUGIN
- stc-plugin-procfs.c
+ stcplugin-procfs.c
)
# library build
#include <linux/cn_proc.h>
#include <glib.h>
-#include "stc-plugin-procfs.h"
+#include "stc-plugin-iface-procfs.h"
#include "helper-net-cls.h"
#include "helper-procfs.h"
-#include "stc-manager-plugin-monitor.h"
-#include "stc-manager-plugin-exception.h"
+#include "stc-plugin-monitor.h"
+#include "stc-plugin-exception.h"
//LCOV_EXCL_START
typedef struct {
ADD_DEFINITIONS("-DUSE_DLOG")
SET(SRCS_PLUGIN
- stc-plugin-tether.c
+ stcplugin-tether.c
)
# library build
* limitations under the License.
*/
-#include <vconf/vconf.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <glib.h>
-#include "stc-plugin-tether.h"
-#include "stc-manager-plugin-monitor.h"
+#include "stc.h"
+#include "stc-plugin-monitor.h"
+#include "stc-plugin-iface-tether.h"
static GSList *station_list = NULL;
static GDBusConnection *connection = NULL;
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "stcmgr.h"
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-#include "common.h"
+#include "stctest-common.h"
GMainLoop *MainLoop::m_mainLoop = NULL;
guint MainLoop::m_timerId = 0;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stctest-firewall.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-
-#include "firewall.h"
-#include "common.h"
+#include "stctest-common.h"
static void AsyncReadyCallback(GObject *source_object,
GAsyncResult *res, gpointer user_data)
#include <glib.h>
#include <gio/gio.h>
-#include "stcmgr.h"
-#include "gdbus.h"
+#include "stctest.h"
+#include "stctest-gdbus.h"
#define FIREWALL_RULE_CHAIN "chain"
#define FIREWALL_RULE_DIRECTION "direction"
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stctest-gdbus.h"
#include <stdio.h>
#include <stdlib.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-#include "gdbus.h"
-
GDbus::GDbus()
{
this->m_pConnection = NULL;
#include <glib.h>
#include <gio/gio.h>
-#include "stcmgr.h"
+#include "stctest.h"
#define GMAINTIMEOUT 10000
#define DBUS_REPLY_TIMEOUT (120 * 1000)
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stctest-main.h"
#include <stdio.h>
#include <stdlib.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <unistd.h>
-
-#include "unittest.h"
-#include "restriction.h"
-#include "statistics.h"
-#include "manager.h"
-#include "stc-manager.h"
-#include "firewall.h"
+#include "stc.h"
+#include "stctest-restriction.h"
+#include "stctest-statistics.h"
+#include "stctest-manager.h"
+#include "stctest-firewall.h"
#define GTEST_MAC "1:c:e:b:00:da"
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stctest-manager.h"
#include <stdio.h>
#include <stdlib.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-#include "manager.h"
-
Manager::Manager()
{
Create();
#ifndef __STC_MGR_MANAGER_H__
#define __STC_MGR_MANAGER_H__
-#include "stcmgr.h"
-#include "gdbus.h"
+#include "stctest.h"
+#include "stctest-gdbus.h"
class Manager : public GDbus {
private:
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stctest-restriction.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-
-#include "restriction.h"
-#include "common.h"
+#include "stctest-common.h"
static void AsyncReadyCallback(GObject *source_object,
GAsyncResult *res, gpointer user_data)
#include <glib.h>
#include <gio/gio.h>
-#include "stcmgr.h"
-#include "gdbus.h"
+#include "stctest.h"
+#include "stctest-gdbus.h"
#define RESTRICTION_RULE_APP_ID "app_id"
#define RESTRICTION_RULE_IFNAME "ifname"
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stctest-statistics.h"
#include <stdio.h>
#include <stdlib.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-#include "statistics.h"
-#include "common.h"
+#include "stctest-common.h"
static void AsyncReadyCallback(GObject *source_object,
GAsyncResult *res, gpointer user_data)
#ifndef __STC_MGR_STATISTICS_H__
#define __STC_MGR_STATISTICS_H__
-#include "stcmgr.h"
-#include "gdbus.h"
+#include "stctest.h"
+#include "stctest-gdbus.h"
#define STATISTICS_RULE_APP_ID "app_id"
#define STATISTICS_RULE_INTERVAL_FROM "from"