4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include "capture_opts.h"
29 /** Global compile time version string */
30 extern void get_wireshark_gtk_compiled_info(GString *str);
31 extern void get_gui_compiled_info(GString *str);
32 /** Global runtime version string */
33 extern void get_wireshark_runtime_info(GString *str);
36 extern GtkWidget* wireless_tb;
39 airpcap_toolbar_encryption_cb(GtkWidget *entry, gpointer user_data);
41 /** User requested "Zoom In" by menu or toolbar.
43 * @param widget parent widget (unused)
46 extern void view_zoom_in_cb(GtkWidget *widget, gpointer data);
48 /** User requested "Zoom Out" by menu or toolbar.
50 * @param widget parent widget (unused)
53 extern void view_zoom_out_cb(GtkWidget *widget, gpointer data);
55 /** User requested "Zoom 100%" by menu or toolbar.
57 * @param widget parent widget (unused)
60 extern void view_zoom_100_cb(GtkWidget *widget, gpointer data);
62 /** User requested "Protocol Info" by ptree context menu.
64 * @param widget parent widget (unused)
67 extern void selected_ptree_info_cb(GtkWidget *widget, gpointer data);
69 /** User requested "Filter Reference" by ptree context menu.
71 * @param widget parent widget (unused)
74 extern void selected_ptree_ref_cb(GtkWidget *widget, gpointer data);
76 /** "Apply as Filter" / "Prepare a Filter" action type. */
78 MATCH_SELECTED_REPLACE, /**< "Selected" */
79 MATCH_SELECTED_AND, /**< "and Selected" */
80 MATCH_SELECTED_OR, /**< "or Selected" */
81 MATCH_SELECTED_NOT, /**< "Not Selected" */
82 MATCH_SELECTED_AND_NOT, /**< "and not Selected" */
83 MATCH_SELECTED_OR_NOT /**< "or not Selected" */
86 /** mask MATCH_SELECTED_E values (internally used) */
87 #define MATCH_SELECTED_MASK 0x0ff
89 /** "bitwise or" this with MATCH_SELECTED_E value for instant apply instead of prepare only */
90 #define MATCH_SELECTED_APPLY_NOW 0x100
92 /** "bitwise or" this with MATCH_SELECTED_E value for copy to clipboard instead of prepare only */
93 #define MATCH_SELECTED_COPY_ONLY 0x200
95 /** User requested one of "Apply as Filter" or "Prepare a Filter" functions
96 * by menu or context menu of protocol tree.
98 * @param data parent widget
99 * @param action the function to use
101 extern void match_selected_ptree_cb(gpointer data, MATCH_SELECTED_E action);
103 /** "Copy ..." action type. */
105 COPY_SELECTED_DESCRIPTION, /**< "Copy Description" */
106 COPY_SELECTED_FIELDNAME, /**< "Copy Fieldname" */
107 COPY_SELECTED_VALUE /**< "Copy Value" */
110 /** User highlighted item in details window and then right clicked and selected the copy option
112 * @param w parent widget
113 * @param data parent widget
114 * @param action the function to use
116 extern void copy_selected_plist_cb(GtkWidget *w _U_, gpointer data, COPY_SELECTED_E action);
118 /** Set or remove a time reference on this frame
120 * @param set TRUE = set time ref, FALSE=unset time ref
121 * @param frame pointer to frame
122 * @param row row number
124 extern void set_frame_reftime(gboolean set, frame_data *frame, gint row);
126 /** User requested the colorize function
127 * by menu or context menu of protocol tree.
129 * @param w parent widget
130 * @param data parent widget
131 * @param filt_nr 1-10: use filter for color 1-10
132 * 0: open new colorization rule dialog
133 * 255: clear filters for color 1-10
135 extern void colorize_selected_ptree_cb(GtkWidget *w, gpointer data, guint8 filt_nr);
137 /** User requested one of "Apply as Filter" or "Prepare a Filter" functions
138 * by context menu of packet list.
140 * @param data parent widget
141 * @param action the function to use
143 extern void match_selected_plist_cb(gpointer data, MATCH_SELECTED_E action);
145 /** User requested "Quit" by menu or toolbar.
147 * @param widget parent widget (unused)
150 extern void file_quit_cmd_cb(GtkWidget *widget, gpointer data);
152 /** User requested "Print" by menu or toolbar.
154 * @param widget parent widget (unused)
157 extern void file_print_cmd_cb(GtkWidget *widget, gpointer data);
159 /** User requested "Print" by packet list context menu.
161 * @param widget parent widget (unused)
164 extern void file_print_selected_cmd_cb(GtkWidget *widget _U_, gpointer data _U_);
166 /** User requested "Export as Plain Text" by menu.
168 * @param widget parent widget (unused)
171 extern void export_text_cmd_cb(GtkWidget *widget, gpointer data);
173 /** User requested "Export as Postscript" by menu.
175 * @param widget parent widget (unused)
178 extern void export_ps_cmd_cb(GtkWidget *widget, gpointer data);
180 /** User requested "Export as PSML" by menu.
182 * @param widget parent widget (unused)
185 extern void export_psml_cmd_cb(GtkWidget *widget, gpointer data);
187 /** User requested "Export as PDML" by menu.
189 * @param widget parent widget (unused)
192 extern void export_pdml_cmd_cb(GtkWidget *widget, gpointer data);
194 /** User requested "Export as CSV" by menu.
196 * @param widget parent widget (unused)
199 extern void export_csv_cmd_cb(GtkWidget *widget, gpointer data);
201 /** User requested "Export as C Arrays" by menu.
203 * @param widget parent widget (unused)
206 extern void export_carrays_cmd_cb(GtkWidget *widget, gpointer data);
208 /** User requested "Export as JSON" by menu.
210 * @param widget parent widget (unused)
213 extern void export_json_cmd_cb(GtkWidget *widget, gpointer data);
215 /** User requested "Expand Tree" by menu.
217 * @param widget parent widget (unused)
220 extern void expand_tree_cb(GtkWidget *widget, gpointer data);
222 /** User requested "Collapse Tree" by menu.
224 * @param widget parent widget (unused)
227 extern void collapse_tree_cb(GtkWidget *widget, gpointer data);
229 /** User requested "Expand All" by menu.
231 * @param widget parent widget (unused)
234 extern void expand_all_cb(GtkWidget *widget, gpointer data);
236 /** User requested "Apply as a custom column" by menu.
238 * @param widget parent widget (unused)
241 extern void apply_as_custom_column_cb(GtkWidget *widget, gpointer data);
243 /** User requested "Collapse All" by menu.
245 * @param widget parent widget (unused)
248 extern void collapse_all_cb(GtkWidget *widget, gpointer data);
250 /** User requested "Resolve Name" by menu.
252 * @param widget parent widget (unused)
255 extern void resolve_name_cb(GtkWidget *widget, gpointer data);
257 /** Action to take for reftime_frame_cb() */
259 REFTIME_TOGGLE, /**< toggle ref frame */
260 REFTIME_FIND_NEXT, /**< find next ref frame */
261 REFTIME_FIND_PREV /**< find previous ref frame */
264 /** User requested one of the "Time Reference" functions by menu.
266 * @param widget parent widget (unused)
268 * @param action the function to use
270 extern void reftime_frame_cb(GtkWidget *widget, gpointer data, REFTIME_ACTION_E action);
272 /** User requested the "Find Next Mark" function by menu.
274 * @param widget parent widget (unused)
276 * @param action unused
278 extern void find_next_mark_cb(GtkWidget *widget, gpointer data, int action);
280 /** User requested the "Find Previous Mark" function by menu.
282 * @param widget parent widget (unused)
284 * @param action unused
286 extern void find_prev_mark_cb(GtkWidget *widget, gpointer data, int action);
289 /** Empty out the combobox entry field */
290 extern void dfilter_combo_add_empty(void);
293 /** Update various parts of the main window for a capture file "unsaved
296 * @param cf capture_file structure for the capture file.
298 extern void main_update_for_unsaved_changes(capture_file *cf);
301 /** Update various parts of the main window for a change in whether
302 * "auto scroll in live capture" is on or off.
304 * @param auto_scroll_live_in new state of "auto scroll in live capture"
306 void main_auto_scroll_live_changed(gboolean auto_scroll_live_in);
309 /** Update parts of the main window for a change in colorization. */
310 extern void main_colorize_changed(gboolean packet_list_colorize);
312 /** Quit the program.
314 * @return TRUE, if a file read is in progress
316 extern gboolean main_do_quit(void);
318 /** Rearrange the main window widgets, user changed its preferences. */
319 extern void main_widgets_rearrange(void);
321 /** Show or hide the main window widgets, user changed its preferences. */
322 extern void main_widgets_show_or_hide(void);
324 /* Update main window items based on whether we have a packet history. */
325 extern void main_set_for_packet_history(gboolean back_history, gboolean forward_history);
327 /** Apply a new filter string.
328 * Call cf_filter_packets() and add this filter string to the recent filter list.
330 * @param cf the capture file
331 * @param dftext the new filter string
332 * @param force force the refiltering, even if filter string doesn't changed
333 * @return TRUE, if the filtering succeeded
335 extern gboolean main_filter_packets(capture_file *cf, const gchar *dftext,
339 /** Win32 only: Create a console. Beware: cannot be closed again. */
340 extern void create_console(void);
343 /** Change configuration profile */
344 extern void change_configuration_profile(const gchar *profile_name);
346 /** Update GUI for changes in fields */
347 extern void main_fields_changed (void);
349 /** redissect packets and update UI */
350 extern void redissect_packets(void);
352 /** Fetch all IP addresses from selected row */
353 extern GList *get_ip_address_list_from_packet_list_row(gpointer data);
355 extern GtkWidget *pkt_scrollw;
357 #endif /* __MAIN_H__ */