wireshark/ui/gtk/decode_as_dlg.h

66 lines
1.9 KiB
C
Raw Normal View History

/* decode_as_dlg.h
*
* Routines to modify dissector tables on the fly.
*
* By David Hampton <dhampton@mac.com>
* Copyright 2001 David Hampton
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef __DECODE_AS_DLG_H__
#define __DECODE_AS_DLG_H__
/** @file
* "Decode As" / "User Specified Decodes" dialog box.
* @ingroup dialog_group
*/
/*
Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table. When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog. Any GUI (GTK+/Qt/tshark) can just hook into the "decode as list" to see what can be provided. This patch includes the GUI portion of the functionality (including packet-dcerpc.[ch] because it had some GUI dependencies that are now removed). Other notes: 1. Some "GUI text" (UTF8_LEFTWARDS_ARROW and similar) made their way into the dissector code. Not sure how necessary it is and if reformatting the strings to avoid the macros is desired (TCP/UDP use it, SCTP doesn't). 2. I converted the SCTP functionality to have 2 tabs (instead of radio button), currently both are labeled "Transport" which could be confusing to users. Naming suggestions welcome (as well as for naming of tabs from other dissectors). 3. BER and DCERPC have more opportunity to use Decode As now that they are selected based on dissector presense, not packet_info values. 4. Catapult DCT2000 populates pinfo->ipproto, yet under new design will not show up to do Decode As. Should a "decode as item" be created for it? 5. BER dissector doesn't have Clear/Show Current functionality working (never did) 6. Bluetooth (in old design) could have been used "capture wide" instead of single packet (creating tabs of values not present in current packet), which goes against what I believe to be in the intent of Decode As, but I'm willing to hear counter-arguments. svn path=/trunk/; revision=53446
2013-11-20 19:23:02 +00:00
* Enum used to track which radio button is currently selected in the
* dialog. These buttons are labeled "Decode" and "Do not decode".
*/
Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table. When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog. Any GUI (GTK+/Qt/tshark) can just hook into the "decode as list" to see what can be provided. This patch includes the GUI portion of the functionality (including packet-dcerpc.[ch] because it had some GUI dependencies that are now removed). Other notes: 1. Some "GUI text" (UTF8_LEFTWARDS_ARROW and similar) made their way into the dissector code. Not sure how necessary it is and if reformatting the strings to avoid the macros is desired (TCP/UDP use it, SCTP doesn't). 2. I converted the SCTP functionality to have 2 tabs (instead of radio button), currently both are labeled "Transport" which could be confusing to users. Naming suggestions welcome (as well as for naming of tabs from other dissectors). 3. BER and DCERPC have more opportunity to use Decode As now that they are selected based on dissector presense, not packet_info values. 4. Catapult DCT2000 populates pinfo->ipproto, yet under new design will not show up to do Decode As. Should a "decode as item" be created for it? 5. BER dissector doesn't have Clear/Show Current functionality working (never did) 6. Bluetooth (in old design) could have been used "capture wide" instead of single packet (creating tabs of values not present in current packet), which goes against what I believe to be in the intent of Decode As, but I'm willing to hear counter-arguments. svn path=/trunk/; revision=53446
2013-11-20 19:23:02 +00:00
enum action_type {
/* The "Decode" button is currently selected. */
E_DECODE_YES,
Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table. When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog. Any GUI (GTK+/Qt/tshark) can just hook into the "decode as list" to see what can be provided. This patch includes the GUI portion of the functionality (including packet-dcerpc.[ch] because it had some GUI dependencies that are now removed). Other notes: 1. Some "GUI text" (UTF8_LEFTWARDS_ARROW and similar) made their way into the dissector code. Not sure how necessary it is and if reformatting the strings to avoid the macros is desired (TCP/UDP use it, SCTP doesn't). 2. I converted the SCTP functionality to have 2 tabs (instead of radio button), currently both are labeled "Transport" which could be confusing to users. Naming suggestions welcome (as well as for naming of tabs from other dissectors). 3. BER and DCERPC have more opportunity to use Decode As now that they are selected based on dissector presense, not packet_info values. 4. Catapult DCT2000 populates pinfo->ipproto, yet under new design will not show up to do Decode As. Should a "decode as item" be created for it? 5. BER dissector doesn't have Clear/Show Current functionality working (never did) 6. Bluetooth (in old design) could have been used "capture wide" instead of single packet (creating tabs of values not present in current packet), which goes against what I believe to be in the intent of Decode As, but I'm willing to hear counter-arguments. svn path=/trunk/; revision=53446
2013-11-20 19:23:02 +00:00
/* The "Do not decode" button is currently selected. */
E_DECODE_NO
};
/** User requested the "Decode As" dialog box by menu or toolbar.
*
* @param widget parent widget (unused)
* @param data unused
*/
void decode_as_cb(GtkWidget *widget, gpointer data);
/** User requested the "User Specified Decodes" dialog box by menu or toolbar.
*
* @param widget parent widget (unused)
* @param data unused
*/
void decode_show_cb(GtkWidget *widget, gpointer data);
/** Have any pages in the notebook in a "Decode As" dialog box? If there
* wouldn't be, we inactivate the menu item for "Decode As".
*
* @return TRUE, if we have at least one notebook page in "Decode As"
*/
gboolean decode_as_ok(void);
#endif