Commit Graph

314 Commits

Author SHA1 Message Date
Mikael Kanstrup 32d1d96721 androiddump: Fix tcpdump encap type signed/unsigned conversion error
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-16 11:53:04 +00:00
João Valverde 97cb389a35 Revert "CMake: Don't install HTML manuals twice"
This reverts commit f1285fcf06.

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-10 15:58:41 +00:00
João Valverde f1285fcf06 CMake: Don't install HTML manuals twice
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-10-09 13:24:58 +00:00
Tomasz Moń 3c245f2f46 randpktdump: Remove misleading tooltip
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-24 21:38:31 +00:00
Tomasz Moń 4853fb93b2 randpktdump: Initialize print error handler
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-14 21:25:57 +00:00
Gerald Combs ed4c62e3f7 CMake: Fix extcap symlinks on macOS.
Change-Id: I39b1ad1114ba7c8932786aab633d9df133e7ef4d
Reviewed-on: https://code.wireshark.org/review/34496
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-09-10 18:20:57 +00:00
Guy Harris 5cf3fd03f1 HTTPS In More Places, update some URLs.
Change-Id: Ice2e1e2e4d94f6c9da7c651866cfa1a8ac4a31d8
Reviewed-on: https://code.wireshark.org/review/34096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-27 07:55:36 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
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-07-26 18:44:40 +00:00
Dario Lombardo ed34c3de14 sshdump: fix bug in --remote-sudo.
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-06-19 13:00:55 +00:00
Gerald Combs dd4c987756 CMake+macOS: Use symlinks for our CLI utilities.
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-24 17:05:39 +00:00
Guy Harris 640ded8e1d Fix some signedness warnings.
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-17 17:00:08 +00:00
João Valverde c7d86568a0 CMake: Remove wsutil pcap dependency
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-03 21:57:05 +00:00
João Valverde 4c5d2f5ccf CMake: Add libpcap imported library target
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-03 21:56:45 +00:00
Guy Harris 2ee483a222 Move the Winsock initialization and cleanup to wsutil routines.
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-02 09:29:01 +00:00
Gerald Combs cec5991f40 Windows: Modernize our WSAStartup usage.
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-05-01 17:51:59 +00:00
Guy Harris bbc8cbfb9c If you use data_file_url(), you must first call init_progfile_dir().
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-04-08 02:57:53 +00:00
Guy Harris 5a7e0b6350 Don't cast away constness if you don't have to.
Change-Id: Ib6bf70c8d222d1c31681535689d2372178df3b80
Reviewed-on: https://code.wireshark.org/review/32463
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-17 22:15:57 +00:00
Peter Wu 567fe966b1 extcap: set G_REGEX_RAW to avoid potential crashes
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-02-10 16:12:46 +00:00
Peter Wu 87e5269c69 CMake: rewrite FindSystemd.cmake file
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-31 13:15:47 +00:00
Peter Wu 62ffa95707 sshdump: leave username, port and interface unset by default
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-27 09:46:55 +00:00
Peter Wu ccf37e3905 CMake: fix failure to locate zlib (and possibly libssh)
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-23 15:43:38 +00:00
Dario Lombardo d70bc0c40e extcap: remove dependencies from ui.
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-22 15:38:10 +00:00
João Valverde 4f46a2af88 CMake: Set a direct rpath for libraries
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-22 00:55:40 +00:00
Peter Wu 5dd86a0a7e CMake: do not set RPATH when installing to a system directory
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-20 21:59:42 +00:00
João Valverde a3991874eb CMake: Replace PACKAGELIST magic
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-20 11:50:10 +00:00
Peter Wu 5cc461490d CMake: use object libraries to avoid redundant builds
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-12 18:20:44 +00:00
Guy Harris 10a7993bae Remove comment whose meaning is unclear at best.
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-05 21:36:21 +00:00
Peter Wu e2e5b01d77 cli_main: remove real_main from stack traces for non-Windows
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-02 12:08:20 +00:00
Guy Harris ba589a4e44 Move some command-line-oriented routines from wsutil to ui.
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>
2019-01-01 02:07:06 +00:00
Alexis La Goutte ee58c3fc70 ssh-base: fix no previous prototype for ‘extcap_log’ [-Wmissing-prototypes]
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-26 20:14:37 +00:00
Jaap Keuter afc1265b63 writecap: rename pcapng_write_session_block to _section_block
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>
2018-12-18 23:41:41 +00:00
Guy Harris a34cc98b2a Put the main() and wmain() routines for CLI programs into a separate file.
That means that code is only in one place, rather than having copies of
it in each of those programs.

