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 */ 7 #ifndef _UAPI_LINUX_IN_H 8 #define _UAPI_LINUX_IN_H 9 #include <bits/ip_msfilter.h> 10 #include <bits/ip_mreq_source.h> 11 #include <bits/in_addr.h> 12 #include <linux/types.h> 13 #include <linux/stddef.h> 14 #include <linux/libc-compat.h> 15 #include <linux/socket.h> 16 #if __UAPI_DEF_IN_IPPROTO 17 enum { 18 IPPROTO_IP = 0, 19 #define IPPROTO_IP IPPROTO_IP 20 IPPROTO_ICMP = 1, 21 #define IPPROTO_ICMP IPPROTO_ICMP 22 IPPROTO_IGMP = 2, 23 #define IPPROTO_IGMP IPPROTO_IGMP 24 IPPROTO_IPIP = 4, 25 #define IPPROTO_IPIP IPPROTO_IPIP 26 IPPROTO_TCP = 6, 27 #define IPPROTO_TCP IPPROTO_TCP 28 IPPROTO_EGP = 8, 29 #define IPPROTO_EGP IPPROTO_EGP 30 IPPROTO_PUP = 12, 31 #define IPPROTO_PUP IPPROTO_PUP 32 IPPROTO_UDP = 17, 33 #define IPPROTO_UDP IPPROTO_UDP 34 IPPROTO_IDP = 22, 35 #define IPPROTO_IDP IPPROTO_IDP 36 IPPROTO_TP = 29, 37 #define IPPROTO_TP IPPROTO_TP 38 IPPROTO_DCCP = 33, 39 #define IPPROTO_DCCP IPPROTO_DCCP 40 IPPROTO_IPV6 = 41, 41 #define IPPROTO_IPV6 IPPROTO_IPV6 42 IPPROTO_RSVP = 46, 43 #define IPPROTO_RSVP IPPROTO_RSVP 44 IPPROTO_GRE = 47, 45 #define IPPROTO_GRE IPPROTO_GRE 46 IPPROTO_ESP = 50, 47 #define IPPROTO_ESP IPPROTO_ESP 48 IPPROTO_AH = 51, 49 #define IPPROTO_AH IPPROTO_AH 50 IPPROTO_MTP = 92, 51 #define IPPROTO_MTP IPPROTO_MTP 52 IPPROTO_BEETPH = 94, 53 #define IPPROTO_BEETPH IPPROTO_BEETPH 54 IPPROTO_ENCAP = 98, 55 #define IPPROTO_ENCAP IPPROTO_ENCAP 56 IPPROTO_PIM = 103, 57 #define IPPROTO_PIM IPPROTO_PIM 58 IPPROTO_COMP = 108, 59 #define IPPROTO_COMP IPPROTO_COMP 60 IPPROTO_L2TP = 115, 61 #define IPPROTO_L2TP IPPROTO_L2TP 62 IPPROTO_SCTP = 132, 63 #define IPPROTO_SCTP IPPROTO_SCTP 64 IPPROTO_UDPLITE = 136, 65 #define IPPROTO_UDPLITE IPPROTO_UDPLITE 66 IPPROTO_MPLS = 137, 67 #define IPPROTO_MPLS IPPROTO_MPLS 68 IPPROTO_ETHERNET = 143, 69 #define IPPROTO_ETHERNET IPPROTO_ETHERNET 70 IPPROTO_RAW = 255, 71 #define IPPROTO_RAW IPPROTO_RAW 72 IPPROTO_MPTCP = 262, 73 #define IPPROTO_MPTCP IPPROTO_MPTCP 74 IPPROTO_MAX 75 }; 76 #endif 77 #if __UAPI_DEF_IN_ADDR 78 #endif 79 #define IP_TOS 1 80 #define IP_TTL 2 81 #define IP_HDRINCL 3 82 #define IP_OPTIONS 4 83 #define IP_ROUTER_ALERT 5 84 #define IP_RECVOPTS 6 85 #define IP_RETOPTS 7 86 #define IP_PKTINFO 8 87 #define IP_PKTOPTIONS 9 88 #define IP_MTU_DISCOVER 10 89 #define IP_RECVERR 11 90 #define IP_RECVTTL 12 91 #define IP_RECVTOS 13 92 #define IP_MTU 14 93 #define IP_FREEBIND 15 94 #define IP_IPSEC_POLICY 16 95 #define IP_XFRM_POLICY 17 96 #define IP_PASSSEC 18 97 #define IP_TRANSPARENT 19 98 #define IP_RECVRETOPTS IP_RETOPTS 99 #define IP_ORIGDSTADDR 20 100 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR 101 #define IP_MINTTL 21 102 #define IP_NODEFRAG 22 103 #define IP_CHECKSUM 23 104 #define IP_BIND_ADDRESS_NO_PORT 24 105 #define IP_RECVFRAGSIZE 25 106 #define IP_RECVERR_RFC4884 26 107 #define IP_PMTUDISC_DONT 0 108 #define IP_PMTUDISC_WANT 1 109 #define IP_PMTUDISC_DO 2 110 #define IP_PMTUDISC_PROBE 3 111 #define IP_PMTUDISC_INTERFACE 4 112 #define IP_PMTUDISC_OMIT 5 113 #define IP_MULTICAST_IF 32 114 #define IP_MULTICAST_TTL 33 115 #define IP_MULTICAST_LOOP 34 116 #define IP_ADD_MEMBERSHIP 35 117 #define IP_DROP_MEMBERSHIP 36 118 #define IP_UNBLOCK_SOURCE 37 119 #define IP_BLOCK_SOURCE 38 120 #define IP_ADD_SOURCE_MEMBERSHIP 39 121 #define IP_DROP_SOURCE_MEMBERSHIP 40 122 #define IP_MSFILTER 41 123 #define MCAST_JOIN_GROUP 42 124 #define MCAST_BLOCK_SOURCE 43 125 #define MCAST_UNBLOCK_SOURCE 44 126 #define MCAST_LEAVE_GROUP 45 127 #define MCAST_JOIN_SOURCE_GROUP 46 128 #define MCAST_LEAVE_SOURCE_GROUP 47 129 #define MCAST_MSFILTER 48 130 #define IP_MULTICAST_ALL 49 131 #define IP_UNICAST_IF 50 132 #define IP_LOCAL_PORT_RANGE 51 133 #define IP_PROTOCOL 52 134 #define MCAST_EXCLUDE 0 135 #define MCAST_INCLUDE 1 136 #define IP_DEFAULT_MULTICAST_TTL 1 137 #define IP_DEFAULT_MULTICAST_LOOP 1 138 #if __UAPI_DEF_IP_MREQ 139 struct ip_mreq { 140 struct in_addr imr_multiaddr; 141 struct in_addr imr_interface; 142 }; 143 struct ip_mreqn { 144 struct in_addr imr_multiaddr; 145 struct in_addr imr_address; 146 int imr_ifindex; 147 }; 148 #define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter) - sizeof(__u32) + (numsrc) * sizeof(__u32)) 149 struct group_req { 150 __u32 gr_interface; 151 struct sockaddr_storage gr_group; 152 }; 153 struct group_source_req { 154 __u32 gsr_interface; 155 struct sockaddr_storage gsr_group; 156 struct sockaddr_storage gsr_source; 157 }; 158 struct group_filter { 159 union { 160 struct { 161 __u32 gf_interface_aux; 162 struct sockaddr_storage gf_group_aux; 163 __u32 gf_fmode_aux; 164 __u32 gf_numsrc_aux; 165 struct sockaddr_storage gf_slist[1]; 166 }; 167 struct { 168 __u32 gf_interface; 169 struct sockaddr_storage gf_group; 170 __u32 gf_fmode; 171 __u32 gf_numsrc; 172 struct sockaddr_storage gf_slist_flex[]; 173 }; 174 }; 175 }; 176 #define GROUP_FILTER_SIZE(numsrc) (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) + (numsrc) * sizeof(struct sockaddr_storage)) 177 #endif 178 #if __UAPI_DEF_IN_PKTINFO 179 struct in_pktinfo { 180 int ipi_ifindex; 181 struct in_addr ipi_spec_dst; 182 struct in_addr ipi_addr; 183 }; 184 #endif 185 #if __UAPI_DEF_SOCKADDR_IN 186 #define __SOCK_SIZE__ 16 187 struct sockaddr_in { 188 __kernel_sa_family_t sin_family; 189 __be16 sin_port; 190 struct in_addr sin_addr; 191 unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) - sizeof(unsigned short int) - sizeof(struct in_addr)]; 192 }; 193 #define sin_zero __pad 194 #endif 195 #if __UAPI_DEF_IN_CLASS 196 #define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0) 197 #define IN_CLASSA_NET 0xff000000 198 #define IN_CLASSA_NSHIFT 24 199 #define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) 200 #define IN_CLASSA_MAX 128 201 #define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000) 202 #define IN_CLASSB_NET 0xffff0000 203 #define IN_CLASSB_NSHIFT 16 204 #define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) 205 #define IN_CLASSB_MAX 65536 206 #define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000) 207 #define IN_CLASSC_NET 0xffffff00 208 #define IN_CLASSC_NSHIFT 8 209 #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) 210 #define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000) 211 #define IN_MULTICAST(a) IN_CLASSD(a) 212 #define IN_MULTICAST_NET 0xe0000000 213 #define IN_BADCLASS(a) (((long int) (a)) == (long int) 0xffffffff) 214 #define IN_EXPERIMENTAL(a) IN_BADCLASS((a)) 215 #define IN_CLASSE(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000) 216 #define IN_CLASSE_NET 0xffffffff 217 #define IN_CLASSE_NSHIFT 0 218 #define INADDR_ANY ((unsigned long int) 0x00000000) 219 #define INADDR_BROADCAST ((unsigned long int) 0xffffffff) 220 #define INADDR_NONE ((unsigned long int) 0xffffffff) 221 #define INADDR_DUMMY ((unsigned long int) 0xc0000008) 222 #define IN_LOOPBACKNET 127 223 #define INADDR_LOOPBACK 0x7f000001 224 #define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000) 225 #define INADDR_UNSPEC_GROUP 0xe0000000U 226 #define INADDR_ALLHOSTS_GROUP 0xe0000001U 227 #define INADDR_ALLRTRS_GROUP 0xe0000002U 228 #define INADDR_ALLSNOOPERS_GROUP 0xe000006aU 229 #define INADDR_MAX_LOCAL_GROUP 0xe00000ffU 230 #endif 231 #include <asm/byteorder.h> 232 #endif 233