diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-21 16:42:10 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-21 16:42:10 +0000 |
commit | 64c687346bb90442c51b1680016bffe3508a2605 (patch) | |
tree | 84fd0d450d990265ccdba2788d69c69f21a952a6 /ui/gtk/follow_tcp.c | |
parent | d5433fd9b65d2b176721c440d445310f9868f6ea (diff) |
Remove packet_info->ipproto and packet_info->ethertype uses in the GUI. Convert to walking packet protocol list looking for desired protocols.
I may eventually switch this to use proto_* values instead of strings, but just the addition of the loop is more jarring as compared to the simple comparing of ip or ethernet values. But it should lead to a smaller (less protocol specific) packet_info structure.
svn path=/trunk/; revision=53476
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."); |