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_arcnet.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 ARCnet interface.
007:  *
008:  * Authors:     David Woodhouse and Avery Pennarun
009:  *
010:  *              This program is free software; you can redistribute it and/or
011:  *              modify it under the terms of the GNU General Public License
012:  *              as published by the Free Software Foundation; either version
013:  *              2 of the License, or (at your option) any later version.
014:  */
015: 
016: #ifndef _LINUX_IF_ARCNET_H
017: #define _LINUX_IF_ARCNET_H
018: 
019: #include <linux/types.h>
020: #include <linux/if_ether.h>
021: 
022: 
023: /*
024:  *    These are the defined ARCnet Protocol ID's.
025:  */
026: 
027: /* CAP mode */
028: /* No macro but uses 1-8 */
029: 
030: /* RFC1201 Protocol ID's */
031: #define ARC_P_IP                212     /* 0xD4 */
032: #define ARC_P_IPV6              196     /* 0xC4: RFC2497 */
033: #define ARC_P_ARP               213     /* 0xD5 */
034: #define ARC_P_RARP              214     /* 0xD6 */
035: #define ARC_P_IPX               250     /* 0xFA */
036: #define ARC_P_NOVELL_EC         236     /* 0xEC */
037: 
038: /* Old RFC1051 Protocol ID's */
039: #define ARC_P_IP_RFC1051        240     /* 0xF0 */
040: #define ARC_P_ARP_RFC1051       241     /* 0xF1 */
041: 
042: /* MS LanMan/WfWg "NDIS" encapsulation */
043: #define ARC_P_ETHER             232     /* 0xE8 */
044: 
045: /* Unsupported/indirectly supported protocols */
046: #define ARC_P_DATAPOINT_BOOT    0       /* very old Datapoint equipment */
047: #define ARC_P_DATAPOINT_MOUNT   1
048: #define ARC_P_POWERLAN_BEACON   8       /* Probably ATA-Netbios related */
049: #define ARC_P_POWERLAN_BEACON2  243     /* 0xF3 */
050: #define ARC_P_LANSOFT           251     /* 0xFB - what is this? */
051: #define ARC_P_ATALK             0xDD
052: 
053: /* Hardware address length */
054: #define ARCNET_ALEN     1
055: 
056: /*
057:  * The RFC1201-specific components of an arcnet packet header.
058:  */
059: struct arc_rfc1201 {
060:     __u8  proto;                /* protocol ID field - varies           */
061:     __u8  split_flag;   /* for use with split packets           */
062:     __be16   sequence;          /* sequence number                      */
063:     __u8  payload[0];   /* space remaining in packet (504 bytes)*/
064: };
065: #define RFC1201_HDR_SIZE 4
066: 
067: 
068: /*
069:  * The RFC1051-specific components.
070:  */
071: struct arc_rfc1051 {
072:     __u8 proto;         /* ARC_P_RFC1051_ARP/RFC1051_IP */
073:     __u8 payload[0];            /* 507 bytes                    */
074: };
075: #define RFC1051_HDR_SIZE 1
076: 
077: 
078: /*
079:  * The ethernet-encap-specific components.  We have a real ethernet header
080:  * and some data.
081:  */
082: struct arc_eth_encap {
083:     __u8 proto;         /* Always ARC_P_ETHER                   */
084:     struct ethhdr eth;          /* standard ethernet header (yuck!)     */
085:     __u8 payload[0];            /* 493 bytes                            */
086: };
087: #define ETH_ENCAP_HDR_SIZE 14
088: 
089: 
090: struct arc_cap {
091:         __u8 proto;
092:         __u8 cookie[sizeof(int)];   /* Actually NOT sent over the network */
093:         union {
094:                 __u8 ack;
095:                 __u8 raw[0];            /* 507 bytes */
096:         } mes;
097: };
098: 
099: /*
100:  * The data needed by the actual arcnet hardware.
101:  *
102:  * Now, in the real arcnet hardware, the third and fourth bytes are the
103:  * 'offset' specification instead of the length, and the soft data is at
104:  * the _end_ of the 512-byte buffer.  We hide this complexity inside the
105:  * driver.
106:  */
107: struct arc_hardware {
108:     __u8  source,               /* source ARCnet - filled in automagically */
109:              dest,              /* destination ARCnet - 0 for broadcast    */
110:              offset[2];         /* offset bytes (some weird semantics)     */
111: };
112: #define ARC_HDR_SIZE 4
113: 
114: /*
115:  * This is an ARCnet frame header, as seen by the kernel (and userspace,
116:  * when you do a raw packet capture).
117:  */
118: struct archdr {
119:     /* hardware requirements */
120:     struct arc_hardware hard;
121:      
122:     /* arcnet encapsulation-specific bits */
123:     union {
124:         struct arc_rfc1201   rfc1201;
125:         struct arc_rfc1051   rfc1051;
126:         struct arc_eth_encap eth_encap;
127:         struct arc_cap       cap;
128:         __u8 raw[0];            /* 508 bytes                            */
129:     } soft;
130: };
131: 
132: #endif                          /* _LINUX_IF_ARCNET_H */
133: 


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