Move the protocol registration routines back into libwireshark
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>
Tue, 21 Nov 2017 18:38:44 +0000 (18:38 +0000)
committerJoão Valverde <j@v6e.pt>
Tue, 21 Nov 2017 20:21:50 +0000 (20:21 +0000)
Follow-up to b695b3e2f72998d66ca4b7a6826d4ce1688060c8.

Change-Id: I7e36519f2c3806c1205d05437671325080974257
Reviewed-on: https://code.wireshark.org/review/24524
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
21 files changed:
CMakeLists.txt
Makefile.am
debian/libwireshark-dev.install
debian/libwireshark0.symbols
dftest.c
epan/CMakeLists.txt
epan/Makefile.am
epan/register.c [moved from register.c with 100% similarity]
epan/register.h [moved from register.h with 90% similarity]
epan/wslua/init_wslua.h
rawshark.c
sharkd.c
tfshark.c
tools/make-tap-reg.py
tools/oss-fuzzshark/build.sh
tshark.c
ui/gtk/about_dlg.c
ui/gtk/main.c
ui/qt/about_dialog.cpp
ui/qt/splash_overlay.h
ui/qt/wireshark_application.h

index de47807b3cbddb5137525ab399595d0a6ac7010f..247b044bbd9e9c4cfd9e8ff6686e1cfb71e6acbc 100644 (file)
@@ -1565,7 +1565,6 @@ endif()
 set(SHARK_COMMON_SRC
        cfile.c
        frame_tvbuff.c
-       register.c
        sync_pipe_write.c
        version_info.c
 )
@@ -2536,7 +2535,6 @@ if(BUILD_dftest)
        )
        set(dftest_FILES
                dftest.c
-               register.c
        )
        add_executable(dftest ${dftest_FILES})
        add_dependencies(dftest version)
index 9f4e08fadaa4c10456aa8481d384b147c7b76413..63968c3e0edf263d911797e8406041a49498f9e6 100644 (file)
@@ -379,7 +379,6 @@ EXTCAP_COMMON_SRC = \
 SHARK_COMMON_SRC = \
        cfile.c                 \
        frame_tvbuff.c          \
-       register.c              \
        sync_pipe_write.c
 
 # wireshark specifics
@@ -656,8 +655,7 @@ randpkt_LDADD = \
        @C_ARES_LIBS@
 
 dftest_SOURCES = \
-       dftest.c \
-       register.c
+       dftest.c
 
 dftest_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
 
@@ -719,7 +717,6 @@ noinst_HEADERS = \
        extcap_spawn.h          \
        fileset.h               \
        frame_tvbuff.h          \
-       register.h              \
        ringbuffer.h            \
        summary.h               \
        sync_pipe.h             \
index 14441b9a6a5255698389277d367299b3d0721cba..19296e96545d693eee9e6b078c6216d8d14c3458 100644 (file)
@@ -1,7 +1,7 @@
 usr/lib/*/libwireshark.so
 usr/lib/*/pkgconfig/wireshark.pc
 obj-*/config.h usr/include/wireshark
