Skip to content

Commit

Permalink
Add support for AppNeta protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
fklassen committed Nov 28, 2023
1 parent 54eedfc commit 6a84204
Show file tree
Hide file tree
Showing 16 changed files with 3,885 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ set(PROJECT_MAJOR_VERSION 4)
set(PROJECT_MINOR_VERSION 2)
set(PROJECT_PATCH_VERSION 0)
set(PROJECT_BUILD_VERSION 0)
set(PROJECT_VERSION_EXTENSION "")
set(PROJECT_BUILD_VERSION ${GIT_REVISION})
set(PROJECT_VERSION_EXTENSION "-appneta.52")

if(DEFINED ENV{WIRESHARK_VERSION_EXTRA})
set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}")
Expand Down
43 changes: 43 additions & 0 deletions CMakeListsCustom.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# CMakeListsCustom.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Add a list of your custom plugins SRC dir here including the path
#

# Fail CMake stage if any of these plugins are missing from source tree
set(CUSTOM_PLUGIN_SRC_DIR
plugins/epan/ani_payload
plugins/epan/ani_rpp
plugins/epan/twamp
)

# 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
)

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} )
else()
message( WARNING "Custom plugins: No ${_plugin_dir}/CMakeLists.txt file found - ignoring" )
endif()
endforeach()

#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
#
98 changes: 98 additions & 0 deletions README.appneta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
MacOS
=====

References:
-----------

* Code Signing:
* https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html
* https://developer.apple.com/library/archive/technotes/tn2206/_index.html

* Notarizing
* https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution

Prereq:
-------

sudo gem install asciidoctor
pip3 install dmgbuild

Build:
------

Run one time only, or if moving to a new Wireshark revision

MACOSX_SUPPORT_LIBS=/Users/<identity>/git/pvc-appliance/macos-support-libs tools/macos-setup.sh -t 10.14

Here are some exports - CODE_SIGN_IDENTITY as per 'security find-identity -p codesigning -v login.keychain'

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/Users/<identity>/Qt5.12.4/5.12.4/clang_64/lib/pkgconfig
export CMAKE_PREFIX_PATH=/Users/<identity>/Qt5.12.4/5.12.4/clang_64/lib/cmake
export CODE_SIGN_IDENTITY="AppNeta Inc"
PATH=/Users/<identity>/Qt5.12.4/5.12.4/clang_64/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin/:$PATH
export PATH

mkdir build; cd build
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -G Ninja ..
ninja
ninja app_bundle

Notarize:
---------

At this point you may want to notarize the app_bundle - you will require an
application-specific password - https://support.apple.com/en-us/HT204397

cd run
ditto -ck --keepParent Wireshark.app Wireshark.zip
xcrun altool --notarize-app --primary-bundle-id "com.appneta.wireshark.app" --username <apple id> --password <app-specific password> --file Wireshark.zip

Wait up to 5 minutes for success - check using this command

xcrun altool --notarize-history 0 --username <apple id> --password <app-specific password>

Staple the notarization result so app can be verified as notarized when offline

xcrun stapler staple Wireshark.app
cd ..

macOS Package:
--------------

cd run
../packaging/macosx/osx-dmg.sh
xcrun altool --notarize-app --primary-bundle-id "com.appneta.wireshark.dmg" --username <apple id> --password <app-specific password> --file Wireshark\ <version>\ Intel\ 64.dmg
xcrun altool --notarize-history 0 --username <apple id> --password <app-specific password>
xcrun stapler staple Wireshark\ <version>\ Intel\ 64.dmg
cd ..

Linux
=====

To build Linux debug:
---------------------

mkdir -p build-debug
cd build-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j6

Make Linux Package:
------------------

Update version in CMakeList.txt and debian/changelog

$ mkdir -p /tmp/wireshark_3.4.2.appneta.50_repo
pdebuild --use-pdebuild-internal --debbuildopts "-b -a amd64 -us -uc" --buildresult /tmp/wireshark_3.4.2.appneta.50_repo

Once packages are made, do something like:

$ cd /tmp/wireshark_3.4.2.appneta.50_repo
$ dpkg-scanpackages . | xz -c > Packages.xz

Optionally you can move directory and install packages locally
... in /etc/apt/sources.list.d/wireshark.list ...

deb [trusted=yes] file:/home/fklassen/data/wireshark_3.4.2.appneta.50_repo ./
$ sudo apt update
$ sudo apt install wireshark
31 changes: 31 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
wireshark (3.4.3.appneta.52) UNRELEASED; urgency=medium

