diff --git a/CMakeLists.txt b/CMakeLists.txt index 47bbda8c30..a2ce8bcab4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}}") diff --git a/cmake/modules/FindSMI.cmake b/cmake/modules/FindSMI.cmake index e8ce5020bf..93f6393e56 100644 --- a/cmake/modules/FindSMI.cmake +++ b/cmake/modules/FindSMI.cmake @@ -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 ) diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index c106537cfe..d03badad62 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -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 diff --git a/epan/epan.c b/epan/epan.c index 25adf70cf1..aaa404ba9f 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -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 */ } /*