]> git.saurik.com Git - apple/xnu.git/blame - bsd/net/if_vlan_var.h
xnu-517.3.15.tar.gz
[apple/xnu.git] / bsd / net / if_vlan_var.h
CommitLineData
1c79356b 1/*
4a249263 2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
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
13 * file.
14 *
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
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
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.
1c79356b
A
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25/*
26 * Copyright 1998 Massachusetts Institute of Technology
27 *
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
38 * warranty.
39 *
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
51 * SUCH DAMAGE.
52 *
4a249263 53 * $FreeBSD: src/sys/net/if_vlan_var.h,v 1.16 2003/07/08 21:54:20 wpaul Exp $
1c79356b
A
54 */
55
56#ifndef _NET_IF_VLAN_VAR_H_
57#define _NET_IF_VLAN_VAR_H_ 1
1c79356b
A
58
59struct ether_vlan_header {
60 u_char evl_dhost[ETHER_ADDR_LEN];
61 u_char evl_shost[ETHER_ADDR_LEN];
62 u_int16_t evl_encap_proto;
63 u_int16_t evl_tag;
64 u_int16_t evl_proto;
65};
66
4a249263
A
67#define EVL_VLID_MASK 0x0FFF
68#define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK)
1c79356b 69#define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7)
1c79356b 70
4a249263 71#if 0
1c79356b
A
72/* sysctl(3) tags, for compatibility purposes */
73#define VLANCTL_PROTO 1
74#define VLANCTL_MAX 2
4a249263 75#endif 0
1c79356b
A
76
77/*
78 * Configuration structure for SIOCSETVLAN and SIOCGETVLAN ioctls.
79 */
80struct vlanreq {
81 char vlr_parent[IFNAMSIZ];
82 u_short vlr_tag;
83};
1c79356b
A
84
85#endif /* _NET_IF_VLAN_VAR_H_ */