1 #ifndef _UAPI_IF_TUNNEL_H_
2 #define _UAPI_IF_TUNNEL_H_
4 #include <linux/types.h>
8 #include <asm/byteorder.h>
11 #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
12 #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
13 #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
14 #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
15 #define SIOCGETPRL (SIOCDEVPRIVATE + 4)
16 #define SIOCADDPRL (SIOCDEVPRIVATE + 5)
17 #define SIOCDELPRL (SIOCDEVPRIVATE + 6)
18 #define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
19 #define SIOCGET6RD (SIOCDEVPRIVATE + 8)
20 #define SIOCADD6RD (SIOCDEVPRIVATE + 9)
21 #define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
22 #define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
24 #define GRE_CSUM __cpu_to_be16(0x8000)
25 #define GRE_ROUTING __cpu_to_be16(0x4000)
26 #define GRE_KEY __cpu_to_be16(0x2000)
27 #define GRE_SEQ __cpu_to_be16(0x1000)
28 #define GRE_STRICT __cpu_to_be16(0x0800)
29 #define GRE_REC __cpu_to_be16(0x0700)
30 #define GRE_ACK __cpu_to_be16(0x0080)
31 #define GRE_FLAGS __cpu_to_be16(0x0078)
32 #define GRE_VERSION __cpu_to_be16(0x0007)
34 #define GRE_IS_CSUM(f) ((f) & GRE_CSUM)
35 #define GRE_IS_ROUTING(f) ((f) & GRE_ROUTING)
36 #define GRE_IS_KEY(f) ((f) & GRE_KEY)
37 #define GRE_IS_SEQ(f) ((f) & GRE_SEQ)
38 #define GRE_IS_STRICT(f) ((f) & GRE_STRICT)
39 #define GRE_IS_REC(f) ((f) & GRE_REC)
40 #define GRE_IS_ACK(f) ((f) & GRE_ACK)
42 #define GRE_VERSION_0 __cpu_to_be16(0x0000)
43 #define GRE_VERSION_1 __cpu_to_be16(0x0001)
44 #define GRE_PROTO_PPP __cpu_to_be16(0x880b)
45 #define GRE_PPTP_KEY_MASK __cpu_to_be32(0xffff)
47 struct ip_tunnel_parm
{
64 IFLA_IPTUN_ENCAP_LIMIT
,
69 IFLA_IPTUN_6RD_PREFIX
,
70 IFLA_IPTUN_6RD_RELAY_PREFIX
,
71 IFLA_IPTUN_6RD_PREFIXLEN
,
72 IFLA_IPTUN_6RD_RELAY_PREFIXLEN
,
73 IFLA_IPTUN_ENCAP_TYPE
,
74 IFLA_IPTUN_ENCAP_FLAGS
,
75 IFLA_IPTUN_ENCAP_SPORT
,
76 IFLA_IPTUN_ENCAP_DPORT
,
77 IFLA_IPTUN_COLLECT_METADATA
,
80 #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
82 enum tunnel_encap_types
{
88 #define TUNNEL_ENCAP_FLAG_CSUM (1<<0)
89 #define TUNNEL_ENCAP_FLAG_CSUM6 (1<<1)
90 #define TUNNEL_ENCAP_FLAG_REMCSUM (1<<2)
92 /* SIT-mode i_flags */
93 #define SIT_ISATAP 0x0001
95 struct ip_tunnel_prl
{
105 #define PRL_DEFAULT 0x0001
107 struct ip_tunnel_6rd
{
108 struct in6_addr prefix
;
111 __u16 relay_prefixlen
;
126 IFLA_GRE_ENCAP_LIMIT
,
130 IFLA_GRE_ENCAP_FLAGS
,
131 IFLA_GRE_ENCAP_SPORT
,
132 IFLA_GRE_ENCAP_DPORT
,
133 IFLA_GRE_COLLECT_METADATA
,
138 #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
140 /* VTI-mode i_flags */
141 #define VTI_ISVTI ((__force __be16)0x0001)
153 #define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
154 #endif /* _UAPI_IF_TUNNEL_H_ */