From 829c1ed25ec2734d9c6fec6d8cbcc2b6e69ff6f1 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Mon, 9 Sep 2013 01:40:06 +0000 Subject: Add the TCP window scaling graph. Add zoom selections. Rename some methods. Add the ability to toggle time and sequence number origins. Add more keyboard shortcuts. Comment out abs_secs abs_usecs in the segment struct since it looks like we aren't using them. Make sure we stay in the same TCP stream. svn path=/trunk/; revision=51856 --- ui/tap-tcp-stream.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'ui/tap-tcp-stream.c') diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c index 6bbf3c1d3a..621c882b09 100644 --- a/ui/tap-tcp-stream.c +++ b/ui/tap-tcp-stream.c @@ -61,15 +61,18 @@ tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, cons tg->src_port, tg->dst_port, &tcphdr->ip_src, &tcphdr->ip_dst, tcphdr->th_sport, tcphdr->th_dport, - ts->direction)) + ts->direction) + && tg->stream == tcphdr->th_stream) { struct segment *segment = (struct segment *)g_malloc(sizeof(struct segment)); segment->next = NULL; segment->num = pinfo->fd->num; segment->rel_secs = (guint32)pinfo->rel_ts.secs; segment->rel_usecs = pinfo->rel_ts.nsecs/1000; + /* Currently unused segment->abs_secs = (guint32)pinfo->fd->abs_ts.secs; segment->abs_usecs = pinfo->fd->abs_ts.nsecs/1000; + */ segment->th_seq = tcphdr->th_seq; segment->th_ack = tcphdr->th_ack; segment->th_win = tcphdr->th_win; @@ -111,7 +114,8 @@ graph_segment_list_get(capture_file *cf, struct tcp_graph *tg, gboolean stream_k if (!cf || !tg) return; if (!stream_known) { - if (!select_tcpip_session(cf, ¤t)) return; + struct tcpheader *header = select_tcpip_session(cf, ¤t); + if (!header) return; if (tg->type == GRAPH_THROUGHPUT) ts.direction = COMPARE_CURR_DIR; else @@ -122,6 +126,7 @@ graph_segment_list_get(capture_file *cf, struct tcp_graph *tg, gboolean stream_k tg->src_port = current.th_sport; COPY_ADDRESS(&tg->dst_address, ¤t.ip_dst); tg->dst_port = current.th_dport; + tg->stream = header->th_stream; } /* rescan all the packets and pick up all interesting tcp headers. @@ -328,8 +333,10 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs) hdrs->num = fdata->num; hdrs->rel_secs = (guint32) rel_ts.secs; hdrs->rel_usecs = rel_ts.nsecs/1000; + /* Currently unused hdrs->abs_secs = (guint32) fdata->abs_ts.secs; hdrs->abs_usecs = fdata->abs_ts.nsecs/1000; + */ hdrs->th_seq = th.tcphdrs[0]->th_seq; hdrs->th_ack = th.tcphdrs[0]->th_ack; hdrs->th_win = th.tcphdrs[0]->th_win; -- cgit v1.2.1