* fix for windows build

-- AppNeta <[email protected]> Thu, 16 Feb 2021 08:33:48 -0800

wireshark (3.4.3.appneta.51) UNRELEASED; urgency=medium

* fix init.lua build issue

-- AppNeta <[email protected]> Thu, 11 Feb 2021 12:05:12 -0800

wireshark (3.4.2.appneta.50) unstable; urgency=medium

* updates to build on Buster

-- AppNeta <[email protected]> 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 <[email protected]> Wed, 26 May 2020 11:30:00 -0700

wireshark (3.4.5) unstable; urgency=low

* Self-made package

-- Wireshark Self-made package <[email protected]> Mon, 17 Oct 2016 12:05:44 +0200
2 changes: 1 addition & 1 deletion epan/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ packet_cache_proto_handles(void)
file_handle = find_dissector("file");
ws_assert(file_handle != NULL);

data_handle = find_dissector("data");
data_handle = find_dissector("appneta_payload");
ws_assert(data_handle != NULL);

proto_malformed = proto_get_id_by_filter_name("_ws.malformed");
Expand Down
15 changes: 9 additions & 6 deletions packaging/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Catch symbol additions.
export DPKG_GENSYMBOLS_CHECK_LEVEL=4

distrelease := $(shell lsb_release -cs)
ifeq ($(distrelease),n/a)
distrelease := sid
Expand All @@ -31,7 +34,7 @@ endif
dh $@ --with python3 --buildsystem $(DH_BUILDSYSTEM) --with quilt

override_dh_auto_configure:
dh_auto_configure -- -DBUILD_xxx2deb=ON -DBUILD_corbaidl2wrs=ON -DUSE_qt6=OFF
dh_auto_configure -- -DBUILD_xxx2deb=ON -DBUILD_corbaidl2wrs=ON

override_dh_auto_build:
# Ignore warnings from asn2wrs.py about duplicate field names.
Expand All @@ -55,13 +58,13 @@ override_dh_strip:

override_dh_auto_install:
dh_auto_install
ifeq ($(MAKE),ninja)
DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C $(CURDIR)/obj-* install-headers
else
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp -C $(CURDIR)/obj-* install-headers
endif
rm -f debian/*.shlibs
rm -rf $(CURDIR)/debian/tmp/usr/share/wireshark/COPYING
mkdir -p $(CURDIR)/debian/tmp/etc/wireshark/
mv $(CURDIR)/debian/tmp/usr/share/wireshark/init.lua \
$(CURDIR)/debian/tmp/etc/wireshark/
ln -s /etc/wireshark/init.lua \
$(CURDIR)/debian/tmp/usr/share/wireshark/init.lua

override_dh_install:
dh_install
Expand Down
6 changes: 5 additions & 1 deletion packaging/nsis/custom_plugins.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;Add your custom plugins directives here
; Example:
;File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\foo.dll"
;File "${STAGING_DIR}\plugins\${VERSION_MAJOR}.${VERSION_MINOR}\epan\foo.dll"

File "${STAGING_DIR}\plugins\${VERSION_MAJOR}.${VERSION_MINOR}\epan\ani_payload.dll"
File "${STAGING_DIR}\plugins\${VERSION_MAJOR}.${VERSION_MINOR}\epan\ani_rpp.dll"
File "${STAGING_DIR}\plugins\${VERSION_MAJOR}.${VERSION_MINOR}\epan\twamp.dll"
3 changes: 3 additions & 0 deletions packaging/nsis/wireshark.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,9 @@ SetOutPath '$INSTDIR\profiles\No Reassembly'
File "${STAGING_DIR}\profiles\No Reassembly\preferences"

SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan'
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\ani_payload.dll"
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\ani_rpp.dll"
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\twamp.dll"
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\ethercat.dll"
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\gryphon.dll"
File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\irda.dll"
Expand Down
53 changes: 53 additions & 0 deletions plugins/epan/ani_payload/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#

include(WiresharkPlugin)

# Plugin name and version info (major minor micro extra)
set_module_info(ani_payload 0 0 1 0)

set(PLUGIN_FILES
packet-ani-payload.c
)

set_source_files_properties(
${PLUGIN_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)

add_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")
CHECKAPI(
NAME
ani_payload
SWITCHES
-g abort -g termoutput -build
SOURCES
${PLUGIN_FILES}
${PLUGIN_HEADERS}
)

#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
#
Loading

0 comments on commit 6a84204

Please sign in to comment.