xref: /original-bsd/sbin/routed/defs.h (revision 1451ccc8)
1 /*
2  * Copyright (c) 1983, 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)defs.h	5.6 (Berkeley) 06/18/88
18  */
19 
20 /*
21  * Internal data structure definitions for
22  * user routing process.  Based on Xerox NS
23  * protocol specs with mods relevant to more
24  * general addressing scheme.
25  */
26 #include <sys/types.h>
27 #include <sys/socket.h>
28 
29 #include <net/route.h>
30 #include <netinet/in.h>
31 #include <protocols/routed.h>
32 
33 #include <stdio.h>
34 #include <netdb.h>
35 
36 #include "trace.h"
37 #include "interface.h"
38 #include "table.h"
39 #include "af.h"
40 
41 /*
42  * When we find any interfaces marked down we rescan the
43  * kernel every CHECK_INTERVAL seconds to see if they've
44  * come up.
45  */
46 #define	CHECK_INTERVAL	(1*60)
47 
48 #define equal(a1, a2) \
49 	(bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
50 #define	min(a,b)	((a)>(b)?(b):(a))
51 
52 struct	sockaddr_in addr;	/* address of daemon's socket */
53 
54 int	s;			/* source and sink of all data */
55 int	kmem;
56 int	supplier;		/* process should supply updates */
57 int	install;		/* if 1 call kernel */
58 int	lookforinterfaces;	/* if 1 probe kernel for new up interfaces */
59 int	performnlist;		/* if 1 check if /vmunix has changed */
60 int	externalinterfaces;	/* # of remote and local interfaces */
61 int	timeval;		/* local idea of time */
62 
63 char	packet[MAXPACKETSIZE+1];
64 struct	rip *msg;
65 
66 char	**argv0;
67 struct	servent *sp;
68 
69 extern	char *sys_errlist[];
70 extern	int errno;
71 
72 struct	in_addr inet_makeaddr();
73 int	inet_addr();
74 char	*malloc();
75 char	*ctime();
76 int	exit();
77 int	sendmsg();
78 int	supply();
79 int	timer();
80 int	cleanup();
81