forked from osmocom/wireshark
epan: Add SMI version
parent
ea424f881f
commit
9b13c4352d
|
@ -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}}")
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
17
epan/epan.c
17
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 */
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue