2000-08-11 13:37:21 +00:00
|
|
|
/* main.h
|
1998-09-16 02:39:15 +00:00
|
|
|
* Global defines, etc.
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1998-09-16 03:22:19 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-09-16 02:39:15 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
1999-10-08 07:29:42 +00:00
|
|
|
#ifndef __MAIN_H__
|
|
|
|
#define __MAIN_H__
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-09-09 03:32:03 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
1998-09-16 02:39:15 +00:00
|
|
|
#include "config.h"
|
1999-09-09 03:32:03 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "globals.h"
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2004-06-04 17:19:01 +00:00
|
|
|
/** @defgroup main_window_group Main window
|
|
|
|
* The main window has the following submodules:
|
|
|
|
@dot
|
|
|
|
digraph main_dependencies {
|
|
|
|
node [shape=record, fontname=Helvetica, fontsize=10];
|
|
|
|
main [ label="main window" URL="\ref main.h"];
|
2009-06-21 19:16:37 +00:00
|
|
|
menu [ label="menubar" URL="\ref menus.h"];
|
2004-06-04 17:19:01 +00:00
|
|
|
toolbar [ label="toolbar" URL="\ref toolbar.h"];
|
2008-04-12 20:11:12 +00:00
|
|
|
packet_list [ label="packet list pane" URL="\ref main_packet_list.h"];
|
|
|
|
proto_draw [ label="packet details & bytes panes" URL="\ref main_proto_draw.h"];
|
2004-06-04 17:19:01 +00:00
|
|
|
recent [ label="recent user settings" URL="\ref recent.h"];
|
|
|
|
main -> menu [ arrowhead="open", style="solid" ];
|
|
|
|
main -> toolbar [ arrowhead="open", style="solid" ];
|
|
|
|
main -> packet_list [ arrowhead="open", style="solid" ];
|
|
|
|
main -> proto_draw [ arrowhead="open", style="solid" ];
|
|
|
|
main -> recent [ arrowhead="open", style="solid" ];
|
|
|
|
}
|
|
|
|
@enddot
|
|
|
|
*/
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** @file
|
2004-06-04 17:19:01 +00:00
|
|
|
* The main window, filter toolbar, program start/stop and a lot of other things
|
|
|
|
* @ingroup main_window_group
|
|
|
|
* @ingroup windows_group
|
2001-10-22 22:59:26 +00:00
|
|
|
*/
|
|
|
|
|
2005-09-21 20:11:55 +00:00
|
|
|
/** Global compile time version string */
|
|
|
|
extern GString *comp_info_str;
|
|
|
|
/** Global runtime version string */
|
|
|
|
extern GString *runtime_info_str;
|
|
|
|
|
2006-08-16 18:01:25 +00:00
|
|
|
extern GtkWidget* airpcap_tb;
|
|
|
|
|
2005-08-02 04:47:15 +00:00
|
|
|
extern void protect_thread_critical_region(void);
|
|
|
|
extern void unprotect_thread_critical_region(void);
|
|
|
|
|
2006-08-16 18:01:25 +00:00
|
|
|
void
|
|
|
|
airpcap_toolbar_encryption_cb(GtkWidget *entry, gpointer user_data);
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested "Zoom In" by menu or toolbar.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void view_zoom_in_cb(GtkWidget *widget, gpointer data);
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested "Zoom Out" by menu or toolbar.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void view_zoom_out_cb(GtkWidget *widget, gpointer data);
|
2002-01-11 08:21:02 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested "Zoom 100%" by menu or toolbar.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void view_zoom_100_cb(GtkWidget *widget, gpointer data);
|
2002-01-11 08:21:02 +00:00
|
|
|
|
2005-01-17 21:48:51 +00:00
|
|
|
/** User requested "Protocol Info" by ptree context menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void selected_ptree_info_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2005-01-19 01:12:45 +00:00
|
|
|
/** User requested "Filter Reference" by ptree context menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void selected_ptree_ref_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** "Apply as Filter" / "Prepare a Filter" action type. */
|
|
|
|
typedef enum {
|
|
|
|
MATCH_SELECTED_REPLACE, /**< "Selected" */
|
|
|
|
MATCH_SELECTED_AND, /**< "and Selected" */
|
|
|
|
MATCH_SELECTED_OR, /**< "or Selected" */
|
|
|
|
MATCH_SELECTED_NOT, /**< "Not Selected" */
|
|
|
|
MATCH_SELECTED_AND_NOT, /**< "and not Selected" */
|
|
|
|
MATCH_SELECTED_OR_NOT /**< "or not Selected" */
|
|
|
|
} MATCH_SELECTED_E;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** mask MATCH_SELECTED_E values (internally used) */
|
|
|
|
#define MATCH_SELECTED_MASK 0x0ff
|
1998-12-29 04:05:38 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** "bitwise or" this with MATCH_SELECTED_E value for instant apply instead of prepare only */
|
|
|
|
#define MATCH_SELECTED_APPLY_NOW 0x100
|
|
|
|
|
2007-03-08 23:37:55 +00:00
|
|
|
/** "bitwise or" this with MATCH_SELECTED_E value for copy to clipboard instead of prepare only */
|
|
|
|
#define MATCH_SELECTED_COPY_ONLY 0x200
|
|
|
|
|
2009-04-08 18:32:11 +00:00
|
|
|
/** User requested one of "Apply as Filter" or "Prepare a Filter" functions
|
|
|
|
* by menu or context menu of protocol tree.
|
2006-05-11 05:08:00 +00:00
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data parent widget
|
2009-04-08 18:32:11 +00:00
|
|
|
* @param action the function to use
|
2006-05-11 05:08:00 +00:00
|
|
|
*/
|
2009-04-08 18:32:11 +00:00
|
|
|
extern void match_selected_ptree_cb(GtkWidget *widget, gpointer data, MATCH_SELECTED_E action);
|
2006-05-11 05:08:00 +00:00
|
|
|
|
2009-04-08 18:32:11 +00:00
|
|
|
/** "Copy ..." action type. */
|
|
|
|
typedef enum {
|
|
|
|
COPY_SELECTED_DESCRIPTION, /**< "Copy Description" */
|
|
|
|
COPY_SELECTED_FIELDNAME, /**< "Copy Fieldname" */
|
|
|
|
COPY_SELECTED_VALUE /**< "Copy Value" */
|
|
|
|
} COPY_SELECTED_E;
|
|
|
|
|
|
|
|
/** User highlited item in details window and then right clicked and selected the copy option
|
2004-06-01 17:33:37 +00:00
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data parent widget
|
|
|
|
* @param action the function to use
|
|
|
|
*/
|
2009-04-08 18:32:11 +00:00
|
|
|
extern void copy_selected_plist_cb(GtkWidget *w _U_, gpointer data, COPY_SELECTED_E action);
|
2004-06-01 17:33:37 +00:00
|
|
|
|
2007-11-24 11:38:16 +00:00
|
|
|
/** User requested the colorize function
|
|
|
|
* by menu or context menu of protocol tree.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data parent widget
|
|
|
|
* @param filt_nr 1-10: use filter for color 1-10
|
|
|
|
* 0: open new colorization rule dialog
|
|
|
|
* 255: clear filters for color 1-10
|
|
|
|
*/
|
|
|
|
extern void colorize_selected_ptree_cb(GtkWidget *w, gpointer data, guint8 filt_nr);
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested one of "Apply as Filter" or "Prepare a Filter" functions
|
|
|
|
* by context menu of packet list.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data parent widget
|
|
|
|
* @param action the function to use
|
|
|
|
*/
|
|
|
|
extern void match_selected_plist_cb(GtkWidget *widget, gpointer data, MATCH_SELECTED_E action);
|
|
|
|
|
|
|
|
/** User requested "Quit" by menu or toolbar.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void file_quit_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Print" by menu or toolbar.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void file_print_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2005-01-24 19:33:47 +00:00
|
|
|
/** User requested "Print" by packet list context menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void file_print_selected_cmd_cb(GtkWidget *widget _U_, gpointer data _U_);
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested "Export as Plain Text" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void export_text_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Export as Postscript" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void export_ps_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Export as PSML" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void export_psml_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Export as PDML" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void export_pdml_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2005-03-11 20:56:31 +00:00
|
|
|
/** User requested "Export as CSV" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void export_csv_cmd_cb(GtkWidget *widget, gpointer data);
|
2008-03-11 18:23:16 +00:00
|
|
|
|
|
|
|
/** User requested "Export as C Arrays" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void export_carrays_cmd_cb(GtkWidget *widget, gpointer data);
|
2005-03-11 20:56:31 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested "Expand Tree" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void expand_tree_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Expand All" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void expand_all_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Collapse All" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void collapse_all_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Resolve Name" by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
extern void resolve_name_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** Action to take for reftime_frame_cb() */
|
|
|
|
typedef enum {
|
|
|
|
REFTIME_TOGGLE, /**< toggle ref frame */
|
|
|
|
REFTIME_FIND_NEXT, /**< find next ref frame */
|
2004-06-21 10:53:35 +00:00
|
|
|
REFTIME_FIND_PREV /**< find previous ref frame */
|
2004-06-01 17:33:37 +00:00
|
|
|
} REFTIME_ACTION_E;
|
|
|
|
|
|
|
|
/** User requested one of the "Time Reference" functions by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
* @param action the function to use
|
|
|
|
*/
|
|
|
|
extern void reftime_frame_cb(GtkWidget *widget, gpointer data, REFTIME_ACTION_E action);
|
|
|
|
|
2006-06-12 19:35:26 +00:00
|
|
|
/** User requested the "Find Next Mark" function by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
* @param action unused
|
|
|
|
*/
|
|
|
|
extern void find_next_mark_cb(GtkWidget *widget, gpointer data, int action);
|
|
|
|
|
|
|
|
/** User requested the "Find Previous Mark" function by menu.
|
|
|
|
*
|
|
|
|
* @param widget parent widget (unused)
|
|
|
|
* @param data unused
|
|
|
|
* @param action unused
|
|
|
|
*/
|
|
|
|
extern void find_prev_mark_cb(GtkWidget *widget, gpointer data, int action);
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** Add a display filter coming from the user's recent file to the dfilter combo box.
|
|
|
|
*
|
|
|
|
* @param dftext the filter string
|
|
|
|
*/
|
|
|
|
extern gboolean dfilter_combo_add_recent(gchar *dftext);
|
|
|
|
|
|
|
|
/** Empty out the combobox entry field */
|
2004-01-25 18:51:26 +00:00
|
|
|
extern void dfilter_combo_add_empty(void);
|
2004-06-01 17:33:37 +00:00
|
|
|
|
2008-01-31 19:50:38 +00:00
|
|
|
/** Write all non empty display filters (until maximum count)
|
2004-06-01 17:33:37 +00:00
|
|
|
* of the combo box GList to the user's recent file.
|
|
|
|
*
|
|
|
|
* @param rf the recent file
|
|
|
|
*/
|
2004-01-19 00:42:12 +00:00
|
|
|
extern void dfilter_recent_combo_write_all(FILE *rf);
|
2003-12-13 18:01:30 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** Quit the program.
|
|
|
|
*
|
|
|
|
* @return TRUE, if a file read is in progress
|
|
|
|
*/
|
2004-01-29 23:11:38 +00:00
|
|
|
extern gboolean main_do_quit(void);
|
2004-06-01 17:33:37 +00:00
|
|
|
|
|
|
|
/** Rearrange the main window widgets, user changed it's preferences. */
|
2004-01-19 00:42:12 +00:00
|
|
|
extern void main_widgets_rearrange(void);
|
2004-06-01 17:33:37 +00:00
|
|
|
|
|
|
|
/** Show or hide the main window widgets, user changed it's preferences. */
|
2004-05-04 20:49:33 +00:00
|
|
|
extern void main_widgets_show_or_hide(void);
|
2004-06-01 17:33:37 +00:00
|
|
|
|
2008-01-31 19:50:38 +00:00
|
|
|
/** Apply a new filter string.
|
2005-02-04 18:44:44 +00:00
|
|
|
* Call cf_filter_packets() and add this filter string to the recent filter list.
|
2004-06-01 17:33:37 +00:00
|
|
|
*
|
|
|
|
* @param cf the capture file
|
|
|
|
* @param dftext the new filter string
|
|
|
|
* @param force force the refiltering, even if filter string doesn't changed
|
|
|
|
* @return TRUE, if the filtering succeeded
|
|
|
|
*/
|
2004-02-23 22:48:52 +00:00
|
|
|
extern gboolean main_filter_packets(capture_file *cf, const gchar *dftext,
|
|
|
|
gboolean force);
|
2004-06-01 17:33:37 +00:00
|
|
|
|
2004-05-13 15:28:02 +00:00
|
|
|
#ifdef _WIN32
|
2004-06-01 17:33:37 +00:00
|
|
|
/** Win32 only: Create a console. Beware: cannot be closed again. */
|
2004-05-13 15:28:02 +00:00
|
|
|
extern void create_console(void);
|
|
|
|
#endif
|
2003-12-13 18:01:30 +00:00
|
|
|
|
2008-01-14 16:40:23 +00:00
|
|
|
/** Fill in capture options with values from the preferences */
|
2006-11-16 07:04:02 +00:00
|
|
|
extern void prefs_to_capture_opts(void);
|
|
|
|
|
2008-01-14 16:40:23 +00:00
|
|
|
/** Change configuration profile */
|
|
|
|
extern void change_configuration_profile(const gchar *profile_name);
|
|
|
|
|
2009-05-04 21:13:14 +00:00
|
|
|
/** redissect packets and update UI */
|
|
|
|
extern void redissect_packets(void);
|
|
|
|
|
2007-06-04 20:15:10 +00:00
|
|
|
extern GtkWidget *pkt_scrollw;
|
|
|
|
|
1999-10-08 07:29:42 +00:00
|
|
|
#endif /* __MAIN_H__ */
|