xref: /original-bsd/sbin/routed/defs.h (revision 3b4109a4)
1 /*
2  * Copyright (c) 1983, 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)defs.h	5.10 (Berkeley) 02/28/91
8  */
9 
10 /*
11  * Internal data structure definitions for
12  * user routing process.  Based on Xerox NS
13  * protocol specs with mods relevant to more
14  * general addressing scheme.
15  */
16 #include <sys/param.h>
17 #include <sys/socket.h>
18 #include <sys/time.h>
19 
20 #include <net/route.h>
21 #include <netinet/in.h>
22 #include <protocols/routed.h>
23 
24 #include <stdio.h>
25 #include <netdb.h>
26 
27 #include "trace.h"
28 #include "interface.h"
29 #include "table.h"
30 #include "af.h"
31 
32 /*
33  * When we find any interfaces marked down we rescan the
34  * kernel every CHECK_INTERVAL seconds to see if they've
35  * come up.
36  */
37 #define	CHECK_INTERVAL	(1*60)
38 
39 #define equal(a1, a2) \
40 	(bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
41 
42 struct	sockaddr_in addr;	/* address of daemon's socket */
43 
44 int	s;			/* source and sink of all data */
45 int	kmem;
46 int	supplier;		/* process should supply updates */
47 int	install;		/* if 1 call kernel */
48 int	lookforinterfaces;	/* if 1 probe kernel for new up interfaces */
49 int	performnlist;		/* if 1 check if /vmunix has changed */
50 int	externalinterfaces;	/* # of remote and local interfaces */
51 struct	timeval now;		/* current idea of time */
52 struct	timeval lastbcast;	/* last time all/changes broadcast */
53 struct	timeval lastfullupdate;	/* last time full table broadcast */
54 struct	timeval nextbcast;	/* time to wait before changes broadcast */
55 int	needupdate;		/* true if we need update at nextbcast */
56 
57 char	packet[MAXPACKETSIZE+1];
58 struct	rip *msg;
59 
60 char	**argv0;
61 struct	servent *sp;
62 
63 struct	in_addr inet_makeaddr();
64 int	inet_addr();
65 int	sndmsg();
66 int	supply();
67 int	cleanup();
68