blob: 9249f5ca7f7415e8d0f079b658f30835c1309acc [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_LINUX_IP_H
20#define _UAPI_LINUX_IP_H
21#include <linux/types.h>
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080022#include <linux/stddef.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define IPTOS_TOS_MASK 0x1E
Tao Baod7db5942015-01-28 10:07:51 -080025#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define IPTOS_LOWDELAY 0x10
27#define IPTOS_THROUGHPUT 0x08
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define IPTOS_RELIABILITY 0x04
29#define IPTOS_MINCOST 0x02
30#define IPTOS_PREC_MASK 0xE0
Tao Baod7db5942015-01-28 10:07:51 -080031#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define IPTOS_PREC_NETCONTROL 0xe0
33#define IPTOS_PREC_INTERNETCONTROL 0xc0
34#define IPTOS_PREC_CRITIC_ECP 0xa0
35#define IPTOS_PREC_FLASHOVERRIDE 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define IPTOS_PREC_FLASH 0x60
37#define IPTOS_PREC_IMMEDIATE 0x40
38#define IPTOS_PREC_PRIORITY 0x20
39#define IPTOS_PREC_ROUTINE 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define IPOPT_COPY 0x80
41#define IPOPT_CLASS_MASK 0x60
42#define IPOPT_NUMBER_MASK 0x1f
Tao Baod7db5942015-01-28 10:07:51 -080043#define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
Tao Baod7db5942015-01-28 10:07:51 -080044#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
45#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
Ben Cheng655a7c02013-10-16 16:09:24 -070046#define IPOPT_CONTROL 0x00
47#define IPOPT_RESERVED1 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define IPOPT_MEASUREMENT 0x40
49#define IPOPT_RESERVED2 0x60
Tao Baod7db5942015-01-28 10:07:51 -080050#define IPOPT_END (0 | IPOPT_CONTROL)
51#define IPOPT_NOOP (1 | IPOPT_CONTROL)
Tao Baod7db5942015-01-28 10:07:51 -080052#define IPOPT_SEC (2 | IPOPT_CONTROL | IPOPT_COPY)
53#define IPOPT_LSRR (3 | IPOPT_CONTROL | IPOPT_COPY)
54#define IPOPT_TIMESTAMP (4 | IPOPT_MEASUREMENT)
55#define IPOPT_CIPSO (6 | IPOPT_CONTROL | IPOPT_COPY)
Tao Baod7db5942015-01-28 10:07:51 -080056#define IPOPT_RR (7 | IPOPT_CONTROL)
57#define IPOPT_SID (8 | IPOPT_CONTROL | IPOPT_COPY)
58#define IPOPT_SSRR (9 | IPOPT_CONTROL | IPOPT_COPY)
59#define IPOPT_RA (20 | IPOPT_CONTROL | IPOPT_COPY)
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define IPVERSION 4
61#define MAXTTL 255
62#define IPDEFTTL 64
63#define IPOPT_OPTVAL 0
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define IPOPT_OLEN 1
65#define IPOPT_OFFSET 2
66#define IPOPT_MINOFF 4
67#define MAX_IPOPTLEN 40
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define IPOPT_NOP IPOPT_NOOP
69#define IPOPT_EOL IPOPT_END
70#define IPOPT_TS IPOPT_TIMESTAMP
71#define IPOPT_TS_TSONLY 0
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define IPOPT_TS_TSANDADDR 1
73#define IPOPT_TS_PRESPEC 3
74#define IPV4_BEET_PHMAXLEN 8
75struct iphdr {
Ben Cheng655a7c02013-10-16 16:09:24 -070076#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080077 __u8 ihl : 4, version : 4;
78#elif defined(__BIG_ENDIAN_BITFIELD)
79 __u8 version : 4, ihl : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -070080#else
81#error "Please fix <asm/byteorder.h>"
Ben Cheng655a7c02013-10-16 16:09:24 -070082#endif
Tao Baod7db5942015-01-28 10:07:51 -080083 __u8 tos;
Tao Baod7db5942015-01-28 10:07:51 -080084 __be16 tot_len;
85 __be16 id;
86 __be16 frag_off;
87 __u8 ttl;
Tao Baod7db5942015-01-28 10:07:51 -080088 __u8 protocol;
89 __sum16 check;
Christopher Ferris6cd53a52022-12-12 23:39:16 +000090 __struct_group(, addrs,, __be32 saddr;
Tao Baod7db5942015-01-28 10:07:51 -080091 __be32 daddr;
Christopher Ferris6cd53a52022-12-12 23:39:16 +000092 );
Ben Cheng655a7c02013-10-16 16:09:24 -070093};
94struct ip_auth_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080095 __u8 nexthdr;
96 __u8 hdrlen;
Tao Baod7db5942015-01-28 10:07:51 -080097 __be16 reserved;
98 __be32 spi;
99 __be32 seq_no;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700100 __u8 auth_data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700101};
102struct ip_esp_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800103 __be32 spi;
104 __be32 seq_no;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700105 __u8 enc_data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700106};
Ben Cheng655a7c02013-10-16 16:09:24 -0700107struct ip_comp_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800108 __u8 nexthdr;
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u8 flags;
110 __be16 cpi;
Ben Cheng655a7c02013-10-16 16:09:24 -0700111};
112struct ip_beet_phdr {
Tao Baod7db5942015-01-28 10:07:51 -0800113 __u8 nexthdr;
114 __u8 hdrlen;
115 __u8 padlen;
116 __u8 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -0700117};
Tao Baod7db5942015-01-28 10:07:51 -0800118enum {
119 IPV4_DEVCONF_FORWARDING = 1,
120 IPV4_DEVCONF_MC_FORWARDING,
Tao Baod7db5942015-01-28 10:07:51 -0800121 IPV4_DEVCONF_PROXY_ARP,
122 IPV4_DEVCONF_ACCEPT_REDIRECTS,
123 IPV4_DEVCONF_SECURE_REDIRECTS,
124 IPV4_DEVCONF_SEND_REDIRECTS,
Tao Baod7db5942015-01-28 10:07:51 -0800125 IPV4_DEVCONF_SHARED_MEDIA,
126 IPV4_DEVCONF_RP_FILTER,
127 IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
128 IPV4_DEVCONF_BOOTP_RELAY,
Tao Baod7db5942015-01-28 10:07:51 -0800129 IPV4_DEVCONF_LOG_MARTIANS,
130 IPV4_DEVCONF_TAG,
131 IPV4_DEVCONF_ARPFILTER,
132 IPV4_DEVCONF_MEDIUM_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800133 IPV4_DEVCONF_NOXFRM,
134 IPV4_DEVCONF_NOPOLICY,
135 IPV4_DEVCONF_FORCE_IGMP_VERSION,
136 IPV4_DEVCONF_ARP_ANNOUNCE,
Tao Baod7db5942015-01-28 10:07:51 -0800137 IPV4_DEVCONF_ARP_IGNORE,
138 IPV4_DEVCONF_PROMOTE_SECONDARIES,
139 IPV4_DEVCONF_ARP_ACCEPT,
140 IPV4_DEVCONF_ARP_NOTIFY,
Tao Baod7db5942015-01-28 10:07:51 -0800141 IPV4_DEVCONF_ACCEPT_LOCAL,
142 IPV4_DEVCONF_SRC_VMARK,
143 IPV4_DEVCONF_PROXY_ARP_PVLAN,
144 IPV4_DEVCONF_ROUTE_LOCALNET,
Tao Baod7db5942015-01-28 10:07:51 -0800145 IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
146 IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800147 IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700148 IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700149 IPV4_DEVCONF_DROP_GRATUITOUS_ARP,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700150 IPV4_DEVCONF_BC_FORWARDING,
Christopher Ferrisa4792612022-01-10 13:51:15 -0800151 IPV4_DEVCONF_ARP_EVICT_NOCARRIER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700152 __IPV4_DEVCONF_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800153};
Christopher Ferris38062f92014-07-09 15:33:25 -0700154#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700155#endif