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_hippi.h
001: /*
002:  * INET         An implementation of the TCP/IP protocol suite for the LINUX
003:  *              operating system.  INET is implemented using the  BSD Socket
004:  *              interface as the means of communication with the user level.
005:  *
006:  *              Global definitions for the HIPPI interface.
007:  *
008:  * Version:     @(#)if_hippi.h  1.0.0   05/26/97
009:  *
010:  * Author:      Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
011:  *              Donald Becker, <becker@super.org>
012:  *              Alan Cox, <alan@lxorguk.ukuu.org.uk>
013:  *              Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
014:  *              Jes Sorensen, <Jes.Sorensen@cern.ch>
015:  *
016:  *              This program is free software; you can redistribute it and/or
017:  *              modify it under the terms of the GNU General Public License
018:  *              as published by the Free Software Foundation; either version
019:  *              2 of the License, or (at your option) any later version.
020:  */
021:  
022: #ifndef _LINUX_IF_HIPPI_H
023: #define _LINUX_IF_HIPPI_H
024: 
025: #include <linux/types.h>
026: #include <asm/byteorder.h>
027: 
028: /*
029:  *      HIPPI magic constants.
030:  */
031: 
032: #define HIPPI_ALEN      6               /* Bytes in one HIPPI hw-addr      */
033: #define HIPPI_HLEN      sizeof(struct hippi_hdr)
034: #define HIPPI_ZLEN      0               /* Min. bytes in frame without FCS */
035: #define HIPPI_DATA_LEN  65280           /* Max. bytes in payload           */
036: #define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
037:                                         /* Max. bytes in frame without FCS */
038: 
039: /*
040:  * Define LLC and SNAP constants.
041:  */
042: #define HIPPI_EXTENDED_SAP      0xAA
043: #define HIPPI_UI_CMD            0x03
044: 
045: 
046: /*
047:  *      Do we need to list some sort of ID's here?
048:  */
049: 
050: /*
051:  *      HIPPI statistics collection data. 
052:  */
053:  
054: struct hipnet_statistics {
055:         int     rx_packets;             /* total packets received       */
056:         int     tx_packets;             /* total packets transmitted    */
057:         int     rx_errors;              /* bad packets received         */
058:         int     tx_errors;              /* packet transmit problems     */
059:         int     rx_dropped;             /* no space in linux buffers    */
060:         int     tx_dropped;             /* no space available in linux  */
061: 
062:         /* detailed rx_errors: */
063:         int     rx_length_errors;
064:         int     rx_over_errors;         /* receiver ring buff overflow  */
065:         int     rx_crc_errors;          /* recved pkt with crc error    */
066:         int     rx_frame_errors;        /* recv'd frame alignment error */
067:         int     rx_fifo_errors;         /* recv'r fifo overrun          */
068:         int     rx_missed_errors;       /* receiver missed packet       */
069: 
070:         /* detailed tx_errors */
071:         int     tx_aborted_errors;
072:         int     tx_carrier_errors;
073:         int     tx_fifo_errors;
074:         int     tx_heartbeat_errors;
075:         int     tx_window_errors;
076: };
077: 
078: 
079: struct hippi_fp_hdr {
080: #if 0
081:         __u8            ulp;                            /* must contain 4 */
082: #if defined (__BIG_ENDIAN_BITFIELD)
083:         __u8            d1_data_present:1;              /* must be 1 */
084:         __u8            start_d2_burst_boundary:1;      /* must be zero */
085:         __u8            reserved:6;                     /* must be zero */
086: #if 0
087:         __u16           reserved1:5;
088:         __u16           d1_area_size:8;                 /* must be 3 */
089:         __u16           d2_offset:3;                    /* must be zero */
090: #endif
091: #elif defined(__LITTLE_ENDIAN_BITFIELD)
092:         __u8            reserved:6;                     /* must be zero */
093:         __u8            start_d2_burst_boundary:1;      /* must be zero */
094:         __u8            d1_data_present:1;              /* must be 1 */
095: #if 0
096:         __u16           d2_offset:3;                    /* must be zero */
097:         __u16           d1_area_size:8;                 /* must be 3 */
098:         __u16           reserved1:5;                    /* must be zero */
099: #endif
100: #else
101: #error  "Please fix <asm/byteorder.h>"
102: #endif
103: #else
104:         __be32          fixed;
105: #endif
106:         __be32          d2_size;
107: } __attribute__((packed));
108: 
109: struct hippi_le_hdr {
110: #if defined (__BIG_ENDIAN_BITFIELD)
111:         __u8            fc:3;
112:         __u8            double_wide:1;
113:         __u8            message_type:4;
114: #elif defined(__LITTLE_ENDIAN_BITFIELD)
115:         __u8            message_type:4;
116:         __u8            double_wide:1;
117:         __u8            fc:3;
118: #endif
119:         __u8            dest_switch_addr[3];
120: #if defined (__BIG_ENDIAN_BITFIELD)
121:         __u8            dest_addr_type:4,
122:                         src_addr_type:4;
123: #elif defined(__LITTLE_ENDIAN_BITFIELD)
124:         __u8            src_addr_type:4,
125:                         dest_addr_type:4;
126: #endif
127:         __u8            src_switch_addr[3];
128:         __u16           reserved;
129:         __u8            daddr[HIPPI_ALEN];
130:         __u16           locally_administered;
131:         __u8            saddr[HIPPI_ALEN];
132: } __attribute__((packed));
133: 
134: #define HIPPI_OUI_LEN   3
135: /*
136:  * Looks like the dsap and ssap fields have been swapped by mistake in
137:  * RFC 2067 "IP over HIPPI".
138:  */
139: struct hippi_snap_hdr {
140:         __u8    dsap;                   /* always 0xAA */
141:         __u8    ssap;                   /* always 0xAA */
142:         __u8    ctrl;                   /* always 0x03 */
143:         __u8    oui[HIPPI_OUI_LEN];     /* organizational universal id (zero)*/
144:         __be16  ethertype;              /* packet type ID field */
145: } __attribute__((packed));
146: 
147: struct hippi_hdr {
148:         struct hippi_fp_hdr     fp;
149:         struct hippi_le_hdr     le;
150:         struct hippi_snap_hdr   snap;
151: } __attribute__((packed));
152: 
153: #endif  /* _LINUX_IF_HIPPI_H */
154: 


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