[connman] Added Tizen Wi-Fi Mesh
[platform/upstream/connman.git] / include / inet.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2013  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef __CONNMAN_INET_H
23 #define __CONNMAN_INET_H
24
25 #include <arpa/inet.h>
26 #include <linux/netlink.h>
27 #include <linux/rtnetlink.h>
28
29 #include <connman/device.h>
30 #include <connman/ipconfig.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 int connman_inet_ifindex(const char *name);
37 char *connman_inet_ifname(int index);
38
39 int connman_inet_ifup(int index);
40 int connman_inet_ifdown(int index);
41
42 #if defined TIZEN_EXT
43 void connman_inet_update_device_ident(struct connman_device *device);
44 #endif
45
46 int connman_inet_set_address(int index, struct connman_ipaddress *ipaddress);
47 int connman_inet_clear_address(int index, struct connman_ipaddress *ipaddress);
48 int connman_inet_add_host_route(int index, const char *host, const char *gateway);
49 int connman_inet_del_host_route(int index, const char *host);
50 int connman_inet_add_network_route(int index, const char *host, const char *gateway,
51                                         const char *netmask);
52 int connman_inet_del_network_route(int index, const char *host);
53 int connman_inet_clear_gateway_address(int index, const char *gateway);
54 int connman_inet_set_gateway_interface(int index);
55 int connman_inet_clear_gateway_interface(int index);
56 bool connman_inet_compare_subnet(int index, const char *host);
57 int connman_inet_set_ipv6_address(int index,
58                 struct connman_ipaddress *ipaddress);
59 int connman_inet_clear_ipv6_address(int index,
60                 const char *address, int prefix_len);
61 int connman_inet_add_ipv6_network_route(int index, const char *host,
62                                         const char *gateway, unsigned char prefix_len);
63 int connman_inet_add_ipv6_host_route(int index, const char *host,
64                                                 const char *gateway);
65 int connman_inet_del_ipv6_network_route(int index, const char *host,
66                                         unsigned char prefix_len);
67 int connman_inet_del_ipv6_host_route(int index, const char *host);
68 int connman_inet_clear_ipv6_gateway_address(int index, const char *gateway);
69 int connman_inet_set_ipv6_gateway_interface(int index);
70 int connman_inet_clear_ipv6_gateway_interface(int index);
71
72 int connman_inet_add_to_bridge(int index, const char *bridge);
73 int connman_inet_remove_from_bridge(int index, const char *bridge);
74
75 int connman_inet_set_mtu(int index, int mtu);
76 int connman_inet_setup_tunnel(char *tunnel, int mtu);
77 int connman_inet_create_tunnel(char **iface);
78 int connman_inet_get_dest_addr(int index, char **dest);
79 int connman_inet_ipv6_get_dest_addr(int index, char **dest);
80 int connman_inet_check_ipaddress(const char *host);
81 bool connman_inet_check_hostname(const char *ptr, size_t len);
82 bool connman_inet_is_ipv6_supported();
83
84 #if defined TIZEN_EXT_WIFI_MESH
85 char *connman_inet_ifaddr(const char *name);
86 char *connman_inet_ifname2addr(const char *name);
87 #endif
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif /* __CONNMAN_INET_H */