add Berkeley specific headers
[unix-history] / usr / src / sbin / routed / defs.h
index a502ae1..a737fed 100644 (file)
@@ -1,4 +1,16 @@
-/*     defs.h  4.1     82/05/22        */
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of California at Berkeley. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
+ *
+ *     @(#)defs.h      5.4 (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>
 
 
-/*
- * Internal routing table structure.
- * Differs a bit from kernel tables.
- */
-struct rt_hash {
-       struct  rt_entry *rt_forw;
-       struct  rt_entry *rt_back;
-};
+#include <net/route.h>
+#include <netinet/in.h>
+#include <protocols/routed.h>
 
 
-struct rt_entry {
-       struct  rt_entry *rt_forw;
-       struct  rt_entry *rt_back;
-       u_long  rt_hash;                /* for net or for host */
-       struct  sockaddr rt_dst;        /* match value */
-       struct  sockaddr rt_gateway;    /* who to forward to */
-       short   rt_flags;               /* see below */
-       short   rt_retry;               /* # ioctl retries */
-       int     rt_timer;               /* for invalidation */
-       int     rt_metric;              /* hop count of route */
-       struct  ifnet *rt_ifp;          /* corresponding interface */
-};
+#include <stdio.h>
+#include <netdb.h>
 
 
-#define        ROUTEHASHSIZ    19
+#include "trace.h"
+#include "interface.h"
+#include "table.h"
+#include "af.h"
 
 /*
 
 /*
- * Flags used by routing process are not
- * interpreted by kernel.
+ * When we find any interfaces marked down we rescan the
+ * kernel every CHECK_INTERVAL seconds to see if they've
+ * come up.
  */
  */
-#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 */
+#define        CHECK_INTERVAL  (1*60)
 
 
-struct rt_hash nethash[ROUTEHASHSIZ], hosthash[ROUTEHASHSIZ];
-struct rt_entry *rtlookup();
+#define equal(a1, a2) \
+       (bcmp((caddr_t)(a1), (caddr_t)(a2), sizeof (struct sockaddr)) == 0)
+#define        min(a,b)        ((a)>(b)?(b):(a))
 
 
-/*
- * 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)();
-};
+struct sockaddr_in addr;       /* address of daemon's socket */
+
+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 */
+
+char   packet[MAXPACKETSIZE+1];
+struct rip *msg;
+
+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();