CLI programs that, on Windows, should get UTF-8 arguments rather than
arguments in the local code page should:

	include the top-level cli_main.h header;

	define the main function as real_main();

	be built with the top-level cli_main.c file.

On UN*X, cli_main.c has a main() program, and just passes the arguments
on to real_main().

On Windows, cli_main.c has a wmain() function that converts the UTF-16
arguments it's handed to UTF-8 arguments, using WideCharToMultiByte() so
that it doesn't use any functions other than those provided by the
system, and then calls real_main() with the argument count and UTF-8
arguments.

Change-Id: I8b11f01dbc5c63fce599d1bef9ad96cd92c3c01e
Reviewed-on: https://code.wireshark.org/review/31017
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-13 00:52:11 +00:00
João Valverde 697623411c CMake: Use $ORIGIN with RPATH
Make our package relocatable on Unix systems.

Linux, Solaris and FreeBSD are known to support $ORIGIN.

Change-Id: Ibcdda33d62c075bfa867d006cb6aaf5824609011
Reviewed-on: https://code.wireshark.org/review/30896
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-03 23:54:15 +00:00
Mikael Kanstrup 22db1f066f androiddump: Don't present the verbose config option
The verbose config option has been replaced by an extcap base debug
option. Presenting verbose as an available option makes Wireshark
trying to retrieve the value of this option. As the option is not
really supported and invalid options after a recent change now
generate errors the androiddump tool does not start properly.

For reference the problem happens due the unfortunate combo of
these two patches:
v2.3.0rc0-1108-gb83ea46 ("extcap: put missed parameters into the help")
v2.9.0rc0-2431-g945d441 ("extcap: fix return value in extcap_base_parse_options().")

Fix by removing verbose as an available config option.

Change-Id: I894f599708a7160f50ca9ee1f9586022342705cb
Reviewed-on: https://code.wireshark.org/review/30716
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-20 05:08:46 +00:00
Mikael Kanstrup 51fb5081b3 androiddump: Add packets with same encap type as used when open wtap
Already when selecting the extcap interface to use the encap type is
known. For some reason when adding packets the type is explicitly
checked for certain values and if not known type is set to
WTAP_ENCAP_WIRESHARK_UPPER_PDU.

This conversion break tcpdump function for all but ETHERNET interface
type. For example NLMON and 802.11 radiotap interfaces does not work.

This problem has probably been there since quite a while back but was not
seen (in the sense that current capture looked OK). Though when:

"3aec5e1 Catch attempts to write multiple encapsulation types if unsupported."

got applied the encap type mismatch is now detected and packet capture stops.
As encap type is known already when selecting the interface to use, fix
this by simply reusing the initial value when dumping the packets.

Change-Id: Ica9824e715c47b285c985ea48cbae0e10e18d542
Reviewed-on: https://code.wireshark.org/review/30715
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-20 05:08:35 +00:00
Guy Harris a1372f6d01 Use an enum for compression types in various interfaces.
This:

1) means that we don't have to flag the compression argument with a
comment to indicate what it means (FALSE doesn't obviously say "not
compressed", WTAP_UNCOMPRESSED does);

2) leaves space in the interfaces in question for additional compression
types.

(No, this is not part 1 of an implementation of additional compression
types, it's just an API cleanup.  Implementing additional compression
types involves significant work in libwiretap, as well as UI changes to
replace "compress the file" checkboxes with something to indicate *how*
to compress the file, or to always use some other form of compression).

Change-Id: I1d23dc720be10158e6b34f97baa247ba8a537abf
Reviewed-on: https://code.wireshark.org/review/30660
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-16 09:20:36 +00:00
Guy Harris 4e17bd6229 Use the dump parameters structure for non-pcapng-specific stuff.
Use it for all the per-file information, including the per-file
link-layer type and the per-file snapshot length.

