Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


if_tr.h
001: /* Copyright (C) 1997, 2005 Free Software Foundation, Inc.
002:    This file is part of the GNU C Library.
003: 
004:    The GNU C Library is free software; you can redistribute it and/or
005:    modify it under the terms of the GNU Lesser General Public
006:    License as published by the Free Software Foundation; either
007:    version 2.1 of the License, or (at your option) any later version.
008: 
009:    The GNU C Library is distributed in the hope that it will be useful,
010:    but WITHOUT ANY WARRANTY; without even the implied warranty of
011:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:    Lesser General Public License for more details.
013: 
014:    You should have received a copy of the GNU Lesser General Public
015:    License along with the GNU C Library; if not, write to the Free
016:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
017:    02111-1307 USA.  */
018: 
019: #ifndef _NETINET_IF_TR_H
020: #define _NETINET_IF_TR_H 1
021: 
022: #include <sys/cdefs.h>
023: #include <sys/types.h>
024: 
025: /* IEEE 802.5 Token-Ring magic constants.  The frame sizes omit the preamble
026:    and FCS/CRC (frame check sequence). */
027: #define TR_ALEN         6               /* Octets in one token-ring addr */
028: #define TR_HLEN         (sizeof (struct trh_hdr) + sizeof (struct trllc))
029: #define AC              0x10
030: #define LLC_FRAME       0x40
031: 
032: /* LLC and SNAP constants */
033: #define EXTENDED_SAP    0xAA
034: #define UI_CMD          0x03
035: 
036: /* This is an Token-Ring frame header. */
037: struct trh_hdr
038: {
039:   u_int8_t  ac;                 /* access control field */
040:   u_int8_t  fc;                 /* frame control field */
041:   u_int8_t  daddr[TR_ALEN];     /* destination address */
042:   u_int8_t  saddr[TR_ALEN];     /* source address */
043:   u_int16_t rcf;                /* route control field */
044:   u_int16_t rseg[8];            /* routing registers */
045: };
046: 
047: /* This is an Token-Ring LLC structure */
048: struct trllc
049: {
050:   u_int8_t  dsap;               /* destination SAP */
051:   u_int8_t  ssap;               /* source SAP */
052:   u_int8_t  llc;                /* LLC control field */
053:   u_int8_t  protid[3];          /* protocol id */
054:   u_int16_t ethertype;          /* ether type field */
055: };
056: 
057: /* Token-Ring statistics collection data. */
058: struct tr_statistics
059: {
060:   unsigned long rx_packets;     /* total packets received       */
061:   unsigned long tx_packets;     /* total packets transmitted    */
062:   unsigned long rx_bytes;       /* total bytes received         */
063:   unsigned long tx_bytes;       /* total bytes transmitted      */
064:   unsigned long rx_errors;      /* bad packets received         */
065:   unsigned long tx_errors;      /* packet transmit problems     */
066:   unsigned long rx_dropped;     /* no space in linux buffers    */
067:   unsigned long tx_dropped;     /* no space available in linux  */
068:   unsigned long multicast;      /* multicast packets received   */
069:   unsigned long transmit_collision;
070: 
071:   /* detailed Token-Ring errors. See IBM Token-Ring Network
072:      Architecture for more info */
073: 
074:   unsigned long line_errors;
075:   unsigned long internal_errors;
076:   unsigned long burst_errors;
077:   unsigned long A_C_errors;
078:   unsigned long abort_delimiters;
079:   unsigned long lost_frames;
080:   unsigned long recv_congest_count;
081:   unsigned long frame_copied_errors;
082:   unsigned long frequency_errors;
083:   unsigned long token_errors;
084:   unsigned long dummy1;
085: };
086: 
087: /* source routing stuff */
088: #define TR_RII                  0x80
089: #define TR_RCF_DIR_BIT          0x80
090: #define TR_RCF_LEN_MASK         0x1f00
091: #define TR_RCF_BROADCAST        0x8000  /* all-routes broadcast */
092: #define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */
093: #define TR_RCF_FRAME2K          0x20
094: #define TR_RCF_BROADCAST_MASK   0xC000
095: #define TR_MAXRIFLEN            18
096: 
097: #ifdef __USE_BSD
098: 
099: struct trn_hdr
100: {
101:   u_int8_t trn_ac;                /* access control field */
102:   u_int8_t trn_fc;                /* field control field */
103:   u_int8_t trn_dhost[TR_ALEN];    /* destination host */
104:   u_int8_t trn_shost[TR_ALEN];    /* source host */
105:   u_int16_t trn_rcf;              /* route control field */
106:   u_int16_t trn_rseg[8];          /* routing registers */
107: };
108: 
109: #endif
110: 
111: #endif  /* netinet/if_tr.h */
112: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/