forked from osmocom/wireshark
move quit_after_cap into capture_opts
svn path=/trunk/; revision=12449
This commit is contained in:
parent
113ed3e788
commit
bdfe1d7fc8
|
@ -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();
|
||||
}
|
||||
|
|
12
capture.h
12
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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue