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