]>
git.saurik.com Git - apple/xnu.git/blob - bsd/net/tokendefs.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 /* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved.
24 * tokendefs.h - Token-Ring MAC header definitions.
27 * 8-Oct-92 Joel Greenblatt at NeXT
30 #ifndef _NET_TOKENDEFS_H_
31 #define _NET_TOKENDEFS_H_
34 #include <sys/errno.h>
37 * Token ring address - 6 octets
39 #define NUM_TR_ADDR_BYTES 6
42 u_char token_addr_octet
[NUM_TR_ADDR_BYTES
];
45 #define ta_byte token_addr_octet
47 typedef struct token_addr token_addr_t
;
52 #define MAC_HDR_MIN (1+1+6+6) /* MAC hdr size w/o ri field */
53 #define MAC_HDR_MAX (MAC_HDR_MIN + RISIZE) /* MAC hdr size w/max ri */
56 * The maximum size of the MAC information field as spec'd by ISO 8802/5.
58 #define MAC_INFO_4MB 4472 /* max size of mac info field -- 4 Mbs */
59 #define MAC_INFO_16MB 17800 /* max size of mac info field -- 16 Mbs */
62 * Maximum DMA packet sizes for 4 & 16 Mbit assuming no CRC.
64 #define MAC_DMA_MAX_4MB (MAC_HDR_MAX + MAC_INFO_4MB)
65 #define MAC_DMA_MAX_16MB (MAC_HDR_MAX + MAC_INFO_16MB)
68 * Routing control field.
73 unsigned char bcast
: 3, /* broadcast */
75 unsigned char dir
: 1, /* direction */
76 longf
: 3, /* longest frame */
77 rsrvd
: 4; /* reserved */
79 #elif __LITTLE_ENDIAN__
80 unsigned char len
: 5, /* length */
81 bcast
: 3; /* broadcast */
82 unsigned char rsrvd
: 4, /* reserved */
83 longf
: 3, /* longest frame */
84 dir
: 1; /* direction */
91 #define BI_SPECIFIC 0 /* b'0xx': non-broadcast (specific route) */
92 #define BI_AR_BCAST 4 /* b'10x': all-routes broadcast */
93 #define BI_SR_BCAST 6 /* b'11x': single-route broadcast */
105 #define LF_BCAST 7 /* All-routes broadcast */
107 #define LFB_4MB LF_S4472 /* encoded max info -- 4 Mb */
108 #define LFB_16MB LF_S17800 /* encoded max info -- 16 Mb */
111 * Source Routing field (2-18 bytes, must be even)
114 #define RISIZE 18 /* max size (bytes) of 802.5 routing field */
118 u_char sn
[RISIZE
-sizeof(routing_ctl_t
)];
122 * Token Ring MAC header (IEEE 802.5, ISO 8802/5)
128 u_char ac
; /* PPPTMRRR; PPP = token priority */
129 u_char fc
; /* FFrrZZZZ; FF = frame type */
130 #define TR_FC_MASK 0xc0 /* mask for frame-type */
131 #define TR_FC_MAC 0x00 /* frame-type = mac frame */
132 #define TR_FC_DATA 0x40 /* frame-type = non-mac (data frame) */
133 u_char da
[TR_DA_SIZE
]; /* destination address */
134 u_char sa
[TR_DA_SIZE
]; /* source address */
135 #define TR_RII 0x80 /* routing info indicator bit */
136 sroute_t ri
; /* routing information field */
140 * token-ring netif definitions
142 #define IFTYPE_TOKENRING "4/16Mb Token-Ring" /* netif type-string */
147 #define TRINGDOWN ENETDOWN /* interface down */
148 #define TNOBUFS ENOBUFS /* transmit queue full error */
149 #define TBADDA EINVAL /* bad dest addr */
150 #define TBADFSIZE EMSGSIZE /* bad frame size */
152 #endif /* ! _NET_TOKENDEFS_H_ */