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.7 (Berkeley) 02/18/89 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/param.h> 27 #include <sys/socket.h> 28 #include <sys/time.h> 29 30 #include <net/route.h> 31 #include <netinet/in.h> 32 #include <protocols/routed.h> 33 34 #include <stdio.h> 35 #include <netdb.h> 36 37 #include "trace.h" 38 #include "interface.h" 39 #include "table.h" 40 #include "af.h" 41 42 /* 43 * When we find any interfaces marked down we rescan the 44 * kernel every CHECK_INTERVAL seconds to see if they've 45 * come up. 46 */ 47 #define CHECK_INTERVAL (1*60) 48 49 #define equal(a1, a2) \ 50 (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0) 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 struct timeval now; /* current idea of time */ 62 struct timeval lastbcast; /* last time all/changes broadcast */ 63 struct timeval lastfullupdate; /* last time full table broadcast */ 64 struct timeval nextbcast; /* time to wait before changes broadcast */ 65 int needupdate; /* true if we need update at nextbcast */ 66 67 char packet[MAXPACKETSIZE+1]; 68 struct rip *msg; 69 70 char **argv0; 71 struct servent *sp; 72 73 extern char *sys_errlist[]; 74 extern int errno; 75 76 struct in_addr inet_makeaddr(); 77 int inet_addr(); 78 char *malloc(); 79 char *ctime(); 80 int exit(); 81 int sendmsg(); 82 int supply(); 83 int timer(); 84 int cleanup(); 85