2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright 1998 Massachusetts Institute of Technology
28 * Permission to use, copy, modify, and distribute this software and
29 * its documentation for any purpose and without fee is hereby
30 * granted, provided that both the above copyright notice and this
31 * permission notice appear in all copies, that both the above
32 * copyright notice and this permission notice appear in all
33 * supporting documentation, and that the name of M.I.T. not be used
34 * in advertising or publicity pertaining to distribution of the
35 * software without specific, written prior permission. M.I.T. makes
36 * no representations about the suitability of this software for any
37 * purpose. It is provided "as is" without express or implied
40 * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
41 * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
42 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
43 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
44 * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 #ifndef _NET_IF_VLAN_VAR_H_
56 #define _NET_IF_VLAN_VAR_H_ 1
57 #include <sys/appleapiopts.h>
59 #ifdef __APPLE_API_PRIVATE
62 struct arpcom ifv_ac
; /* make this an interface */
63 struct ifnet
*ifv_p
; /* parent inteface of this vlan */
66 u_int16_t ifvm_proto
; /* encapsulation ethertype */
67 u_int16_t ifvm_tag
; /* tag to apply on packets leaving if */
70 #define ifv_if ifv_ac.ac_if
71 #define ifv_tag ifv_mib.ifvm_tag
74 struct ether_vlan_header
{
75 u_char evl_dhost
[ETHER_ADDR_LEN
];
76 u_char evl_shost
[ETHER_ADDR_LEN
];
77 u_int16_t evl_encap_proto
;
82 #define EVL_VLANOFTAG(tag) ((tag) & 4095)
83 #define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7)
84 #define EVL_ENCAPLEN 4 /* length in octets of encapsulation */
86 /* When these sorts of interfaces get their own identifier... */
87 #define IFT_8021_VLAN IFT_PROPVIRTUAL
89 /* sysctl(3) tags, for compatibility purposes */
90 #define VLANCTL_PROTO 1
94 * Configuration structure for SIOCSETVLAN and SIOCGETVLAN ioctls.
97 char vlr_parent
[IFNAMSIZ
];
100 #define SIOCSETVLAN SIOCSIFGENERIC
101 #define SIOCGETVLAN SIOCGIFGENERIC
104 /* shared with if_ethersubr.c: */
105 extern u_int vlan_proto
;
106 extern int vlan_input(struct ether_header
*eh
, struct mbuf
*m
);
109 #endif /* __APPLE_API_PRIVATE */
110 #endif /* _NET_IF_VLAN_VAR_H_ */