]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/if_vlan_var.h
xnu-792.12.6.tar.gz
[apple/xnu.git] / bsd / net / if_vlan_var.h
1 /*
2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * Copyright 1998 Massachusetts Institute of Technology
32 *
33 * Permission to use, copy, modify, and distribute this software and
34 * its documentation for any purpose and without fee is hereby
35 * granted, provided that both the above copyright notice and this
36 * permission notice appear in all copies, that both the above
37 * copyright notice and this permission notice appear in all
38 * supporting documentation, and that the name of M.I.T. not be used
39 * in advertising or publicity pertaining to distribution of the
40 * software without specific, written prior permission. M.I.T. makes
41 * no representations about the suitability of this software for any
42 * purpose. It is provided "as is" without express or implied
43 * warranty.
44 *
45 * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
46 * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
47 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
48 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
49 * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
52 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
53 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
54 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
55 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 * SUCH DAMAGE.
57 *
58 * $FreeBSD: src/sys/net/if_vlan_var.h,v 1.16 2003/07/08 21:54:20 wpaul Exp $
59 */
60
61 #ifndef _NET_IF_VLAN_VAR_H_
62 #define _NET_IF_VLAN_VAR_H_ 1
63
64 #define ETHER_VLAN_ENCAP_LEN 4 /* len of 802.1Q VLAN encapsulation */
65 struct ether_vlan_header {
66 u_char evl_dhost[ETHER_ADDR_LEN];
67 u_char evl_shost[ETHER_ADDR_LEN];
68 u_int16_t evl_encap_proto;
69 u_int16_t evl_tag;
70 u_int16_t evl_proto;
71 };
72
73 #define EVL_VLID_MASK 0x0FFF
74 #define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK)
75 #define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7)
76
77 #if 0
78 /* sysctl(3) tags, for compatibility purposes */
79 #define VLANCTL_PROTO 1
80 #define VLANCTL_MAX 2
81 #endif 0
82
83 /*
84 * Configuration structure for SIOCSETVLAN and SIOCGETVLAN ioctls.
85 */
86 struct vlanreq {
87 char vlr_parent[IFNAMSIZ];
88 u_short vlr_tag;
89 };
90
91 #ifdef KERNEL_PRIVATE
92 int vlan_family_init(void);
93 #endif KERNEL_PRIVATE
94 #endif /* _NET_IF_VLAN_VAR_H_ */