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