]> git.saurik.com Git - apple/xnu.git/blame - bsd/net/if_bridgevar.h
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / bsd / net / if_bridgevar.h
CommitLineData
6d2010ae 1/*
fe8ab488 2 * Copyright (c) 2004-2014 Apple Inc. All rights reserved.
6d2010ae
A
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/*
30 * Copyright 2001 Wasabi Systems, Inc.
31 * All rights reserved.
32 *
33 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
34 *
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
37 * are met:
38 * 1. Redistributions of source code must retain the above copyright
39 * notice, this list of conditions and the following disclaimer.
40 * 2. Redistributions in binary form must reproduce the above copyright
41 * notice, this list of conditions and the following disclaimer in the
42 * documentation and/or other materials provided with the distribution.
43 * 3. All advertising materials mentioning features or use of this software
44 * must display the following acknowledgement:
45 * This product includes software developed for the NetBSD Project by
46 * Wasabi Systems, Inc.
47 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
48 * or promote products derived from this software without specific prior
49 * written permission.
50 *
51 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
52 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
53 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
54 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
55 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
56 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
57 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
58 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
59 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
60 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
61 * POSSIBILITY OF SUCH DAMAGE.
62 */
63
64/*
65 * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
66 * All rights reserved.
67 *
68 * Redistribution and use in source and binary forms, with or without
69 * modification, are permitted provided that the following conditions
70 * are met:
71 * 1. Redistributions of source code must retain the above copyright
72 * notice, this list of conditions and the following disclaimer.
73 * 2. Redistributions in binary form must reproduce the above copyright
74 * notice, this list of conditions and the following disclaimer in the
75 * documentation and/or other materials provided with the distribution.
76 * 3. All advertising materials mentioning features or use of this software
77 * must display the following acknowledgement:
78 * This product includes software developed by Jason L. Wright
79 * 4. The name of the author may not be used to endorse or promote products
80 * derived from this software without specific prior written permission.
81 *
82 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
83 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
84 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
85 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
86 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
87 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
88 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
89 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
90 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
91 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
92 * POSSIBILITY OF SUCH DAMAGE.
93 *
94 * OpenBSD: if_bridge.h,v 1.14 2001/03/22 03:48:29 jason Exp
95 *
96 * $FreeBSD$
97 */
98
99/*
100 * Data structure and control definitions for bridge interfaces.
101 */
102
103#ifndef _NET_IF_BRIDGEVAR_H_
104#define _NET_IF_BRIDGEVAR_H_
105
106#ifdef PRIVATE
107
108#include <sys/queue.h>
109
110#include <net/if.h>
111#include <net/ethernet.h>
ea3f0419 112#include <netinet/in.h>
6d2010ae
A
113
114/*
115 * Commands used in the SIOCSDRVSPEC ioctl. Note the lookup of the
116 * bridge interface itself is keyed off the ifdrv structure.
117 */
0a7de745
A
118#define BRDGADD 0 /* add bridge member (ifbreq) */
119#define BRDGDEL 1 /* delete bridge member (ifbreq) */
120#define BRDGGIFFLGS 2 /* get member if flags (ifbreq) */
121#define BRDGSIFFLGS 3 /* set member if flags (ifbreq) */
122#define BRDGSCACHE 4 /* set cache size (ifbrparam) */
123#define BRDGGCACHE 5 /* get cache size (ifbrparam) */
124#define BRDGGIFS 6 /* get member list (ifbifconf) */
125#define BRDGRTS 7 /* get address list (ifbaconf) */
126#define BRDGSADDR 8 /* set static address (ifbareq) */
127#define BRDGSTO 9 /* set cache timeout (ifbrparam) */
128#define BRDGGTO 10 /* get cache timeout (ifbrparam) */
129#define BRDGDADDR 11 /* delete address (ifbareq) */
130#define BRDGFLUSH 12 /* flush address cache (ifbreq) */
131
132#define BRDGGPRI 13 /* get priority (ifbrparam) */
133#define BRDGSPRI 14 /* set priority (ifbrparam) */
134#define BRDGGHT 15 /* get hello time (ifbrparam) */
135#define BRDGSHT 16 /* set hello time (ifbrparam) */
136#define BRDGGFD 17 /* get forward delay (ifbrparam) */
137#define BRDGSFD 18 /* set forward delay (ifbrparam) */
138#define BRDGGMA 19 /* get max age (ifbrparam) */
139#define BRDGSMA 20 /* set max age (ifbrparam) */
140#define BRDGSIFPRIO 21 /* set if priority (ifbreq) */
141#define BRDGSIFCOST 22 /* set if path cost (ifbreq) */
142#define BRDGGFILT 23 /* get filter flags (ifbrparam) */
143#define BRDGSFILT 24 /* set filter flags (ifbrparam) */
144#define BRDGPURGE 25 /* purge address cache for a particular interface (ifbreq) */
145#define BRDGADDS 26 /* add bridge span member (ifbreq) */
146#define BRDGDELS 27 /* delete bridge span member (ifbreq) */
147#define BRDGPARAM 28 /* get bridge STP params (ifbropreq) */
148#define BRDGGRTE 29 /* get cache drops (ifbrparam) */
149#define BRDGGIFSSTP 30 /* get member STP params list (ifbpstpconf) */
150#define BRDGSPROTO 31 /* set protocol (ifbrparam) */
151#define BRDGSTXHC 32 /* set tx hold count (ifbrparam) */
152#define BRDGSIFAMAX 33 /* set max interface addrs (ifbreq) */
ea3f0419
A
153#define BRDGGHOSTFILTER 34 /* get host filter (ifbrhostfilter) */
154#define BRDGSHOSTFILTER 35 /* set host filter (ifbrhostfilter) */
155#define BRDGGMACNATLIST 36 /* get MAC NAT list */
156
6d2010ae
A
157
158/*
159 * Generic bridge control request.
160 */
161#pragma pack(4)
162
163struct ifbreq {
0a7de745
A
164 char ifbr_ifsname[IFNAMSIZ]; /* member if name */
165 uint32_t ifbr_ifsflags; /* member if flags */
166 uint32_t ifbr_stpflags; /* member if STP flags */
167 uint32_t ifbr_path_cost; /* member if STP cost */
168 uint8_t ifbr_portno; /* member if port number */
169 uint8_t ifbr_priority; /* member if STP priority */
170 uint8_t ifbr_proto; /* member if STP protocol */
171 uint8_t ifbr_role; /* member if STP role */
172 uint8_t ifbr_state; /* member if STP state */
173 uint32_t ifbr_addrcnt; /* member if addr number */
174 uint32_t ifbr_addrmax; /* member if addr max */
175 uint32_t ifbr_addrexceeded; /* member if addr violations */
176 uint8_t pad[32];
6d2010ae
A
177};
178
179#pragma pack()
180
ea3f0419 181/* BRDGGIFFLGS, BRDGSIFFLGS */
0a7de745
A
182#define IFBIF_LEARNING 0x0001 /* if can learn */
183#define IFBIF_DISCOVER 0x0002 /* if sends packets w/ unknown dest. */
184#define IFBIF_STP 0x0004 /* if participates in spanning tree */
185#define IFBIF_SPAN 0x0008 /* if is a span port */
186#define IFBIF_STICKY 0x0010 /* if learned addresses stick */
187#define IFBIF_BSTP_EDGE 0x0020 /* member stp edge port */
188#define IFBIF_BSTP_AUTOEDGE 0x0040 /* member stp autoedge enabled */
189#define IFBIF_BSTP_PTP 0x0080 /* member stp point to point */
190#define IFBIF_BSTP_AUTOPTP 0x0100 /* member stp autoptp enabled */
191#define IFBIF_BSTP_ADMEDGE 0x0200 /* member stp admin edge enabled */
192#define IFBIF_BSTP_ADMCOST 0x0400 /* member stp admin path cost */
193#define IFBIF_PRIVATE 0x0800 /* if is a private segment */
ea3f0419 194#define IFBIF_MAC_NAT 0x8000 /* member requires MAC NAT */
0a7de745
A
195
196#define IFBIFBITS "\020\001LEARNING\002DISCOVER\003STP\004SPAN" \
ea3f0419
A
197 "\005STICKY\006EDGE\007AUTOEDGE\010PTP" \
198 "\011AUTOPTP\014PRIVATE" \
199 "\020MACNAT"
200
0a7de745
A
201#define IFBIFMASK ~(IFBIF_BSTP_EDGE|IFBIF_BSTP_AUTOEDGE|IFBIF_BSTP_PTP| \
202 IFBIF_BSTP_AUTOPTP|IFBIF_BSTP_ADMEDGE| \
203 IFBIF_BSTP_ADMCOST) /* not saved */
6d2010ae
A
204
205/* BRDGFLUSH */
0a7de745
A
206#define IFBF_FLUSHDYN 0x00 /* flush learned addresses only */
207#define IFBF_FLUSHALL 0x01 /* flush all addresses */
6d2010ae
A
208
209/* BRDGSFILT */
ea3f0419 210#define IFBF_FILT_USEIPF 0x00000001 /* run pf hooks on the bridge
0a7de745 211 * interface */
ea3f0419 212#define IFBF_FILT_MEMBER 0x00000002 /* run pf hooks on the member
0a7de745
A
213 * interfaces */
214#define IFBF_FILT_ONLYIP 0x00000004 /* only pass IP[46] packets when
ea3f0419 215 * pf is enabled */
0a7de745 216#define IFBF_FILT_MASK 0x00000007 /* mask of valid values */
6d2010ae 217
6d2010ae
A
218/*
219 * Interface list structure.
220 */
221
222#pragma pack(4)
223
224#ifndef XNU_KERNEL_PRIVATE
225
226struct ifbifconf {
0a7de745 227 uint32_t ifbic_len; /* buffer size */
6d2010ae 228 union {
0a7de745 229 caddr_t ifbicu_buf;
6d2010ae 230 struct ifbreq *ifbicu_req;
0a7de745
A
231#define ifbic_buf ifbic_ifbicu.ifbicu_buf
232#define ifbic_req ifbic_ifbicu.ifbicu_req
6d2010ae
A
233 } ifbic_ifbicu;
234};
235
236#else /* XNU_KERNEL_PRIVATE */
237
238struct ifbifconf32 {
0a7de745 239 uint32_t ifbic_len; /* buffer size */
6d2010ae 240 union {
0a7de745
A
241 user32_addr_t ifbicu_buf;
242 user32_addr_t ifbicu_req;
243#define ifbic_buf ifbic_ifbicu.ifbicu_buf
244#define ifbic_req ifbic_ifbicu.ifbicu_req
6d2010ae
A
245 } ifbic_ifbicu;
246};
247
248struct ifbifconf64 {
0a7de745 249 uint32_t ifbic_len; /* buffer size */
6d2010ae 250 union {
0a7de745
A
251 user64_addr_t ifbicu_buf;
252 user64_addr_t ifbicu_req;
6d2010ae
A
253 } ifbic_ifbicu;
254};
255#endif /* XNU_KERNEL_PRIVATE */
256
257#pragma pack()
258
259/*
260 * Bridge address request.
261 */
262
263#pragma pack(4)
264
265#ifndef XNU_KERNEL_PRIVATE
266
267struct ifbareq {
0a7de745
A
268 char ifba_ifsname[IFNAMSIZ]; /* member if name */
269 unsigned long ifba_expire; /* address expire time */
270 uint8_t ifba_flags; /* address flags */
271 uint8_t ifba_dst[ETHER_ADDR_LEN];/* destination address */
272 uint16_t ifba_vlan; /* vlan id */
6d2010ae
A
273};
274
275#else /* XNU_KERNEL_PRIVATE */
276
277struct ifbareq32 {
0a7de745
A
278 char ifba_ifsname[IFNAMSIZ]; /* member if name */
279 uint32_t ifba_expire; /* address expire time */
280 uint8_t ifba_flags; /* address flags */
281 uint8_t ifba_dst[ETHER_ADDR_LEN];/* destination address */
282 uint16_t ifba_vlan; /* vlan id */
6d2010ae
A
283};
284
285struct ifbareq64 {
0a7de745
A
286 char ifba_ifsname[IFNAMSIZ]; /* member if name */
287 uint64_t ifba_expire; /* address expire time */
288 uint8_t ifba_flags; /* address flags */
289 uint8_t ifba_dst[ETHER_ADDR_LEN];/* destination address */
290 uint16_t ifba_vlan; /* vlan id */
6d2010ae
A
291};
292#endif /* XNU_KERNEL_PRIVATE */
293
294#pragma pack()
295
0a7de745
A
296#define IFBAF_TYPEMASK 0x03 /* address type mask */
297#define IFBAF_DYNAMIC 0x00 /* dynamically learned address */
298#define IFBAF_STATIC 0x01 /* static address */
299#define IFBAF_STICKY 0x02 /* sticky address */
6d2010ae 300
0a7de745 301#define IFBAFBITS "\020\1STATIC\2STICKY"
6d2010ae
A
302
303/*
304 * Address list structure.
305 */
306
307#pragma pack(4)
308
309#ifndef XNU_KERNEL_PRIVATE
310
311struct ifbaconf {
0a7de745 312 uint32_t ifbac_len; /* buffer size */
6d2010ae
A
313 union {
314 caddr_t ifbacu_buf;
315 struct ifbareq *ifbacu_req;
0a7de745
A
316#define ifbac_buf ifbac_ifbacu.ifbacu_buf
317#define ifbac_req ifbac_ifbacu.ifbacu_req
6d2010ae
A
318 } ifbac_ifbacu;
319};
320
321#else /* XNU_KERNEL_PRIVATE */
322
323struct ifbaconf32 {
0a7de745 324 uint32_t ifbac_len; /* buffer size */
6d2010ae 325 union {
0a7de745
A
326 user32_addr_t ifbacu_buf;
327 user32_addr_t ifbacu_req;
328#define ifbac_buf ifbac_ifbacu.ifbacu_buf
329#define ifbac_req ifbac_ifbacu.ifbacu_req
6d2010ae
A
330 } ifbac_ifbacu;
331};
332
333struct ifbaconf64 {
0a7de745 334 uint32_t ifbac_len; /* buffer size */
6d2010ae 335 union {
0a7de745
A
336 user64_addr_t ifbacu_buf;
337 user64_addr_t ifbacu_req;
6d2010ae
A
338 } ifbac_ifbacu;
339};
340#endif /* XNU_KERNEL_PRIVATE */
341
342#pragma pack()
343
344/*
345 * Bridge parameter structure.
346 */
347
348#pragma pack(4)
349
350struct ifbrparam {
351 union {
352 uint32_t ifbrpu_int32;
353 uint16_t ifbrpu_int16;
354 uint8_t ifbrpu_int8;
355 } ifbrp_ifbrpu;
356};
357
358#pragma pack()
359
0a7de745
A
360#define ifbrp_csize ifbrp_ifbrpu.ifbrpu_int32 /* cache size */
361#define ifbrp_ctime ifbrp_ifbrpu.ifbrpu_int32 /* cache time (sec) */
362#define ifbrp_prio ifbrp_ifbrpu.ifbrpu_int16 /* bridge priority */
363#define ifbrp_proto ifbrp_ifbrpu.ifbrpu_int8 /* bridge protocol */
364#define ifbrp_txhc ifbrp_ifbrpu.ifbrpu_int8 /* bpdu tx holdcount */
365#define ifbrp_hellotime ifbrp_ifbrpu.ifbrpu_int8 /* hello time (sec) */
366#define ifbrp_fwddelay ifbrp_ifbrpu.ifbrpu_int8 /* fwd time (sec) */
367#define ifbrp_maxage ifbrp_ifbrpu.ifbrpu_int8 /* max age (sec) */
368#define ifbrp_cexceeded ifbrp_ifbrpu.ifbrpu_int32 /* # of cache dropped
369 * adresses */
370#define ifbrp_filter ifbrp_ifbrpu.ifbrpu_int32 /* filtering flags */
6d2010ae
A
371
372/*
373 * Bridge current operational parameters structure.
374 */
375
376#pragma pack(4)
377
378#ifndef XNU_KERNEL_PRIVATE
379
380struct ifbropreq {
0a7de745
A
381 uint8_t ifbop_holdcount;
382 uint8_t ifbop_maxage;
383 uint8_t ifbop_hellotime;
384 uint8_t ifbop_fwddelay;
385 uint8_t ifbop_protocol;
386 uint16_t ifbop_priority;
387 uint16_t ifbop_root_port;
388 uint32_t ifbop_root_path_cost;
389 uint64_t ifbop_bridgeid;
390 uint64_t ifbop_designated_root;
391 uint64_t ifbop_designated_bridge;
392 struct timeval ifbop_last_tc_time;
6d2010ae
A
393};
394
395#else /* XNU_KERNEL_PRIVATE */
396
397struct ifbropreq32 {
0a7de745
A
398 uint8_t ifbop_holdcount;
399 uint8_t ifbop_maxage;
400 uint8_t ifbop_hellotime;
401 uint8_t ifbop_fwddelay;
402 uint8_t ifbop_protocol;
403 uint16_t ifbop_priority;
404 uint16_t ifbop_root_port;
405 uint32_t ifbop_root_path_cost;
406 uint64_t ifbop_bridgeid;
407 uint64_t ifbop_designated_root;
408 uint64_t ifbop_designated_bridge;
409 struct timeval ifbop_last_tc_time;
6d2010ae
A
410};
411
412struct ifbropreq64 {
0a7de745
A
413 uint8_t ifbop_holdcount;
414 uint8_t ifbop_maxage;
415 uint8_t ifbop_hellotime;
416 uint8_t ifbop_fwddelay;
417 uint8_t ifbop_protocol;
418 uint16_t ifbop_priority;
419 uint16_t ifbop_root_port;
420 uint32_t ifbop_root_path_cost;
421 uint64_t ifbop_bridgeid;
422 uint64_t ifbop_designated_root;
423 uint64_t ifbop_designated_bridge;
424 struct timeval ifbop_last_tc_time;
6d2010ae
A
425};
426
427#endif
428
429#pragma pack()
430
431/*
432 * Bridge member operational STP params structure.
433 */
434
435#pragma pack(4)
436
437struct ifbpstpreq {
0a7de745
A
438 uint8_t ifbp_portno; /* bp STP port number */
439 uint32_t ifbp_fwd_trans; /* bp STP fwd transitions */
440 uint32_t ifbp_design_cost; /* bp STP designated cost */
441 uint32_t ifbp_design_port; /* bp STP designated port */
442 uint64_t ifbp_design_bridge; /* bp STP designated bridge */
443 uint64_t ifbp_design_root; /* bp STP designated root */
6d2010ae
A
444};
445
446#pragma pack()
447
448/*
449 * Bridge STP ports list structure.
450 */
451
452#pragma pack(4)
453
454#ifndef XNU_KERNEL_PRIVATE
455
456struct ifbpstpconf {
0a7de745 457 uint32_t ifbpstp_len; /* buffer size */
6d2010ae 458 union {
0a7de745 459 caddr_t ifbpstpu_buf;
6d2010ae
A
460 struct ifbpstpreq *ifbpstpu_req;
461 } ifbpstp_ifbpstpu;
0a7de745
A
462#define ifbpstp_buf ifbpstp_ifbpstpu.ifbpstpu_buf
463#define ifbpstp_req ifbpstp_ifbpstpu.ifbpstpu_req
6d2010ae
A
464};
465
466#else /* XNU_KERNEL_PRIVATE */
467
468struct ifbpstpconf32 {
0a7de745 469 uint32_t ifbpstp_len; /* buffer size */
6d2010ae 470 union {
0a7de745
A
471 user32_addr_t ifbpstpu_buf;
472 user32_addr_t ifbpstpu_req;
473#define ifbpstp_buf ifbpstp_ifbpstpu.ifbpstpu_buf
474#define ifbpstp_req ifbpstp_ifbpstpu.ifbpstpu_req
6d2010ae
A
475 } ifbpstp_ifbpstpu;
476};
477
478struct ifbpstpconf64 {
0a7de745 479 uint32_t ifbpstp_len; /* buffer size */
6d2010ae 480 union {
0a7de745
A
481 user64_addr_t ifbpstpu_buf;
482 user64_addr_t ifbpstpu_req;
6d2010ae
A
483 } ifbpstp_ifbpstpu;
484};
485
486#endif /* XNU_KERNEL_PRIVATE */
487
488#pragma pack()
489
fe8ab488
A
490/*
491 * Bridge member host filter.
492 */
493
0a7de745
A
494#define IFBRHF_ENABLED 0x01
495#define IFBRHF_HWSRC 0x02 /* Valid with enabled flags */
496#define IFBRHF_IPSRC 0x04 /* Valid with enabled flags */
fe8ab488
A
497
498#pragma pack(4)
499
500struct ifbrhostfilter {
0a7de745
A
501 uint32_t ifbrhf_flags; /* flags */
502 char ifbrhf_ifsname[IFNAMSIZ]; /* member if name */
503 uint8_t ifbrhf_hwsrca[ETHER_ADDR_LEN];
504 uint32_t ifbrhf_ipsrc;
fe8ab488
A
505};
506
507#pragma pack()
508
509/*
510 * sysctl net.link.bridge.hostfilterstats
511 */
512struct bridge_hostfilter_stats {
0a7de745
A
513 uint64_t brhf_bad_ether_type;
514 uint64_t brhf_bad_ether_srchw_addr;
515
516 uint64_t brhf_ether_too_small;
517 uint64_t brhf_ether_pullup_failed;
518
519 uint64_t brhf_arp_ok;
520 uint64_t brhf_arp_too_small;
521 uint64_t brhf_arp_pullup_failed;
522 uint64_t brhf_arp_bad_hw_type;
523 uint64_t brhf_arp_bad_pro_type;
524 uint64_t brhf_arp_bad_hw_len;
525 uint64_t brhf_arp_bad_pro_len;
526 uint64_t brhf_arp_bad_op;
527 uint64_t brhf_arp_bad_sha;
528 uint64_t brhf_arp_bad_spa;
529
530 uint64_t brhf_ip_ok;
531 uint64_t brhf_ip_too_small;
532 uint64_t brhf_ip_pullup_failed;
533 uint64_t brhf_ip_bad_srcaddr;
534 uint64_t brhf_ip_bad_proto;
535
536 uint64_t brhf_dhcp_too_small;
537 uint64_t brhf_dhcp_bad_op;
538 uint64_t brhf_dhcp_bad_htype;
539 uint64_t brhf_dhcp_bad_hlen;
540 uint64_t brhf_dhcp_bad_chaddr;
541 uint64_t brhf_dhcp_bad_ciaddr;
fe8ab488 542};
6d2010ae
A
543
544#ifdef XNU_KERNEL_PRIVATE
545
0a7de745 546extern u_int8_t bstp_etheraddr[ETHER_ADDR_LEN];
316670eb 547
0a7de745 548int bridgeattach(int);
6d2010ae
A
549
550#endif /* XNU_KERNEL_PRIVATE */
ea3f0419
A
551
552
553/*
554 * MAC NAT entry list
555 */
556
557#pragma pack(4)
558
559union ifbrip {
560 struct in_addr ifbrip_addr;
561 struct in6_addr ifbrip_addr6;
562};
563
564struct ifbrmne {
565 char ifbmne_ifname[IFNAMSIZ]; /* member if name */
566 uint64_t ifbmne_expire; /* expiration time */
567 uint8_t ifbmne_mac[ETHER_ADDR_LEN];/* MAC address */
568 uint8_t ifbmne_reserved;
569 uint8_t ifbmne_af; /* AF_INET or AF_INET6 */
570 union ifbrip ifbmne_ip;
571};
572#define ifbmne_ip_addr ifbmne_ip.ifbrip_addr
573#define ifbmne_ip6_addr ifbmne_ip.ifbrip_addr6
574
575#ifndef XNU_KERNEL_PRIVATE
576
577struct ifbrmnelist {
578 uint32_t ifbml_len; /* buffer size (multiple of elsize) */
579 uint16_t ifbml_elsize; /* sizeof(ifbrmacnatent) */
580 uint16_t ifbml_pad;
581 caddr_t ifbml_buf;
582};
583
584#else /* XNU_KERNEL_PRIVATE */
585
586struct ifbrmnelist32 {
587 uint32_t ifbml_len; /* buffer size */
588 uint16_t ifbml_elsize; /* sizeof(ifbrmacnatent) */
589 uint16_t ifbml_pad;
590 user32_addr_t ifbml_buf;
591};
592
593struct ifbrmnelist64 {
594 uint32_t ifbml_len; /* buffer size */
595 uint16_t ifbml_elsize; /* sizeof(ifbrmacnatent) */
596 uint16_t ifbml_pad;
597 user64_addr_t ifbml_buf;
598};
599
600#endif /* XNU_KERNEL_PRIVATE */
601
602#pragma pack()
603
6d2010ae
A
604#endif /* PRIVATE */
605#endif /* !_NET_IF_BRIDGEVAR_H_ */