xref: /original-bsd/sbin/XNSrouted/protocol.h (revision c3e32dec)
1 /*
2  * Copyright (c) 1985, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This file includes significant work done at Cornell University by
6  * Bill Nesheim.  That work included by permission.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)protocol.h	8.1 (Berkeley) 06/05/93
11  */
12 
13 /*
14  * Xerox Routing Information Protocol
15  *
16  */
17 
18 struct netinfo {
19 	union ns_net	rip_dst;		/* destination net */
20 	u_short		rip_metric;		/* cost of route */
21 };
22 
23 struct rip {
24 	u_short	rip_cmd;		/* request/response */
25 	struct netinfo rip_nets[1];	/* variable length */
26 };
27 
28 /*
29  * Packet types.
30  */
31 #define	RIPCMD_REQUEST		1	/* want info */
32 #define	RIPCMD_RESPONSE		2	/* responding to request */
33 
34 #define	RIPCMD_MAX		3
35 #ifdef RIPCMDS
36 char *ripcmds[RIPCMD_MAX] =
37   { "#0", "REQUEST", "RESPONSE" };
38 #endif
39 
40 #define	HOPCNT_INFINITY		16		/* per Xerox NS */
41 #define	DSTNETS_ALL		0xffffffff	/* per Xerox NS */
42 #define	MAXPACKETSIZE		512		/* max broadcast size */
43 
44 extern union ns_net ns_anynet;
45 extern union ns_net ns_zeronet;
46 
47 /*
48  * Timer values used in managing the routing table.
49  * Every update forces an entry's timer to be reset.  After
50  * EXPIRE_TIME without updates, the entry is marked invalid,
51  * but held onto until GARBAGE_TIME so that others may
52  * see it "be deleted".
53  */
54 #define	TIMER_RATE		30	/* alarm clocks every 30 seconds */
55 
56 #define	SUPPLY_INTERVAL		30	/* time to supply tables */
57 
58 #define	EXPIRE_TIME		180	/* time to mark entry invalid */
59 #define	GARBAGE_TIME		240	/* time to garbage collect */
60