aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
AgeCommit message (Collapse)AuthorFilesLines
2020-12-10sshdump: fix detection of custom version in WindowsPascal Quantin1-0/+4
(cherry picked from commit 10377c4d92f9ac310f7e7878890e066d17cb37ba)
2020-10-14Have WTAP_ERR_INTERNAL include an err_info string giving details.Guy Harris1-3/+4
That way, users won't just see "You got an internal error", the details will be given, so they can report them in a bug.
2020-08-09wiretap: have wtap_dump_flush(), and its callers, check for errors.Guy Harris1-2/+9
Change-Id: Ibcddf1a949f775afa49d36a2d165c3685556035d Reviewed-on: https://code.wireshark.org/review/38104 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-18sshdump: allow for multiple instances.Dario Lombardo1-6/+17
sshdump can now be copied in multiple instances. Each instance will show up a different interface and will have its own profile. This will help users connecting to different hosts. Instead of changing profiles, sshdump can be cloned, and each instance will be used for a single host. Change-Id: If4fb42cf78021c6f16213ae91cbf41ec7f61ca77 Reviewed-on: https://code.wireshark.org/review/37883 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-16extcap: put the code to add lissh version information into a common routine.Guy Harris4-4/+13
add_libssh_info() can be used by ciscodump, sshdump. and any other extcap program that uses libssh. Change-Id: I60474bd610eeb7dfb6ec07fc1aaaf19c4f745cdd Reviewed-on: https://code.wireshark.org/review/37882 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-16extcap: assume we're using libssh 0.6 or later.Guy Harris3-29/+2
We require 0.6 or later in CMakeLists.txt, and both ssh_version() and LIBSSH_VERSION having to be fed to SSH_STRINGIFY() date back before 0.5, so just assume ssh_version() is available and LIBSSH_VERSION has to be fed to SSH_STRINGIFY(). Change-Id: I4f62a720424383f88e0410cad07dbe67d0c69297 Reviewed-on: https://code.wireshark.org/review/37881 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-16extcap: get the libssh version string from the libssh.h header.Guy Harris1-0/+19
Thanks, libssh developers, for making it so straightforward! This means we don't need to construct it in the CMake module that finds libssh. Change-Id: I6c173bf7c0671dfdfac423a7d01ecced7b69e851 Reviewed-on: https://code.wireshark.org/review/37878 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-16extcap: clean up the version number handling.Guy Harris9-23/+41
Have the version parameter be just the version number; other code expects it to be that. Have additional parameters for the "compiled with" and "running with" information. Add a extcap_version_print() routine to show the version message, printing {exename} version {version} and then printing Compiled with {compiled_with} if "compiled with" information is supplied and printing Running with {running_with} if "running with" information is supplied. This fixes some messages, as well as fixing the display of extcap modules in the About dialog. Change-Id: I3d298d30e83bd363abd599d75adfc780a90f34fd Reviewed-on: https://code.wireshark.org/review/37877 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-16extcap-base: no need to get the basename of the executable path twice.Guy Harris1-4/+1
Just use extcap->exename. Change-Id: I85cfda2afaf776f3222cf362bcd6c675b4ff1504 Reviewed-on: https://code.wireshark.org/review/37876 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-15Show the version of libssh being used, if possible.Guy Harris4-5/+22
If we have ssh_version(), then ssh_version(0) will return a string for the version being used. Change-Id: I0717f6d4d5c3fa04aa7938dc6bc0d4c8abfa95fd Reviewed-on: https://code.wireshark.org/review/37875 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-15extcap: add libssh version info to sshdump and ciscodump.Dario Lombardo4-0/+10
Change-Id: I1e13cc3471e37514a0dd181abd4938607a057ec6 Reviewed-on: https://code.wireshark.org/review/37870 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-15extcap: improve version output for all extcaps.Dario Lombardo1-2/+7
Change-Id: I6ecdbdbbdf852bc3b874ad6a9acdd94f8e839c89 Reviewed-on: https://code.wireshark.org/review/37869 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-14sshdump: remove redundant ssh_userauth_agent callPeter Wu2-13/+0
Since the original introduction of sshdump, ssh_userauth_publickey_auto was already in use which would try the ssh-agent on non-Windows platforms. There is no need to explicitly call ssh_userauth_agent which is dead code anyway due to a typo in the macro name. Change-Id: I976ec3da9e35ade63983ba5ca01163714d466912 Reviewed-on: https://code.wireshark.org/review/37476 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-05-09More PVS-Studio issues flagged by Valerii Zapodovnikov.Martin Mathieson1-8/+4
/opt/SourceCode/wireshark/epan/dissectors/packet-frame.c 818 warn V547 Expression 'fi' is always true. /opt/SourceCode/wireshark/epan/dissectors/packet-gsm_sms.c 2692 warn V547 Expression 'length <= (offset - saved_offset)' is always false. /opt/SourceCode/wireshark/epan/dissectors/packet-isup.c 4688 warn V1037 Two or more case-branches perform the same actions. Check lines: 4688, 4697 /opt/SourceCode/wireshark/extcap/androiddump.c 1237 warn V560 A part of conditional expression is always true: data_str. /opt/SourceCode/wireshark/extcap/androiddump.c 1603 warn V547 Expression is always true. /opt/SourceCode/wireshark/ui/qt/models/packet_list_model.cpp 497 warn V560 A part of conditional expression is always true: ok_r1. For the voip_calls.c change, I preferred to initailize along with every other field, rather than set to actual value it gets set to later. For the isobus-vt change, I could not find a spec but followed the pattern from other error bit fields. Bug: 16335 Change-Id: Ie55082222b582f6fff4e8c7a992d863acee6cf15 Reviewed-on: https://code.wireshark.org/review/37160 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-04-15sshdump: Use Open dialog for SSH private keyTomasz Moń1-1/+1
Set mustexist option to true to use Open file dialog instead of Save. Change-Id: Ic8890facb6eebdacdc52881f617e8137585220f4 Reviewed-on: https://code.wireshark.org/review/36832 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-15More modeline fixes to put HT tab stops every 8 characters.Guy Harris2-7/+7
Change-Id: If3ea65f24e33b89784b3d9a1e7009d09728d4f7a Reviewed-on: https://code.wireshark.org/review/36437 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-02-10extcap: Fix packet time calculationErwin Rol2-5/+8
The packet time calculation used the time(NULL) call to get the time in seconds and than divided by 1000 to get micro seconds. This results in correct seconds but some random micro seconds values. Now get the time in microseconds and divide by 1000000 to get the seconds and use the remainder for the micro seconds part. Change-Id: I31f90960e27b0089c20936f69c7dc30f1efd50d9 Signed-off-by: Erwin Rol <erwin@erwinrol.com> Reviewed-on: https://code.wireshark.org/review/36067 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-25androiddump: Link against libwiretap and libwsutilJeroen Roovers1-0/+3
With BUILD_androiddump and EXTCAP_ANDROIDDUMP_LIBPCAP enabled, the linker notices a couple of cases of underlinking: extcap/androiddump.c:541: error: undefined reference to 'ws_inet_pton4' extcap/androiddump.c:685: error: undefined reference to 'ws_hexstrtou32' extcap/androiddump.c:2513: error: undefined reference to 'cmdarg_err_init' extcap/androiddump.c:2517: error: undefined reference to 'data_file_url' extcap/androiddump.c:2629: error: undefined reference to 'ws_strtou16' extcap/androiddump.c:2592: error: undefined reference to 'ws_strtou16' extcap/androiddump.c:2646: error: undefined reference to 'ws_strtou16' extcap/androiddump.c:1708: error: undefined reference to 'ws_inet_pton4' extcap/androiddump.c:1783: error: undefined reference to 'ws_inet_pton4' Fix that by explicitly linking against libwiretap and libwsutil when the linker cannot find those symbols by linking to them through libwireshark. Change-Id: I4db266fe82927c12d18fec06f9d766b9390bcec3 Reviewed-on: https://code.wireshark.org/review/35855 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-18androiddump: Provide fifo argument to g_warning()Jeroen Roovers1-3/+3
When EXTCAP_ANDROIDDUMP_LIBPCAP=1, the compiler warns: In file included from /usr/include/glib-2.0/glib.h:62:0, from extcap-base.h:29, from androiddump.c:26: androiddump.c: In function ‘extcap_dumper_open’: androiddump.c:366:19: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=] g_warning("Can't open %s for saving packets: %s", pcap_geterr(pcap)); (et cetera) Fix three occurrences of that warning by using char *fifo as it was apparently intended. Fixes: 67a5d9bebebe1bbe668d8da11601c1833bc7bf4d Change-Id: I0597a345d87594cbe548d118a57e3751d0e3abf6 Reviewed-on: https://code.wireshark.org/review/35853 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>
2019-10-16androiddump: Fix tcpdump encap type signed/unsigned conversion errorMikael Kanstrup1-1/+1
androiddump determines encap type by reading the data link type value from pcap content generated by tcpdump running on the device. The data link type is converted from an uint type to an int type because int is what the pcap/wtap API expects. However the signed to unsigned conversion is performed on an 8-bit data value rather than the full 32-bit value making DLT values larger than 127 fail. Fix the unsigned to signed conversion by determining DLT from the full 32-bit "network" field from pcap global header instead of the 8-bit data char array. While at it also take caore of device to host endianness conversion. Fixes: v2.5.1rc0-65-gbfef57ebb7 ("androiddump: Fix and simplify tcpdump capture") Fixes: v2.9.0rc0-694-gafd0eef4f6 ("androiddump: Fix tcpdump encap type when libwiretap is used") Change-Id: I71629b166a6893763b16e9df33408fee8c99cbd2 Reviewed-on: https://code.wireshark.org/review/34788 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2019-10-10Revert "CMake: Don't install HTML manuals twice"João Valverde6-6/+6
This reverts commit f1285fcf061669702ca1accd7b2c50ebc8198993. NSIS package is broken with this commit. Change-Id: Ief22a308edad188fa2d5fab79355f19493359fa6 Reviewed-on: https://code.wireshark.org/review/34758 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2019-10-09CMake: Don't install HTML manuals twiceJoão Valverde6-6/+6
HTML docs are installed to both $docdir and $pkgdatadir. Fix that to install to $docdir only. Change-Id: I115158585b6df9170d9a01249adbc8548df91f14 Reviewed-on: https://code.wireshark.org/review/34640 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2019-09-24randpktdump: Remove misleading tooltipTomasz Moń1-1/+1
The number of packets to generate is unsigned and always finite. The code supports 64 bits integers as the count and thus for most use cases (2^64)-1 is good enough alternative for infinite. Change-Id: I9f83002358d0ab11724dce22802390b145e4ac67 Reviewed-on: https://code.wireshark.org/review/34613 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-09-14randpktdump: Initialize print error handlerTomasz Moń1-0/+8
When there is a problem with output pipe, randpktdump will call cfile_write_failure_message() which in turn calls cmdarg_err() which calls print_err. Call cmdarg_err_init() so print_err is not NULL. Change-Id: Ie459596a473c83204e9aa1d48bb2d2d3717b340a Reviewed-on: https://code.wireshark.org/review/34495 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-09-10CMake: Fix extcap symlinks on macOS.Gerald Combs1-1/+1
Change-Id: I39b1ad1114ba7c8932786aab633d9df133e7ef4d Reviewed-on: https://code.wireshark.org/review/34496 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-07-27HTTPS In More Places, update some URLs.Guy Harris1-1/+1
Change-Id: Ice2e1e2e4d94f6c9da7c651866cfa1a8ac4a31d8 Reviewed-on: https://code.wireshark.org/review/34096 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26HTTPS (almost) everywhere.Guy Harris2-2/+2
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>
2019-06-19sshdump: fix bug in --remote-sudo.Dario Lombardo1-2/+2
Fix documentation as well. Bug: 15845 Change-Id: I1b4e50c21887afa6a60b76de6cc169a1d0b5067a Reviewed-on: https://code.wireshark.org/review/33658 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-24CMake+macOS: Use symlinks for our CLI utilities.Gerald Combs1-7/+8
On macOS, <build directory>/run/wireshark is a wrapper script that execs run/Wireshark.app/Contents/MacOS/Wireshark so that Launch Services will activate our application properly. We don't need to worry about this for our other executables. Make them symlinks so that we can run things like `lldb run/tshark` with impunity. Change-Id: I4e656d778040ece722f873b1a7f6e6e60d21e2a6 Reviewed-on: https://code.wireshark.org/review/33071 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-17Fix some signedness warnings.Guy Harris2-12/+12
Packet data is raw octets, meaning guint8s, not chars or gchars. The last argument to recvfrom should be of type socklen_t on UN*X and int on Windows; wsutil/socket.h defines socklen_t to be int on Windows, so just use socklen_t. Change-Id: I5355a246e0f74f39c0f8e198d8dd9769b623af49 Reviewed-on: https://code.wireshark.org/review/33242 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-03CMake: Remove wsutil pcap dependencyJoão Valverde1-1/+1
Change-Id: Ic5a3653cb8bcc33e0be108c8b201567e7090f9f5 Reviewed-on: https://code.wireshark.org/review/33043 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2019-05-03CMake: Add libpcap imported library targetJoão Valverde1-1/+1
Change-Id: I5326b87784817fb353329e2d686fe0515c32f6cb Reviewed-on: https://code.wireshark.org/review/33038 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2019-05-02Move the Winsock initialization and cleanup to wsutil routines.Guy Harris6-77/+59
Those routines exist on both Windows and UN*X, but they don't do anything on UN*X (they could if it were ever necessary). That eliminates some #ifdefs, and also means that the gory details of initializing Winsock, including the Winsock version being requested, are buried in one routine. The initialization routine returns NULL on success and a pointer to a g_malloc()ated error message on failure; report the error to the user, along with a "report this to the Wireshark developers" suggestion. That means including wsutil/socket.h, which obviates the need to include some headers for socket APIs, as it includes them for you. Change-Id: I9327bbf25effbb441e4217edc5354a4d5ab07186 Reviewed-on: https://code.wireshark.org/review/33045 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-01Windows: Modernize our WSAStartup usage.Gerald Combs6-5/+11
Make sure we link each application that calls WSAStartup with ws2_32.lib. Pass version 2.2 to WSAStartup. Wikipedia says it was introduced in 1996, so we should be OK. Ping-Bug: 15711 Change-Id: I431839e930e7c646669af7373789640b5180ec28 Reviewed-on: https://code.wireshark.org/review/33033 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-08If you use data_file_url(), you must first call init_progfile_dir().Guy Harris7-0/+126
And if you call init_progfile_dir(), you must call init_process_policies() before that. And even if you *don't* use data_file_url(), you might use it in the future, or you might use other calls to get data file paths, so make *all* the extcap programs make those calls. (Yes, this is important on macOS, for example; it may also be important on Windows. On other UN*Xes we may just compile in the data file path, but that's not true on *all* our platforms.) Change-Id: I99265ed69ec24096884ec067feddd7d7f3855436 Reviewed-on: https://code.wireshark.org/review/32775 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-17Don't cast away constness if you don't have to.Guy Harris1-2/+2
Change-Id: Ib6bf70c8d222d1c31681535689d2372178df3b80 Reviewed-on: https://code.wireshark.org/review/32463 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-10extcap: set G_REGEX_RAW to avoid potential crashesPeter Wu2-4/+4
None of the patterns try to match UTF-8 text. Treat the inputs as bytes to avoid potential crashes on invalid subjects (e.g. malformed data from an extcap binary, ADB or SSH server). Change-Id: I6f3113cfd9da04ae3fa2b0ece7b0a3a94312830e Ping-Bug: 14905 Reviewed-on: https://code.wireshark.org/review/31939 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-31CMake: rewrite FindSystemd.cmake filePeter Wu1-3/+0
Clarify that this is only needed for the sdjournal extcap interface and report the found version in the CMake output. Change-Id: I40bc540631bda32d0b92e4fcd59d8c1726606d86 Reviewed-on: https://code.wireshark.org/review/31834 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27sshdump: leave username, port and interface unset by defaultPeter Wu1-15/+20
If the username or port number are unspecified, libssh will pick an appropriate default (the local username or port 22 respectively). Additionally, it will use the ssh config file if possible. The eth0 interface is not always appropriate. If the -i option is not specified, tcpdump will select an appropriate default. Change-Id: I99d2136ab27d1652bb420f44d16df063030fb9ce Reviewed-on: https://code.wireshark.org/review/31752 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-23CMake: fix failure to locate zlib (and possibly libssh)Peter Wu1-2/+6
Include directories are no longer globally included, be explicit with the required include directories or else function checks will fail. Change-Id: I72d88f94854fcfe6529554f84e49d1dba696e9df Fixes: v2.9.1rc0-436-ga3991874eb ("CMake: Replace PACKAGELIST magic") Reviewed-on: https://code.wireshark.org/review/31693 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-22extcap: remove dependencies from ui.Dario Lombardo1-2/+0
ui is required by randpkt_core, move it to its deps. Bug: 15401 Change-Id: Ia8cfaddd220a22c1cf03ec6bf8f83f068f8d94ba Reviewed-on: https://code.wireshark.org/review/31670 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-01-22CMake: Set a direct rpath for librariesJoão Valverde1-9/+5
Instead of using "$ORIGIN/../lib" just use "$ORIGIN". Also be explicit in configuring the relative RPATH. We don't want to assume a default relative path, in case more targets are addded, out of caution. Change-Id: I3b7f5e8de7be8bb30aca3b433212113d876c4163 Reviewed-on: https://code.wireshark.org/review/31647 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20CMake: do not set RPATH when installing to a system directoryPeter Wu1-2/+3
When built with -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib (as is done by many Linux distributions), do not set an unnecessary RPATH. This was the case before v2.9.0rc0-2727-g697623411c. Relocatable builds will still be possible with the default options as /usr/local/lib is typically not considered a system library path. Change-Id: Ic6ff1760183c20d3f9f9fb787604e888e116534e Reviewed-on: https://code.wireshark.org/review/31602 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20CMake: Replace PACKAGELIST magicJoão Valverde1-3/+9
This is more explicit and easier to read with slightly better locality while using less code. Also less awkward when the package doesn't fit the narrow package list expectations. The ws_find_package() macro doesn't include all the status messages. The choice was to rely on standard find_package() and feature_summary() output and be less verbose. Avoid polluting the CLI build interface. Per target include paths and macro definitions are preferred. Because this patch intentionally removes the global CMAKE_*_FLAGS and include_directories() usage in favor of target properties, some untested build configurations may inadvertently break because of missing ${PACKAGE}_INCLUDE_DIRS or ${PACKAGE}_DEFINITIONS. This required a manual review of dependencies that might have been incomplete. ${PACKAGE_VAR}_LINK_FLAGS seems to be unused. Changing the CMake Qt code to use more modern CMake component syntax is left as future work. Change-Id: I3ed75252189a6e05a23ed6e619088f519cd7ed78 Reviewed-on: https://code.wireshark.org/review/31496 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-12CMake: use object libraries to avoid redundant buildsPeter Wu1-20/+31
Some source files are duplicated via add_executable. Assuming that these are not affected by target-specific preprocessor macros, they can be built only once and shared among executables. In one configuration, this reduces the number of object files by 55 (cli_main.c and version_info.c alone were built 15 times each). Removes the version dependency from each target since the 'version_info' target can now declare this dependency. Remove CLEAN_C_FILES from extcap since it is not used to set -Werror. Due to removing some files from wireshark_FILES (and others), these are no longer part of checkAPIs though. Hopefully that is acceptable. Change-Id: I0a3f1ffb950e70a6176c96d867f694fbc6476f58 Reviewed-on: https://code.wireshark.org/review/31509 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-05Remove comment whose meaning is unclear at best.Guy Harris1-2/+0
What is is it saying we shouldn't be doing? Change-Id: Iad26687f3f3f482af09760255fef7189ed71a3ae Reviewed-on: https://code.wireshark.org/review/31391 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-02cli_main: remove real_main from stack traces for non-WindowsPeter Wu5-5/+5
Restore the "main" name since that is used everywhere else except for Windows. On Windows, "main" is renamed via a macro to avoid a conflict with "wmain" and to allow it to be called in cli_main.c. For those wondering, GUI applications (such as Qt) have a different entry point, namely WinMain. In Qt5, src/winmain/qtmain_win.cpp defines WinMain, but seems to convert its arguments from Unicode to CP_ACP (ASCII). It might not support UTF-8, but I did not verify this. Change-Id: I93fa59324eb2ef95a305b08fc5ba34d49cc73bf0 Reviewed-on: https://code.wireshark.org/review/31208 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-01Move some command-line-oriented routines from wsutil to ui.Guy Harris1-1/+1
cmdarg_err() is for reporting errors for command-line programs and command-line errors in GUI programs; it's not something for any of the Wireshark libraries to use. The various routines for parsing numerical command-line arguments are not for general use, they're just for use when parsing arguments. Change-Id: I100bd4a55ab8ee4497f41d9651b0c5670e6c1e7f Reviewed-on: https://code.wireshark.org/review/31281 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-26ssh-base: fix no previous prototype for ‘extcap_log’ [-Wmissing-prototypes]Alexis La Goutte1-1/+1
Change-Id: I96f937ac7f0b085cd1db80b67f490193b02f9aca Reviewed-on: https://code.wireshark.org/review/31203 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-12-18writecap: rename pcapng_write_session_block to _section_blockJaap Keuter1-1/+1
The pcapng file format specification speaks of a secion block, not a session block. Let the function name reflect the proper name of the block it writes. Change-Id: Id399fae3648c93f4750fedaa297b18f95f2bb96f Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-on: https://code.wireshark.org/review/31099 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>