1/*
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 17 unchanged lines hidden (view full) ---
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
34 * $FreeBSD: head/sys/netinet/tcp_usrreq.c 54526 1999-12-13 00:39:20Z shin $
35 */
36
37#include "opt_tcpdebug.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#include <sys/sysctl.h>
43#include <sys/mbuf.h>
44#include <sys/socket.h>
--- 13 unchanged lines hidden (view full) ---
58#include <netinet/tcp_seq.h>
59#include <netinet/tcp_timer.h>
60#include <netinet/tcp_var.h>
61#include <netinet/tcpip.h>
62#ifdef TCPDEBUG
63#include <netinet/tcp_debug.h>
64#endif
65
66/*
67 * TCP protocol interface to socket abstraction.
68 */
69extern char *tcpstates[]; /* XXX ??? */
70
71static int tcp_attach __P((struct socket *, struct proc *));
72static int tcp_connect __P((struct tcpcb *, struct sockaddr *,
73 struct proc *));
--- 652 unchanged lines hidden (view full) ---
726 error = soreserve(so, tcp_sendspace, tcp_recvspace);
727 if (error)
728 return (error);
729 }
730 error = in_pcballoc(so, &tcbinfo, p);
731 if (error)
732 return (error);
733 inp = sotoinpcb(so);
734 inp->inp_vflag |= INP_IPV4;
735 tp = tcp_newtcpcb(inp);
736 if (tp == 0) {
737 int nofd = so->so_state & SS_NOFDREF; /* XXX */
738
739 so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
740 in_pcbdetach(inp);
741 so->so_state |= nofd;
--- 80 unchanged lines hidden ---
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 17 unchanged lines hidden (view full) ---
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
34 * $FreeBSD: head/sys/netinet/tcp_usrreq.c 54526 1999-12-13 00:39:20Z shin $
35 */
36
37#include "opt_tcpdebug.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#include <sys/sysctl.h>
43#include <sys/mbuf.h>
44#include <sys/socket.h>
--- 13 unchanged lines hidden (view full) ---
58#include <netinet/tcp_seq.h>
59#include <netinet/tcp_timer.h>
60#include <netinet/tcp_var.h>
61#include <netinet/tcpip.h>
62#ifdef TCPDEBUG
63#include <netinet/tcp_debug.h>
64#endif
65
66/*
67 * TCP protocol interface to socket abstraction.
68 */
69extern char *tcpstates[]; /* XXX ??? */
70
71static int tcp_attach __P((struct socket *, struct proc *));
72static int tcp_connect __P((struct tcpcb *, struct sockaddr *,
73 struct proc *));
--- 652 unchanged lines hidden (view full) ---
726 error = soreserve(so, tcp_sendspace, tcp_recvspace);
727 if (error)
728 return (error);
729 }
730 error = in_pcballoc(so, &tcbinfo, p);
731 if (error)
732 return (error);
733 inp = sotoinpcb(so);
734 inp->inp_vflag |= INP_IPV4;
735 tp = tcp_newtcpcb(inp);
736 if (tp == 0) {
737 int nofd = so->so_state & SS_NOFDREF; /* XXX */
738
739 so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
740 in_pcbdetach(inp);
741 so->so_state |= nofd;
--- 80 unchanged lines hidden ---