first listing
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Mon, 9 Nov 1981 08:56:57 +0000 (00:56 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Mon, 9 Nov 1981 08:56:57 +0000 (00:56 -0800)
SCCS-vsn: sys/kern/uipc_proto.c 4.2

usr/src/sys/kern/uipc_proto.c

index 17c5cbf..54820d9 100644 (file)
@@ -1,6 +1,12 @@
+/*     uipc_proto.c    4.2     81/11/08        */
+
 #include "../h/param.h"
 #include "../h/param.h"
-#include "../inet/protocol.h"
-#include "../inet/protocolsw.h"
+#include "../h/socket.h"
+#include "../h/protocol.h"
+#include "../h/protosw.h"
+#include "../h/mbuf.h"
+#include "../net/inet.h"
+
 /* should include a header file giving desired protocols */
 #define        NTCP    1
 
 /* should include a header file giving desired protocols */
 #define        NTCP    1
 
@@ -17,13 +23,12 @@ int gen_usrreq();
 /*
  * TCP/IP protocol family: IP, ICMP, UDP, TCP.
  */
 /*
  * TCP/IP protocol family: IP, ICMP, UDP, TCP.
  */
-int    ip_input(),ip_output(),ip_advise(),ip_slowtimo(),ip_drain();
-int    icmp_input(),icmp_output();
+int    ip_init(),ip_input(),ip_output(),ip_advise(),ip_slowtimo(),ip_drain();
+int    icmp_input(),icmp_drain();
 int    udp_input(),udp_advise(),udp_usrreq(),udp_sense();
 int    udp_input(),udp_advise(),udp_usrreq(),udp_sense();
-int    tcp_input(),tcp_advise(),tcp_fasttimo(),tcp_slowtimo(),
-           tcp_drain(),tcp_sense();
-int    rawip_input(),rawip_advise(),rawip_advise(),rawip_usrreq(),
-           rawip_sense();
+int    tcp_init(),tcp_input(),tcp_advise(),tcp_fasttimo(),tcp_slowtimo(),
+           tcp_usrreq(),tcp_drain(),tcp_sense();
+int    ri_input(),ri_advise(),ri_usrreq(),ri_sense();
 #endif
 
 #if NPUP > 0
 #endif
 
 #if NPUP > 0
@@ -74,53 +79,54 @@ int rawpup_input(),rawpup_usrreq(),rawpup_sense();
 
 struct protosw protosw[] = {
 { SOCK_STREAM, PF_GENERIC,     0,              0,
 
 struct protosw protosw[] = {
 { SOCK_STREAM, PF_GENERIC,     0,              0,
-  0,           0,              0,
+  0,           0,              0,              0,
   0,           0,              0,              gen_usrreq,     0,
   0 },
   0,           0,              0,              gen_usrreq,     0,
   0 },
-{ SOCK_DGRAM,  PF_GENERIC,     0,              PR_ATOMIC|PR_PROVIDEADDR,
-  0,           0,              0,
+{ SOCK_DGRAM,  PF_GENERIC,     0,              PR_ATOMIC|PR_ADDR,
+  0,           0,              0,              0,
   0,           0,              0,              gen_usrreq,     0,
   0 },
   0,           0,              0,              gen_usrreq,     0,
   0 },
-{ SOCK_RDM,    PF_GENERIC,     0,              PR_ATOMIC|PR_PROVIDEADDR,
-  0,           0,              0,
+{ SOCK_RDM,    PF_GENERIC,     0,              PR_ATOMIC|PR_ADDR,
+  0,           0,              0,              0,
   0,           0,              0,              gen_usrreq,     0,
   0 },
   0,           0,              0,              gen_usrreq,     0,
   0 },
-{ SOCK_RAW,    PF_GENERIC,     0,              PR_ATOMIC|PR_PROVIDEADDR,
-  0,           0,              0,
+{ SOCK_RAW,    PF_GENERIC,     0,              PR_ATOMIC|PR_ADDR,
+  0,           0,              0,              0,
   0,           0,              0,              gen_usrreq,     0,
   0,           0,              0,              gen_usrreq,     0,
+  0 },
 #if NTCP > 0
 { 0,           0,              0,              0,
 #if NTCP > 0
 { 0,           0,              0,              0,
-  ip_input,    ip_output,      0,
+  ip_init,     ip_input,       ip_output,      0,
   0,           ip_slowtimo,    ip_drain,       0,              0,
   0 },
 { 0,           0,              IPPROTO_ICMP,   0,
   0,           ip_slowtimo,    ip_drain,       0,              0,
   0 },
 { 0,           0,              IPPROTO_ICMP,   0,
-  icmp_input,  icmp_output,    0,
+  0,           icmp_input,     0,              0,
   0,           0,              icmp_drain,     0,              0,
   0 },
   0,           0,              icmp_drain,     0,              0,
   0 },
-{ SOCK_DGRAM,  PF_INET,        IPPROTO_UDP,    PR_ATOMIC|PR_PROVIDEADDR,
-  udp_input,   0,              udp_advise,
+{ SOCK_DGRAM,  PF_INET,        IPPROTO_UDP,    PR_ATOMIC|PR_ADDR,
+  0,           udp_input,      0,              udp_advise,
   0,           0,              0,              udp_usrreq,     udp_sense,
   MLEN },
 { SOCK_STREAM, PF_INET,        IPPROTO_TCP,    0,
   0,           0,              0,              udp_usrreq,     udp_sense,
   MLEN },
 { SOCK_STREAM, PF_INET,        IPPROTO_TCP,    0,
-  tcp_input,   0,              tcp_advise,
+  tcp_init,    tcp_input,      0,              tcp_advise,
   tcp_fasttimo,        tcp_slowtimo,   tcp_drain,      tcp_usrreq,     tcp_sense,
   MLEN },
   tcp_fasttimo,        tcp_slowtimo,   tcp_drain,      tcp_usrreq,     tcp_sense,
   MLEN },
-{ SOCK_RAW,    PF_INET,        IPPROTO_RAW,    PR_ATOMIC|PR_PROVIDEADDR,
-  ri_input,    0,              ri_advise,
-  ri_fasttimo, ri_slowtimo,    ri_drain,       ri_usrreq,      ri_sense,
+{ SOCK_RAW,    PF_INET,        IPPROTO_RAW,    PR_ATOMIC|PR_ADDR,
+  0,           ri_input,       0,              ri_advise,
+  0,           0,              0,              ri_usrreq,      ri_sense,
   MLEN },
 #endif
 #if NPUP > 0
   MLEN },
 #endif
 #if NPUP > 0
-{ SOCK_DGRAM,  PF_PUP,         0,              PR_ATOMIC|PR_PROVIDEADDR,
-  pup_input,   pup_output,     pup_advise,
+{ SOCK_DGRAM,  PF_PUP,         0,              PR_ATOMIC|PR_ADDR,
+  pup_init,    pup_input,      pup_output,     pup_advise,
   0,           pup_slowtimo,   pup_drain,      pup_usrreq,     pup_sense,
   MLEN },
 { SOCK_STREAM, PF_PUP1,        PUPPROTO_BSP,   0,
   0,           pup_slowtimo,   pup_drain,      pup_usrreq,     pup_sense,
   MLEN },
 { SOCK_STREAM, PF_PUP1,        PUPPROTO_BSP,   0,
-  bsp_input,   0,              bsp_advise,
+  bsp_init,    bsp_input,      0,              bsp_advise,
   bsp_fasttimo,        bsp_slowtimo,   bsp_drain,      bsp_usrreq,     bsp_sense,
   MLEN },
   bsp_fasttimo,        bsp_slowtimo,   bsp_drain,      bsp_usrreq,     bsp_sense,
   MLEN },
-{ SOCK_RAW,    PF_PUP1,        PUPPROTO_RAW,   PR_ATOMIC|PR_PROVIDEADDR,
-  rp_input,    0,              rp_advise,
+{ SOCK_RAW,    PF_PUP1,        PUPPROTO_RAW,   PR_ATOMIC|PR_ADDR,
+  rp_init,     rp_input,       0,              rp_advise,
   rp_fasttimo, rp_slowtimo,    rp_drain,       rp_usrreq,      rp_sense,
   MLEN },
 #endif
   rp_fasttimo, rp_slowtimo,    rp_drain,       rp_usrreq,      rp_sense,
   MLEN },
 #endif
@@ -150,7 +156,8 @@ struct protosw protosw[] = {
  * Find a standard protocol in a protocol family
  * of a specific type.
  */
  * Find a standard protocol in a protocol family
  * of a specific type.
  */
-pf_stdproto(family, type)
+struct protosw *
+pf_findtype(family, type)
        int family, type;
 {
        register struct protosw *pr;
        int family, type;
 {
        register struct protosw *pr;
@@ -166,15 +173,21 @@ pf_stdproto(family, type)
 /*
  * Find a specified protocol in a specified protocol family.
  */
 /*
  * Find a specified protocol in a specified protocol family.
  */
-pf_findproto(family, proto)
-       int family, proto;
+struct protosw *
+pf_findproto(family, protocol)
+       int family, protocol;
 {
        register struct protosw *pr;
 
        if (family == 0)
                return (0);
        for (pr = protosw; pr < protoswEND; pr++)
 {
        register struct protosw *pr;
 
        if (family == 0)
                return (0);
        for (pr = protosw; pr < protoswEND; pr++)
-               if (pr->pr_family == family && pr->pr_proto == proto)
+               if (pr->pr_family == family && pr->pr_protocol == protocol)
                        return (pr);
        return (0);
 }
                        return (pr);
        return (0);
 }
+
+prinit()
+{
+
+}