diff options
author | wollman <wollman@FreeBSD.org> | 1997-02-18 20:46:36 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1997-02-18 20:46:36 +0000 |
commit | 9c02696981a3e802694006b17a0654f76ffe2c87 (patch) | |
tree | de43a65608f4e16314533102f763778f5f0efe26 /sys/netinet/tcp_usrreq.c | |
parent | 348a992441e4cfa6fff7a76bd128868ccc008872 (diff) | |
download | FreeBSD-src-9c02696981a3e802694006b17a0654f76ffe2c87.zip FreeBSD-src-9c02696981a3e802694006b17a0654f76ffe2c87.tar.gz |
Convert raw IP from mondo-switch-statement-from-Hell to
pr_usrreqs. Collapse duplicates with udp_usrreq.c and
tcp_usrreq.c (calling the generic routines in uipc_socket2.c and
in_pcb.c). Calling sockaddr()_ or peeraddr() on a detached
socket now traps, rather than harmlessly returning an error; this
should never happen. Allow the raw IP buffer sizes to be
controlled via sysctl.
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 61 |
1 files changed, 6 insertions, 55 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 6f02422..5207da9 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -69,7 +69,7 @@ /* * TCP protocol interface to socket abstraction. */ -extern char *tcpstates[]; +extern char *tcpstates[]; /* XXX ??? */ static int tcp_attach __P((struct socket *)); static int tcp_connect __P((struct tcpcb *, struct mbuf *)); @@ -288,7 +288,7 @@ tcp_usr_accept(struct socket *so, struct mbuf *nam) struct tcpcb *tp; COMMON_START(); - in_setpeeraddr(inp, nam); + in_setpeeraddr(so, nam); COMMON_END(PRU_ACCEPT); } @@ -415,19 +415,6 @@ tcp_usr_abort(struct socket *so) } /* - * Fill in st_bklsize for fstat() operations on a socket. - */ -static int -tcp_usr_sense(struct socket *so, struct stat *sb) -{ - int s = splnet(); - - sb->st_blksize = so->so_snd.sb_hiwat; - splx(s); - return 0; -} - -/* * Receive out-of-band data. */ static int @@ -457,49 +444,13 @@ tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags) COMMON_END(PRU_RCVOOB); } -static int -tcp_usr_sockaddr(struct socket *so, struct mbuf *nam) -{ - int s = splnet(); - int error = 0; - struct inpcb *inp = sotoinpcb(so); - struct tcpcb *tp; - - COMMON_START(); - in_setsockaddr(inp, nam); - COMMON_END(PRU_SOCKADDR); -} - -static int -tcp_usr_peeraddr(struct socket *so, struct mbuf *nam) -{ - int s = splnet(); - int error = 0; - struct inpcb *inp = sotoinpcb(so); - struct tcpcb *tp; - - COMMON_START(); - in_setpeeraddr(inp, nam); - COMMON_END(PRU_PEERADDR); -} - -/* - * XXX - this should just be a call to in_control, but we need to get - * the types worked out. - */ -static int -tcp_usr_control(struct socket *so, int cmd, caddr_t arg, struct ifnet *ifp) -{ - return in_control(so, cmd, arg, ifp); -} - /* xxx - should be const */ struct pr_usrreqs tcp_usrreqs = { tcp_usr_abort, tcp_usr_accept, tcp_usr_attach, tcp_usr_bind, - tcp_usr_connect, pru_connect2_notsupp, tcp_usr_control, tcp_usr_detach, - tcp_usr_disconnect, tcp_usr_listen, tcp_usr_peeraddr, tcp_usr_rcvd, - tcp_usr_rcvoob, tcp_usr_send, tcp_usr_sense, tcp_usr_shutdown, - tcp_usr_sockaddr + tcp_usr_connect, pru_connect2_notsupp, in_control, tcp_usr_detach, + tcp_usr_disconnect, tcp_usr_listen, in_setpeeraddr, tcp_usr_rcvd, + tcp_usr_rcvoob, tcp_usr_send, pru_sense_null, tcp_usr_shutdown, + in_setsockaddr }; /* |