122003Sdist /* 261540Sbostic * Copyright (c) 1983, 1988, 1993 361540Sbostic * The Regents of the University of California. All rights reserved. 422003Sdist * 542712Sbostic * %sccs.include.redist.c% 633489Sbostic * 7*69037Sbostic * @(#)defs.h 8.2 (Berkeley) 04/28/95 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) \ 40*69037Sbostic (memcmp((a1), (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 */ 4552583Ssklower int r; /* routing socket */ 4652583Ssklower pid_t pid; /* process id for identifying messages */ 4752583Ssklower uid_t uid; /* user id for identifying messages */ 4852583Ssklower int seqno; /* sequence number for identifying messages */ 499023Ssam int kmem; 509023Ssam int supplier; /* process should supply updates */ 519023Ssam int install; /* if 1 call kernel */ 5210244Ssam int lookforinterfaces; /* if 1 probe kernel for new up interfaces */ 5310244Ssam int performnlist; /* if 1 check if /vmunix has changed */ 549023Ssam int externalinterfaces; /* # of remote and local interfaces */ 5536831Skarels struct timeval now; /* current idea of time */ 5636831Skarels struct timeval lastbcast; /* last time all/changes broadcast */ 5736831Skarels struct timeval lastfullupdate; /* last time full table broadcast */ 5836831Skarels struct timeval nextbcast; /* time to wait before changes broadcast */ 5936831Skarels int needupdate; /* true if we need update at nextbcast */ 609023Ssam 619023Ssam char packet[MAXPACKETSIZE+1]; 629023Ssam struct rip *msg; 639023Ssam 649023Ssam char **argv0; 659023Ssam struct servent *sp; 669023Ssam 679023Ssam struct in_addr inet_makeaddr(); 6810244Ssam int inet_addr(); 6952583Ssklower int inet_maskof(); 7046784Sbostic int sndmsg(); 7110244Ssam int supply(); 7210244Ssam int cleanup(); 7352583Ssklower 7452583Ssklower int rtioctl(); 7552583Ssklower #define ADD 1 7652583Ssklower #define DELETE 2 7752583Ssklower #define CHANGE 3 78