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