aboutsummaryrefslogtreecommitdiff
path: root/slirp/tcp_input.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-17 15:43:53 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-02-07 15:49:08 +0200
commitd7df0b41dc38327388c3f19fdf4246793d4a1e4b (patch)
treec22ae85e9673aab5ba4df10ee5c7e124f4cdac1b /slirp/tcp_input.c
parenta9d8b3ec4385793815d7121785730422fa3dfb68 (diff)
slirp: prefer c99 types over BSD kind
Replace: - u_char -> uint8_t - u_short -> uint16_t - u_long -> uint32_t - u_int -> unsigned - caddr_t -> char * Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/tcp_input.c')
-rw-r--r--slirp/tcp_input.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index 864da7d857..6749b32f5d 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -76,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);
@@ -197,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;
@@ -205,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;
@@ -327,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;
@@ -469,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
@@ -724,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;
@@ -1039,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;
@@ -1108,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;
@@ -1381,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;
@@ -1511,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;