summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2017-06-27 22:04:33 +0200
committerSake Blok <sake.blok@SYN-bit.nl>2017-07-03 16:41:37 +0000
commit3803e00367413260cbb543c3c4ed13ae2d8fd194 (patch)
treee96b7c81846caec9343201ea80e8afeee68dc80c /tshark.c
parent2c58ed569ed0c096d5640fd0da5825bcfef04aeb (diff)
downloadwireshark-3803e00367413260cbb543c3c4ed13ae2d8fd194.tar.gz
Add option to use wall-clock intervalsHEADmaster
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 'tshark.c')
-rw-r--r--tshark.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tshark.c b/tshark.c
index 53871469ed..982c92bceb 100644
--- a/tshark.c
+++ b/tshark.c
@@ -364,6 +364,7 @@ print_usage(FILE *output)
/*fprintf(output, "\n");*/
fprintf(output, "Capture output:\n");
fprintf(output, " -b <ringbuffer opt.> ... duration:NUM - switch to next file after NUM secs\n");
+ fprintf(output, " interval:NUM - create time intervals of NUM secs\n");
fprintf(output, " filesize:NUM - switch to next file after NUM KB\n");
fprintf(output, " files:NUM - ringbuffer: replace after NUM files\n");
#endif /* HAVE_LIBPCAP */
@@ -1638,6 +1639,12 @@ main(int argc, char *argv[])
goto clean_exit;
}
if (global_capture_opts.has_file_duration) {
+ cmdarg_err("Switching capture files after a time period was specified, but "
+ "a capture isn't being done.");
+ exit_status = INVALID_OPTION;
+ goto clean_exit;
+ }
+ if (global_capture_opts.has_file_interval) {
cmdarg_err("Switching capture files after a time interval was specified, but "
"a capture isn't being done.");
exit_status = INVALID_OPTION;
@@ -1720,9 +1727,10 @@ main(int argc, char *argv[])
goto clean_exit;
}
if (!global_capture_opts.has_autostop_filesize &&
- !global_capture_opts.has_file_duration) {
+ !global_capture_opts.has_file_duration &&
+ !global_capture_opts.has_file_interval) {
cmdarg_err("Multiple capture files requested, but "
- "no maximum capture file size or duration was specified.");
+ "no maximum capture file size, duration or interval was specified.");
exit_status = INVALID_OPTION;
goto clean_exit;
}