Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | /*- |
2 | * Copyright (c) 1991 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 3. All advertising materials mentioning features or use of this software | |
14 | * must display the following acknowledgement: | |
15 | * This product includes software developed by the University of | |
16 | * California, Berkeley and its contributors. | |
17 | * 4. Neither the name of the University nor the names of its contributors | |
18 | * may be used to endorse or promote products derived from this software | |
19 | * without specific prior written permission. | |
20 | * | |
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 | |
31 | * SUCH DAMAGE. | |
32 | * | |
43371f85 | 33 | * from: @(#)eonvar.h 7.5 (Berkeley) 5/6/91 |
8ace4366 | 34 | * $Id: eonvar.h,v 1.2 1993/10/16 21:05:04 rgrimes Exp $ |
15637ed4 RG |
35 | */ |
36 | ||
37 | /*********************************************************** | |
38 | Copyright IBM Corporation 1987 | |
39 | ||
40 | All Rights Reserved | |
41 | ||
42 | Permission to use, copy, modify, and distribute this software and its | |
43 | documentation for any purpose and without fee is hereby granted, | |
44 | provided that the above copyright notice appear in all copies and that | |
45 | both that copyright notice and this permission notice appear in | |
46 | supporting documentation, and that the name of IBM not be | |
47 | used in advertising or publicity pertaining to distribution of the | |
48 | software without specific, written prior permission. | |
49 | ||
50 | IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING | |
51 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL | |
52 | IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR | |
53 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
54 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
55 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
56 | SOFTWARE. | |
57 | ||
58 | ******************************************************************/ | |
59 | ||
60 | /* | |
61 | * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison | |
62 | */ | |
63 | ||
8ace4366 GW |
64 | #ifndef _NETISO_EONVAR_H_ |
65 | #define _NETISO_EONVAR_H_ 1 | |
66 | ||
15637ed4 RG |
67 | #define EON_986_VERSION 0x3 |
68 | #define EON_VERSION 0x1 | |
69 | ||
70 | #define EON_CACHESIZE 30 | |
71 | ||
72 | #define E_FREE 1 | |
73 | #define E_LINK 2 | |
74 | #define E_ES 3 | |
75 | #define E_IS 4 | |
76 | ||
77 | ||
78 | /* | |
79 | * this overlays a sockaddr_iso | |
80 | */ | |
81 | ||
82 | struct sockaddr_eon { | |
83 | u_char seon_len; /* Length */ | |
84 | u_char seon_family; /* AF_ISO */ | |
85 | u_char seon_status; /* overlays session suffixlen */ | |
86 | #define EON_ESLINK_UP 0x1 | |
87 | #define EON_ESLINK_DOWN 0x2 | |
88 | #define EON_ISLINK_UP 0x10 | |
89 | #define EON_ISLINK_DOWN 0x20 | |
90 | /* no change is neither up or down */ | |
91 | u_char seon_pad1; /* 0, overlays tsfxlen */ | |
92 | u_char seon_adrlen; | |
93 | u_char seon_afi; /* 47 */ | |
94 | u_char seon_idi[2]; /* 0006 */ | |
95 | u_char seon_vers; /* 03 */ | |
96 | u_char seon_glbnum[2]; /* see RFC 1069 */ | |
97 | u_char seon_RDN[2]; /* see RFC 1070 */ | |
98 | u_char seon_pad2[3]; /* see RFC 1070 */ | |
99 | u_char seon_LAREA[2]; /* see RFC 1070 */ | |
100 | u_char seon_pad3[2]; /* see RFC 1070 */ | |
101 | /* right now ip addr is aligned -- be careful -- | |
102 | * future revisions may have it u_char[4] | |
103 | */ | |
104 | u_int seon_ipaddr; /* a.b.c.d */ | |
105 | u_char seon_protoid; /* NSEL */ | |
106 | }; | |
107 | ||
108 | #ifdef EON_TEMPLATE | |
109 | struct sockaddr_eon eon_template = { | |
110 | sizeof (eon_template), AF_ISO, 0, 0, 0x14, | |
111 | 0x47, 0x0, 0x6, 0x3, 0 | |
112 | }; | |
113 | #endif | |
114 | ||
115 | #define DOWNBITS ( EON_ESLINK_DOWN | EON_ISLINK_DOWN ) | |
116 | #define UPBITS ( EON_ESLINK_UP | EON_ISLINK_UP ) | |
117 | ||
118 | #define SIOCSEONCORE _IOWR('i',10, struct iso_ifreq) /* EON core member */ | |
119 | #define SIOCGEONCORE _IOWR('i',11, struct iso_ifreq) /* EON core member */ | |
120 | ||
121 | struct eon_hdr { | |
122 | u_char eonh_vers; /* value 1 */ | |
123 | u_char eonh_class; /* address multicast class, below */ | |
124 | #define EON_NORMAL_ADDR 0x0 | |
125 | #define EON_MULTICAST_ES 0x1 | |
126 | #define EON_MULTICAST_IS 0x2 | |
127 | #define EON_BROADCAST 0x3 | |
128 | u_short eonh_csum; /* osi checksum (choke)*/ | |
129 | }; | |
130 | struct eon_iphdr { | |
131 | struct ip ei_ip; | |
132 | struct eon_hdr ei_eh; | |
133 | }; | |
134 | #define EONIPLEN (sizeof(struct eon_hdr) + sizeof(struct ip)) | |
135 | ||
136 | /* stole these 2 fields of the flags for I-am-ES and I-am-IS */ | |
137 | #define IFF_ES 0x400 | |
138 | #define IFF_IS 0x800 | |
139 | ||
140 | struct eon_stat { | |
141 | int es_in_multi_es; | |
142 | int es_in_multi_is; | |
143 | int es_in_broad; | |
144 | int es_in_normal; | |
145 | int es_out_multi_es; | |
146 | int es_out_multi_is; | |
147 | int es_out_broad; | |
148 | int es_out_normal; | |
149 | int es_ipout; | |
150 | ||
151 | int es_icmp[PRC_NCMDS]; | |
152 | /* errors */ | |
153 | int es_badcsum; | |
154 | int es_badhdr; | |
8ace4366 GW |
155 | }; |
156 | ||
157 | #ifdef KERNEL | |
158 | extern struct eon_stat eon_stat; | |
159 | #endif | |
15637ed4 RG |
160 | |
161 | #undef IncStat | |
162 | #define IncStat(xxx) eonstat.xxx++ | |
163 | ||
164 | typedef struct qhdr { | |
165 | struct qhdr *link, *rlink; | |
166 | } *queue_t; | |
167 | ||
168 | struct eon_llinfo { | |
169 | struct qhdr el_qhdr; /* keep all in a list */ | |
170 | int el_flags; /* cache valid ? */ | |
171 | int el_snpaoffset; /* IP address contained in dst nsap */ | |
172 | struct rtentry *el_rt; /* back pointer to parent route */ | |
173 | struct eon_iphdr el_ei; /* precomputed portion of hdr */ | |
174 | struct route el_iproute; /* if direct route cache IP info */ | |
175 | /* if gateway, cache secondary route */ | |
176 | }; | |
177 | #define el_iphdr el_ei.ei_ip | |
178 | #define el_eonhdr el_ei.ei_eh | |
8ace4366 | 179 | #endif /* _NETISO_EONVAR_H_ */ |