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