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/tp_tpdu.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  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 /*      $NetBSD: tp_tpdu.h,v 1.10 2005/02/26 22:39:49 perry 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  *      @(#)tp_tpdu.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  * This ghastly set of macros makes it possible to refer to tpdu structures
   62  * without going mad.
   63  */
   64 
   65 #ifndef _NETISO_TP_TPDU_H_
   66 #define _NETISO_TP_TPDU_H_
   67 
   68 #include <machine/endian.h>     /* for BYTE_ORDER */
   69 
   70 /*
   71  * This much of a tpdu is the same for all types of tpdus  (except DT tpdus
   72  * in class 0; their exceptions are handled by the data structure below
   73  */
   74 struct tpdu_fixed {
   75         u_char          _tpduf_li:8,    /* length indicator */
   76 #if BYTE_ORDER == LITTLE_ENDIAN
   77                         _tpduf_cdt:4,   /* credit */
   78                         _tpduf_type:4;  /* type of tpdu (DT, CR, etc.) */
   79 #endif
   80 #if BYTE_ORDER == BIG_ENDIAN
   81                         _tpduf_type:4,  /* type of tpdu (DT, CR, etc.) */
   82                         _tpduf_cdt:4;   /* credit */
   83 #endif
   84         u_short         _tpduf_dref;    /* destination ref; not in DT in
   85                                          * class 0 */
   86 };
   87 
   88 #define tpdu_li _tpduf._tpduf_li
   89 #define tpdu_type _tpduf._tpduf_type
   90 #define tpdu_cdt _tpduf._tpduf_cdt
   91 #define tpdu_dref _tpduf._tpduf_dref
   92 
   93 struct tp0du {
   94         u_char          _tp0_li, _tp0_cdt_type, /* same as in tpdu_fixed */
   95 #if BYTE_ORDER == BIG_ENDIAN
   96                         _tp0_eot:1,     /* eot */
   97                         _tp0_mbz:7,     /* must be zero */
   98 #endif
   99 #if BYTE_ORDER == LITTLE_ENDIAN
  100                         _tp0_mbz:7,     /* must be zero */
  101                         _tp0_eot:1,     /* eot */
  102 #endif
  103                         _tp0_notused:8; /* data begins on this octet */
  104 };
  105 
  106 #define tp0du_eot _tp0_eot
  107 #define tp0du_mbz _tp0_mbz
  108 
  109 /*
  110  * This is used when the extended format seqence numbers are
  111  * being sent and received.
  112  */
  113 /*
  114  * the seqeot field is an int that overlays the seq
  115  * and eot fields, this allows the htonl operation
  116  * to be applied to the entire 32 bit quantity, and
  117  * simplifies the structure definitions.
  118  */
  119 union seq_type {
  120         struct {
  121 #if BYTE_ORDER == BIG_ENDIAN
  122                 unsigned int    st_eot:1,       /* end-of-tsdu */
  123                                 st_seq:31;      /* 31 bit sequence number */
  124 #endif
  125 #if BYTE_ORDER == LITTLE_ENDIAN
  126                 unsigned int    st_seq:31,      /* 31 bit sequence number */
  127                                 st_eot:1;       /* end-of-tsdu */
  128 #endif
  129         } st;
  130         unsigned int    s_seqeot;
  131 #define s_eot   st.st_eot
  132 #define s_seq   st.st_seq
  133 };
  134 
  135 /*
  136  * Then most tpdu types have a portion that is always present but differs
  137  * among the tpdu types :
  138  */
  139 union tpdu_fixed_rest {
  140 
  141         struct {
  142                 u_short         _tpdufr_sref,   /* source reference */
  143 #if BYTE_ORDER == BIG_ENDIAN
  144                                 _tpdufr_class:4, /* class [ISO 8073 13.3.3.e] */
  145                                 _tpdufr_opt:4, /* options [ISO 8073 13.3.3.e] */
  146 #endif
  147 #if BYTE_ORDER == LITTLE_ENDIAN
  148                                 _tpdufr_opt:4, /* options [ISO 8073 13.3.3.e] */
  149                                 _tpdufr_class:4, /* class [ISO 8073 13.3.3.e] */
  150 #endif
  151                                 _tpdufr_xx:8;   /* unused */
  152         } CRCC;
  153 
  154 #define tpdu_CRli _tpduf._tpduf_li
  155 #define tpdu_CRtype _tpduf._tpduf_type
  156 #define tpdu_CRcdt _tpduf._tpduf_cdt
  157 #define tpdu_CRdref_0 _tpduf._tpduf_dref
  158 #define tpdu_CRsref _tpdufr.CRCC._tpdufr_sref
  159 #define tpdu_sref _tpdufr.CRCC._tpdufr_sref
  160 #define tpdu_CRclass _tpdufr.CRCC._tpdufr_class
  161 #define tpdu_CRoptions _tpdufr.CRCC._tpdufr_opt
  162 
  163 #define tpdu_CCli _tpduf._tpduf_li
  164 #define tpdu_CCtype _tpduf._tpduf_type
  165 #define tpdu_CCcdt _tpduf._tpduf_cdt
  166 #define tpdu_CCdref _tpduf._tpduf_dref
  167 #define tpdu_CCsref _tpdufr.CRCC._tpdufr_sref
  168 #define tpdu_CCclass _tpdufr.CRCC._tpdufr_class
  169 #define tpdu_CCoptions _tpdufr.CRCC._tpdufr_opt
  170 
  171         /* OPTIONS and ADDL OPTIONS bits */
  172 #define TPO_USE_EFC                             0x1
  173 #define TPO_XTD_FMT                             0x2
  174 #define TPAO_USE_TXPD                   0x1
  175 #define TPAO_NO_CSUM                    0x2
  176 #define TPAO_USE_RCC                    0x4
  177 #define TPAO_USE_NXPD                   0x8
  178 
  179         struct {
  180                 unsigned short  _tpdufr_sref;   /* source reference */
  181                 unsigned char   _tpdufr_reason; /* [ ISO 8073 13.5.3.d ] */
  182         } DR;
  183 #define tpdu_DRli _tpduf._tpduf_li
  184 #define tpdu_DRtype _tpduf._tpduf_type
  185 #define tpdu_DRdref _tpduf._tpduf_dref
  186 #define tpdu_DRsref _tpdufr.DR._tpdufr_sref
  187 #define tpdu_DRreason _tpdufr.DR._tpdufr_reason
  188 
  189         unsigned short  _tpdufr_sref;   /* source reference */
  190 
  191 #define tpdu_DCli _tpduf._tpduf_li
  192 #define tpdu_DCtype _tpduf._tpduf_type
  193 #define tpdu_DCdref _tpduf._tpduf_dref
  194 #define tpdu_DCsref _tpdufr._tpdufr_sref
  195 
  196         struct {
  197 #if BYTE_ORDER == BIG_ENDIAN
  198                 unsigned char   _tpdufr_eot:1,  /* end-of-tsdu */
  199                                 _tpdufr_seq:7;  /* 7 bit sequence number */
  200 #endif
  201 #if BYTE_ORDER == LITTLE_ENDIAN
  202                 unsigned char   _tpdufr_seq:7,  /* 7 bit sequence number */
  203                                 _tpdufr_eot:1;  /* end-of-tsdu */
  204 #endif
  205         } SEQEOT;
  206         struct {
  207 #if BYTE_ORDER == BIG_ENDIAN
  208                 unsigned int    _tpdufr_Xeot:1, /* end-of-tsdu */
  209                                 _tpdufr_Xseq:31;        /* 31 bit sequence
  210                                                          * number */
  211 #endif
  212 #if BYTE_ORDER == LITTLE_ENDIAN
  213                 unsigned int    _tpdufr_Xseq:31,        /* 31 bit sequence
  214                                                          * number */
  215                                 _tpdufr_Xeot:1; /* end-of-tsdu */
  216 #endif
  217         } SEQEOT31;
  218         unsigned int    _tpdufr_Xseqeot;
  219 #define tpdu_seqeotX _tpdufr._tpdufr_Xseqeot
  220 
  221 #define tpdu_DTli _tpduf._tpduf_li
  222 #define tpdu_DTtype _tpduf._tpduf_type
  223 #define tpdu_DTdref _tpduf._tpduf_dref
  224 #define tpdu_DTseq _tpdufr.SEQEOT._tpdufr_seq
  225 #define tpdu_DTeot _tpdufr.SEQEOT._tpdufr_eot
  226 #define tpdu_DTseqX _tpdufr.SEQEOT31._tpdufr_Xseq
  227 #define tpdu_DTeotX _tpdufr.SEQEOT31._tpdufr_Xeot
  228 
  229 #define tpdu_XPDli _tpduf._tpduf_li
  230 #define tpdu_XPDtype _tpduf._tpduf_type
  231 #define tpdu_XPDdref _tpduf._tpduf_dref
  232 #define tpdu_XPDseq _tpdufr.SEQEOT._tpdufr_seq
  233 #define tpdu_XPDeot _tpdufr.SEQEOT._tpdufr_eot
  234 #define tpdu_XPDseqX _tpdufr.SEQEOT31._tpdufr_Xseq
  235 #define tpdu_XPDeotX _tpdufr.SEQEOT31._tpdufr_Xeot
  236 
  237         struct {
  238 #if BYTE_ORDER == BIG_ENDIAN
  239                 unsigned        _tpdufr_yrseq0:1,       /* always zero */
  240                                 _tpdufr_yrseq:31;       /* [ ISO 8073 13.9.3.d ] */
  241 #endif
  242 #if BYTE_ORDER == LITTLE_ENDIAN
  243                 unsigned        _tpdufr_yrseq:31,       /* [ ISO 8073 13.9.3.d ] */
  244                                 _tpdufr_yrseq0:1;       /* always zero */
  245 #endif
  246                 unsigned short  _tpdufr_cdt;    /* [ ISO 8073 13.9.3.b ] */
  247         } AK31;
  248 
  249 #define tpdu_AKli _tpduf._tpduf_li
  250 #define tpdu_AKtype _tpduf._tpduf_type
  251 #define tpdu_AKdref _tpduf._tpduf_dref
  252 #define tpdu_AKseq _tpdufr.SEQEOT._tpdufr_seq
  253 #define tpdu_AKseqX _tpdufr.AK31._tpdufr_yrseq
  254         /* location of cdt depends on size of seq. numbers */
  255 #define tpdu_AKcdt _tpduf._tpduf_cdt
  256 #define tpdu_AKcdtX _tpdufr.AK31._tpdufr_cdt
  257 
  258 #define tpdu_XAKli _tpduf._tpduf_li
  259 #define tpdu_XAKtype _tpduf._tpduf_type
  260 #define tpdu_XAKdref _tpduf._tpduf_dref
  261 #define tpdu_XAKseq _tpdufr.SEQEOT._tpdufr_seq
  262 #define tpdu_XAKseqX _tpdufr.SEQEOT31._tpdufr_Xseq
  263 
  264         unsigned char   _tpdu_ERreason; /* [ ISO 8073 13.12.3.c ] */
  265 
  266 #define tpdu_ERli _tpduf._tpduf_li
  267 #define tpdu_ERtype _tpduf._tpduf_type
  268 #define tpdu_ERdref _tpduf._tpduf_dref
  269 #define tpdu_ERreason _tpdufr._tpdu_ERreason
  270 
  271 };
  272 
  273 struct tpdu {
  274         struct tpdu_fixed _tpduf;
  275         union tpdu_fixed_rest _tpdufr;
  276 };
  277 
  278 #endif /* _NETISO_TP_TPDU_H_ */

Cache object: c97a9242ded3614aba253b70a2cd833d


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