Skip to content

Commit

Permalink
update Windows build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
fklassen committed Nov 29, 2023
1 parent 6a84204 commit d4e811a
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 77 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
9 changes: 8 additions & 1 deletion CMakeListsCustom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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} )
Expand Down
31 changes: 31 additions & 0 deletions README.appneta.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

31 changes: 0 additions & 31 deletions debian/changelog

This file was deleted.

4 changes: 4 additions & 0 deletions packaging/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
19 changes: 13 additions & 6 deletions plugins/epan/ani_payload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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}
)

#
Expand Down
1 change: 0 additions & 1 deletion plugins/epan/ani_payload/packet-ani-payload.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/


#include "config.h"

/* plugins are DLLs */
Expand Down
26 changes: 16 additions & 10 deletions plugins/epan/ani_rpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
#
Expand Down
46 changes: 29 additions & 17 deletions plugins/epan/ani_rpp/packet-ani-rpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
26 changes: 16 additions & 10 deletions plugins/epan/twamp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set_module_info(twamp 0 0 1 0)

set(PLUGIN_FILES
packet-twamp.c
${DISSECTOR_SRC}
)

set_source_files_properties(
Expand All @@ -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
#
Expand Down

0 comments on commit d4e811a

Please sign in to comment.