protocol change; byte swap those fields which need it; also add
[unix-history] / usr / src / include / protocols / routed.h
CommitLineData
55d340a4 1/* routed.h 83/05/25 4.9 */
1c1358ef
SL
2/*
3 * Routing Information Protocol
971be2e2
SL
4 *
5 * Derived from Xerox NS Routing Information Protocol
6 * by changing 32-bit net numbers to sockaddr's and
7 * padding stuff to 32-bit boundaries.
1c1358ef 8 */
55d340a4
SL
9#define RIPVERSION 1
10
1c1358ef
SL
11struct netinfo {
12 struct sockaddr rip_dst; /* destination net/host */
13 int rip_metric; /* cost of route */
14};
15
16struct rip {
17 u_char rip_cmd; /* request/response */
55d340a4
SL
18 u_char rip_vers; /* protocol version # */
19 u_char rip_res1[2]; /* pad to 32-bit boundary */
0f7c374e
SL
20 union {
21 struct netinfo ru_nets[1]; /* variable length... */
22 char ru_tracefile[1]; /* ditto ... */
23 } ripun;
24#define rip_nets ripun.ru_nets
25#define rip_tracefile ripun.ru_tracefile
1c1358ef
SL
26};
27
55d340a4
SL
28/*
29 * Packet types.
30 */
74b4e6b3
SL
31#define RIPCMD_REQUEST 1 /* want info */
32#define RIPCMD_RESPONSE 2 /* responding to request */
33#define RIPCMD_TRACEON 3 /* turn tracing on */
34#define RIPCMD_TRACEOFF 4 /* turn it off */
35
36#define RIPCMD_MAX 5
37#ifdef RIPCMDS
38char *ripcmds[RIPCMD_MAX] =
39 { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
40#endif
1c1358ef 41
1c1358ef 42#define HOPCNT_INFINITY 16 /* per Xerox NS */
971be2e2 43#define MAXPACKETSIZE 512 /* max broadcast size */
1c1358ef
SL
44
45/*
971be2e2 46 * Timer values used in managing the routing table.
1c1358ef
SL
47 * Every update forces an entry's timer to be reset. After
48 * EXPIRE_TIME without updates, the entry is marked invalid,
49 * but held onto until GARBAGE_TIME so that others may
6db0b3a4 50 * see it "be deleted".
1c1358ef
SL
51 */
52#define TIMER_RATE 30 /* alarm clocks every 30 seconds */
6db0b3a4 53
1c1358ef 54#define SUPPLY_INTERVAL 30 /* time to supply tables */
6db0b3a4
BJ
55
56#define EXPIRE_TIME 180 /* time to mark entry invalid */
040c02ef 57#define GARBAGE_TIME 240 /* time to garbage collect */