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_token.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_token.h,v 1.12 2005/12/11 23:05:25 thorpej Exp $    */
    2 
    3 /*
    4  * Copyright (c) 1982, 1986, 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  *      from: NetBSD: if_fddi.h,v 1.2 1995/08/19 04:35:28 cgd Exp
   32  */
   33 
   34 #ifndef _NET_IF_TOKEN_H_
   35 #define _NET_IF_TOKEN_H_
   36 
   37 #define ISO88025_ADDR_LEN 6
   38 
   39 /* Token Ring physical header */
   40 struct token_header {
   41         u_int8_t  token_ac;                     /* access control field */
   42         u_int8_t  token_fc;                     /* frame control field */
   43         u_int8_t  token_dhost[ISO88025_ADDR_LEN];       /* dest. address */
   44         u_int8_t  token_shost[ISO88025_ADDR_LEN];       /* source address */
   45 } __attribute__((__packed__));
   46 
   47 #define TOKEN_MAX_BRIDGE 8
   48 
   49 /* Token Ring routing information field */
   50 struct token_rif {
   51         u_int16_t tr_rcf;                       /* route control field */
   52         u_int16_t tr_rdf[TOKEN_MAX_BRIDGE];     /* route-designator fields */
   53 } __attribute__((__packed__));
   54 
   55 /* standard values for address control and frame control field */
   56 #define TOKEN_AC                0x10
   57 #define TOKEN_FC                0x40
   58 
   59 #define TOKEN_RI_PRESENT                0x80    /* routing info present bit */
   60 #define TOKEN_RCF_LEN_MASK              0x1f00
   61 #define TOKEN_RCF_BROADCAST_MASK        0xe000
   62 #define TOKEN_RCF_BROADCAST_ALL         0x8000  /* all routes broadcast */
   63 #define TOKEN_RCF_BROADCAST_SINGLE      0xc000  /* single route broadcast */
   64 
   65 /*
   66  * A Token-ring frame consists of
   67  * header +      rif      + llcinfo + fcs
   68  *  14    + 2 * (0 ... 9) +    x    +  4  octets
   69  * where llcinfo contains the llcsnap header (8 octets) and the IP frame
   70  */
   71                                         /*  LLC INFO (802.5PD-2) */
   72 #define TOKEN_RCF_FRAME0        0x0000  /*    516    */
   73 #define TOKEN_RCF_FRAME1        0x0010  /*   1500    */
   74 #define TOKEN_RCF_FRAME2        0x0020  /*   2052    */
   75 #define TOKEN_RCF_FRAME3        0x0030  /*   4472    */
   76 #define TOKEN_RCF_FRAME4        0x0040  /*   8144    */
   77 #define TOKEN_RCF_FRAME5        0x0050  /*  11407    */
   78 #define TOKEN_RCF_FRAME6        0x0060  /*  17800    */
   79 #define TOKEN_RCF_FRAME7        0x0070  /*  65535    */
   80 #define TOKEN_RCF_FRAME_MASK    0x0070
   81 
   82 #define TOKEN_RCF_DIRECTION     0x0080
   83 
   84 /*
   85  * According to RFC 1042
   86  */
   87 #define IPMTU_4MBIT_MAX         4464
   88 #define IPMTU_16MBIT_MAX        8188
   89 
   90 /*
   91  * RFC 1042:
   92  * It is recommended that all implementations support IP packets
   93  * of at least 2002 octets.
   94  */
   95 #define ISO88025_MTU 2002
   96 
   97 /*
   98  * This assumes that route information fields are appended to
   99  * existing structures like llinfo_arp and token_header
  100  */
  101 #define TOKEN_RIF(x) ((struct token_rif *) ((x) + 1))
  102 
  103 /*
  104  * This is a kludge to get at the token ring mac header and the source route
  105  * information after m_adj() has been used on the mbuf.
  106  * Note that m is always an mbuf with a packet header.
  107  */
  108 #define M_TRHSTART(m) \
  109         (ALIGN(((m)->m_flags & M_EXT ? (m)->m_ext.ext_buf : &(m)->m_pktdat[0]) \
  110             + sizeof (struct token_header)) - sizeof(struct token_header))
  111 
  112 #if defined(_KERNEL)
  113 /*
  114  * XXX we need if_ethersubr.c with all these defines
  115  */
  116 #define tokenbroadcastaddr      etherbroadcastaddr
  117 #define token_ipmulticast_min   ether_ipmulticast_min
  118 #define token_ipmulticast_max   ether_ipmulticast_max
  119 #define token_addmulti          ether_addmulti
  120 #define token_delmulti          ether_delmulti
  121 #define token_sprintf           ether_sprintf
  122 
  123 void    token_ifattach(struct ifnet *, caddr_t);
  124 void    token_ifdetach(struct ifnet *);
  125 #endif
  126 
  127 #endif /* !_NET_IF_TOKEN_H_ */

Cache object: 214275137963734b7dceb25ae937a8b4


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