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