aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwenxu <wenxu@ucloud.cn>2018-12-19 01:11:15 -0500
committerDavid S. Miller <davem@davemloft.net>2018-12-19 18:58:01 -0500
commit1875a9ab01dfa96b06cb6649cb1ce56efa86c7cb (patch)
tree4002aa9917fbb654a45712352ddd0e8f557d38aa
parent8e1da73acded4751a93d4166458a7e640f37d26c (diff)
iptunnel: make TUNNEL_FLAGS available in uapi
ip l add dev tun type gretap external ip r a 10.0.0.1 encap ip dst 192.168.152.171 id 1000 dev gretap For gretap Key example when the command set the id but don't set the TUNNEL_KEY flags. There is no key field in the send packet In the lwtunnel situation, some TUNNEL_FLAGS should can be set by userspace Signed-off-by: wenxu <wenxu@ucloud.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ip_tunnels.h19
-rw-r--r--include/uapi/linux/if_tunnel.h20
2 files changed, 20 insertions, 19 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index b0d022ff6ea1..5ce926701bd0 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -144,25 +144,6 @@ struct ip_tunnel {
144 bool ignore_df; 144 bool ignore_df;
145}; 145};
146 146
147#define TUNNEL_CSUM __cpu_to_be16(0x01)
148#define TUNNEL_ROUTING __cpu_to_be16(0x02)
149#define TUNNEL_KEY __cpu_to_be16(0x04)
150#define TUNNEL_SEQ __cpu_to_be16(0x08)
151#define TUNNEL_STRICT __cpu_to_be16(0x10)
152#define TUNNEL_REC __cpu_to_be16(0x20)
153#define TUNNEL_VERSION __cpu_to_be16(0x40)
154#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
155#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
156#define TUNNEL_OAM __cpu_to_be16(0x0200)
157#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
158#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
159#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
160#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
161#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
162
163#define TUNNEL_OPTIONS_PRESENT \
164 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
165
166struct tnl_ptk_info { 147struct tnl_ptk_info {
167 __be16 flags; 148 __be16 flags;
168 __be16 proto; 149 __be16 proto;
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
index 1b3d148c4560..7d9105533c7b 100644
--- a/include/uapi/linux/if_tunnel.h
+++ b/include/uapi/linux/if_tunnel.h
@@ -160,4 +160,24 @@ enum {
160}; 160};
161 161
162#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1) 162#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
163
164#define TUNNEL_CSUM __cpu_to_be16(0x01)
165#define TUNNEL_ROUTING __cpu_to_be16(0x02)
166#define TUNNEL_KEY __cpu_to_be16(0x04)
167#define TUNNEL_SEQ __cpu_to_be16(0x08)
168#define TUNNEL_STRICT __cpu_to_be16(0x10)
169#define TUNNEL_REC __cpu_to_be16(0x20)
170#define TUNNEL_VERSION __cpu_to_be16(0x40)
171#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
172#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
173#define TUNNEL_OAM __cpu_to_be16(0x0200)
174#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
175#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
176#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
177#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
178#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
179
180#define TUNNEL_OPTIONS_PRESENT \
181 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
182
163#endif /* _UAPI_IF_TUNNEL_H_ */ 183#endif /* _UAPI_IF_TUNNEL_H_ */