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