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 /capchild | |
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 'capchild')
-rw-r--r-- | capchild/capture_sync.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c index 6dc0fcb84a..96911bddae 100644 --- a/capchild/capture_sync.c +++ b/capchild/capture_sync.c @@ -205,6 +205,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf char scount[ARGV_NUMBER_LEN]; char sfilesize[ARGV_NUMBER_LEN]; char sfile_duration[ARGV_NUMBER_LEN]; + char sfile_interval[ARGV_NUMBER_LEN]; char sring_num_files[ARGV_NUMBER_LEN]; char sautostop_files[ARGV_NUMBER_LEN]; char sautostop_filesize[ARGV_NUMBER_LEN]; @@ -293,6 +294,12 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf argv = sync_pipe_add_arg(argv, &argc, sfile_duration); } + if (capture_opts->has_file_interval) { + argv = sync_pipe_add_arg(argv, &argc, "-b"); + g_snprintf(sfile_interval, ARGV_NUMBER_LEN, "interval:%d",capture_opts->file_interval); + argv = sync_pipe_add_arg(argv, &argc, sfile_interval); + } + if (capture_opts->has_ring_num_files) { argv = sync_pipe_add_arg(argv, &argc, "-b"); g_snprintf(sring_num_files, ARGV_NUMBER_LEN, "files:%d",capture_opts->ring_num_files); |