Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_IP_H |
| 8 | #define _UAPI_LINUX_IP_H |
| 9 | #include <linux/types.h> |
Christopher Ferris | 8b7fdc9 | 2023-02-21 13:36:32 -0800 | [diff] [blame] | 10 | #include <linux/stddef.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #include <asm/byteorder.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 12 | #define IPTOS_TOS_MASK 0x1E |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 13 | #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 14 | #define IPTOS_LOWDELAY 0x10 |
| 15 | #define IPTOS_THROUGHPUT 0x08 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 16 | #define IPTOS_RELIABILITY 0x04 |
| 17 | #define IPTOS_MINCOST 0x02 |
| 18 | #define IPTOS_PREC_MASK 0xE0 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 19 | #define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 20 | #define IPTOS_PREC_NETCONTROL 0xe0 |
| 21 | #define IPTOS_PREC_INTERNETCONTROL 0xc0 |
| 22 | #define IPTOS_PREC_CRITIC_ECP 0xa0 |
| 23 | #define IPTOS_PREC_FLASHOVERRIDE 0x80 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #define IPTOS_PREC_FLASH 0x60 |
| 25 | #define IPTOS_PREC_IMMEDIATE 0x40 |
| 26 | #define IPTOS_PREC_PRIORITY 0x20 |
| 27 | #define IPTOS_PREC_ROUTINE 0x00 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | #define IPOPT_COPY 0x80 |
| 29 | #define IPOPT_CLASS_MASK 0x60 |
| 30 | #define IPOPT_NUMBER_MASK 0x1f |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | #define IPOPT_COPIED(o) ((o) & IPOPT_COPY) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 32 | #define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK) |
| 33 | #define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | #define IPOPT_CONTROL 0x00 |
| 35 | #define IPOPT_RESERVED1 0x20 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #define IPOPT_MEASUREMENT 0x40 |
| 37 | #define IPOPT_RESERVED2 0x60 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 | #define IPOPT_END (0 | IPOPT_CONTROL) |
| 39 | #define IPOPT_NOOP (1 | IPOPT_CONTROL) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 40 | #define IPOPT_SEC (2 | IPOPT_CONTROL | IPOPT_COPY) |
| 41 | #define IPOPT_LSRR (3 | IPOPT_CONTROL | IPOPT_COPY) |
| 42 | #define IPOPT_TIMESTAMP (4 | IPOPT_MEASUREMENT) |
| 43 | #define IPOPT_CIPSO (6 | IPOPT_CONTROL | IPOPT_COPY) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 44 | #define IPOPT_RR (7 | IPOPT_CONTROL) |
| 45 | #define IPOPT_SID (8 | IPOPT_CONTROL | IPOPT_COPY) |
| 46 | #define IPOPT_SSRR (9 | IPOPT_CONTROL | IPOPT_COPY) |
| 47 | #define IPOPT_RA (20 | IPOPT_CONTROL | IPOPT_COPY) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | #define IPVERSION 4 |
| 49 | #define MAXTTL 255 |
| 50 | #define IPDEFTTL 64 |
| 51 | #define IPOPT_OPTVAL 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 52 | #define IPOPT_OLEN 1 |
| 53 | #define IPOPT_OFFSET 2 |
| 54 | #define IPOPT_MINOFF 4 |
| 55 | #define MAX_IPOPTLEN 40 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | #define IPOPT_NOP IPOPT_NOOP |
| 57 | #define IPOPT_EOL IPOPT_END |
| 58 | #define IPOPT_TS IPOPT_TIMESTAMP |
| 59 | #define IPOPT_TS_TSONLY 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | #define IPOPT_TS_TSANDADDR 1 |
| 61 | #define IPOPT_TS_PRESPEC 3 |
| 62 | #define IPV4_BEET_PHMAXLEN 8 |
| 63 | struct iphdr { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | #ifdef __LITTLE_ENDIAN_BITFIELD |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 65 | __u8 ihl : 4, version : 4; |
| 66 | #elif defined(__BIG_ENDIAN_BITFIELD) |
| 67 | __u8 version : 4, ihl : 4; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | #else |
| 69 | #error "Please fix <asm/byteorder.h>" |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 70 | #endif |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | __u8 tos; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | __be16 tot_len; |
| 73 | __be16 id; |
| 74 | __be16 frag_off; |
| 75 | __u8 ttl; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | __u8 protocol; |
| 77 | __sum16 check; |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 78 | __struct_group(, addrs,, __be32 saddr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | __be32 daddr; |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 80 | ); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 81 | }; |
| 82 | struct ip_auth_hdr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | __u8 nexthdr; |
| 84 | __u8 hdrlen; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 85 | __be16 reserved; |
| 86 | __be32 spi; |
| 87 | __be32 seq_no; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 88 | __u8 auth_data[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | }; |
| 90 | struct ip_esp_hdr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | __be32 spi; |
| 92 | __be32 seq_no; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 93 | __u8 enc_data[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | struct ip_comp_hdr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 96 | __u8 nexthdr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 97 | __u8 flags; |
| 98 | __be16 cpi; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 99 | }; |
| 100 | struct ip_beet_phdr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 101 | __u8 nexthdr; |
| 102 | __u8 hdrlen; |
| 103 | __u8 padlen; |
| 104 | __u8 reserved; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 106 | enum { |
| 107 | IPV4_DEVCONF_FORWARDING = 1, |
| 108 | IPV4_DEVCONF_MC_FORWARDING, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 109 | IPV4_DEVCONF_PROXY_ARP, |
| 110 | IPV4_DEVCONF_ACCEPT_REDIRECTS, |
| 111 | IPV4_DEVCONF_SECURE_REDIRECTS, |
| 112 | IPV4_DEVCONF_SEND_REDIRECTS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 113 | IPV4_DEVCONF_SHARED_MEDIA, |
| 114 | IPV4_DEVCONF_RP_FILTER, |
| 115 | IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE, |
| 116 | IPV4_DEVCONF_BOOTP_RELAY, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 117 | IPV4_DEVCONF_LOG_MARTIANS, |
| 118 | IPV4_DEVCONF_TAG, |
| 119 | IPV4_DEVCONF_ARPFILTER, |
| 120 | IPV4_DEVCONF_MEDIUM_ID, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 121 | IPV4_DEVCONF_NOXFRM, |
| 122 | IPV4_DEVCONF_NOPOLICY, |
| 123 | IPV4_DEVCONF_FORCE_IGMP_VERSION, |
| 124 | IPV4_DEVCONF_ARP_ANNOUNCE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 125 | IPV4_DEVCONF_ARP_IGNORE, |
| 126 | IPV4_DEVCONF_PROMOTE_SECONDARIES, |
| 127 | IPV4_DEVCONF_ARP_ACCEPT, |
| 128 | IPV4_DEVCONF_ARP_NOTIFY, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 129 | IPV4_DEVCONF_ACCEPT_LOCAL, |
| 130 | IPV4_DEVCONF_SRC_VMARK, |
| 131 | IPV4_DEVCONF_PROXY_ARP_PVLAN, |
| 132 | IPV4_DEVCONF_ROUTE_LOCALNET, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 133 | IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL, |
| 134 | IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 135 | IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 136 | IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 137 | IPV4_DEVCONF_DROP_GRATUITOUS_ARP, |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 138 | IPV4_DEVCONF_BC_FORWARDING, |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 139 | IPV4_DEVCONF_ARP_EVICT_NOCARRIER, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 140 | __IPV4_DEVCONF_MAX |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 141 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 142 | #define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 143 | #endif |