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