don't send net route to subnet gw's unless on subnet 0;
[unix-history] / usr / src / sbin / routed / defs.h
index ac888e4..8abb105 100644 (file)
@@ -1,4 +1,10 @@
-/*     defs.h  4.2     82/05/25        */
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)defs.h      5.3 (Berkeley) %G%
+ */
 
 /*
  * Internal data structure definitions for
 
 /*
  * Internal data structure definitions for
  * protocol specs with mods relevant to more
  * general addressing scheme.
  */
  * protocol specs with mods relevant to more
  * general addressing scheme.
  */
+#include <sys/types.h>
+#include <sys/socket.h>
+
 #include <net/route.h>
 #include <net/route.h>
+#include <netinet/in.h>
+#include <protocols/routed.h>
+
+#include <stdio.h>
+#include <netdb.h>
+
+#include "trace.h"
+#include "interface.h"
+#include "table.h"
+#include "af.h"
 
 /*
 
 /*
- * Internal routing table structure.
- * Differs a bit from kernel tables.
+ * When we find any interfaces marked down we rescan the
+ * kernel every CHECK_INTERVAL seconds to see if they've
+ * come up.
  */
  */
-struct rthash {
-       struct  rt_entry *rt_forw;
-       struct  rt_entry *rt_back;
-};
+#define        CHECK_INTERVAL  (1*60)
 
 
-struct rt_entry {
-       struct  rt_entry *rt_forw;
-       struct  rt_entry *rt_back;
-       union {
-               struct  rtentry rtu_rt;
-               struct {
-                       u_long  rtu_hash;
-                       struct  sockaddr rtu_dst;
-                       struct  sockaddr rtu_gateway;
-                       short   rtu_flags;
-                       short   rtu_retry;
-                       int     rtu_timer;
-                       int     rtu_metric;
-                       struct  ifnet *rtu_ifp;
-               } rtu_entry;
-       } rt_rtu;
-};
+#define equal(a1, a2) \
+       (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
+#define        min(a,b)        ((a)>(b)?(b):(a))
 
 
-#define        rt_rt           rt_rtu.rtu_rt                   /* pass to ioctl */
-#define        rt_hash         rt_rtu.rtu_entry.rtu_hash       /* for net or host */
-#define        rt_dst          rt_rtu.rtu_entry.rtu_dst        /* match value */
-#define        rt_gateway      rt_rtu.rtu_entry.rtu_gateway    /* who to forward to */
-#define        rt_flags        rt_rtu.rtu_entry.rtu_flags      /* see below */
-#define        rt_retry        rt_rtu.rtu_entry.rtu_retry      /* retries of ioctl */
-#define        rt_timer        rt_rtu.rtu_entry.rtu_timer      /* for invalidation */
-#define        rt_metric       rt_rtu.rtu_entry.rtu_metric     /* cost of route */
-#define        rt_ifp          rt_rtu.rtu_entry.rtu_ifp        /* interface to take */
+struct sockaddr_in addr;       /* address of daemon's socket */
 
 
-#define        ROUTEHASHSIZ    19
+int    s;                      /* source and sink of all data */
+int    kmem;
+int    supplier;               /* process should supply updates */
+int    install;                /* if 1 call kernel */
+int    lookforinterfaces;      /* if 1 probe kernel for new up interfaces */
+int    performnlist;           /* if 1 check if /vmunix has changed */
+int    externalinterfaces;     /* # of remote and local interfaces */
+int    timeval;                /* local idea of time */
 
 
-/*
- * Flags used by routing process are not
- * interpreted by kernel.
- */
-#define        RTF_DELRT       0x8             /* delete pending */
-#define        RTF_CHGRT       0x10            /* change command pending */
-#define        RTF_ADDRT       0x20            /* add command pending */
-#define        RTF_SILENT      0x40            /* don't send to router */
-
-struct rthash nethash[ROUTEHASHSIZ], hosthash[ROUTEHASHSIZ];
-struct rt_entry *rtlookup();
+char   packet[MAXPACKETSIZE+1];
+struct rip *msg;
 
 
-/*
- * Per address family routines.  Hash returns hash key based
- * on address; netmatch verifies net # matching, output interprets
- * an address in preparation for sending; portmatch interprets
- * an address in verifying incoming packets were sent from the
- * appropriate port; checkhost is used to decide whether an
- * address is for a host, or for a network (e.g. broadcast);
- * canon purges any extraneous stuff from a sender's address
- * before pattern matching is performed (e.g. Internet ports).
- */
-struct afswitch {
-       int     (*af_hash)();
-       int     (*af_netmatch)();
-       int     (*af_output)();
-       int     (*af_portmatch)();
-       int     (*af_checkhost)();
-       int     (*af_canon)();
-};
+char   **argv0;
+struct servent *sp;
 
 
-struct afhash {
-       u_int   afh_hosthash;
-       u_int   afh_nethash;
-};
+extern char *sys_errlist[];
+extern int errno;
 
 
-struct afswitch afswitch[AF_MAX];
+struct in_addr inet_makeaddr();
+int    inet_addr();
+char   *malloc();
+int    exit();
+int    sendmsg();
+int    supply();
+int    timer();
+int    cleanup();