X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fstc-manager.h;h=9496953a87e41f942c8d1c75408a1455995a4c07;hb=d9eb4be3e43b3e43c2d3d029cadbd4af7af409bf;hp=f2b9c97a077cb90145be5266cd4e438e66cfa903;hpb=3292a32e4d3621fc117920f5a4aa40c547a980fd;p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git diff --git a/include/stc-manager.h b/include/stc-manager.h old mode 100755 new mode 100644 index f2b9c97..9496953 --- a/include/stc-manager.h +++ b/include/stc-manager.h @@ -24,12 +24,20 @@ #define NET_CLS_SUBSYS "net_cls" #define STC_BACKGROUND_APP_SUFFIX "_BACKGROUND" +#define STC_TETHERING_APP_SUFFIX "_TETHERING" #define STC_BACKGROUND_APP_ID "BACKGROUND" #define STC_TOTAL_DATACALL "TOTAL_DATACALL" #define STC_TOTAL_WIFI "TOTAL_WIFI" #define STC_TOTAL_BLUETOOTH "TOTAL_BLUETOOTH" #define STC_TOTAL_IPV4 "TOTAL_IPV4" #define STC_TOTAL_IPV6 "TOTAL_IPV6" +#define STC_TOTAL_TETHERING "TOTAL_TETHERING" + +#define STC_IPTABLES "/usr/sbin/iptables" +#define STC_IP6TABLES "/usr/sbin/ip6tables" + +#define STC_CMD_INSERT "-I" +#define STC_CMD_SIZE 256 #define STC_DEBUG_LOG (stc_util_get_debuglog()) @@ -48,6 +56,59 @@ typedef enum { STC_CMD_MAX_ELEM } stc_cmd_type_e; +typedef enum { + STC_FW_DIRECTION_NONE, + STC_FW_DIRECTION_IN, + STC_FW_DIRECTION_OUT +} stc_fw_direction_e; + +typedef enum { + STC_FW_FAMILY_NONE, + STC_FW_FAMILY_V4, + STC_FW_FAMILY_V6 +} stc_fw_family_type_e; + +typedef enum { + STC_FW_IP_NONE, + STC_FW_IP_SINGLE, + STC_FW_IP_MASK, + STC_FW_IP_RANGE +} stc_fw_ip_type_e; + +typedef enum { + STC_FW_PORT_NONE, + STC_FW_PORT_SINGLE, + STC_FW_PORT_RANGE +} stc_fw_port_type_e; + +typedef enum { + STC_FW_PROTOCOL_NONE, + STC_FW_PROTOCOL_TCP, + STC_FW_PROTOCOL_UDP, + STC_FW_PROTOCOL_ICMP, + STC_FW_PROTOCOL_ESP, + STC_FW_PROTOCOL_AH, + STC_FW_PROTOCOL_SCTP, + STC_FW_PROTOCOL_MH, + STC_FW_PROTOCOL_ALL, +} stc_fw_protocol_type_e; + +typedef enum { + STC_FW_CHAIN_TARGET_NONE, + STC_FW_CHAIN_TARGET_INPUT, + STC_FW_CHAIN_TARGET_OUTPUT, + STC_FW_CHAIN_TARGET_MAX +} stc_fw_chain_target_e; + +typedef enum { + STC_FW_RULE_TARGET_NONE, + STC_FW_RULE_TARGET_ACCEPT, + STC_FW_RULE_TARGET_DROP, + STC_FW_RULE_TARGET_LOG, + STC_FW_RULE_TARGET_NFLOG, + STC_FW_RULE_TARGET_MAX +} stc_fw_rule_target_e; + /** * @brief Monitored application types */ @@ -59,6 +120,7 @@ typedef enum { STC_APP_TYPE_GROUP, STC_APP_TYPE_WATCH, STC_APP_TYPE_WIDGET, + STC_APP_TYPE_TETHERING, STC_APP_TYPE_MAX, } stc_app_type_e; @@ -66,22 +128,31 @@ typedef enum { * @brief State of the statisticsed process */ typedef enum { - STC_APP_STATE_UNKNOWN = 0, - STC_APP_STATE_FOREGROUND = 1 << 1, /** < foreground state */ - STC_APP_STATE_BACKGROUND = 1 << 2, /** < background state */ - STC_APP_STATE_LAST_ELEM = 1 << 3 + STC_APP_STATE_UNKNOWN, + STC_APP_STATE_FOREGROUND, /** < foreground state */ + STC_APP_STATE_BACKGROUND, /** < background state */ + STC_APP_STATE_LAST_ELEM } stc_app_state_e; /** * @brief Network restriction states */ typedef enum { - STC_RESTRICTION_UNKNOWN, - STC_RESTRICTION_ACTIVATED, /** < restriction has been activated */ - STC_RESTRICTION_REMOVED, /** < restriction has been removed */ - STC_RESTRICTION_EXCLUDED, /** < restriction has been excluded */ - STC_RESTRICTION_LAST_ELEM -} stc_restriction_state_e; + STC_RSTN_STATE_UNKNOWN, + STC_RSTN_STATE_ACTIVATED, + STC_RSTN_STATE_DEACTIVATED, + STC_RSTN_STATE_LAST_ELEM +} stc_rstn_state_e; + +/** + * @brief Network restriction types + */ +typedef enum { + STC_RSTN_TYPE_UNKNOWN, + STC_RSTN_TYPE_ACCEPT, + STC_RSTN_TYPE_DROP, + STC_RSTN_TYPE_LAST_ELEM +} stc_rstn_type_e; /** * @brief Network interface types @@ -94,6 +165,8 @@ typedef enum { STC_IFACE_BLUETOOTH, /**< bluetooth interface */ STC_IFACE_IPV4, /**< ipv4 interface */ STC_IFACE_IPV6, /**< ipv6 interface */ + STC_IFACE_USB, /**< usb interface */ + STC_IFACE_P2P, /**< p2p interface */ STC_IFACE_ALL, /**< enumerate all network interface types */ STC_IFACE_LAST_ELEM } stc_iface_type_e; @@ -102,17 +175,15 @@ typedef enum { * @brief Network roaming type */ typedef enum { - STC_ROAMING_UNKNOWN, /**< can't define roaming - roaming unknown */ - STC_ROAMING_ENABLE, /**< in roaming */ STC_ROAMING_DISABLE, /**< not in roaming */ - STC_ROAMING_LAST_ELEM, + STC_ROAMING_ENABLE, /**< in roaming */ } stc_roaming_type_e; /** * @brief Hardware network protocol types */ typedef enum { - STC_PROTOCOL_NONE, /**< Network unknown */ + STC_PROTOCOL_UNKNOWN, /**< Network unknown */ STC_PROTOCOL_DATACALL_NOSVC, /**< Network no service */ STC_PROTOCOL_DATACALL_EMERGENCY, /**< Network emergency */ STC_PROTOCOL_DATACALL_SEARCH, /**< Network search 1900 */ @@ -164,6 +235,7 @@ typedef struct { gpointer statistics_obj; gpointer restriction_obj; + gpointer firewall_obj; gpointer manager_obj; GDBusObjectManagerServer *obj_mgr; @@ -176,5 +248,6 @@ typedef struct { stc_s *stc_get_manager(void); void stc_stop_manager(void); +int stc_commit_iptables(char *cmd, int *err_num, char **err_str); #endif /* __STC_MANAGER__ */