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