xref: /original-bsd/sys/netiso/esis.h (revision 2cb1372a)
1 /*-
2  * Copyright (c) 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)esis.h	8.1 (Berkeley) 06/10/93
8  */
9 
10 /***********************************************************
11 		Copyright IBM Corporation 1987
12 
13                       All Rights Reserved
14 
15 Permission to use, copy, modify, and distribute this software and its
16 documentation for any purpose and without fee is hereby granted,
17 provided that the above copyright notice appear in all copies and that
18 both that copyright notice and this permission notice appear in
19 supporting documentation, and that the name of IBM not be
20 used in advertising or publicity pertaining to distribution of the
21 software without specific, written prior permission.
22 
23 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
24 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
25 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
26 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
27 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
28 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
29 SOFTWARE.
30 
31 ******************************************************************/
32 
33 /*
34  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
35  */
36 /*
37  *	$Header: esis.h,v 4.7 88/09/15 11:24:18 hagens Exp $
38  *	$Source: /usr/argo/sys/netiso/RCS/esis.h,v $
39  */
40 
41 #ifndef BYTE_ORDER
42 /*
43  * Definitions for byte order,
44  * according to byte significance from low address to high.
45  */
46 #define	LITTLE_ENDIAN	1234	/* least-significant byte first (vax) */
47 #define	BIG_ENDIAN	4321	/* most-significant byte first (IBM, net) */
48 #define	PDP_ENDIAN	3412	/* LSB first in word, MSW first in long (pdp) */
49 
50 #ifdef vax
51 #define	BYTE_ORDER	LITTLE_ENDIAN
52 #else
53 #define	BYTE_ORDER	BIG_ENDIAN	/* mc68000, tahoe, most others */
54 #endif
55 #endif /* BYTE_ORDER */
56 
57 #define	SNPAC_AGE		60			/* seconds */
58 #define	ESIS_CONFIG		60			/* seconds */
59 #define	ESIS_HT			(ESIS_CONFIG * 2)
60 
61 /*
62  *	Fixed part of an ESIS header
63  */
64 struct esis_fixed {
65 	u_char	esis_proto_id;		/* network layer protocol identifier */
66 	u_char	esis_hdr_len;		/* length indicator (octets) */
67 	u_char	esis_vers;			/* version/protocol identifier extension */
68 	u_char	esis_res1;			/* reserved */
69 	u_char	esis_type;			/* type code */
70 /* technically, type should be &='d 0x1f */
71 #define ESIS_ESH	0x02		/* End System Hello */
72 #define ESIS_ISH	0x04		/* Intermediate System Hello */
73 #define ESIS_RD		0x06		/* Redirect */
74 	u_char	esis_ht_msb;		/* holding time (seconds) high byte */
75 	u_char	esis_ht_lsb;		/* holding time (seconds) low byte */
76 	u_char	esis_cksum_msb;		/* checksum high byte */
77 	u_char	esis_cksum_lsb;		/* checksum low byte */
78 };
79 /*
80  * Values for ESIS datagram options
81  */
82 #define ESISOVAL_NETMASK	0xe1	/* address mask option, RD PDU only */
83 #define ESISOVAL_SNPAMASK	0xe2	/* snpa mask option, RD PDU only */
84 #define ESISOVAL_ESCT		0xc6	/* end system conf. timer, ISH PDU only */
85 
86 
87 #define	ESIS_CKSUM_OFF		0x07
88 #define ESIS_CKSUM_REQUIRED(pdu)\
89 	((pdu->esis_cksum_msb != 0) || (pdu->esis_cksum_lsb != 0))
90 
91 #define	ESIS_VERSION	1
92 
93 struct esis_stat {
94 	u_short		es_nomem;			/* insufficient memory to send hello */
95 	u_short		es_badcsum;			/* incorrect checksum */
96 	u_short		es_badvers;			/* incorrect version number */
97 	u_short		es_badtype;			/* unknown pdu type field */
98 	u_short		es_toosmall;		/* packet too small */
99 	u_short		es_eshsent;			/* ESH sent */
100 	u_short		es_eshrcvd;			/* ESH rcvd */
101 	u_short		es_ishsent;			/* ISH sent */
102 	u_short		es_ishrcvd;			/* ISH rcvd */
103 	u_short		es_rdsent;			/* RD sent */
104 	u_short		es_rdrcvd;			/* RD rcvd */
105 };
106 
107 #ifdef	KERNEL
108 struct esis_stat esis_stat;
109 #endif	/* KERNEL */
110