Root/
Source at commit 1808 created 12 years 4 months ago. By blackosx, Revise layout of package installer 'Welcome' file so it looks cleaner. Change the copyright notice to begin from 2009 as seen in the Chameleon 2.0 r431 installer. Should this date be set earlier? | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2000-2008 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) 1982, 1986, 1990, 1993␊ |
30 | *␉The Regents of the University of California. 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. All advertising materials mentioning features or use of this software␊ |
41 | * must display the following acknowledgement:␊ |
42 | *␉This product includes software developed by the University of␊ |
43 | *␉California, Berkeley and its contributors.␊ |
44 | * 4. Neither the name of the University nor the names of its contributors␊ |
45 | * may be used to endorse or promote products derived from this software␊ |
46 | * without specific prior written permission.␊ |
47 | *␊ |
48 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND␊ |
49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE␊ |
50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE␊ |
51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE␊ |
52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL␊ |
53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS␊ |
54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)␊ |
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT␊ |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY␊ |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF␊ |
58 | * SUCH DAMAGE.␊ |
59 | *␊ |
60 | *␉@(#)in_pcb.h␉8.1 (Berkeley) 6/10/93␊ |
61 | * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.32.2.4 2001/08/13 16:26:17 ume Exp $␊ |
62 | */␊ |
63 | /*␊ |
64 | * NOTICE: This file was modified by SPARTA, Inc. in 2007 to introduce␊ |
65 | * support for mandatory and extensible security protections. This notice␊ |
66 | * is included in support of clause 2.2 (b) of the Apple Public License,␊ |
67 | * Version 2.0.␊ |
68 | */␊ |
69 | ␊ |
70 | #ifndef _NETINET_IN_PCB_H_␊ |
71 | #define _NETINET_IN_PCB_H_␊ |
72 | #include <sys/appleapiopts.h>␊ |
73 | ␊ |
74 | #include <sys/types.h>␊ |
75 | #include <sys/queue.h>␊ |
76 | ␊ |
77 | #include <netinet6/ipsec.h> /* for IPSEC */␊ |
78 | ␊ |
79 | typedef␉u_quad_t␉inp_gen_t;␊ |
80 | ␊ |
81 | /*␊ |
82 | * PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet.␊ |
83 | * So, AF_INET6 null laddr is also used as AF_INET null laddr,␊ |
84 | * by utilize following structure. (At last, same as INRIA)␊ |
85 | */␊ |
86 | struct in_addr_4in6 {␊ |
87 | ␉u_int32_t␉ia46_pad32[3];␊ |
88 | ␉struct␉in_addr␉ia46_addr4;␊ |
89 | };␊ |
90 | ␊ |
91 | ␊ |
92 | /*␊ |
93 | * The range of the generation count, as used in this implementation,␊ |
94 | * is 9e19. We would have to create 300 billion connections per␊ |
95 | * second for this number to roll over in a year. This seems sufficiently␊ |
96 | * unlikely that we simply don't concern ourselves with that possibility.␊ |
97 | */␊ |
98 | ␊ |
99 | /*␊ |
100 | * Interface exported to userland by various protocols which use␊ |
101 | * inpcbs. Hack alert -- only define if struct xsocket is in scope.␊ |
102 | */␊ |
103 | ␊ |
104 | /*␊ |
105 | * This is a copy of the inpcb as it shipped in Panther. This structure␊ |
106 | * is filled out in a copy function. This allows the inpcb to change␊ |
107 | * without breaking userland tools.␊ |
108 | * ␊ |
109 | * CAUTION: Many fields may not be filled out. Fewer may be filled out␊ |
110 | * in the future. Code defensively.␊ |
111 | */␊ |
112 | ␊ |
113 | #pragma pack(4)␊ |
114 | ␊ |
115 | #if defined(__LP64__)␊ |
116 | struct _inpcb_list_entry {␊ |
117 | u_int32_t␉le_next;␊ |
118 | u_int32_t␉le_prev;␊ |
119 | };␊ |
120 | #define _INPCB_PTR(x)␉␉u_int32_t␊ |
121 | #define _INPCB_LIST_ENTRY(x)␉struct _inpcb_list_entry␊ |
122 | #else␊ |
123 | #define _INPCB_PTR(x)␉␉x␊ |
124 | #define _INPCB_LIST_ENTRY(x)␉LIST_ENTRY(x)␉␊ |
125 | #endif␊ |
126 | ␊ |
127 | struct inpcbinfo;␊ |
128 | struct inpcbport;␊ |
129 | struct mbuf;␊ |
130 | struct ip6_pktopts;␊ |
131 | struct ip6_moptions;␊ |
132 | struct icmp6_filter;␊ |
133 | struct inpcbpolicy;␊ |
134 | ␊ |
135 | struct inpcb {␊ |
136 | ␉_INPCB_LIST_ENTRY(inpcb) inp_hash;␉/* hash list */␊ |
137 | ␉struct␉in_addr reserved1;␉/* APPLE reserved: inp_faddr defined in protcol indep. part */␊ |
138 | ␉struct␉in_addr reserved2; /* APPLE reserved */␊ |
139 | ␉u_short␉inp_fport;␉␉/* foreign port */␊ |
140 | ␉u_short␉inp_lport;␉␉/* local port */␊ |
141 | ␉_INPCB_LIST_ENTRY(inpcb) inp_list;␉/* list for all PCBs of this proto */␊ |
142 | ␉_INPCB_PTR(caddr_t)␉inp_ppcb;␉/* pointer to per-protocol pcb */␊ |
143 | ␉_INPCB_PTR(struct inpcbinfo *)␉inp_pcbinfo;␉/* PCB list info */␊ |
144 | ␉_INPCB_PTR(void *)␉inp_socket;␉/* back pointer to socket */␊ |
145 | ␉u_char␉nat_owner;␉␉/* Used to NAT TCP/UDP traffic */␊ |
146 | ␉u_int32_t nat_cookie;␉␉/* Cookie stored and returned to NAT */␊ |
147 | ␉_INPCB_LIST_ENTRY(inpcb) inp_portlist;␉/* list for this PCB's local port */␊ |
148 | ␉_INPCB_PTR(struct inpcbport *)␉inp_phd;␉␉/* head of this list */␊ |
149 | ␉inp_gen_t inp_gencnt;␉␉/* generation count of this instance */␊ |
150 | ␉int␉inp_flags;␉␉/* generic IP/datagram flags */␊ |
151 | ␉u_int32_t inp_flow;␊ |
152 | ␊ |
153 | ␉u_char␉inp_vflag;␊ |
154 | ␊ |
155 | ␉u_char inp_ip_ttl;␉␉/* time to live proto */␊ |
156 | ␉u_char inp_ip_p;␉␉/* protocol proto */␊ |
157 | ␉/* protocol dependent part */␊ |
158 | ␉union {␊ |
159 | ␉␉/* foreign host table entry */␊ |
160 | ␉␉struct␉in_addr_4in6 inp46_foreign;␊ |
161 | ␉␉struct␉in6_addr inp6_foreign;␊ |
162 | ␉} inp_dependfaddr;␊ |
163 | ␉union {␊ |
164 | ␉␉/* local host table entry */␊ |
165 | ␉␉struct␉in_addr_4in6 inp46_local;␊ |
166 | ␉␉struct␉in6_addr inp6_local;␊ |
167 | ␉} inp_dependladdr;␊ |
168 | ␉union {␊ |
169 | ␉␉/* placeholder for routing entry */␊ |
170 | ␉␉u_char␉inp4_route[20];␊ |
171 | ␉␉u_char␉inp6_route[32];␊ |
172 | ␉} inp_dependroute;␊ |
173 | ␉struct {␊ |
174 | ␉␉/* type of service proto */␊ |
175 | ␉␉u_char inp4_ip_tos;␊ |
176 | ␉␉/* IP options */␊ |
177 | ␉␉_INPCB_PTR(struct mbuf *) inp4_options;␊ |
178 | ␉␉/* IP multicast options */␊ |
179 | ␉␉_INPCB_PTR(struct ip_moptions *) inp4_moptions;␊ |
180 | ␉} inp_depend4;␊ |
181 | ␊ |
182 | ␉struct {␊ |
183 | ␉␉/* IP options */␊ |
184 | ␉␉_INPCB_PTR(struct mbuf *)␉inp6_options;␊ |
185 | ␉␉u_int8_t␉inp6_hlim;␊ |
186 | ␉␉u_int8_t␉unused_uint8_1;␊ |
187 | ␉␉ushort␉unused_uint16_1;␊ |
188 | ␉␉/* IP6 options for outgoing packets */␊ |
189 | ␉␉_INPCB_PTR(struct ip6_pktopts *)␉inp6_outputopts;␊ |
190 | ␉␉/* IP multicast options */␊ |
191 | ␉␉_INPCB_PTR(struct ip6_moptions *)␉inp6_moptions;␊ |
192 | ␉␉/* ICMPv6 code type filter */␊ |
193 | ␉␉_INPCB_PTR(struct icmp6_filter *)␉inp6_icmp6filt;␊ |
194 | ␉␉/* IPV6_CHECKSUM setsockopt */␊ |
195 | ␉␉int␉inp6_cksum;␊ |
196 | ␉␉u_short␉inp6_ifindex;␊ |
197 | ␉␉short␉inp6_hops;␊ |
198 | ␉} inp_depend6;␊ |
199 | ␊ |
200 | ␉int␉hash_element; /* Array index of pcb's hash list */␊ |
201 | ␉_INPCB_PTR(caddr_t)␉inp_saved_ppcb;␉/* place to save pointer while cached */␊ |
202 | ␉_INPCB_PTR(struct inpcbpolicy *)␉inp_sp;␊ |
203 | ␉u_int32_t␉reserved[3];␉/* For future use */␊ |
204 | };␊ |
205 | ␊ |
206 | struct␉xinpcb {␊ |
207 | ␉u_int32_t␉xi_len;␉␉/* length of this structure */␊ |
208 | ␉struct␉inpcb xi_inp;␊ |
209 | ␉struct␉xsocket xi_socket;␊ |
210 | ␉u_quad_t␉xi_alignment_hack;␊ |
211 | };␊ |
212 | ␊ |
213 | #if !CONFIG_EMBEDDED␊ |
214 | ␊ |
215 | struct inpcb64_list_entry {␊ |
216 | u_int64_t le_next;␊ |
217 | u_int64_t le_prev;␊ |
218 | };␊ |
219 | ␊ |
220 | struct␉xinpcb64 {␊ |
221 | ␉u_int64_t␉␉xi_len;␉␉/* length of this structure */␊ |
222 | ␉u_int64_t␉␉xi_inpp;␊ |
223 | ␉u_short ␉␉inp_fport;␉/* foreign port */␊ |
224 | ␉u_short␉␉␉inp_lport;␉/* local port */␊ |
225 | ␉struct inpcb64_list_entry␉␊ |
226 | ␉␉␉␉inp_list;␉/* list for all PCBs of this proto */␊ |
227 | ␉u_int64_t␉␉inp_ppcb;␉/* pointer to per-protocol pcb */␊ |
228 | ␉u_int64_t␉␉inp_pcbinfo;␉/* PCB list info */␊ |
229 | ␉struct inpcb64_list_entry␉␊ |
230 | ␉␉␉␉inp_portlist;␉/* list for this PCB's local port */␊ |
231 | ␉u_int64_t␉␉inp_phd;␉/* head of this list */␊ |
232 | ␉inp_gen_t␉␉inp_gencnt;␉/* generation count of this instance */␊ |
233 | ␉int␉␉␉inp_flags;␉/* generic IP/datagram flags */␊ |
234 | ␉u_int32_t␉␉inp_flow;␊ |
235 | ␉u_char␉␉␉inp_vflag;␊ |
236 | ␉u_char␉␉␉inp_ip_ttl;␉/* time to live */␊ |
237 | ␉u_char␉␉␉inp_ip_p;␉/* protocol */␊ |
238 | union {␉␉␉␉␉/* foreign host table entry */␊ |
239 | struct in_addr_4in6␉inp46_foreign;␊ |
240 | struct in6_addr␉inp6_foreign;␊ |
241 | }␉␉␉inp_dependfaddr;␊ |
242 | union {␉␉␉␉␉/* local host table entry */␊ |
243 | struct in_addr_4in6␉inp46_local;␊ |
244 | struct in6_addr␉inp6_local;␊ |
245 | }␉␉␉inp_dependladdr;␊ |
246 | struct {␊ |
247 | u_char␉␉inp4_ip_tos;␉/* type of service */␊ |
248 | }␉␉␉inp_depend4;␊ |
249 | struct {␊ |
250 | u_int8_t inp6_hlim;␊ |
251 | ␉␉int␉␉inp6_cksum;␊ |
252 | u_short␉␉inp6_ifindex;␊ |
253 | short ␉inp6_hops;␊ |
254 | }␉␉␉inp_depend6;␊ |
255 | struct xsocket64 xi_socket;␊ |
256 | ␉u_quad_t␉␉xi_alignment_hack;␊ |
257 | };␊ |
258 | ␊ |
259 | #endif /* !CONFIG_EMBEDDED */␊ |
260 | ␊ |
261 | struct␉xinpgen {␊ |
262 | ␉u_int32_t xig_len;␉/* length of this structure */␊ |
263 | ␉u_int␉xig_count;␉/* number of PCBs at this time */␊ |
264 | ␉inp_gen_t xig_gen;␉/* generation count at this time */␊ |
265 | ␉so_gen_t xig_sogen;␉/* socket generation count at this time */␊ |
266 | };␊ |
267 | ␊ |
268 | #pragma pack()␊ |
269 | ␊ |
270 | /*␊ |
271 | * These defines are for use with the inpcb.␊ |
272 | */␊ |
273 | #define INP_IPV4␉0x1␊ |
274 | #define INP_IPV6␉0x2␊ |
275 | #define␉inp_faddr␉inp_dependfaddr.inp46_foreign.ia46_addr4␊ |
276 | #define␉inp_laddr␉inp_dependladdr.inp46_local.ia46_addr4␊ |
277 | #define␉inp_route␉inp_dependroute.inp4_route␊ |
278 | #define␉inp_ip_tos␉inp_depend4.inp4_ip_tos␊ |
279 | #define␉inp_options␉inp_depend4.inp4_options␊ |
280 | #define␉inp_moptions␉inp_depend4.inp4_moptions␊ |
281 | #define␉in6p_faddr␉inp_dependfaddr.inp6_foreign␊ |
282 | #define␉in6p_laddr␉inp_dependladdr.inp6_local␊ |
283 | #define␉in6p_route␉inp_dependroute.inp6_route␊ |
284 | #define␉in6p_ip6_hlim␉inp_depend6.inp6_hlim␊ |
285 | #define␉in6p_hops␉inp_depend6.inp6_hops␉/* default hop limit */␊ |
286 | #define␉in6p_ip6_nxt␉inp_ip_p␊ |
287 | #define␉in6p_flowinfo␉inp_flow␊ |
288 | #define␉in6p_vflag␉inp_vflag␊ |
289 | #define␉in6p_options␉inp_depend6.inp6_options␊ |
290 | #define␉in6p_outputopts␉inp_depend6.inp6_outputopts␊ |
291 | #define␉in6p_moptions␉inp_depend6.inp6_moptions␊ |
292 | #define␉in6p_icmp6filt␉inp_depend6.inp6_icmp6filt␊ |
293 | #define␉in6p_cksum␉inp_depend6.inp6_cksum␊ |
294 | #define␉in6p_ifindex␉inp_depend6.inp6_ifindex␊ |
295 | #define␉in6p_flags␉inp_flags /* for KAME src sync over BSD*'s */␊ |
296 | #define␉in6p_socket␉inp_socket /* for KAME src sync over BSD*'s */␊ |
297 | #define␉in6p_lport␉inp_lport /* for KAME src sync over BSD*'s */␊ |
298 | #define␉in6p_fport␉inp_fport /* for KAME src sync over BSD*'s */␊ |
299 | #define␉in6p_ppcb␉inp_ppcb /* for KAME src sync over BSD*'s */␊ |
300 | #define␉in6p_state␉inp_state␊ |
301 | #define␉in6p_wantcnt␉inp_wantcnt␊ |
302 | ␊ |
303 | ␊ |
304 | /* flags in inp_flags: */␊ |
305 | #define␉INP_RECVOPTS␉␉0x01␉/* receive incoming IP options */␊ |
306 | #define␉INP_RECVRETOPTS␉␉0x02␉/* receive IP options for reply */␊ |
307 | #define␉INP_RECVDSTADDR␉␉0x04␉/* receive IP dst address */␊ |
308 | #define␉INP_HDRINCL␉␉0x08␉/* user supplies entire IP header */␊ |
309 | #define␉INP_HIGHPORT␉␉0x10␉/* user wants "high" port binding */␊ |
310 | #define␉INP_LOWPORT␉␉0x20␉/* user wants "low" port binding */␊ |
311 | #define␉INP_ANONPORT␉␉0x40␉/* port chosen for user */␊ |
312 | #define␉INP_RECVIF␉␉0x80␉/* receive incoming interface */␊ |
313 | #define␉INP_MTUDISC␉␉0x100␉/* user can do MTU discovery */␊ |
314 | #ifdef __APPLE__␊ |
315 | #define INP_STRIPHDR␉␉0x200␉/* Strip headers in raw_ip, for OT support */␊ |
316 | #endif␊ |
317 | #define INP_FAITH␉␉␉0x400 /* accept FAITH'ed connections */␊ |
318 | #define INP_INADDR_ANY ␉0x800 /* local address wasn't specified */␊ |
319 | ␊ |
320 | #define INP_RECVTTL␉␉0x1000␊ |
321 | #define␉INP_UDP_NOCKSUM␉␉0x2000␉/* Turn off outbound UDP checksum */␊ |
322 | #define␉INP_BOUND_IF␉␉0x4000␉/* bind socket to an ifindex */␊ |
323 | ␊ |
324 | #define IN6P_IPV6_V6ONLY␉0x008000 /* restrict AF_INET6 socket for v6 */␊ |
325 | ␊ |
326 | #define␉IN6P_PKTINFO␉␉0x010000 /* receive IP6 dst and I/F */␊ |
327 | #define␉IN6P_HOPLIMIT␉␉0x020000 /* receive hoplimit */␊ |
328 | #define␉IN6P_HOPOPTS␉␉0x040000 /* receive hop-by-hop options */␊ |
329 | #define␉IN6P_DSTOPTS␉␉0x080000 /* receive dst options after rthdr */␊ |
330 | #define␉IN6P_RTHDR␉␉␉0x100000 /* receive routing header */␊ |
331 | #define␉IN6P_RTHDRDSTOPTS␉0x200000 /* receive dstoptions before rthdr */␊ |
332 | #define␉IN6P_TCLASS␉␉␉0x400000 /* receive traffic class value */␊ |
333 | #define␉IN6P_AUTOFLOWLABEL␉0x800000 /* attach flowlabel automatically */␊ |
334 | #define␉IN6P_BINDV6ONLY␉␉0x10000000 /* do not grab IPv4 traffic */␊ |
335 | ␊ |
336 | ␊ |
337 | #endif /* !_NETINET_IN_PCB_H_ */␊ |
338 |