From cfab5ef035db7be8502623af203ab3494a9200e3 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 4 Apr 2017 23:23:59 +0200 Subject: Add libxml2 as optional dependency This can be used by dissectors that need to parse out-of-band configuration. Change-Id: I13c0a2f408fb5c21bad7ab3d7971e0fa8ed7d783 Reviewed-on: https://code.wireshark.org/review/20912 Reviewed-by: Roland Knall --- epan/epan.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'epan/epan.c') diff --git a/epan/epan.c b/epan/epan.c index 75ff54214b..e3a3ae85d1 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -84,6 +84,11 @@ #include #endif +#ifdef HAVE_LIBXML2 +#include +#include +#endif + static wmem_allocator_t *pinfo_pool_cache = NULL; const gchar* @@ -166,6 +171,10 @@ epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_da gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); #ifdef HAVE_LIBGNUTLS gnutls_global_init(); +#endif +#ifdef HAVE_LIBXML2 + xmlInitParser(); + LIBXML_TEST_VERSION; #endif TRY { tap_init(); @@ -253,6 +262,9 @@ epan_cleanup(void) #endif #ifdef HAVE_LIBGNUTLS gnutls_global_deinit(); +#endif +#ifdef HAVE_LIBXML2 + xmlCleanupParser(); #endif except_deinit(); addr_resolv_cleanup(); @@ -677,6 +689,14 @@ epan_get_compiled_version_info(GString *str) g_string_append(str, "without Snappy"); #endif /* HAVE_SNAPPY */ + /* libxml2 */ + g_string_append(str, ", "); +#ifdef HAVE_LIBXML2 + g_string_append(str, "with libxml2 " LIBXML_DOTTED_VERSION); +#else + g_string_append(str, "without libxml2"); +#endif /* HAVE_LIBXML2 */ + } /* -- cgit v1.2.3