1 /* 2 * Copyright (c) 1983 The 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) 09/19/88 18 */ 19 20 #include <sys/types.h> 21 #include <sys/socket.h> 22 23 #include <net/route.h> 24 #include <netns/ns.h> 25 #include <netns/idp.h> 26 #if defined(vax) || defined(pdp11) 27 #define xnnet(x) ((u_long) (x)->rip_dst[1] << 16 | (u_long) (x)->rip_dst[0] ) 28 #else 29 #define xnnet(x) ((u_long) (x)->rip_dst[0] << 16 | (u_long) (x)->rip_dst[1] ) 30 #endif 31 #define IDPPORT_RIF 1 32 33 #include <stdio.h> 34 #include <syslog.h> 35 36 #include "protocol.h" 37 #include "trace.h" 38 #include "interface.h" 39 #include "table.h" 40 #include "af.h" 41 42 43 /* 44 * When we find any interfaces marked down we rescan the 45 * kernel every CHECK_INTERVAL seconds to see if they've 46 * come up. 47 */ 48 #define CHECK_INTERVAL (5*60) 49 50 #define equal(a1, a2) \ 51 (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0) 52 #define min(a,b) ((a)>(b)?(b):(a)) 53 54 struct sockaddr_ns addr; /* Daemon's Address */ 55 int s; /* Socket to listen on */ 56 int kmem; 57 int supplier; /* process should supply updates */ 58 int install; /* if 1 call kernel */ 59 int lookforinterfaces; /* if 1 probe kernel for new up interfaces */ 60 int performnlist; /* if 1 check if /vmunix has changed */ 61 int externalinterfaces; /* # of remote and local interfaces */ 62 int timeval; /* local idea of time */ 63 int noteremoterequests; /* squawk on requests from non-local nets */ 64 65 char packet[MAXPACKETSIZE+sizeof(struct idp)+1]; 66 struct rip *msg; 67 68 char **argv0; 69 70 extern char *sys_errlist[]; 71 extern int errno; 72 73 char *malloc(); 74 int exit(); 75 int sendmsg(); 76 int supply(); 77 int timer(); 78 int cleanup(); 79