124306Ssklower /* 224327Ssklower * Copyright (c) 1983 Regents of the University of California. 324327Ssklower * All rights reserved. The Berkeley software License Agreement 424327Ssklower * specifies the terms and conditions for redistribution. 524327Ssklower * 6*24875Ssklower * @(#)defs.h 5.4 (Berkeley) 09/17/85"; 724306Ssklower */ 824327Ssklower 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> 19*24875Ssklower #include <syslog.h> 2024306Ssklower 2124306Ssklower #include "protocol.h" 2224306Ssklower #include "trace.h" 2324306Ssklower #include "interface.h" 2424306Ssklower #include "table.h" 2524306Ssklower #include "af.h" 2624306Ssklower 2724306Ssklower 2824306Ssklower /* 2924306Ssklower * When we find any interfaces marked down we rescan the 3024306Ssklower * kernel every CHECK_INTERVAL seconds to see if they've 3124306Ssklower * come up. 3224306Ssklower */ 3324306Ssklower #define CHECK_INTERVAL (1*60) 3424306Ssklower 3524306Ssklower #define equal(a1, a2) \ 3624306Ssklower (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0) 3724306Ssklower #define min(a,b) ((a)>(b)?(b):(a)) 3824306Ssklower 3924317Ssklower struct sockaddr_ns addr; /* Daemon's Address */ 4024317Ssklower int s; /* Socket to listen on */ 4124306Ssklower int kmem; 4224306Ssklower int supplier; /* process should supply updates */ 4324306Ssklower int install; /* if 1 call kernel */ 4424306Ssklower int lookforinterfaces; /* if 1 probe kernel for new up interfaces */ 4524306Ssklower int performnlist; /* if 1 check if /vmunix has changed */ 4624306Ssklower int externalinterfaces; /* # of remote and local interfaces */ 4724306Ssklower int timeval; /* local idea of time */ 48*24875Ssklower int noteremoterequests; /* squawk on requests from non-local nets */ 4924306Ssklower 5024306Ssklower char packet[MAXPACKETSIZE+sizeof(struct idp)+1]; 5124306Ssklower struct rip *msg; 5224306Ssklower 5324306Ssklower char **argv0; 5424306Ssklower 5524306Ssklower extern char *sys_errlist[]; 5624306Ssklower extern int errno; 5724306Ssklower 5824306Ssklower char *malloc(); 5924306Ssklower int exit(); 6024306Ssklower int sendmsg(); 6124306Ssklower int supply(); 6224306Ssklower int timer(); 6324306Ssklower int cleanup(); 64