aboutsummaryrefslogtreecommitdiffstats
path: root/ui/capture_ui_utils.h
AgeCommit message (Collapse)AuthorFilesLines
2023-11-24ui: Have get_interface_descriptive_name take the capture_optionsJohn Thacker1-3/+4
Instead of always calling capture_interface_list, have get_interface_descriptive_name take the capture_options (which we always have when calling it) as a parameter, and use the get_iface_list() member of that. Generally that is the same as calling capture_interface list, but if we cache the interface list (e.g., when running tshark) it could be different. We also probably should be looking through the already retrieved interfaces in ifaces or all_ifaces most of the time before doing another call to dumpcap, since we call this on interfaces that are already set up. Passing in the capture_options allows that change to be made later. Related to #16625
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-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.
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-08-13Move get_iface_display_name() to ui/iface_lists.c.Guy Harris1-9/+0
It's only used there, so move it there. Change-Id: I68472150e020ba94166782e3e4c08cba94c0f9ee Reviewed-on: https://code.wireshark.org/review/29114 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-11Make a routine static that's not used outside its source file.Guy Harris1-9/+0
Change-Id: I5121828c1fb95cbf89e7304dd748f8fcac63ad5a Reviewed-on: https://code.wireshark.org/review/29073 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-11-30Reformat some top-level ui files.Gerald Combs1-16/+4
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-02-26Qt: Update selected interface filter behavior.Gerald Combs1-0/+2
Change the selected interface behavior in the main window and the capture interfaces dialog to better handle multiple selections. Attempt to document this at the top of interface_tree.cpp. Move the default capture filter code from CaptureFilterEdit to MainWelcome. Add a "conflicting filter" check to CaptureEdit which updates the placeholder text. Handle conflicting filters in the main welcome screen and the capture interfaces dialog. Propagate interface selections and filter updates in the capture interfaces dialog to the main welcome screen. Consolidate some of the interface handling code in InterfaceTree and CaptureInterfacesDialog. Make sure CaptureInterfacesDialog manages the global capture options by device name instead numeric index. Start deprecating prefs.capture_devices_filter and capture_dev_user_cfilter_find. Change some member function names so that they're hopefully more clear and consistent. Ping-Bug: 11886 Change-Id: I63b06dbae29c2c45ee9252092ad54bdcbacae6e6 Reviewed-on: https://code.wireshark.org/review/14129 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-12-02Qt: Use uniform interface display nameStig Bjørlykke1-0/+9
Use common function to generate the interface display name, both when scanning for interfaces (scan_local_interfaces()) and when changing Comment in the Manage Interfaces dialog. Change-Id: I3260208856563aaf387ce397d4ae61bddcc89b4f Reviewed-on: https://code.wireshark.org/review/12362 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>
2015-04-05Have a common routine for constructing strings listing interfaces.Guy Harris1-0/+17
We have a bunch of duplicated code to make those lists; make a common routine for that. (dumpcap currently doesn't use it, as the routine in question uses a routine in libui, which dumpcap doesn't use. We should probably fix that.) Change-Id: I9058bf3320d420b8713e90743618972da1d1c6ed Reviewed-on: https://code.wireshark.org/review/7934 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-04Let capture_dev_user_pmode_find() say "not found".Guy Harris1-1/+7
"Not found" is different from "found, and false". Have it return a boolean "did I find the property" indication and, if it did, supply the property value through a pointer. Change-Id: Iaa942ea346410b35e512ff1a3821cbf60c88dfd6 Reviewed-on: https://code.wireshark.org/review/7916 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25Have a #define for whether the capture buffer size can be set.Guy Harris1-1/+1
It can be set if either 1) this is Windows (where we're assumed to be using WinPcap, which includes calls to set the buffer size) or 2) we have pcap_create() (in which case we also have pcap_set_buffer_size(), at least in a normal libpcap release). Use that rather than testing "defined(_WIN32) || defined(HAVE_PCAP_CREATE)"; that makes it a bit more obvious what's being tested. Change-Id: Id9f8455019d19206b04dd6820a748cb97ae5ad12 Reviewed-on: https://code.wireshark.org/review/7816 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-23Centralize the code to set the active_dlt value for a device.Guy Harris1-0/+7
We were doing it similarly, but not the same, in several places; make a common routine for it. Have that code check to make sure the DLT_ value in question is actually supported by the device; if not, pick the first supported DLT_ value, if any; this keeps it from, for example, picking a bad DLT_ value if your defaults were set based on monitor mode being on but monitor mode actually being off, or vice versa. Change-Id: I1722bfeaf60429bc5c6f665fdea3d466052b13bd Reviewed-on: https://code.wireshark.org/review/7795 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-19Patch some memory leaks.Guy Harris1-0/+27
capture_dev_user_descr_find() and capture_dev_user_cfilter_find() return g_malloc()ated strings; we don't need to g_strdup() them to get a g_malloc()ated string, and we *do* need to free them if we aren't going to use them any more. Document that while we're at it, and give more details for the functions returning integer user-specified interface parameters as well. Change-Id: Icf98a48992b1c4168ead54bdc4cc2847da89d665 Reviewed-on: https://code.wireshark.org/review/7745 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-18Fix parsing of interface properties strings.Guy Harris1-2/+1
The first entry in the list does not have a leading comma, so a strstr() for ",{ifname}(" will not work. Instead, use g_strsplit() with a comma for all of the preferences. Have common code for all the "uncomplicated" preferences. Have a specialized handler for the one "complicated" preference. Change-Id: I2144a98ab0cb70db56eaaba88175d6e03885de2a Reviewed-on: https://code.wireshark.org/review/7741 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-0/+13
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad Reviewed-on: https://code.wireshark.org/review/4626 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-30Make a routine unused outside capture_ui_utils.c static.Guy Harris1-9/+0
Change-Id: I63f1e5fb119a44edf4ee489683e79cb39a746c08 Reviewed-on: https://code.wireshark.org/review/2710 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30Move capture_ui_utils.[ch] to libui.Guy Harris1-0/+135
Change-Id: Id0f3d4d60a1acc7aa64fd3737b8f16df5bca4e5a Reviewed-on: https://code.wireshark.org/review/2708 Reviewed-by: Guy Harris <guy@alum.mit.edu>