xref: /original-bsd/sbin/XNSrouted/protocol.h (revision 5f69ff4a)
1 /*
2  * Copyright (c) 1985 The Regents of the University of California.
3  * 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  * Redistribution and use in source and binary forms are permitted
9  * provided that the above copyright notice and this paragraph are
10  * duplicated in all such forms and that any documentation,
11  * advertising materials, and other materials related to such
12  * distribution and use acknowledge that the software was developed
13  * by the University of California, Berkeley.  The name of the
14  * University may not be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  *	@(#)protocol.h	5.5 (Berkeley) 09/19/88
21  */
22 
23 /*
24  * Xerox Routing Information Protocol
25  *
26  */
27 
28 struct netinfo {
29 	union ns_net	rip_dst;		/* destination net */
30 	u_short		rip_metric;		/* cost of route */
31 };
32 
33 struct rip {
34 	u_short	rip_cmd;		/* request/response */
35 	struct netinfo rip_nets[1];	/* variable length */
36 };
37 
38 /*
39  * Packet types.
40  */
41 #define	RIPCMD_REQUEST		1	/* want info */
42 #define	RIPCMD_RESPONSE		2	/* responding to request */
43 
44 #define	RIPCMD_MAX		3
45 #ifdef RIPCMDS
46 char *ripcmds[RIPCMD_MAX] =
47   { "#0", "REQUEST", "RESPONSE" };
48 #endif
49 
50 #define	HOPCNT_INFINITY		16		/* per Xerox NS */
51 #define	DSTNETS_ALL		0xffffffff	/* per Xerox NS */
52 #define	MAXPACKETSIZE		512		/* max broadcast size */
53 
54 extern union ns_net ns_anynet;
55 extern union ns_net ns_zeronet;
56 
57 /*
58  * Timer values used in managing the routing table.
59  * Every update forces an entry's timer to be reset.  After
60  * EXPIRE_TIME without updates, the entry is marked invalid,
61  * but held onto until GARBAGE_TIME so that others may
62  * see it "be deleted".
63  */
64 #define	TIMER_RATE		30	/* alarm clocks every 30 seconds */
65 
66 #define	SUPPLY_INTERVAL		30	/* time to supply tables */
67 
68 #define	EXPIRE_TIME		180	/* time to mark entry invalid */
69 #define	GARBAGE_TIME		240	/* time to garbage collect */
70