diff options
author | Sake Blok <sake@euronet.nl> | 2017-06-27 22:04:33 +0200 |
---|---|---|
committer | Sake Blok <sake.blok@SYN-bit.nl> | 2017-07-03 16:41:37 +0000 |
commit | 3803e00367413260cbb543c3c4ed13ae2d8fd194 (patch) | |
tree | e96b7c81846caec9343201ea80e8afeee68dc80c /capture_opts.c | |
parent | 2c58ed569ed0c096d5640fd0da5825bcfef04aeb (diff) |
Add option to use wall-clock intervals
Add the "interval" option to "-b". Each new capture starts at the
exact start of a time interval. For instance, using -b interval:3600
will start a new capture file at each whole hour.
Changed the duration option in the GUI interfaces to use the new
interval option.
Change-Id: I0180c43843f5d2f0c2f50153c9ce42ac7fa5aeae
Reviewed-on: https://code.wireshark.org/review/22428
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Sake Blok <sake.blok@SYN-bit.nl>
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/capture_opts.c b/capture_opts.c index ef3e659850..92175ff78b 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -106,6 +106,8 @@ capture_opts_init(capture_options *capture_opts) capture_opts->multi_files_on = FALSE; capture_opts->has_file_duration = FALSE; capture_opts->file_duration = 60; /* 1 min */ + capture_opts->has_file_interval = FALSE; + capture_opts->file_interval = 60; /* 1 min */ capture_opts->has_ring_num_files = FALSE; capture_opts->ring_num_files = RINGBUFFER_MIN_NUM_FILES; @@ -240,6 +242,7 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio g_log(log_domain, log_level, "MultiFilesOn : %u", capture_opts->multi_files_on); g_log(log_domain, log_level, "FileDuration (%u) : %u", capture_opts->has_file_duration, capture_opts->file_duration); + g_log(log_domain, log_level, "FileInterval (%u) : %u", capture_opts->has_file_interval, capture_opts->file_interval); g_log(log_domain, log_level, "RingNumFiles (%u) : %u", capture_opts->has_ring_num_files, capture_opts->ring_num_files); g_log(log_domain, log_level, "AutostopFiles (%u) : %u", capture_opts->has_autostop_files, capture_opts->autostop_files); @@ -397,6 +400,9 @@ get_ring_arguments(capture_options *capture_opts, const char *arg) } else if (strcmp(arg,"duration") == 0) { capture_opts->has_file_duration = TRUE; capture_opts->file_duration = get_positive_int(p, "ring buffer duration"); + } else if (strcmp(arg,"interval") == 0) { + capture_opts->has_file_interval = TRUE; + capture_opts->file_interval = get_positive_int(p, "ring buffer interval"); } *colonp = ':'; /* put the colon back */ |