aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-07-16 02:03:08 -0700
committerGuy Harris <gharris@sonic.net>2020-07-16 09:26:43 +0000
commit92966774721fe914403cebbcbc38ceb7e4c01ea3 (patch)
tree255aad427320437ffa65584c02ff0289724c2da2 /extcap
parenta1d2d18cb8367cc62395be1bbfa9fee6433e4386 (diff)
extcap: assume we're using libssh 0.6 or later.
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>
Diffstat (limited to 'extcap')
-rw-r--r--extcap/ciscodump.c6
-rw-r--r--extcap/ssh-base.h19
-rw-r--r--extcap/sshdump.c6
3 files changed, 2 insertions, 29 deletions
diff --git a/extcap/ciscodump.c b/extcap/ciscodump.c
index fed926428f..42b4db31e7 100644
--- a/extcap/ciscodump.c
+++ b/extcap/ciscodump.c
@@ -551,12 +551,8 @@ int main(int argc, char *argv[])
help_url = data_file_url("ciscodump.html");
extcap_base_set_util_info(extcap_conf, argv[0], CISCODUMP_VERSION_MAJOR, CISCODUMP_VERSION_MINOR,
CISCODUMP_VERSION_RELEASE, help_url);
- extcap_base_set_compiled_with(extcap_conf, "libssh version %s", LIBSSH_VERSION_STRING);
-#ifdef HAVE_SSH_VERSION
+ extcap_base_set_compiled_with(extcap_conf, "libssh version %s", SSH_STRINGIFY(LIBSSH_VERSION));
extcap_base_set_running_with(extcap_conf, "libssh version %s", ssh_version(0));
-#else
- extcap_base_set_running_with(extcap_conf, "libssh (unknown version)");
-#endif
g_free(help_url);
extcap_base_register_interface(extcap_conf, CISCODUMP_EXTCAP_INTERFACE, "Cisco remote capture", 147, "Remote capture dependent DLT");
diff --git a/extcap/ssh-base.h b/extcap/ssh-base.h
index 6a2f523a01..55565646d9 100644
--- a/extcap/ssh-base.h
+++ b/extcap/ssh-base.h
@@ -15,25 +15,6 @@
#include <libssh/libssh.h>
-/*
- * Sigh.
- *
- * libssh 1.0 and 2.0 define LIBSSH_VERSION as a string.
- *
- * libssh 3.0 and later define it as three numbers with periods
- * between them, so that you have to do SSH_STRINGIFY(LIBSSH_VERSION)
- * to get the SSH version as a string.
- *
- * Fortunately, "needs SSH_STRINGIFY()" is true iff SSH_STRINGIFY is
- * defined, so we can define LIBSSH_VERSION_STRING differently,
- * depending on whether SSH_STRINGIFY is defined.
- */
-#ifdef SSH_STRINGIFY
-#define LIBSSH_VERSION_STRING SSH_STRINGIFY(LIBSSH_VERSION)
-#else
-#define LIBSSH_VERSION_STRING LIBSSH_VERSION
-#endif
-
#include <glib.h>
#ifndef STDERR_FILENO
diff --git a/extcap/sshdump.c b/extcap/sshdump.c
index 9d60b97989..4e13178ca6 100644
--- a/extcap/sshdump.c
+++ b/extcap/sshdump.c
@@ -373,12 +373,8 @@ int main(int argc, char *argv[])
extcap_base_set_util_info(extcap_conf, argv[0], SSHDUMP_VERSION_MAJOR, SSHDUMP_VERSION_MINOR,
SSHDUMP_VERSION_RELEASE, help_url);
g_free(help_url);
- extcap_base_set_compiled_with(extcap_conf, "libssh version %s", LIBSSH_VERSION_STRING);
-#ifdef HAVE_SSH_VERSION
+ extcap_base_set_compiled_with(extcap_conf, "libssh version %s", SSH_STRINGIFY(LIBSSH_VERSION));
extcap_base_set_running_with(extcap_conf, "libssh version %s", ssh_version(0));
-#else
- extcap_base_set_running_with(extcap_conf, "libssh (unknown version)");
-#endif
extcap_base_register_interface(extcap_conf, SSH_EXTCAP_INTERFACE, "SSH remote capture", 147, "Remote capture dependent DLT");
help_header = g_strdup_printf(