Refactory the packages for each functionality
[platform/core/connectivity/bluetooth-agent.git] / ipsp-agent / bluetooth_ipsp_agent.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *              http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #ifndef __BLUETOOTH_IPSP_AGENT_H__
19 #define __BLUETOOTH_IPSP_AGENT_H__
20
21 #include <sys/types.h>
22 #include <sys/wait.h>
23 #include <dlog.h>
24 #include <glib.h>
25 #include <linux/types.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #define CONNMAN_DBUS_NAME "net.connman"
32 #define CONNMAN_BLUETOOTH_TECHNOLOGY_PATH "/net/connman/technology/bluetooth"
33 #define CONNMAN_BLUETOTOH_TECHNOLOGY_INTERFACE "net.connman.Technology"
34
35 #define BT_IPSP_NAME "org.projectx.bt_ipsp"
36 #define BT_IPSP_PATH "/org/projectx/bt_ipsp"
37
38 #define LOG_COLOR_RESET    "\033[0m"
39 #define LOG_COLOR_RED      "\033[31m"
40 #define LOG_COLOR_YELLOW   "\033[33m"
41 #define LOG_COLOR_GREEN         "\033[32m"
42 #define LOG_COLOR_BLUE          "\033[36m"
43 #define LOG_COLOR_PURPLE   "\033[35m"
44
45 #define BT_INFO_C(fmt, arg...) \
46         SLOGI_IF(TRUE,  LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg)
47 #define BT_ERR_C(fmt, arg...) \
48         SLOGI_IF(TRUE,  LOG_COLOR_RED" "fmt" "LOG_COLOR_RESET, ##arg)
49
50
51 #define MH_MAX_IPV6_ADDRESS_STR_LEN 40
52 #define MH_IF_INET6_PATH        "/proc/net/if_inet6"
53 #define MH_MAX_INTERFACE_NAME_LEN 20
54 #define MAX_BUF_SIZE            (256u)
55
56         typedef enum {
57         MOBILE_AP_IPV6_SCOPE_GLOBAL = 0,
58         MOBILE_AP_IPV6_SCOPE_LINK = 20,
59         MOBILE_AP_IPV6_SCOPE_SITE = 40,
60 } mobile_ap_ipv6_scope_e;
61
62 #define DNSMASQ_CONF_LEN 1024
63 #define DNSMASQ_LEASES_FILE             "/var/lib/misc/dnsmasq.leases"
64 #define DNSMASQ_CONF_FILE       "/tmp/dnsmasq.conf"
65 #define DNSMASQ_CONF6   \
66                         "dhcp-range=192.168.43.3,192.168.43.254,255.255.255.0\n" \
67                         "dhcp-range=192.168.130.2,192.168.130.150,255.255.255.0\n" \
68                         "dhcp-range=192.168.131.2,192.168.131.150,255.255.255.0\n" \
69                         "dhcp-range=192.168.132.2,192.168.132.150,255.255.255.0\n" \
70                         "dhcp-range=192.168.133.2,192.168.133.150,255.255.255.0\n" \
71                         "dhcp-range=192.168.134.2,192.168.134.150,255.255.255.0\n" \
72                         "dhcp-range=192.168.135.2,192.168.135.150,255.255.255.0\n" \
73                         "dhcp-range=192.168.136.2,192.168.136.150,255.255.255.0\n" \
74                         "dhcp-range=192.168.137.2,192.168.137.150,255.255.255.0\n" \
75                         "dhcp-range=set:blue,192.168.129.4,192.168.129.150,255.255.255.0\n"\
76                         "enable-dbus\n" \
77                         "group=system\n" \
78                         "user=system\n" \
79                         "dhcp-option=tag:blue,option:router,192.168.129.3\n" \
80                         "dhcp-option=6,%s\n" \
81                         "log-dhcp\n"\
82                         "log-queries\n"\
83                         "log-facility=/opt/var/log/dnsmasq.log\n"\
84                         "enable-ra\n" \
85                         "dhcp-range=%s::, ra-names, ra-stateless, 64, 12h\n"
86
87 #define IPV6_FORWARDING "/proc/sys/net/ipv6/conf/all/forwarding"
88 #define IPV6_PROXY_NDP  "/proc/sys/net/ipv6/conf/all/proxy_ndp"
89
90 #define IPV6_INTERFACE_ROUTING  "%s/%d dev %s"
91 #define IPV6_NEIGH_PROXY        "proxy %s dev %s"
92 #define IP_CMD          "/usr/sbin/ip"
93
94
95 #ifdef __cplusplus
96 }
97 #endif
98
99 #endif