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/netiso/eonvar.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: eonvar.h,v 1.18 2008/10/24 17:07:33 dyoung Exp $       */
    2 
    3 /*-
    4  * Copyright (c) 1991, 1993
    5  *      The Regents of the University of California.  All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above copyright
   13  *    notice, this list of conditions and the following disclaimer in the
   14  *    documentation and/or other materials provided with the distribution.
   15  * 3. Neither the name of the University nor the names of its contributors
   16  *    may be used to endorse or promote products derived from this software
   17  *    without specific prior written permission.
   18  *
   19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   29  * SUCH DAMAGE.
   30  *
   31  *      @(#)eonvar.h    8.1 (Berkeley) 6/10/93
   32  */
   33 
   34 /***********************************************************
   35                 Copyright IBM Corporation 1987
   36 
   37                       All Rights Reserved
   38 
   39 Permission to use, copy, modify, and distribute this software and its
   40 documentation for any purpose and without fee is hereby granted,
   41 provided that the above copyright notice appear in all copies and that
   42 both that copyright notice and this permission notice appear in
   43 supporting documentation, and that the name of IBM not be
   44 used in advertising or publicity pertaining to distribution of the
   45 software without specific, written prior permission.
   46 
   47 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   48 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
   49 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
   50 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
   51 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
   52 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
   53 SOFTWARE.
   54 
   55 ******************************************************************/
   56 
   57 /*
   58  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
   59  */
   60 
   61 #ifndef _NETISO_EONVAR_H_
   62 #define _NETISO_EONVAR_H_
   63 
   64 #include <sys/ansi.h>
   65 
   66 #ifndef sa_family_t
   67 typedef __sa_family_t   sa_family_t;
   68 #define sa_family_t     __sa_family_t
   69 #endif
   70 
   71 #define EON_986_VERSION 0x3
   72 #define EON_VERSION 0x1
   73 
   74 #define EON_CACHESIZE 30
   75 
   76 #define E_FREE  1
   77 #define E_LINK  2
   78 #define E_ES    3
   79 #define E_IS    4
   80 
   81 
   82 /*
   83  * this overlays a sockaddr_iso
   84  */
   85 
   86 struct sockaddr_eon {
   87         u_char          seon_len;       /* Length */
   88         sa_family_t     seon_family;    /* AF_ISO */
   89         u_char          seon_status;    /* overlays session suffixlen */
   90 #define EON_ESLINK_UP           0x1
   91 #define EON_ESLINK_DOWN         0x2
   92 #define EON_ISLINK_UP           0x10
   93 #define EON_ISLINK_DOWN         0x20
   94         /* no change is neither up or down */
   95         u_char          seon_pad1;      /* 0, overlays tsfxlen */
   96         u_char          seon_adrlen;
   97         u_char          seon_afi;       /* 47 */
   98         u_char          seon_idi[2];    /* 0006 */
   99         u_char          seon_vers;      /* 03 */
  100         u_char          seon_glbnum[2]; /* see RFC 1069 */
  101         u_char          seon_RDN[2];    /* see RFC 1070 */
  102         u_char          seon_pad2[3];   /* see RFC 1070 */
  103         u_char          seon_LAREA[2];  /* see RFC 1070 */
  104         u_char          seon_pad3[2];   /* see RFC 1070 */
  105         /*
  106          * right now ip addr is  aligned  -- be careful -- future revisions
  107          * may have it u_char[4]
  108          */
  109         u_int           seon_ipaddr;    /* a.b.c.d */
  110         u_char          seon_protoid;   /* NSEL */
  111 };
  112 
  113 #ifdef EON_TEMPLATE
  114 struct sockaddr_eon eon_template = {
  115         sizeof(eon_template), AF_ISO, 0, 0, 0x14,
  116         0x47, 0x0, 0x6, 0x3, 0
  117 };
  118 #endif
  119 
  120 #define DOWNBITS ( EON_ESLINK_DOWN | EON_ISLINK_DOWN )
  121 #define UPBITS ( EON_ESLINK_UP | EON_ISLINK_UP )
  122 
  123 struct eon_hdr {
  124         u_char          eonh_vers;      /* value 1 */
  125         u_char          eonh_class;     /* address multicast class, below */
  126 #define         EON_NORMAL_ADDR         0x0
  127 #define         EON_MULTICAST_ES        0x1
  128 #define         EON_MULTICAST_IS        0x2
  129 #define         EON_BROADCAST           0x3
  130         u_short         eonh_csum;      /* osi checksum (choke) */
  131 };
  132 struct eon_iphdr {
  133         struct ip       ei_ip;
  134         struct eon_hdr  ei_eh;
  135 };
  136 #define EONIPLEN (sizeof(struct eon_hdr) + sizeof(struct ip))
  137 
  138 /* stole these 2 fields of the flags for I-am-ES and I-am-IS */
  139 #define IFF_ES  0x400
  140 #define IFF_IS  0x800
  141 
  142 struct eon_stat {
  143         int             es_in_multi_es;
  144         int             es_in_multi_is;
  145         int             es_in_broad;
  146         int             es_in_normal;
  147         int             es_out_multi_es;
  148         int             es_out_multi_is;
  149         int             es_out_broad;
  150         int             es_out_normal;
  151         int             es_ipout;
  152 
  153         int             es_icmp[PRC_NCMDS];
  154         /* errors */
  155         int             es_badcsum;
  156         int             es_badhdr;
  157 }               eonstat;
  158 
  159 #undef IncStat
  160 #define IncStat(xxx) eonstat.xxx++
  161 
  162 typedef struct qhdr {
  163         struct qhdr    *link, *rlink;
  164 }              *queue_t;
  165 
  166 struct eon_llinfo {
  167         struct qhdr     el_qhdr;/* keep all in a list */
  168         int             el_flags;       /* cache valid ? */
  169         int             el_snpaoffset;  /* IP address contained in dst nsap */
  170         struct rtentry *el_rt;  /* back pointer to parent route */
  171         struct eon_iphdr el_ei; /* precomputed portion of hdr */
  172         struct route    el_iproute;     /* if direct route cache IP info */
  173         /* if gateway, cache secondary route */
  174 };
  175 #define el_iphdr el_ei.ei_ip
  176 #define el_eonhdr el_ei.ei_eh
  177 
  178 #ifdef _KERNEL
  179 void eonprotoinit (void);
  180 void eonattach   (void);
  181 int eonioctl    (struct ifnet *, u_long, void *);
  182 void eoniphdr(struct eon_iphdr *, const void *, struct route *, int);
  183 void eonrtrequest (int, struct rtentry *, const struct rt_addrinfo *);
  184 int eonoutput(struct ifnet *, struct mbuf *, const struct sockaddr *,
  185                      struct rtentry *);
  186 void eoninput    (struct mbuf *, ...);
  187 void *eonctlinput(int, const struct sockaddr *, void *);
  188 #endif
  189 
  190 #endif /* !_NETISO_EONVAR_H_ */

Cache object: 3e4e1e877efa51d7fb84a46ae27cd966


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