Change-Id: Id75687c7faa6418a2bfcf7f8198206a9f95db629
Reviewed-on: https://code.wireshark.org/review/30616
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-11-16 02:18:26 +00:00
Dario Lombardo 0795c988b0 extcap: save debug flag and use it to activate ssh debug.
Change-Id: Ida32834f8c0838f1d815f7e33116b6a6161acf34
Reviewed-on: https://code.wireshark.org/review/30572
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-14 04:58:38 +00:00
Dario Lombardo 7a29c3d2eb ssh-base: define a struct for storing ssh parameters.
Update sshdump and ciscodump to use it.

Change-Id: I5fbb9e3a870ec8baa0f326ad34733743cbb981f3
Reviewed-on: https://code.wireshark.org/review/30571
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-14 04:58:15 +00:00
Dario Lombardo cd0a98e221 ssh-base: support libssh config file.
It's operating system dependent, but the library takes care of it
on different operating systems.

Options are set with this precedence:
- if user-provided, use it
- if not, take the one from config file
- (username only) if none in the config file, take the current user from OS

Change-Id: I00dcc1c9a8613e6d1250b6404bf2100f6ccff7b7
Reviewed-on: https://code.wireshark.org/review/30558
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-14 04:57:48 +00:00
Guy Harris 3faa45d4ec Don't have _ng versions of the dumper open routines.
Have the routines always take a parameters pointer; pass either null or
a pointer to an initialized-to-nothing structure in cases where we were
calling the non-_ng versions.

Change-Id: I23b779d87f3fbd29306ebe1df568852be113d3b2
Reviewed-on: https://code.wireshark.org/review/30590
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-13 03:37:29 +00:00
Dario Lombardo 3486243361 sshdump: fix generation of error message from remote side.
Change-Id: I15f5989f08b7e3851a7c4b949d63434fbc750020
Reviewed-on: https://code.wireshark.org/review/30557
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-11-11 09:51:33 +00:00
Dario Lombardo 5d73f57f54 sshdump: fix some debug messages.
Change-Id: I92d157367efc36d4c1d1a53a201ed652d701894e
Reviewed-on: https://code.wireshark.org/review/30556
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-11-10 21:24:20 +00:00
Dario Lombardo f2a9cfcf24 ssh-base: fix wrong type for ssh port.
According to documentation:

http://api.libssh.org/master/group__libssh__session.html#ga82371e723260c7572ea061edecc2e9f1

Change-Id: I788f909efdb263d645bf402ad5a293a4b3e8d089
Reviewed-on: https://code.wireshark.org/review/30555
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-11-10 16:21:49 +00:00
Stig Bjørlykke 163e4637d5 extcap: Cleanup an if-statement
Change-Id: If56f3837e8bcf0ef3a11579ca031223909ac47b9
Reviewed-on: https://code.wireshark.org/review/30528
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-07 09:57:00 +00:00
Dario Lombardo 0a5770a78a extcap: add option to set proxycommand to ssh sessions.
sshdump and ciscodump have been updated to use it.

Change-Id: I4e1e0d35f086d76c13264939bc4f14308cc88cfb
Reviewed-on: https://code.wireshark.org/review/30496
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-05 05:59:38 +00:00
Dario Lombardo 2be2febfc6 extcap: change boolean to boolflag for --debug option.
Change-Id: I6a42e689fa9a914f7f3bee1c1ade2218573a1c3f
Reviewed-on: https://code.wireshark.org/review/30502
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-05 05:58:12 +00:00
Dario Lombardo 945d441b24 extcap: fix return value in extcap_base_parse_options().
We need to split good options' from bad options' return value.

Change-Id: I836e58c0f05716484664f354e7332a74d6a08c20
Reviewed-on: https://code.wireshark.org/review/30503
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-05 05:56:51 +00:00
Dario Lombardo 6910cb138b sshdump: add missing space.
Change-Id: I593ccf333db91dd9877cf5e8ef30c3e722c6df89
Reviewed-on: https://code.wireshark.org/review/30497
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-11-03 14:18:05 +00:00
Gerald Combs aba59e5973 Win32: Make extcap utilities console applications.
Switch from using WinMain in extcap to wmain.

Change-Id: I54fafad598f5ff74fe84a3ce3e993ac5a31188f7
Reviewed-on: https://code.wireshark.org/review/30094
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-12 19:01:49 +00:00