xref: /csrg-svn/sys/netiso/esis.h (revision 37469)
136380Ssklower /***********************************************************
236380Ssklower 		Copyright IBM Corporation 1987
336380Ssklower 
436380Ssklower                       All Rights Reserved
536380Ssklower 
636380Ssklower Permission to use, copy, modify, and distribute this software and its
736380Ssklower documentation for any purpose and without fee is hereby granted,
836380Ssklower provided that the above copyright notice appear in all copies and that
936380Ssklower both that copyright notice and this permission notice appear in
1036380Ssklower supporting documentation, and that the name of IBM not be
1136380Ssklower used in advertising or publicity pertaining to distribution of the
1236380Ssklower software without specific, written prior permission.
1336380Ssklower 
1436380Ssklower IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
1536380Ssklower ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
1636380Ssklower IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
1736380Ssklower ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1836380Ssklower WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1936380Ssklower ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
2036380Ssklower SOFTWARE.
2136380Ssklower 
2236380Ssklower ******************************************************************/
2336380Ssklower 
2436380Ssklower /*
2536380Ssklower  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
2636380Ssklower  */
2736380Ssklower /*
2836380Ssklower  *	$Header: esis.h,v 4.7 88/09/15 11:24:18 hagens Exp $
2936380Ssklower  *	$Source: /usr/argo/sys/netiso/RCS/esis.h,v $
3036380Ssklower  */
3136380Ssklower 
3236380Ssklower #ifndef BYTE_ORDER
3336380Ssklower /*
3436380Ssklower  * Definitions for byte order,
3536380Ssklower  * according to byte significance from low address to high.
3636380Ssklower  */
3736380Ssklower #define	LITTLE_ENDIAN	1234	/* least-significant byte first (vax) */
3836380Ssklower #define	BIG_ENDIAN	4321	/* most-significant byte first (IBM, net) */
3936380Ssklower #define	PDP_ENDIAN	3412	/* LSB first in word, MSW first in long (pdp) */
4036380Ssklower 
4136380Ssklower #ifdef vax
4236380Ssklower #define	BYTE_ORDER	LITTLE_ENDIAN
4336380Ssklower #else
4436380Ssklower #define	BYTE_ORDER	BIG_ENDIAN	/* mc68000, tahoe, most others */
4536380Ssklower #endif
4636380Ssklower #endif BYTE_ORDER
4736380Ssklower 
4836380Ssklower #define	SNPAC_AGE		60			/* seconds */
4936380Ssklower #define	ESIS_CONFIG		60			/* seconds */
5036380Ssklower #define	ESIS_HT			(ESIS_CONFIG * 2)
5136380Ssklower 
5236380Ssklower /*
5336380Ssklower  *	Fixed part of an ESIS header
5436380Ssklower  */
5536380Ssklower struct esis_fixed {
5636380Ssklower 	u_char	esis_proto_id;		/* network layer protocol identifier */
5736380Ssklower 	u_char	esis_hdr_len;		/* length indicator (octets) */
5836380Ssklower 	u_char	esis_vers;			/* version/protocol identifier extension */
5936380Ssklower 	u_char	esis_res1;			/* reserved */
60*37469Ssklower 	u_char	esis_type;			/* type code */
61*37469Ssklower /* technically, type should be &='d 0x1f */
6236380Ssklower #define ESIS_ESH	0x02		/* End System Hello */
6336380Ssklower #define ESIS_ISH	0x04		/* Intermediate System Hello */
6436380Ssklower #define ESIS_RD		0x06		/* Redirect */
6536380Ssklower 	u_char	esis_ht_msb;		/* holding time (seconds) high byte */
6636380Ssklower 	u_char	esis_ht_lsb;		/* holding time (seconds) low byte */
6736380Ssklower 	u_char	esis_cksum_msb;		/* checksum high byte */
6836380Ssklower 	u_char	esis_cksum_lsb;		/* checksum low byte */
6936380Ssklower };
70*37469Ssklower /*
71*37469Ssklower  * Values for ESIS datagram options
72*37469Ssklower  */
73*37469Ssklower #define ESISOVAL_NETMASK	0xe1	/* address mask option, RD PDU only */
74*37469Ssklower #define ESISOVAL_SNPAMASK	0xe2	/* snpa mask option, RD PDU only */
75*37469Ssklower #define ESISOVAL_ESCT		0xc6	/* end system conf. timer, ISH PDU only */
7636380Ssklower 
77*37469Ssklower 
7836380Ssklower #define	ESIS_CKSUM_OFF		0x07
7936380Ssklower #define ESIS_CKSUM_REQUIRED(pdu)\
8036380Ssklower 	((pdu->esis_cksum_msb != 0) || (pdu->esis_cksum_lsb != 0))
8136380Ssklower 
8236380Ssklower #define	ESIS_VERSION	1
8336380Ssklower 
8436380Ssklower struct esis_stat {
8536380Ssklower 	u_short		es_nomem;			/* insufficient memory to send hello */
8636380Ssklower 	u_short		es_badcsum;			/* incorrect checksum */
8736380Ssklower 	u_short		es_badvers;			/* incorrect version number */
8836380Ssklower 	u_short		es_badtype;			/* unknown pdu type field */
8936380Ssklower 	u_short		es_toosmall;		/* packet too small */
9036380Ssklower 	u_short		es_eshsent;			/* ESH sent */
9136380Ssklower 	u_short		es_eshrcvd;			/* ESH rcvd */
9236380Ssklower 	u_short		es_ishsent;			/* ISH sent */
9336380Ssklower 	u_short		es_ishrcvd;			/* ISH rcvd */
9436380Ssklower 	u_short		es_rdsent;			/* RD sent */
9536380Ssklower 	u_short		es_rdrcvd;			/* RD rcvd */
9636380Ssklower };
9736380Ssklower 
9836380Ssklower #ifdef	KERNEL
9936380Ssklower struct esis_stat esis_stat;
10036380Ssklower #endif	KERNEL
101