diff options
author | Kevin Hogan <kwabena@google.com> | 2017-01-17 20:30:26 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-01-20 00:35:34 +0000 |
commit | 73b5e3d0082cc7ca65e5a085bd80264e5a0b1082 (patch) | |
tree | fabca3a702f742198832bca4fa1985c19bfd41d3 /ui/tap-tcp-stream.c | |
parent | 069a5329887b9195f7994de00fe46c9fd055ca71 (diff) | |
download | wireshark-73b5e3d0082cc7ca65e5a085bd80264e5a0b1082.tar.gz |
Qt: modify RTT graph (handle GSO, SACK, etc), plus bug fixes
Modifications to RTT graph:
- change x-axis to time (s) rather than sequence number
[ avoids sequence number wraparound ambiguity, plus
easier to correlate RTT changes to tcptrace graph ]
- change RTT computation to properly handle acks to GSO packets
- change RTT computation to take SACK blocks into account
Bug fixes:
- eliminate potential memory leak if some packets are unacked
- ensure RTT graph is shown if TCPGraph window is opened to it directly
Change-Id: I2bdcab97399ebde0f15c78fa19c882529a814580
Reviewed-on: https://code.wireshark.org/review/19662
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/tap-tcp-stream.c')
-rw-r--r-- | ui/tap-tcp-stream.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c index abf357683d..44115aa99f 100644 --- a/ui/tap-tcp-stream.c +++ b/ui/tap-tcp-stream.c @@ -364,31 +364,34 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs) return th.tcphdrs[0]; } -int rtt_is_retrans(struct unack *list, unsigned int seqno) +int rtt_is_retrans(struct rtt_unack *list, unsigned int seqno) { - struct unack *u; + struct rtt_unack *u; for (u=list; u; u=u->next) { - if (u->seqno == seqno) + if (tcp_seq_eq_or_after(seqno, u->seqno) && + tcp_seq_before(seqno, u->end_seqno)) return TRUE; } return FALSE; } -struct unack *rtt_get_new_unack(double time_val, unsigned int seqno) +struct rtt_unack * +rtt_get_new_unack(double time_val, unsigned int seqno, unsigned int seglen) { - struct unack *u; + struct rtt_unack *u; - u = (struct unack * )g_malloc(sizeof(struct unack)); + u = (struct rtt_unack * )g_malloc(sizeof(struct rtt_unack)); u->next = NULL; u->time = time_val; u->seqno = seqno; + u->end_seqno = seqno + seglen; return u; } -void rtt_put_unack_on_list(struct unack **l, struct unack *new_unack) +void rtt_put_unack_on_list(struct rtt_unack **l, struct rtt_unack *new_unack) { - struct unack *u, *list = *l; + struct rtt_unack *u, *list = *l; for (u=list; u; u=u->next) { if (!u->next) @@ -400,9 +403,9 @@ void rtt_put_unack_on_list(struct unack **l, struct unack *new_unack) *l = new_unack; } -void rtt_delete_unack_from_list(struct unack **l, struct unack *dead) +void rtt_delete_unack_from_list(struct rtt_unack **l, struct rtt_unack *dead) { - struct unack *u, *list = *l; + struct rtt_unack *u, *list = *l; if (!dead || !list) return; @@ -421,6 +424,14 @@ void rtt_delete_unack_from_list(struct unack **l, struct unack *dead) } } +void rtt_destroy_unack_list(struct rtt_unack **l ) { + while (*l) { + struct rtt_unack *head = *l; + *l = head->next; + g_free(head); + } +} + /* * Editor modelines * |