restore missing default
[unix-history] / usr / src / sys / kern / uipc_proto.c
index 7767d83..a7c8d9d 100644 (file)
@@ -1,4 +1,4 @@
-/*     uipc_proto.c    4.10    81/12/03        */
+/*     uipc_proto.c    4.19    82/03/28        */
 
 #include "../h/param.h"
 #include "../h/socket.h"
 
 #include "../h/param.h"
 #include "../h/socket.h"
@@ -31,8 +31,28 @@ int  udp_init();
 int    tcp_input(),tcp_ctlinput();
 int    tcp_usrreq();
 int    tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
 int    tcp_input(),tcp_ctlinput();
 int    tcp_usrreq();
 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,
@@ -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)();
+}