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