xref: /csrg-svn/sbin/XNSrouted/defs.h (revision 24327)
124306Ssklower /*
2*24327Ssklower  * Copyright (c) 1983 Regents of the University of California.
3*24327Ssklower  * All rights reserved.  The Berkeley software License Agreement
4*24327Ssklower  * specifies the terms and conditions for redistribution.
5*24327Ssklower  *
6*24327Ssklower  *	@(#)defs.h	5.3 (Berkeley) 08/16/85";
724306Ssklower  */
8*24327Ssklower 
924306Ssklower #include <sys/types.h>
1024306Ssklower #include <sys/socket.h>
1124306Ssklower 
1224306Ssklower #include <net/route.h>
1324317Ssklower #include <netns/ns.h>
1424317Ssklower #include <netns/idp.h>
1524317Ssklower #define xnnet(p) (*(long *)&(p))
1624317Ssklower #define	IDPPORT_RIF	1
1724306Ssklower 
1824306Ssklower #include <stdio.h>
1924306Ssklower 
2024306Ssklower #include "protocol.h"
2124306Ssklower #include "trace.h"
2224306Ssklower #include "interface.h"
2324306Ssklower #include "table.h"
2424306Ssklower #include "af.h"
2524306Ssklower 
2624306Ssklower 
2724306Ssklower /*
2824306Ssklower  * When we find any interfaces marked down we rescan the
2924306Ssklower  * kernel every CHECK_INTERVAL seconds to see if they've
3024306Ssklower  * come up.
3124306Ssklower  */
3224306Ssklower #define	CHECK_INTERVAL	(1*60)
3324306Ssklower 
3424306Ssklower #define equal(a1, a2) \
3524306Ssklower 	(bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
3624306Ssklower #define	min(a,b)	((a)>(b)?(b):(a))
3724306Ssklower 
3824317Ssklower struct	sockaddr_ns addr;	/* Daemon's Address */
3924317Ssklower int	s;			/* Socket to listen on */
4024306Ssklower int	kmem;
4124306Ssklower int	supplier;		/* process should supply updates */
4224306Ssklower int	install;		/* if 1 call kernel */
4324306Ssklower int	lookforinterfaces;	/* if 1 probe kernel for new up interfaces */
4424306Ssklower int	performnlist;		/* if 1 check if /vmunix has changed */
4524306Ssklower int	externalinterfaces;	/* # of remote and local interfaces */
4624306Ssklower int	timeval;		/* local idea of time */
4724306Ssklower 
4824306Ssklower char	packet[MAXPACKETSIZE+sizeof(struct idp)+1];
4924306Ssklower struct	rip *msg;
5024306Ssklower 
5124306Ssklower char	**argv0;
5224306Ssklower 
5324306Ssklower extern	char *sys_errlist[];
5424306Ssklower extern	int errno;
5524306Ssklower 
5624306Ssklower char	*malloc();
5724306Ssklower int	exit();
5824306Ssklower int	sendmsg();
5924306Ssklower int	supply();
6024306Ssklower int	timer();
6124306Ssklower int	cleanup();
62