X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/15637ed4f028f1b013a54c226bcb3c75228ad20d..ff59262b576b3e00b42a2fdd969f2c7099e61b7e:/sys/netinet/tcp_usrreq.c diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index c5592b922a..0ddf8704e5 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -30,18 +30,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)tcp_usrreq.c 7.15 (Berkeley) 6/28/90 - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00152 - * -------------------- ----- ---------------------- - * - * 22 Feb 93 David Greenman Increased tcp_sendspace and - * tcp_recvspace to 16k bytes - * 20 Aug 93 Rodney W. Grimes Add #ifdef's so you can go back to - * the stock 4k with a kernel config - * options "TCP_SMALLSPACE" + * from: @(#)tcp_usrreq.c 7.15 (Berkeley) 6/28/90 + * $Id: tcp_usrreq.c,v 1.5 1994/01/24 05:12:36 davidg Exp $ */ #include "param.h" @@ -68,13 +58,14 @@ #include "tcp_timer.h" #include "tcp_var.h" #include "tcpip.h" +#ifdef TCPDEBUG #include "tcp_debug.h" +#endif /* * TCP protocol interface to socket abstraction. */ extern char *tcpstates[]; -struct tcpcb *tcp_newtcpcb(); /* * Process a TCP user request for TCP tb. If this is a send request @@ -82,13 +73,15 @@ struct tcpcb *tcp_newtcpcb(); * (called from the software clock routine), then timertype tells which timer. */ /*ARGSUSED*/ -tcp_usrreq(so, req, m, nam, control) +int +tcp_usrreq(so, req, m, nam, control, dummy) struct socket *so; int req; struct mbuf *m, *nam, *control; + struct mbuf *dummy; { register struct inpcb *inp; - register struct tcpcb *tp; + register struct tcpcb *tp = 0; int s; int error = 0; int ostate; @@ -341,12 +334,15 @@ tcp_usrreq(so, req, m, nam, control) default: panic("tcp_usrreq"); } +#ifdef TCPDEBUG if (tp && (so->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (struct tcpiphdr *)0, req); +#endif splx(s); return (error); } +int tcp_ctloutput(op, so, level, optname, mp) int op; struct socket *so; @@ -355,12 +351,15 @@ tcp_ctloutput(op, so, level, optname, mp) { int error = 0; struct inpcb *inp = sotoinpcb(so); - register struct tcpcb *tp = intotcpcb(inp); + register struct tcpcb *tp; register struct mbuf *m; if (level != IPPROTO_TCP) return (ip_ctloutput(op, so, level, optname, mp)); + if (!inp || !(tp = intotcpcb(inp))) + return (EINVAL); + switch (op) { case PRCO_SETOPT: @@ -405,19 +404,12 @@ tcp_ctloutput(op, so, level, optname, mp) return (error); } -#ifdef TCP_SMALLSPACE -u_long tcp_sendspace = 1024*4; -u_long tcp_recvspace = 1024*4; -#else -u_long tcp_sendspace = 1024*16; -u_long tcp_recvspace = 1024*16; -#endif /* TCP_SMALLSPACE */ - /* * Attach TCP protocol to socket, allocating * internet protocol control block, tcp control block, * bufer space, and entering LISTEN state if to accept connections. */ +int tcp_attach(so) struct socket *so; {