The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/bsd/net/if_vlan_var.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
    3  *
    4  * @APPLE_LICENSE_HEADER_START@
    5  * 
    6  * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
    7  * 
    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
   17  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
   18  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
   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.
   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  *
   53  */
   54 
   55 #ifndef _NET_IF_VLAN_VAR_H_
   56 #define _NET_IF_VLAN_VAR_H_     1
   57 #include <sys/appleapiopts.h>
   58 
   59 #ifdef __APPLE_API_PRIVATE
   60 #ifdef KERNEL
   61 struct  ifvlan {
   62         struct  arpcom ifv_ac;  /* make this an interface */
   63         struct  ifnet *ifv_p;   /* parent inteface of this vlan */
   64         struct  ifv_linkmib {
   65                 int     ifvm_parent;
   66                 u_int16_t ifvm_proto; /* encapsulation ethertype */
   67                 u_int16_t ifvm_tag; /* tag to apply on packets leaving if */
   68         }       ifv_mib;
   69 };
   70 #define ifv_if  ifv_ac.ac_if
   71 #define ifv_tag ifv_mib.ifvm_tag
   72 #endif /* KERNEL */
   73 
   74 struct  ether_vlan_header {
   75         u_char  evl_dhost[ETHER_ADDR_LEN];
   76         u_char  evl_shost[ETHER_ADDR_LEN];
   77         u_int16_t evl_encap_proto;
   78         u_int16_t evl_tag;
   79         u_int16_t evl_proto;
   80 };
   81 
   82 #define EVL_VLANOFTAG(tag) ((tag) & 4095)
   83 #define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7)
   84 #define EVL_ENCAPLEN    4       /* length in octets of encapsulation */
   85 
   86 /* When these sorts of interfaces get their own identifier... */
   87 #define IFT_8021_VLAN   IFT_PROPVIRTUAL
   88 
   89 /* sysctl(3) tags, for compatibility purposes */
   90 #define VLANCTL_PROTO   1
   91 #define VLANCTL_MAX     2
   92 
   93 /*
   94  * Configuration structure for SIOCSETVLAN and SIOCGETVLAN ioctls.
   95  */
   96 struct  vlanreq {
   97         char    vlr_parent[IFNAMSIZ];
   98         u_short vlr_tag;
   99 };
  100 #define SIOCSETVLAN     SIOCSIFGENERIC
  101 #define SIOCGETVLAN     SIOCGIFGENERIC
  102 
  103 #ifdef KERNEL
  104 /* shared with if_ethersubr.c: */
  105 extern  u_int vlan_proto;
  106 extern  int vlan_input(struct ether_header *eh, struct mbuf *m);
  107 #endif
  108 
  109 #endif /* __APPLE_API_PRIVATE */
  110 #endif /* _NET_IF_VLAN_VAR_H_ */

Cache object: 2b62b73361cb27e8a34c08bc77d9c7a5


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.