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