diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-12-03 21:05:59 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-12-03 21:05:59 +0000 |
commit | 64ee59907dbc717ac074d81f0c42337678318edd (patch) | |
tree | 27ea40b8f115d03fcff756aeb874e56a78bc7c77 /gtk/decode_as_dlg.c | |
parent | a492a07a5134edb9bb1792793472a7e33b2e6fe7 (diff) | |
download | wireshark-64ee59907dbc717ac074d81f0c42337678318edd.tar.gz wireshark-64ee59907dbc717ac074d81f0c42337678318edd.tar.bz2 wireshark-64ee59907dbc717ac074d81f0c42337678318edd.zip |
"ptype" is always set, even if only to PT_NONE; it will be set to PT_TCP
only there's TCP in the current frame and it will be set to PT_UDP only
if there's UDP in the current frame. As such, there's no need to check
"ipproto" before checking "ptype" - and we should check "ptype" as well
as "ipproto" when deciding whether we'll put up a "Decode As" dialog
with anything in it.
(Not that there's anything other than IPv4 or IPv6 over which we
currently dissect TCP or UDP....)
svn path=/trunk/; revision=4318
Diffstat (limited to 'gtk/decode_as_dlg.c')
-rw-r--r-- | gtk/decode_as_dlg.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c index 1671cce0da..7972a29037 100644 --- a/gtk/decode_as_dlg.c +++ b/gtk/decode_as_dlg.c @@ -1,6 +1,6 @@ /* decode_as_dlg.c * - * $Id: decode_as_dlg.c,v 1.17 2001/12/03 20:49:03 guy Exp $ + * $Id: decode_as_dlg.c,v 1.18 2001/12/03 21:05:59 guy Exp $ * * Routines to modify dissector tables on the fly. * @@ -1081,7 +1081,8 @@ decode_add_tcpudp_page (gchar *prompt, gchar *table_name) gboolean decode_as_ok(void) { - return cfile.edt->pi.ethertype || cfile.edt->pi.ipproto; + return cfile.edt->pi.ethertype || cfile.edt->pi.ipproto || + cfile.edt->pi.ptype == PT_TCP || cfile.edt->pi.ptype == PT_UDP; } @@ -1122,26 +1123,26 @@ decode_add_notebook (GtkWidget *format_hb) gtk_object_set_data(GTK_OBJECT(page), E_PAGE_ACTION, decode_simple); label = gtk_label_new("Network"); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); + } + + /* Add transport selection page */ + switch (cfile.edt->pi.ptype) { + + case PT_TCP: + page = decode_add_tcpudp_page("TCP", "tcp.port"); + break; - /* Add transport selection page */ - switch (cfile.edt->pi.ptype) { - - case PT_TCP: - page = decode_add_tcpudp_page("TCP", "tcp.port"); - break; - - case PT_UDP: - page = decode_add_tcpudp_page("UDP", "udp.port"); - break; - - default: - page = NULL; - break; - } - if (page != NULL) { - label = gtk_label_new("Transport"); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); - } + case PT_UDP: + page = decode_add_tcpudp_page("UDP", "udp.port"); + break; + + default: + page = NULL; + break; + } + if (page != NULL) { + label = gtk_label_new("Transport"); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); } /* Select the last added page (selects first by default) */ |