122003Sdist /* 234565Skarels * Copyright (c) 1983, 1988 Regents of the University of California. 333489Sbostic * All rights reserved. 422003Sdist * 5*42712Sbostic * %sccs.include.redist.c% 633489Sbostic * 7*42712Sbostic * @(#)defs.h 5.9 (Berkeley) 06/01/90 822003Sdist */ 96921Ssam 106921Ssam /* 116921Ssam * Internal data structure definitions for 126921Ssam * user routing process. Based on Xerox NS 136921Ssam * protocol specs with mods relevant to more 146921Ssam * general addressing scheme. 156921Ssam */ 1636831Skarels #include <sys/param.h> 179023Ssam #include <sys/socket.h> 1836831Skarels #include <sys/time.h> 199213Ssam 206935Ssam #include <net/route.h> 219213Ssam #include <netinet/in.h> 2224198Skarels #include <protocols/routed.h> 239213Ssam 249023Ssam #include <stdio.h> 259023Ssam #include <netdb.h> 269213Ssam 2710244Ssam #include "trace.h" 2810244Ssam #include "interface.h" 2910244Ssam #include "table.h" 3010244Ssam #include "af.h" 316921Ssam 329023Ssam /* 337145Ssam * When we find any interfaces marked down we rescan the 347145Ssam * kernel every CHECK_INTERVAL seconds to see if they've 357145Ssam * come up. 367145Ssam */ 377145Ssam #define CHECK_INTERVAL (1*60) 389023Ssam 399023Ssam #define equal(a1, a2) \ 409023Ssam (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0) 419023Ssam 4210244Ssam struct sockaddr_in addr; /* address of daemon's socket */ 439023Ssam 4410244Ssam int s; /* source and sink of all data */ 459023Ssam int kmem; 469023Ssam int supplier; /* process should supply updates */ 479023Ssam int install; /* if 1 call kernel */ 4810244Ssam int lookforinterfaces; /* if 1 probe kernel for new up interfaces */ 4910244Ssam int performnlist; /* if 1 check if /vmunix has changed */ 509023Ssam int externalinterfaces; /* # of remote and local interfaces */ 5136831Skarels struct timeval now; /* current idea of time */ 5236831Skarels struct timeval lastbcast; /* last time all/changes broadcast */ 5336831Skarels struct timeval lastfullupdate; /* last time full table broadcast */ 5436831Skarels struct timeval nextbcast; /* time to wait before changes broadcast */ 5536831Skarels int needupdate; /* true if we need update at nextbcast */ 569023Ssam 579023Ssam char packet[MAXPACKETSIZE+1]; 589023Ssam struct rip *msg; 599023Ssam 609023Ssam char **argv0; 619023Ssam struct servent *sp; 629023Ssam 6310244Ssam extern int errno; 6410244Ssam 659023Ssam struct in_addr inet_makeaddr(); 6610244Ssam int inet_addr(); 6710244Ssam char *malloc(); 6834565Skarels char *ctime(); 6910244Ssam int exit(); 7010244Ssam int sendmsg(); 7110244Ssam int supply(); 7210244Ssam int timer(); 7310244Ssam int cleanup(); 74