1 |
1633 |
jcastillo |
/*
|
2 |
|
|
* INET An implementation of the TCP/IP protocol suite for the LINUX
|
3 |
|
|
* operating system. INET is implemented using the BSD Socket
|
4 |
|
|
* interface as the means of communication with the user level.
|
5 |
|
|
*
|
6 |
|
|
* Global definitions for the Token-Ring IEEE 802.5 interface.
|
7 |
|
|
*
|
8 |
|
|
* Version: @(#)if_tr.h 0.0 07/11/94
|
9 |
|
|
*
|
10 |
|
|
* Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
|
11 |
|
|
* Donald Becker, <becker@super.org>
|
12 |
|
|
* Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
|
13 |
|
|
*
|
14 |
|
|
* This program is free software; you can redistribute it and/or
|
15 |
|
|
* modify it under the terms of the GNU General Public License
|
16 |
|
|
* as published by the Free Software Foundation; either version
|
17 |
|
|
* 2 of the License, or (at your option) any later version.
|
18 |
|
|
*/
|
19 |
|
|
#ifndef _LINUX_IF_TR_H
|
20 |
|
|
#define _LINUX_IF_TR_H
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
|
24 |
|
|
and FCS/CRC (frame check sequence). */
|
25 |
|
|
#define TR_ALEN 6 /* Octets in one ethernet addr */
|
26 |
|
|
#define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc))
|
27 |
|
|
#define AC 0x10
|
28 |
|
|
#define LLC_FRAME 0x40
|
29 |
|
|
#if 0
|
30 |
|
|
#define ETH_HLEN 14 /* Total octets in header. */
|
31 |
|
|
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
|
32 |
|
|
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
|
33 |
|
|
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
|
34 |
|
|
#endif
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
/* These are some defined Ethernet Protocol ID's. */
|
38 |
|
|
#define ETH_P_IP 0x0800 /* Internet Protocol packet */
|
39 |
|
|
#define ETH_P_ARP 0x0806 /* Address Resolution packet */
|
40 |
|
|
#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
|
41 |
|
|
|
42 |
|
|
/* LLC and SNAP constants */
|
43 |
|
|
#define EXTENDED_SAP 0xAA
|
44 |
|
|
#define UI_CMD 0x03
|
45 |
|
|
|
46 |
|
|
/* This is an Token-Ring frame header. */
|
47 |
|
|
struct trh_hdr {
|
48 |
|
|
__u8 ac; /* access control field */
|
49 |
|
|
__u8 fc; /* frame control field */
|
50 |
|
|
__u8 daddr[TR_ALEN]; /* destination address */
|
51 |
|
|
__u8 saddr[TR_ALEN]; /* source address */
|
52 |
|
|
__u16 rcf; /* route control field */
|
53 |
|
|
__u16 rseg[8]; /* routing registers */
|
54 |
|
|
};
|
55 |
|
|
|
56 |
|
|
/* This is an Token-Ring LLC structure */
|
57 |
|
|
struct trllc {
|
58 |
|
|
__u8 dsap; /* destination SAP */
|
59 |
|
|
__u8 ssap; /* source SAP */
|
60 |
|
|
__u8 llc; /* LLC control field */
|
61 |
|
|
__u8 protid[3]; /* protocol id */
|
62 |
|
|
__u16 ethertype; /* ether type field */
|
63 |
|
|
};
|
64 |
|
|
|
65 |
|
|
/* Token-Ring statistics collection data. */
|
66 |
|
|
struct tr_statistics {
|
67 |
|
|
int rx_packets; /* total packets received */
|
68 |
|
|
int tx_packets; /* total packets transmitted */
|
69 |
|
|
int rx_errors; /* bad packets received */
|
70 |
|
|
int tx_errors; /* packet transmit problems */
|
71 |
|
|
int rx_dropped; /* no space in linux buffers */
|
72 |
|
|
int tx_dropped; /* no space available in linux */
|
73 |
|
|
int multicast; /* multicast packets received */
|
74 |
|
|
int transmit_collision;
|
75 |
|
|
|
76 |
|
|
/* detailed Token-Ring errors. See IBM Token-Ring Network
|
77 |
|
|
Architecture for more info */
|
78 |
|
|
|
79 |
|
|
int line_errors;
|
80 |
|
|
int internal_errors;
|
81 |
|
|
int burst_errors;
|
82 |
|
|
int A_C_errors;
|
83 |
|
|
int abort_delimiters;
|
84 |
|
|
int lost_frames;
|
85 |
|
|
int recv_congest_count;
|
86 |
|
|
int frame_copied_errors;
|
87 |
|
|
int frequency_errors;
|
88 |
|
|
int token_errors;
|
89 |
|
|
int dummy1;
|
90 |
|
|
};
|
91 |
|
|
|
92 |
|
|
/* source routing stuff */
|
93 |
|
|
|
94 |
|
|
#define TR_RII 0x80
|
95 |
|
|
#define TR_RCF_DIR_BIT 0x80
|
96 |
|
|
#define TR_RCF_LEN_MASK 0x1f00
|
97 |
|
|
#define TR_RCF_BROADCAST 0x8000
|
98 |
|
|
#define TR_RCF_LIMITED_BROADCAST 0xA000
|
99 |
|
|
#define TR_RCF_FRAME2K 0x20
|
100 |
|
|
#define TR_RCF_BROADCAST_MASK 0xC000
|
101 |
|
|
|
102 |
|
|
#endif /* _LINUX_IF_TR_H */
|