blob: 8e1847fba67f4138ccabe5a425f0911a2fbd0394 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_IF_TUNNEL_H_
20#define _UAPI_IF_TUNNEL_H_
21#include <linux/types.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080022#include <linux/if.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080023#include <linux/ip.h>
24#include <linux/in6.h>
25#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
27#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
28#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
29#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
Ben Cheng655a7c02013-10-16 16:09:24 -070030#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
31#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
32#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
33#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
Ben Cheng655a7c02013-10-16 16:09:24 -070034#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
35#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
36#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
37#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
Ben Cheng655a7c02013-10-16 16:09:24 -070038#define GRE_CSUM __cpu_to_be16(0x8000)
39#define GRE_ROUTING __cpu_to_be16(0x4000)
40#define GRE_KEY __cpu_to_be16(0x2000)
41#define GRE_SEQ __cpu_to_be16(0x1000)
Ben Cheng655a7c02013-10-16 16:09:24 -070042#define GRE_STRICT __cpu_to_be16(0x0800)
43#define GRE_REC __cpu_to_be16(0x0700)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080044#define GRE_ACK __cpu_to_be16(0x0080)
45#define GRE_FLAGS __cpu_to_be16(0x0078)
Ben Cheng655a7c02013-10-16 16:09:24 -070046#define GRE_VERSION __cpu_to_be16(0x0007)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080047#define GRE_IS_CSUM(f) ((f) & GRE_CSUM)
48#define GRE_IS_ROUTING(f) ((f) & GRE_ROUTING)
49#define GRE_IS_KEY(f) ((f) & GRE_KEY)
50#define GRE_IS_SEQ(f) ((f) & GRE_SEQ)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080051#define GRE_IS_STRICT(f) ((f) & GRE_STRICT)
52#define GRE_IS_REC(f) ((f) & GRE_REC)
53#define GRE_IS_ACK(f) ((f) & GRE_ACK)
54#define GRE_VERSION_0 __cpu_to_be16(0x0000)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080055#define GRE_VERSION_1 __cpu_to_be16(0x0001)
56#define GRE_PROTO_PPP __cpu_to_be16(0x880b)
57#define GRE_PPTP_KEY_MASK __cpu_to_be32(0xffff)
Ben Cheng655a7c02013-10-16 16:09:24 -070058struct ip_tunnel_parm {
Tao Baod7db5942015-01-28 10:07:51 -080059 char name[IFNAMSIZ];
60 int link;
61 __be16 i_flags;
Tao Baod7db5942015-01-28 10:07:51 -080062 __be16 o_flags;
63 __be32 i_key;
64 __be32 o_key;
65 struct iphdr iph;
Ben Cheng655a7c02013-10-16 16:09:24 -070066};
67enum {
Tao Baod7db5942015-01-28 10:07:51 -080068 IFLA_IPTUN_UNSPEC,
69 IFLA_IPTUN_LINK,
Tao Baod7db5942015-01-28 10:07:51 -080070 IFLA_IPTUN_LOCAL,
71 IFLA_IPTUN_REMOTE,
72 IFLA_IPTUN_TTL,
73 IFLA_IPTUN_TOS,
Tao Baod7db5942015-01-28 10:07:51 -080074 IFLA_IPTUN_ENCAP_LIMIT,
75 IFLA_IPTUN_FLOWINFO,
76 IFLA_IPTUN_FLAGS,
77 IFLA_IPTUN_PROTO,
Tao Baod7db5942015-01-28 10:07:51 -080078 IFLA_IPTUN_PMTUDISC,
79 IFLA_IPTUN_6RD_PREFIX,
80 IFLA_IPTUN_6RD_RELAY_PREFIX,
81 IFLA_IPTUN_6RD_PREFIXLEN,
Tao Baod7db5942015-01-28 10:07:51 -080082 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
83 IFLA_IPTUN_ENCAP_TYPE,
84 IFLA_IPTUN_ENCAP_FLAGS,
85 IFLA_IPTUN_ENCAP_SPORT,
Tao Baod7db5942015-01-28 10:07:51 -080086 IFLA_IPTUN_ENCAP_DPORT,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080087 IFLA_IPTUN_COLLECT_METADATA,
Christopher Ferris525ce912017-07-26 13:12:53 -070088 IFLA_IPTUN_FWMARK,
Tao Baod7db5942015-01-28 10:07:51 -080089 __IFLA_IPTUN_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070090};
91#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080092enum tunnel_encap_types {
Tao Baod7db5942015-01-28 10:07:51 -080093 TUNNEL_ENCAP_NONE,
94 TUNNEL_ENCAP_FOU,
95 TUNNEL_ENCAP_GUE,
Christopher Ferris934ec942018-01-31 15:29:16 -080096 TUNNEL_ENCAP_MPLS,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080097};
Tao Baod7db5942015-01-28 10:07:51 -080098#define TUNNEL_ENCAP_FLAG_CSUM (1 << 0)
99#define TUNNEL_ENCAP_FLAG_CSUM6 (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800100#define TUNNEL_ENCAP_FLAG_REMCSUM (1 << 2)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800101#define SIT_ISATAP 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -0700102struct ip_tunnel_prl {
Tao Baod7db5942015-01-28 10:07:51 -0800103 __be32 addr;
104 __u16 flags;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800105 __u16 __reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800106 __u32 datalen;
107 __u32 __reserved2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700108};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800109#define PRL_DEFAULT 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -0700110struct ip_tunnel_6rd {
Tao Baod7db5942015-01-28 10:07:51 -0800111 struct in6_addr prefix;
112 __be32 relay_prefix;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800113 __u16 prefixlen;
Tao Baod7db5942015-01-28 10:07:51 -0800114 __u16 relay_prefixlen;
Ben Cheng655a7c02013-10-16 16:09:24 -0700115};
116enum {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800117 IFLA_GRE_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800118 IFLA_GRE_LINK,
119 IFLA_GRE_IFLAGS,
120 IFLA_GRE_OFLAGS,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800121 IFLA_GRE_IKEY,
Tao Baod7db5942015-01-28 10:07:51 -0800122 IFLA_GRE_OKEY,
123 IFLA_GRE_LOCAL,
124 IFLA_GRE_REMOTE,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800125 IFLA_GRE_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800126 IFLA_GRE_TOS,
127 IFLA_GRE_PMTUDISC,
128 IFLA_GRE_ENCAP_LIMIT,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800129 IFLA_GRE_FLOWINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800130 IFLA_GRE_FLAGS,
131 IFLA_GRE_ENCAP_TYPE,
132 IFLA_GRE_ENCAP_FLAGS,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800133 IFLA_GRE_ENCAP_SPORT,
Tao Baod7db5942015-01-28 10:07:51 -0800134 IFLA_GRE_ENCAP_DPORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800135 IFLA_GRE_COLLECT_METADATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800136 IFLA_GRE_IGNORE_DF,
Christopher Ferris525ce912017-07-26 13:12:53 -0700137 IFLA_GRE_FWMARK,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800138 IFLA_GRE_ERSPAN_INDEX,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700139 IFLA_GRE_ERSPAN_VER,
140 IFLA_GRE_ERSPAN_DIR,
141 IFLA_GRE_ERSPAN_HWID,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800142 __IFLA_GRE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700143};
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
Tao Baod7db5942015-01-28 10:07:51 -0800145#define VTI_ISVTI ((__force __be16) 0x0001)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800146enum {
Tao Baod7db5942015-01-28 10:07:51 -0800147 IFLA_VTI_UNSPEC,
148 IFLA_VTI_LINK,
Tao Baod7db5942015-01-28 10:07:51 -0800149 IFLA_VTI_IKEY,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800150 IFLA_VTI_OKEY,
Tao Baod7db5942015-01-28 10:07:51 -0800151 IFLA_VTI_LOCAL,
152 IFLA_VTI_REMOTE,
Christopher Ferris525ce912017-07-26 13:12:53 -0700153 IFLA_VTI_FWMARK,
Tao Baod7db5942015-01-28 10:07:51 -0800154 __IFLA_VTI_MAX,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800155};
Ben Cheng655a7c02013-10-16 16:09:24 -0700156#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
Christopher Ferris86a48372019-01-10 14:14:59 -0800157#define TUNNEL_CSUM __cpu_to_be16(0x01)
158#define TUNNEL_ROUTING __cpu_to_be16(0x02)
159#define TUNNEL_KEY __cpu_to_be16(0x04)
160#define TUNNEL_SEQ __cpu_to_be16(0x08)
161#define TUNNEL_STRICT __cpu_to_be16(0x10)
162#define TUNNEL_REC __cpu_to_be16(0x20)
163#define TUNNEL_VERSION __cpu_to_be16(0x40)
164#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
165#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
166#define TUNNEL_OAM __cpu_to_be16(0x0200)
167#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
168#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
169#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
170#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
171#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
172#define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700173#endif