lint
[unix-history] / usr / src / sys / kern / uipc_proto.c
index a2717be..08f2c2c 100644 (file)
@@ -1,11 +1,11 @@
-/*     uipc_proto.c    4.3     81/11/14        */
+/*     uipc_proto.c    4.9     81/11/30        */
 
 #include "../h/param.h"
 #include "../h/socket.h"
 
 #include "../h/param.h"
 #include "../h/socket.h"
-#include "../h/protocol.h"
 #include "../h/protosw.h"
 #include "../h/mbuf.h"
 #include "../h/protosw.h"
 #include "../h/mbuf.h"
-#include "../net/inet.h"
+#include "../net/in.h"
+#include "../net/in_systm.h"
 
 /*
  * Protocol configuration table and routines to search it.
 
 /*
  * Protocol configuration table and routines to search it.
 /*
  * Local protocol handler.
  */
 /*
  * Local protocol handler.
  */
-int    pi_usrreq();
+int    piusrreq();
 
 /*
  * TCP/IP protocol family: IP, ICMP, UDP, TCP.
  */
 
 /*
  * TCP/IP protocol family: IP, ICMP, UDP, TCP.
  */
-int    ip_input(),ip_output(),ip_ctloutput();
+int    ip_output();
 int    ip_init(),ip_slowtimo(),ip_drain();
 int    icmp_input();
 int    icmp_drain();
 int    ip_init(),ip_slowtimo(),ip_drain();
 int    icmp_input();
 int    icmp_drain();
@@ -31,54 +31,54 @@ int udp_init();
 int    tcp_input(),tcp_ctlinput();
 int    tcp_usrreq(),tcp_sense();
 int    tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
 int    tcp_input(),tcp_ctlinput();
 int    tcp_usrreq(),tcp_sense();
 int    tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
-int    ri_input(),ri_ctlinput();
-int    ri_usrreq(),ri_sense();
+int    rip_input(),rip_output(),rip_ctlinput();
+int    rip_usrreq(),rip_slowtimo();
 
 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,
-  pi_usrreq,   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,
-  pi_usrreq,   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,
-  pi_usrreq,   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,
-  pi_usrreq,   0,              0,
+  piusrreq,
   0,           0,              0,              0,
 },
 { 0,           0,              0,              0,
   0,           0,              0,              0,
 },
 { 0,           0,              0,              0,
-  ip_input,    ip_output,      0,              0,
-  0,           0,              0,
+  0,           ip_output,      0,              0,
+  0,
   ip_init,     0,              ip_slowtimo,    ip_drain,
 },
 { 0,           0,              IPPROTO_ICMP,   0,
   icmp_input,  0,              0,              0,
   ip_init,     0,              ip_slowtimo,    ip_drain,
 },
 { 0,           0,              IPPROTO_ICMP,   0,
   icmp_input,  0,              0,              0,
-  0,           0,              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,
 },
   udp_init,    0,              0,              0,
 },
-{ SOCK_STREAM, PF_INET,        IPPROTO_TCP,    PR_CONNREQUIRED,
+{ SOCK_STREAM, PF_INET,        IPPROTO_TCP,    PR_CONNREQUIRED|PR_WANTRCVD,
   tcp_input,   0,              tcp_ctlinput,   0,
   tcp_input,   0,              tcp_ctlinput,   0,
-  tcp_usrreq,  tcp_sense,      MLEN,
+  tcp_usrreq,
   tcp_init,    tcp_fasttimo,   tcp_slowtimo,   tcp_drain,
 },
 { SOCK_RAW,    PF_INET,        IPPROTO_RAW,    PR_ATOMIC|PR_ADDR,
   tcp_init,    tcp_fasttimo,   tcp_slowtimo,   tcp_drain,
 },
 { SOCK_RAW,    PF_INET,        IPPROTO_RAW,    PR_ATOMIC|PR_ADDR,
-  ri_input,    0,              ri_ctlinput,    0,
-  ri_usrreq,   ri_sense,       MLEN,
-  0,           0,              0,              0,
+  rip_input,   rip_output,     rip_ctlinput,   0,
+  rip_usrreq,
+  0,           0,              rip_slowtimo,   0,
 }
 };
 
 }
 };
 
@@ -97,6 +97,7 @@ pfinit()
 {
        register struct protosw *pr;
 
 {
        register struct protosw *pr;
 
+COUNT(PFINIT);
        for (pr = protoswLAST; pr >= protosw; pr--)
                if (pr->pr_init)
                        (*pr->pr_init)();
        for (pr = protoswLAST; pr >= protosw; pr--)
                if (pr->pr_init)
                        (*pr->pr_init)();
@@ -112,9 +113,10 @@ pffindtype(family, type)
 {
        register struct protosw *pr;
 
 {
        register struct protosw *pr;
 
+COUNT(PFFINDTYPE);
        if (family == 0)
                return (0);
        if (family == 0)
                return (0);
-       for (pr = protosw; pr < protoswLAST; pr++)
+       for (pr = protosw; pr <= protoswLAST; pr++)
                if (pr->pr_family == family && pr->pr_type == type)
                        return (pr);
        return (0);
                if (pr->pr_family == family && pr->pr_type == type)
                        return (pr);
        return (0);
@@ -129,9 +131,10 @@ pffindproto(family, protocol)
 {
        register struct protosw *pr;
 
 {
        register struct protosw *pr;
 
+COUNT(PFFINDPROTO);
        if (family == 0)
                return (0);
        if (family == 0)
                return (0);
-       for (pr = protosw; pr < protoswLAST; pr++)
+       for (pr = protosw; pr <= protoswLAST; pr++)
                if (pr->pr_family == family && pr->pr_protocol == protocol)
                        return (pr);
        return (0);
                if (pr->pr_family == family && pr->pr_protocol == protocol)
                        return (pr);
        return (0);