aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.h
AgeCommit message (Collapse)AuthorFilesLines
2022-08-13capture: Stop extcaps before dumpcapTomasz Moń1-0/+2
Send SIGTERM on UNIX systems to all extcap processes when user requests capture stop. Wait up to 30 seconds for extcaps to finish. If extcaps do not finish in time, send SIGKILL to remaining extcaps. Do not call TerminateProcess() on Windows in the same place where UNIX SIGTERM is sent. Instead schedule extcap termination timeout to happen as soon as control returns back to the event loop. There is no universally agreed replacement for SIGTERM on Windows, so just keep things simple (forcefully terminate like always) until we have agreed on something.
2022-08-12extcap: Do not drain stderr on process exitTomasz Moń1-1/+0
Extcap child watch callback assumed that the stderr pipe is broken. However the stdout and stderr pipes are not necessarily broken if the child process spawned new processes that inherited standard handles. Do not drain stderr in busy loop to prevent UI freeze. Stop capture session only when all extcap watches are removed. Remove stdout and stderr watches on capture stop timer (30 seconds) expiration, even if the pipes are not broken. Do not rely only on 0 bytes read to cease reading stdout and stderr. Stop reading if the status is anything else than G_IO_STATUS_NORMAL (especially it can be G_IO_STATUS_EOF).
2022-08-10extcap: Read stdout and stderr during captureTomasz Moń1-1/+3
Read extcap stdout/stderr data when available to prevent extcap hang on stdout/stderr write. Discard stdout data as it was not used earlier. Store up to 1024 bytes of stderr and display it to user after capture stops. Fixes #17827
2022-08-10extcap: Close capture session after extcap finishesTomasz Moń1-0/+3
Wait up to 30 seconds for extcap process to finish after closing pipes. The wait is achieved in non-blocking fashion, i.e. the UI is completely responsive during the wait. Only actions related to capture process like capture control, file open, save, export are inactive during the wait. On Windows extcap child watch callback gets called immediately as the process is forcefully terminated. Prior to this change the extcap was forcefully terminated on Windows anyway. The wait is possible on UNIX systems if extcap does handle SIGPIPE and SIGTERM signals. The defaults handlers for SIGPIPE and SIGTERM simply terminate the process so for large number of extcaps there is no change. If extcap does not finish within 30 seconds, it is forcefully terminated using SIGKILL signal.
2022-02-11Differentiate `-c` from `-a packets:`David Perry1-0/+3
2022-02-09Specify directory for temporary capturesDavid Perry1-1/+4
2021-09-30ws_getopt: Rename struct and macrosJoão Valverde1-13/+13
This is part of the API and should also be renamed to avoid conflicts.
2021-09-17Use the musl in-tree getopt_long() everywhereJoão Valverde1-1/+1
Besides the obvious limitation of being unavailable on Windows, the standard is vague about getopt() and getopt_long() has many non-portable pitfalls and buggy implementations, that increase the maintainance cost a lot. Also the GNU libc code currently in the tree is not suited for embedding and is unmaintainable. Own maintainership for getopt_long() and use the musl implementation everywhere. This way we don't need to worry if optreset is available, or if the $OPERATING_SYSTEM version behaves in subtly different ways. The API is under the Wireshark namespace to avoid conflicts with system headers. Side-note, the Mingw-w64 9.0 getopt_long() implementation is buggy with opterr and known to crash. In my experience it's a headache to use the embedded getopt implementation if the system provides one.
2021-09-14Add tshark ringbuffer option '-b nametimenum:value'Juha Takala1-0/+1
This is used to select ringbuffer savefile name template. Choose one of two savefile name templates: If value is 1, make running file number part before start time part; this is the original and default behaviour (e.g. log_00001_20210828164426.pcap). If value is greater than 1, make start time part before running number part (e.g. log_20210828164426_00001.pcap). The latter makes alphabetical sortig order equal to creation time order, and keeps related multiple file sets in same directory close to each other (e.g. while browsing in wireshark "Open file" dialog). Signed-off-by: Juha Takala <juha.takala+rauta@iki.fi>
2021-07-15Clean up handling of --capture-comment.Guy Harris1-7/+3
Don't store the comments in a capture_options structure, because that's available only if we're being built with capture support, and --capture-comment can be used in TShark when reading a capture file and writing another capture file, with no live capture taking place. This means we don't handle that option in capture_opts_add_opt(); handle it in the programs that support it. Support writing multiple comments in dumpcap when capturing. These changes also fix builds without pcap, and makes --capture-comment work in Wireshark when a capture is started from the command line with -k. Update the help messages to indicate that --capture-comment adds a capture comment, it doesn't change any comment (much less "the" comment, as there isn't necessarily a single comment). Update the man pages: - not to presume that only pcapng files support file comments (even if that's true now, it might not be true in the future); - to note that multiple instances of --capture-comment are supported, and that multiple comments will be written, whether capturing or reading one file and writing another; - clarify that Wireshark doesn't *discard* SHB comments other than the first one, even though it only displays the first one;
2021-07-14Rename LONGOPT_NUM_CAP_COMMENT to LONGOPT_CAPTURE_COMMENT.Guy Harris1-2/+2
The latter is what editcap calls --capture-comment, and the _NUM serves no purpose whatsoever. One #define name for it suffices.
2021-07-14tshark: allow --capture-comment when reading a fileDavid Perry1-1/+1
Allows adding one or more capture comments to a new pcapng file when tshark is reading from a file. Currently, tshark only allows setting one capture comment, and that only when doing a live capture. The use case for this feature is given in bug #15005. I decided to allow multiple capture comments to match the same ability in `editcap`. To allow this change, I changed the function signature of `process_cap_file()` so it takes a `capture_options` struct instead of individual parameters that affect the capture.
2021-06-14wslog: Add support for domain filteringJoão Valverde1-1/+1
A domain filter can be given in the environment variable 'WS_LOG_DOMAINS' or in a command-line options "--log-domains". The filter is specified as a comma separated case insensitive list, for example: ./tshark --log-domains=main,capture Domain data type switches from an enum to a string. There is no constaint on adding new domains, neither in code or at runtime. The string format is arbitrary, only positive matches will produce output.
2021-06-11Refactor our logging and extend the wslog APIJoão Valverde1-1/+2
Experience has shown that: 1. The current logging methods are not very reliable or practical. A logging bitmask makes little sense as the user-facing interface (who would want debug but not crtical messages for example?); it's computer-friendly and user-unfriendly. More importantly the console log level preference is initialized too late in the startup process to be used for the logging subsystem and that fact raises a number of annoying and hard-to-fix usability issues. 2. Coding around G_MESSAGES_DEBUG to comply with our log level mask and not clobber the user's settings or not create unexpected log misses is unworkable and generally follows the principle of most surprise. The fact that G_MESSAGES_DEBUG="all" can leak to other programs using GLib is also annoying. 3. The non-structured GLib logging API is very opinionated and lacks configurability beyond replacing the log handler. 4. Windows GUI has some special code to attach to a console, but it would be nice to abstract away the rest under a single interface. 5. Using this logger seems to be noticeably faster. Deprecate the console log level preference and extend our API to implement a log handler in wsutil/wslog.h to provide easy-to-use, flexible and dependable logging during all execution phases. Log levels have a hierarchy, from most verbose to least verbose (debug to error). When a given level is set everything above that is also enabled. The log level can be set with an environment variable or a command line option (parsed as soon as possible but still later than the environment). The default log level is "message". Dissector logging is not included because it is not clear what log domain they should use. An explosion to thousands of domains is not desirable and putting everything in a single domain is probably too coarse and noisy. For now I think it makes sense to let them do their own thing using g_log_default_handler() and continue using the G_MESSAGES_DEBUG mechanism with specific domains for each individual dissector. In the future a mechanism may be added to selectively enable these domains at runtime while trying to avoid the problems introduced by G_MESSAGES_DEBUG.
2021-04-13Clean up printing of interface information.Guy Harris1-5/+6
In dumpcap, if we're being run by TShark or Wireshark, if there are no link-layer types, just provide an empty list to our caller; let them construct an empty list of link-layer types when they read our output. In the code that reads that list, don't report an error if the list is empty, rely on the caller to do so. Have capture_opts_print_if_capabilities() do more work, moving some functions from its callers to it.
2021-04-13Don't handle -k in capture_opts_add_opt().Guy Harris1-1/+1
It's not a generic capture option also supported by TShark and dumpcap, it's Wireshark-specific (dumpcap *always* starts a capture, and TShark starts one iff it's passed one or more interfaces on which to capture; only Wireshark needs it to start the capture immediately - that's a relic of the days when Wireshark *itself* did what dumpcap now does for Wireshark). Handle it in commandline_other_options(), rather than in capture_opts_add_opt(). That lets us get rid of an argument to capture_opts_add_opt(), and dummy variables in TShark and dumpcap used to work with that extra argument.
2021-03-29Merge the caputils/ and capchild/ directoriesJoão Valverde1-1/+1
The distinction between the different kinds of capture utility may not warrant a special subfolfer for each, and sometimes the distinction is not be clear or some functions could stradle multiple "categories" (like capture_ifinfo.[ch]). Simplify by having only a generic 'capture' subfolder. The separate CMake libraries are kept as a way to reuse object code efficiently.
2021-03-25Add dumpcap options to set the name and description for a capture source.Guy Harris1-0/+1
Add --ifname and --ifdescr to allow the name and description for an interface or pipe to be set; this overrides the specified name or reported description for an interface, and overrides the pipe path name and provides a description for a pipe. Provide those arguments when capturing from an extcap program. This is mainly for extcaps, so you have something more meaningful than some random path name as the interface name and something descriptive for the description.
2020-10-30add support for compression of capture fileMasaru Tsuchiyama1-1/+5
2020-08-08Dumpcap: print closed ring-buffer file namesDavid Perry1-0/+3
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>
2020-03-28Write the if_hardware option, if available, to pcapng files when capturing.Guy Harris1-0/+2
Change-Id: Ib9ff78d148a2364c84d84b4a9b020b3d783654a3 Reviewed-on: https://code.wireshark.org/review/36602 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2019-12-15Reorganize long option valuesJaap Keuter1-11/+3
For long options, without corresponding short options, to be processed they need to be assigned a value, preferably outside of the range of all possible short options. The code in various places tries to stay clear of these low values, but further coordination is missing, easily leading to issues when option processing code gets extended and/or reorganized. This change introduces a single location from where each catagory of command line long option can derive a base value, which should minimize potential option value collisions. Change-Id: Ic8861a347d0050f74002de3aa1fcfb01202866e5 Reviewed-on: https://code.wireshark.org/review/35459 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-12-13cmdline: cleanup option string definitionsJaap Keuter1-4/+4
Option string composition has grown organically over time and is depending on compilation options also. This results in somewhat complex macro definitions and the use of the string concatenation feature of the C compiler. This change tries to clean up some of this magic by removing definitions of empty strings and merging of adjacent strings. Change-Id: I968449ea9b564915bee468a0cac0e114983ceebe Reviewed-on: https://code.wireshark.org/review/35429 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-09Dumpcap+Qt: Add support for `-a packets:NUM` and `-b packets:NUM`.Gerald Combs1-1/+4
Add the ability to rotate files after a specified number of packets (`-b packets:NUM`). Move some condition checks to capture_loop_write_packet_cb. Add `-a packets:NUM` in order to be consistent. It is functionally equivalent to the `-c` flag. Add a corresponding "packets" option to the Capture Interfaces dialog Output tab. Add initial tests for autostop and ringbuffer conditions. Change-Id: I66eb968927ed287deb8edb96db96d7c73526c257 Reviewed-on: https://code.wireshark.org/review/30534 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-01Move condition logic to dumpcap.cGerald Combs1-3/+3
Move the condition logic from capture_stop_conditions.c to dumpcap.c. Remove capture_stop_conditions.[ch] and conditions.[ch]. Switch duration values to doubles. Change-Id: Ifa74fb13ec8fc923b0721597a6cf071d72069ea0 Reviewed-on: https://code.wireshark.org/review/30440 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-13Put the interface descrptions into the IDB when capturing to pcapng.Guy Harris1-3/+3
capture_opts_add_iface_opt(), when called in a program acting as a capture child, will fetch the description for the interface, and will also generate a "display name" for the interface. In the process, we clean up capture_opts_add_iface_opt() a bit, combining duplicate code. We rename console_display_name to just display_name, as it may also be used in the title bar of Wireshark when capturing. Change-Id: Ifd18955bb3cb41df4c0ed4362d4854068c825b96 Reviewed-on: https://code.wireshark.org/review/29117 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16Eliminate some unneeded header checks.Guy Harris1-3/+1
sys/stat.h and sys/types.h date back to V7 UNIX, so they should be present on all UN*Xes, and we're assuming they're available on Windows, so, unless and until we ever support platforms that are neither UN*Xes nor Windows, we don't need to check for them. Remove the CMake checks for them, remove the HAVE_ values from cmakeconfig.h.in, and remove all tests for the HAVE_ values. Change-Id: I90bb2aab37958553673b03b52f4931d3b304b9d0 Reviewed-on: https://code.wireshark.org/review/27603 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16Not GTK+-only any more.Guy Harris1-1/+1
Change-Id: Id286252e4e59e141fce962020813f522f0b817bb Reviewed-on: https://code.wireshark.org/review/27571 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-02More spawned process handling updates.Gerald Combs1-1/+1
Document ws_pipe.h. Define invalid PIDs in one place. Extcap didn't use stdin before 1a0987904f. Make sure we close it. Change-Id: I7a69cd9b5137ae82435e64628a22e4d812d58f89 Reviewed-on: https://code.wireshark.org/review/26226 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-02Generalize our process spawning code.Gerald Combs1-7/+1
Move the contents of extcap_spawn to ws_pipe. Rename various extcap_* prefixes to ws_pipe_*. Open stdin when we spawn processes. Change-Id: I9286295443ee955bb6328b0ed6f945ee0bb2a798 Reviewed-on: https://code.wireshark.org/review/26216 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-08extcap: remove conditional compilation.Dario Lombardo1-4/+0
Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9 Reviewed-on: https://code.wireshark.org/review/25186 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-09Start using SPDX license identifiers.Gerald Combs1-13/+1
A while back Graham pointed out the SPDX project (spdx.org), which is working on standardizing license specifications: https://www.wireshark.org/lists/wireshark-dev/201509/msg00119.html Appendix V of the specification describes a short identifier (SPDX-License-Identifier) that you can use in place of boilerplate in your source files: https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b Start the conversion process with our top-level C and C++ files. Change-Id: Iba1d835776714deb6285e2181e8ca17f95221878 Reviewed-on: https://code.wireshark.org/review/24302 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Balint Reczey <balint@balintreczey.hu> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-28iface_lists: Remove locked fieldMikael Kanstrup1-1/+0
It seems the locked field of interface_t was used to avoid simultaneous updates of interface entries from either multiple threads or most likely the recursive UI update callbacks case later identified. Since 802362e ("Avoid recursive scan_local_interfaces operation") the recursive callback behavior is no longer happening. And as code does not have consistent checks the locked field can anyway hardly protect a multi-threaded case if such a case exists. Remove the unnecessary locked field. Ping-Bug: 13864 Change-Id: Idc393f702b82aa6014dd636572d00f0d67120bf3 Reviewed-on: https://code.wireshark.org/review/23262 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-08-28extcap: Interface Toolbar support on WindowsHåkon Øye Amundsen1-0/+2
Add support for extcap control pipes on Windows. Improved read loop in InterfaceToolbarReader. Delay opening control pipes until extcap has opened the fifo pipe. Make extcap_example.py work on Windows. Bug: 13833 Change-Id: I4b47d25452637759b8a3be53be48eee5365bc0e4 Reviewed-on: https://code.wireshark.org/review/23211 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-23extcap: Create unique pipe names for each interfaceStig Bjørlykke1-0/+7
On Windows the pipe names does not get random characters appended. Add the interface name and pipe type to make it unique. This partly fixes the issue with capturing from multiple extcap interfaces on Windows. Ping-Bug: 13653 Ping-Bug: 13833 Change-Id: I4290b37cf789bf77608993682a803aca29513d28 Reviewed-on: https://code.wireshark.org/review/23158 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-22Fix requesting hardware timestamps without -kAhmad Fatoum1-0/+1
The interface_options struct passed to dumpcap is populated differently when running Wireshark with and without -k. Previously, only with -k was there a valid pointer in interface_opts.timestamp_type Fixes: aca55a2 ("Add hardware timestamping support") Signed-off-by: Ahmad Fatoum <ahmad.fatoum@siemens.com> Change-Id: Ic7ecc5a1190c28197d6a7271f1b353f74d43ca61 Reviewed-on: https://code.wireshark.org/review/23160 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-22Add hardware timestamping supportAhmad Fatoum1-12/+25
pcap provides a pcap_set_tstamp_type function, which can be used to request hardware timestamps from a supporting kernel. This patch adds support for aforementioned function as well as two new command line options to dumpcap, wireshark and tshark: --list-time-stamp-types List time stamp types supported for the interface --time-stamp-type <type> Change the interface's timestamp method Name choice mimics those used by tcpdump(1), which already supports this feature. However, unlike tcpdump, we provide both options unconditionally. If Wireshark was configured without pcap_set_tstamp_type being available, --list-time-stamp-types reports an empty list. Change-Id: I418a4b2b84cb01949cd262aad0ad8427f5ac0652 Signed-off-by: Ahmad Fatoum <ahmad.fatoum@siemens.com> Reviewed-on: https://code.wireshark.org/review/23113 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-03Add option to use wall-clock intervalsSake Blok1-0/+2
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>
2017-04-25Qt: Add interface toolbar supportStig Bjørlykke1-0/+2
An extcap utility can provide configuration for controls to use in a GUI interface toolbar. This controls are bidirectional and can be used to control the extcap utility while capturing. This is useful in scenarios where configuration can be done based on findings in the capture process, setting temporary values or give other inputs without restarting current capture. Todo: - Add support for Windows Change-Id: Ie15fa67f92eb27d8b73df6bb36f66b9a7d81932d Reviewed-on: https://code.wireshark.org/review/19982 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-03-19Fix various compile warnings turning error on Linux with gcc6 whenJoerg Mayer1-13/+13
compiling with HAVE_PCAP_REMOTE (and ENABLE_ECHLD) Change-Id: If5524f2d3dcacca9c82a46167480c8436dd8b1b2 Reviewed-on: https://code.wireshark.org/review/20615 Petri-Dish: Jörg Mayer <jmayer@loplof.de> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-02-02capture_opts: free memory on exit to avoid leak.Dario Lombardo1-0/+4
This required a restyle of the way the different apps exit. Change-Id: Iedf728488954cc415b620ff0284d2e60f38f87d2 Reviewed-on: https://code.wireshark.org/review/19780 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-30Have routines for parsing options that affect dissection.Guy Harris1-14/+2
Have them handle -d, -t, --disable-protocol, --disable-heuristic, and --enable-heuristic for TShark and both flavors of Wireshark. Change-Id: I612c276b1f9df8a2092202d23ab3d48be7857e85 Reviewed-on: https://code.wireshark.org/review/18583 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-24Move --fullscreen out of LONGOPT_CAPTURE_COMMON.Guy Harris1-2/+3
It's not a capture option, so it doesn't belong there. Change-Id: I8aa6719a5a8e90c734c7acfc01b1ba2818498de3 Reviewed-on: https://code.wireshark.org/review/18427 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-23Qt: add fullscreen feature.Dario Lombardo1-1/+3
The feature activates/deactivates fullscreen mode of Qt UI. A new menu item has been added as well as a shortcut (F11 or Ctrl+Cmd+F) according to browsers common shortcut. Change-Id: I01906b494d0a13ce70d27c00ebbe03e6ec87cbd7 Reviewed-on: https://code.wireshark.org/review/18332 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-07-05extcap: Remove g_spawn_helper supportRoland Knall1-0/+1
Move g_spawn to separate file and implement functions to use Windows based method of spawning, instead of the glib based version Change-Id: Ibae03d834ec86531eba37dc8768fbf17ddadf57f Reviewed-on: https://code.wireshark.org/review/16049 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-06-28Pull quit_after_cap out of the global capture options.Guy Harris1-1/+0
Really, all the GUI-related options should be pulled out, so they're not cluttering up dumpcap and tshark. Change-Id: I0276dee2be48bae3498a819d8c0c2747fe1352e7 Reviewed-on: https://code.wireshark.org/review/16180 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-13Start deprecating the capture info API.Gerald Combs1-1/+1
The GTK+ UI has a capture info dialog which shows a summary of captured protocols, including IPX (!), NetBIOS (!!) and VINES (!!OMG!!). It's been disabled by default since 2006 (g59aa9e40). Remove the preference in the Qt UI capture pane. It's still available via the advanced prefs. Add comments in various parts of the code noting that the capture_info routines and structs are GTK+ only. Also note that if we *do* want to add a Qt capture info dialog we'll probably want to modernize the information we show. Change-Id: I3c63f6f01b60f0767fb33602a7f0c3b537dbde51 Reviewed-on: https://code.wireshark.org/review/10991 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-12Remove -Wwrite-strings compiler flagJoão Valverde1-14/+14
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are not useful, they're impossible to fix in a sane way and therefore are being handled with casts of static strings to (char *). This just moves the warning to [-Wcast-qual] and a compiler pragma is in turn required (and used) to squelch that warning. Remove the Wwrite-strings warning. Let that responsibility fall on the programmer (as is done by casting). Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5 Reviewed-on: https://code.wireshark.org/review/12162 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>