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