-register.h usr/include/wireshark
+epan/register.h usr/include/wireshark
 epan/stat_groups.h usr/include/wireshark
 epan/*.h usr/include/wireshark/epan
 epan/crypt/*.h usr/include/wireshark/epan/crypt
index 7126308dcb7bb880bd02499bf2d7d26bda46b717..e9a3dc5e940121bdd05f5d93aed7146742ddb6b0 100644 (file)
@@ -1284,6 +1284,8 @@ libwireshark.so.0 libwireshark0 #MINVER#
  reassembly_table_destroy@Base 1.9.1
  reassembly_table_init@Base 1.9.1
  register_all_plugin_tap_listeners@Base 1.9.1
+ register_all_protocol_handoffs@Base 1.9.1
+ register_all_protocols@Base 1.9.1
  register_ber_oid_dissector@Base 2.1.0
  register_ber_oid_dissector_handle@Base 1.9.1
  register_ber_oid_syntax@Base 1.9.1
@@ -1293,6 +1295,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
  register_cleanup_routine@Base 1.99.8
  register_conversation_filter@Base 2.0.0
  register_conversation_table@Base 2.5.0
+ register_count@Base 1.9.1
  register_custom_dissector_table@Base 1.99.8
  register_custom_dissector_table@Base 1.99.8
  register_decode_as@Base 1.12.0~rc1
index 36abd0330305f5be4ba6de7cab7c86d7a98b687f..481b5979c636e68ba5cccf35b3140124c3eb6356 100644 (file)
--- a/dftest.c
+++ b/dftest.c
@@ -33,7 +33,7 @@
 #include <wiretap/wtap.h>
 
 #include "ui/util.h"
-#include "register.h"
+#include "epan/register.h"
 
 static void failure_warning_message(const char *msg_format, va_list ap);
 static void open_failure_message(const char *filename, int err,
index 984b062c2009179ab158fc79dc154e0953e4fe48..b0fd8d7eb1e712527226e627ad1b0616a559d86b 100644 (file)
@@ -139,6 +139,7 @@ set(LIBWIRESHARK_PUBLIC_HEADERS
        range.h
        reassemble.h
        reedsolomon.h
+       register.h
        req_resp_hdrs.h
        rtd_table.h
        rtp_pt.h
@@ -228,6 +229,7 @@ set(LIBWIRESHARK_FILES
        range.c
        reassemble.c
        reedsolomon.c
+       register.c
        req_resp_hdrs.c
        rtd_table.c
        sequence_analysis.c
index 945c7b4803b38585cb629c74e9780c7ac0b1fe44..52be37fea61f08a4f261f2ee4bcc0171a9b17520 100644 (file)
@@ -93,6 +93,7 @@ LIBWIRESHARK_SRC = \
        reassemble.c            \
        reedsolomon.c           \
        req_resp_hdrs.c         \
+       register.c              \
        rtd_table.c             \
        sequence_analysis.c     \
        show_exception.c        \
@@ -246,6 +247,7 @@ LIBWIRESHARK_INCLUDES_PUBLIC = \
        range.h                 \
        reassemble.h            \
        reedsolomon.h           \
+       register.h              \
        req_resp_hdrs.h         \
        rtd_table.h             \
        rtp_pt.h                \
similarity index 100%
rename from register.c
rename to epan/register.c
similarity index 90%
rename from register.h
rename to epan/register.h
index 39fefe0780f9ad1b368c4024ddd06c2f98e61686..55c72c2464d139798e1aa2e696379eafb0c42ae6 100644 (file)
@@ -49,7 +49,7 @@ typedef void (*register_cb)(register_action_e action, const char *message, gpoin
  * Messages have the format "proto_register_XXX".
  * @param client_data Data pointer for the callback.
  */
-void register_all_protocols(register_cb cb, gpointer client_data);
+WS_DLL_PUBLIC void register_all_protocols(register_cb cb, gpointer client_data);
 
 /** Call each dissector's protocol handoff routine.
  *
@@ -61,11 +61,11 @@ void register_all_protocols(register_cb cb, gpointer client_data);
  * Messages have the format "proto_reg_handoff_XXX".
  * @param client_data Data pointer for the callback.
  */
-void register_all_protocol_handoffs(register_cb cb, gpointer client_data);
+WS_DLL_PUBLIC void register_all_protocol_handoffs(register_cb cb, gpointer client_data);
 
-extern void register_all_tap_listeners(void);
+WS_DLL_LOCAL void register_all_tap_listeners(void);
 
-gulong register_count(void);
+WS_DLL_PUBLIC gulong register_count(void);
 
 #ifdef __cplusplus
 }
index 850cc2e9e816c5dc8a353f7c51c6dec5c8ba2e05..1c6d9624ea3a87db5dabdcddd3aee29c1ef94630 100644 (file)
@@ -27,7 +27,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#include "register.h"
+#include "epan/register.h"
 #include "ws_symbol_export.h"
 
 WS_DLL_PUBLIC int wslua_count_plugins(void);
index 94417e0661dc270636ff7d433082d816a39e1c03..c3bbb7660d5589d09421e14dc718fc70b70ff30d 100644 (file)
@@ -71,7 +71,7 @@
 #include "ui/util.h"
 #include "ui/dissect_opts.h"
 #include "ui/failure_message.h"
-#include "register.h"
+#include "epan/register.h"
 #include "conditions.h"
 #include "capture_stop_conditions.h"
 #include <epan/epan_dissect.h>
index 66b0694ec76c59e9c4083a65aebf79a540b88a1c..c24e3f3ecc710b0fed5c0c8b798940c2a0941218 100644 (file)
--- a/sharkd.c
+++ b/sharkd.c
@@ -50,7 +50,7 @@
 #include "ui/filter_files.h"
 #include "ui/tap_export_pdu.h"
 #include "ui/failure_message.h"
-#include "register.h"
+#include "epan/register.h"
 #include <epan/epan_dissect.h>
 #include <epan/tap.h>
 
