blob: 60dbb200de607a84596ff116bc449a61f81869d8 [file] [log] [blame]
David Howells607ca462012-10-13 10:46:48 +01001#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)
Gao Fengab10dcc2016-08-09 12:38:24 +080027#define GRE_ACK __cpu_to_be16(0x0080)
28#define GRE_FLAGS __cpu_to_be16(0x0078)
David Howells607ca462012-10-13 10:46:48 +010029#define GRE_VERSION __cpu_to_be16(0x0007)
30
Gao Fengab10dcc2016-08-09 12:38:24 +080031#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
David Howells607ca462012-10-13 10:46:48 +010035struct 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
Nicolas Dichtel09746582012-11-09 06:09:59 +000045enum {
46 IFLA_IPTUN_UNSPEC,
47 IFLA_IPTUN_LINK,
48 IFLA_IPTUN_LOCAL,
49 IFLA_IPTUN_REMOTE,
50 IFLA_IPTUN_TTL,
51 IFLA_IPTUN_TOS,
Nicolas Dichtelc075b132012-11-09 06:10:01 +000052 IFLA_IPTUN_ENCAP_LIMIT,
53 IFLA_IPTUN_FLOWINFO,
54 IFLA_IPTUN_FLAGS,
Nicolas Dichtelcfa323b2012-11-14 05:13:58 +000055 IFLA_IPTUN_PROTO,
Nicolas Dichtelbefe2aa2012-11-14 05:14:02 +000056 IFLA_IPTUN_PMTUDISC,
Nicolas Dichtele2f1f072012-11-19 22:41:45 +000057 IFLA_IPTUN_6RD_PREFIX,
58 IFLA_IPTUN_6RD_RELAY_PREFIX,
59 IFLA_IPTUN_6RD_PREFIXLEN,
60 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
Tom Herbert56328482014-09-17 12:25:58 -070061 IFLA_IPTUN_ENCAP_TYPE,
62 IFLA_IPTUN_ENCAP_FLAGS,
63 IFLA_IPTUN_ENCAP_SPORT,
64 IFLA_IPTUN_ENCAP_DPORT,
Nicolas Dichtel09746582012-11-09 06:09:59 +000065 __IFLA_IPTUN_MAX,
66};
67#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
68
Tom Herbert56328482014-09-17 12:25:58 -070069enum tunnel_encap_types {
70 TUNNEL_ENCAP_NONE,
71 TUNNEL_ENCAP_FOU,
Tom Herbertbc1fc392014-10-03 15:48:10 -070072 TUNNEL_ENCAP_GUE,
Tom Herbert56328482014-09-17 12:25:58 -070073};
74
75#define TUNNEL_ENCAP_FLAG_CSUM (1<<0)
76#define TUNNEL_ENCAP_FLAG_CSUM6 (1<<1)
Tom Herbertb17f7092014-11-04 09:06:56 -080077#define TUNNEL_ENCAP_FLAG_REMCSUM (1<<2)
Tom Herbert56328482014-09-17 12:25:58 -070078
David Howells607ca462012-10-13 10:46:48 +010079/* SIT-mode i_flags */
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 /* data follows */
89};
90
91/* PRL flags */
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,
Tom Herbert4565e992014-09-17 12:26:01 -0700116 IFLA_GRE_ENCAP_TYPE,
117 IFLA_GRE_ENCAP_FLAGS,
118 IFLA_GRE_ENCAP_SPORT,
119 IFLA_GRE_ENCAP_DPORT,
Pravin B Shelar2e15ea32015-08-07 23:51:42 -0700120 IFLA_GRE_COLLECT_METADATA,
Philip Prindeville22a59be2016-06-14 15:53:02 -0600121 IFLA_GRE_IGNORE_DF,
David Howells607ca462012-10-13 10:46:48 +0100122 __IFLA_GRE_MAX,
123};
124
125#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
126
127/* VTI-mode i_flags */
Dmitry Popovefd0f112014-06-11 15:09:14 +0400128#define VTI_ISVTI ((__force __be16)0x0001)
David Howells607ca462012-10-13 10:46:48 +0100129
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 /* _UAPI_IF_TUNNEL_H_ */