diff options
Diffstat (limited to 'slirp/tcp_subr.c')
-rw-r--r-- | slirp/tcp_subr.c | 51 |
1 files changed, 18 insertions, 33 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index b30dffdc67..b70f06e062 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -49,7 +49,7 @@ * Tcp initialization */ void -tcp_init() +tcp_init(void) { tcp_iss = 1; /* wrong */ tcb.so_next = tcb.so_prev = &tcb; @@ -63,8 +63,7 @@ tcp_init() */ /* struct tcpiphdr * */ void -tcp_template(tp) - struct tcpcb *tp; +tcp_template(struct tcpcb *tp) { struct socket *so = tp->t_socket; register struct tcpiphdr *n = &tp->t_template; @@ -102,12 +101,8 @@ tcp_template(tp) * segment are as specified by the parameters. */ void -tcp_respond(tp, ti, m, ack, seq, flags) - struct tcpcb *tp; - register struct tcpiphdr *ti; - register struct mbuf *m; - tcp_seq ack, seq; - int flags; +tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m, + tcp_seq ack, tcp_seq seq, int flags) { register int tlen; int win = 0; @@ -122,7 +117,7 @@ tcp_respond(tp, ti, m, ack, seq, flags) if (tp) win = sbspace(&tp->t_socket->so_rcv); - if (m == 0) { + if (m == NULL) { if ((m = m_get()) == NULL) return; #ifdef TCP_COMPAT_42 @@ -152,7 +147,7 @@ tcp_respond(tp, ti, m, ack, seq, flags) tlen += sizeof (struct tcpiphdr); m->m_len = tlen; - ti->ti_mbuf = 0; + ti->ti_mbuf = NULL; ti->ti_x1 = 0; ti->ti_seq = htonl(seq); ti->ti_ack = htonl(ack); @@ -182,8 +177,7 @@ tcp_respond(tp, ti, m, ack, seq, flags) * protocol control block. */ struct tcpcb * -tcp_newtcpcb(so) - struct socket *so; +tcp_newtcpcb(struct socket *so) { register struct tcpcb *tp; @@ -257,8 +251,7 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err) * wake up any sleepers */ struct tcpcb * -tcp_close(tp) - register struct tcpcb *tp; +tcp_close(struct tcpcb *tp) { register struct tcpiphdr *t; struct socket *so = tp->t_socket; @@ -281,7 +274,7 @@ tcp_close(tp) */ /* free(tp, M_PCB); */ free(tp); - so->so_tcpcb = 0; + so->so_tcpcb = NULL; soisfdisconnected(so); /* clobber input socket cache if we're closing the cached connection */ if (so == tcp_last_so) @@ -333,8 +326,7 @@ tcp_quench(i, errno) * We can let the user exit from the close as soon as the FIN is acked. */ void -tcp_sockclosed(tp) - struct tcpcb *tp; +tcp_sockclosed(struct tcpcb *tp) { DEBUG_CALL("tcp_sockclosed"); @@ -375,8 +367,7 @@ tcp_sockclosed(tp) * nonblocking. Connect returns after the SYN is sent, and does * not wait for ACK+SYN. */ -int tcp_fconnect(so) - struct socket *so; +int tcp_fconnect(struct socket *so) { int ret=0; @@ -438,8 +429,7 @@ int tcp_fconnect(so) * here and SYN the local-host. */ void -tcp_connect(inso) - struct socket *inso; +tcp_connect(struct socket *inso) { struct socket *so; struct sockaddr_in addr; @@ -525,8 +515,7 @@ tcp_connect(inso) * Attach a TCPCB to a socket. */ int -tcp_attach(so) - struct socket *so; +tcp_attach(struct socket *so) { if ((so->so_tcpcb = tcp_newtcpcb(so)) == NULL) return -1; @@ -558,14 +547,13 @@ static const struct tos_t tcptos[] = { #ifdef CONFIG_QEMU static #endif -struct emu_t *tcpemu = 0; +struct emu_t *tcpemu = NULL; /* * Return TOS according to the above table */ u_int8_t -tcp_tos(so) - struct socket *so; +tcp_tos(struct socket *so) { int i = 0; struct emu_t *emup; @@ -620,9 +608,7 @@ int do_echo = -1; * NOTE: if you return 0 you MUST m_free() the mbuf! */ int -tcp_emu(so, m) - struct socket *so; - struct mbuf *m; +tcp_emu(struct socket *so, struct mbuf *m) { u_int n1, n2, n3, n4, n5, n6; char buff[257]; @@ -976,7 +962,7 @@ do_prompt: } #endif case EMU_FTP: /* ftp */ - *(m->m_data+m->m_len) = 0; /* NULL terminate for strstr */ + *(m->m_data+m->m_len) = 0; /* NUL terminate for strstr */ if ((bptr = (char *)strstr(m->m_data, "ORT")) != NULL) { /* * Need to emulate the PORT command @@ -1244,8 +1230,7 @@ do_prompt: * return 2 if this is a command-line connection */ int -tcp_ctl(so) - struct socket *so; +tcp_ctl(struct socket *so) { struct sbuf *sb = &so->so_snd; int command; |