From abdac5bfac5f330de14c545d8d5f503393801d1f Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Sun, 8 Sep 2013 01:25:27 +0000 Subject: Add the TCP RTT graph. Show the time values in ms instead of s. Add a button and keyboard shortcut to switch the connection direction. Move more code to tap-tcp-stream.c. Update our axis labels. svn path=/trunk/; revision=51832 --- ui/tap-tcp-stream.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'ui/tap-tcp-stream.c') diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c index e2359dacf1..6bbf3c1d3a 100644 --- a/ui/tap-tcp-stream.c +++ b/ui/tap-tcp-stream.c @@ -343,6 +343,63 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs) } +int rtt_is_retrans(struct unack *list, unsigned int seqno) +{ + struct unack *u; + + for (u=list; u; u=u->next) { + if (u->seqno == seqno) + return TRUE; + } + return FALSE; +} + +struct unack *rtt_get_new_unack(double time_val, unsigned int seqno) +{ + struct unack *u; + + u = (struct unack * )g_malloc(sizeof(struct unack)); + u->next = NULL; + u->time = time_val; + u->seqno = seqno; + return u; +} + +void rtt_put_unack_on_list(struct unack **l, struct unack *new_unack) +{ + struct unack *u, *list = *l; + + for (u=list; u; u=u->next) { + if (!u->next) + break; + } + if (u) + u->next = new_unack; + else + *l = new_unack; +} + +void rtt_delete_unack_from_list(struct unack **l, struct unack *dead) +{ + struct unack *u, *list = *l; + + if (!dead || !list) + return; + + if (dead == list) { + *l = list->next; + g_free(list); + } else { + for (u=list; u; u=u->next) { + if (u->next == dead) { + u->next = u->next->next; + g_free(dead); + break; + } + } + } +} + /* * Editor modelines * -- cgit v1.2.3