aboutsummaryrefslogtreecommitdiffstats
path: root/capture.h
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2004-12-29 09:09:35 +0000
committerUlf Lamping <ulf.lamping@web.de>2004-12-29 09:09:35 +0000
commit2ed93e96bd6c630a9171ea5d5217098fbfa76746 (patch)
treede1cdbec9c926a405377e4e9006c3bfcd8d5161b /capture.h
parentf1deabed568a18c05afdca5f4898fc9e13f71e91 (diff)
Don't use a global capture_opts in the capturing engine (this isn't a good idea). Do some more "housekeeping" in the capturing part.
Hopefully the unspecified forward declaration of capture_options_t in main.h is portable, but buildbot will tell me. This way I need the internals of that struct only at the places I really use it. svn path=/trunk/; revision=12853
Diffstat (limited to 'capture.h')
-rw-r--r--capture.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/capture.h b/capture.h
index d9707a9fd5..bd4d5472a5 100644
--- a/capture.h
+++ b/capture.h
@@ -35,7 +35,7 @@
#ifdef HAVE_LIBPCAP
/** Capture options coming from user interface */
-typedef struct {
+typedef struct capture_options_tag {
/* general */
#ifdef _WIN32
int buffer_size; /**< the capture buffer size (MB) */
@@ -43,12 +43,12 @@ typedef struct {
gboolean has_snaplen; /**< TRUE if maximum capture packet
length is specified */
int snaplen; /**< Maximum captured packet length */
- int promisc_mode; /**< Capture in promiscuous mode */
+ gboolean promisc_mode; /**< Capture in promiscuous mode */
int linktype; /**< Data link type to use, or -1 for
"use default" */
/* GUI related */
- int sync_mode; /**< Fork a child to do the capture,
+ gboolean sync_mode; /**< Fork a child to do the capture,
and sync between them */
gboolean show_info; /**< show the info dialog */
gboolean quit_after_cap; /** Makes a "capture only mode". Implies -k */
@@ -77,9 +77,6 @@ typedef struct {
gint32 autostop_duration; /**< Maximum capture duration */
} capture_options;
-/** Global capture options. */
-extern capture_options capture_opts;
-
/** True if this is the child for "-S" */
extern gboolean capture_child;
@@ -88,19 +85,19 @@ extern gboolean capture_child;
* to the file in question.
*
* @return TRUE if the capture starts successfully, FALSE otherwise. */
-extern gboolean do_capture(const char *save_file);
+extern gboolean do_capture(capture_options *capture_opts, const char *save_file);
/** Do the low-level work of a capture (start the capture child). */
-extern int capture_start(gboolean *stats_known, struct pcap_stat *stats);
+extern int capture_start(capture_options *capture_opts, gboolean *stats_known, struct pcap_stat *stats);
/** Stop a capture from a menu item. */
-extern void capture_stop(void);
+extern void capture_stop(gboolean sync_mode);
/** Terminate the capture child cleanly when exiting. */
-extern void kill_capture_child(void);
+extern void kill_capture_child(gboolean sync_mode);
/** Do the low-level work of a capture. */
-extern int capture_loop_start(gboolean *stats_known, struct pcap_stat *stats);
+extern int capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct pcap_stat *stats);
/** Stop a low-level capture. */
extern void capture_loop_stop(void);