restore missing default
[unix-history] / usr / src / sys / kern / uipc_proto.c
index c0e93e2..a7c8d9d 100644 (file)
@@ -1,4 +1,4 @@
-/*     uipc_proto.c    4.8     81/11/26        */
+/*     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,63 +23,104 @@ 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_ctlinput();
-int    rip_usrreq(),rip_sense();
+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[] = {
 
 struct protosw protosw[] = {
-{ SOCK_STREAM, PF_LOCAL,       0,              PR_CONNREQUIRED,
+{ SOCK_STREAM, PF_UNIX,        0,              PR_CONNREQUIRED,
   0,           0,              0,              0,
   0,           0,              0,              0,
-  piusrreq,    0,              0,
+  piusrreq,
   0,           0,              0,              0,
 },
   0,           0,              0,              0,
 },
-{ SOCK_DGRAM,  PF_LOCAL,       0,              PR_ATOMIC|PR_ADDR,
+{ SOCK_DGRAM,  PF_UNIX,        0,              PR_ATOMIC|PR_ADDR,
   0,           0,              0,              0,
   0,           0,              0,              0,
-  piusrreq,    0,              0,
+  piusrreq,
   0,           0,              0,              0,
 },
   0,           0,              0,              0,
 },
-{ SOCK_RDM,    PF_LOCAL,       0,              PR_ATOMIC|PR_ADDR,
+{ SOCK_RDM,    PF_UNIX,        0,              PR_ATOMIC|PR_ADDR,
   0,           0,              0,              0,
   0,           0,              0,              0,
-  piusrreq,    0,              0,
+  piusrreq,
   0,           0,              0,              0,
 },
   0,           0,              0,              0,
 },
-{ SOCK_RAW,    PF_LOCAL,       0,              PR_ATOMIC|PR_ADDR,
+{ SOCK_RAW,    PF_UNIX,        0,              PR_ATOMIC|PR_ADDR,
   0,           0,              0,              0,
   0,           0,              0,              0,
-  piusrreq,    0,              0,
+  piusrreq,
   0,           0,              0,              0,
 },
 { 0,           0,              0,              0,
   0,           ip_output,      0,              0,
   0,           0,              0,              0,
 },
 { 0,           0,              0,              0,
   0,           ip_output,      0,              0,
-  0,           0,              0,
+  0,
   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,
-  0,           0,              0,
+  icmp_input,  0,              icmp_ctlinput,  0,
+  0,
   0,           0,              0,              icmp_drain,
 },
 { SOCK_DGRAM,  PF_INET,        IPPROTO_UDP,    PR_ATOMIC|PR_ADDR,
   udp_input,   0,              udp_ctlinput,   0,
   0,           0,              0,              icmp_drain,
 },
 { SOCK_DGRAM,  PF_INET,        IPPROTO_UDP,    PR_ATOMIC|PR_ADDR,
   udp_input,   0,              udp_ctlinput,   0,
-  udp_usrreq,  udp_sense,      MLEN,
+  udp_usrreq,
   udp_init,    0,              0,              0,
 },
 { SOCK_STREAM, PF_INET,        IPPROTO_TCP,    PR_CONNREQUIRED|PR_WANTRCVD,
   tcp_input,   0,              tcp_ctlinput,   0,
   udp_init,    0,              0,              0,
 },
 { SOCK_STREAM, PF_INET,        IPPROTO_TCP,    PR_CONNREQUIRED|PR_WANTRCVD,
   tcp_input,   0,              tcp_ctlinput,   0,
-  tcp_usrreq,  tcp_sense,      MLEN,
+  tcp_usrreq,
   tcp_init,    tcp_fasttimo,   tcp_slowtimo,   tcp_drain,
 },
   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,   0,              rip_ctlinput,   0,
-  rip_usrreq,  rip_sense,      MLEN,
+  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,
 }
   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)();
+}