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