diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-02-06 00:13:00 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-02-06 00:13:00 +0000 |
commit | 97866a968b4c5bc273e986775cdc9cefe52c281f (patch) | |
tree | 3b581fbf16b7876759297cd33f0890c1df52b92d /capture.c | |
parent | a9cc1df5516feb8c160e78a0adf0f7cb89f7088e (diff) |
instead of initializing the capture_options in main.c, use the new function capture_opts_init
svn path=/trunk/; revision=13315
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -79,6 +79,41 @@ static gboolean normal_do_capture(capture_options *capture_opts, gboolean is_tem static void stop_capture_signal_handler(int signo); +void +capture_opts_init(capture_options *capture_opts, void *cfile) +{ + capture_opts->cf = cfile; +#ifdef _WIN32 + capture_opts->buffer_size = 1; /* 1 MB */ +#endif + capture_opts->has_snaplen = FALSE; + capture_opts->snaplen = MIN_PACKET_SIZE; + capture_opts->promisc_mode = TRUE; + capture_opts->linktype = -1; /* the default linktype */ + capture_opts->capture_child = FALSE; + capture_opts->save_file = NULL; + capture_opts->save_file_fd = -1; + capture_opts->sync_mode = TRUE; + capture_opts->show_info = TRUE; + capture_opts->quit_after_cap = FALSE; + + capture_opts->multi_files_on = FALSE; + capture_opts->has_file_duration = FALSE; + capture_opts->file_duration = 60; /* 1 min */ + capture_opts->has_ring_num_files = TRUE; + capture_opts->ring_num_files = 2; + + capture_opts->has_autostop_files = FALSE; + capture_opts->autostop_files = 1; + capture_opts->has_autostop_packets = FALSE; + capture_opts->autostop_packets = 1; + capture_opts->has_autostop_filesize = FALSE; + capture_opts->autostop_filesize = 1024 * 1024; /* 1 MB */ + capture_opts->has_autostop_duration = FALSE; + capture_opts->autostop_duration = 60; /* 1 min */ +} + + /* open the output file (temporary/specified name/ringbuffer) and close the old one */ /* Returns TRUE if the file opened successfully, FALSE otherwise. */ static gboolean |