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/netnatm/natm.h

Version: -  FREEBSD  -  FREEBSD11  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 1996 Charles D. Cranor and Washington University.
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. All advertising materials mentioning features or use of this software
   14  *    must display the following acknowledgement:
   15  *      This product includes software developed by Charles D. Cranor and
   16  *      Washington University.
   17  * 4. The name of the author may not be used to endorse or promote products
   18  *    derived from this software without specific prior written permission.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   30  *
   31  * $NetBSD: natm.h,v 1.1 1996/07/04 03:20:12 chuck Exp $
   32  * $FreeBSD: stable/9/sys/netnatm/natm.h 168776 2007-04-16 12:31:35Z pjd $
   33  */
   34 
   35 /*
   36  * natm.h: native mode atm
   37  */
   38 
   39 /*
   40  * supported protocols
   41  */
   42 #define PROTO_NATMAAL0          1
   43 #define PROTO_NATMAAL5          2       
   44 
   45 /*
   46  * sockaddr_natm
   47  */
   48 
   49 struct sockaddr_natm {
   50         unsigned char   snatm_len;              /* length */
   51         sa_family_t     snatm_family;           /* AF_NATM */
   52         char            snatm_if[IFNAMSIZ];     /* interface name */
   53         u_int16_t       snatm_vci;              /* vci */
   54         u_int8_t        snatm_vpi;              /* vpi */
   55 };
   56 
   57 #ifdef _KERNEL
   58 
   59 /*
   60  * natm protocol control block
   61  */
   62 struct natmpcb {
   63         LIST_ENTRY(natmpcb) pcblist;    /* list pointers */
   64         u_int           npcb_inq;       /* # of our pkts in proto q */
   65         struct socket   *npcb_socket;   /* backpointer to socket */
   66         struct ifnet    *npcb_ifp;      /* pointer to hardware */
   67         struct in_addr  ipaddr;         /* remote IP address, if APCB_IP */
   68         u_int16_t       npcb_vci;       /* VCI */
   69         u_int8_t        npcb_vpi;       /* VPI */
   70         u_int8_t        npcb_flags;     /* flags */
   71 };
   72 
   73 /* flags */
   74 #define NPCB_FREE       0x01            /* free (not on any list) */
   75 #define NPCB_CONNECTED  0x02            /* connected */
   76 #define NPCB_IP         0x04            /* used by IP */
   77 #define NPCB_DRAIN      0x08            /* destroy as soon as inq == 0 */
   78 
   79 /* flag arg to npcb_free */
   80 #define NPCB_REMOVE     0               /* remove from global list */
   81 #define NPCB_DESTROY    1               /* destroy and be free */
   82 
   83 LIST_HEAD(npcblist, natmpcb);
   84 
   85 /* global data structures */
   86 
   87 extern struct mtx natm_mtx;             /* global netnatm lock */
   88 extern struct npcblist natm_pcbs;       /* global list of pcbs */
   89 #define NATM_STAT
   90 #ifdef NATM_STAT
   91 extern  u_int   natm_sodropcnt;
   92 extern  u_int   natm_sodropbytes;       /* account of droppage */
   93 extern  u_int   natm_sookcnt;
   94 extern  u_int   natm_sookbytes;         /* account of ok */
   95 #endif
   96 
   97 /* locking macros */
   98 #define NATM_LOCK_INIT()        mtx_init(&natm_mtx, "natm_mtx", NULL, MTX_DEF)
   99 #define NATM_LOCK()             mtx_lock(&natm_mtx)
  100 #define NATM_UNLOCK()           mtx_unlock(&natm_mtx)
  101 #define NATM_LOCK_ASSERT()      mtx_assert(&natm_mtx, MA_OWNED)
  102 
  103 /* external functions */
  104 
  105 /* natm_pcb.c */
  106 struct  natmpcb *npcb_alloc(int);
  107 void    npcb_free(struct natmpcb *, int);
  108 struct  natmpcb *npcb_add(struct natmpcb *, struct ifnet *, uint16_t, uint8_t);
  109 
  110 /* natm.c */
  111 extern struct pr_usrreqs natm_usrreqs;
  112 
  113 #ifdef SYSCTL_HANDLER_ARGS
  114 int     natm0_sysctl(SYSCTL_HANDLER_ARGS);
  115 int     natm5_sysctl(SYSCTL_HANDLER_ARGS);
  116 #endif
  117 
  118 void    natmintr(struct mbuf *);
  119 
  120 #endif

Cache object: 8d018dfcb48782350e98d2abdf30f959


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