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/net/if_atm.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 /*      $NetBSD: if_atm.h,v 1.15 2005/12/11 23:05:24 thorpej Exp $       */
    2 
    3 /*
    4  *
    5  * Copyright (c) 1996 Charles D. Cranor and Washington University.
    6  * All rights reserved.
    7  *
    8  * Redistribution and use in source and binary forms, with or without
    9  * modification, are permitted provided that the following conditions
   10  * are met:
   11  * 1. Redistributions of source code must retain the above copyright
   12  *    notice, this list of conditions and the following disclaimer.
   13  * 2. Redistributions in binary form must reproduce the above copyright
   14  *    notice, this list of conditions and the following disclaimer in the
   15  *    documentation and/or other materials provided with the distribution.
   16  * 3. All advertising materials mentioning features or use of this software
   17  *    must display the following acknowledgement:
   18  *      This product includes software developed by Charles D. Cranor and
   19  *      Washington University.
   20  * 4. The name of the author may not be used to endorse or promote products
   21  *    derived from this software without specific prior written permission.
   22  *
   23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   26  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   28  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   32  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   33  */
   34 
   35 /*
   36  * net/if_atm.h
   37  */
   38 
   39 #ifndef _NET_IF_ATM_H_
   40 #define _NET_IF_ATM_H_
   41 
   42 #if (defined(__FreeBSD__) || defined(__bsdi__)) && defined(KERNEL)
   43 #ifndef _KERNEL
   44 #define _KERNEL
   45 #endif
   46 #endif /* freebsd doesn't define _KERNEL */
   47 
   48 #ifndef NO_ATM_PVCEXT
   49 /*
   50  * ATM_PVCEXT enables PVC extension: VP/VC shaping
   51  * and PVC shadow interfaces.
   52  */
   53 #define ATM_PVCEXT      /* enable pvc extension */
   54 #endif
   55 
   56 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
   57 #define RTALLOC1(A,B)           rtalloc1((A),(B))
   58 #elif defined(__FreeBSD__)
   59 #define RTALLOC1(A,B)           rtalloc1((A),(B),0UL)
   60 #endif
   61 
   62 /*
   63  * pseudo header for packet transmission
   64  */
   65 
   66 struct atm_pseudohdr {
   67   u_int8_t atm_ph[4];   /* flags+VPI+VCI1(msb)+VCI2(lsb) */
   68 };
   69 
   70 #define ATM_PH_FLAGS(X) ((X)->atm_ph[0])
   71 #define ATM_PH_VPI(X)   ((X)->atm_ph[1])
   72 #define ATM_PH_VCI(X)   ((((X)->atm_ph[2]) << 8) | ((X)->atm_ph[3]))
   73 #define ATM_PH_SETVCI(X,V) { \
   74         (X)->atm_ph[2] = ((V) >> 8) & 0xff; \
   75         (X)->atm_ph[3] = ((V) & 0xff); \
   76 }
   77 
   78 #define ATM_PH_AAL5    0x01     /* use AAL5? (0 == aal0) */
   79 #define ATM_PH_LLCSNAP 0x02     /* use the LLC SNAP encoding (iff aal5) */
   80 
   81 #ifdef ATM_PVCEXT
   82 #define ATM_PH_INERNAL  0x20    /* reserve for kernel internal use */
   83 #endif
   84 #define ATM_PH_DRIVER7  0x40    /* reserve for driver's use */
   85 #define ATM_PH_DRIVER8  0x80    /* reserve for driver's use */
   86 
   87 #define ATMMTU          9180    /* ATM MTU size for IP */
   88                                 /* XXX: could be 9188 with LLC/SNAP according
   89                                         to comer */
   90 
   91 /* user's ioctl hook for raw atm mode */
   92 #define SIOCRAWATM      _IOWR('a', 122, int)    /* set driver's raw mode */
   93 
   94 /* atm_pseudoioctl: turns on and off RX VCIs  [for internal use only!] */
   95 struct atm_pseudoioctl {
   96   struct atm_pseudohdr aph;
   97   void *rxhand;
   98 };
   99 #define SIOCATMENA      _IOWR('a', 123, struct atm_pseudoioctl) /* enable */
  100 #define SIOCATMDIS      _IOWR('a', 124, struct atm_pseudoioctl) /* disable */
  101 
  102 #ifdef ATM_PVCEXT
  103 
  104 /* structure to control PVC transmitter */
  105 struct pvctxreq {
  106     /* first entry must be compatible with struct ifreq */
  107     char pvc_ifname[IFNAMSIZ];          /* if name, e.g. "en0" */
  108     struct atm_pseudohdr pvc_aph;       /* (flags) + vpi:vci */
  109     struct atm_pseudohdr pvc_joint;     /* for vp shaping: another vc
  110                                            to share the shaper */
  111     int pvc_pcr;                        /* peak cell rate (shaper value) */
  112 };
  113 
  114 /* use ifioctl for now */
  115 #define SIOCSPVCTX      _IOWR('i', 95, struct pvctxreq)
  116 #define SIOCGPVCTX      _IOWR('i', 96, struct pvctxreq)
  117 #define SIOCSPVCSIF     _IOWR('i', 97, struct ifreq)
  118 #define SIOCGPVCSIF     _IOWR('i', 98, struct ifreq)
  119 
  120 #endif /* ATM_PVCEXT */
  121 
  122 /*
  123  * XXX forget all the garbage in if_llc.h and do it the easy way
  124  */
  125 
  126 #define ATMLLC_HDR "\252\252\3\0\0\0"
  127 struct atmllc {
  128   u_int8_t llchdr[6];   /* aa.aa.03.00.00.00 */
  129   u_int8_t type[2];     /* "ethernet" type */
  130 } __attribute__((__packed__));
  131 
  132 /* ATM_LLC macros: note type code in host byte order */
  133 #define ATM_LLC_TYPE(X) (((X)->type[0] << 8) | ((X)->type[1]))
  134 #define ATM_LLC_SETTYPE(X,V) { \
  135         (X)->type[0] = ((V) >> 8) & 0xff; \
  136         (X)->type[1] = ((V) & 0xff); \
  137 }
  138 
  139 #ifdef _KERNEL
  140 void    atm_ifattach(struct ifnet *);
  141 void    atm_input(struct ifnet *, struct atm_pseudohdr *,
  142                 struct mbuf *, void *);
  143 int     atm_output(struct ifnet *, struct mbuf *, struct sockaddr *,
  144                 struct rtentry *);
  145 #endif
  146 #ifdef ATM_PVCEXT
  147 #ifdef _KERNEL
  148 #include <sys/queue.h>
  149 /*
  150  * ATM PVC subinterface: a trick to assign a subinterface
  151  * to a PVC.
  152  * with a pvc subinterface, each PVC looks like an individual
  153  * Point-to-Point interface.
  154  * as opposed to the NBMA model, a pvc subinterface is inherently
  155  * multicast capable (no LANE/MARS required).
  156  */
  157 struct pvcsif {
  158         /*
  159          * The ifnet struct _must_ be at the head of this structure.
  160          */
  161         struct ifnet sif_if;            /* ifnet structure per pvc */
  162         struct atm_pseudohdr sif_aph;   /* flags + vpi:vci */
  163         int     sif_vci;                /* vci no */
  164         LIST_ENTRY(pvcsif) sif_links;
  165 };
  166 struct ifnet *pvcsif_alloc(void);
  167 #endif
  168 #endif /* ATM_PVCEXT */
  169 #endif /* !_NET_IF_ATM_H_ */

Cache object: 79ed87c9dbe6bb0c4f1e3526bae185d4


[ 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.