diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-09-04 23:15:59 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-09-04 23:15:59 +0000 |
commit | 03fd39d7f0c409a45e422d9142b48536ec5c8647 (patch) | |
tree | e8c1be0562459e4d302310d65cfd367b929e5564 /ui/tap-tcp-stream.c | |
parent | 1abd5a5965e3542c7dfcf6ec258daffe1d9fb504 (diff) | |
download | wireshark-03fd39d7f0c409a45e422d9142b48536ec5c8647.tar.gz |
Throughput graph updates.
GTK+: Fix what appears to be an off-by-one error in the MA period (21
segments instead of 20). Throw away our initial segment length instead
of subtracting it from the moving sum, which skews the sum.
Qt: Add the througput graph. Use bits/s for the throughput y axis. Let
the user switch between graph types. The dialog hangs when doing this. I
haven't been able to track down the cause. Remove some unused code.
Both: Tell the user that we're using a 20 segment moving average. Move
more routines to tap-tcp-stream.[ch].
svn path=/trunk/; revision=51759
Diffstat (limited to 'ui/tap-tcp-stream.c')
-rw-r--r-- | ui/tap-tcp-stream.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c index 4be31f4c4e..dffa6cd15d 100644 --- a/ui/tap-tcp-stream.c +++ b/ui/tap-tcp-stream.c @@ -176,6 +176,44 @@ compare_headers(address *saddr1, address *daddr1, guint16 sport1, guint16 dport1 } } +int +get_num_dsegs(struct tcp_graph *tg) +{ + int count; + struct segment *tmp; + + for (tmp=tg->segments, count=0; tmp; tmp=tmp->next) { + if (compare_headers(&tg->src_address, &tg->dst_address, + tg->src_port, tg->dst_port, + &tmp->ip_src, &tmp->ip_dst, + tmp->th_sport, tmp->th_dport, + COMPARE_CURR_DIR)) { + count++; + } + } + return count; +} + +int +get_num_acks(struct tcp_graph *tg, int *num_sack_ranges) +{ + int count; + struct segment *tmp; + + for (tmp = tg->segments, count=0; tmp; tmp = tmp->next) { + if (!compare_headers(&tg->src_address, &tg->dst_address, + tg->src_port, tg->dst_port, + &tmp->ip_src, &tmp->ip_dst, + tmp->th_sport, tmp->th_dport, + COMPARE_CURR_DIR)) { + count++; + *num_sack_ranges += tmp->num_sack_ranges; + } + } + return count; +} + + typedef struct _th_t { int num_hdrs; |