6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 /** @defgroup main_window_group Main window
31 * The main window has the following submodules:
33 digraph main_dependencies {
34 node [shape=record, fontname=Helvetica, fontsize=10];
35 main [ label="main window" URL="\ref main.h"];
36 menu [ label="menubar" URL="\ref menus.h"];
37 toolbar [ label="toolbar" URL="\ref main_toolbar.h"];
38 packet_list [ label="packet list pane" URL="\ref new_packet_list.h"];
39 proto_draw [ label="packet details & bytes panes" URL="\ref main_proto_draw.h"];
40 recent [ label="recent user settings" URL="\ref recent.h"];
41 main -> menu [ arrowhead="open", style="solid" ];
42 main -> toolbar [ arrowhead="open", style="solid" ];
43 main -> packet_list [ arrowhead="open", style="solid" ];
44 main -> proto_draw [ arrowhead="open", style="solid" ];
45 main -> recent [ arrowhead="open", style="solid" ];
51 * The main window, filter toolbar, program start/stop and a lot of other things
52 * @ingroup main_window_group
53 * @ingroup windows_group
56 /** Global compile time version string */
57 extern GString *comp_info_str;
58 /** Global runtime version string */
59 extern GString *runtime_info_str;
61 extern GtkWidget* airpcap_tb;
63 extern void protect_thread_critical_region(void);
64 extern void unprotect_thread_critical_region(void);
67 airpcap_toolbar_encryption_cb(GtkWidget *entry, gpointer user_data);
69 /** User requested "Zoom In" by menu or toolbar.
71 * @param widget parent widget (unused)
74 extern void view_zoom_in_cb(GtkWidget *widget, gpointer data);
76 /** User requested "Zoom Out" by menu or toolbar.
78 * @param widget parent widget (unused)
81 extern void view_zoom_out_cb(GtkWidget *widget, gpointer data);
83 /** User requested "Zoom 100%" by menu or toolbar.
85 * @param widget parent widget (unused)
88 extern void view_zoom_100_cb(GtkWidget *widget, gpointer data);
90 /** User requested "Protocol Info" by ptree context menu.
92 * @param widget parent widget (unused)
95 extern void selected_ptree_info_cb(GtkWidget *widget, gpointer data);
97 /** User requested "Filter Reference" by ptree context menu.
99 * @param widget parent widget (unused)
102 extern void selected_ptree_ref_cb(GtkWidget *widget, gpointer data);
104 /** "Apply as Filter" / "Prepare a Filter" action type. */
106 MATCH_SELECTED_REPLACE, /**< "Selected" */
107 MATCH_SELECTED_AND, /**< "and Selected" */
108 MATCH_SELECTED_OR, /**< "or Selected" */
109 MATCH_SELECTED_NOT, /**< "Not Selected" */
110 MATCH_SELECTED_AND_NOT, /**< "and not Selected" */
111 MATCH_SELECTED_OR_NOT /**< "or not Selected" */
114 /** mask MATCH_SELECTED_E values (internally used) */
115 #define MATCH_SELECTED_MASK 0x0ff
117 /** "bitwise or" this with MATCH_SELECTED_E value for instant apply instead of prepare only */
118 #define MATCH_SELECTED_APPLY_NOW 0x100
120 /** "bitwise or" this with MATCH_SELECTED_E value for copy to clipboard instead of prepare only */
121 #define MATCH_SELECTED_COPY_ONLY 0x200
123 /** User requested one of "Apply as Filter" or "Prepare a Filter" functions
124 * by menu or context menu of protocol tree.
126 * @param widget parent widget
127 * @param data parent widget
128 * @param action the function to use
130 extern void match_selected_ptree_cb(GtkWidget *widget, gpointer data, MATCH_SELECTED_E action);
132 /** "Copy ..." action type. */
134 COPY_SELECTED_DESCRIPTION, /**< "Copy Description" */
135 COPY_SELECTED_FIELDNAME, /**< "Copy Fieldname" */
136 COPY_SELECTED_VALUE /**< "Copy Value" */
139 /** User highlighted item in details window and then right clicked and selected the copy option
141 * @param w parent widget
142 * @param data parent widget
143 * @param action the function to use
145 extern void copy_selected_plist_cb(GtkWidget *w _U_, gpointer data, COPY_SELECTED_E action);
147 /** Set or remove a time reference on this frame
149 * @param set TRUE = set time ref, FALSE=unset time ref
150 * @param frame pointer to frame
151 * @param row row number
153 extern void set_frame_reftime(gboolean set, frame_data *frame, gint row);
155 /** User requested the colorize function
156 * by menu or context menu of protocol tree.
158 * @param w parent widget
159 * @param data parent widget
160 * @param filt_nr 1-10: use filter for color 1-10
161 * 0: open new colorization rule dialog
162 * 255: clear filters for color 1-10
164 extern void colorize_selected_ptree_cb(GtkWidget *w, gpointer data, guint8 filt_nr);
166 /** User requested one of "Apply as Filter" or "Prepare a Filter" functions
167 * by context menu of packet list.
169 * @param widget parent widget (unused)
170 * @param data parent widget
171 * @param action the function to use
173 extern void match_selected_plist_cb(GtkWidget *widget, gpointer data, MATCH_SELECTED_E action);
175 /** User requested "Quit" by menu or toolbar.
177 * @param widget parent widget (unused)
180 extern void file_quit_cmd_cb(GtkWidget *widget, gpointer data);
182 /** User requested "Print" by menu or toolbar.
184 * @param widget parent widget (unused)
187 extern void file_print_cmd_cb(GtkWidget *widget, gpointer data);
189 /** User requested "Print" by packet list context menu.
191 * @param widget parent widget (unused)
194 extern void file_print_selected_cmd_cb(GtkWidget *widget _U_, gpointer data _U_);
196 /** User requested "Export as Plain Text" by menu.
198 * @param widget parent widget (unused)
201 extern void export_text_cmd_cb(GtkWidget *widget, gpointer data);
203 /** User requested "Export as Postscript" by menu.
205 * @param widget parent widget (unused)
208 extern void export_ps_cmd_cb(GtkWidget *widget, gpointer data);
210 /** User requested "Export as PSML" by menu.
212 * @param widget parent widget (unused)
215 extern void export_psml_cmd_cb(GtkWidget *widget, gpointer data);
217 /** User requested "Export as PDML" by menu.
219 * @param widget parent widget (unused)
222 extern void export_pdml_cmd_cb(GtkWidget *widget, gpointer data);
224 /** User requested "Export as CSV" by menu.
226 * @param widget parent widget (unused)
229 extern void export_csv_cmd_cb(GtkWidget *widget, gpointer data);
231 /** User requested "Export as C Arrays" by menu.
233 * @param widget parent widget (unused)
236 extern void export_carrays_cmd_cb(GtkWidget *widget, gpointer data);
238 /** User requested "Expand Tree" by menu.
240 * @param widget parent widget (unused)
243 extern void expand_tree_cb(GtkWidget *widget, gpointer data);
245 /** User requested "Expand All" by menu.
247 * @param widget parent widget (unused)
250 extern void expand_all_cb(GtkWidget *widget, gpointer data);
252 /** User requested "Apply as a custom column" by menu.
254 * @param widget parent widget (unused)
257 extern void apply_as_custom_column_cb(GtkWidget *widget, gpointer data);
259 /** User requested "Collapse All" by menu.
261 * @param widget parent widget (unused)
264 extern void collapse_all_cb(GtkWidget *widget, gpointer data);
266 /** User requested "Resolve Name" by menu.
268 * @param widget parent widget (unused)
271 extern void resolve_name_cb(GtkWidget *widget, gpointer data);
273 /** Action to take for reftime_frame_cb() */
275 REFTIME_TOGGLE, /**< toggle ref frame */
276 REFTIME_FIND_NEXT, /**< find next ref frame */
277 REFTIME_FIND_PREV /**< find previous ref frame */
280 /** User requested one of the "Time Reference" functions by menu.
282 * @param widget parent widget (unused)
284 * @param action the function to use
286 extern void reftime_frame_cb(GtkWidget *widget, gpointer data, REFTIME_ACTION_E action);
288 /** User requested the "Find Next Mark" function by menu.
290 * @param widget parent widget (unused)
292 * @param action unused
294 extern void find_next_mark_cb(GtkWidget *widget, gpointer data, int action);
296 /** User requested the "Find Previous Mark" function by menu.
298 * @param widget parent widget (unused)
300 * @param action unused
302 extern void find_prev_mark_cb(GtkWidget *widget, gpointer data, int action);
304 /** Add a display filter coming from the user's recent file to the dfilter combo box.
306 * @param dftext the filter string
308 extern gboolean dfilter_combo_add_recent(gchar *dftext);
311 /** Empty out the combobox entry field */
312 extern void dfilter_combo_add_empty(void);
314 /** Write all non empty display filters (until maximum count)
315 * of the combo box GList to the user's recent file.
317 * @param rf the recent file
319 extern void dfilter_recent_combo_write_all(FILE *rf);
321 /** Quit the program.
323 * @return TRUE, if a file read is in progress
325 extern gboolean main_do_quit(void);
327 /** Rearrange the main window widgets, user changed it's preferences. */
328 extern void main_widgets_rearrange(void);
330 /** Show or hide the main window widgets, user changed it's preferences. */
331 extern void main_widgets_show_or_hide(void);
333 /** Apply a new filter string.
334 * Call cf_filter_packets() and add this filter string to the recent filter list.
336 * @param cf the capture file
337 * @param dftext the new filter string
338 * @param force force the refiltering, even if filter string doesn't changed
339 * @return TRUE, if the filtering succeeded
341 extern gboolean main_filter_packets(capture_file *cf, const gchar *dftext,
345 /** Win32 only: Create a console. Beware: cannot be closed again. */
346 extern void create_console(void);
350 /** Restart the tap update display timer with new configured interval */
351 extern void reset_tap_update_timer(void);
354 /** Fill in capture options with values from the preferences */
355 extern void prefs_to_capture_opts(void);
357 /** Change configuration profile */
358 extern void change_configuration_profile(const gchar *profile_name);
360 /** redissect packets and update UI */
361 extern void redissect_packets(void);
363 /** Fetch all IP addresses from selected row */
364 extern GList *get_ip_address_list_from_packet_list_row(gpointer data);
366 extern GtkWidget *pkt_scrollw;
368 #endif /* __MAIN_H__ */