summaryrefslogtreecommitdiffstats
path: root/slirp/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/tcp_input.c')
-rw-r--r--slirp/tcp_input.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index de5b74a52b..6749b32f5d 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -38,7 +38,6 @@
* terms and conditions of the copyright.
*/
-#include "qemu/osdep.h"
#include "slirp.h"
#include "ip_icmp.h"
@@ -77,7 +76,7 @@
} \
}
-static void tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt,
+static void tcp_dooptions(struct tcpcb *tp, uint8_t *cp, int cnt,
struct tcpiphdr *ti);
static void tcp_xmit_timer(register struct tcpcb *tp, int rtt);
@@ -198,7 +197,7 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso, unsigned short af)
struct ip save_ip, *ip;
struct ip6 save_ip6, *ip6;
register struct tcpiphdr *ti;
- caddr_t optp = NULL;
+ char *optp = NULL;
int optlen = 0;
int len, tlen, off;
register struct tcpcb *tp = NULL;
@@ -206,7 +205,7 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso, unsigned short af)
struct socket *so = NULL;
int todrop, acked, ourfinisacked, needoutput = 0;
int iss = 0;
- u_long tiwin;
+ uint32_t tiwin;
int ret;
struct sockaddr_storage lhost, fhost;
struct sockaddr_in *lhost4, *fhost4;
@@ -328,7 +327,7 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso, unsigned short af)
ti->ti_len = tlen;
if (off > sizeof (struct tcphdr)) {
optlen = off - sizeof (struct tcphdr);
- optp = mtod(m, caddr_t) + sizeof (struct tcpiphdr);
+ optp = mtod(m, char *) + sizeof (struct tcpiphdr);
}
tiflags = ti->ti_flags;
@@ -470,7 +469,7 @@ findso:
* else do it below (after getting remote address).
*/
if (optp && tp->t_state != TCPS_LISTEN)
- tcp_dooptions(tp, (u_char *)optp, optlen, ti);
+ tcp_dooptions(tp, (uint8_t *)optp, optlen, ti);
/*
* Header prediction: check for the two common cases
@@ -506,7 +505,7 @@ findso:
SEQ_GT(ti->ti_ack, tp->t_rtseq))
tcp_xmit_timer(tp, tp->t_rtt);
acked = ti->ti_ack - tp->snd_una;
- sbdrop(&so->so_snd, acked);
+ sodrop(so, acked);
tp->snd_una = ti->ti_ack;
m_free(m);
@@ -725,7 +724,7 @@ findso:
tcp_template(tp);
if (optp)
- tcp_dooptions(tp, (u_char *)optp, optlen, ti);
+ tcp_dooptions(tp, (uint8_t *)optp, optlen, ti);
if (iss)
tp->iss = iss;
@@ -1040,7 +1039,7 @@ trimthenstep6:
tp->t_dupacks = 0;
else if (++tp->t_dupacks == TCPREXMTTHRESH) {
tcp_seq onxt = tp->snd_nxt;
- u_int win =
+ unsigned win =
MIN(tp->snd_wnd, tp->snd_cwnd) /
2 / tp->t_maxseg;
@@ -1109,8 +1108,8 @@ trimthenstep6:
* (maxseg^2 / cwnd per packet).
*/
{
- register u_int cw = tp->snd_cwnd;
- register u_int incr = tp->t_maxseg;
+ register unsigned cw = tp->snd_cwnd;
+ register unsigned incr = tp->t_maxseg;
if (cw > tp->snd_ssthresh)
incr = incr * incr / cw;
@@ -1118,10 +1117,10 @@ trimthenstep6:
}
if (acked > so->so_snd.sb_cc) {
tp->snd_wnd -= so->so_snd.sb_cc;
- sbdrop(&so->so_snd, (int )so->so_snd.sb_cc);
+ sodrop(so, (int)so->so_snd.sb_cc);
ourfinisacked = 1;
} else {
- sbdrop(&so->so_snd, acked);
+ sodrop(so, acked);
tp->snd_wnd -= acked;
ourfinisacked = 0;
}
@@ -1382,7 +1381,7 @@ drop:
}
static void
-tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcpiphdr *ti)
+tcp_dooptions(struct tcpcb *tp, uint8_t *cp, int cnt, struct tcpiphdr *ti)
{
uint16_t mss;
int opt, optlen;
@@ -1512,7 +1511,7 @@ tcp_xmit_timer(register struct tcpcb *tp, int rtt)
*/
int
-tcp_mss(struct tcpcb *tp, u_int offer)
+tcp_mss(struct tcpcb *tp, unsigned offer)
{
struct socket *so = tp->t_socket;
int mss;