Root/
Source at commit 1548 created 12 years 10 months ago. By blackosx, Added detection for FAT format created by Lion's Disk Utility. Enhanced install log. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 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 | /*␉$FreeBSD: src/sys/netinet6/ip6_mroute.h,v 1.2.2.2 2001/07/03 11:01:53 ume Exp $␉*/␊ |
30 | /*␉$KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $␉*/␊ |
31 | ␊ |
32 | /*␊ |
33 | * Copyright (C) 1998 WIDE Project.␊ |
34 | * All rights reserved.␊ |
35 | *␊ |
36 | * Redistribution and use in source and binary forms, with or without␊ |
37 | * modification, are permitted provided that the following conditions␊ |
38 | * are met:␊ |
39 | * 1. Redistributions of source code must retain the above copyright␊ |
40 | * notice, this list of conditions and the following disclaimer.␊ |
41 | * 2. Redistributions in binary form must reproduce the above copyright␊ |
42 | * notice, this list of conditions and the following disclaimer in the␊ |
43 | * documentation and/or other materials provided with the distribution.␊ |
44 | * 3. Neither the name of the project 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 PROJECT 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 PROJECT 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 | ␊ |
61 | /*␉BSDI ip_mroute.h,v 2.5 1996/10/11 16:01:48 pjd Exp␉*/␊ |
62 | ␊ |
63 | /*␊ |
64 | * Definitions for IP multicast forwarding.␊ |
65 | *␊ |
66 | * Written by David Waitzman, BBN Labs, August 1988.␊ |
67 | * Modified by Steve Deering, Stanford, February 1989.␊ |
68 | * Modified by Ajit Thyagarajan, PARC, August 1993.␊ |
69 | * Modified by Ajit Thyagarajan, PARC, August 1994.␊ |
70 | * Modified by Ahmed Helmy, USC, September 1996.␊ |
71 | *␊ |
72 | * MROUTING Revision: 1.2␊ |
73 | */␊ |
74 | ␊ |
75 | #ifndef _NETINET6_IP6_MROUTE_H_␊ |
76 | #define _NETINET6_IP6_MROUTE_H_␊ |
77 | #include <sys/appleapiopts.h>␊ |
78 | ␊ |
79 | /*␊ |
80 | * Multicast Routing set/getsockopt commands.␊ |
81 | */␊ |
82 | #define MRT6_DONE␉␉101␉/* shut down forwarder */␊ |
83 | #define MRT6_ADD_MIF␉␉102␉/* add multicast interface */␊ |
84 | #define MRT6_DEL_MIF␉␉103␉/* delete multicast interface */␊ |
85 | #define MRT6_ADD_MFC␉␉104␉/* insert forwarding cache entry */␊ |
86 | #define MRT6_DEL_MFC␉␉105␉/* delete forwarding cache entry */␊ |
87 | #define MRT6_PIM 107 /* enable pim code */␊ |
88 | #define MRT6_INIT␉␉108␉/* initialize forwarder (mrt6msg) */␊ |
89 | ␊ |
90 | #ifdef __APPLE__␊ |
91 | #define GET_TIME(t)␉getmicrotime(&t)␊ |
92 | #endif␊ |
93 | ␊ |
94 | /*␊ |
95 | * Types and macros for handling bitmaps with one bit per multicast interface.␊ |
96 | */␊ |
97 | typedef u_short mifi_t;␉␉/* type of a mif index */␊ |
98 | #define MAXMIFS␉␉64␊ |
99 | ␊ |
100 | #ifndef␉IF_SETSIZE␊ |
101 | #define␉IF_SETSIZE␉256␊ |
102 | #endif␊ |
103 | ␊ |
104 | typedef␉u_int32_t␉if_mask;␊ |
105 | #define␉NIFBITS␉(sizeof(if_mask) * NBBY)␉/* bits per mask */␊ |
106 | ␊ |
107 | #ifndef howmany␊ |
108 | #define␉howmany(x, y)␉((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1))␊ |
109 | #endif␊ |
110 | ␊ |
111 | typedef␉struct if_set {␊ |
112 | ␉if_mask␉ifs_bits[howmany(IF_SETSIZE, NIFBITS)];␊ |
113 | } if_set;␊ |
114 | ␊ |
115 | #define␉IF_SET(n, p)␉((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))␊ |
116 | #define␉IF_CLR(n, p)␉((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))␊ |
117 | #define␉IF_ISSET(n, p)␉((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))␊ |
118 | #define␉IF_COPY(f, t)␉bcopy(f, t, sizeof(*(f)))␊ |
119 | #define␉IF_ZERO(p)␉bzero(p, sizeof(*(p)))␊ |
120 | ␊ |
121 | /*␊ |
122 | * Argument structure for MRT6_ADD_IF.␊ |
123 | */␊ |
124 | struct mif6ctl {␊ |
125 | ␉mifi_t␉ mif6c_mifi;␉ ␉/* the index of the mif to be added */␊ |
126 | ␉u_char␉ mif6c_flags; ␉/* MIFF_ flags defined below */␊ |
127 | ␉u_short␉ mif6c_pifi;␉␉/* the index of the physical IF */␊ |
128 | #if notyet␊ |
129 | ␉u_int␉ mif6c_rate_limit; /* max rate ␉␉ */␊ |
130 | #endif␊ |
131 | };␊ |
132 | ␊ |
133 | #define␉MIFF_REGISTER␉0x1␉/* mif represents a register end-point */␊ |
134 | ␊ |
135 | /*␊ |
136 | * Argument structure for MRT6_ADD_MFC and MRT6_DEL_MFC␊ |
137 | */␊ |
138 | struct mf6cctl {␊ |
139 | ␉struct sockaddr_in6 mf6cc_origin;␉/* IPv6 origin of mcasts */␊ |
140 | ␉struct sockaddr_in6 mf6cc_mcastgrp; /* multicast group associated */␊ |
141 | ␉mifi_t␉␉mf6cc_parent;␉/* incoming ifindex */␊ |
142 | ␉struct if_set␉mf6cc_ifset;␉/* set of forwarding ifs */␊ |
143 | };␊ |
144 | ␊ |
145 | /*␊ |
146 | * The kernel's multicast routing statistics.␊ |
147 | */␊ |
148 | struct mrt6stat {␊ |
149 | ␉u_quad_t mrt6s_mfc_lookups;␉/* # forw. cache hash table hits */␊ |
150 | ␉u_quad_t mrt6s_mfc_misses;␉/* # forw. cache hash table misses */␊ |
151 | ␉u_quad_t mrt6s_upcalls;␉␉/* # calls to mrouted */␊ |
152 | ␉u_quad_t mrt6s_no_route;␉/* no route for packet's origin */␊ |
153 | ␉u_quad_t mrt6s_bad_tunnel;␉/* malformed tunnel options */␊ |
154 | ␉u_quad_t mrt6s_cant_tunnel;␉/* no room for tunnel options */␊ |
155 | ␉u_quad_t mrt6s_wrong_if;␉/* arrived on wrong interface␉ */␊ |
156 | ␉u_quad_t mrt6s_upq_ovflw;␉/* upcall Q overflow␉␉ */␊ |
157 | ␉u_quad_t mrt6s_cache_cleanups;␉/* # entries with no upcalls ␉ */␊ |
158 | ␉u_quad_t mrt6s_drop_sel; ␉/* pkts dropped selectively */␊ |
159 | ␉u_quad_t mrt6s_q_overflow; ␉/* pkts dropped - Q overflow */␊ |
160 | ␉u_quad_t mrt6s_pkt2large; ␉/* pkts dropped - size > BKT SIZE */␊ |
161 | ␉u_quad_t mrt6s_upq_sockfull;␉/* upcalls dropped - socket full */␊ |
162 | };␊ |
163 | ␊ |
164 | ␊ |
165 | /*␊ |
166 | * Structure used to communicate from kernel to multicast router.␊ |
167 | * We'll overlay the structure onto an MLD header (not an IPv6 header␊ |
168 | * like igmpmsg{} used for IPv4 implementation). This is because this␊ |
169 | * structure will be passed via an IPv6 raw socket, on which an application␊ |
170 | * will only receive the payload i.e. the data after the IPv6 header and all␊ |
171 | * the extension headers. (see Section 3 of draft-ietf-ipngwg-2292bis-01)␊ |
172 | */␊ |
173 | struct mrt6msg {␊ |
174 | #define MRT6MSG_NOCACHE␉␉1␊ |
175 | #define MRT6MSG_WRONGMIF␉2␊ |
176 | #define MRT6MSG_WHOLEPKT␉3␉␉/* used for user level encap*/␊ |
177 | ␉u_char␉ im6_mbz;␉␉␉/* must be zero␉␉ */␊ |
178 | ␉u_char␉ im6_msgtype;␉␉/* what type of message␉ */␊ |
179 | ␉u_int16_t im6_mif;␉␉␉/* mif rec'd on␉␉ */␊ |
180 | ␉u_int32_t im6_pad;␉␉␉/* padding for 64bit arch */␊ |
181 | ␉struct in6_addr im6_src, im6_dst;␊ |
182 | };␊ |
183 | ␊ |
184 | /*␊ |
185 | * Argument structure used by multicast routing daemon to get src-grp␊ |
186 | * packet counts␊ |
187 | */␊ |
188 | struct sioc_sg_req6 {␊ |
189 | ␉struct sockaddr_in6 src;␊ |
190 | ␉struct sockaddr_in6 grp;␊ |
191 | ␉u_quad_t pktcnt;␊ |
192 | ␉u_quad_t bytecnt;␊ |
193 | ␉u_quad_t wrong_if;␊ |
194 | };␊ |
195 | ␊ |
196 | /*␊ |
197 | * Argument structure used by mrouted to get mif pkt counts␊ |
198 | */␊ |
199 | struct sioc_mif_req6 {␊ |
200 | ␉mifi_t mifi;␉␉/* mif number␉␉␉␉*/␊ |
201 | ␉u_quad_t icount;␉/* Input packet count on mif␉␉*/␊ |
202 | ␉u_quad_t ocount;␉/* Output packet count on mif␉␉*/␊ |
203 | ␉u_quad_t ibytes;␉/* Input byte count on mif␉␉*/␊ |
204 | ␉u_quad_t obytes;␉/* Output byte count on mif␉␉*/␊ |
205 | };␊ |
206 | ␊ |
207 | ␊ |
208 | ␊ |
209 | #endif /* !_NETINET6_IP6_MROUTE_H_ */␊ |
210 |