Commit Graph

208 Commits

Author SHA1 Message Date
Gerald Combs d9e530bc17 Use address functions instead of ADDRESS macros in ui.
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the ui directory.

Change-Id: I10e95e66c8da5b880133452ebc484c53046e87ba
Reviewed-on: https://code.wireshark.org/review/11199
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:46:12 +00:00
Stig Bjørlykke b0a8fa59f8 Initialize extcap for pipes
Change-Id: Ia731f281ee9af171c759d7f6f7c614c350cbb4e7
Reviewed-on: https://code.wireshark.org/review/10178
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: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-22 11:55:21 +00:00
Pascal Quantin 6452caa3b3 Fix retrieval of data link type supported by remote interfaces with 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-07-22 07:10:10 +00:00
AndersBroman 9421af309b Try to fix: warning C6244: Local declaration of 'airpcap_if_list' hides
previous declaration.

Change-Id: Id0c3b74ac52c427d9c1efdf749dc410bc5bb450f
Reviewed-on: https://code.wireshark.org/review/9460
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-02 15:28:03 +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 493ddd5963 OK, this appears to be what's intended.
Include a column to describe what's intended.  If that's *not* what's
intended, fix the comment and the twisty little maze of #defines.

Change-Id: Ic5d120c401d8aba23a19e9d042b1460621b80e0b
Reviewed-on: https://code.wireshark.org/review/7815
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25 02:41:41 +00:00
Guy Harris 77bc38e498 Clean up handling of buffer size.
Instead of a twisty little maze of #if, #ifdefs, and #elifs, all
different, define HAVE_BUFFER_SIZE upfront iff we can set the buffer
size - i.e., if this is Win32, and thus we're using WinPcap, or if we
have pcap_create() and thus pcap_set_buffer_size() - and use that to
govern whether to have a buffer size setting or not.

Always put the buffer size setting in the right vertical box.  If that
doesn't work well for some configurations of available interface knobs,
feel free to change the checks, but please make it less opaque what's
going on (include a comment if necessary).

Change-Id: I384c601982b470ae08de271431eac06d6c925332
Reviewed-on: https://code.wireshark.org/review/7814
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25 01:30:28 +00:00
Roland Knall 8a3bd9ee38 Win32: Compilation error if winpcap remote capturing disabled
If HAVE_PCAP_REMOTE is not set, this code is not defined and therefore will not be
compiled correctly.

Change-Id: Ie08a6f99598d46cfa38e2448ea979a8a9aa7c7fc
Reviewed-on: https://code.wireshark.org/review/7803
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-24 23:59:41 +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 f0311abe72 Rename update_interface_list() and remove local interface code from it.
It's only used to update the remote interface list, and never updates
anything else (it sets iftype_id to CAPTURE_IFREMOTE and never changes
it, so all tests for whether iftype_id is == or >= CAPTURE_IFREMOTE
succeed); remove the code that would be executed if, somehow, iftype_id
got stomped on, and rename it to update_remote_interface_list().

Change-Id: I3bd80fb19bb14ef5bdf2c1a77a10f1f32bb62aba
Reviewed-on: https://code.wireshark.org/review/7773
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>
2015-03-21 10:06:14 +00:00
Guy Harris da3e4f92d5 Make the snapshot-length member of interface_t an int.
That matches what it is in other structures, and eliminates a compiler
warning.

While we're at it, remove an empty if statement revealed by that change.

Change-Id: I5e8c8f92fdb3567e75800c729443737032a1bcc7
Reviewed-on: https://code.wireshark.org/review/7752
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-19 06:38:44 +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 3c9c9bc299 capture_dlg.c: Fix (possibly valid) "Using uninitialized memory" MSVC2013 Code Analysis warning
Change-Id: I849b731420d779b68ab4335eb8d06482ecd649e7
Reviewed-on: https://code.wireshark.org/review/7068
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-11 17:03:53 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
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-01-06 07:38:18 +00:00
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00
Irene Ruengeler e5757d1dcc Fix GTK warning in EXTCAP parts
Change-Id: I3a4d9baf3592db1394d1177a19014cbef9140759
Reviewed-on: https://code.wireshark.org/review/5628
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Irene Ruengeler <iruengeler@googlemail.com>
2014-12-09 07:18:06 +00:00
Alexis La Goutte acc19b7679 extcap: warning: no previous prototype for ‘extcap_free_arglist’ [-Wmissing-prototypes]
Remove extcap_free_arglist (never used)

Change-Id: I1f751512be627380a992db63c3e4abd22b3aa486
Reviewed-on: https://code.wireshark.org/review/4455
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-04 16:16:36 +00:00
Gerald Combs ea6fa049c9 Update the simple dialog code.
Rename simple_dialog_qt.{cpp,h} to simple_dialog.{cpp,h}. Make it a
subclass of QMessageBox. Queue messages at startup similar to GTK+.

Move the GTK+-specific simple_dialog declarations to
gtk/simple_dialog.h.

Don't yell at the user so much. Replace exclamation points with periods.

Change-Id: I1cc771106222d5e06f1f52d67ac29d6dc367cce4
Reviewed-on: https://code.wireshark.org/review/4288
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-25 22:02:43 +00:00
Roland Knall bed29af46d Extcap Capture Interface
Extcap is a plugin interface, which allows for the usage
 of external capture interfaces via pipes using a predefined
 configuration language which results in a graphical gui.

 This implementation seeks for a generic implementation,
 which results in a seamless integration with the current
 system, and does add all external interfaces as simple
 interfaces.

 Windows Note: Due to limitations with GTK and Windows,
 a gspawn-winXX-helper.exe, respective gspawn-winXX-helper-console.exe
 is needed, which is part of any GTK windows installation.

 The default installation directory from the build is an extcap
 subdirectory underneath the run directory. The folder used by
 extcap may be viewed in the folders tab of the about dialog.

 The default installation directory for extcap plugins with
 a pre-build or installer version of wireshark is the extcap
 subdirectory underneath the main wireshark directory.

 For more information see:

  http://youtu.be/Nn84T506SwU
  bug #9009

 Also take a look in doc/extcap_example.py for a Python-example
 and in extcap.pod for the arguments grammer.

 Todo:
   - Integrate with Qt - currently no GUI is generated, but
     the interfaces are still usable

Change-Id: I4f1239b2f1ebd8b2969f73af137915f5be1ce50f
Signed-off-by: Mike Ryan <mikeryan+wireshark@lacklustre.net>
Signed-off-by: Mike Kershaw <dragorn@kismetwireless.net>
Signed-off-by: Roland Knall <rknall@gmail.com>
Reviewed-on: https://code.wireshark.org/review/359
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-08-21 03:34:02 +00:00
Guy Harris 435e7c6106 Move the AirPcap stuff into caputils.
Change-Id: I64b45dad36a3ec491aeb9de3439b4fe19b46f9d8
Reviewed-on: https://code.wireshark.org/review/3308
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-01 00:30:03 +00:00
Guy Harris a760a7db66 Clean up indentation (consistent two-space indentation).
Change-Id: I90210a051f820e70b8b41e5376f881f812c9539f
Reviewed-on: https://code.wireshark.org/review/3173
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-23 09:08:47 +00:00
Irene Ruengeler c7b45d0a7d GTK Remote Capturing
Move the GTK files necessary for managing the recnet remote host from capture_dlg.c to recent.c in order to use them in QT, too.

Change-Id: I3f3fd31ce928162de08c6db7309ef2a9b1e97760
Reviewed-on: https://code.wireshark.org/review/2955
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-11 04:29:46 +00:00
Pascal Quantin 032c261997 GTK: fix crash when closing Capture Options dialog box on Windows
Introduced in g929afd2

Change-Id: I911994af2a210f00cd099f26e68d1e1f0fea577b
Reviewed-on: https://code.wireshark.org/review/2901
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-06 19:14:52 +00:00
Guy Harris 9e6487f247 Move utility routines for capturing into a libcaputils static library.
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-07-04 07:25:26 +00:00
Guy Harris ad1391aa4e Move capture.[ch] to libui.
Change-Id: I86e7e781cc9e14abab0374a18b95438529b046f0
Reviewed-on: https://code.wireshark.org/review/2711
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 05:38:57 +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
Irene Ruengeler 929afd23a7 Fix several GTK warnings in Windows.
Change-Id: I300137319129c3e188884e1240c025d92e34e410
Reviewed-on: https://code.wireshark.org/review/2687
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-28 05:57:30 +00:00
Guy Harris 7bbf35b9fa Fix some more capchild includes.
Change-Id: I6d6cd79ee9e630fe81eb6deca9691249b44bdaf4
Reviewed-on: https://code.wireshark.org/review/2595
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-24 00:36:24 +00:00
Roland Knall 268104a1dd CaptureDialog: Fix IF type for user created pipe
- If a user adds a pipe via "Capture Options"->"Manage Interfaces"
   ->"Pipes" the device.if_type.type is either not filled out (in
   the case if no other interfaces exist), or will be set to the
   last set if_type of the device queried by the iteration in line
   3537.

 - One could argue, that this is just a fixup, as still the issue
   remains, that the device structure will not be resetted, after
   the search for an already existing pipe element. Maybe a separate
   variable should be used for searching as it is used for adding
   the pipe

