aboutsummaryrefslogtreecommitdiffstats
path: root/epan/follow.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-11-13 22:18:01 +0000
committerGerald Combs <gerald@wireshark.org>2013-11-13 22:18:01 +0000
commitb0063a025bfb68a3bc05a69cadf528116325576f (patch)
tree5b047bb81d7bdf70e4baed7bbe2700a5bc058861 /epan/follow.c
parent3e41e172db45009124ec19ad859cf9cb82c88200 (diff)
Highlight selected sequence diagram items.
Create a new dialog each time the user follows a stream. A lot of the follow code seems to assume one and only one dialog so there are likely outstanding bugs. Don't use the global cfile (should we deprecate its usage?). We want to move closer to multiple documents, not further away. Clean up after ourselves. Free our payload list and unlink our temp file. Make a bunch of gchar*s QStrings. Make sure our destructor gets called and use it. Make member variable and method names more consistent. svn path=/trunk/; revision=53306
Diffstat (limited to 'epan/follow.c')
-rw-r--r--epan/follow.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/epan/follow.c b/epan/follow.c
index 4e26a5bad7..ed930c12b4 100644
--- a/epan/follow.c
+++ b/epan/follow.c
@@ -58,7 +58,7 @@ FILE* data_out_file = NULL;
gboolean empty_tcp_stream;
gboolean incomplete_tcp_stream;
-static guint32 tcp_stream_to_follow;
+static guint32 tcp_stream_to_follow = 0;
static guint8 ip_address[2][MAX_IPADDR_LEN];
static guint port[2];
static guint bytes_written[2];
@@ -80,12 +80,12 @@ follow_stats(follow_stats_t* stats)
}
}
-/* this will build libpcap filter text that will only
+/* This will build a display filter text that will only
pass the packets related to the stream. There is a
chance that two streams could intersect, but not a
very good one */
-char*
-build_follow_filter( packet_info *pi ) {
+gchar*
+build_follow_conv_filter( packet_info *pi ) {
char* buf;
int len;
conversation_t *conv=NULL;
@@ -148,6 +148,15 @@ static gboolean find_tcp_addr;
static address tcp_addr[2];
static gboolean find_tcp_index;
+gchar*
+build_follow_index_filter(void) {
+ gchar *buf;
+
+ find_tcp_addr = TRUE;
+ buf = g_strdup_printf("tcp.stream eq %d", tcp_stream_to_follow);
+ return buf;
+}
+
/* select a tcp stream to follow via it's address/port pairs */
gboolean
follow_tcp_addr(const address *addr0, guint port0,
@@ -192,6 +201,10 @@ follow_tcp_index(guint32 indx)
return FALSE;
}
+ if (indx > get_tcp_stream_count()) {
+ return FALSE;
+ }
+
find_tcp_addr = TRUE;
tcp_stream_to_follow = indx;
memset(ip_address, 0, sizeof ip_address);
@@ -200,6 +213,11 @@ follow_tcp_index(guint32 indx)
return TRUE;
}
+guint32
+get_follow_tcp_index(void) {
+ return tcp_stream_to_follow;
+}
+
/* here we are going to try and reconstruct the data portion of a TCP
session. We will try and handle duplicates, TCP fragments, and out
of order packets in a smart way. */