2 * Copyright (c) 1998, Larry Lile
5 * For latest sources and information on this driver, please
6 * go to http://anarchy.stdio.com.
8 * Questions, comments or suggestions should be directed to
9 * Larry Lile <lile@stdio.com>.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice unmodified, this list of conditions, and the following
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * Information gathered from tokenring@freebsd, /sys/net/ethernet.h and
36 * the Mach token ring driver.
40 * Fundamental constants relating to iso 802.5
43 #ifndef _NET_ISO88025_H_
44 #define _NET_ISO88025_H_
47 * The number of bytes in an iso 802.5 (MAC) address.
49 #define ISO88025_ADDR_LEN 6
53 #define ISO88025_HDR_LEN (ISO88025_CF_LEN + ISO88025_ADDR_LEN*2)
54 #define ISO88025_CF_LEN 2
60 * The minimum packet length.
62 #define ISO88025_MIN_LEN 0 /* This offends my morality */
65 * The maximum packet length.
67 #define ISO88025_MAX_LEN 17960
70 * A macro to validate a length with
72 #define ISO88025_IS_VALID_LEN(foo) \
73 ((foo) >= ISO88025_MIN_LEN && (foo) <= ISO88025_MAX_LEN)
76 * ISO 802.5 physical header
78 struct iso88025_header {
79 u_char ac; /* access control field */
80 u_char fc; /* frame control field */
81 u_char iso88025_dhost[ISO88025_ADDR_LEN]; /* destination address */
82 u_char iso88025_shost[ISO88025_ADDR_LEN]; /* source address */
83 u_short rcf; /* route control field */
84 u_short rseg[RIF_LEN]; /* routing registers */
87 struct iso88025_sockaddr_data {
88 u_char ether_dhost[ISO88025_ADDR_LEN];
89 u_char ether_shost[ISO88025_ADDR_LEN];
95 * Structure of a 48-bit iso 802.5 address.
96 * ( We could also add the 16 bit addresses as a union)
98 struct iso88025_addr {
99 u_char octet[ISO88025_ADDR_LEN];
102 #define ISO88025MTU 18000
103 #define ISO88025_DEFAULT_MTU 1500
104 #define senderr(e) { error = (e); goto bad;}
106 void iso88025_ifattach __P((struct ifnet *));
107 int iso88025_ioctl __P((struct ifnet *, int , caddr_t ));
108 int iso88025_output __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *));
109 void iso88025_input __P((struct ifnet *, struct iso88025_header *, struct mbuf *));