1 /* 2 * Copyright (c) 1983, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)defs.h 8.2 (Berkeley) 04/28/95 8 */ 9 10 /* 11 * Internal data structure definitions for 12 * user routing process. Based on Xerox NS 13 * protocol specs with mods relevant to more 14 * general addressing scheme. 15 */ 16 #include <sys/param.h> 17 #include <sys/socket.h> 18 #include <sys/time.h> 19 20 #include <net/route.h> 21 #include <netinet/in.h> 22 #include <protocols/routed.h> 23 24 #include <stdio.h> 25 #include <netdb.h> 26 27 #include "trace.h" 28 #include "interface.h" 29 #include "table.h" 30 #include "af.h" 31 32 /* 33 * When we find any interfaces marked down we rescan the 34 * kernel every CHECK_INTERVAL seconds to see if they've 35 * come up. 36 */ 37 #define CHECK_INTERVAL (1*60) 38 39 #define equal(a1, a2) \ 40 (memcmp((a1), (a2), sizeof (struct sockaddr)) == 0) 41 42 struct sockaddr_in addr; /* address of daemon's socket */ 43 44 int s; /* source and sink of all data */ 45 int r; /* routing socket */ 46 pid_t pid; /* process id for identifying messages */ 47 uid_t uid; /* user id for identifying messages */ 48 int seqno; /* sequence number for identifying messages */ 49 int kmem; 50 int supplier; /* process should supply updates */ 51 int install; /* if 1 call kernel */ 52 int lookforinterfaces; /* if 1 probe kernel for new up interfaces */ 53 int performnlist; /* if 1 check if /vmunix has changed */ 54 int externalinterfaces; /* # of remote and local interfaces */ 55 struct timeval now; /* current idea of time */ 56 struct timeval lastbcast; /* last time all/changes broadcast */ 57 struct timeval lastfullupdate; /* last time full table broadcast */ 58 struct timeval nextbcast; /* time to wait before changes broadcast */ 59 int needupdate; /* true if we need update at nextbcast */ 60 61 char packet[MAXPACKETSIZE+1]; 62 struct rip *msg; 63 64 char **argv0; 65 struct servent *sp; 66 67 struct in_addr inet_makeaddr(); 68 int inet_addr(); 69 int inet_maskof(); 70 int sndmsg(); 71 int supply(); 72 int cleanup(); 73 74 int rtioctl(); 75 #define ADD 1 76 #define DELETE 2 77 #define CHANGE 3 78