2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __BLUETOOTH_IPSP_AGENT_H__
19 #define __BLUETOOTH_IPSP_AGENT_H__
21 #include <sys/types.h>
25 #include <linux/types.h>
32 #define CONNMAN_DBUS_NAME "net.connman"
33 #define CONNMAN_BLUETOOTH_TECHNOLOGY_PATH "/net/connman/technology/bluetooth"
34 #define CONNMAN_BLUETOTOH_TECHNOLOGY_INTERFACE "net.connman.Technology"
36 #define BT_IPSP_NAME "org.projectx.bt_ipsp"
37 #define BT_IPSP_PATH "/org/projectx/bt_ipsp"
39 #define LOG_COLOR_RESET "\033[0m"
40 #define LOG_COLOR_RED "\033[31m"
41 #define LOG_COLOR_YELLOW "\033[33m"
42 #define LOG_COLOR_GREEN "\033[32m"
43 #define LOG_COLOR_BLUE "\033[36m"
44 #define LOG_COLOR_PURPLE "\033[35m"
46 #define BT_INFO_C(fmt, arg...) \
47 SLOGI_IF(TRUE, LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg)
48 #define BT_ERR_C(fmt, arg...) \
49 SLOGI_IF(TRUE, LOG_COLOR_RED" "fmt" "LOG_COLOR_RESET, ##arg)
52 #define MH_MAX_IPV6_ADDRESS_STR_LEN 40
53 #define MH_IF_INET6_PATH "/proc/net/if_inet6"
54 #define MH_MAX_INTERFACE_NAME_LEN 20
55 #define MAX_BUF_SIZE (256u)
58 MOBILE_AP_IPV6_SCOPE_GLOBAL = 0,
59 MOBILE_AP_IPV6_SCOPE_LINK = 20,
60 MOBILE_AP_IPV6_SCOPE_SITE = 40,
61 } mobile_ap_ipv6_scope_e;
63 #define DNSMASQ_CONF_LEN 1024
64 #define DNSMASQ_LEASES_FILE "/var/lib/misc/dnsmasq.leases"
65 #define DNSMASQ_CONF_FILE "/tmp/dnsmasq.conf"
66 #define DNSMASQ_CONF6 \
67 "dhcp-range=192.168.43.3,192.168.43.254,255.255.255.0\n" \
68 "dhcp-range=192.168.130.2,192.168.130.150,255.255.255.0\n" \
69 "dhcp-range=192.168.131.2,192.168.131.150,255.255.255.0\n" \
70 "dhcp-range=192.168.132.2,192.168.132.150,255.255.255.0\n" \
71 "dhcp-range=192.168.133.2,192.168.133.150,255.255.255.0\n" \
72 "dhcp-range=192.168.134.2,192.168.134.150,255.255.255.0\n" \
73 "dhcp-range=192.168.135.2,192.168.135.150,255.255.255.0\n" \
74 "dhcp-range=192.168.136.2,192.168.136.150,255.255.255.0\n" \
75 "dhcp-range=192.168.137.2,192.168.137.150,255.255.255.0\n" \
76 "dhcp-range=set:blue,192.168.129.4,192.168.129.150,255.255.255.0\n"\
80 "dhcp-option=tag:blue,option:router,192.168.129.3\n" \
81 "dhcp-option=6,%s\n" \
84 "log-facility=/opt/var/log/dnsmasq.log\n"\
86 "dhcp-range=%s::, ra-names, ra-stateless, 64, 12h\n"
88 #define IPV6_FORWARDING "/proc/sys/net/ipv6/conf/all/forwarding"
89 #define IPV6_PROXY_NDP "/proc/sys/net/ipv6/conf/all/proxy_ndp"
91 #define IPV6_INTERFACE_ROUTING "%s/%d dev %s"
92 #define IPV6_NEIGH_PROXY "proxy %s dev %s"
93 #define IP_CMD "/usr/sbin/ip"
95 void _bt_ipsp_gdbus_deinit_proxys(void);
96 void _bt_ipsp_terminate(void);
97 gboolean _bt_ipsp_register_dbus(void);
98 void _bt_ipsp_unregister_dbus(void);