aboutsummaryrefslogtreecommitdiffstats
path: root/ui/tap-tcp-stream.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-09-08 01:25:27 +0000
committerGerald Combs <gerald@wireshark.org>2013-09-08 01:25:27 +0000
commitabdac5bfac5f330de14c545d8d5f503393801d1f (patch)
tree8f40df8d4876d6f439e85b98170d7aa27472d4b1 /ui/tap-tcp-stream.c
parentcc26962f96217d834e1dcf11312f9521bde9841c (diff)
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
Diffstat (limited to 'ui/tap-tcp-stream.c')
-rw-r--r--ui/tap-tcp-stream.c57
1 files changed, 57 insertions, 0 deletions
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
*