restore missing default
[unix-history] / usr / src / sys / kern / uipc_proto.c
index 08f2c2c..a7c8d9d 100644 (file)
@@ -1,4 +1,4 @@
-/*     uipc_proto.c    4.9     81/11/30        */
+/*     uipc_proto.c    4.19    82/03/28        */
 
 #include "../h/param.h"
 #include "../h/socket.h"
 
 #include "../h/param.h"
 #include "../h/socket.h"
@@ -23,16 +23,36 @@ int piusrreq();
  */
 int    ip_output();
 int    ip_init(),ip_slowtimo(),ip_drain();
  */
 int    ip_output();
 int    ip_init(),ip_slowtimo(),ip_drain();
-int    icmp_input();
+int    icmp_input(),icmp_ctlinput();
 int    icmp_drain();
 int    udp_input(),udp_ctlinput();
 int    icmp_drain();
 int    udp_input(),udp_ctlinput();
-int    udp_usrreq(),udp_sense();
+int    udp_usrreq();
 int    udp_init();
 int    tcp_input(),tcp_ctlinput();
 int    udp_init();
 int    tcp_input(),tcp_ctlinput();
-int    tcp_usrreq(),tcp_sense();
+int    tcp_usrreq();
 int    tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
 int    tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
-int    rip_input(),rip_output(),rip_ctlinput();
-int    rip_usrreq(),rip_slowtimo();
+int    rip_input(),rip_output();
+
+/*
+ * IMP protocol family: raw interface
+ */
+#include "imp.h"
+#if NIMP > 0
+int    rimp_output();
+#endif
+
+/*
+ * PUP-I protocol family: raw interface
+ */
+#include "pup.h"
+#if NPUP > 0
+int    rpup_output();
+#endif
+
+/*
+ * Sundries.
+*/
+int    raw_init(),raw_usrreq(),raw_input();
 
 struct protosw protosw[] = {
 { SOCK_STREAM, PF_UNIX,        0,              PR_CONNREQUIRED,
 
 struct protosw protosw[] = {
 { SOCK_STREAM, PF_UNIX,        0,              PR_CONNREQUIRED,
@@ -61,7 +81,7 @@ struct protosw protosw[] = {
   ip_init,     0,              ip_slowtimo,    ip_drain,
 },
 { 0,           0,              IPPROTO_ICMP,   0,
   ip_init,     0,              ip_slowtimo,    ip_drain,
 },
 { 0,           0,              IPPROTO_ICMP,   0,
-  icmp_input,  0,              0,              0,
+  icmp_input,  0,              icmp_ctlinput,  0,
   0,
   0,           0,              0,              icmp_drain,
 },
   0,
   0,           0,              0,              icmp_drain,
 },
@@ -75,11 +95,32 @@ struct protosw protosw[] = {
   tcp_usrreq,
   tcp_init,    tcp_fasttimo,   tcp_slowtimo,   tcp_drain,
 },
   tcp_usrreq,
   tcp_init,    tcp_fasttimo,   tcp_slowtimo,   tcp_drain,
 },
+{ 0,           0,              0,              0,
+  raw_input,   0,              0,              0,
+  raw_usrreq,
+  raw_init,    0,              0,              0,
+},
 { SOCK_RAW,    PF_INET,        IPPROTO_RAW,    PR_ATOMIC|PR_ADDR,
 { SOCK_RAW,    PF_INET,        IPPROTO_RAW,    PR_ATOMIC|PR_ADDR,
-  rip_input,   rip_output,     rip_ctlinput,   0,
-  rip_usrreq,
-  0,           0,              rip_slowtimo,   0,
+  rip_input,   rip_output,     0,              0,
+  raw_usrreq,
+  0,           0,              0,              0,
+}
+#if NIMP > 0
+,
+{ SOCK_RAW,    PF_IMPLINK,     0,              PR_ATOMIC|PR_ADDR,
+  0,           rimp_output,    0,              0,
+  raw_usrreq,
+  0,           0,              0,              0,
+}
+#endif
+#if NPUP > 0
+,
+{ SOCK_RAW,    PF_PUP,         0,              PR_ATOMIC|PR_ADDR,
+  0,           rpup_output,    0,              0,
+  raw_usrreq,
+  0,           0,              0,              0,
 }
 }
+#endif
 };
 
 #define        NPROTOSW        (sizeof(protosw) / sizeof(protosw[0]))
 };
 
 #define        NPROTOSW        (sizeof(protosw) / sizeof(protosw[0]))
@@ -139,3 +180,26 @@ COUNT(PFFINDPROTO);
                        return (pr);
        return (0);
 }
                        return (pr);
        return (0);
 }
+
+/*
+ * Slow timeout on all protocols.
+ */
+pfslowtimo()
+{
+       register struct protosw *pr;
+
+COUNT(PFSLOWTIMO);
+       for (pr = protoswLAST; pr >= protosw; pr--)
+               if (pr->pr_slowtimo)
+                       (*pr->pr_slowtimo)();
+}
+
+pffasttimo()
+{
+       register struct protosw *pr;
+
+COUNT(PFSLOWTIMO);
+       for (pr = protoswLAST; pr >= protosw; pr--)
+               if (pr->pr_fasttimo)
+                       (*pr->pr_fasttimo)();
+}