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 Dec 2, 2023
1 parent 54eedfc commit a8ec7d7
Show file tree
Hide file tree
Showing 9 changed files with 3,307 additions and 4 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.58")

if(DEFINED ENV{WIRESHARK_VERSION_EXTRA})
set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}")
Expand Down
131 changes: 131 additions & 0 deletions README.appneta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
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
brew install pkgconfig sparkle doxygen libp11 libgnutils gettext asciidoctor docbook docbook-xsl
brew install --cask libndi

Build:
------

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

tools/macos-setup.sh --install-optional

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=13.0 -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

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

3 changes: 3 additions & 0 deletions epan/dissectors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ set(CLEAN_ASN1_DISSECTOR_SRC
${CMAKE_CURRENT_SOURCE_DIR}/packet-acp133.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-acse.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-ain.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-ani-payload.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-ani-rpp.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-ansi_tcap.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-atn-ulcs.c
${CMAKE_CURRENT_SOURCE_DIR}/packet-atn-cm.c
Expand Down Expand Up @@ -270,6 +272,7 @@ set(DISSECTOR_PUBLIC_HEADERS
packet-afp.h
packet-alcap.h
packet-amp.h
packet-ani-payload.h
packet-ansi_a.h
packet-ansi_map.h
packet-ansi_tcap.h
Expand Down
Loading

0 comments on commit a8ec7d7

Please sign in to comment.