extcap: add libssh version info to sshdump and ciscodump.

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>
This commit is contained in:
Dario Lombardo 2020-07-15 18:43:44 +02:00 committed by Anders Broman
parent d975ebbed4
commit f793923a12
6 changed files with 12 additions and 0 deletions

View File

@ -71,6 +71,7 @@ else ()
REGEX "#define[ ]+LIBSSH_VERSION_MICRO[ ]+[0-9]+")
string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_PATCH ${LIBSSH_VERSION_PATCH})
set(LIBSSH_VERSION ${LIBSSH_VERSION_MAJOR}.${LIBSSH_VERSION_MINOR}.${LIBSSH_VERSION_PATCH})
set(LIBSSH_VERSION_STRING "${LIBSSH_VERSION}")
endif()
endif()

View File

@ -60,6 +60,7 @@
/* Define if LIBSSH support is enabled */
#cmakedefine HAVE_LIBSSH 1
#cmakedefine LIBSSH_VERSION_STRING "@LIBSSH_VERSION_STRING@"
/* Define if you have the 'dlget' function. */
#cmakedefine HAVE_DLGET 1

View File

@ -551,6 +551,7 @@ 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_add_library_info(extcap_conf, "libssh", LIBSSH_VERSION_STRING);
g_free(help_url);
extcap_base_register_interface(extcap_conf, CISCODUMP_EXTCAP_INTERFACE, "Cisco remote capture", 147, "Remote capture dependent DLT");

View File

@ -96,6 +96,13 @@ void extcap_base_set_util_info(extcap_parameters * extcap, const char * exename,
extcap->helppage = g_strdup(helppage);
}
void extcap_base_add_library_info(extcap_parameters * extcap, const char * libname, const char * libversion)
{
gchar * old_version = extcap->version;
extcap->version = g_strdup_printf("%s\nCompiled with %s version %s", old_version, libname, libversion);
g_free(old_version);
}
static void extcap_custom_log(const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,

View File

@ -87,6 +87,7 @@ typedef struct _extcap_parameters
void extcap_base_register_interface(extcap_parameters * extcap, const char * interface, const char * ifdescription, uint16_t dlt, const char * dltdescription );
void extcap_base_register_interface_ext(extcap_parameters * extcap, const char * interface, const char * ifdescription, uint16_t dlt, const char * dltname, const char * dltdescription );
void extcap_base_set_util_info(extcap_parameters * extcap, const char * exename, const char * major, const char * minor, const char * release, const char * helppage);
void extcap_base_add_library_info(extcap_parameters * extcap, const char * libname, const char * libversion);
uint8_t extcap_base_parse_options(extcap_parameters * extcap, int result, char * optargument);
uint8_t extcap_base_handle_interface(extcap_parameters * extcap);
void extcap_base_cleanup(extcap_parameters ** extcap);

View File

@ -373,6 +373,7 @@ 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_add_library_info(extcap_conf, "libssh", LIBSSH_VERSION_STRING);
extcap_base_register_interface(extcap_conf, SSH_EXTCAP_INTERFACE, "SSH remote capture", 147, "Remote capture dependent DLT");
help_header = g_strdup_printf(