From abfa590fe53ef4be90930f4f7625f34530a3eaf8 Mon Sep 17 00:00:00 2001 From: ulfl Date: Sat, 30 Oct 2004 14:30:52 +0000 Subject: [PATCH] move quit_after_cap into capture_opts git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12449 f5534014-38df-0310-8fa8-9805f1628bb7 --- capture.c | 3 +-- capture.h | 12 ++++++++---- gtk/main.c | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/capture.c b/capture.c index e59899b531..31c128a034 100644 --- a/capture.c +++ b/capture.c @@ -173,7 +173,6 @@ * Capture options. */ capture_options capture_opts; -gboolean quit_after_cap = FALSE;/* Makes a "capture only mode". Implies -k */ gboolean capture_child; /* if this is the child for "-S" */ @@ -307,7 +306,7 @@ normal_do_capture(gboolean is_tempfile) /* Not sync mode. */ capture_succeeded = capture(&stats_known, &stats); - if (quit_after_cap) { + if (capture_opts.quit_after_cap) { /* DON'T unlink the save file. Presumably someone wants it. */ main_window_exit(); } diff --git a/capture.h b/capture.h index 0ebede639b..1462ad2bf5 100644 --- a/capture.h +++ b/capture.h @@ -36,6 +36,7 @@ /** Capture options coming from user interface */ typedef struct { + /* general */ #ifdef _WIN32 int buffer_size; /**< the capture buffer size (MB) */ #endif @@ -45,16 +46,22 @@ typedef struct { int 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, and sync between them */ gboolean show_info; /**< show the info dialog */ + gboolean quit_after_cap; /** Makes a "capture only mode". Implies -k */ + /* multiple files (and ringbuffer) */ gboolean multi_files_on; /**< TRUE if ring buffer in use */ gboolean has_file_duration; /**< TRUE if ring duration specified */ gint32 file_duration; /* Switch file after n seconds */ gboolean has_ring_num_files;/**< TRUE if ring num_files specified */ guint32 ring_num_files; /**< Number of multiple buffer files */ + + /* autostop conditions */ gboolean has_autostop_files;/**< TRUE if maximum number of capture files are specified */ gint32 autostop_files; /**< Maximum number of capture files */ @@ -73,10 +80,7 @@ typedef struct { /** Global capture options. */ extern capture_options capture_opts; -/** Makes a "capture only mode". Implies -k */ -extern gboolean quit_after_cap; - -/** If this is the child for "-S" */ +/** True if this is the child for "-S" */ extern gboolean capture_child; /** Open a specified file, or create a temporary file, and start a capture diff --git a/gtk/main.c b/gtk/main.c index 259e1c2cd4..9ec98b499e 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1734,6 +1734,7 @@ main(int argc, char *argv[]) #ifdef _WIN32 capture_opts.buffer_size = 1; #endif + capture_opts.quit_after_cap = FALSE; capture_opts.has_autostop_packets = FALSE; capture_opts.autostop_packets = 1; @@ -1992,7 +1993,7 @@ main(int argc, char *argv[]) break; case 'Q': /* Quit after capture (just capture to file) */ #ifdef HAVE_LIBPCAP - quit_after_cap = TRUE; + capture_opts.quit_after_cap = TRUE; start_capture = TRUE; /*** -Q implies -k !! ***/ #else capture_option_specified = TRUE; -- 2.34.1