epan: Add SMI version

This commit is contained in:
João Valverde 2021-05-25 18:12:29 +01:00
parent ea424f881f
commit 9b13c4352d
4 changed files with 26 additions and 7 deletions

View File

@ -1760,6 +1760,11 @@ set_package_properties(Minizip PROPERTIES
DESCRIPTION "C library for supporting zip/unzip functionality"
PURPOSE "Support for profiles import/export"
)
set_package_properties(SMI PROPERTIES
URL "https://www.ibr.cs.tu-bs.de/projects/libsmi/"
DESCRIPTION "Library to access SMI management information"
PURPOSE "Support MIB and PIB parsing and OID resolution"
)
string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type)
message(STATUS "C-Flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${_build_type}}")

View File

@ -47,6 +47,14 @@ IF(SMI_FOUND)
)
mark_as_advanced( SMI_DLL_DIR SMI_DLL )
endif()
include(CheckSymbolExists)
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${SMI_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${SMI_LIBRARIES})
check_symbol_exists("smi_version_string" "smi.h" HAVE_SMI_VERSION_STRING)
cmake_pop_check_state()
ELSE(SMI_FOUND)
SET( SMI_LIBRARIES )
SET( SMI_INCLUDE_DIRS )

View File

@ -130,6 +130,9 @@
/* Define to 1 if you have the `smi' library (-lsmi). */
#cmakedefine HAVE_LIBSMI 1
/* Define to 1 if libsmi exports a version string (and that symbol is visible). */
#cmakedefine HAVE_SMI_VERSION_STRING 1
/* Define to use zlib library */
#cmakedefine HAVE_ZLIB 1

View File

@ -749,13 +749,6 @@ epan_dissect_packet_contains_field(epan_dissect_t* edt,
void
epan_get_compiled_version_info(GString *str)
{
/* SNMP */
#ifdef HAVE_LIBSMI
g_string_append(str, ", with SMI " SMI_VERSION_STRING);
#else /* no SNMP library */
g_string_append(str, ", without SMI");
#endif /* _SMI_H */
/* LUA */
#ifdef HAVE_LUA
g_string_append(str, ", with " LUA_RELEASE);
@ -838,6 +831,12 @@ epan_get_compiled_version_info(GString *str)
g_string_append(str, ", without libxml2");
#endif /* HAVE_LIBXML2 */
/* SNMP */
#ifdef HAVE_LIBSMI
g_string_append(str, ", with SMI " SMI_VERSION_STRING);
#else /* no SNMP library */
g_string_append(str, ", without SMI");
#endif /* HAVE_LIBSMI */
}
/*
@ -885,6 +884,10 @@ epan_get_runtime_version_info(GString *str)
#endif
#endif /* HAVE_ZSTD */
/* SNMP */
#ifdef HAVE_SMI_VERSION_STRING
g_string_append_printf(str, ", with libsmi %s", smi_version_string);
#endif /* HAVE_SMI_VERSION_STRING */
}
/*