Commit Graph

11 Commits

Author SHA1 Message Date
Stig Bjørlykke 631172f2f4 Qt: Use uniform interface display name
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-12-02 09:57:35 +00:00
Guy Harris d4bfa9c43b Have a common routine for constructing strings listing interfaces.
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-05 23:43:01 +00:00
Guy Harris c67bc03355 Let capture_dev_user_pmode_find() say "not found".
"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-04-04 21:03:34 +00:00
Guy Harris 083f6b6e6d Have a #define for whether the capture buffer size can be set.
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-25 03:22:33 +00:00
Guy Harris 1b4120846e Centralize the code to set the active_dlt value for a device.
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-23 00:00:42 +00:00
Guy Harris 1fdfee69d6 Patch some memory leaks.
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-19 00:28:40 +00:00
Guy Harris 096e5231ff Fix parsing of interface properties strings.
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>
2015-03-18 23:58:54 +00:00
Bill Meier bfe3706035 Always put editor-modelines at the end of the file ...
... 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-14 20:08:29 +00:00
Bill Meier 1b8b2a8aa8 Add editor modelines; Adjust whitespace as needed.
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad
Reviewed-on: https://code.wireshark.org/review/4626
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12 18:58:32 +00:00
Guy Harris 7d1a93f7fd Make a routine unused outside capture_ui_utils.c static.
Change-Id: I63f1e5fb119a44edf4ee489683e79cb39a746c08
Reviewed-on: https://code.wireshark.org/review/2710
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 05:30:13 +00:00
Guy Harris df5833723c Move capture_ui_utils.[ch] to libui.
Change-Id: Id0f3d4d60a1acc7aa64fd3737b8f16df5bca4e5a
Reviewed-on: https://code.wireshark.org/review/2708
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 01:36:56 +00:00