Commit | Line | Data |
---|---|---|
b0097ef1 | 1 | /* routed.h 82/08/18 4.8 */ |
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 SL |
8 | */ |
9 | struct netinfo { | |
10 | struct sockaddr rip_dst; /* destination net/host */ | |
11 | int rip_metric; /* cost of route */ | |
12 | }; | |
13 | ||
14 | struct rip { | |
15 | u_char rip_cmd; /* request/response */ | |
16 | u_char rip_res1[3]; /* pad to 32-bit boundary */ | |
0f7c374e SL |
17 | union { |
18 | struct netinfo ru_nets[1]; /* variable length... */ | |
19 | char ru_tracefile[1]; /* ditto ... */ | |
20 | } ripun; | |
21 | #define rip_nets ripun.ru_nets | |
22 | #define rip_tracefile ripun.ru_tracefile | |
1c1358ef SL |
23 | }; |
24 | ||
74b4e6b3 SL |
25 | #define RIPCMD_REQUEST 1 /* want info */ |
26 | #define RIPCMD_RESPONSE 2 /* responding to request */ | |
27 | #define RIPCMD_TRACEON 3 /* turn tracing on */ | |
28 | #define RIPCMD_TRACEOFF 4 /* turn it off */ | |
29 | ||
30 | #define RIPCMD_MAX 5 | |
31 | #ifdef RIPCMDS | |
32 | char *ripcmds[RIPCMD_MAX] = | |
33 | { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" }; | |
34 | #endif | |
1c1358ef | 35 | |
1c1358ef | 36 | #define HOPCNT_INFINITY 16 /* per Xerox NS */ |
971be2e2 | 37 | #define MAXPACKETSIZE 512 /* max broadcast size */ |
1c1358ef SL |
38 | |
39 | /* | |
971be2e2 | 40 | * Timer values used in managing the routing table. |
1c1358ef SL |
41 | * Every update forces an entry's timer to be reset. After |
42 | * EXPIRE_TIME without updates, the entry is marked invalid, | |
43 | * but held onto until GARBAGE_TIME so that others may | |
6db0b3a4 | 44 | * see it "be deleted". |
1c1358ef SL |
45 | */ |
46 | #define TIMER_RATE 30 /* alarm clocks every 30 seconds */ | |
6db0b3a4 | 47 | |
1c1358ef | 48 | #define SUPPLY_INTERVAL 30 /* time to supply tables */ |
6db0b3a4 BJ |
49 | |
50 | #define EXPIRE_TIME 180 /* time to mark entry invalid */ | |
040c02ef | 51 | #define GARBAGE_TIME 240 /* time to garbage collect */ |