index 8aa09222d113d1404d528d982c2cb8d2a354f6c1..00380bf8e9979a5a367c920846cae2a74ef3e45b 100644 (file)
--- a/tfshark.c
+++ b/tfshark.c
@@ -58,7 +58,7 @@
 #include "ui/util.h"
 #include "ui/decode_as_utils.h"
 #include "ui/dissect_opts.h"
-#include "register.h"
+#include "epan/register.h"
 #include <epan/epan_dissect.h>
 #include <epan/tap.h>
 #include <epan/stat_tap_ui.h>
index f4435df4e0a7a27a4d0cd3567d7106e6538c8a86..1d780979c531b5b912a57b9fa12faa4a082f3c89 100755 (executable)
@@ -154,7 +154,7 @@ reg_code.write("/* Generated automatically from %s  */\n" % (sys.argv[0]))
 
 # Make the routine to register all taps
 reg_code.write("""
-#include "register.h"
+#include "epan/register.h"
 void register_all_tap_listeners(void) {
 """);
 
index 394fd79470e80f21b5b3df7a5030c92c541df137..6164cd31416c536f3e72da6e0d1443fea8627b5c 100755 (executable)
@@ -43,7 +43,7 @@ generate_fuzzer()
       -c -o $WORK/${fuzzer_name}.o \
       $fuzzer_cflags
 
-  $CXX $CXXFLAGS $WORK/register.o $WORK/${fuzzer_name}.o \
+  $CXX $CXXFLAGS $WORK/${fuzzer_name}.o \
       -o $OUT/${fuzzer_name} \
       ${WIRESHARK_FUZZERS_COMMON_FLAGS}
 
@@ -57,10 +57,6 @@ WIRESHARK_FUZZERS_COMMON_FLAGS="-lFuzzingEngine \
     -L"$WIRESHARK_INSTALL_PATH/lib" -lwireshark -lwiretap -lwsutil \
     -Wl,-Bstatic `pkg-config --libs glib-2.0` -pthread -lpcre -lgcrypt -lgpg-error -lz -Wl,-Bdynamic"
 
-$CC $CFLAGS -I $SRC/wireshark/ `pkg-config --cflags glib-2.0` \
-    $SRC/wireshark/register.c \
-    -c -o $WORK/register.o
-
 for dissector in $FUZZ_DISSECTORS; do
   generate_fuzzer "${dissector}" -DFUZZ_DISSECTOR_TARGET=\"$dissector\"
 done
index ccfaca13a29c6feb0471b3277a22881b7d013a06..7e013ba274a7979f98a2979f022347f886e68b67 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -88,7 +88,7 @@
 #if defined(HAVE_GEOIP)
 #include "epan/geoip_db.h"
 #endif
-#include "register.h"
+#include "epan/register.h"
 #include <epan/epan_dissect.h>
 #include <epan/tap.h>
 #include <epan/stat_tap_ui.h>
index a2980bf6bb3b2275001360c0fac51c1e69fc9c6b..5d90c1b4ba9b659321a45e9ed9835b54c7231f59 100644 (file)
@@ -44,7 +44,7 @@
 #endif
 
 #include "../../log.h"
-#include "../../register.h"
+#include "epan/register.h"
 
 #include "ui/last_open_dir.h"
 
index 854d2cc78366db47808d7d072d5d96700c4d0056..79b8c0588247f8c4b409491b144d9d75a76506aa 100644 (file)
@@ -92,7 +92,7 @@
 #include "../../frame_tvbuff.h"
 #include "../../summary.h"
 #include <epan/color_filters.h>
-#include "../../register.h"
+#include "epan/register.h"
 #include "../../ringbuffer.h"
 #include "../../log.h"
 
index c26b4b0052195bc9e0a918dae6c794d119b0a315..79b53eb0b6a80874f83aa6e38ef3bcb7f6ad80f3 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 
 #include "log.h"
-#include "register.h"
+#include "epan/register.h"
 
 #include "ui/alert_box.h"
 #include "ui/last_open_dir.h"
index 3aae85ff5a8359c210ad481f8360d2d00203454b..03c06d9ed27fd0a4d8715ab94751f19063905466 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <glib.h>
 
-#include "register.h"
+#include "epan/register.h"
 
 #include <QWidget>
 #include <QElapsedTimer>
index 83f8fc609334f94d371adeb5c5ea67e06e3a7878..c9d6c9ebba91e40017c9db29fa0f2cebbe3cedbd 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <glib.h>
 
-#include "register.h"
+#include "epan/register.h"
 
 #include "ui/help_url.h"