diff options
author | David Perry <boolean263@protonmail.com> | 2020-07-29 09:36:19 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-08-08 08:04:13 +0000 |
commit | e4379f0ea1ae75045cd7969b18bd40c9f3fefa6c (patch) | |
tree | ea24bdac5d74a6897e6c842e0ae32f4e6f7fa656 /ringbuffer.h | |
parent | a9f39a29fe57fd7b1531f243fa278fd8c0fdab3e (diff) | |
download | wireshark-e4379f0ea1ae75045cd7969b18bd40c9f3fefa6c.tar.gz wireshark-e4379f0ea1ae75045cd7969b18bd40c9f3fefa6c.tar.bz2 wireshark-e4379f0ea1ae75045cd7969b18bd40c9f3fefa6c.zip |
Dumpcap: print closed ring-buffer file names
This proposal adds a new option '-b printname:<filename>' to dumpcap. If
used, dumpcap will print the name of each ring buffer file it creates
after it is closed. Allows the use of '-'/'stdout' and 'stderr'.
Use case: Since the file name is printed after the file is closed for
writing, an automated capture process can do something like the
following with the guarantee that the file in question will not be
changed.
dumpcap -i eth0 -b files:2 -b printname:stdout [-b ...] | \
while read cap_file_name ; do
# Do something with $cap_file_name
done
This sort of scripting is difficult in dumpcap's current form. Dumpcap
prints the names of new files to stderr as it *opens* them, so a script
attempting to use this must sleep for "-b duration:value" seconds plus
some fudge time to be sure it's getting a closed, unchanging file.
Change-Id: Idb288cc7c8c30443256d35c8cd4460a2e3f0861c
Reviewed-on: https://code.wireshark.org/review/37994
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ringbuffer.h')
-rw-r--r-- | ringbuffer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ringbuffer.h b/ringbuffer.h index 4c1a3baaa9..d95dff2636 100644 --- a/ringbuffer.h +++ b/ringbuffer.h @@ -32,6 +32,7 @@ gboolean ringbuf_switch_file(FILE **pdh, gchar **save_file, int *save_file_fd, gboolean ringbuf_libpcap_dump_close(gchar **save_file, int *err); void ringbuf_free(void); void ringbuf_error_cleanup(void); +gboolean ringbuf_set_print_name(gchar *name, int *err); #endif /* ringbuffer.h */ |