xref: /onnv-gate/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_vlan.h (revision 2760:38f12e308f6d)
1*2760Sdg199075 /*
2*2760Sdg199075  * CDDL HEADER START
3*2760Sdg199075  *
4*2760Sdg199075  * The contents of this file are subject to the terms of the
5*2760Sdg199075  * Common Development and Distribution License (the "License").
6*2760Sdg199075  * You may not use this file except in compliance with the License.
7*2760Sdg199075  *
8*2760Sdg199075  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2760Sdg199075  * or http://www.opensolaris.org/os/licensing.
10*2760Sdg199075  * See the License for the specific language governing permissions
11*2760Sdg199075  * and limitations under the License.
12*2760Sdg199075  *
13*2760Sdg199075  * When distributing Covered Code, include this CDDL HEADER in each
14*2760Sdg199075  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2760Sdg199075  * If applicable, add the following below this CDDL HEADER, with the
16*2760Sdg199075  * fields enclosed by brackets "[]" replaced with your own identifying
17*2760Sdg199075  * information: Portions Copyright [yyyy] [name of copyright owner]
18*2760Sdg199075  *
19*2760Sdg199075  * CDDL HEADER END
20*2760Sdg199075  */
21*2760Sdg199075 
22*2760Sdg199075 /*
23*2760Sdg199075  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*2760Sdg199075  * Use is subject to license terms.
25*2760Sdg199075  */
26*2760Sdg199075 
27*2760Sdg199075 #ifndef _SNOOP_VLAN_H
28*2760Sdg199075 #define	_SNOOP_VLAN_H
29*2760Sdg199075 
30*2760Sdg199075 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*2760Sdg199075 
32*2760Sdg199075 #include <sys/ethernet.h>
33*2760Sdg199075 
34*2760Sdg199075 #ifdef __cplusplus
35*2760Sdg199075 extern "C" {
36*2760Sdg199075 #endif
37*2760Sdg199075 
38*2760Sdg199075 /*
39*2760Sdg199075  * The offset in bytes, in a VLAN tagged packet, from the
40*2760Sdg199075  * ethernet header ethertype (which is ETHERTYPE_VLAN) to
41*2760Sdg199075  * the encapsulated ethertype.
42*2760Sdg199075  */
43*2760Sdg199075 #define	ENCAP_ETHERTYPE_OFF (offsetof(struct ether_vlan_header, ether_type) -\
44*2760Sdg199075 	    offsetof(struct ether_vlan_header, ether_tpid))
45*2760Sdg199075 
46*2760Sdg199075 /*
47*2760Sdg199075  * The offset in bytes, from the beginning of an ethernet header,
48*2760Sdg199075  * to the VLAN ID.
49*2760Sdg199075  */
50*2760Sdg199075 #define	VLAN_ID_OFFSET (offsetof(struct ether_vlan_header, ether_tci) -\
51*2760Sdg199075 	    offsetof(struct ether_vlan_header, ether_dhost))
52*2760Sdg199075 
53*2760Sdg199075 #ifdef __cplusplus
54*2760Sdg199075 }
55*2760Sdg199075 #endif
56*2760Sdg199075 
57*2760Sdg199075 #endif /* _SNOOP_VLAN_H */
58