David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 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_FLAGS __cpu_to_be16(0x00F8) |
| 28 | #define GRE_VERSION __cpu_to_be16(0x0007) |
| 29 | |
| 30 | struct ip_tunnel_parm { |
| 31 | char name[IFNAMSIZ]; |
| 32 | int link; |
| 33 | __be16 i_flags; |
| 34 | __be16 o_flags; |
| 35 | __be32 i_key; |
| 36 | __be32 o_key; |
| 37 | struct iphdr iph; |
| 38 | }; |
| 39 | |
Nicolas Dichtel | 0974658 | 2012-11-09 06:09:59 +0000 | [diff] [blame] | 40 | enum { |
| 41 | IFLA_IPTUN_UNSPEC, |
| 42 | IFLA_IPTUN_LINK, |
| 43 | IFLA_IPTUN_LOCAL, |
| 44 | IFLA_IPTUN_REMOTE, |
| 45 | IFLA_IPTUN_TTL, |
| 46 | IFLA_IPTUN_TOS, |
Nicolas Dichtel | c075b13 | 2012-11-09 06:10:01 +0000 | [diff] [blame] | 47 | IFLA_IPTUN_ENCAP_LIMIT, |
| 48 | IFLA_IPTUN_FLOWINFO, |
| 49 | IFLA_IPTUN_FLAGS, |
Nicolas Dichtel | cfa323b | 2012-11-14 05:13:58 +0000 | [diff] [blame] | 50 | IFLA_IPTUN_PROTO, |
Nicolas Dichtel | befe2aa | 2012-11-14 05:14:02 +0000 | [diff] [blame] | 51 | IFLA_IPTUN_PMTUDISC, |
Nicolas Dichtel | e2f1f07 | 2012-11-19 22:41:45 +0000 | [diff] [blame] | 52 | IFLA_IPTUN_6RD_PREFIX, |
| 53 | IFLA_IPTUN_6RD_RELAY_PREFIX, |
| 54 | IFLA_IPTUN_6RD_PREFIXLEN, |
| 55 | IFLA_IPTUN_6RD_RELAY_PREFIXLEN, |
Tom Herbert | 5632848 | 2014-09-17 12:25:58 -0700 | [diff] [blame] | 56 | IFLA_IPTUN_ENCAP_TYPE, |
| 57 | IFLA_IPTUN_ENCAP_FLAGS, |
| 58 | IFLA_IPTUN_ENCAP_SPORT, |
| 59 | IFLA_IPTUN_ENCAP_DPORT, |
Nicolas Dichtel | 0974658 | 2012-11-09 06:09:59 +0000 | [diff] [blame] | 60 | __IFLA_IPTUN_MAX, |
| 61 | }; |
| 62 | #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) |
| 63 | |
Tom Herbert | 5632848 | 2014-09-17 12:25:58 -0700 | [diff] [blame] | 64 | enum tunnel_encap_types { |
| 65 | TUNNEL_ENCAP_NONE, |
| 66 | TUNNEL_ENCAP_FOU, |
Tom Herbert | bc1fc39 | 2014-10-03 15:48:10 -0700 | [diff] [blame] | 67 | TUNNEL_ENCAP_GUE, |
Tom Herbert | 5632848 | 2014-09-17 12:25:58 -0700 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | #define TUNNEL_ENCAP_FLAG_CSUM (1<<0) |
| 71 | #define TUNNEL_ENCAP_FLAG_CSUM6 (1<<1) |
Tom Herbert | b17f709 | 2014-11-04 09:06:56 -0800 | [diff] [blame] | 72 | #define TUNNEL_ENCAP_FLAG_REMCSUM (1<<2) |
Tom Herbert | 5632848 | 2014-09-17 12:25:58 -0700 | [diff] [blame] | 73 | |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 74 | /* SIT-mode i_flags */ |
| 75 | #define SIT_ISATAP 0x0001 |
| 76 | |
| 77 | struct ip_tunnel_prl { |
| 78 | __be32 addr; |
| 79 | __u16 flags; |
| 80 | __u16 __reserved; |
| 81 | __u32 datalen; |
| 82 | __u32 __reserved2; |
| 83 | /* data follows */ |
| 84 | }; |
| 85 | |
| 86 | /* PRL flags */ |
| 87 | #define PRL_DEFAULT 0x0001 |
| 88 | |
| 89 | struct ip_tunnel_6rd { |
| 90 | struct in6_addr prefix; |
| 91 | __be32 relay_prefix; |
| 92 | __u16 prefixlen; |
| 93 | __u16 relay_prefixlen; |
| 94 | }; |
| 95 | |
| 96 | enum { |
| 97 | IFLA_GRE_UNSPEC, |
| 98 | IFLA_GRE_LINK, |
| 99 | IFLA_GRE_IFLAGS, |
| 100 | IFLA_GRE_OFLAGS, |
| 101 | IFLA_GRE_IKEY, |
| 102 | IFLA_GRE_OKEY, |
| 103 | IFLA_GRE_LOCAL, |
| 104 | IFLA_GRE_REMOTE, |
| 105 | IFLA_GRE_TTL, |
| 106 | IFLA_GRE_TOS, |
| 107 | IFLA_GRE_PMTUDISC, |
| 108 | IFLA_GRE_ENCAP_LIMIT, |
| 109 | IFLA_GRE_FLOWINFO, |
| 110 | IFLA_GRE_FLAGS, |
Tom Herbert | 4565e99 | 2014-09-17 12:26:01 -0700 | [diff] [blame] | 111 | IFLA_GRE_ENCAP_TYPE, |
| 112 | IFLA_GRE_ENCAP_FLAGS, |
| 113 | IFLA_GRE_ENCAP_SPORT, |
| 114 | IFLA_GRE_ENCAP_DPORT, |
Pravin B Shelar | 2e15ea3 | 2015-08-07 23:51:42 -0700 | [diff] [blame] | 115 | IFLA_GRE_COLLECT_METADATA, |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 116 | __IFLA_GRE_MAX, |
| 117 | }; |
| 118 | |
| 119 | #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) |
| 120 | |
| 121 | /* VTI-mode i_flags */ |
Dmitry Popov | efd0f11 | 2014-06-11 15:09:14 +0400 | [diff] [blame] | 122 | #define VTI_ISVTI ((__force __be16)0x0001) |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 123 | |
| 124 | enum { |
| 125 | IFLA_VTI_UNSPEC, |
| 126 | IFLA_VTI_LINK, |
| 127 | IFLA_VTI_IKEY, |
| 128 | IFLA_VTI_OKEY, |
| 129 | IFLA_VTI_LOCAL, |
| 130 | IFLA_VTI_REMOTE, |
| 131 | __IFLA_VTI_MAX, |
| 132 | }; |
| 133 | |
| 134 | #define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1) |
| 135 | #endif /* _UAPI_IF_TUNNEL_H_ */ |