[libvirt] [PATCH] tools: compatible with old wireshark

Jincheng Miao jmiao at redhat.com
Thu Oct 16 02:45:34 UTC 2014


Old version wireshark doesn't have ws_symbol_export.h, which is added
from wireshark-v1.10.0. But some distros, like RHEL6u5, only have
wireshark-v1.8, so libvirt should be compatible with these wiresharks.

Signed-off-by: Jincheng Miao <jmiao at redhat.com>
---
 configure.ac                            |  2 +-
 tools/wireshark/util/make-dissector-reg | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f7b02ff..c62f934 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2667,7 +2667,7 @@ if test "$with_wireshark_dissector" != "no"; then
             LIBVIRT_WS_HANDLE_ERROR([wireshark/config.h is required for wireshark-dissector support])
         ])
         AC_CHECK_HEADERS([wireshark/epan/packet.h wireshark/epan/dissectors/packet-tcp.h],, [
-            LIBVIRT_WS_HANDLE_ERROR([wireshark/epan/{packet,packet-tcp}.h are required for wireshark-dissector support])
+            LIBVIRT_WS_HANDLE_ERROR([wireshark/epan/{packet,/dissectors/packet-tcp}.h are required for wireshark-dissector support])
         ], [
           #include <wireshark/config.h>
         ])
diff --git a/tools/wireshark/util/make-dissector-reg b/tools/wireshark/util/make-dissector-reg
index 6fa25c1..2524f09 100755
--- a/tools/wireshark/util/make-dissector-reg
+++ b/tools/wireshark/util/make-dissector-reg
@@ -53,7 +53,21 @@ then
 
 /* plugins are DLLs */
 #define WS_BUILD_DLL
-#include "ws_symbol_export.h"
+
+/* File ws_symbol_export.h is introduced from commit id
+ * 45c2884 (1.10.0). For compatability with old wireshark,
+ * which is provided by some distros, like RHEL6u5,
+ * here define WS_DLL_PUBLIC_NOEXTERN manually.
+ */
+#if WIRESHARK_VERSION < 1010000
+# if __GNUC__ >= 4
+#  define WS_DLL_PUBLIC_NOEXTERN __attribute__ ((visibility("default")))
+# else
+#  define WS_DLL_PUBLIC_NOEXTERN __attribute__ ((dllexport))
+# endif
+#else
+# include "ws_symbol_export.h"
+#endif
 
 /* In 1.12 wireshark WS_DLL_PUBLIC_NOEXTERN was substitued with
  * WS_DLL_PUBLIC_DEF. See wireshark's commit
-- 
1.9.3




More information about the libvir-list mailing list