Commit | Line | Data |
---|---|---|
c74357ac KS |
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 | * $Header: esis.h,v 4.7 88/09/15 11:24:18 hagens Exp $ | |
29 | * $Source: /usr/argo/sys/netiso/RCS/esis.h,v $ | |
30 | */ | |
31 | ||
32 | #ifndef BYTE_ORDER | |
33 | /* | |
34 | * Definitions for byte order, | |
35 | * according to byte significance from low address to high. | |
36 | */ | |
37 | #define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */ | |
38 | #define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ | |
39 | #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */ | |
40 | ||
41 | #ifdef vax | |
42 | #define BYTE_ORDER LITTLE_ENDIAN | |
43 | #else | |
44 | #define BYTE_ORDER BIG_ENDIAN /* mc68000, tahoe, most others */ | |
45 | #endif | |
46 | #endif BYTE_ORDER | |
47 | ||
48 | #define SNPAC_AGE 60 /* seconds */ | |
49 | #define ESIS_CONFIG 60 /* seconds */ | |
50 | #define ESIS_HT (ESIS_CONFIG * 2) | |
51 | ||
52 | /* | |
53 | * Fixed part of an ESIS header | |
54 | */ | |
55 | struct esis_fixed { | |
56 | u_char esis_proto_id; /* network layer protocol identifier */ | |
57 | u_char esis_hdr_len; /* length indicator (octets) */ | |
58 | u_char esis_vers; /* version/protocol identifier extension */ | |
59 | u_char esis_res1; /* reserved */ | |
60 | #if BYTE_ORDER == LITTLE_ENDIAN | |
61 | u_char esis_type:5, /* type code */ | |
62 | esis_res4:1, /* reserved */ | |
63 | esis_res3:1, /* reserved */ | |
64 | esis_res2:1; /* reserved */ | |
65 | #define ESIS_ESH 0x02 /* End System Hello */ | |
66 | #define ESIS_ISH 0x04 /* Intermediate System Hello */ | |
67 | #define ESIS_RD 0x06 /* Redirect */ | |
68 | #endif | |
69 | #if BYTE_ORDER == BIG_ENDIAN | |
70 | u_char esis_res2:1, /* reserved */ | |
71 | esis_res3:1, /* reserved */ | |
72 | esis_res4:1, /* reserved */ | |
73 | esis_type:5; /* type code */ | |
74 | #define ESIS_ESH 0x02 /* End System Hello */ | |
75 | #define ESIS_ISH 0x04 /* Intermediate System Hello */ | |
76 | #define ESIS_RD 0x06 /* Redirect */ | |
77 | #endif | |
78 | u_char esis_ht_msb; /* holding time (seconds) high byte */ | |
79 | u_char esis_ht_lsb; /* holding time (seconds) low byte */ | |
80 | u_char esis_cksum_msb; /* checksum high byte */ | |
81 | u_char esis_cksum_lsb; /* checksum low byte */ | |
82 | }; | |
83 | ||
84 | #define ESIS_CKSUM_OFF 0x07 | |
85 | #define ESIS_CKSUM_REQUIRED(pdu)\ | |
86 | ((pdu->esis_cksum_msb != 0) || (pdu->esis_cksum_lsb != 0)) | |
87 | ||
88 | #define ESIS_VERSION 1 | |
89 | ||
90 | struct esis_stat { | |
91 | u_short es_nomem; /* insufficient memory to send hello */ | |
92 | u_short es_badcsum; /* incorrect checksum */ | |
93 | u_short es_badvers; /* incorrect version number */ | |
94 | u_short es_badtype; /* unknown pdu type field */ | |
95 | u_short es_toosmall; /* packet too small */ | |
96 | u_short es_eshsent; /* ESH sent */ | |
97 | u_short es_eshrcvd; /* ESH rcvd */ | |
98 | u_short es_ishsent; /* ISH sent */ | |
99 | u_short es_ishrcvd; /* ISH rcvd */ | |
100 | u_short es_rdsent; /* RD sent */ | |
101 | u_short es_rdrcvd; /* RD rcvd */ | |
102 | }; | |
103 | ||
104 | #ifdef KERNEL | |
105 | struct esis_stat esis_stat; | |
106 | #endif KERNEL |