summaryrefslogtreecommitdiff
path: root/ui/gtk/prefs_capture.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-05Allow bigger snapshot lengths for D-Bus captures.Guy Harris1-7/+7
Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except for D-Bus captures. Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for them, because that's the largest possible D-Bus message size. See https://bugs.freedesktop.org/show_bug.cgi?id=100220 for an example of the problems caused by limiting the snapshot length to 256KB for D-Bus. Have a snapshot length of 0 in a capture_file structure mean "there is no snapshot length for the file"; we don't need the has_snap field in that case, a value of 0 mean "no, we don't have a snapshot length". In dumpcap, start out with a pipe buffer size of 2KB, and grow it as necessary. When checking for a too-big packet from a pipe, check against the appropriate maximum - 128MB for DLT_DBUS, 256KB for everything else. Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20 Reviewed-on: https://code.wireshark.org/review/21952 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>
2017-03-28GTK: the maximum packet size is WTAP_MAX_PACKET_SIZE, not 65535Pascal Quantin1-3/+3
Change-Id: I4b78a3bff7ed158eef2008e52ec8abc9f7a8d1d3 Reviewed-on: https://code.wireshark.org/review/20748 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-25Fix memory leaks related to hide_interface functionMikael Kanstrup1-3/+2
Valgrind report leaks like these: 6 bytes in 6 blocks are definitely lost in loss record 2,197 of 46,703 at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xA5C1610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA5D8B0E: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0x69A211: ManageInterfacesDialog::localAccepted() (manage_interfaces_dialog.cpp:454) by 0x69A500: ManageInterfacesDialog::on_buttonBox_accepted() (manage_interfaces_dialog.cpp:211) by 0x71DB32: ManageInterfacesDialog::qt_metacall(QMetaObject::Call, int, void**) (manage_interfaces_dialog.moc.cpp:245) by 0xBEBE36C: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) by 0xBEBE2A5: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) by 0xAF87E41: QAbstractButton::clicked(bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) by 0xAD11095: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) by 0xAD11BAD: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) by 0xAD11D23: QAbstractButton::mouseReleaseEvent(QMouseEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) 96 bytes in 4 blocks are definitely lost in loss record 42,458 of 52,779 at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xA5C1610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA5D722D: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0xA5B84F3: g_list_append (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0) by 0x731F9A: hide_interface (iface_lists.c:426) by 0x69A211: ManageInterfacesDialog::localAccepted() (manage_interfaces_dialog.cpp:454) by 0x69A4F0: ManageInterfacesDialog::on_buttonBox_accepted() (manage_interfaces_dialog.cpp:211) by 0x71DB22: ManageInterfacesDialog::qt_metacall(QMetaObject::Call, int, void**) (manage_interfaces_dialog.moc.cpp:245) by 0xBEBE36C: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) by 0xBEBE2A5: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) by 0xAF87E41: QAbstractButton::clicked(bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) by 0xAD11095: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) These are caused by leaks inside hide_interface function and among its users. Fixed by letting hide_interface function free its resources properly and making sure the users follow the pattern. Change-Id: I91527b83d36dc38b402d0f4a1db4b7db40fd83f9 Reviewed-on: https://code.wireshark.org/review/12113 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-07-22Fix retrieval of data link type supported by remote interfaces with ↵Pascal Quantin1-7/+7
authentication Make use of -A parameter when querying data link types supported by a given interface with dumpcap. Ensure to pass the authentication parameters configured for a remote interface when calling capture_get_if_capabilities() Bug: 11366 Change-Id: I4efea615084a82108e4a12a64e8c46817f30a5c6 Reviewed-on: https://code.wireshark.org/review/9690 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-04Let capture_dev_user_pmode_find() say "not found".Guy Harris1-5/+4
"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-21/+21
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-18Fix parsing of interface properties strings.Guy Harris1-3/+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-07-22Get rid of NO_INTERFACES_FOUND - it's not an error.Guy Harris1-1/+1
It just means "pcap didn't give me any interfaces, and didn't report an error". Hopefully, in the future, there will be pcap APIs that distinguish between the (admittedly unlikely, these days) case of "there really *are* no interfaces on which *anybody* can capture" and "you don't have sufficient permission to capture", and we can report the latter as an error. (Given that pcap supports more than just "regular interfaces", though, there are cases where you don't have permission to capture on those but you have permission to capture raw USB traffic, for example, so perhaps what's really needed is per-interface indications of permissions.) Change-Id: I7b8abb0829e8502f5259c95e8af31655f79d36a1 Reviewed-on: https://code.wireshark.org/review/3169 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04Move utility routines for capturing into a libcaputils static library.Guy Harris1-1/+1
Some of those routines are used only in dumpcap; others are used in TShark and Wireshark as well. Change-Id: I9d92483f2fcff57a7d8b6bf6bdf2870505d19fb7 Reviewed-on: https://code.wireshark.org/review/2841 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30Move capture_ui_utils.[ch] to libui.Guy Harris1-1/+1
Change-Id: Id0f3d4d60a1acc7aa64fd3737b8f16df5bca4e5a Reviewed-on: https://code.wireshark.org/review/2708 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-24For capchild headers, include <capchild/XXX.h>.Guy Harris1-1/+1
Change-Id: I780c69ee637dcd9846756a2e2d6a35baf02d826d Reviewed-on: https://code.wireshark.org/review/2594 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-11Migrate GTK icon handling to GTK 3.10 APIBalint Reczey1-2/+2
GtkStockItem usage is deprecated with all the GTK_STOCK_.* stock ids. We keep a stock id based approach but without relying on GTK's GtkStockItem system. We create our own internal stock ids for {icon, label} tuples and keep the original GTK stock id #define-s and values to preserve backward compatibility. Change-Id: Ia0b35a5903f079e92c8026e3df21bbf0be2d06b0 Reviewed-on: https://code.wireshark.org/review/302 Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-23From Ville Skyttä: Spelling FixesBill Meier1-2/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9591 svn path=/trunk/; revision=54387
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-10Trivial: The file name is prefs_capture.c, not capture_prefs.cChris Maynard1-1/+1
svn path=/trunk/; revision=53926
2013-12-02Specify SI units for the max filesize autostop condition. For now, keep the ↵Chris Maynard1-2/+2
capture buffer size in IEC units, but document it as such. #BACKPORT(1.10, 1.8(?)) svn path=/trunk/; revision=53728
2013-11-26Note why refresh_local_interface_lists() is being called in variousGuy Harris1-1/+2
cases. svn path=/trunk/; revision=53597
2013-11-26Fix indentation.Guy Harris1-1/+1
svn path=/trunk/; revision=53595
2013-07-15Do not hide the interface name in capture options.Irene Rüngeler1-20/+3
Fix for bug 8932 reported by tdarnell5. svn path=/trunk/; revision=50609
2013-07-09From Cal Turney:Anders Broman1-1/+16
Wireshark crashes when switching from a v1.11.0 profile to a v1.4.6 prof and then to a v1.5.1 profile. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8884 #BACKPORT 1.10 svn path=/trunk/; revision=50455
2013-06-27Windows changes for main_window_update ....Luis Ontanon1-1/+1
svn path=/trunk/; revision=50192
2013-06-27get main_window_update out of the way... pass an update_cb to the ↵Luis Ontanon1-7/+8
capture_sync stuff ... as per the XXX comment removed from tshark.c this was a mess to keep the linker happy... I couldn't! I did this without even understanding whether calling main_window_update was realy necessary in most cases. I guess nothing or more specific update cbs would be best. svn path=/trunk/; revision=50188
2013-05-13Fix indentation.Guy Harris1-1/+1
svn path=/trunk/; revision=49280
2013-05-10Delete unused variable.Irene Rüngeler1-1/+1
svn path=/trunk/; revision=49230
2013-05-10The Interface column cannot be hidden any more.Irene Rüngeler1-15/+0
svn path=/trunk/; revision=49227
2013-03-26Fix Coverity CID 990752: Unused pointer value. (column was previously unused)Chris Maynard1-9/+9
svn path=/trunk/; revision=48561
2013-03-21From beroset:Bill Meier1-3/+3
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10404 Note: The following parts of the patch had been previously done: asn1/snmp/packet-snmp-template.c epan/dissectors/packet-snmp.c epan/dissectors/packet-x11.c Also; hostlist_table.c: code under '#ifdef HAVE_GEOIP' didn't compile and needed a few additional patches. svn path=/trunk/; revision=48447
2013-03-13gtk_widget_set_vexpand() is only for GTK3.Bill Meier1-0/+2
svn path=/trunk/; revision=48281
2013-03-13Certain prefs window contents should not be centered vertically in GTK3.Bill Meier1-13/+27
(Fix: prevent vertical expand/fill of grid widget in certain cases). (This stuff in GTK3 about "parents inheriting expand/fill properties from children" is driving me crazy). svn path=/trunk/; revision=48280
2013-03-13Fix compilation under Linux ../../../ui/gtk/prefs_capture.c: In function ↵Alexis La Goutte1-3/+1
‘ifopts_write_new_pmode’: ../../../ui/gtk/prefs_capture.c:2055:18: error: variable ‘all_pmode’ set but not used [-Werror=unused-but-set-variable] svn path=/trunk/; revision=48279
2013-03-13Add interface options preferences.Irene Rüngeler1-22/+170
svn path=/trunk/; revision=48275
2013-03-07Use ifdefs for buffer size.Irene Rüngeler1-1/+3
svn path=/trunk/; revision=48166
2013-03-07More ifdefs. Maybe this makes the mac buildbots happy.Michael Tüxen1-0/+4
svn path=/trunk/; revision=48165
2013-03-07Add buffersize and snap length to the preferences.Irene Rüngeler1-5/+346
svn path=/trunk/; revision=48163
2013-03-06Use explicit casts.Anders Broman1-21/+21
svn path=/trunk/; revision=48137
2013-02-01Update some tooltips.Gerald Combs1-2/+3
svn path=/trunk/; revision=47404
2013-01-24Use ws_gtk_grid...() in place of gtk_table...().Bill Meier1-68/+65
This completes the process of replacing Wireshark gtk_table...() usage !! (However: the prefs dialogs still have a few Gtk3 related Expand/Fill issues which need to be fixed). svn path=/trunk/; revision=47262
2012-11-22On UN*X, if an interface has a description, use it as the "friendlyGuy Harris1-3/+3
name". If it doesn't have a description, on OS X, use the System Configuration framework to attempt to get a "friendly name" for interfaces. If a loopback device doesn't have a friendly name, give it "Loopback" as the friendly name. Move the "turn a CFString into a mallocated C string" routine into common code, as it's used in more than one place. svn path=/trunk/; revision=46131
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45016
2012-08-08Have (almost) all preferences use the generic preferences API (per ↵Michael Mann1-42/+15
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7402). This cleaned up a lot of hardcoded code and allows breaking up the prefs structure (or at least prevent it from growing too large) if desired. Bugfixed problems mentioned in http://www.wireshark.org/lists/wireshark-dev/201208/msg00001.html Column preferences now support default '#' character svn path=/trunk/; revision=44348
2012-08-03Move capture_globals.h from ui/gtk/ to ui/. Show interface activityGerald Combs1-3/+4
using sparklines in the qtshark main window. svn path=/trunk/; revision=44253
2012-08-03Make it compile under WindowsIrene Rüngeler1-5/+11
svn path=/trunk/; revision=44240
2012-08-03Make the columns of the capture options dialog selectable. Changes are ↵Irene Rüngeler1-2/+301
stored in the preferences file. The ordering can be changed by dragging the column. The order is not stored. svn path=/trunk/; revision=44239
2012-08-01Move the common parts of iface_lists.[ch] from ui/gtk/ to ui/. Leave theGerald Combs1-1/+1
GTK+-specific parts behind in capture_dlg.c. svn path=/trunk/; revision=44196
2012-07-20gtk_container_add() -> gtk_box_pack_start() [bug #7377]Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43874
2012-07-09From Michael Mann:Anders Broman1-3/+29
disable hide checkboxes with error messages Updated preference dialog to include text if hide checkbox is disabled. Used error message for "Local Interfaces" dialog. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2598 svn path=/trunk/; revision=43622
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-28Move the stuff to manage the global interface list and to updateGuy Harris1-1/+1
displays of that list into a separate iface_lists.c file. svn path=/trunk/; revision=43523
2012-06-28Detangle the code that manages the interface list on the welcome screen:Guy Harris1-2/+3
fill_capture_box(): if there are interfaces on which to capture, constructs the interface list, otherwise destroys the interface list and puts up a message. update_capture_box(): updates the interface list to reflect current reality. welcome_if_panel_reload(): if there is an interface list, and if there are interfaces on which to capture (so that we still want that list), updates the list by calling update_capture_box(), otherwise creates or destroys it by calling fill_capture_box() (as either it doesn't exist but now needs to or does exist but needs to go away). Have refresh_local_interface_lists(), which re-fetches the list of local interfaces and updates every interface list that includes local interfaces, and refresh_non_local_interface_lists(), which only updates interface lists that (also) include interfaces other than local interfaces (such as pipes and remote interfaces). Call them in the apprpriate places (if we know the list of local interfaces has been updated, call refresh_local_interface_lists(), otherwise, if we know interfaces other than local interfaces have been added or removed, call refresh_non_local_interface_lists()). Don't have any routine that updates the interface list for one widget update the interface list for any other widget; leave the global updating of interface lists up to refresh_local_interface_lists() and refresh_non_local_interface_lists() - only call one of them if any interface lists are to be updated. svn path=/trunk/; revision=43517