Wireshark-commits: [Wireshark-commits] master e4379f0: Dumpcap: print closed ring-buffer file names

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 8 Aug 2020 08:04:26 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=e4379f0ea1ae75045cd7969b18bd40c9f3fefa6c
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

e4379f0 by David Perry (boolean263@xxxxxxxxxxxxxx):

    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@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  a9f39a2   QUIC: add STREAM data reassembly support
     add  e4379f0   Dumpcap: print closed ring-buffer file names


Summary of changes:
 capture_opts.c  |  6 ++++++
 capture_opts.h  |  3 +++
 doc/dumpcap.pod |  4 ++++
 dumpcap.c       | 12 ++++++++++++
 ringbuffer.c    | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 ringbuffer.h    |  1 +
 6 files changed, 76 insertions(+)