Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / unix / sysv / linux / netinet / if_tr.h
blob068d7254726da0dd1e01b7be16490ca3513ea48a
1 /* Copyright (C) 1997-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
18 #ifndef _NETINET_IF_TR_H
19 #define _NETINET_IF_TR_H 1
21 #include <sys/cdefs.h>
22 #include <sys/types.h>
24 /* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
25 and FCS/CRC (frame check sequence). */
26 #define TR_ALEN 6 /* Octets in one token-ring addr */
27 #define TR_HLEN (sizeof (struct trh_hdr) + sizeof (struct trllc))
28 #define AC 0x10
29 #define LLC_FRAME 0x40
31 /* LLC and SNAP constants */
32 #define EXTENDED_SAP 0xAA
33 #define UI_CMD 0x03
35 /* This is an Token-Ring frame header. */
36 struct trh_hdr
38 u_int8_t ac; /* access control field */
39 u_int8_t fc; /* frame control field */
40 u_int8_t daddr[TR_ALEN]; /* destination address */
41 u_int8_t saddr[TR_ALEN]; /* source address */
42 u_int16_t rcf; /* route control field */
43 u_int16_t rseg[8]; /* routing registers */
46 /* This is an Token-Ring LLC structure */
47 struct trllc
49 u_int8_t dsap; /* destination SAP */
50 u_int8_t ssap; /* source SAP */
51 u_int8_t llc; /* LLC control field */
52 u_int8_t protid[3]; /* protocol id */
53 u_int16_t ethertype; /* ether type field */
56 /* Token-Ring statistics collection data. */
57 struct tr_statistics
59 unsigned long rx_packets; /* total packets received */
60 unsigned long tx_packets; /* total packets transmitted */
61 unsigned long rx_bytes; /* total bytes received */
62 unsigned long tx_bytes; /* total bytes transmitted */
63 unsigned long rx_errors; /* bad packets received */
64 unsigned long tx_errors; /* packet transmit problems */
65 unsigned long rx_dropped; /* no space in linux buffers */
66 unsigned long tx_dropped; /* no space available in linux */
67 unsigned long multicast; /* multicast packets received */
68 unsigned long transmit_collision;
70 /* detailed Token-Ring errors. See IBM Token-Ring Network
71 Architecture for more info */
73 unsigned long line_errors;
74 unsigned long internal_errors;
75 unsigned long burst_errors;
76 unsigned long A_C_errors;
77 unsigned long abort_delimiters;
78 unsigned long lost_frames;
79 unsigned long recv_congest_count;
80 unsigned long frame_copied_errors;
81 unsigned long frequency_errors;
82 unsigned long token_errors;
83 unsigned long dummy1;
86 /* source routing stuff */
87 #define TR_RII 0x80
88 #define TR_RCF_DIR_BIT 0x80
89 #define TR_RCF_LEN_MASK 0x1f00
90 #define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */
91 #define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */
92 #define TR_RCF_FRAME2K 0x20
93 #define TR_RCF_BROADCAST_MASK 0xC000
94 #define TR_MAXRIFLEN 18
96 #ifdef __USE_BSD
98 struct trn_hdr
100 u_int8_t trn_ac; /* access control field */
101 u_int8_t trn_fc; /* field control field */
102 u_int8_t trn_dhost[TR_ALEN]; /* destination host */
103 u_int8_t trn_shost[TR_ALEN]; /* source host */
104 u_int16_t trn_rcf; /* route control field */
105 u_int16_t trn_rseg[8]; /* routing registers */
108 #endif
110 #endif /* netinet/if_tr.h */