aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/ssh-base.h
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-07-15 23:37:20 -0700
committerAnders Broman <a.broman58@gmail.com>2020-07-16 08:18:58 +0000
commita1d2d18cb8367cc62395be1bbfa9fee6433e4386 (patch)
treed8ca44b7fea25b110b7dd7c8658bb6cafabeb204 /extcap/ssh-base.h
parent48237f77aaec85def2200cb16d249fdc38b6eb2a (diff)
extcap: get the libssh version string from the libssh.h header.
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>
Diffstat (limited to 'extcap/ssh-base.h')
-rw-r--r--extcap/ssh-base.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/extcap/ssh-base.h b/extcap/ssh-base.h
index 55565646d9..6a2f523a01 100644
--- a/extcap/ssh-base.h
+++ b/extcap/ssh-base.h
@@ -15,6 +15,25 @@
#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