diff options
Diffstat (limited to 'ui/gtk/follow_tcp.c')
-rw-r--r-- | ui/gtk/follow_tcp.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/ui/gtk/follow_tcp.c b/ui/gtk/follow_tcp.c index 48ceec3b94..483b739d0e 100644 --- a/ui/gtk/follow_tcp.c +++ b/ui/gtk/follow_tcp.c @@ -43,7 +43,6 @@ #include <epan/charsets.h> #include <epan/epan_dissect.h> #include <wsutil/filesystem.h> -#include <epan/ipproto.h> #include <epan/charsets.h> #include "../file.h" @@ -106,9 +105,27 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_) size_t nchars; gchar *data_out_filename; char stream_window_title[256]; + wmem_list_frame_t* protos; + int proto_id; + const char* proto_name; + gboolean is_tcp = FALSE; + + /* we got tcp so we can follow (should really be protected by menu sensitivity) */ + protos = wmem_list_head(cfile.edt->pi.layers); + /* walk the list of a available protocols in the packet to see if we have TCP */ + while (protos != NULL) { + proto_id = GPOINTER_TO_INT(wmem_list_frame_data(protos)); + proto_name = proto_get_protocol_filter_name(proto_id); + + if (!strcmp(proto_name, "tcp")) { + is_tcp = TRUE; + break; + } + + protos = wmem_list_frame_next(protos); + } - /* we got tcp so we can follow */ - if (cfile.edt->pi.ipproto != IP_PROTO_TCP) { + if (!is_tcp) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error following stream. Please make\n" "sure you have a TCP packet selected."); |