blob: e1d5594a249bd2d0f574107ebc1321021a849c74 [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,
Tao Baod7db5942015-01-28 10:07:51 -080088 __IFLA_IPTUN_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070089};
90#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080091enum tunnel_encap_types {
Tao Baod7db5942015-01-28 10:07:51 -080092 TUNNEL_ENCAP_NONE,
93 TUNNEL_ENCAP_FOU,
94 TUNNEL_ENCAP_GUE,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080095};
Tao Baod7db5942015-01-28 10:07:51 -080096#define TUNNEL_ENCAP_FLAG_CSUM (1 << 0)
97#define TUNNEL_ENCAP_FLAG_CSUM6 (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080098#define TUNNEL_ENCAP_FLAG_REMCSUM (1 << 2)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080099#define SIT_ISATAP 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -0700100struct ip_tunnel_prl {
Tao Baod7db5942015-01-28 10:07:51 -0800101 __be32 addr;
102 __u16 flags;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800103 __u16 __reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u32 datalen;
105 __u32 __reserved2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700106};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800107#define PRL_DEFAULT 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -0700108struct ip_tunnel_6rd {
Tao Baod7db5942015-01-28 10:07:51 -0800109 struct in6_addr prefix;
110 __be32 relay_prefix;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800111 __u16 prefixlen;
Tao Baod7db5942015-01-28 10:07:51 -0800112 __u16 relay_prefixlen;
Ben Cheng655a7c02013-10-16 16:09:24 -0700113};
114enum {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800115 IFLA_GRE_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800116 IFLA_GRE_LINK,
117 IFLA_GRE_IFLAGS,
118 IFLA_GRE_OFLAGS,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800119 IFLA_GRE_IKEY,
Tao Baod7db5942015-01-28 10:07:51 -0800120 IFLA_GRE_OKEY,
121 IFLA_GRE_LOCAL,
122 IFLA_GRE_REMOTE,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800123 IFLA_GRE_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800124 IFLA_GRE_TOS,
125 IFLA_GRE_PMTUDISC,
126 IFLA_GRE_ENCAP_LIMIT,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800127 IFLA_GRE_FLOWINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800128 IFLA_GRE_FLAGS,
129 IFLA_GRE_ENCAP_TYPE,
130 IFLA_GRE_ENCAP_FLAGS,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800131 IFLA_GRE_ENCAP_SPORT,
Tao Baod7db5942015-01-28 10:07:51 -0800132 IFLA_GRE_ENCAP_DPORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133 IFLA_GRE_COLLECT_METADATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800134 IFLA_GRE_IGNORE_DF,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800135 __IFLA_GRE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700136};
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
Tao Baod7db5942015-01-28 10:07:51 -0800138#define VTI_ISVTI ((__force __be16) 0x0001)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800139enum {
Tao Baod7db5942015-01-28 10:07:51 -0800140 IFLA_VTI_UNSPEC,
141 IFLA_VTI_LINK,
Tao Baod7db5942015-01-28 10:07:51 -0800142 IFLA_VTI_IKEY,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800143 IFLA_VTI_OKEY,
Tao Baod7db5942015-01-28 10:07:51 -0800144 IFLA_VTI_LOCAL,
145 IFLA_VTI_REMOTE,
Tao Baod7db5942015-01-28 10:07:51 -0800146 __IFLA_VTI_MAX,
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800147};
Ben Cheng655a7c02013-10-16 16:09:24 -0700148#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700149#endif