Skip to content

Commit

Permalink
move quit_after_cap into capture_opts
Browse files Browse the repository at this point in the history
svn path=/trunk/; revision=12449
  • Loading branch information
ulflulfl committed Oct 30, 2004
1 parent 113ed3e commit bdfe1d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 1 addition & 2 deletions capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" */


Expand Down Expand Up @@ -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();
}
Expand Down
12 changes: 8 additions & 4 deletions capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

/** Capture options coming from user interface */
typedef struct {
/* general */
#ifdef _WIN32
int buffer_size; /**< the capture buffer size (MB) */
#endif
Expand All @@ -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 */
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion gtk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bdfe1d7

Please sign in to comment.