1 |
148 |
jeremybenn |
/* $NetBSD: if_arc.h,v 1.13 1999/11/19 20:41:19 thorpej Exp $ */
|
2 |
|
|
/* $FreeBSD: src/sys/net/if_arc.h,v 1.3 2002/03/19 21:54:16 alfred Exp $ */
|
3 |
|
|
|
4 |
|
|
/*
|
5 |
|
|
* Copyright (c) 1982, 1986, 1993
|
6 |
|
|
* The Regents of the University of California. All rights reserved.
|
7 |
|
|
*
|
8 |
|
|
* Redistribution and use in source and binary forms, with or without
|
9 |
|
|
* modification, are permitted provided that the following conditions
|
10 |
|
|
* are met:
|
11 |
|
|
* 1. Redistributions of source code must retain the above copyright
|
12 |
|
|
* notice, this list of conditions and the following disclaimer.
|
13 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
14 |
|
|
* notice, this list of conditions and the following disclaimer in the
|
15 |
|
|
* documentation and/or other materials provided with the distribution.
|
16 |
|
|
* 3. All advertising materials mentioning features or use of this software
|
17 |
|
|
* must display the following acknowledgement:
|
18 |
|
|
* This product includes software developed by the University of
|
19 |
|
|
* California, Berkeley and its contributors.
|
20 |
|
|
* 4. Neither the name of the University nor the names of its contributors
|
21 |
|
|
* may be used to endorse or promote products derived from this software
|
22 |
|
|
* without specific prior written permission.
|
23 |
|
|
*
|
24 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
25 |
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
26 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
27 |
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
28 |
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
29 |
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
30 |
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
31 |
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
32 |
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
33 |
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
34 |
|
|
* SUCH DAMAGE.
|
35 |
|
|
*
|
36 |
|
|
* from: NetBSD: if_ether.h,v 1.10 1994/06/29 06:37:55 cgd Exp
|
37 |
|
|
* @(#)if_ether.h 8.1 (Berkeley) 6/10/93
|
38 |
|
|
*/
|
39 |
|
|
|
40 |
|
|
#ifndef _NET_IF_ARC_H_
|
41 |
|
|
#define _NET_IF_ARC_H_
|
42 |
|
|
|
43 |
|
|
/*
|
44 |
|
|
* Arcnet address - 1 octets
|
45 |
|
|
* don't know who uses this.
|
46 |
|
|
*/
|
47 |
|
|
struct arc_addr {
|
48 |
|
|
u_int8_t arc_addr_octet[1];
|
49 |
|
|
} __attribute__((__packed__));
|
50 |
|
|
|
51 |
|
|
/*
|
52 |
|
|
* Structure of a 2.5MB/s Arcnet header.
|
53 |
|
|
* as given to interface code.
|
54 |
|
|
*/
|
55 |
|
|
struct arc_header {
|
56 |
|
|
u_int8_t arc_shost;
|
57 |
|
|
u_int8_t arc_dhost;
|
58 |
|
|
u_int8_t arc_type;
|
59 |
|
|
/*
|
60 |
|
|
* only present for newstyle encoding with LL fragmentation.
|
61 |
|
|
* Don't use sizeof(anything), use ARC_HDR{,NEW}LEN instead.
|
62 |
|
|
*/
|
63 |
|
|
u_int8_t arc_flag;
|
64 |
|
|
u_int16_t arc_seqid;
|
65 |
|
|
|
66 |
|
|
/*
|
67 |
|
|
* only present in exception packets (arc_flag == 0xff)
|
68 |
|
|
*/
|
69 |
|
|
u_int8_t arc_type2; /* same as arc_type */
|
70 |
|
|
u_int8_t arc_flag2; /* real flag value */
|
71 |
|
|
u_int16_t arc_seqid2; /* real seqid value */
|
72 |
|
|
} __attribute__((__packed__));
|
73 |
|
|
|
74 |
|
|
#define ARC_ADDR_LEN 1
|
75 |
|
|
|
76 |
|
|
#define ARC_HDRLEN 3
|
77 |
|
|
#define ARC_HDRNEWLEN 6
|
78 |
|
|
#define ARC_HDRNEWLEN_EXC 10
|
79 |
|
|
|
80 |
|
|
/* these lengths are data link layer length - 2*ARC_ADDR_LEN */
|
81 |
|
|
#define ARC_MIN_LEN 1
|
82 |
|
|
#define ARC_MIN_FORBID_LEN 254
|
83 |
|
|
#define ARC_MAX_FORBID_LEN 256
|
84 |
|
|
#define ARC_MAX_LEN 508
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
/* RFC 1051 */
|
88 |
|
|
#define ARCTYPE_IP_OLD 240 /* IP protocol */
|
89 |
|
|
#define ARCTYPE_ARP_OLD 241 /* address resolution protocol */
|
90 |
|
|
|
91 |
|
|
/* RFC 1201 */
|
92 |
|
|
#define ARCTYPE_IP 212 /* IP protocol */
|
93 |
|
|
#define ARCTYPE_ARP 213 /* address resolution protocol */
|
94 |
|
|
#define ARCTYPE_REVARP 214 /* reverse addr resolution protocol */
|
95 |
|
|
|
96 |
|
|
#define ARCTYPE_ATALK 221 /* Appletalk */
|
97 |
|
|
#define ARCTYPE_BANIAN 247 /* Banyan Vines */
|
98 |
|
|
#define ARCTYPE_IPX 250 /* Novell IPX */
|
99 |
|
|
|
100 |
|
|
#define ARCTYPE_INET6 0xc4 /* IPng */
|
101 |
|
|
#define ARCTYPE_DIAGNOSE 0x80 /* as per ANSI/ATA 878.1 */
|
102 |
|
|
|
103 |
|
|
#define ARCMTU 507
|
104 |
|
|
#define ARCMIN 0
|
105 |
|
|
|
106 |
|
|
#define ARC_PHDS_MAXMTU 60480
|
107 |
|
|
|
108 |
|
|
struct arccom {
|
109 |
|
|
struct ifnet ac_if; /* network-visible interface */
|
110 |
|
|
|
111 |
|
|
u_int16_t ac_seqid; /* seq. id used by PHDS encap. */
|
112 |
|
|
|
113 |
|
|
u_int8_t arc_shost;
|
114 |
|
|
u_int8_t arc_dhost;
|
115 |
|
|
u_int8_t arc_type;
|
116 |
|
|
|
117 |
|
|
u_int8_t dummy0;
|
118 |
|
|
u_int16_t dummy1;
|
119 |
|
|
int sflag, fsflag, rsflag;
|
120 |
|
|
struct mbuf *curr_frag;
|
121 |
|
|
|
122 |
|
|
struct ac_frag {
|
123 |
|
|
u_int8_t af_maxflag; /* from first packet */
|
124 |
|
|
u_int8_t af_lastseen; /* last split flag seen */
|
125 |
|
|
u_int16_t af_seqid;
|
126 |
|
|
struct mbuf *af_packet;
|
127 |
|
|
} ac_fragtab[256]; /* indexed by sender ll address */
|
128 |
|
|
};
|
129 |
|
|
|
130 |
|
|
#ifdef _KERNEL
|
131 |
|
|
extern u_int8_t arcbroadcastaddr;
|
132 |
|
|
extern int arc_ipmtu; /* XXX new ip only, no RFC 1051! */
|
133 |
|
|
|
134 |
|
|
void arc_ifattach(struct ifnet *, u_int8_t);
|
135 |
|
|
void arc_ifdetach(struct ifnet *);
|
136 |
|
|
void arc_storelladdr(struct ifnet *, u_int8_t);
|
137 |
|
|
char *arc_sprintf(u_int8_t *);
|
138 |
|
|
int arc_isphds(int);
|
139 |
|
|
void arc_input(struct ifnet *, struct mbuf *);
|
140 |
|
|
int arc_output(struct ifnet *, struct mbuf *,
|
141 |
|
|
struct sockaddr *, struct rtentry *);
|
142 |
|
|
int arc_ioctl(struct ifnet *, int, caddr_t);
|
143 |
|
|
|
144 |
|
|
void arc_frag_init(struct ifnet *);
|
145 |
|
|
struct mbuf * arc_frag_next(struct ifnet *);
|
146 |
|
|
#endif
|
147 |
|
|
|
148 |
|
|
#endif /* _NET_IF_ARC_H_ */
|