xref: /original-bsd/include/protocols/routed.h (revision f0fd5f8a)
1 /*	routed.h	82/08/18	4.8	*/
2 /*
3  * Routing Information Protocol
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.
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 */
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
23 };
24 
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
35 
36 #define	HOPCNT_INFINITY		16	/* per Xerox NS */
37 #define	MAXPACKETSIZE		512	/* max broadcast size */
38 
39 /*
40  * Timer values used in managing the routing table.
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
44  * see it "be deleted".
45  */
46 #define	TIMER_RATE		30	/* alarm clocks every 30 seconds */
47 
48 #define	SUPPLY_INTERVAL		30	/* time to supply tables */
49 
50 #define	EXPIRE_TIME		180	/* time to mark entry invalid */
51 #define	GARBAGE_TIME		240	/* time to garbage collect */
52