1#ifndef _UAPI_IF_TUNNEL_H_
2#define _UAPI_IF_TUNNEL_H_
3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6
7
8#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
9#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
10#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
11#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
12#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
13#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
14#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
15#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
16#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
17#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
18#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
19#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
20
21#define GRE_CSUM __cpu_to_be16(0x8000)
22#define GRE_ROUTING __cpu_to_be16(0x4000)
23#define GRE_KEY __cpu_to_be16(0x2000)
24#define GRE_SEQ __cpu_to_be16(0x1000)
25#define GRE_STRICT __cpu_to_be16(0x0800)
26#define GRE_REC __cpu_to_be16(0x0700)
27#define GRE_ACK __cpu_to_be16(0x0080)
28#define GRE_FLAGS __cpu_to_be16(0x0078)
29#define GRE_VERSION __cpu_to_be16(0x0007)
30
31#define GRE_VERSION_1 __cpu_to_be16(0x0001)
32#define GRE_PROTO_PPP __cpu_to_be16(0x880b)
33#define GRE_PPTP_KEY_MASK __cpu_to_be32(0xffff)
34
35struct ip_tunnel_parm {
36 char name[IFNAMSIZ];
37 int link;
38 __be16 i_flags;
39 __be16 o_flags;
40 __be32 i_key;
41 __be32 o_key;
42 struct iphdr iph;
43};
44
45enum {
46 IFLA_IPTUN_UNSPEC,
47 IFLA_IPTUN_LINK,
48 IFLA_IPTUN_LOCAL,
49 IFLA_IPTUN_REMOTE,
50 IFLA_IPTUN_TTL,
51 IFLA_IPTUN_TOS,
52 IFLA_IPTUN_ENCAP_LIMIT,
53 IFLA_IPTUN_FLOWINFO,
54 IFLA_IPTUN_FLAGS,
55 IFLA_IPTUN_PROTO,
56 IFLA_IPTUN_PMTUDISC,
57 IFLA_IPTUN_6RD_PREFIX,
58 IFLA_IPTUN_6RD_RELAY_PREFIX,
59 IFLA_IPTUN_6RD_PREFIXLEN,
60 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
61 IFLA_IPTUN_ENCAP_TYPE,
62 IFLA_IPTUN_ENCAP_FLAGS,
63 IFLA_IPTUN_ENCAP_SPORT,
64 IFLA_IPTUN_ENCAP_DPORT,
65 __IFLA_IPTUN_MAX,
66};
67#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
68
69enum tunnel_encap_types {
70 TUNNEL_ENCAP_NONE,
71 TUNNEL_ENCAP_FOU,
72 TUNNEL_ENCAP_GUE,
73};
74
75#define TUNNEL_ENCAP_FLAG_CSUM (1<<0)
76#define TUNNEL_ENCAP_FLAG_CSUM6 (1<<1)
77#define TUNNEL_ENCAP_FLAG_REMCSUM (1<<2)
78
79
80#define SIT_ISATAP 0x0001
81
82struct ip_tunnel_prl {
83 __be32 addr;
84 __u16 flags;
85 __u16 __reserved;
86 __u32 datalen;
87 __u32 __reserved2;
88
89};
90
91
92#define PRL_DEFAULT 0x0001
93
94struct ip_tunnel_6rd {
95 struct in6_addr prefix;
96 __be32 relay_prefix;
97 __u16 prefixlen;
98 __u16 relay_prefixlen;
99};
100
101enum {
102 IFLA_GRE_UNSPEC,
103 IFLA_GRE_LINK,
104 IFLA_GRE_IFLAGS,
105 IFLA_GRE_OFLAGS,
106 IFLA_GRE_IKEY,
107 IFLA_GRE_OKEY,
108 IFLA_GRE_LOCAL,
109 IFLA_GRE_REMOTE,
110 IFLA_GRE_TTL,
111 IFLA_GRE_TOS,
112 IFLA_GRE_PMTUDISC,
113 IFLA_GRE_ENCAP_LIMIT,
114 IFLA_GRE_FLOWINFO,
115 IFLA_GRE_FLAGS,
116 IFLA_GRE_ENCAP_TYPE,
117 IFLA_GRE_ENCAP_FLAGS,
118 IFLA_GRE_ENCAP_SPORT,
119 IFLA_GRE_ENCAP_DPORT,
120 IFLA_GRE_COLLECT_METADATA,
121 IFLA_GRE_IGNORE_DF,
122 __IFLA_GRE_MAX,
123};
124
125#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
126
127
128#define VTI_ISVTI 0x0001
129
130enum {
131 IFLA_VTI_UNSPEC,
132 IFLA_VTI_LINK,
133 IFLA_VTI_IKEY,
134 IFLA_VTI_OKEY,
135 IFLA_VTI_LOCAL,
136 IFLA_VTI_REMOTE,
137 __IFLA_VTI_MAX,
138};
139
140#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
141#endif
142