/* open the info */
-void capture_info_open(capture_opts *capture_opts)
+void capture_info_open(capture_options *capture_opts)
{
info_data.counts.total = 0;
info_data.counts.sctp = 0;
#ifndef __CAPTURE_INFO_H__
#define __CAPTURE_INFO_H__
+#include "capture_opts.h"
/* open the info - init values (wtap, counts), create dialog */
-extern void capture_info_open(capture_opts *capture_opts);
+extern void capture_info_open(capture_options *capture_opts);
/* new file arrived - (eventually close old wtap), open wtap */
extern gboolean capture_info_new_file(const char *new_filename);
/** Create the capture info dialog */
extern void capture_info_ui_create(
capture_info *cinfo,
-capture_opts *capture_opts);
+capture_options *capture_opts);
/** Update the capture info counters in the dialog */
extern void capture_info_ui_update(
#ifndef __CAPTURE_OPTS_H__
#define __CAPTURE_OPTS_H__
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h> /* for gid_t */
+#endif
+
/* Current state of capture engine. XXX - differentiate states */
typedef enum {
airpcap_gui_utils.h \
capture_dlg.h \
capture_file_dlg.h \
+ capture_globals.h \
cfilter_combo_utils.h \
color_dlg.h \
color_edit_dlg.h \
#include "gtk/capture_file_dlg.h"
#include "gtk/help_dlg.h"
#include "gtk/gtkglobals.h"
+#include "gtk/capture_globals.h"
#include "gtk/cfilter_combo_utils.h"
#ifdef _WIN32
--- /dev/null
+/* capture_globals.h
+ * Capture-related globals.
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __CAPTURE_GLOBALS_H__
+#define __CAPTURE_GLOBALS_H__
+
+extern capture_options global_capture_opts;
+
+#endif /* __CAPTURE_GLOBALS_H__ */
#include "gtk/help_dlg.h"
#include "gtk/keys.h"
#include "gtk/webbrowser.h"
+#include "gtk/capture_globals.h"
#ifdef HAVE_AIRPCAP
#include "../image/toolbar/capture_airpcap_16.xpm"
static gboolean
capture_info_delete_cb(GtkWidget *w _U_, GdkEvent *event _U_, gpointer data) {
- capture_opts *capture_opts = data;
+ capture_options *capture_opts = data;
#ifdef HAVE_AIRPCAP
airpcap_set_toolbar_stop_capture(airpcap_if_active);
#endif
/* will keep pointers to the fields in the counts parameter */
void capture_info_ui_create(
capture_info *cinfo,
-capture_opts *capture_opts)
+capture_options *capture_opts)
{
unsigned int i;
GtkWidget *main_vb, *stop_bt, *counts_tb;
#include "gtk/drag_and_drop.h"
#include "gtk/main.h"
#include "gtk/main_menu.h"
+#include "gtk/capture_globals.h"
enum { DND_TARGET_STRING, DND_TARGET_ROOTWIN, DND_TARGET_URL };
GtkSelectionData *selection_data, guint info, guint t _U_, gpointer data _U_)
{
gpointer dialog;
- gchar *cf_names_freeme;
+ gchar *cf_names_freeme;
if (info == DND_TARGET_URL) {
/* Usually we block incoming events by disabling the corresponding menu/toolbar items.
#ifdef HAVE_LIBPCAP
/* if a capture is running, do nothing but warn the user */
- if((capture_opts->state != CAPTURE_STOPPED)) {
+ if((global_capture_opts.state != CAPTURE_STOPPED)) {
dialog = simple_dialog(ESD_TYPE_CONFIRMATION,
ESD_BTN_OK,
"%sDrag and Drop currently not possible!%s\n\n"
/** Change configuration profile */
extern void change_configuration_profile(const gchar *profile_name);
-#ifdef HAVE_LIBPCAP
-extern capture_opts global_capture_opts;
-#endif
-
extern GtkWidget *pkt_scrollw;
#endif /* __MAIN_H__ */
#include "gtk/main_statusbar.h"
#include "gtk/gui_utils.h"
#include "gtk/gtkglobals.h"
+#include "gtk/capture_globals.h"
#include "gtk/expert_comp_dlg.h"
#include "gtk/profile_dlg.h"
statusbar_pop_file_msg();
- if(global_capture_opts.iface) {
+ if(capture_opts->iface) {
capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s",
- get_iface_description(&global_capture_opts),
- (global_capture_opts.save_file) ? global_capture_opts.save_file : "");
+ get_iface_description(capture_opts),
+ (capture_opts->save_file) ? capture_opts->save_file : "");
} else {
capture_msg = g_strdup_printf(" <live capture in progress> to file: %s",
- (global_capture_opts.save_file) ? global_capture_opts.save_file : "");
+ (capture_opts->save_file) ? capture_opts->save_file : "");
}
statusbar_push_file_msg(capture_msg);
statusbar_pop_file_msg();
capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s",
- get_iface_description(&global_capture_opts),
- (global_capture_opts.save_file) ? global_capture_opts.save_file : "");
+ get_iface_description(capture_opts),
+ (capture_opts->save_file) ? capture_opts->save_file : "");
statusbar_push_file_msg(capture_msg);
gtk_statusbar_push(GTK_STATUSBAR(packets_bar), packets_ctx, " Packets: 0");
#include "gtk/capture_file_dlg.h"
#include "gtk/help_dlg.h"
#include "gtk/stock_icons.h"
+#include "gtk/capture_globals.h"
#include "../image/wssplash.xpm"
static gboolean
welcome_if_press_cb(GtkWidget *widget _U_, GdkEvent *event _U_, gpointer data)
{
- if (capture_opts->iface)
- g_free(capture_opts->iface);
- if (capture_opts->iface_descr)
- g_free(capture_opts->iface_descr);
+ if (global_capture_opts.iface)
+ g_free(global_capture_opts.iface);
+ if (global_capture_opts.iface_descr)
+ g_free(global_capture_opts.iface_descr);
- capture_opts->iface = g_strdup(data);
- capture_opts->iface_descr = NULL;
+ global_capture_opts.iface = g_strdup(data);
+ global_capture_opts.iface_descr = NULL;
/* XXX - fix this */
- /*capture_opts->iface_descr = get_interface_descriptive_name(capture_opts->iface);*/
+ /*global_capture_opts.iface_descr = get_interface_descriptive_name(global_capture_opts.iface);*/
/* XXX - remove this? */
- if (capture_opts->save_file) {
- g_free(capture_opts->save_file);
- capture_opts->save_file = NULL;
+ if (global_capture_opts.save_file) {
+ g_free(global_capture_opts.save_file);
+ global_capture_opts.save_file = NULL;
}
capture_start_cb(NULL, NULL);
#ifdef HAVE_LIBPCAP
#include "../capture.h"
#include "gtk/main.h"
+#include "gtk/capture_globals.h"
#endif
#include "gtk/summary_dlg.h"
/* initial computations */
summary_fill_in(&cfile, &summary);
#ifdef HAVE_LIBPCAP
- summary_fill_in_capture(capture_opts, &summary);
+ summary_fill_in_capture(&global_capture_opts, &summary);
#endif
seconds = summary.stop_time - summary.start_time;
disp_seconds = summary.filtered_stop - summary.filtered_start;