xref: /csrg-svn/sys/netiso/eonvar.h (revision 36378)
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  */
27 
28 #define EON_986_VERSION 0x3
29 #define EON_VERSION 0x1
30 
31 #define EON_CACHESIZE 30
32 
33 #define E_FREE 	1
34 #define E_LINK	2
35 #define E_ES 	3
36 #define E_IS 	4
37 
38 
39 /*
40  * this overlays a sockaddr_iso
41  */
42 
43 struct sockaddr_eon {
44 	short 			seon_family;	/* AF_ISO */
45 	u_short			seon_status;	/* overlays transport suffix */
46 #define EON_ESLINK_UP		0x1
47 #define EON_ESLINK_DOWN		0x2
48 #define EON_ISLINK_UP		0x10
49 #define EON_ISLINK_DOWN		0x20
50 /* no change is neither up or down */
51 
52 	u_char			seon_afi;		/* 47 */
53 	u_char			seon_idi[2];	/* 0006 */
54 	u_char			seon_vers;		/* 03 */
55 		/* right now ip addr is  aligned  -- be careful --
56 		 * future revisions may have it u_char[4]
57 		 */
58 	u_int			seon_ipaddr;	/* a.b.c.d */
59 	u_char			seon_protoid[1]; /* */
60 	u_char			seon_adrlen;
61 	u_short			seon_netype[2];
62 };
63 
64 struct sockaddr_eon eon_template = {
65 	AF_ISO, 0, 0x47, 0x0, 0x6, 0x3,
66 	0,
67 	0,
68 	0xa,
69 	0
70 };
71 
72 #define DOWNBITS ( EON_ESLINK_DOWN | EON_ISLINK_DOWN )
73 #define UPBITS ( EON_ESLINK_UP | EON_ISLINK_UP )
74 
75 struct eon_hdr {
76 	u_char 	eonh_vers; /* value 1 */
77 	u_char 	eonh_class;  /* address multicast class, below */
78 #define		EON_NORMAL_ADDR		0x0
79 #define		EON_MULTICAST_ES	0x1
80 #define		EON_MULTICAST_IS	0x2
81 #define		EON_BROADCAST		0x3
82 	u_short eonh_csum;  /* osi checksum (choke)*/
83 };
84 
85 /* stole these 2 fields of the flags for I-am-ES and I-am-IS */
86 #define	IFF_ES	0x400
87 #define	IFF_IS	0x800
88 
89 struct eon_stat {
90 	int	es_in_multi_es;
91 	int	es_in_multi_is;
92 	int	es_in_broad;
93 	int	es_in_normal;
94 	int	es_out_multi_es;
95 	int	es_out_multi_is;
96 	int	es_out_broad;
97 	int	es_out_normal;
98 	int	es_ipout;
99 
100 	int	es_icmp[PRC_NCMDS];
101 	/* errors */
102 	int	es_badcsum;
103 	int	es_badhdr;
104 } eonstat;
105 
106 #undef IncStat
107 #define IncStat(xxx) eonstat.xxx++
108