Change-Id: Ia727bf3ce270a62d065e8c524a13768af389c346
Reviewed-on: https://code.wireshark.org/review/1296
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-23 12:14:42 +00:00
Martin Kaiser 97ba9406e7 fix a crash in the GTK "Interface Management" dialogue
for Pipes and Local Interfaces
(Capture / Options / Manage Interfaces)

if you start with an empty dialogue, select a pipe using Browse and
press Save, wireshark crashes because of a strcmp() against the
uninitialized pipe_name

initialize pipe_name to NULL and make sure its value is reset when the
dialogue is closed

don't add a pipe unless there's an active selection in the pipe list
(which may be "New Pipe")

Change-Id: Id460c8d0d43cd7fc4cb8f4e9b4357898bbef20f7
Reviewed-on: https://code.wireshark.org/review/776
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-21 21:24:28 +00:00
Balint Reczey 00be1d31ce Migrate GTK icon handling to GTK 3.10 API
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-11 05:38:01 +00:00
Peter Hatina 78ff87e655 Reorganize Capture Options dialog
Opening Capture Options dialog on low resolution displays (e.g. 1366x768) in GNOME-shell makes user unable to see the bottom of the dialog

Change-Id: Icc39d5ca89f98edb3ff246cd23ab9663a3dfbd1e
Reviewed-on: https://code.wireshark.org/review/453
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-06 21:27:02 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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>
2014-03-04 14:27:33 +00:00
Alexis La Goutte 1115889c0b Fix Branch condition evaluates to a garbage value found by Clang Analyzer
Change-Id: I745f838a763e5cc89e1b9c0536ad3cb299b00786
Reviewed-on: https://code.wireshark.org/review/245
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-18 13:50:58 +00:00
Stig Bjørlykke 0d31c840ae Removed debug output.
svn path=/trunk/; revision=53903
2013-12-10 14:43:15 +00:00
Jakub Zawadzki 65db82872c When including <epan/prefs.h> don't force inclusion of <epan/uat.h>
svn path=/trunk/; revision=53769
2013-12-03 22:16:49 +00:00
Chris Maynard 93f15d640c Specify SI units for the max filesize autostop condition. For now, keep the capture buffer size in IEC units, but document it as such.
#BACKPORT(1.10, 1.8(?))

svn path=/trunk/; revision=53728
2013-12-02 19:17:12 +00:00
Chris Maynard 8a849e82e1 When a snaplength isn't specifically set by the user, the default snaplength is used. In this case, rather than display the text, "default", display the actual value so the user always knows which value will be used. Other tools (tcpdump, for example) uses a different default snaplength, so it may not have been obvious to all users which value Wireshark uses for its default snaplength (even if it is documented in the man pages).
svn path=/trunk/; revision=53660
2013-11-29 23:52:32 +00:00
Chris Maynard 5d44edf894 While r53608 fixed the "Use promiscuous mode on all interfaces" toggle button behavior, it wasn't enough, so use the technique from r53609 for the "Capture on all interfaces" toggle button to fix it completely.
#BACKPORT(1.10)

svn path=/trunk/; revision=53611
2013-11-27 05:31:10 +00:00
Chris Maynard eabd5d8534 OK, capture_all is only ever set to TRUE or FALSE, so just use it directly.
svn path=/trunk/; revision=53610
2013-11-27 05:13:22 +00:00
Chris Maynard 136030657b Make "Capture on all interfaces" toggle button behave properly, particularly when all interfaces had been selected but one of them is deselected.
#BACKPORT(1.10)

svn path=/trunk/; revision=53609
2013-11-27 05:03:31 +00:00
Chris Maynard a01b501445 Make "Use promiscuous mode on all interfaces" toggle button work properly again.
#BACKPORT(1.10)

svn path=/trunk/; revision=53608
2013-11-27 03:02:51 +00:00
Guy Harris 1f88ca3ca6 Note why refresh_local_interface_lists() is being called in various
cases.

svn path=/trunk/; revision=53597
2013-11-26 09:33:56 +00:00
Guy Harris b01acd4b25 Add explanatory comments.
svn path=/trunk/; revision=53596
2013-11-26 09:10:50 +00:00
Guy Harris 747ab4e006 Blank after comma for all arguments in that call.
svn path=/trunk/; revision=53579
2013-11-25 20:54:19 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Michael Mann 36e13a4c55 Bugfix "Restart the running live capture" when using multiple files makes a long filename. Bug 2274 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2274)
Yes this solution leaks memory, but I think the handful of bytes leaked is worth fixing this nuisance.  Won't backport until leak is fixed though.

svn path=/trunk/; revision=52793
2013-10-23 15:31:48 +00:00
Gerald Combs a631772243 More ui/util.h includes.
svn path=/trunk/; revision=52545
2013-10-11 17:58:12 +00:00