aboutsummaryrefslogtreecommitdiffstats
path: root/ui/capture.h
AgeCommit message (Collapse)AuthorFilesLines
2023-12-22Qt: [Re]start the stats when filling the interface listJohn Thacker1-0/+9
Use the welcome mode to fill in the interface list and start the stats at the same time, instead of two calls. Also now restart the stats when refreshing the interface list because an interface has changed. Add a comment that there are still some situations where we don't trigger an interface refresh on a interface monitor notification on Linux Related to #15082
2021-11-30Add UI header files to DoxygenMoshe Kaplan1-1/+2
Add @file markers for UI header files so that Doxygen will generate documentation for them.
2021-07-15Clean up handling of --capture-comment.Guy Harris1-1/+5
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-04-20Remove unneeded modelines in ui.Gerald Combs1-13/+0
Remove the editor modeline blocks from the source files in ui that use 4 space indentation by running perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -l shiftwidth=4 $( ag -g '\.(c|cpp|h|m|mm)') ) This gives us one source of indentation truth for these files, and it *shouldn't* affect anyone since - These files match the default in our top-level .editorconfig. - The one notable editor that's likely to be used on these files and *doesn't* support EditorConfig (Qt Creator) defaults to 4 space indentation.
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.
2020-05-04ui/capture.h: add missing include to fix build with GCC 9.3Aurelien Aptel1-0/+1
ui/capture.h has a function prototype using capture_file struct without it being defined yet. This fails to compile with recent GCC (9.3.1) Bug: 16547 Change-Id: I84f932de2e7ed70f14aa157b9c3b1d1f80b0016f Signed-off-by: Aurelien Aptel <aaptel@suse.com> Reviewed-on: https://code.wireshark.org/review/37024 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-25Have callback function pointers in a capture_session structure.Guy Harris1-1/+10
Instead of having programs that use the capchild library define functions with known names, with the library routines calling back routines with those names, have function pointers for those callbacks in the capture_session structure, and have capture_session_init() set them. Make the callback routines in TShark and in the ui library static. Change-Id: Ia1ba6119c5ef7708e0f87b8420f200136ba41eae Reviewed-on: https://code.wireshark.org/review/36583 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
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>
2019-02-20Qt: Fix restart capture when using a ring bufferStig Bjørlykke1-4/+0
Set capture_opts->restart before restart current capture. Update the restart handling in capture_input_closed() to not remove the current save file; this is either the last file in a ring buffer or a temporary file which will be reused later. Also remove the code which starts the capture again because this is now done in MainWindow::on_actionCaptureRestart_triggered(). Keep the code to restore the original save file when having a ring buffer. This will avoid the error message "Ring buffer requested, but capture isn't being saved to a permanent file" and a following unwanted capture stop. This fix will also avoid the "No packets captured" warning when restart capture without having any packets captured. Remove the unused capture_restart() function which was used in GTK. Change-Id: I80802217b71810eaa36b78a2eb4c32697ddc92ce Reviewed-on: https://code.wireshark.org/review/32110 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-14UI: Make sure we always have interface statistics.Gerald Combs1-1/+1
Ensure that capture_stat_start always returns a non-NULL if_stat_cache_t pointer. This keeps InterfaceTreeModel::updateStatistic from repeatedly running dumpcap when we're unable to gather statistics, e.g. when we don't have capture permissions. Bug: 14284 Change-Id: Id408714a934abab2abdee1d4bb5e4bed872af016 Reviewed-on: https://code.wireshark.org/review/31038 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-03Remove declaration of routine that no longer exists.Guy Harris1-3/+0
The routine was removed in Id302e88bed4da8b9b457049fb78b0bc7d7ffabe3. Change-Id: I1874be1cb666d42011cc9b4ab9360dc885d3622c Reviewed-on: https://code.wireshark.org/review/26231 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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>
2017-12-11[capture_info] Fold the code of capture_info_open() into ui/capture.cAndersBroman1-0/+3
Change-Id: Id302e88bed4da8b9b457049fb78b0bc7d7ffabe3 Reviewed-on: https://code.wireshark.org/review/24766 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-30Reformat some top-level ui files.Gerald Combs1-25/+13
Make sure each ui/*.[ch] file uses identical (4-space) indentation. Remove ui/.editorconfig. Fix up other formatting where needed. SPDX-abbreviate the license blurb in the files we modify. Change-Id: I5faa1c1eae9a4b6220422ad8e4ba7a341c7deb1f Reviewed-on: https://code.wireshark.org/review/24632 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-26capture(.h): fix api referenceAlexis La Goutte1-0/+1
The following parameters of capture_start(capture_options *capture_opts, capture_session *cap_session, info_data_t *cap_data, void(*update_cb)(void)) are not documented: parameter 'cap_data' Change-Id: I5953b35155de49ead64be263b32da2aa671f2206 Reviewed-on: https://code.wireshark.org/review/13546 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-19Allow "capture info data" to not be a singleton.Michael Mann1-1/+2
It was buried as a static variable in capture_info.c, and functions were refactored to allow a pointer to the info_data_t structure to be passed in. TShark and GTK will have their own single (global) copy of the structure, while it opens up Qt to have multiple instances. Change-Id: Ic2d7a2ad574de43f457cb18b194d6bc3fffb6120 Reviewed-on: https://code.wireshark.org/review/12691 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-20Qt: Add a CaptureFile class.Gerald Combs1-2/+2
Wrap the capture_file struct in a QObject which translates cf_cb_* and capture_cb_* events into signals. Move the global cfile to capture_file.cpp. Don't use a void pointer for the capture file struct. Change-Id: Ic5d5efb4bb1db64aa0247245890e5669b1da723a Reviewed-on: https://code.wireshark.org/review/5885 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-14Always put editor-modelines at the end of the file ...Bill Meier1-3/+3
... to ensure that there are no potential issues with respect to editors limiting the number of lines scanned at the end of the file when checking for editor modelines. Change-Id: Ic85cbb108bb5159d6ec4116fea11f5eebb4e44a4 Reviewed-on: https://code.wireshark.org/review/4688 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12Add editor modelines; Adjust whitespace as needed.Bill Meier1-9/+22
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad Reviewed-on: https://code.wireshark.org/review/4626 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-30Move capture.[ch] to libui.Guy Harris1-0/+108
Change-Id: I86e7e781cc9e14abab0374a18b95438529b046f0 Reviewed-on: https://code.wireshark.org/review/2711 Reviewed-by: Guy Harris <guy@alum.mit.edu>