aboutsummaryrefslogtreecommitdiffstats
path: root/epan/epan.c
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2017-04-04 23:23:59 +0200
committerRoland Knall <rknall@gmail.com>2017-04-19 10:41:55 +0000
commitcfab5ef035db7be8502623af203ab3494a9200e3 (patch)
tree2d848bbd7bd38baa818a817b9cda5b4b107f30a6 /epan/epan.c
parentd13c6d9628e3964697559e3509d9c1f8ec30ed9e (diff)
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 <rknall@gmail.com>
Diffstat (limited to 'epan/epan.c')
-rw-r--r--epan/epan.c20
1 files changed, 20 insertions, 0 deletions
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 <nghttp2/nghttp2ver.h>
#endif
+#ifdef HAVE_LIBXML2
+#include <libxml/xmlversion.h>
+#include <libxml/parser.h>
+#endif
+
static wmem_allocator_t *pinfo_pool_cache = NULL;
const gchar*
@@ -167,6 +172,10 @@ epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_da
#ifdef HAVE_LIBGNUTLS
gnutls_global_init();
#endif
+#ifdef HAVE_LIBXML2
+ xmlInitParser();
+ LIBXML_TEST_VERSION;
+#endif
TRY {
tap_init();
prefs_init();
@@ -254,6 +263,9 @@ epan_cleanup(void)
#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 */
+
}
/*