Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/android-openjdk-build-multiarch
Path: blob/buildjre8/ios-missing-include/netinet6/nd6.h
861 views
1
/*
2
* Copyright (c) 2000-2020 Apple Inc. All rights reserved.
3
*
4
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
*
6
* This file contains Original Code and/or Modifications of Original Code
7
* as defined in and that are subject to the Apple Public Source License
8
* Version 2.0 (the 'License'). You may not use this file except in
9
* compliance with the License. The rights granted to you under the License
10
* may not be used to create, or enable the creation or redistribution of,
11
* unlawful or unlicensed copies of an Apple operating system, or to
12
* circumvent, violate, or enable the circumvention or violation of, any
13
* terms of an Apple operating system software license agreement.
14
*
15
* Please obtain a copy of the License at
16
* http://www.opensource.apple.com/apsl/ and read it before using this file.
17
*
18
* The Original Code and all software distributed under the License are
19
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23
* Please see the License for the specific language governing rights and
24
* limitations under the License.
25
*
26
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
*/
28
/*
29
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
30
* All rights reserved.
31
*
32
* Redistribution and use in source and binary forms, with or without
33
* modification, are permitted provided that the following conditions
34
* are met:
35
* 1. Redistributions of source code must retain the above copyright
36
* notice, this list of conditions and the following disclaimer.
37
* 2. Redistributions in binary form must reproduce the above copyright
38
* notice, this list of conditions and the following disclaimer in the
39
* documentation and/or other materials provided with the distribution.
40
* 3. Neither the name of the project nor the names of its contributors
41
* may be used to endorse or promote products derived from this software
42
* without specific prior written permission.
43
*
44
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
45
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
48
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54
* SUCH DAMAGE.
55
*/
56
57
#ifndef _NETINET6_ND6_H_
58
#define _NETINET6_ND6_H_
59
#include <sys/appleapiopts.h>
60
#include <net/net_kev.h>
61
62
/* see net/route.h, or net/if_inarp.h */
63
#ifndef RTF_ANNOUNCE
64
#define RTF_ANNOUNCE RTF_PROTO2
65
#endif
66
67
#include <sys/queue.h>
68
69
70
#define ND6_LLINFO_PURGE -3
71
#define ND6_LLINFO_NOSTATE -2
72
/*
73
* We don't need the WAITDELETE state any more, but we keep the definition
74
* in a comment line instead of removing it. This is necessary to avoid
75
* unintentionally reusing the value for another purpose, which might
76
* affect backward compatibility with old applications.
77
* (20000711 [email protected])
78
*/
79
/* #define ND6_LLINFO_WAITDELETE -1 */
80
#define ND6_LLINFO_INCOMPLETE 0
81
#define ND6_LLINFO_REACHABLE 1
82
#define ND6_LLINFO_STALE 2
83
#define ND6_LLINFO_DELAY 3
84
#define ND6_LLINFO_PROBE 4
85
86
87
struct nd_ifinfo {
88
u_int32_t linkmtu; /* LinkMTU */
89
u_int32_t maxmtu; /* Upper bound of LinkMTU */
90
u_int32_t basereachable; /* BaseReachableTime */
91
u_int32_t reachable; /* Reachable Time */
92
u_int32_t retrans; /* Retrans Timer */
93
u_int32_t flags; /* Flags */
94
int recalctm; /* BaseReacable re-calculation timer */
95
u_int8_t chlim; /* CurHopLimit */
96
u_int8_t receivedra;
97
/* the following 3 members are for privacy extension for addrconf */
98
u_int8_t randomseed0[8]; /* upper 64 bits of SHA1 digest */
99
u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */
100
u_int8_t randomid[8]; /* current random ID */
101
};
102
103
#define ND6_IFF_PERFORMNUD 0x1
104
#define ND6_IFF_PROXY_PREFIXES 0x20
105
#define ND6_IFF_IGNORE_NA 0x40
106
#define ND6_IFF_REPLICATED 0x100 /* sleep proxy registered */
107
#define ND6_IFF_DAD 0x200 /* Perform DAD on the interface */
108
109
extern int dad_enhanced;
110
#define ND6_DAD_ENHANCED_DEFAULT 1
111
112
struct in6_nbrinfo {
113
char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */
114
struct in6_addr addr; /* IPv6 address of the neighbor */
115
long asked; /* # of queries already sent for this addr */
116
int isrouter; /* if it acts as a router */
117
int state; /* reachability state */
118
int expire; /* lifetime for NDP state transition */
119
};
120
121
122
#define DRLSTSIZ 10
123
#define PRLSTSIZ 10
124
125
struct in6_drlist {
126
char ifname[IFNAMSIZ];
127
struct {
128
struct in6_addr rtaddr;
129
u_char flags;
130
u_short rtlifetime;
131
u_long expire;
132
u_short if_index;
133
} defrouter[DRLSTSIZ];
134
};
135
136
137
/* valid values for stateflags */
138
#define NDDRF_INSTALLED 0x01 /* installed in the routing table */
139
#define NDDRF_IFSCOPE 0x02 /* installed as a scoped route */
140
#define NDDRF_STATIC 0x04 /* for internal use only */
141
#define NDDRF_MAPPED 0x08 /* Default router addr is mapped to a different one for routing */
142
#define NDDRF_INELIGIBLE 0x10 /* Default router entry is ineligible for default router selection */
143
144
struct in6_defrouter {
145
struct sockaddr_in6 rtaddr;
146
u_char flags;
147
u_char stateflags;
148
u_short rtlifetime;
149
u_long expire;
150
u_short if_index;
151
};
152
153
154
struct in6_prlist {
155
char ifname[IFNAMSIZ];
156
struct {
157
struct in6_addr prefix;
158
struct prf_ra raflags;
159
u_char prefixlen;
160
u_char origin;
161
u_long vltime;
162
u_long pltime;
163
u_long expire;
164
u_short if_index;
165
u_short advrtrs; /* number of advertisement routers */
166
struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */
167
} prefix[PRLSTSIZ];
168
};
169
170
171
struct in6_prefix {
172
struct sockaddr_in6 prefix;
173
struct prf_ra raflags;
174
u_char prefixlen;
175
u_char origin;
176
u_long vltime;
177
u_long pltime;
178
u_long expire;
179
u_int32_t flags;
180
int refcnt;
181
u_short if_index;
182
u_short advrtrs; /* number of advertisement routers */
183
/* struct sockaddr_in6 advrtr[] */
184
};
185
186
187
struct in6_ondireq {
188
char ifname[IFNAMSIZ];
189
struct {
190
u_int32_t linkmtu; /* LinkMTU */
191
u_int32_t maxmtu; /* Upper bound of LinkMTU */
192
u_int32_t basereachable; /* BaseReachableTime */
193
u_int32_t reachable; /* Reachable Time */
194
u_int32_t retrans; /* Retrans Timer */
195
u_int32_t flags; /* Flags */
196
int recalctm; /* BaseReacable re-calculation timer */
197
u_int8_t chlim; /* CurHopLimit */
198
/* Number of routers learned on the interface */
199
u_int8_t receivedra;
200
/*
201
* The current collision count value
202
* being used for secure address generation.
203
*/
204
u_int8_t collision_count;
205
} ndi;
206
};
207
208
struct in6_ndireq {
209
char ifname[IFNAMSIZ];
210
struct nd_ifinfo ndi;
211
};
212
213
struct in6_ndifreq {
214
char ifname[IFNAMSIZ];
215
u_long ifindex;
216
};
217
218
#define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */
219
#define RTR_SOLICITATION_INTERVAL 4 /* 4sec */
220
221
222
/* Prefix status */
223
#define NDPRF_ONLINK 0x1
224
#define NDPRF_DETACHED 0x2
225
#define NDPRF_STATIC 0x100
226
#define NDPRF_IFSCOPE 0x1000
227
#define NDPRF_PRPROXY 0x2000
228
229
/* protocol constants */
230
#define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */
231
#define RTR_SOLICITATION_INTERVAL 4 /* 4sec */
232
#define MAX_RTR_SOLICITATIONS 3
233
234
#define ND6_INFINITE_LIFETIME 0xffffffff
235
#define ND6_MAX_LIFETIME 0x7fffffff
236
237
238
239
240
241
/* nd6_send.c */
242
#endif /* _NETINET6_ND6_H_ */
243
244