Update version after release of v0.6.5.2
[olsrd.git] / src / kernel_tunnel.h
1 /*
2  * kernel_tunnel.h
3  *
4  *  Created on: 08.02.2010
5  *      Author: henning
6  */
7
8 #ifndef KERNEL_TUNNEL_H_
9 #define KERNEL_TUNNEL_H_
10
11 #include <net/if.h>
12 #ifdef _WIN32
13 /* compat for win32 */
14 #include <iprtrmib.h>
15 #define IF_NAMESIZE MAX_INTERFACE_NAME_LEN
16 #endif /* _WIN32 */
17
18 #include "defs.h"
19 #include "olsr_types.h"
20 #include "common/avl.h"
21
22 #define TUNNEL_ENDPOINT_IF "tunl0"
23 #define TUNNEL_ENDPOINT_IF6 "ip6tnl0"
24
25 #ifdef __ANDROID__
26   #define OS_TUNNEL_PATH "/dev/tun"
27 #else
28   #define OS_TUNNEL_PATH "/dev/net/tun"
29 #endif
30
31 struct olsr_iptunnel_entry {
32   struct avl_node node;
33   union olsr_ip_addr target;
34
35   char if_name[IF_NAMESIZE];
36   int if_index;
37
38   int usage;
39 };
40
41 int olsr_os_init_iptunnel(const char * name);
42 void olsr_os_cleanup_iptunnel(const char * name);
43
44 struct olsr_iptunnel_entry *olsr_os_add_ipip_tunnel(union olsr_ip_addr *target, bool transportV4);
45 void olsr_os_del_ipip_tunnel(struct olsr_iptunnel_entry *);
46
47 #endif /* KERNEL_TUNNEL_H_ */