11db2359dSdist /* 26160dbd1Sbostic * Copyright (c) 1983, 1988, 1993 36160dbd1Sbostic * The Regents of the University of California. All rights reserved. 41db2359dSdist * 54839fc90Sbostic * %sccs.include.redist.c% 6cf60b4c8Sbostic * 7*d57c142dSbostic * @(#)defs.h 8.2 (Berkeley) 04/28/95 81db2359dSdist */ 928b593c3Ssam 1028b593c3Ssam /* 1128b593c3Ssam * Internal data structure definitions for 1228b593c3Ssam * user routing process. Based on Xerox NS 1328b593c3Ssam * protocol specs with mods relevant to more 1428b593c3Ssam * general addressing scheme. 1528b593c3Ssam */ 16a3f24c4fSkarels #include <sys/param.h> 17ccaa07b6Ssam #include <sys/socket.h> 18a3f24c4fSkarels #include <sys/time.h> 1910ae73adSsam 20416f7c9fSsam #include <net/route.h> 2110ae73adSsam #include <netinet/in.h> 2266a2489dSkarels #include <protocols/routed.h> 2310ae73adSsam 24ccaa07b6Ssam #include <stdio.h> 25ccaa07b6Ssam #include <netdb.h> 2610ae73adSsam 27853e12b2Ssam #include "trace.h" 28853e12b2Ssam #include "interface.h" 29853e12b2Ssam #include "table.h" 30853e12b2Ssam #include "af.h" 31ccaa07b6Ssam 32dfe56fa2Ssam /* 33dfe56fa2Ssam * When we find any interfaces marked down we rescan the 34dfe56fa2Ssam * kernel every CHECK_INTERVAL seconds to see if they've 35dfe56fa2Ssam * come up. 36dfe56fa2Ssam */ 37dfe56fa2Ssam #define CHECK_INTERVAL (1*60) 38ccaa07b6Ssam 39ccaa07b6Ssam #define equal(a1, a2) \ 40*d57c142dSbostic (memcmp((a1), (a2), sizeof (struct sockaddr)) == 0) 41ccaa07b6Ssam 42853e12b2Ssam struct sockaddr_in addr; /* address of daemon's socket */ 43ccaa07b6Ssam 44853e12b2Ssam int s; /* source and sink of all data */ 45204c22bdSsklower int r; /* routing socket */ 46204c22bdSsklower pid_t pid; /* process id for identifying messages */ 47204c22bdSsklower uid_t uid; /* user id for identifying messages */ 48204c22bdSsklower int seqno; /* sequence number for identifying messages */ 49ccaa07b6Ssam int kmem; 50ccaa07b6Ssam int supplier; /* process should supply updates */ 51ccaa07b6Ssam int install; /* if 1 call kernel */ 52853e12b2Ssam int lookforinterfaces; /* if 1 probe kernel for new up interfaces */ 53853e12b2Ssam int performnlist; /* if 1 check if /vmunix has changed */ 54ccaa07b6Ssam int externalinterfaces; /* # of remote and local interfaces */ 55a3f24c4fSkarels struct timeval now; /* current idea of time */ 56a3f24c4fSkarels struct timeval lastbcast; /* last time all/changes broadcast */ 57a3f24c4fSkarels struct timeval lastfullupdate; /* last time full table broadcast */ 58a3f24c4fSkarels struct timeval nextbcast; /* time to wait before changes broadcast */ 59a3f24c4fSkarels int needupdate; /* true if we need update at nextbcast */ 60ccaa07b6Ssam 61ccaa07b6Ssam char packet[MAXPACKETSIZE+1]; 62ccaa07b6Ssam struct rip *msg; 63ccaa07b6Ssam 64ccaa07b6Ssam char **argv0; 65ccaa07b6Ssam struct servent *sp; 66ccaa07b6Ssam 67853e12b2Ssam struct in_addr inet_makeaddr(); 68853e12b2Ssam int inet_addr(); 69204c22bdSsklower int inet_maskof(); 70bf89ec77Sbostic int sndmsg(); 71853e12b2Ssam int supply(); 72853e12b2Ssam int cleanup(); 73204c22bdSsklower 74204c22bdSsklower int rtioctl(); 75204c22bdSsklower #define ADD 1 76204c22bdSsklower #define DELETE 2 77204c22bdSsklower #define CHANGE 3 78