1 /* $NetBSD: eonvar.h,v 1.17 2007/05/02 20:40:28 dyoung Exp $ */
4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * @(#)eonvar.h 8.1 (Berkeley) 6/10/93
34 /***********************************************************
35 Copyright IBM Corporation 1987
39 Permission to use, copy, modify, and distribute this software and its
40 documentation for any purpose and without fee is hereby granted,
41 provided that the above copyright notice appear in all copies and that
42 both that copyright notice and this permission notice appear in
43 supporting documentation, and that the name of IBM not be
44 used in advertising or publicity pertaining to distribution of the
45 software without specific, written prior permission.
47 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
48 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
49 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
50 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
51 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
52 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
55 ******************************************************************/
58 * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
61 #ifndef _NETISO_EONVAR_H_
62 #define _NETISO_EONVAR_H_
67 typedef __sa_family_t sa_family_t
;
68 #define sa_family_t __sa_family_t
71 #define EON_986_VERSION 0x3
72 #define EON_VERSION 0x1
74 #define EON_CACHESIZE 30
83 * this overlays a sockaddr_iso
87 u_char seon_len
; /* Length */
88 sa_family_t seon_family
; /* AF_ISO */
89 u_char seon_status
; /* overlays session suffixlen */
90 #define EON_ESLINK_UP 0x1
91 #define EON_ESLINK_DOWN 0x2
92 #define EON_ISLINK_UP 0x10
93 #define EON_ISLINK_DOWN 0x20
94 /* no change is neither up or down */
95 u_char seon_pad1
; /* 0, overlays tsfxlen */
97 u_char seon_afi
; /* 47 */
98 u_char seon_idi
[2]; /* 0006 */
99 u_char seon_vers
; /* 03 */
100 u_char seon_glbnum
[2]; /* see RFC 1069 */
101 u_char seon_RDN
[2]; /* see RFC 1070 */
102 u_char seon_pad2
[3]; /* see RFC 1070 */
103 u_char seon_LAREA
[2]; /* see RFC 1070 */
104 u_char seon_pad3
[2]; /* see RFC 1070 */
106 * right now ip addr is aligned -- be careful -- future revisions
107 * may have it u_char[4]
109 u_int seon_ipaddr
; /* a.b.c.d */
110 u_char seon_protoid
; /* NSEL */
114 struct sockaddr_eon eon_template
= {
115 sizeof(eon_template
), AF_ISO
, 0, 0, 0x14,
116 0x47, 0x0, 0x6, 0x3, 0
120 #define DOWNBITS ( EON_ESLINK_DOWN | EON_ISLINK_DOWN )
121 #define UPBITS ( EON_ESLINK_UP | EON_ISLINK_UP )
124 u_char eonh_vers
; /* value 1 */
125 u_char eonh_class
; /* address multicast class, below */
126 #define EON_NORMAL_ADDR 0x0
127 #define EON_MULTICAST_ES 0x1
128 #define EON_MULTICAST_IS 0x2
129 #define EON_BROADCAST 0x3
130 u_short eonh_csum
; /* osi checksum (choke) */
134 struct eon_hdr ei_eh
;
136 #define EONIPLEN (sizeof(struct eon_hdr) + sizeof(struct ip))
138 /* stole these 2 fields of the flags for I-am-ES and I-am-IS */
153 int es_icmp
[PRC_NCMDS
];
160 #define IncStat(xxx) eonstat.xxx++
162 typedef struct qhdr
{
163 struct qhdr
*link
, *rlink
;
167 struct qhdr el_qhdr
;/* keep all in a list */
168 int el_flags
; /* cache valid ? */
169 int el_snpaoffset
; /* IP address contained in dst nsap */
170 struct rtentry
*el_rt
; /* back pointer to parent route */
171 struct eon_iphdr el_ei
; /* precomputed portion of hdr */
172 struct route el_iproute
; /* if direct route cache IP info */
173 /* if gateway, cache secondary route */
175 #define el_iphdr el_ei.ei_ip
176 #define el_eonhdr el_ei.ei_eh
179 void eonprotoinit (void);
180 void eonattach (void);
181 int eonioctl (struct ifnet
*, u_long
, void *);
182 void eoniphdr(struct eon_iphdr
*, const void *, struct route
*, int);
183 void eonrtrequest (int, struct rtentry
*, const struct rt_addrinfo
*);
184 int eonoutput(struct ifnet
*, struct mbuf
*, const struct sockaddr
*,
186 void eoninput (struct mbuf
*, ...);
187 void *eonctlinput(int, const struct sockaddr
*, void *);
190 #endif /* !_NETISO_EONVAR_H_ */