From 3803e00367413260cbb543c3c4ed13ae2d8fd194 Mon Sep 17 00:00:00 2001 From: Sake Blok Date: Tue, 27 Jun 2017 22:04:33 +0200 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Sake Blok --- capchild/capture_sync.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'capchild') 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); -- cgit v1.2.1