aboutsummaryrefslogtreecommitdiffstats
path: root/epan
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
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')
-rw-r--r--epan/CMakeLists.txt1
-rw-r--r--epan/Makefile.am3
-rw-r--r--epan/dissectors/Makefile.am2
-rw-r--r--epan/epan.c20
4 files changed, 24 insertions, 2 deletions
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 3c1f014cd7..4ebc03f60e 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -205,6 +205,7 @@ set(epan_LIBS
${SMI_LIBRARIES}
${SNAPPY_LIBRARIES}
${WIN_PSAPI_LIBRARY}
+ ${LIBXML2_LIBRARIES}
)
set(CLEAN_FILES
diff --git a/epan/Makefile.am b/epan/Makefile.am
index 24df231fe3..1b9878fd8b 100644
--- a/epan/Makefile.am
+++ b/epan/Makefile.am
@@ -40,7 +40,7 @@ DIST_SUBDIRS = $(SUBDIRS) $(wslua_dist_dir)
AM_CPPFLAGS = $(INCLUDEDIRS) -I$(builddir)/wslua $(WS_CPPFLAGS) \
$(GLIB_CFLAGS) $(LUA_CFLAGS) $(LIBGNUTLS_CFLAGS) \
$(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) \
- $(LZ4_CFLAGS) $(KRB5_CFLAGS) $(SNAPPY_CFLAGS)
+ $(LZ4_CFLAGS) $(KRB5_CFLAGS) $(SNAPPY_CFLAGS) $(LIBXML2_CFLAGS)
noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
lib_LTLIBRARIES = libwireshark.la
@@ -336,6 +336,7 @@ libwireshark_la_LIBADD = \
@NGHTTP2_LIBS@ \
@SSL_LIBS@ \
@SNAPPY_LIBS@ \
+ @LIBXML2_LIBS@ \
@GLIB_LIBS@
libwireshark_la_DEPENDENCIES = \
diff --git a/epan/dissectors/Makefile.am b/epan/dissectors/Makefile.am
index b74e9c3789..7cd515358b 100644
--- a/epan/dissectors/Makefile.am
+++ b/epan/dissectors/Makefile.am
@@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.am.inc
AM_CPPFLAGS = $(INCLUDEDIRS) -I$(top_srcdir)/epan $(WS_CPPFLAGS) \
$(GLIB_CFLAGS) $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
- $(KRB5_CFLAGS)
+ $(KRB5_CFLAGS) $(LIBXML2_CFLAGS)
include Custom.common
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 */
+
}
/*