Commit | Line | Data |
---|---|---|
300e8bd6 C |
1 | /* egp.h */ |
2 | ||
3 | /* EGP User Process, ISI 23-Jun-84 */ | |
4 | ||
5 | /* uses defs.h */ | |
6 | ||
7 | struct egpngh { | |
8 | struct egpngh *ng_next; /* next state table of linked list */ | |
9 | /* struct interface *ng_ifp; /* pointer to shared net interface | |
10 | table */ | |
11 | int ng_state; | |
12 | int ng_reach; /* reachability substate */ | |
13 | int ng_flags; | |
14 | u_char ng_status; /* Info saved for cease retransmission */ | |
15 | u_long ng_myaddr; /* My inet address for common net */ | |
16 | u_long ng_addr; /* Neighbor's inet address */ | |
17 | u_short ng_sid; /* seq.# next acq., hello or poll to send */ | |
18 | u_short ng_rid; /* seq.# last acq., hello or poll recvd */ | |
19 | ||
20 | /* Acquire and hello info */ | |
21 | int ng_retry; /* For states ACQUIRE_SENT and CEASE_SENT, | |
22 | No. retries to acquire or cease neighbor. | |
23 | For NEIGHBOR state, no. consecutive times | |
24 | neighbor is unreachable */ | |
25 | int ng_hint; /* Send acquire, hello or cease interval | |
26 | in seconds */ | |
27 | long ng_htime; /* Time for next acquire, hello, or cease */ | |
28 | int ng_responses; /* Shift register of responses for determining | |
29 | reachability, each set bit corresponds to a | |
30 | response, each zero to no response */ | |
31 | int ng_rcmd; /* No. acq., hello and poll commands recvd | |
32 | since lats check */ | |
33 | ||
34 | /* NR Poll info */ | |
35 | int ng_snpoll; /* No. sends of this NR poll id */ | |
36 | int ng_spint; /* Send NR poll interval (in seconds) */ | |
37 | long ng_stime; /* Time to send next NR poll */ | |
38 | int ng_runsol; /* No. unsolicited NR msgs received for | |
39 | previous id */ | |
40 | int ng_rnpoll; /* No. polls received before next poll time */ | |
41 | int ng_rpint; /* Rcv NR poll interval (in seconds) */ | |
42 | long ng_rtime; /* Time to rcv next NR poll */ | |
43 | }; | |
44 | ||
45 | #define egpng struct egpngh | |
46 | ||
47 | /* States */ | |
48 | #define EMPTY 0 | |
49 | #define UNACQUIRED 1 | |
50 | #define ACQUIRE_SENT 2 | |
51 | #define NEIGHBOR 3 | |
52 | #define CEASE_SENT 4 | |
53 | #define BAD 5 | |
54 | ||
55 | /* reachability substates for state NEIGHBOR */ | |
56 | #define BOTH_UP 0 | |
57 | #define NG_DOWN 1 /* according to me my peer is unreachable */ | |
58 | #define ME_DOWN 2 /* according to my peer I am unreachable */ | |
59 | ||
60 | /* flags */ | |
61 | #define NG_BAD 1 /* change to state BAD when cease complete */ | |
62 | ||
63 | /* Basic EGP packet */ | |
64 | #define egpkt struct egppkt | |
65 | ||
66 | egpkt { u_char egp_ver; /* Version # */ | |
67 | u_char egp_type; /* Opcode */ | |
68 | u_char egp_code; | |
69 | u_char egp_status; | |
70 | u_short egp_chksum; | |
71 | u_short egp_system; /* Autonomous system */ | |
72 | u_short egp_id; | |
73 | }; | |
74 | ||
75 | /* EGP neighbor acquisition packet */ | |
76 | struct egpacq { | |
77 | egpkt ea_pkt; | |
78 | u_short ea_hint; /* Hello interval in seconds */ | |
79 | u_short ea_pint; /* NR poll interval in seconds */ | |
80 | }; | |
81 | ||
82 | /* EGP NR poll packet */ | |
83 | struct egppoll { | |
84 | egpkt ep_pkt; | |
85 | u_short ep_unused; | |
86 | u_long ep_net; /* Source net */ | |
87 | }; | |
88 | ||
89 | /* EGP NR Message packet */ | |
90 | struct egpnr { | |
91 | egpkt en_pkt; | |
92 | u_char en_igw; /* No. internal gateways */ | |
93 | u_char en_egw; /* No. external gateways */ | |
94 | u_long en_net; /* shared net */ | |
95 | }; | |
96 | ||
97 | #define NRMAXNETUNIT 9 /* maximum size per net in octets of net part | |
98 | of NR message */ | |
99 | /* EGP Error packet */ | |
100 | struct egperr { | |
101 | egpkt ee_pkt; | |
102 | u_short ee_rsn; | |
103 | u_char ee_egphd[12]; /* First 12 bytes of bad egp pkt */ | |
104 | }; | |
105 | ||
106 | #define EGPLEN (sizeof(egpkt)) | |
107 | #define EGPVER 2 | |
108 | ||
109 | /* EGP Types */ | |
110 | #define EGPNR 1 | |
111 | #define EGPPOLL 2 | |
112 | #define EGPACQ 3 | |
113 | #define EGPHELLO 5 | |
114 | #define EGPERR 8 | |
115 | ||
116 | /* Neighbor Acquisition Codes */ | |
117 | #define NAREQ 0 /* Neighbor acq. request */ | |
118 | #define NACONF 1 /* Neighbor acq. confirmation */ | |
119 | #define NAREFUS 2 /* Neighbor acq. refuse */ | |
120 | #define NACEASE 3 /* Neighbor cease */ | |
121 | #define NACACK 4 /* Neighbor cease ack */ | |
122 | ||
123 | /* Neighbour Acquisition Message Status Info */ | |
124 | #define UNSPEC 0 | |
125 | #define ACTIVE 1 | |
126 | #define PASSIVE 2 | |
127 | #define NORESOURCE 3 | |
128 | #define ADMINPROHIB 4 | |
129 | #define GODOWN 5 | |
130 | #define PARAMPROB 6 | |
131 | #define PROTOVIOL 7 | |
132 | ||
133 | /* Neighbor Hello Codes */ | |
134 | #define HELLO 0 | |
135 | #define HEARDU 1 | |
136 | ||
137 | /* Reachability, poll and update status */ | |
138 | #define INDETERMINATE 0 | |
139 | #define UP 1 | |
140 | #define DOWN 2 | |
141 | #define UNSOLICITED 128 | |
142 | ||
143 | /* Error reason status */ | |
144 | #define EUNSPEC 0 | |
145 | #define EBADHEAD 1 | |
146 | #define EBADDATA 2 | |
147 | #define ENOREACH 3 | |
148 | #define EXSPOLL 4 | |
149 | #define ENORESPONSE 5 |