aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
AgeCommit message (Collapse)AuthorFilesLines
2018-08-23CMake: Clean up and homogenize plugin dir configurationJoão Valverde1-7/+7
Change-Id: If43c7b124afdf6471164675f8a0c55a76e998ea1 Reviewed-on: https://code.wireshark.org/review/29254 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-08-22Revert "CMake: Clean up plugin dirs"João Valverde1-7/+7
Broke system (global) binary plugin path. This reverts commit 450ff674a6e84c3abebff76a470d72114083f27f. Change-Id: I5353d2f3acf4450aed243040ef71425a71542a08 Reviewed-on: https://code.wireshark.org/review/29240 Reviewed-by: João Valverde <j@v6e.pt>
2018-08-21CMake: Clean up plugin dirsJoão Valverde1-7/+7
Change-Id: Ie41366205db19b8a9714ad5259c3f958e1e9ee95 Reviewed-on: https://code.wireshark.org/review/29233 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-07-19Extcap programs must write to the packet pipe in binary mode.Guy Harris3-3/+3
It doesn't matter on UN*X, but it definitely matters on Windows; we're writing a pcap file, not a text file, so every byte we write should go down the pipe as is. Bug: 14989 Change-Id: I26c067b8ff5dba644a579846dd97b568a81c7053 Reviewed-on: https://code.wireshark.org/review/28764 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-01randpktdump: add --delay optionPeter Wu1-2/+16
For testing live capture mode in the Qt UI, it is useful to have a continous capture source with some dummy packets. Change-Id: Id76ecbf24828dd3212b208c96679524e4c25b00f Reviewed-on: https://code.wireshark.org/review/28537 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-21Fix build paths for cmake's Xcode project generator on macOS.David Kreitschmann1-10/+17
Multi-configuration generators (such as Xcode or VS) append the current build configuration to most paths (eg. Debug/Release). Currently this results in inconsistent paths for the application bundle and the included command line tools. This commit sets the correct path information for multi-configuration generators for macOS application bundles. The standard Makefile behaviour is untouched. One Windows specific configuration was changed, as it was conflicting with these changes. This needs to be checked before merging. Additionally the wrapper scripts are omitted for Xcode, as the path to the binaries depends on the configuration chosen in Xcode. Therefore it is not viable to create these scripts in the cmake run. Bug: 11816 Change-Id: Ib43d82eb04600a0e2f2b020afb44b579ffc7a7c9 Reviewed-on: https://code.wireshark.org/review/28291 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-26udpdump: add error message from libwritecap.Dario Lombardo1-2/+2
Change-Id: Ida86772c88af6b35e2d3b3864e1b1b551cfd1d96 Reviewed-on: https://code.wireshark.org/review/27804 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-26ciscodump: check return value of libpcap_write_packet (CID: 1435606).Dario Lombardo1-1/+5
Change-Id: Ifb89952b48bf300168b5f775ac3c2777c0c93877 Reviewed-on: https://code.wireshark.org/review/27803 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-24extcap: set EXTCAP_DIR in the root cmake file and propagate it.Dario Lombardo1-11/+0
The EXTCAP_DIR must be known in the root file to be set in config.h and it's still needed in extcap/ to install the binaries, hence we need caching it as well. Bug: 14724 Change-Id: I58bac7de7a00e06c23fe8c8f1a7e3d299de6a560 Reviewed-on: https://code.wireshark.org/review/27776 Reviewed-by: Mikael Kanstrup <mikael.kanstrup@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-24androiddump: Fix tcpdump encap type when libwiretap is usedMikael Kanstrup1-2/+6
androiddump determines encap type by parsing pcap global header from tcpdump binary output. Only when libpcap is used with androiddump this (pcap linktype) value can be used right away. Libwiretap uses its own encap values but is feed with pcap linktype values making the whole packet encapsulation invalid. Fix by converting pcap linktype values into wiretap encap values (For pcap linktype definitions see http://www.tcpdump.org/linktypes.html) (For wtap encap defininitions see wiretap/wtap.h) Fixes: bfef57ebb7 ("androiddump: Fix and simplify tcpdump capture") Change-Id: I5ea86204b8e5774fd84d4007db8c2910680dbd53 Reviewed-on: https://code.wireshark.org/review/27747 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Florian Bezold <florian.bezold@esrlabs.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-05-23make our version of nla_for_each_nested() publicMartin Kaiser1-0/+1
caputils/ws80211_utils.c contains a re-definition of the linux kernel's nla_for_each_nested() macro that applies the correct casts to allow compilation with a C++ compiler. Make this definition public by moving it into a new wsutil/netlink.h file. Include the kernel's original definition before we overwrite it. This way, it's not necessary for a .c file to include wsutil/netlink.h after the system includes. Use our nla_for_each_nested() version in extcap/dpauxmon.c to squelch the following compiler warning: [1664/2251] Building C object extcap/CMakeFiles/dpauxmon.dir/dpauxmon.c.o ../extcap/dpauxmon.c: In function ‘family_handler’: ../extcap/dpauxmon.c:168:13: warning: request for implicit conversion from ‘void *’ to ‘struct nlattr *’ not permitted in C++ [-Wc++-compat] nla_for_each_nested(mcgrp, tb[CTRL_ATTR_MCAST_GROUPS], rem_mcgrp) { Change-Id: I6ba40ef6343c5d168c1b0c4554f13202911ded76 Reviewed-on: https://code.wireshark.org/review/27688 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-19cmake: move extcap sections to extcap/CMakeLists.txt.Dario Lombardo1-0/+226
Change-Id: Ie7d9f6ad3d8b788e0d22e3ce15159fc46f5a93e8 Reviewed-on: https://code.wireshark.org/review/27638 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-18randpktdump: use boolflag instead of boolean in config.Dario Lombardo1-15/+6
Change-Id: I259382352d4c79755c095b1e23325265226acd23 Reviewed-on: https://code.wireshark.org/review/27613 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-18dpauxmon: remove precision loss in dump_packet.Dario Lombardo1-2/+2
../extcap/dpauxmon.c:129:72: warning: implicit conversion loses integer precision: 'const ssize_t' (aka 'const long') to 'guint32' (aka 'unsigned int') [-Wshorten-64-to-32] Change-Id: If835baec3c51eecd4aff9ad7dab052192de78455 Reviewed-on: https://code.wireshark.org/review/27616 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-17dpauxmon (extcap): fix no previous prototype for function ↵Alexis La Goutte1-1/+1
'nl_receive_timeout' [-Wmissing-prototypes] Change-Id: Iaeda0a1c677b3ec605d1a419b1230cf994ccdf4e Reviewed-on: https://code.wireshark.org/review/27609 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-14extcap: Support for DisplayPort AUX channel monitorsDirk Eibach2-0/+625
Support for the generic netlink DisplayPort AUX channel monitor kernel driver. Change-Id: Iab445229ecef082968355f604993292f5f2d8d69 Reviewed-on: https://code.wireshark.org/review/27313 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2018-05-09You have to set tm_isdst before calling mktime().Guy Harris1-0/+2
You either need to tell mktime() that 1) DST/Summer Time is in effect, 2) DST/Summer Time isn't in effect, or 3) we don't know whether DST/Summer Time is in effect, you figure it out. We set tm_isdst to -1, to choose option 3), which is what we want. Fixes Coverity CID 1435496. Change-Id: I0f22ef1201ee8abefb3fa75aa3432b021fb13cfd Reviewed-on: https://code.wireshark.org/review/27408 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-08sshdump/ciscodump: use groups in config.Dario Lombardo3-32/+34
Change-Id: I3d6689738aee32bf720e6ebca1d4462429fdc1eb Reviewed-on: https://code.wireshark.org/review/27397 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-05-02extcap-base.c: fix compilation with gcc 8Pascal Quantin1-7/+4
extcap-base.c:293:43: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] extcap-base.c:302:45: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] extcap-base.c:321:42: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] Change-Id: Ifd9151d04412c5e29636dc14c57a327cc12d33f3 Reviewed-on: https://code.wireshark.org/review/27265 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-18Remove autotools build system.Dario Lombardo1-85/+0
It has been replaced by cmake. Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a Reviewed-on: https://code.wireshark.org/review/26969 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-16glib: Get rid of GLIB_CHECK_VERSION as we now require 2.32.0Anders2-2/+0
Change-Id: Ie95cf37f9cd283545693e290340a7489cc989c95 Reviewed-on: https://code.wireshark.org/review/26970 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-05extcap: Tell utilities the wireshark versionRoland Knall2-0/+4
Add an optional argument to extcap-version, which tells the utilities the wireshark version and therefore allows them to handle different versions differently. If no version is provided, the utility has to assume it is dealing with a Wireshark 2.x version (default behavior). Change-Id: I51658300f28f503ca8050d204b73749f1a54df16 Reviewed-on: https://code.wireshark.org/review/26752 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-03-27androiddump: Read btsnoop header separately from rest of dataMikael Kanstrup1-7/+4
The code to read and skip btsnoop header was written in a way where it reads up to PACKET_LENGTH bytes of data, skips the header, then move rest of data back start of buffer. So far so good. The code then resets number of bytes used in buffer making it skip rest of all data read. Many times this works fine but only by luck. When there's no data transfers first recv call will always only return the header (sender side writes header separately right after accept). When data transfers are ongoing first recv call will return both header and data. Then initial data is lost but more importantly risk parsing data with invalid offset. Fix by reading btsnoop header separately from rest of data. Change-Id: Ie52c33f943d8b311e0cd5638ec1a7d4840e271b8 Reviewed-on: https://code.wireshark.org/review/26659 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michal Labedzki <michal.labedzki@wireshark.org>
2018-03-26androiddump: Update ps command parameter for Android OreoMikael Kanstrup1-1/+4
ps command is used to find com.android.bluetooth process. From Android Oreo the ps command needs -A parameter for listing all processes. Change-Id: I1a547a0d61175c1e194823462661ec69e711ca50 Reviewed-on: https://code.wireshark.org/review/26652 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-03-26androiddump: Fix btsnoop net port lookupMikael Kanstrup1-5/+9
Code assumes btsnoop net port is the first tcp socket found in /proc/<pid>/net/tcp. If it is not the port number lookup will fail. Fixed by searching all open tcp sockets for a match. Change-Id: I988fe18680600b59c595f3d619d95c72c1a6966d Reviewed-on: https://code.wireshark.org/review/26651 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-03-26androiddump: Fix some error messagesMikael Kanstrup1-2/+2
Change-Id: I1b3ad9fdafb08307a9863469f8478ecde0000acc Reviewed-on: https://code.wireshark.org/review/26650 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-10androiddump: Fix non-blocking connect on WindowsFlorian Bezold1-0/+16
Commit 043ed1f6 enabled non-blocking connect on Windows. This seems to break androiddump on Windows completely, since a successful connection always returns SOCKET_ERROR on connect, with WSAGetLastError() set to WSAEWOULDBLOCK. Apparently, the only way to check for a real connection is to try a write select on the socket: https://stackoverflow.com/questions/35370239/timeout-in-connect-function-from-winsock This fixes androiddump on Windows: - If ADB server is running, extcap interfaces are listed - If ADB is not running, there is no noticeable delay in Wireshark Change-Id: I6bd772215c7b232c8fe8e840cb7ad1d54c7d8860 Reviewed-on: https://code.wireshark.org/review/25715 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-10androiddump: Fix and simplify tcpdump captureFlorian Bezold1-192/+89
1. Use "exec:" ADB command to get raw (non-PTY) tcpdump output This is also supported on Android devices before Android 7, and is a much easier approach than testing the new "shell,raw:" command and falling back if unsupported. This basically undoes commit 5ebc3277. 2. Pass "-U" to tcpdump to prevent on-target buffering Before using the "shell,raw" approach in commit 5ebc3277, I tried the "exec:" command already, but experienced extreme buffering of the tcpdump output, which is unacceptable for live trace viewing. Turns out, the buffering is determined "automatically" by libpcap: - When running in a PTY, output is flushed fast for viewing - When _not_ in a PTY, output is not flushed and thus heavily buffered. The "exec" command obviously doesn't use a PTY. Fortunately, tcpdump has a "-U" option to flush the output after each catpured packet, which is exactly what we need. 3. Ignore tcpdump stderr output Enabling "-U" caused androiddump to fail, because it happened that the tcpdump stderr logs were mixed with the stdout data. (We were probably lucky this didn't happen without -U as well). To fix this, we just ignore stderr completely by adding "2>/dev/null" to the tcpdump command. 4. Get linktype from pcap global header The stderr logs were previously parsed to get the textual linktype. This is now replaced by a simpler & less fragile approach: tcpdump prints the global pcap header, which contains precicesly the linktype info we need. 5. Parse pcap global header magic correctly for timestamps & endianness The previous code only supported the "classic" pcap header magic and might also been incorrect on big-endian host machines. Now, endian handling is simplified and we can detect the "nanosecond timestamp" magic values as well. This fixes the problem that extcap_dumper_dump expects *nano*second timestamps, but the previous code supplied *micro*seconds if on-target tcpdump outputs microseconds. 6. The parsing simplifications above allowed the main loop for tcpdump capture to be simplified considerably. Change-Id: Id66791e700a8943b86128f044f080bee60a9fa79 Reviewed-on: https://code.wireshark.org/review/25713 Petri-Dish: Michael Mann <mmann78@netscape.net> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-09Generalize wtap_pkthdr into a structure for packet and non-packet records.Guy Harris1-18/+18
Separate the stuff that any record could have from the stuff that only particular record types have; put the latter into a union, and put all that into a wtap_rec structure. Add some record-type checks as necessary. Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2 Reviewed-on: https://code.wireshark.org/review/25696 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo10-10/+10
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>
2018-01-28androiddump: Raise ADB timeout to 2s for slower devicesFlorian Bezold1-1/+1
Running "tcpdump -D" on target seems to be a expensive operation in some cases, not finishing within the 500ms timeout on several devices (~1000 ms in one of our cases). Change-Id: I57e4d31f12c4e393ff84e79b64cb024b74a11f0e Reviewed-on: https://code.wireshark.org/review/24719 Reviewed-by: Michal Labedzki <michal.labedzki@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-09wiretap: add a parameter to wtap_init() indicating whether plugins must be ↵Pascal Quantin2-1/+3
loaded g995812c5f1 moved wiretap plugins registration from applications to wiretap library init function. As we do not want to load plugins for all users of libwiretap, let's make it configurable. Bug: 14314 Change-Id: Id8fdcc484e2d0d31d3ab0bd357d3a6678570f700 Reviewed-on: https://code.wireshark.org/review/25194 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-08androiddump: Fix crash in add_tcpdump_interfacesMikael Kanstrup1-1/+1
If there's a network interface on the device without the 'flags' field and at the same time exist other network interfaces with the 'flags' field present a null-dereference happens accessing the non-matched regex flags field. Fix crash by adding explicit null check to ensure (optional) regex group really matched. Fixes: 7dcf57719f ("androiddump: Support older on-target tcpdump versions") Change-Id: Ia08dd8547c9cdda96b3c62b99d98ff1d85bd6cd2 Reviewed-on: https://code.wireshark.org/review/25198 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-02androiddump: Support older on-target tcpdump versionsFlorian Bezold1-2/+5
The output of 'tcpdump -D' only outputs interface flags from Android 7 onwards. Since it would be sad to lose the great androiddump support for all older devices because of this, the logic is extended so that it lists all interfaces if no '[' and ']' is found in the output. Also, the used regex seemed to require an interface description, which might not exist (even with new tcpdump versions). Now, interfaces without description are not filtered. Change-Id: I92b550a37b9bc0d0142aed68ee98f26de79be759 Reviewed-on: https://code.wireshark.org/review/24720 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-18androiddump: Fix adb tcpdump PTY CR/LF handlingFlorian Bezold1-13/+30
Devices running Android >= 7 have a different adb shell handling than before: - Before Android 7, adb always runs shell commands in a PTY (pseudoterminal), which automatically converts all \n to \r\n - Since Android 7, adb no longer uses a PTY if a command is directly started (like 'tcpdump' in our case). The original androiddump code reversed the PTY \r\n handling as for older devices. Commit 66507b9 for bug 13510 removed that which supported newer devices while breaking all older devices. This fix tries to support both by first trying to use the new "shell,raw:" adb command syntax. If that succeeds, adb/device must support non-PTY shells and we don't reverse any \r\n. If that fails, it's most likely an older device, and we fall back to the original "shell:" command and enable \r\n reversal. (To prevent misleading error popups in Wireshark, the warning log in adb_send when the first attempt fails is changed to a debug log). Ping-Bug: 13510 Change-Id: I7e0a4f594ebe5dde682cceb667330459337a0c9c Reviewed-on: https://code.wireshark.org/review/24721 Reviewed-by: Mikael Kanstrup <mikael.kanstrup@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-14ciscodump(extcap): fix 'packet' was marked unused but was used ↵Alexis La Goutte1-1/+1
[-Wused-but-marked-unused] Change-Id: I04a52c37404fe6a91740b766de1482376d7128fa Reviewed-on: https://code.wireshark.org/review/24825 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-14Refactor plugin registration and loadingJoão Valverde1-3/+0
Put different types of plugins (libwiretap, libwireshark) in different subdirectories, give libwiretap and libwireshark init routines that load the plugins, and have them scan the appropriate subdirectories so that we don't even *try* to, for example, load libwireshark plugins in programs that only use libwiretap. Compiled plugins are stored in subfolders of the plugin folders, with the subfolder name being the Wireshark minor version number (X.Y). There is another hierarchical level for each Wireshark library (libwireshark, libwscodecs and libwiretap). The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}. Currently we only distribute "epan" (libwireshark) plugins. Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb Reviewed-on: https://code.wireshark.org/review/23983 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-11-22sshdump: remove extra option check.Dario Lombardo1-5/+0
This looked a bit odd since the capture filter is variable length. Removing it makes sshdump work. Change-Id: I454c6263c04019d5e8ecbecd2490dd10185f5c67 Reviewed-on: https://code.wireshark.org/review/24531 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-22sshdump: add option to prevent promiscuous mode.Dario Lombardo1-9/+23
Bug: 14237 Change-Id: I5cecca8ed638c3935c7c77e3a304e4b0527d7fa3 Reviewed-on: https://code.wireshark.org/review/24530 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-19Fix (and chop) static build optionJoão Valverde1-30/+0
This sets the scope of the static build option to Wireshark support libraries only. Before the patch: Static plugins don't work with CMake and autotools. autotools static build is broken, and most likely will always be, as building Wireshark all-static is difficult and time-consuming. After the patch: For CMake Wireshark will be built with static or shared libraries and dynamic plugins. Everything just works. CMake apparently doesn't want you building static and shared libraries at the same time. For autotools Wireshark will be built with shared libraries by default. --disable-shared and --enable-static options work as usual. Dlopened plugins are not built if --disable-shared is given to configure (to disable shared libraries). This is a limitations imposed by libtool. Tested on Linux. This removes broken support for building plugins statically. Change-Id: Ib8e8176976f136eea93a2ce8f9857b6cf9bec64c Reviewed-on: https://code.wireshark.org/review/24241 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-11-15udpdump: add space.Dario Lombardo1-1/+1
Change-Id: I44960f64f16434ccdf033eaa2bfa96579da7cc4b Reviewed-on: https://code.wireshark.org/review/24439 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-11-12extcap: use SPDX identifiers for licences.Dario Lombardo10-130/+10
Change-Id: Id56687f86f4c60494dad0b6d58550ee45b0b203c Reviewed-on: https://code.wireshark.org/review/24381 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-09extcap: rename interface names.Dario Lombardo2-2/+2
The new names better reflect the utility. Change-Id: I54105fc8be6735d3febbcc68837990758a5e52c3 Reviewed-on: https://code.wireshark.org/review/24320 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-11-09Replace inet_addr() with our inet_pton() wrapperJoão Valverde2-6/+5
Error checking omitted like in original code. Change-Id: If8b4181d30ddf5717951aaf7ec61db25c0bc5322 Reviewed-on: https://code.wireshark.org/review/24309 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-11-08udpdump: don't call inet_addr() for every packet.Dario Lombardo1-1/+3
Change-Id: Id3d9229f5d61390f2f4127c8dfdf445935297e85 Reviewed-on: https://code.wireshark.org/review/24300 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-16[RFC]androiddump: Support extcap-dlts optionMikael Kanstrup1-3/+30
According to README.extcap documentation all extcap tools must support the --extcap-dlts option. For performance reasons support for this option was removed by commit: 9328eb6 androiddump: Register interfaces when list interfaces A side effect of not implementing the option is that dumpcap is then also called to try to retrieve interface capabilities for all androiddump interfaces. As extcap interfaces are not local network interfaces errors like these are logged whenever the interface list is refreshed: Capture Dbg sync_if_capabilities_open Capture Info sync_pipe_run_command() starts Capture Dbg argv[0]: /usr/local/bin/wireshark/dumpcap Capture Dbg argv[1]: -i Capture Dbg argv[2]: android-tcpdump-wlan0... Capture Dbg argv[3]: -L Capture Dbg argv[4]: -Z Capture Dbg argv[5]: none Capture Dbg sync_pipe_open_command Capture Dbg read 25 ok indicator: E len: 333 msg: E Capture Dbg sync_pipe_wait_for_child: wait till child closed Capture Dbg sync_pipe_wait_for_child: capture child closed after 0.000s Capture Info sync_pipe_run_command() ends, taking 0.012s, result=-1 Capture Msg Capture Interface Capabilities failed. Error -1, The capabilities of the capture device "android-tcpdump-wlan0..." could not be obtained (android-tcpdump-wlan0...: SIOCETHTOOL(ETHTOOL_GET_TS_INFO) ioctl failed: No such device). Please check to make sure you have sufficient permissions, and that you have the proper interface or pipe specified. () To avoid error prints and to fulfil the documented equirements for extcap tools register a fake interface with what would be the properties of such an interface. Change-Id: If174adbb64c66132be4225f854bbf9f66d2f5ed1 Reviewed-on: https://code.wireshark.org/review/23093 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>
2017-10-15autotools: make maintainer-clean should allow rerunning 'configure'João Valverde1-3/+0
Change-Id: Iedae94ffefe27b13b1967d69cacb757b5aa4576d Reviewed-on: https://code.wireshark.org/review/23928 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-2/+1
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-14Some trivial fixes from running cppcheck.Martin Mathieson1-2/+2
The packet-per.c intialisation of ext_length is not really needed - idx could be -1 with or without extension_flag being set. But it'd be best not to have someone need to think this through again. Change-Id: If07f98ac7d7f2619149e35a2a0d75b765839a7ba Reviewed-on: https://code.wireshark.org/review/23905 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-25udpdump: Add missing include for timeval struct.Jakub Zawadzki1-0/+4
struct timeval is defined in <sys/time.h>, include it. It should fix building with musl: udpdump.c: In function 'setup_listener': udpdump.c:126:9: error: variable 'timeout' has initializer but incomplete type struct timeval timeout = { 1, 0 }; Change-Id: Id9be579e50ea2845ca609708e8ec4d1a3858ecc0 Reviewed-on: https://code.wireshark.org/review/23728 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>