xref: /csrg-svn/sbin/XNSrouted/defs.h (revision 35551)
124306Ssklower /*
2*35551Sbostic  * Copyright (c) 1983 The Regents of the University of California.
3*35551Sbostic  * All rights reserved.
424327Ssklower  *
5*35551Sbostic  * Redistribution and use in source and binary forms are permitted
6*35551Sbostic  * provided that the above copyright notice and this paragraph are
7*35551Sbostic  * duplicated in all such forms and that any documentation,
8*35551Sbostic  * advertising materials, and other materials related to such
9*35551Sbostic  * distribution and use acknowledge that the software was developed
10*35551Sbostic  * by the University of California, Berkeley.  The name of the
11*35551Sbostic  * University may not be used to endorse or promote products derived
12*35551Sbostic  * from this software without specific prior written permission.
13*35551Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*35551Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*35551Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16*35551Sbostic  *
17*35551Sbostic  *	@(#)defs.h	5.6 (Berkeley) 09/19/88
1824306Ssklower  */
1924327Ssklower 
2024306Ssklower #include <sys/types.h>
2124306Ssklower #include <sys/socket.h>
2224306Ssklower 
2324306Ssklower #include <net/route.h>
2424317Ssklower #include <netns/ns.h>
2524317Ssklower #include <netns/idp.h>
2626170Ssklower #if defined(vax) || defined(pdp11)
2726170Ssklower #define xnnet(x) ((u_long) (x)->rip_dst[1] << 16 | (u_long) (x)->rip_dst[0] )
2826170Ssklower #else
2926170Ssklower #define xnnet(x) ((u_long) (x)->rip_dst[0] << 16 | (u_long) (x)->rip_dst[1] )
3026170Ssklower #endif
3124317Ssklower #define	IDPPORT_RIF	1
3224306Ssklower 
3324306Ssklower #include <stdio.h>
3424875Ssklower #include <syslog.h>
3524306Ssklower 
3624306Ssklower #include "protocol.h"
3724306Ssklower #include "trace.h"
3824306Ssklower #include "interface.h"
3924306Ssklower #include "table.h"
4024306Ssklower #include "af.h"
4124306Ssklower 
4224306Ssklower 
4324306Ssklower /*
4424306Ssklower  * When we find any interfaces marked down we rescan the
4524306Ssklower  * kernel every CHECK_INTERVAL seconds to see if they've
4624306Ssklower  * come up.
4724306Ssklower  */
4826170Ssklower #define	CHECK_INTERVAL	(5*60)
4924306Ssklower 
5024306Ssklower #define equal(a1, a2) \
5124306Ssklower 	(bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
5224306Ssklower #define	min(a,b)	((a)>(b)?(b):(a))
5324306Ssklower 
5424317Ssklower struct	sockaddr_ns addr;	/* Daemon's Address */
5524317Ssklower int	s;			/* Socket to listen on */
5624306Ssklower int	kmem;
5724306Ssklower int	supplier;		/* process should supply updates */
5824306Ssklower int	install;		/* if 1 call kernel */
5924306Ssklower int	lookforinterfaces;	/* if 1 probe kernel for new up interfaces */
6024306Ssklower int	performnlist;		/* if 1 check if /vmunix has changed */
6124306Ssklower int	externalinterfaces;	/* # of remote and local interfaces */
6224306Ssklower int	timeval;		/* local idea of time */
6324875Ssklower int	noteremoterequests;	/* squawk on requests from non-local nets */
6424306Ssklower 
6524306Ssklower char	packet[MAXPACKETSIZE+sizeof(struct idp)+1];
6624306Ssklower struct	rip *msg;
6724306Ssklower 
6824306Ssklower char	**argv0;
6924306Ssklower 
7024306Ssklower extern	char *sys_errlist[];
7124306Ssklower extern	int errno;
7224306Ssklower 
7324306Ssklower char	*malloc();
7424306Ssklower int	exit();
7524306Ssklower int	sendmsg();
7624306Ssklower int	supply();
7724306Ssklower int	timer();
7824306Ssklower int	cleanup();
79