From d4e811acbba80a9d487143b002c69e2f4edc27a7 Mon Sep 17 00:00:00 2001 From: Fred Klassen Date: Wed, 24 Mar 2021 14:32:59 -0700 Subject: [PATCH] update Windows build instructions --- CMakeLists.txt | 2 +- CMakeListsCustom.txt | 9 +++- README.appneta.md | 31 +++++++++++++ debian/changelog | 31 ------------- packaging/debian/rules | 4 ++ plugins/epan/ani_payload/CMakeLists.txt | 19 +++++--- plugins/epan/ani_payload/packet-ani-payload.c | 1 - plugins/epan/ani_rpp/CMakeLists.txt | 26 +++++++---- plugins/epan/ani_rpp/packet-ani-rpp.c | 46 ++++++++++++------- plugins/epan/twamp/CMakeLists.txt | 26 +++++++---- 10 files changed, 118 insertions(+), 77 deletions(-) delete mode 100644 debian/changelog diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e1517a61af5..085fa1744421 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ set(PROJECT_MINOR_VERSION 2) set(PROJECT_PATCH_VERSION 0) set(PROJECT_BUILD_VERSION 0) set(PROJECT_BUILD_VERSION ${GIT_REVISION}) -set(PROJECT_VERSION_EXTENSION "-appneta.52") +set(PROJECT_VERSION_EXTENSION ".appneta.57") if(DEFINED ENV{WIRESHARK_VERSION_EXTRA}) set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}") diff --git a/CMakeListsCustom.txt b/CMakeListsCustom.txt index 47c68b6d9044..fe0622036f94 100644 --- a/CMakeListsCustom.txt +++ b/CMakeListsCustom.txt @@ -18,9 +18,16 @@ set(CUSTOM_PLUGIN_SRC_DIR # Do not fail CMake stage if any of the optional plugins are missing from source tree set(_OPTIONAL_CUSTOM_PLUGIN_SRC_DIR - plugins/epan/bar + #plugins/epan/bar ) + +# Add your custom TShark taps here +set(CUSTOM_TSHARK_TAP_SRC +# ui/cli/tap-baz.c +) + +# This loop handles supporting optional plugins foreach( _plugin_dir ${_OPTIONAL_CUSTOM_PLUGIN_SRC_DIR} ) if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_plugin_dir}/CMakeLists.txt ) list( APPEND CUSTOM_PLUGIN_SRC_DIR ${_plugin_dir} ) diff --git a/README.appneta.md b/README.appneta.md index 5665127c4c2c..09eb662ec87d 100644 --- a/README.appneta.md +++ b/README.appneta.md @@ -96,3 +96,34 @@ Optionally you can move directory and install packages locally deb [trusted=yes] file:/home/fklassen/data/wireshark_3.4.2.appneta.50_repo ./ $ sudo apt update $ sudo apt install wireshark + +Windows +======= + +* Set up as per [install guide](https://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html). + No need to install Git, CMake, Python or Perl on Windows Dev machine. Install Qt5 not Qt6. + +* I had to open a regular Command Prompt and run + `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"` + rather than open a "x64 Native Tools Command Prompt for VS 2019". + +* Set the following environmental variables e.g. + + > set WIRESHARK_BASE_DIR=C:\Users\fklassen\git + > set WIRESHARK_VERSION_EXTRA=-appneta.52 + > set QT5_BASE_DIR=C:\Qt\5.15.2\msvc2019_64\ + +* Create a build directory and change into it e.g + + > mkdir ..\wsbuild64 + > cd ..\wsbuild64 + +* Generate build files + + > "C:\Program Files\CMake\bin\cmake" -G "Visual Studio 16 2019" -A x64 ..\wireshark + +* Make + + > msbuild /m /p:Configuration=RelWithDebInfo Wireshark.sln + + diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 3c9e3994578d..000000000000 --- a/debian/changelog +++ /dev/null @@ -1,31 +0,0 @@ -wireshark (3.4.3.appneta.52) UNRELEASED; urgency=medium - - * fix for windows build - - -- AppNeta Thu, 16 Feb 2021 08:33:48 -0800 - -wireshark (3.4.3.appneta.51) UNRELEASED; urgency=medium - - * fix init.lua build issue - - -- AppNeta Thu, 11 Feb 2021 12:05:12 -0800 - -wireshark (3.4.2.appneta.50) unstable; urgency=medium - - * updates to build on Buster - - -- AppNeta Wed, 20 Jan 2021 19:50:12 -0800 - -wireshark (3.2.5.appneta.49) unstable; urgency=medium - - * macOS installer supports Mojave and Catalina - * macosx-setup non-sudo mode - * update to 3.2.5 - - -- AppNeta Wed, 26 May 2020 11:30:00 -0700 - -wireshark (3.4.5) unstable; urgency=low - - * Self-made package - - -- Wireshark Self-made package Mon, 17 Oct 2016 12:05:44 +0200 diff --git a/packaging/debian/rules b/packaging/debian/rules index 40d8ce257ffc..a223943ad023 100755 --- a/packaging/debian/rules +++ b/packaging/debian/rules @@ -61,6 +61,7 @@ override_dh_auto_install: rm -f debian/*.shlibs rm -rf $(CURDIR)/debian/tmp/usr/share/wireshark/COPYING mkdir -p $(CURDIR)/debian/tmp/etc/wireshark/ + cp /etc/wireshark/init.lua $(CURDIR)/debian/tmp/usr/share/wireshark/ mv $(CURDIR)/debian/tmp/usr/share/wireshark/init.lua \ $(CURDIR)/debian/tmp/etc/wireshark/ ln -s /etc/wireshark/init.lua \ @@ -71,6 +72,9 @@ override_dh_install: # check all necessary headers are included $(CC) -c debian/headers-check.c $(shell pkg-config --cflags glib-2.0) $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS) -Idebian/libwireshark-dev/usr/include -Idebian/libwireshark-dev/usr/include/wireshark -Idebian/libwiretap-dev/usr/include/wireshark -Idebian/libwsutil-dev/usr/include/wireshark -o /dev/null +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + override_dh_fixperms: dh_fixperms chmod 644 debian/wireshark-dev/usr/share/pyshared/make-plugin-reg.py \ diff --git a/plugins/epan/ani_payload/CMakeLists.txt b/plugins/epan/ani_payload/CMakeLists.txt index e878fecf672f..cf58a33f36c1 100644 --- a/plugins/epan/ani_payload/CMakeLists.txt +++ b/plugins/epan/ani_payload/CMakeLists.txt @@ -14,6 +14,7 @@ set_module_info(ani_payload 0 0 1 0) set(PLUGIN_FILES packet-ani-payload.c + ${DISSECTOR_SRC} ) set_source_files_properties( @@ -22,21 +23,27 @@ set_source_files_properties( COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) -add_plugin_library(ani_payload epan) +register_plugin_files(plugin.c + plugin + ${DISSECTOR_SRC} +) + +add_wireshark_plugin_library(ani_payload epan) target_link_libraries(ani_payload epan) install_plugin(ani_payload epan) -file(GLOB PLUGIN_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") +file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME - ani_payload + ani_payload SWITCHES - -g abort -g termoutput -build + --group dissectors-prohibited + --group dissectors-restricted SOURCES - ${PLUGIN_FILES} - ${PLUGIN_HEADERS} + ${DISSECTOR_SRC} + ${DISSECTOR_HEADERS} ) # diff --git a/plugins/epan/ani_payload/packet-ani-payload.c b/plugins/epan/ani_payload/packet-ani-payload.c index 3910f5831617..635715ad4dfd 100644 --- a/plugins/epan/ani_payload/packet-ani-payload.c +++ b/plugins/epan/ani_payload/packet-ani-payload.c @@ -20,7 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include "config.h" /* plugins are DLLs */ diff --git a/plugins/epan/ani_rpp/CMakeLists.txt b/plugins/epan/ani_rpp/CMakeLists.txt index a40bbab639f1..01aa46b298d1 100644 --- a/plugins/epan/ani_rpp/CMakeLists.txt +++ b/plugins/epan/ani_rpp/CMakeLists.txt @@ -14,6 +14,7 @@ set_module_info(ani_rpp 0 0 1 0) set(PLUGIN_FILES packet-ani-rpp.c + ${DISSECTOR_SRC} ) set_source_files_properties( @@ -22,23 +23,28 @@ set_source_files_properties( COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) -add_plugin_library(ani_rpp epan) +register_plugin_files(plugin.c + plugin + ${DISSECTOR_SRC} +) + +add_wireshark_plugin_library(ani_rpp epan) target_link_libraries(ani_rpp epan) install_plugin(ani_rpp epan) -file(GLOB PLUGIN_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") +file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( - NAME - ani_rpp - SWITCHES - -g abort -g termoutput -build - SOURCES - ${PLUGIN_FILES} - ${PLUGIN_HEADERS} + NAME + ani_rpp + SWITCHES + --group dissectors-prohibited + --group dissectors-restricted + SOURCES + ${DISSECTOR_SRC} + ${DISSECTOR_HEADERS} ) - # # Editor modelines - http://www.wireshark.org/tools/modelines.html # diff --git a/plugins/epan/ani_rpp/packet-ani-rpp.c b/plugins/epan/ani_rpp/packet-ani-rpp.c index 0bc2389170d1..6c9611bc741d 100644 --- a/plugins/epan/ani_rpp/packet-ani-rpp.c +++ b/plugins/epan/ani_rpp/packet-ani-rpp.c @@ -706,24 +706,36 @@ dissect_responder_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ani_rpp_ "Request Header"); break; case HDR_REPLY: - current_tree = add_subtree(tvb, &offset, current_tree, currentHeader, headerLength, - "Reply Header"); - /* the next 28 bytes are the ip and udp headers to be used in the response */ - /* Save the current value of the "we're inside an error packet" - flag, and set that flag; subdissectors may treat packets - that are the payload of error packets differently from - "real" packets. */ - save_in_error_pkt = pinfo->flags.in_error_pkt; - pinfo->flags.in_error_pkt = TRUE; - - next_tvb = tvb_new_subset_remaining(tvb, offset); - set_actual_length(next_tvb, 28); - if (ip_handle) { - call_dissector( ip_handle, next_tvb, pinfo, current_tree); - } + if (tvb_reported_length(tvb) >= 28 && ip_handle) { + guint8 version; + + version = tvb_get_guint8(tvb, offset + 2) >> 4; + current_tree = add_subtree(tvb, &offset, current_tree, currentHeader, headerLength, + "Reply Header"); + /* Save the current value of the "we're inside an error packet" + * flag, and set that flag; subdissectors may treat packets + * that are the payload of error packets differently from + * "real" packets. + */ + save_in_error_pkt = pinfo->flags.in_error_pkt; + pinfo->flags.in_error_pkt = TRUE; + + next_tvb = tvb_new_subset_remaining(tvb, offset); + if (version == 4) { + /* the next 28 bytes are the ipv4 and udp headers to be used in the response */ + set_actual_length(next_tvb, 28); + call_dissector(ip_handle, next_tvb, pinfo, current_tree); + } else if (version == 6 && tvb_reported_length(next_tvb) >= 48) { + /* the next 48 bytes are the ipv6 and udp headers to be used in the response */ + set_actual_length(next_tvb, 48); + call_dissector(ip_handle, next_tvb, pinfo, current_tree); + } else { + save_in_error_pkt = TRUE; + } - /* Restore the "we're inside an error packet" flag. */ - pinfo->flags.in_error_pkt = save_in_error_pkt; + /* Restore the "we're inside an error packet" flag. */ + pinfo->flags.in_error_pkt = save_in_error_pkt; + } break; case HDR_FLOW_CREATE: current_tree = add_subtree(tvb, &offset, current_tree, currentHeader, headerLength, diff --git a/plugins/epan/twamp/CMakeLists.txt b/plugins/epan/twamp/CMakeLists.txt index 9289ac6001b5..5ae85885467f 100644 --- a/plugins/epan/twamp/CMakeLists.txt +++ b/plugins/epan/twamp/CMakeLists.txt @@ -14,6 +14,7 @@ set_module_info(twamp 0 0 1 0) set(PLUGIN_FILES packet-twamp.c + ${DISSECTOR_SRC} ) set_source_files_properties( @@ -22,23 +23,28 @@ set_source_files_properties( COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) -add_plugin_library(twamp epan) +register_plugin_files(plugin.c + plugin + ${DISSECTOR_SRC} +) + +add_wireshark_plugin_library(twamp epan) target_link_libraries(twamp epan) install_plugin(twamp epan) -file(GLOB PLUGIN_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") +file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( - NAME - twamp - SWITCHES - -g abort -g termoutput -build - SOURCES - ${PLUGIN_FILES} - ${PLUGIN_HEADERS} + NAME + twamp + SWITCHES + --group dissectors-prohibited + --group dissectors-restricted + SOURCES + ${DISSECTOR_SRC} + ${DISSECTOR_HEADERS} ) - # # Editor modelines - http://www.wireshark.org/tools/modelines.html #