diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-12-10 17:29:40 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-12-11 02:52:28 +0000 |
commit | 5fc43fe63a07062587bc3d76256f4240221e8bc7 (patch) | |
tree | 8508ce04e5aec4e0e23ad958f9ec6a5102f93fc0 /ui/gtk | |
parent | 224e24884a8b37732105bd40a0ee85d5feaaeab1 (diff) |
Rewrite make-tap-reg.py in C
Change-Id: Ief5b1fffecc9712c01ff10292c403b7c84a5908a
Reviewed-on: https://code.wireshark.org/review/24756
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/CMakeLists.txt | 51 | ||||
-rw-r--r-- | ui/gtk/Makefile.am | 23 | ||||
-rw-r--r-- | ui/gtk/main.c | 6 |
3 files changed, 32 insertions, 48 deletions
diff --git a/ui/gtk/CMakeLists.txt b/ui/gtk/CMakeLists.txt index 381fa528e1..8f92e08819 100644 --- a/ui/gtk/CMakeLists.txt +++ b/ui/gtk/CMakeLists.txt @@ -193,31 +193,31 @@ if(ENABLE_EXTCAP) endif() set(WIRESHARK_TAP_SRC - compare_stat.c - dcerpc_stat.c - expert_comp_dlg.c - flow_graph.c - funnel_stat.c - gsm_map_summary.c - iax2_analysis.c - io_stat.c - lbm_stream_dlg.c - mac_lte_stat_dlg.c - mcast_stream_dlg.c - mtp3_summary.c - rlc_lte_graph.c - rlc_lte_stat_dlg.c - rpc_stat.c - rtp_analysis.c - rtp_stream_dlg.c - sctp_assoc_analyse.c - sctp_chunk_stat.c - sctp_chunk_stat_dlg.c - sctp_stat_dlg.c - stats_tree_stat.c - tcp_graph.c - voip_calls_dlg.c - wlan_stat_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/compare_stat.c + ${CMAKE_CURRENT_SOURCE_DIR}/dcerpc_stat.c + ${CMAKE_CURRENT_SOURCE_DIR}/expert_comp_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/flow_graph.c + ${CMAKE_CURRENT_SOURCE_DIR}/funnel_stat.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_map_summary.c + ${CMAKE_CURRENT_SOURCE_DIR}/iax2_analysis.c + ${CMAKE_CURRENT_SOURCE_DIR}/io_stat.c + ${CMAKE_CURRENT_SOURCE_DIR}/lbm_stream_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/mac_lte_stat_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/mcast_stream_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/mtp3_summary.c + ${CMAKE_CURRENT_SOURCE_DIR}/rlc_lte_graph.c + ${CMAKE_CURRENT_SOURCE_DIR}/rlc_lte_stat_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/rpc_stat.c + ${CMAKE_CURRENT_SOURCE_DIR}/rtp_analysis.c + ${CMAKE_CURRENT_SOURCE_DIR}/rtp_stream_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/sctp_assoc_analyse.c + ${CMAKE_CURRENT_SOURCE_DIR}/sctp_chunk_stat.c + ${CMAKE_CURRENT_SOURCE_DIR}/sctp_chunk_stat_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/sctp_stat_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/stats_tree_stat.c + ${CMAKE_CURRENT_SOURCE_DIR}/tcp_graph.c + ${CMAKE_CURRENT_SOURCE_DIR}/voip_calls_dlg.c + ${CMAKE_CURRENT_SOURCE_DIR}/wlan_stat_dlg.c ${WIRESHARK_CUSTOM_TAP_SRC} ) @@ -263,7 +263,6 @@ if(WIN32) endif() register_tap_files(wireshark-tap-register.c - taps ${WIRESHARK_TAP_SRC} ) diff --git a/ui/gtk/Makefile.am b/ui/gtk/Makefile.am index 14e375df3c..035a00f29a 100644 --- a/ui/gtk/Makefile.am +++ b/ui/gtk/Makefile.am @@ -269,10 +269,6 @@ endif AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS) $(GTK_CFLAGS) \ $(PORTAUDIO_INCLUDES) -CLEANFILES = \ - wireshark-tap-register.c-tmp \ - wireshark-tap-register-cache.pkl - DISTCLEANFILES = \ $(NODIST_GENERATED_FILES) @@ -314,23 +310,8 @@ nodist_libgtkui_a_SOURCES = \ libgtkui_a_DEPENDENCIES = -# -# Build "wireshark-tap-register.c", which contains a function -# "register_all_tap_listeners()" -# that calls the register routines for all wireshark tap listeners. -# -# We do this by grepping through sources. -# -# Formatting conventions: The name of the tap_listener_register_* -# routines must start in column zero, or must be preceded only by -# "void " starting in column zero, and must not be inside #if. -# -# The first argument is the directory in which the source files live. -# All subsequent arguments are the files to scan. -# -wireshark-tap-register.c: $(WIRESHARK_TAP_SRC) Makefile_custom.common $(top_srcdir)/tools/make-tap-reg.py - @echo Making wireshark-tap-register.c - @$(PYTHON) $(top_srcdir)/tools/make-tap-reg.py $(srcdir) taps $(WIRESHARK_TAP_SRC) +wireshark-tap-register.c: $(WIRESHARK_TAP_SRC) ../make-taps + $(AM_V_GEN)../make-taps $@ $(filter %.c,$^) wireshark-gresources.c: main.gresources.xml $(shell glib-compile-resources --sourcedir=$(top_srcdir) --generate-dependencies $(srcdir)/main.gresources.xml) @echo Making $@ diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 6c0e1c1466..075f4995bf 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -112,6 +112,7 @@ #include "ui/util.h" #include "ui/dissect_opts.h" #include "ui/commandline.h" +#include "ui/taps.h" #ifdef HAVE_LIBPCAP #include "ui/capture_ui_utils.h" @@ -2236,7 +2237,10 @@ main(int argc, char *argv[]) register_all_plugin_tap_listeners(); #endif - register_all_tap_listeners(); + /* Register all tap listeners. */ + for (tap_reg_t *t = tap_reg_listener; t->cb_func != NULL; t++) { + t->cb_func(); + } conversation_table_set_gui_info(init_conversation_table); hostlist_table_set_gui_info(init_hostlist_table); srt_table_iterate_tables(register_service_response_tables, NULL); |