language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
Inno Setup Script
wireshark/packaging/macosx/logray-app.dmgbuild.in
# -*- coding: utf-8 -*- from __future__ import unicode_literals import biplist import os.path # # Example settings file for dmgbuild # # Adapted from https://raw.githubusercontent.com/al45tair/dmgbuild/master/examples/settings.py # Use like this: dmgbuild -s settings.py "Test Volume" test.dmg # You can actually use this file for your own application (not just TextEdit) # by doing e.g. # # dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg # .. Useful stuff .............................................................. lr_version = '@LOG_PROJECT_VERSION@' lr_volname = 'Logray ' + lr_version lr_srcdir = '@CMAKE_SOURCE_DIR@' lr_bindir = '@CMAKE_BINARY_DIR@' lr_app = 'Logray.app' lr_readme = 'Read me first.html' lr_install_chmodbpf = 'Install ChmodBPF.pkg' lr_uninstall_chmodbpf = 'Uninstall ChmodBPF.pkg' lr_install_path_helper = 'Add Logray to the system path.pkg' lr_uninstall_path_helper = 'Remove Logray from the system path.pkg' # .. Basics .................................................................... # Uncomment to override the output filename # filename = lr_volname + ' Intel 64.dmg' # Uncomment to override the output volume name # volume_name = 'Logray ' + lr_version # From the hdiutil man page: # UDZO - UDIF zlib-compressed image # UDBZ - UDIF bzip2-compressed image (Mac OS X 10.4+ only) # ULFO - UDIF lzfse-compressed image (OS X 10.11+ only) # ULMO - UDIF lzma-compressed image (macOS 10.15+ only) # Volume format (see hdiutil create -help) # https://developer.apple.com/forums/thread/128166 # currently (Jan 2023) says to use UDZO format = defines.get('format', 'UDZO') # Compression level (if relevant) compression_level = 9 # Volume size size = None # Files to include files = [ os.path.join(lr_bindir, 'run', lr_app), os.path.join(lr_bindir, 'packaging', 'macosx', 'logray', lr_readme), ] # Symlinks to create symlinks = { 'Applications': '/Applications', } # Volume icon # # You can either define icon, in which case that icon file will be copied to the # image, *or* you can define badge_icon, in which case the icon file you specify # will be used to badge the system's Removable Disk icon # badge_icon = os.path.join(lr_srcdir, 'packaging', 'macosx', 'lriconvol.icns') #badge_icon = icon_from_app(application) # Where to put the icons icon_locations = { lr_app: ( 80, 64), 'Applications': (240, 64), lr_readme: (160, 170), lr_install_chmodbpf: ( 80, 276), lr_uninstall_chmodbpf: (250, 276), lr_install_path_helper: ( 80, 382), lr_uninstall_path_helper: (250, 382), } # .. Window configuration ...................................................... # Background # # This is a STRING containing any of the following: # # #3344ff - web-style RGB color # #34f - web-style RGB color, short form (#34f == #3344ff) # rgb(1,0,0) - RGB color, each value is between 0 and 1 # hsl(120,1,.5) - HSL (hue saturation lightness) color # hwb(300,0,0) - HWB (hue whiteness blackness) color # cmyk(0,1,0,0) - CMYK color # goldenrod - X11/SVG named color # builtin-arrow - A simple built-in background with a blue arrow # /foo/bar/baz.png - The path to an image file # # The hue component in hsl() and hwb() may include a unit; it defaults to # degrees ('deg'), but also supports radians ('rad') and gradians ('grad' # or 'gon'). # # Other color components may be expressed either in the range 0 to 1, or # as percentages (e.g. 60% is equivalent to 0.6). background = os.path.join(lr_srcdir, 'packaging', 'macosx', 'dmg_background.png') show_status_bar = False show_tab_view = False show_toolbar = False show_pathbar = False show_sidebar = False sidebar_width = 180 # Window position in ((x, y), (w, h)) format window_rect = ((600, 200), (350, 525)) # Select the default view; must be one of # # 'icon-view' # 'list-view' # 'column-view' # 'coverflow' # default_view = 'icon-view' # General view configuration show_icon_preview = False # Set these to True to force inclusion of icon/list view settings (otherwise # we only include settings for the default view) include_icon_view_settings = 'auto' include_list_view_settings = 'auto' # .. Icon view configuration ................................................... arrange_by = None grid_offset = (0, 0) #grid_spacing = 100 scroll_position = (0, 0) #label_pos = 'bottom' # or 'right' text_size = 12 icon_size = 72
Inno Setup Script
wireshark/packaging/macosx/logray-dsym.dmgbuild.in
# -*- coding: utf-8 -*- from __future__ import unicode_literals import biplist import os.path # # Example settings file for dmgbuild # # Adapted from https://raw.githubusercontent.com/al45tair/dmgbuild/master/examples/settings.py # Use like this: dmgbuild -s settings.py "Test Volume" test.dmg # You can actually use this file for your own application (not just TextEdit) # by doing e.g. # # dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg # .. Useful stuff .............................................................. lw_version = '@LOG_PROJECT_VERSION@' lw_volname = 'Logray Debugging Symbols' + lw_version lw_srcdir = '@CMAKE_SOURCE_DIR@' lw_bindir = '@CMAKE_BINARY_DIR@' lw_app_dsym = 'Logray.dSYM' lw_readme_dsym = 'Debugging symbols installation.html' # .. Basics .................................................................... # Uncomment to override the output filename # filename = lw_volname + ' Intel 64.dmg' # Uncomment to override the output volume name # volume_name = 'Logray ' + lw_version # From the hdiutil man page: # UDZO - UDIF zlib-compressed image # UDBZ - UDIF bzip2-compressed image (Mac OS X 10.4+ only) # ULFO - UDIF lzfse-compressed image (OS X 10.11+ only) # ULMO - UDIF lzma-compressed image (macOS 10.15+ only) # Volume format (see hdiutil create -help) # dSYMs are huge, so compress them with UDBZ despite what # https://developer.apple.com/forums/thread/128166 # currently (Jan 2023) says. format = defines.get('format', 'UDBZ') # Compression level (if relevant) compression_level = 9 # Volume size size = None # Files to include files = [ os.path.join(lw_bindir, 'run', lw_app_dsym), os.path.join(lw_bindir, 'packaging', 'macosx', 'logray', lw_readme_dsym), ] # Symlinks to create symlinks = { 'Applications': '/Applications', } # Volume icon # # You can either define icon, in which case that icon file will be copied to the # image, *or* you can define badge_icon, in which case the icon file you specify # will be used to badge the system's Removable Disk icon # badge_icon = os.path.join(lw_srcdir, 'packaging', 'macosx', 'lriconvol.icns') #badge_icon = icon_from_app(application) # Where to put the icons icon_locations = { lw_app_dsym: ( 80, 64), 'Applications': (240, 64), lw_readme_dsym: (160, 170), } # .. Window configuration ...................................................... # Background # # This is a STRING containing any of the following: # # #3344ff - web-style RGB color # #34f - web-style RGB color, short form (#34f == #3344ff) # rgb(1,0,0) - RGB color, each value is between 0 and 1 # hsl(120,1,.5) - HSL (hue saturation lightness) color # hwb(300,0,0) - HWB (hue whiteness blackness) color # cmyk(0,1,0,0) - CMYK color # goldenrod - X11/SVG named color # builtin-arrow - A simple built-in background with a blue arrow # /foo/bar/baz.png - The path to an image file # # The hue component in hsl() and hwb() may include a unit; it defaults to # degrees ('deg'), but also supports radians ('rad') and gradians ('grad' # or 'gon'). # # Other color components may be expressed either in the range 0 to 1, or # as percentages (e.g. 60% is equivalent to 0.6). background = os.path.join(lw_srcdir, 'packaging', 'macosx', 'dmg_background.png') show_status_bar = False show_tab_view = False show_toolbar = False show_pathbar = False show_sidebar = False sidebar_width = 180 # Window position in ((x, y), (w, h)) format window_rect = ((600, 200), (350, 325)) # Select the default view; must be one of # # 'icon-view' # 'list-view' # 'column-view' # 'coverflow' # default_view = 'icon-view' # General view configuration show_icon_preview = False # Set these to True to force inclusion of icon/list view settings (otherwise # we only include settings for the default view) include_icon_view_settings = 'auto' include_list_view_settings = 'auto' # .. Icon view configuration ................................................... arrange_by = None grid_offset = (0, 0) #grid_spacing = 100 scroll_position = (0, 0) #label_pos = 'bottom' # or 'right' text_size = 12 icon_size = 72
Inno Setup Script
wireshark/packaging/macosx/LograyInfo.plist.in
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>Logray</string> <key>CFBundleGetInfoString</key> <string>@LOG_PROJECT_VERSION@, Copyright 1998-2023 Wireshark Development Team</string> <key>CFBundleIconFile</key> <string>Logray.icns</string> <key>CFBundleIdentifier</key> <string>org.wireshark.Logray</string> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeExtensions</key> <array> <string>scap</string> <string>scap.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Sysdig capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <!-- XXX - This dictionary needs a lot more entries --> </array> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>@LOG_PROJECT_VERSION@</string> <key>CFBundleSignature</key> <string>Lgry</string> <key>CFBundleVersion</key> <string>@LOG_PROJECT_VERSION@</string> <key>NSHumanReadableCopyright</key> <string>Copyright 1998-2023 Wireshark Developers, GNU General Public License.</string> <key>NSPrincipalClass</key> <string>NSApplication</string> <key>NSHighResolutionCapable</key> <true/> <!-- Force dark mode support. --> <key>NSRequiresAquaSystemAppearance</key> <false/> <key>LSMinimumSystemVersion</key> <string>@MIN_MACOS_VERSION@</string> <!-- Sparkle settings https://sparkle-project.org/documentation/customization/ --> <key>SUFeedURL</key> <string>https://www.wireshark.org/update/0/Logray/@LOG_PROJECT_MAJOR_VERSION@.@LOG_PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@/macOS/x86-64/en-US/stable.xml</string> <key>SUEnableAutomaticChecks</key> <false/> <key>SUPublicEDKey</key> <string>BeSuPpEZOmOzkON9QMnfIdwyi06P/LcVoik8M5O2bsQ=</string> <key>SUEnableSystemProfiling</key> <false/> <!-- Disable automatic updates here, then enable them at program startup depending on prefs.gui_update_enabled. --> <key>SUAutomaticallyUpdate</key> <false/> </dict> </plist>
AsciiDoc
wireshark/packaging/macosx/Logray_dsym_installation.adoc
// Required attributes: // include-dir include::{include-dir}/attributes.adoc[] :stylesheet: {include-dir}/ws.css == Debugging Symbols for Logray This archive contains the debugging symbols for Logray {logray-version}. The debugging symbols are only necessary if Logray is crashing and you need to report an issue to the Logray development team. WARNING: This won't work properly with any version other than Logray {logray-version}. To install the symbols, drag _Logray.dSYM_ to the same location as _Logray_. This is usually your _Applications_ folder. To uninstall, drag _Logray.dSYM_ to the trash.
AsciiDoc
wireshark/packaging/macosx/Logray_read_me_first.adoc
// Required attributes: // include-dir // min-macos-version include::{include-dir}/attributes.adoc[] :stylesheet: {include-dir}/ws.css == Before You Begin This release of Logray requires macOS {min-macos-version} or later. If you are running an earlier version of macOS you can install using another packaging system such as Homebrew or MacPorts. == Quick Setup To install Logray, drag the _Logray_ application bundle to the _Applications_ folder. //// If you would like to add the path to https://www.wireshark.org/docs/man-pages/wireshark.html[Logray], https://www.wireshark.org/docs/man-pages/tshark.html[TShark], https://www.wireshark.org/docs/man-pages/capinfos.html[capinfos], https://www.wireshark.org/docs/man-pages/editcap.html[editcap], and https://www.wireshark.org/docs/man-pages/[other command line utilities] to the system PATH, install the link:Logray.app/Contents/Resources/Extras/Add%20Wireshark%20to%20the%20system%20path.pkg[Add Logray to the system path] package. //// == Uninstalling To uninstall Logray, do the following: . Remove _/Applications/Logray.app_
Shell Script
wireshark/packaging/macosx/notarize-dmg.sh
#!/bin/bash # # USAGE # notarize-dmg -u <developer id> "/path/to/Wireshark x.y.z arch.dmg" # https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution # https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/customizing_the_notarization_workflow bundle_id="org.wireshark.dmg.$( printf "%04x" $RANDOM )" # Parse command line arguments while getopts u: OPTCHAR do case $OPTCHAR in u) username="$OPTARG" shift 2 ;; *) echo "Invalid command line option" exit 2 ;; esac done dmg_file="$1" if [[ "$username" != *?@*? ]] ; then echo "Username doesn't appear to be a valid Apple developer ID." exit 1 fi if [ ! -r "$dmg_file" ] ; then echo "Can't find file: ${dmg_file:-No file specified}" exit 1 fi # XXX Set account to $username instead? generic_pw_service="WS_DMG_NOTARIZE" if ! security find-generic-password -a "$username" -s "$generic_pw_service" > /dev/null 2>&1 ; then echo -e "No keychain credentials found. You can add them by running\\n" echo -e " security add-generic-password -a $username -s $generic_pw_service -T altool -w\\n" exit 2 fi echo -e "Notarizing $dmg_file\\n" echo -e "SHA256 pre: $(shasum -a 256 "$dmg_file" | awk '{print $1}' )\\n" if ! altool_out=$( mktemp /tmp/notarize-dmg.out.XXXXX ) ; then echo "Unable to create temp file" exit 1 fi # trap 'rm -f "$altool_out"' EXIT xcrun altool \ --notarize-app \ --type osx \ --username "$username" \ --password "@keychain:${generic_pw_service}" \ --primary-bundle-id "$bundle_id" \ --file "$dmg_file" \ 2>&1 | tee "$altool_out" request_uuid=$( awk '/^RequestUUID/ { print $3 }' < "$altool_out") if [[ "$request_uuid" != *-*-*-*-* ]] ; then echo "Unable to fetch request UUID" exit 1 fi notarization_info_cmd=(xcrun altool \ --notarization-info "$request_uuid" \ --user "$username" \ --password "@keychain:${generic_pw_service}" \ ) start=$SECONDS max_status_wait=$(( 20 * 60)) start=$SECONDS while true ; do printf "\\nWaiting 15s \xe2\x80\xa6 " sleep 15 elapsed=$(( SECONDS - start )) echo "done. Checking status after ${elapsed}s" "${notarization_info_cmd[@]}" 2>&1 | tee "$altool_out" grep "Status: in progress" "$altool_out" > /dev/null 2>&1 || break if [[ $elapsed -gt $max_status_wait ]] ; then break ; fi done staple_cmd=(xcrun stapler staple "$dmg_file") if ! grep "Status: success" "$altool_out" > /dev/null 2>&1 ; then echo "Notarization failed or timed out:" cat "$altool_out" echo -e "\\nInfo command:" echo "${notarization_info_cmd[@]}" echo -e "\\nStaple command:" echo "${staple_cmd[@]}" echo "You can check the status of the Notary Service at https://developer.apple.com/system-status/." exit 1 fi echo -e "\\nStapling $dmg_file" "${staple_cmd[@]}" echo -e "\\nSHA256 post: $(shasum -a 256 "$dmg_file" | awk '{print $1}' )" # macOS 10.14.5+ requires notarization in order for this to pass? # https://wiki.lazarus.freepascal.org/Notarization_for_macOS_10.14.5%2B spctl --assess --type open --context context:primary-signature --verbose=2 "$dmg_file" || exit 1
Inno Setup Script
wireshark/packaging/macosx/osx-app.sh.in
#!/bin/bash # # USAGE # osx-app [-s] [-l /path/to/libraries] # # This script attempts to build an application bundle for macOS, resolving # dynamic libraries, etc. # It strips the executable and libraries if '-s' is given. # # AUTHORS # Kees Cook <[email protected]> # Michael Wybrow <[email protected]> # Jean-Olivier Irisson <[email protected]> # # Copyright (C) 2005 Kees Cook # Copyright (C) 2005-2007 Michael Wybrow # Copyright (C) 2007 Jean-Olivier Irisson # # Released under GNU GPL, read the file 'COPYING' for more information # # Thanks to GNUnet's "build_app" script for help with library dep resolution. # https://gnunet.org/svn/GNUnet/contrib/OSX/build_app # # NB: # This originally came from Inkscape; Inkscape's configure script has an # "--enable-osxapp", which causes some of Inkscape's installation data # files to have macOS-ish paths under Contents/Resources of the bundle # or under /Library/Application Support. We don't have such an option; # we just put them in "bin", "etc", "lib", and "share" directories # under Contents/Resources, rather than in the "bin", "etc", "lib", # and "share" directories under the installation directory. # # XXX We could probably replace a lot of this with https://github.com/auriamg/macdylibbundler shopt -s extglob # Defaults strip=false install_exclude_prefixes="/System/|/Library/|/usr/lib/|/usr/X11/|/opt/X11/|@executable_path" # Bundle always has the same name. Version information is stored in # the Info.plist file which is filled in by the configure script. bundle="Wireshark.app" # Location for libraries (tools/macos-setup.sh defaults to whatever the # various support libraries use as their standard installation location, # which is /usr/local) if [ -z "$LIBPREFIX" ]; then LIBPREFIX="/usr/local" fi # Help message #---------------------------------------------------------- help() { echo -e " Create an app bundle for macOS USAGE $0 [-s] [-l /path/to/libraries] OPTIONS -h,--help Display this help message. -b,--bundle The application bundle name. Default is Wireshark.app. -s Strip the libraries and executables from debugging symbols. -l,--libraries Specify the path to the libraries the application depends on (typically /sw or /opt/local). By default it is /usr/local. EXAMPLE $0 -b Logray.app -s -l /opt/local " } # Parse command line arguments #---------------------------------------------------------- while [ "$1" != "" ] do case $1 in -b|--bundle) bundle="$2" shift 1 ;; -s) strip=true ;; -l|--libraries) LIBPREFIX="$2" shift 1 ;; -h|--help) help exit 0 ;; *) echo "Invalid command line option: $1" exit 2 ;; esac shift 1 done # Safety tests if [ ! -e "$LIBPREFIX" ]; then echo "Cannot find the directory containing the libraries: $LIBPREFIX" >&2 exit 1 fi if [ ! -d "$bundle" ] ; then echo "$bundle not found" >&2 exit 1 fi qt_frameworks_dir=$( "@QT_QMAKE_EXECUTABLE@" -query QT_INSTALL_LIBS ) if [ ! -d "$qt_frameworks_dir" ] ; then echo "Can't find the Qt frameworks directory" >&2 exit 1 fi sparkle_version="@SPARKLE_VERSION@" sparkle_frameworks_dir="@SPARKLE_LIBRARY@" # # Define the signing identities, or use self-signed ("-") # if the identity is not provided. if [ -n "$CODE_SIGN_IDENTITY" ] ; then codesign_dev_app_identity="Developer ID Application: $CODE_SIGN_IDENTITY" codesign_dev_install_identity="Developer ID Installer: $CODE_SIGN_IDENTITY" else codesign_dev_app_identity="-" codesign_dev_install_identity="-" fi # # Leave the Qt frameworks out of the special processing. # install_exclude_prefixes="$install_exclude_prefixes|$qt_frameworks_dir" app_name=${bundle%%.app} app_lower=$(echo "$app_name" | tr '[:upper:]' '[:lower:]') # Package paths pkgexec="$bundle/Contents/MacOS" #pkgres="$bundle/Contents/Resources" pkglib="$bundle/Contents/Frameworks" pkgplugin="$bundle/Contents/PlugIns/$app_lower/@PLUGIN_PATH_ID@" # Set the 'macosx' directory, usually the current directory. #resdir=$( pwd ) # # Get a list of all binaries in the bundle. # Treat all plain files with read and execute permissions for all as # binaries. # secondary_binary_list=() while read -r binary ; do secondary_binary_list+=("$binary") done < <( find "$pkgexec" \! -name "$app_name" -type f -perm -0555 -print | sort ) plugin_library_list=() while read -r library ; do plugin_library_list+=("$library") done < <( find "$pkgplugin" -name "*.so" -type f -perm -0555 -print | sort ) bundle_binary_list=("$pkgexec/$app_name" "${secondary_binary_list[@]}" "${plugin_library_list[@]}") echo -e "\\nFixing up $bundle..." # Start with a clean Frameworks slate. if [ -d "$pkglib" ] ; then printf "Removing %s\n" "$pkglib" rm -v -r -f "$pkglib" fi mkdir -v -m u=rwx,go=rx "$pkglib" echo -e "\\nPrepopulating our libraries" # Copy only <library>.<SOVERSION>.dylib. cp -v +([^.]).+([[:digit:]]).dylib "$pkglib" # Fetch a unique list of LC_RPATHs from our executables, which will be used # for our dependency search below. bundle_binary_rpaths=("/usr/local/lib") rpaths=() # macdeployqt handles our Qt dependencies. We handle our Sparkle and # internal dependencies. skip_pats="Qt|Sparkle|build/run" for binary in "${bundle_binary_list[@]}" "$pkglib"/*.dylib ; do while read -r rpath ; do bundle_binary_rpaths+=("$rpath") done < <( otool -l "$binary" | grep -A2 LC_RPATH | awk '$1=="path" && $2 !~ /^@/ {print $2}' | grep -E -v "$skip_pats" ) done while read -r rpath ; do rpaths+=("$rpath") done < <( printf '%s\n' "${bundle_binary_rpaths[@]}" | sort -u) printf "\nSearching the following LC_RPATHs for dependencies:\n" printf '%s\n' "${rpaths[@]}" # Find out libs we need from Fink, MacPorts, or from a custom install # (i.e. $LIBPREFIX), then loop until no changes. a=1 nfiles=0 endl=true while $endl; do echo -e "\\nLooking for dependencies. Round $a" # # To find dependencies, we: # # run otool -L on all the binaries in the bundle, and on all # the shared libraries in the $pkglib directory, to find all # the libraries they depend on (we don't bother with the # frameworks, as the only frameworks we ship are the Qt # frameworks, which don't depend on any libraries that # don't ship with the OS, and as it's hard to find the # framework libraries under $pkglib without getting # non-framework files); # # filter out all lines that don't contain "compatibility" to # remove lines of output that don't correspond to dependencies; # # use cut to extract the library name from the output; # replace "\tlibbrotli" with "\t/usr/local/lib/libbrotli" so that # it isn't excluded from subsequent filtering. # libbrotli 1.09 and earlier doesn't have a path prefix in its # "install name" when built by tools/macos-setup.sh: # https://github.com/google/brotli/pull/976; # # replace "@loader_path/libbrotli" with "/usr/local/lib/libbrotli" so that # it isn't excluded from subsequent filtering; # # strip out system libraries, as we don't bundle them with # Wireshark; # # eliminate duplicates. # # We might want to let dyld do some of the work for us, e.g. by # parsing the output of # # `DYLD_PRINT_LIBRARIES=1 $bundle_binary` # # instead, or just use CMake's fixup_bundle: # https://cmake.org/cmake/help/latest/module/BundleUtilities.html libs=() while read -r lib ; do libs+=("$lib") done < <( otool -L "${bundle_binary_list[@]}" "$pkglib"/*.dylib 2>/dev/null \ | grep -F compatibility \ | grep -v @rpath \ | cut -d\( -f1 \ | sed '1,$s;^ libbrotli; /usr/local/lib/libbrotli;' \ | sed '1,$s;^ @loader_path/libbrotli; /usr/local/lib/libbrotli;' \ | grep -E -v "$install_exclude_prefixes" \ | sort \ | uniq \ ) while read -r rpath_lib _ ; do suffix=${rpath_lib/@rpath\/} for rpath in "${rpaths[@]}" ; do if [ -f "$rpath/$suffix" ] ; then printf "Found @rpath/%s in %s\n" "$suffix" "$rpath" libs+=("$rpath/$suffix") fi done done < <( otool -L "${bundle_binary_list[@]}" "$pkglib"/*.dylib \ | grep @rpath \ | grep -E -v "$skip_pats" \ | sort -u \ ) install -m 644 -C -v "${libs[@]}" "$pkglib" (( a++ )) # shellcheck disable=SC2012 nnfiles=$( ls "$pkglib" | wc -l ) if (( nnfiles == nfiles )); then endl=false else nfiles=$nnfiles fi done # Strip libraries and executables if requested #---------------------------------------------------------- if [ "$strip" = "true" ]; then echo -e "\\nStripping debugging symbols...\\n" strip -x "$pkglib"/*.dylib strip -ur "${bundle_binary_list[@]}" fi "@QT_MACDEPLOYQT_EXECUTABLE@" "$bundle" -no-strip -verbose=2 || exit 1 # # The build process added to the Wireshark/Logray binary an rpath # entry pointing to the directory containing the Qt frameworks; remove # that entry from the binary in the package. # /usr/bin/install_name_tool -delete_rpath "$qt_frameworks_dir" "$pkgexec/$app_name" if [ -d "$sparkle_frameworks_dir" ] ; then cp -R "$sparkle_frameworks_dir" "$pkglib" || exit 1 # Remove these if we ever start sandboxing. rm -f "$pkglib/Sparkle.framework/XPCServices" || exit 1 rm -rf "$pkglib/Sparkle.framework/Versions/B/XPCServices" || exit 1 fi # NOTE: we must rpathify *all* files, *including* Qt libraries etc., # rpathify_file () { local rpathify_exclude_prefixes="$install_exclude_prefixes|@rpath" # Fix a given executable, library, or plugin to be relocatable if [ ! -f "$1" ]; then return 0; fi # # OK, what type of file is this? # if ! filetype=$( otool -hv "$1" | grep -E MH_MAGIC | awk '{print $5}' ; exit "${PIPESTATUS[0]}" ) ; then echo "Unable to rpathify $1 in $( pwd ): file type failed." exit 1 fi case "$filetype" in EXECUTE|DYLIB|BUNDLE) # # Executable, library, or plugin. (Plugins # can be either DYLIB or BUNDLE; shared # libraries are DYLIB.) # # For DYLIB and BUNDLE, fix the shared # library identification. # if [[ "$filetype" = "DYLIB" || "$filetype" = "BUNDLE" ]]; then echo "Changing shared library identification of $1" base=$( echo "$1" | awk -F/ '{print $NF}' ) # # The library will end up in a directory in # the rpath; this is what we should change its # ID to. # to=@rpath/$base /usr/bin/install_name_tool -id "$to" "$1" # # If we're a library and we depend on something in # @executable_path/../Frameworks, replace that with # @rpath. # while read -r dep_lib ; do base=$( echo "$dep_lib" | awk -F/ '{print $NF}' ) to="@rpath/$base" echo "Changing reference to $dep_lib to $to in $1" /usr/bin/install_name_tool -change "$dep_lib" "$to" "$1" done < <( otool -L "$1" | grep @executable_path/../Frameworks | awk '{print $1}' ) # # Try to work around brotli's lack of a full path # https://github.com/google/brotli/issues/934 # while read -r base ; do to="@rpath/$base" echo "Changing reference to $base to $to in $1" /usr/bin/install_name_tool -change "$base" "$to" "$1" done < <( otool -L "$1" | grep '^ libbrotli' | awk '{print $1}' ) fi # # Find our local rpaths and remove them. # otool -l "$1" | grep -A2 LC_RPATH \ | awk '$1=="path" && $2 !~ /^@/ {print $2}' \ | grep -E -v "$rpathify_exclude_prefixes" | \ while read -r lc_rpath ; do echo "Stripping LC_RPATH $lc_rpath from $1" install_name_tool -delete_rpath "$lc_rpath" "$1" done # # Add -Wl,-rpath,@executable_path/../Frameworks # to the rpath, so it'll find the bundled # frameworks and libraries if they're referred # to by @rpath/, rather than having a wrapper # script tweak DYLD_LIBRARY_PATH. # if [[ "$filetype" = "EXECUTE" ]]; then if [ -d ../Frameworks ] ; then framework_path=../Frameworks elif [ -d ../../Frameworks ] ; then framework_path=../../Frameworks else echo "Unable to find relative path to Frameworks for $1 from $( pwd )" exit 1 fi echo "Adding @executable_path/$framework_path to rpath of $1" /usr/bin/install_name_tool -add_rpath @executable_path/$framework_path "$1" fi # # Show the minimum supported version of macOS # for each executable or library # if [[ "$filetype" = "EXECUTE" || "$filetype" = "DYLIB" ]] ; then echo "Minimum macOS version for $1:" otool -l "$1" | grep -A3 LC_VERSION_MIN_MACOSX fi # # Get the list of dynamic libraries on which this # file depends, and select only the libraries that # are in $LIBPREFIX, as those are the only ones # that we'll be shipping in the app bundle; the # other libraries are system-supplied or supplied # as part of X11, will be expected to be on the # system on which the bundle will be installed, # and should be referred to by their full pathnames. # local libs=() while read -r lib ; do libs+=("$lib") done < <( otool -L "$1" \ | grep -F compatibility \ | cut -d\( -f1 \ | grep -E -v "$rpathify_exclude_prefixes" \ | sort \ | uniq \ ) for lib in "${libs[@]}"; do # # Get the file name of the library. # base=$( echo "$lib" | awk -F/ '{print $NF}' ) # # The library will end up in a directory in # the rpath; this is what we should change its # file name to. # to=@rpath/$base # # Change the reference to that library. # echo "Changing reference to $lib to $to in $1" /usr/bin/install_name_tool -change "$lib" "$to" "$1" done ;; esac } rpathify_dir () { # # Make sure we *have* that directory # if [ -d "$1" ]; then (cd "$1" || exit 1 echo "rpathifying $1" # # Make sure we *have* files to fix # # shellcheck disable=SC2086 files=$( ls $2 2>/dev/null ) if [ -n "$files" ]; then for file in $files; do rpathify_file "$file" "$( pwd )" done else echo "no files found in $1" fi ) rf_ret=$? if [ $rf_ret -ne 0 ] ; then exit $rf_ret ; fi fi } rpathify_files () { # # Fix bundle deps # rpathify_dir "$pkglib" "*.dylib" rpathify_dir "$pkgexec" "*" for plugindir in "$pkgplugin"/* do rpathify_dir "$plugindir" "*" done rpathify_dir "$pkgexec/extcap" "*" } if [ ${#LIBPREFIX} -ge "6" ]; then # If the LIBPREFIX path is long enough to allow # path rewriting, then do this. # 6 is the length of @rpath, which replaces LIBPREFIX. rpathify_files else echo "Could not rewrite dylib paths for bundled libraries. This requires" >&2 echo "the support libraries to be installed in a PREFIX of at least 6 characters in length." >&2 echo "" >&2 exit 1 fi # QtNetwork might be linked with brotli. rpathify_file "$pkglib/QtNetwork.framework/Versions/Current/QtNetwork" bundle_dsym="${bundle%%.app}.dSYM" frameworks=() for framework in "$pkglib"/*.framework/Versions/*/* ; do if [ -f "$framework" ];then frameworks+=("$framework") fi done echo "Dsymifying binaries to $bundle_dsym:" # shellcheck disable=SC2086 dsymutil --minimize --out "$bundle_dsym" \ "${bundle_binary_list[@]}" \ "${frameworks[@]}" \ "$pkglib"/*.dylib # echo "Stripping binaries:" # # shellcheck disable=SC2086 # strip -S \ # "${bundle_binary_list[@]}" \ # "${frameworks[@]}" \ # "$pkglib"/*.dylib \ # "$pkgplugin"/*/*.so # XXX What's the proper directory layout here? # dsymify_file () { # # out_dsym="${1/#$bundle/$bundle_dsym}.dSYM" # echo " $1" # dsymutil --minimize --out "$bundle_dsym" "$1" # strip "$1" # } # echo "Dsymifying and stripping executables:" # if [ -z "${bundle_binary_list[@]}" ] ; then # echo "No executables specified for dsymifying." # exit 1 # fi # for binary in "${bundle_binary_list[@]}" ; do # if [ -e "$binary" ];then # dsymify_file "$binary" # fi # done # echo "Dsymifying and stripping frameworks:" # for framework in "$pkglib"/*.framework/Versions/*/* ; do # if [ -f "$framework" ];then # dsymify_file "$framework" # fi # done # echo "Dsymifying and stripping libraries:" # for library in "$pkglib"/*.dylib ; do # # # # Squelch warnings, in case the .o files from building # # support libraries aren't around any more. # # # dsymify_file "$library" | grep -E -v 'unable to open object file' # done # echo "Dsymifying and stripping plugins:" # for plugin in "$pkgplugin"/*/*.so ; do # dsymify_file "$plugin" # done codesign_file () { # https://developer.apple.com/forums/thread/128166 # https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html # https://developer.apple.com/library/archive/technotes/tn2206/_index.html # https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/resolving_common_notarization_issues?language=objc # # XXX Do we need to add the com.apple.security.cs.allow-unsigned-executable-memory # entitlement for Lua? # https://developer.apple.com/documentation/security/hardened_runtime_entitlements?language=objc codesign \ --sign "$codesign_dev_app_identity" \ --prefix "org.wireshark." \ --force \ --options runtime \ --entitlements "@CMAKE_SOURCE_DIR@/packaging/macosx/entitlements.plist" \ --timestamp \ --verbose \ "$1" || exit 1 } # XXX We could do this via the productbuild calls in the {,un}install_*_pkg # targets in CMakeLists.txt instead. productsign_pkg () { mv "$1" "$1.unsigned" || exit 1 productsign \ --sign "$codesign_dev_install_identity" \ --timestamp \ "$1.unsigned" "$1" || exit 1 rm -f "$1.unsigned" || exit 1 } if [ -n "$CODE_SIGN_IDENTITY" ] ; then security find-identity -v -s "$CODE_SIGN_IDENTITY" -p codesigning # The Code Signing Guide says: # # "While you use the --deep option for verification to mimic what Gatekeeper does, # it is not recommended for signing. During signing, if you have nested code, and # if you are signing manually, you sign nested code in stages (as Xcode does # automatically), starting with the most deeply embedded components first. You # then sign code at the next level of hierarchy, and so on. You work your way # outward, finally signing the top level entity that contains all the others. # Signing all the components in one shot with --deep is for emergency repairs and # temporary adjustments only. Note that signing with the combination --deep # --force will forcibly re-sign all code in a bundle." # We need to force-sign Sparkle and its Updater.app. # https://sparkle-project.org/documentation/#4-distributing-your-app # https://sparkle-project.org/documentation/sandboxing/#code-signing if [ "$sparkle_version" == "2" ] ; then echo "Signing Sparkle's assets" codesign \ --sign "$codesign_dev_app_identity" \ --force \ --options runtime \ --verbose \ "$pkglib/Sparkle.framework/Versions/B/AutoUpdate" \ "$pkglib/Sparkle.framework/Versions/B/Updater.app" \ "$pkglib/Sparkle.framework" \ || exit 1 # Uncomment if we ever start sandboxing. # "$pkglib/Sparkle.framework/Versions/B/XPCServices/org.sparkle-project.InstallerLauncher.xpc" # codesign \ # --sign "$codesign_dev_app_identity" \ # --force \ # --options runtime \ # --entitlements "$sparkle_frameworks_dir/../Entitlements/org.sparkle-project.Downloader.entitlements" \ # --verbose \ # "$pkglib/Sparkle.framework/Versions/B/XPCServices/org.sparkle-project.Downloader.xpc" \ # || exit 1 else echo "Signing Sparkle's AutoUpdate.app" codesign \ --sign "$codesign_dev_app_identity" \ --force \ --timestamp \ --options runtime \ --verbose \ "$pkglib/Sparkle.framework/Versions/A/Resources/AutoUpdate.app" \ || exit 1 fi echo "Signing frameworks" for framework in "$pkglib"/*.framework/Versions/* ; do if [ -L "$framework" ] ; then # Skip "Current" continue fi codesign_file "$framework" done echo "Signing libraries" for library in "$pkglib"/*.dylib ; do codesign_file "$library" done plugin_list=$( find "$bundle/Contents/PlugIns" -type f -name "*.dylib" -o -name "*.so" ) echo "Signing plugins" for plugin in $plugin_list ; do codesign_file "$plugin" done echo "Signing extra packages" find "$bundle/Contents/Resources/Extras" -type f -name "*.pkg" | \ while read -r extra_pkg ; do productsign_pkg "$extra_pkg" done echo "Signing secondary executables" if (( ! ${#secondary_binary_list[@]} )) ; then echo "No executables specified for code signing." exit 1 fi for binary in "${secondary_binary_list[@]}" ; do if [ -e "$binary" ];then codesign_file "$binary" fi done echo "Signing primary executable" codesign_file "$pkgexec/$app_name" echo "Signing $bundle" codesign_file "$bundle" # Code Signing Guide, "Testing Conformance with Command Line Tools" codesign --verify --deep --strict --verbose=2 "$bundle" || exit 1 spctl --assess --type exec --verbose=2 "$bundle" || exit 1 else echo "Code signing not performed (no identity)" fi # File permission sanity check. if badperms=$( find "$bundle" ! -perm -0444 -exec ls -l "{}" + | grep . ) ; then echo "Found files with restrictive permissions:" echo "$badperms" exit 1 fi exit 0
Inno Setup Script
wireshark/packaging/macosx/osx-dmg.sh.in
#!/bin/bash # # The script creates a disk image using the dmgbuild utility and signs it. set -e # Defaults app_name="Wireshark" dmgbuild="@DMGBUILD_EXECUTABLE@" version="@PROJECT_VERSION@" log_version="@LOG_PROJECT_VERSION@" app_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/wireshark-app.dmgbuild" dsym_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/wireshark-dsym.dmgbuild" architecture="" # Help message #---------------------------------------------------------- help() { echo -e " Create a custom dmg file to distribute Wireshark USAGE $0 OPTIONS -h,--help Display this help message. Icons are positioned and the background image is set in wireshark-app.dmgbuild.in and wireshark-dsym.dmgbuild.in. " } if [ ! -x "$dmgbuild" ] ; then echo "Error: \"$dmgbuild\" not found." exit 1 fi # Parse command line arguments while [ "$1" != "" ] do case $1 in -a|--app-name) shift 1 app_name="$1" ;; -h|--help) help exit 0 ;; *) echo "Invalid command line option" exit 2 ;; esac shift 1 done if lipo "$app_name.app/Contents/MacOS/$app_name" -verify_arch arm64 ; then architecture="Arm 64" elif lipo "$app_name.app/Contents/MacOS/$app_name" -verify_arch x86_64 ; then architecture="Intel 64" else echo "Error: $app_name.app missing or has unknown architecture." lipo "$app_name.app/Contents/MacOS/$app_name" -detailed_info exit 1 fi if [[ $app_name = Log* ]] ; then version=$log_version app_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/logray-app.dmgbuild" dsym_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/logray-dsym.dmgbuild" fi app_vol_name="$app_name ${version}" app_img_name="$app_vol_name $architecture.dmg" printf "\nCreating application disk image %s\n" "$app_img_name" "$dmgbuild" \ --no-hidpi \ -s "$app_settings_file" \ "$app_vol_name" \ "$app_img_name" || exit 1 dsym_vol_name="$app_name dSYM ${version}" dsym_img_name="$dsym_vol_name $architecture.dmg" printf "\nCreating debugging symbols disk image %s\n" "$dsym_img_name" "$dmgbuild" \ --no-hidpi \ -s "$dsym_settings_file" \ "$dsym_vol_name" \ "$dsym_img_name" || exit 1 printf "\nSigning disk images\n" # TN2206, "Signing Disk Images" if [ -n "$CODE_SIGN_IDENTITY" ] ; then echo -e "Signing $app_img_name and $dsym_img_name" codesign \ --sign "Developer ID Application: $CODE_SIGN_IDENTITY" \ --timestamp \ --verbose \ "$app_img_name" "$dsym_img_name" fi exit 0
Shell Script
wireshark/packaging/macosx/osx-extras.sh
#!/bin/bash # # USAGE # osx-extras # # This script preps the "Extras" packages prior to package creation. # set -e shopt -s extglob # Help message #---------------------------------------------------------- help() { echo -e " Prepare Wireshark's \"Extras\" packages. USAGE $0 OPTIONS -h,--help Display this help message. " } # Parse command line arguments #---------------------------------------------------------- while [ "$1" != "" ] do case $1 in -h|--help) help exit 0 ;; *) echo "Invalid command line option: $1" exit 2 ;; esac shift 1 done script_dir=$( dirname "$0" ) codesign_file () { # https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html # https://developer.apple.com/library/archive/technotes/tn2206/_index.html # https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/resolving_common_notarization_issues?language=objc # # XXX Do we need to add the com.apple.security.cs.allow-unsigned-executable-memory # entitlement for Lua? # https://developer.apple.com/documentation/security/hardened_runtime_entitlements?language=objc codesign \ --sign "Developer ID Application: $CODE_SIGN_IDENTITY" \ --prefix "org.wireshark." \ --force \ --timestamp \ --verbose \ "$1" } if [ -n "$CODE_SIGN_IDENTITY" ] ; then security find-identity -v -s "$CODE_SIGN_IDENTITY" -p codesigning # According to # https://developer.apple.com/library/archive/technotes/tn2206/_index.html and # https://carlashley.com/2018/09/23/code-signing-scripts-for-pppc-whitelisting/ # script signatures are stored in the file's extended attributes. # # In general, signing shell scripts probably isn't very useful. # In this specific case we should be able to ensure that # ChmodBPF's extended attributes are preserved from the build # system to the end user's machine. chmodbpf="$script_dir/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF" echo "Signing ChmodBPF" codesign_file "$chmodbpf" # Code Signing Guide, "Testing Conformance with Command Line Tools" codesign --verify --strict --verbose=2 "$chmodbpf" || exit 1 else echo "Extras code signing not performed (no identity)" fi exit 0
Inno Setup Script
wireshark/packaging/macosx/wireshark-app.dmgbuild.in
# -*- coding: utf-8 -*- from __future__ import unicode_literals import biplist import os.path # # Example settings file for dmgbuild # # Adapted from https://raw.githubusercontent.com/al45tair/dmgbuild/master/examples/settings.py # Use like this: dmgbuild -s settings.py "Test Volume" test.dmg # You can actually use this file for your own application (not just TextEdit) # by doing e.g. # # dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg # .. Useful stuff .............................................................. ws_version = '@PROJECT_VERSION@' ws_volname = 'Wireshark ' + ws_version ws_srcdir = '@CMAKE_SOURCE_DIR@' ws_bindir = '@CMAKE_BINARY_DIR@' ws_app = 'Wireshark.app' ws_readme = 'Read me first.html' ws_donate = 'Donate to the Wireshark Foundation.html' ws_install_chmodbpf = 'Install ChmodBPF.pkg' ws_uninstall_chmodbpf = 'Uninstall ChmodBPF.pkg' ws_install_path_helper = 'Add Wireshark to the system path.pkg' ws_uninstall_path_helper = 'Remove Wireshark from the system path.pkg' # .. Basics .................................................................... # Uncomment to override the output filename # filename = ws_volname + ' Intel 64.dmg' # Uncomment to override the output volume name # volume_name = 'Wireshark ' + ws_version # From the hdiutil man page: # UDZO - UDIF zlib-compressed image # UDBZ - UDIF bzip2-compressed image (Mac OS X 10.4+ only) # ULFO - UDIF lzfse-compressed image (OS X 10.11+ only) # ULMO - UDIF lzma-compressed image (macOS 10.15+ only) # Volume format (see hdiutil create -help) # # A test with the following bundles resulted in the following .dmg sizes, # measured with `du -sm`: # 182 Wireshark.app # 267 Wireshark.dSYM # # UDBZ # 51 Wireshark 3.7.0 Intel 64.dmg # 81 Wireshark dSYM 3.7.0 Intel 64.dmg # # ULFO # 51 Wireshark 3.7.0 Intel 64.dmg # 81 Wireshark dSYM 3.7.0 Intel 64.dmg # # ULMO # 40 Wireshark 3.7.0 Intel 64.dmg # 50 Wireshark dSYM 3.7.0 Intel 64.dmg # https://developer.apple.com/forums/thread/128166 # currently (Jan 2023) says to use UDZO format = defines.get('format', 'UDZO') # Compression level (if relevant) compression_level = 9 # Volume size size = None # Files to include files = [ os.path.join(ws_bindir, 'run', ws_app), os.path.join(ws_bindir, 'packaging', 'macosx', 'wireshark', ws_readme), os.path.join(ws_bindir, 'packaging', 'macosx', 'wireshark', ws_donate), os.path.join(ws_bindir, 'run', ws_app, 'Contents', 'Resources', 'Extras', ws_install_chmodbpf), os.path.join(ws_bindir, 'run', ws_app, 'Contents', 'Resources', 'Extras', ws_uninstall_chmodbpf), os.path.join(ws_bindir, 'run', ws_app, 'Contents', 'Resources', 'Extras', ws_install_path_helper), os.path.join(ws_bindir, 'run', ws_app, 'Contents', 'Resources', 'Extras', ws_uninstall_path_helper), ] # Symlinks to create symlinks = { 'Applications': '/Applications', } # Volume icon # # You can either define icon, in which case that icon file will be copied to the # image, *or* you can define badge_icon, in which case the icon file you specify # will be used to badge the system's Removable Disk icon # badge_icon = os.path.join(ws_srcdir, 'packaging', 'macosx', 'wsiconvol.icns') #badge_icon = icon_from_app(application) # Window position in ((x, y), (w, h)) format window_rect = ((600, 200), (360, 550)) # Where to put the icons icon_locations = { ws_app: ( 80, 64), 'Applications': (250, 64), ws_readme: ( 80, 180), ws_donate: (250, 180), ws_install_chmodbpf: ( 80, 296), ws_uninstall_chmodbpf: (250, 296), ws_install_path_helper: ( 80, 402), ws_uninstall_path_helper: (250, 402), } # .. Window configuration ...................................................... # Background # # This is a STRING containing any of the following: # # #3344ff - web-style RGB color # #34f - web-style RGB color, short form (#34f == #3344ff) # rgb(1,0,0) - RGB color, each value is between 0 and 1 # hsl(120,1,.5) - HSL (hue saturation lightness) color # hwb(300,0,0) - HWB (hue whiteness blackness) color # cmyk(0,1,0,0) - CMYK color # goldenrod - X11/SVG named color # builtin-arrow - A simple built-in background with a blue arrow # /foo/bar/baz.png - The path to an image file # # The hue component in hsl() and hwb() may include a unit; it defaults to # degrees ('deg'), but also supports radians ('rad') and gradians ('grad' # or 'gon'). # # Other color components may be expressed either in the range 0 to 1, or # as percentages (e.g. 60% is equivalent to 0.6). background = os.path.join(ws_srcdir, 'packaging', 'macosx', 'dmg_background.png') show_status_bar = False show_tab_view = False show_toolbar = False show_pathbar = False show_sidebar = False sidebar_width = 180 # Select the default view; must be one of # # 'icon-view' # 'list-view' # 'column-view' # 'coverflow' # default_view = 'icon-view' # General view configuration show_icon_preview = False # Set these to True to force inclusion of icon/list view settings (otherwise # we only include settings for the default view) include_icon_view_settings = 'auto' include_list_view_settings = 'auto' # .. Icon view configuration ................................................... arrange_by = None grid_offset = (0, 0) #grid_spacing = 100 scroll_position = (0, 0) #label_pos = 'bottom' # or 'right' text_size = 12 icon_size = 72
Inno Setup Script
wireshark/packaging/macosx/wireshark-dsym.dmgbuild.in
# -*- coding: utf-8 -*- from __future__ import unicode_literals import biplist import os.path # # Example settings file for dmgbuild # # Adapted from https://raw.githubusercontent.com/al45tair/dmgbuild/master/examples/settings.py # Use like this: dmgbuild -s settings.py "Test Volume" test.dmg # You can actually use this file for your own application (not just TextEdit) # by doing e.g. # # dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg # .. Useful stuff .............................................................. ws_version = '@PROJECT_VERSION@' ws_volname = 'Wireshark Debugging Symbols' + ws_version ws_srcdir = '@CMAKE_SOURCE_DIR@' ws_bindir = '@CMAKE_BINARY_DIR@' ws_app_dsym = 'Wireshark.dSYM' ws_readme_dsym = 'Debugging symbols installation.html' # .. Basics .................................................................... # Uncomment to override the output filename # filename = ws_volname + ' Intel 64.dmg' # Uncomment to override the output volume name # volume_name = 'Wireshark ' + ws_version # From the hdiutil man page: # UDZO - UDIF zlib-compressed image # UDBZ - UDIF bzip2-compressed image (Mac OS X 10.4+ only) # ULFO - UDIF lzfse-compressed image (OS X 10.11+ only) # ULMO - UDIF lzma-compressed image (macOS 10.15+ only) # Volume format (see hdiutil create -help) # dSYMs are huge, so compress them with UDBZ despite what # https://developer.apple.com/forums/thread/128166 # currently (Jan 2023) says. format = defines.get('format', 'UDBZ') # Compression level (if relevant) compression_level = 9 # Volume size size = None # Files to include files = [ os.path.join(ws_bindir, 'run', ws_app_dsym), os.path.join(ws_bindir, 'packaging', 'macosx', 'wireshark', ws_readme_dsym), ] # Symlinks to create symlinks = { 'Applications': '/Applications', } # Volume icon # # You can either define icon, in which case that icon file will be copied to the # image, *or* you can define badge_icon, in which case the icon file you specify # will be used to badge the system's Removable Disk icon # badge_icon = os.path.join(ws_srcdir, 'packaging', 'macosx', 'wsiconvol.icns') #badge_icon = icon_from_app(application) # Where to put the icons icon_locations = { ws_app_dsym: ( 80, 64), 'Applications': (240, 64), ws_readme_dsym: (160, 170), } # .. Window configuration ...................................................... # Background # # This is a STRING containing any of the following: # # #3344ff - web-style RGB color # #34f - web-style RGB color, short form (#34f == #3344ff) # rgb(1,0,0) - RGB color, each value is between 0 and 1 # hsl(120,1,.5) - HSL (hue saturation lightness) color # hwb(300,0,0) - HWB (hue whiteness blackness) color # cmyk(0,1,0,0) - CMYK color # goldenrod - X11/SVG named color # builtin-arrow - A simple built-in background with a blue arrow # /foo/bar/baz.png - The path to an image file # # The hue component in hsl() and hwb() may include a unit; it defaults to # degrees ('deg'), but also supports radians ('rad') and gradians ('grad' # or 'gon'). # # Other color components may be expressed either in the range 0 to 1, or # as percentages (e.g. 60% is equivalent to 0.6). background = os.path.join(ws_srcdir, 'packaging', 'macosx', 'dmg_background.png') show_status_bar = False show_tab_view = False show_toolbar = False show_pathbar = False show_sidebar = False sidebar_width = 180 # Window position in ((x, y), (w, h)) format window_rect = ((600, 200), (350, 325)) # Select the default view; must be one of # # 'icon-view' # 'list-view' # 'column-view' # 'coverflow' # default_view = 'icon-view' # General view configuration show_icon_preview = False # Set these to True to force inclusion of icon/list view settings (otherwise # we only include settings for the default view) include_icon_view_settings = 'auto' include_list_view_settings = 'auto' # .. Icon view configuration ................................................... arrange_by = None grid_offset = (0, 0) #grid_spacing = 100 scroll_position = (0, 0) #label_pos = 'bottom' # or 'right' text_size = 12 icon_size = 72
Inno Setup Script
wireshark/packaging/macosx/WiresharkInfo.plist.in
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>Wireshark</string> <key>CFBundleGetInfoString</key> <string>@PROJECT_VERSION@, Copyright 1998-2023 Wireshark Development Team</string> <key>CFBundleIconFile</key> <string>Wireshark.icns</string> <key>CFBundleIdentifier</key> <string>org.wireshark.Wireshark</string> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeExtensions</key> <array> <string>5vw</string> <string>5vw.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>InfoVista/Accellent 5View Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>apc</string> <string>pkt</string> <string>tpc</string> <string>wpz</string> <string>apc.gz</string> <string>pkt.gz</string> <string>tpc.gz</string> <string>wpz.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>LiveAction/Savvius/WildPackets *Peek Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>bfr</string> <string>bfr.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Viavi/Network Instruments Observer Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>erf</string> <string>erf.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Endace ERF Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>ipfix</string> <string>ipfix.gz</string> <!-- Don't register for .pfx: that extension has another (more common) use. --> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>IPFIX Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>mplog</string> <string>mplog.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Micropross mplog Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>pcap</string> <string>pcap.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeMIMETypes</key> <array> <string>application/vnd.tcpdump.pcap</string> </array> <key>CFBundleTypeName</key> <string>Pcap Network Capture</string> <key>CFBundleTypeOSTypes</key> <array> <string>PCAP</string> </array> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>pcapng</string> <string>ntar</string> <string>pcapng.gz</string> <string>ntar.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Pcapng Network Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>pklg</string> <string>pklg.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>macOS PacketLogger Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>rf5</string> <string>rf5.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Tektronix K12 Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>snoop</string> <string>snoop.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Solaris snoop Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>tr1</string> <string>tr1.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Novell LANalyzer Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>trc0</string> <string>trc0.gz</string> <string>trc1</string> <string>trc1.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>HP-UX nettl Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>vwr</string> <string>vwr.gz</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>Ixia IxVeriWave Packet Capture</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <dict> <key>CFBundleTypeExtensions</key> <array> <string>rtp</string> <string>rtp.gz</string> <string>rtp.zst</string> <string>rtp.lz4</string> </array> <key>CFBundleTypeIconFile</key> <string>Wiresharkdoc.icns</string> <key>CFBundleTypeName</key> <string>RTP stream (RTPDump)</string> <key>CFBundleTypeRole</key> <string>Viewer</string> </dict> <!-- XXX - This dictionary needs a lot more entries --> </array> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>@PROJECT_VERSION@</string> <key>CFBundleSignature</key> <string>Wshk</string> <key>CFBundleVersion</key> <string>@PROJECT_VERSION@</string> <key>NSHumanReadableCopyright</key> <string>Copyright 1998-2023 Wireshark Developers, GNU General Public License.</string> <key>NSPrincipalClass</key> <string>NSApplication</string> <key>NSHighResolutionCapable</key> <true/> <!-- Force dark mode support. --> <key>NSRequiresAquaSystemAppearance</key> <false/> <key>LSMinimumSystemVersion</key> <string>@MIN_MACOS_VERSION@</string> <!-- Sparkle settings https://sparkle-project.org/documentation/customization/ --> <key>SUFeedURL</key> <string>https://www.wireshark.org/update/0/Wireshark/@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@/macOS/x86-64/en-US/stable.xml</string> <key>SUEnableAutomaticChecks</key> <false/> <key>SUPublicEDKey</key> <string>BeSuPpEZOmOzkON9QMnfIdwyi06P/LcVoik8M5O2bsQ=</string> <key>SUEnableSystemProfiling</key> <false/> <!-- Disable automatic updates here, then enable them at program startup depending on prefs.gui_update_enabled. --> <key>SUAutomaticallyUpdate</key> <false/> </dict> </plist>
AsciiDoc
wireshark/packaging/macosx/Wireshark_dsym_installation.adoc
// Required attributes: // include-dir include::{include-dir}/attributes.adoc[] :stylesheet: {include-dir}/ws.css == Debugging Symbols for Wireshark This archive contains the debugging symbols for Wireshark {wireshark-version}. The debugging symbols are only necessary if Wireshark is crashing and you need to report an issue to the Wireshark development team. WARNING: This won't work properly with any version other than Wireshark {wireshark-version}. To install the symbols, drag _Wireshark.dSYM_ to the same location as _Wireshark_. This is usually your _Applications_ folder. To uninstall, drag _Wireshark.dSYM_ to the trash.
AsciiDoc
wireshark/packaging/macosx/Wireshark_read_me_first.adoc
// Required attributes: // include-dir // min-macos-version include::{include-dir}/attributes.adoc[] :stylesheet: {include-dir}/ws.css == Before You Begin This release of Wireshark requires macOS {min-macos-version} or later. If you are running an earlier version of macOS you can install using another packaging system such as Homebrew or MacPorts. == Quick Setup To install Wireshark, drag the _Wireshark_ application bundle to the _Applications_ folder. In order to be able to capture packets, install the link:Wireshark.app/Contents/Resources/Extras/Install%20ChmodBPF.pkg[Install ChmodBPF] package. If you would like to add the path to https://www.wireshark.org/docs/man-pages/wireshark.html[Wireshark], https://www.wireshark.org/docs/man-pages/tshark.html[TShark], https://www.wireshark.org/docs/man-pages/capinfos.html[capinfos], https://www.wireshark.org/docs/man-pages/editcap.html[editcap], and https://www.wireshark.org/docs/man-pages/[other command line utilities] to the system PATH, install the link:Wireshark.app/Contents/Resources/Extras/Add%20Wireshark%20to%20the%20system%20path.pkg[Add Wireshark to the system path] package. == Package Installation Details The ChmodBPF installer writes to the following locations: * _/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist_. A launch daemon that adjusts permissions on the system's packet capture devices (/dev/bpf*) when the system starts up. * _/Library/Application Support/Wireshark/ChmodBPF_. A copy of the launch daemon property list, and the script that the launch daemon runs. The installer group named “access_bpf” is created. The user who opened the package is added to the group. The system path installer writes to the following locations: * _/etc/paths.d/Wireshark_. The folder name in this file is automatically added to PATH * _/etc/manpaths.d/Wireshark_. The folder name in this file is used by the man command. It assumes that Wireshark is installed in _/Applications_. == Uninstalling To uninstall Wireshark, do the following: . Remove _/Applications/Wireshark.app_ . Remove _/Library/Application Support/Wireshark_ You can uninstall ChmodBPF via the link:Wireshark.app/Contents/Resources/Extras/Uninstall%20ChmodBPF.pkg[Uninstall ChmodBPF] package, which is available on this disk or via menu:Wireshark[About Wireshark,Folders,macOS Extras]. You can also uninstall it manually by doing the following: . Unload the “org.wireshark.ChmodBPF.plist” launchd job . Remove _/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist_ . Remove the “access_bpf” group. You can uninstall the system path components via the link:Wireshark.app/Contents/Resources/Extras/Remove%20Wireshark%20from%20the%20system%20path.pkg[Remove Wireshark from the system path] package, which is available on this disk or via menu:Wireshark[About Wireshark,Folders,macOS Extras]. You can also uninstall it manually by doing the following: . Remove _/etc/paths.d/Wireshark_ . Remove _/etc/manpaths.d/Wireshark_
wireshark/packaging/macosx/ChmodBPF/install-scripts/postinstall
#!/bin/sh # # Fix up ownership and permissions on /Library/Application Support/Wireshark; # for some reason, it's not being owned by root:wheel, and it's not # publicly readable and, for directories and executables, not publicly # searchable/executable. # # Also take away group write permission. # # XXX - that may be a problem with the process of building the installer # package; if so, that's where it *should* be fixed. # chown -R root:wheel "/Library/Application Support/Wireshark" chmod -R a+rX,go-w "/Library/Application Support/Wireshark" CHMOD_BPF_PLIST="/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist" BPF_GROUP="access_bpf" BPF_GROUP_NAME="BPF device access ACL" min_gid=100 if ! dscl . -read /Groups/"$BPF_GROUP" > /dev/null 2>&1; then free_gid=$(dscl . -list /Groups PrimaryGroupID | sort -bnk2 | awk -v min_gid=$min_gid 'BEGIN{i=min_gid}{if($2==i)i++}END{print i}') dseditgroup -q -o create -i $free_gid -r "$BPF_GROUP_NAME" "$BPF_GROUP" fi dseditgroup -q -o edit -a "$USER" -t user "$BPF_GROUP" chmod u=rw,g=r,o=r "$CHMOD_BPF_PLIST" chown root:wheel "$CHMOD_BPF_PLIST" # Clean up our legacy startup item if it's still around. rm -rf /Library/StartupItems/ChmodBPF launchctl bootstrap system "$CHMOD_BPF_PLIST"
wireshark/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF
#! /bin/zsh # shellcheck shell=bash # # Unfortunately, macOS's devfs is based on the old FreeBSD # one, not the current one, so there's no way to configure it # to create BPF devices with particular owners or groups. BPF # devices on macOS are also non-cloning, that is they can # be created on demand at any time. This startup item will # pre-create a number of BPF devices, then make them owned by # the access_bpf group, with permissions rw-rw----, so that # anybody in the access_bpf group can use programs that capture # or send raw packets. # # Change this as appropriate for your site, e.g. to make # it owned by a particular user without changing the permissions, # so only that user and the super-user can capture or send raw # packets, or give it the permissions rw-r-----, so that # only the super-user can send raw packets but anybody in the # admin group can capture packets. # # Pre-create BPF devices. Set to 0 to disable. FORCE_CREATE_BPF_MAX=256 SYSCTL_MAX=$( sysctl -n debug.bpf_maxdevices ) if [ "$FORCE_CREATE_BPF_MAX" -gt "$SYSCTL_MAX" ] ; then FORCE_CREATE_BPF_MAX=$SYSCTL_MAX fi syslog -s -l notice "ChmodBPF: Forcing creation and setting permissions for /dev/bpf0-$(( FORCE_CREATE_BPF_MAX - 1))" CUR_DEV=0 while [ "$CUR_DEV" -lt "$FORCE_CREATE_BPF_MAX" ] ; do # Try to do the minimum necessary to trigger the next device. read -r -n 0 < /dev/bpf$CUR_DEV > /dev/null 2>&1 CUR_DEV=$(( CUR_DEV + 1 )) done chgrp access_bpf /dev/bpf* chmod g+rw /dev/bpf*
wireshark/packaging/macosx/ChmodBPF/root/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>org.wireshark.ChmodBPF</string> <key>RunAtLoad</key> <true/> <key>Program</key> <string>/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF</string> </dict> </plist>
wireshark/packaging/macosx/ChmodBPF/uninstall-scripts/postinstall
#!/bin/sh # # Remove the following: # - The ChmmodBPF launch daemon # - The ChmmodBPF script # - The access_bpf group # CHMOD_BPF_PLIST="/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist" BPF_GROUP="access_bpf" launchctl bootout system "$CHMOD_BPF_PLIST" dscl . -read /Groups/"$BPF_GROUP" > /dev/null 2>&1 && \ dseditgroup -q -o delete "$BPF_GROUP" rm -rf "/Library/Application Support/Wireshark" rm -f "$CHMOD_BPF_PLIST" # ChmodBPF hasn't been a startup item since 2018 (ac4f3c0f4d). rm -rf /Library/StartupItems/ChmodBPF # https://gitlab.com/wireshark/wireshark/-/issues/18734 pkgutil --forget org.wireshark.ChmodBPF.pkg
wireshark/packaging/macosx/path_helper/uninstall-scripts/postinstall
#!/bin/sh # # Remove the Wireshark paths.d and manpaths.d entries. # rm -f /private/etc/paths.d/Wireshark rm -f /private/etc/manpaths.d/Wireshark # https://gitlab.com/wireshark/wireshark/-/issues/18734 pkgutil --forget org.wireshark.path_helper.pkg
wireshark/packaging/msys2/mingw-w64-wireshark-git/PKGBUILD
# Maintainer: Wireshark Core Team <[email protected]> _realname=wireshark pkgbase=mingw-w64-${_realname}-git pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-git") pkgver=4.1.0rc0.1408.gd00bd20fea pkgrel=1 pkgdesc="Network traffic and protocol analyzer/sniffer" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64') url="https://www.wireshark.org" license=('GPL2') depends=("${MINGW_PACKAGE_PREFIX}-bcg729" "${MINGW_PACKAGE_PREFIX}-brotli" "${MINGW_PACKAGE_PREFIX}-c-ares" "${MINGW_PACKAGE_PREFIX}-glib2" "${MINGW_PACKAGE_PREFIX}-gnutls" "${MINGW_PACKAGE_PREFIX}-libgcrypt" "${MINGW_PACKAGE_PREFIX}-libilbc" "${MINGW_PACKAGE_PREFIX}-libmaxminddb" "${MINGW_PACKAGE_PREFIX}-libpcap" "${MINGW_PACKAGE_PREFIX}-libsmi" "${MINGW_PACKAGE_PREFIX}-libssh" "${MINGW_PACKAGE_PREFIX}-libxml2" "${MINGW_PACKAGE_PREFIX}-lz4" "${MINGW_PACKAGE_PREFIX}-minizip" "${MINGW_PACKAGE_PREFIX}-nghttp2" "${MINGW_PACKAGE_PREFIX}-opencore-amr" "${MINGW_PACKAGE_PREFIX}-opus" "${MINGW_PACKAGE_PREFIX}-pcre2" "${MINGW_PACKAGE_PREFIX}-qt6-base" "${MINGW_PACKAGE_PREFIX}-qt6-multimedia" "${MINGW_PACKAGE_PREFIX}-qt6-5compat" "${MINGW_PACKAGE_PREFIX}-sbc" "${MINGW_PACKAGE_PREFIX}-snappy" "${MINGW_PACKAGE_PREFIX}-spandsp" "${MINGW_PACKAGE_PREFIX}-speexdsp" "${MINGW_PACKAGE_PREFIX}-zlib" "${MINGW_PACKAGE_PREFIX}-zstd") makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-qt6-tools" "${MINGW_PACKAGE_PREFIX}-asciidoctor" "${MINGW_PACKAGE_PREFIX}-docbook-xsl" "${MINGW_PACKAGE_PREFIX}-libxslt" 'git') checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest" "${MINGW_PACKAGE_PREFIX}-python-pytest-xdist") provides=("${MINGW_PACKAGE_PREFIX}-${_realname}") conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}") _commit=${PKG_COMMIT:-HEAD} source=("${_realname}"::"git+https://gitlab.com/wireshark/wireshark.git#commit=${_commit}") sha256sums=('SKIP') pkgver() { cd "${_realname}" git describe --long "${_commit}" | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g' } build() { mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" declare -a extra_config if check_option "debug" "n"; then extra_config+=("-DCMAKE_BUILD_TYPE=Release") else extra_config+=("-DCMAKE_BUILD_TYPE=Debug") fi MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ "${MINGW_PREFIX}"/bin/cmake.exe \ -GNinja \ -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ "${extra_config[@]}" \ -DENABLE_WERROR=OFF \ -DUSE_qt6=ON \ -DENABLE_WINSPARKLE=OFF \ -DFETCH_lua=ON \ ../${_realname} "${MINGW_PREFIX}"/bin/cmake.exe --build . "${MINGW_PREFIX}"/bin/cmake.exe --build . --target user_guide_html } check() { cd "${srcdir}/build-${MSYSTEM}" "${MINGW_PREFIX}"/bin/cmake.exe --build . --target test-programs "${MINGW_PREFIX}"/bin/pytest.exe } package() { cd "${srcdir}/build-${MSYSTEM}" DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install . DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install . --component UserGuide DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install . --component Development install -Dm644 "${srcdir}/${_realname}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" }
Text
wireshark/packaging/nsis/CMakeLists.txt
# CMakeLists.txt # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later # # We should use CPack to generate the NSIS package. Even better, # we should use CPack to create a .msi using WiX. set(WIRESHARK_NSIS_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/wireshark-manifest.nsh ${CMAKE_CURRENT_BINARY_DIR}/wireshark-config.nsh ) if(NOT SKIP_NSIS_QT_DLLS) list(APPEND WIRESHARK_NSIS_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/wireshark-qt-manifest.nsh) endif() set(WIRESHARK_NSIS_GENERATED_FILES ${WIRESHARK_NSIS_GENERATED_FILES} PARENT_SCOPE) set(WIRESHARK_NSIS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/wireshark.nsi ${CMAKE_CURRENT_SOURCE_DIR}/wireshark-common.nsh ${CMAKE_CURRENT_SOURCE_DIR}/GetWindowsVersion.nsh ${CMAKE_CURRENT_SOURCE_DIR}/servicelib.nsh ${CMAKE_CURRENT_SOURCE_DIR}/NpcapPage.ini ${CMAKE_CURRENT_SOURCE_DIR}/USBPcapPage.ini ${WIRESHARK_NSIS_GENERATED_FILES} PARENT_SCOPE ) set(LOGRAY_NSIS_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/logray-manifest.nsh ${CMAKE_CURRENT_BINARY_DIR}/logray-config.nsh ${CMAKE_CURRENT_BINARY_DIR}/logray-qt-manifest.nsh ) set(LOGRAY_NSIS_GENERATED_FILES ${LOGRAY_NSIS_GENERATED_FILES} PARENT_SCOPE) set(LOGRAY_NSIS_FILES logray.nsi uninstall-logray.nsi logray-common.nsh GetWindowsVersion.nsh servicelib.nsh NpcapPage.ini USBPcapPage.ini ${LOGRAY_NSIS_GENERATED_FILES} PARENT_SCOPE ) # Variables required for config.nsh set(PROGRAM_NAME ${CMAKE_PROJECT_NAME}) set(LOG_PROGRAM_NAME ${LOG_PROJECT_NAME}) file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}" TOP_SRC_DIR) # STAGING_DIR depends on the build configuration so we pass it # on the command line below. file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/docbook" DOCBOOK_DIR) set (MMDBRESOLVE_EXE ${MAXMINDDB_FOUND}) # To do: # - Sync the various version names between CMake and NSIS. # - Set CMakeLists.txt version strings in tools/make-version.py # - Add a VERSION_EXTRA cmake option set (PRODUCT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.${PROJECT_BUILD_VERSION}) set (LOG_PRODUCT_VERSION ${LOG_PROJECT_MAJOR_VERSION}.${LOG_PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.${PROJECT_BUILD_VERSION}) if((BUILD_wireshark OR BUILD_logray) AND QT_FOUND) set (QT_DIR "\${STAGING_DIR}") endif() # Look for the Visual C++ Redistributable packages in the following locations: # - _PROJECT_LIB_DIR # - _PROJECT_LIB_DIR/vcredist_MSVCxx # - %VCINSTALLDIR% # - %VCINSTALLDIR%/redist/1033 (<= Visual Studio 2015) # - %VCINSTALLDIR%/Redist/MSVC/* (>= Visual Studio 2017) # MSVC_VERSION (_MSC_VER) = Visual Studio Version / MSVC Toolset Version # 1900 = VS2015 14.0 / 14.00 # 1910 = VS2017 15.1, 15.2 / 14.10 # 1911 = VS2017 15.3, 15.4 / 14.11 # 1912 = VS2017 15.5 / 14.12 # 1913 = VS2017 15.6 / 14.13 # 1914 = VS2017 15.7 / 14.14 if(MSVC_VERSION GREATER_EQUAL 1930) set(_ws_vcredist_subdir "vcredist_MSVC2022") elseif(MSVC_VERSION GREATER_EQUAL 1920) set(_ws_vcredist_subdir "vcredist_MSVC2019") set(_msvs_version 15.0) # Doesn't appear to be set elseif(MSVC_VERSION GREATER_EQUAL 1910) set(_ws_vcredist_subdir "vcredist_MSVC2017") set(_msvs_version 15.0) elseif(MSVC_VERSION GREATER_EQUAL 1900) set(_ws_vcredist_subdir "vcredist_MSVC2015") set(_ms_vcredist_subdir "redist/1033") set(_msvs_version 14.0) endif() # Try to find the Redist folder in VCINSTALLDIR which is set by vcvarsall.bat. # If it is not set, query it within the registry. VS2015 looks for the "VC7" key # in two locations (four if you count HKCU instead of HKLM). However, VS2017 # does not use "VC7" (it sets a directory relative to vsdevcmd_start.bat). As # both versions do set "VS7", use that instead. find_path(VCINSTALLDIR Redist PATHS "$ENV{VCINSTALLDIR}" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_msvs_version}]\\VC" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\SxS\\VS7;${_msvs_version}]\\VC" NO_DEFAULT_PATH ) file(TO_NATIVE_PATH "${VCINSTALLDIR}" VCINSTALLDIR_NATIVE) message(STATUS "Using VCINSTALLDIR: ${VCINSTALLDIR_NATIVE}") # Visual Studio Community 2017 version 15.7.5 uses VCRT 14.14.26405, but an # earlier version used 14.10.25008. Let's just glob for the right value. if(MSVC_VERSION GREATER_EQUAL 1910 AND VCINSTALLDIR) file(GLOB _ms_vcredist_subdir RELATIVE "${VCINSTALLDIR}" "${VCINSTALLDIR}/Redist/MSVC/14.*.*") endif() find_program(_vcredist NAMES "vc_redist.${WIRESHARK_TARGET_PLATFORM}.exe" # Visual Studio 2022 and later "vcredist_${WIRESHARK_TARGET_PLATFORM}.exe" # Visual Studio 2019 and earlier PATHS "${_PROJECT_LIB_DIR}" $ENV{VCToolsRedistDir} "${VCINSTALLDIR}" PATH_SUFFIXES ${_ws_vcredist_subdir} ${_ms_vcredist_subdir} NO_DEFAULT_PATH ) if(_vcredist) file(TO_NATIVE_PATH "${_vcredist}" _vcredist) message(STATUS "Using ${_vcredist} for the NSIS installer.") get_filename_component(VCREDIST_DIR ${_vcredist} DIRECTORY) get_filename_component(VCREDIST_EXE ${_vcredist} NAME) endif() if (BUILD_wireshark) # Ideally we would generate this at compile time using a separate cmake # module, e.g. cmake/modules/configure_nsis_file.cmake. However we would # have to figure out a clean way to pass in the variables above. file(READ "${CMAKE_CURRENT_SOURCE_DIR}/wireshark-config.nsh.in" _config_nsh_contents) string(CONFIGURE "${_config_nsh_contents}" _config_nsh_contents) string(REPLACE "#define" "!define" _config_nsh_contents "${_config_nsh_contents}") string(REPLACE "#undef" "!undef" _config_nsh_contents "${_config_nsh_contents}") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/wireshark-config.nsh" "${_config_nsh_contents}") # wireshark-manifest.nsh. Can be created at configure time. set(_all_manifest "${CMAKE_CURRENT_BINARY_DIR}/wireshark-manifest.nsh") set(_all_manifest_contents "# Files required for all sections. Generated by CMake.\n") if(USE_REPOSITORY) set(_all_manifest_contents "${_all_manifest_contents}!ifdef BUNDLE_DEBUG_DLLS\n") foreach(_dll ${GLIB2_DLLS_DEBUG}) set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") endforeach() set(_all_manifest_contents "${_all_manifest_contents}!else\n") foreach(_dll ${GLIB2_DLLS_RELEASE}) set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") endforeach() set(_all_manifest_contents "${_all_manifest_contents}!endif\n") foreach(_dll ${CARES_DLL} ${PCRE2_DLL} ${GCRYPT_DLLS} ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLLS} ${LUA_DLL} ${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL} ${ZLIB_DLL} ${BROTLI_DLLS} ${ZSTD_DLL} ${ILBC_DLL} ${OPUS_DLL} ${SPEEXDSP_DLL} # Needed for mmdbresolve ${MAXMINDDB_DLL} ) set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") endforeach() elseif(USE_MSYSTEM) include(${CMAKE_CURRENT_SOURCE_DIR}/InstallMSYS2.cmake) foreach(_dll ${MINGW_DLLS}) file(TO_NATIVE_PATH ${_dll} _path) set(_all_manifest_contents "${_all_manifest_contents}File \"${_path}\"\n") endforeach() else() include(${CMAKE_CURRENT_SOURCE_DIR}/InstallMinGW.cmake) foreach(_dll ${MINGW_DLLS}) file(TO_NATIVE_PATH ${_dll} _path) set(_all_manifest_contents "${_all_manifest_contents}File \"${_path}\"\n") endforeach() endif() if(LUA_FOUND) foreach(_script "init.lua" "browser_sslkeylog.lua") set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_script}\"\n") endforeach() endif() file(WRITE "${_all_manifest}" "${_all_manifest_contents}") endif() if (BUILD_logray) # Ideally we would generate this at compile time using a separate cmake # module, e.g. cmake/modules/configure_nsis_file.cmake. However we would # have to figure out a clean way to pass in the variables above. file(READ "${CMAKE_CURRENT_SOURCE_DIR}/logray-config.nsh.in" _config_nsh_contents) string(CONFIGURE "${_config_nsh_contents}" _config_nsh_contents) string(REPLACE "#define" "!define" _config_nsh_contents "${_config_nsh_contents}") string(REPLACE "#undef" "!undef" _config_nsh_contents "${_config_nsh_contents}") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/logray-config.nsh" "${_config_nsh_contents}") # logray-manifest.nsh. Can be created at configure time. set(_all_manifest "${CMAKE_CURRENT_BINARY_DIR}/logray-manifest.nsh") set(_all_manifest_contents "# Files required for all sections. Generated by CMake.\n") set(_all_manifest_contents "${_all_manifest_contents}!ifdef BUNDLE_DEBUG_DLLS\n") foreach(_dll ${GLIB2_DLLS_DEBUG}) set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") endforeach() set(_all_manifest_contents "${_all_manifest_contents}!else\n") foreach(_dll ${GLIB2_DLLS_RELEASE}) set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") endforeach() set(_all_manifest_contents "${_all_manifest_contents}!endif\n") foreach(_dll ${CARES_DLL} ${PCRE2_DLL} ${GCRYPT_DLLS} ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLLS} ${LUA_DLL} ${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL} ${ZLIB_DLL} ${BROTLI_DLLS} ${ZSTD_DLL} ${ILBC_DLL} ${OPUS_DLL} ${SPEEXDSP_DLL} # Needed for mmdbresolve ${MAXMINDDB_DLL} ) set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_dll}\"\n") endforeach() foreach(_script "init.lua") set(_all_manifest_contents "${_all_manifest_contents}File \"\${STAGING_DIR}\\${_script}\"\n") endforeach() file(WRITE "${_all_manifest}" "${_all_manifest_contents}") endif() file(TO_NATIVE_PATH "${DATAFILE_DIR}" _staging_dir) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" _outfile_dir) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" _nsis_include_dir) # Variables we can't set via config.nsh. set(NSIS_OPTIONS -DSTAGING_DIR=${_staging_dir} -DOUTFILE_DIR=${_outfile_dir} -DNSIS_INCLUDE_DIR=${_nsis_include_dir} -V2 PARENT_SCOPE ) # We want to sign all of the executables that we ship in the official # installers. This means that uninstall-wireshark.exe must be built # separately AND that building the installer itself won't overwrite # uninstall-wireshark.exe macro( ADD_NSIS_UNINSTALLER_TARGETS ) set (_nsis_source_dir ${CMAKE_SOURCE_DIR}/packaging/nsis ) set (_nsis_binary_dir ${CMAKE_BINARY_DIR}/packaging/nsis ) # # XXX - if we're not building Wireshark, we can't build # anything, so there's nothing to uninstall. # if(BUILD_logray) add_custom_command(OUTPUT ${DATAFILE_DIR}/uninstall-logray.exe DEPENDS ${_nsis_source_dir}/uninstall-logray.nsi ${_nsis_source_dir}/logray-common.nsh COMMAND ${MAKENSIS_EXECUTABLE} ${NSIS_OPTIONS} uninstall-logray.nsi COMMAND ${POWERSHELL_COMMAND} "${_nsis_source_dir}/makeUninstall.ps1" ${DATAFILE_DIR}/uninstall_logray_installer.exe COMMAND ${CMAKE_COMMAND} -E remove ${DATAFILE_DIR}/uninstall_logray_installer.exe WORKING_DIRECTORY ${_nsis_source_dir} ) endif() endmacro( ADD_NSIS_UNINSTALLER_TARGETS ) macro( ADD_NSIS_PACKAGE_TARGETS ) set (_nsis_source_dir ${CMAKE_SOURCE_DIR}/packaging/nsis ) set (_nsis_binary_dir ${CMAKE_BINARY_DIR}/packaging/nsis ) # # XXX - if we're not building Wireshark, we can't build the # manifest below. On the other hand, if we're not building # Wireshark, we have no need to include Qt in the installer, # so it's not clear we need this manifest. # # This should probably be fixed, so that people can produce # command-line-only installer packages. if(BUILD_wireshark) # wireshark-qt-manifest.nsh. Created using Wireshark.exe. if(NOT SKIP_NSIS_QT_DLLS) if (USE_REPOSITORY) add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh COMMAND set "PATH=${QT_BIN_PATH};%PATH%" COMMAND ${POWERSHELL_COMMAND} "${_nsis_source_dir}/windeployqt-to-nsis.ps1" -Executable $<TARGET_FILE:wireshark> -FilePath ${_nsis_binary_dir}/wireshark-qt-manifest.nsh $<$<CONFIG:Debug>:-DebugConfig> DEPENDS "${_nsis_source_dir}/windeployqt-to-nsis.ps1" $<TARGET_FILE:wireshark> ) elseif(HAVE_MSYSTEM) add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh COMMAND ${Python3_EXECUTABLE} "${_nsis_source_dir}/windeployqt-to-nsis.py" --executable $<TARGET_FILE:wireshark> ${_nsis_binary_dir}/wireshark-qt-manifest.nsh #$<$<CONFIG:Debug>:-DebugConfig> DEPENDS "${_nsis_source_dir}/windeployqt-to-nsis.py" $<TARGET_FILE:wireshark> ) elseif(MINGW AND CMAKE_CROSSCOMPILING) add_custom_command(OUTPUT ${_nsis_binary_dir}/wireshark-qt-manifest.nsh COMMAND ${Python3_EXECUTABLE} "${_nsis_source_dir}/windeployqt-to-nsis.py" --sysroot "${MINGW_SYSROOT}" --mapping "${_nsis_source_dir}/mingw64-qt-mapping.txt" ${_nsis_binary_dir}/wireshark-qt-manifest.nsh #$<$<CONFIG:Debug>:-DebugConfig> DEPENDS "${_nsis_source_dir}/windeployqt-to-nsis.py" "${_nsis_source_dir}/mingw64-qt-mapping.txt" ) else() message(FATAL_ERROR "Unknown Qt deployment method") endif() endif() # Build NSIS package dependencies. We build the package in # two stages so that wireshark_nsis below doesn't trigger # any dependencies that might clobber any signed executables. add_custom_target(wireshark_nsis_prep DEPENDS ${WIRESHARK_NSIS_FILES} copy_data_files user_guide_html faq_html ) set_target_properties(wireshark_nsis_prep PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) # Make sure required blobs are available FetchContent_MakeAvailable(Npcap USBPcap) # Dump the installer into # ${CMAKE_CURRENT_SOURCE_DIR}/packaging/nsis # Note that executables and DLLs *must* be built separately add_custom_target(wireshark_nsis COMMAND ${MAKENSIS_EXECUTABLE} ${NSIS_OPTIONS} $<$<CONFIG:Debug>:-DBUNDLE_DEBUG_DLLS> $<$<BOOL:${MSVC}>:-DUSE_VCREDIST> wireshark.nsi WORKING_DIRECTORY ${_nsis_source_dir} ) set_target_properties(wireshark_nsis PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) endif() if(BUILD_logray) # logray-qt-manifest.nsh. Created using Wireshark.exe. add_custom_command(OUTPUT ${_nsis_binary_dir}/logray-qt-manifest.nsh COMMAND set "PATH=${QT_BIN_PATH};%PATH%" COMMAND ${POWERSHELL_COMMAND} "${_nsis_source_dir}/windeployqt-to-nsis.ps1" -Executable $<TARGET_FILE:logray> -FilePath ${_nsis_binary_dir}/logray-qt-manifest.nsh $<$<CONFIG:Debug>:-DebugConfig> DEPENDS "${_nsis_source_dir}/windeployqt-to-nsis.ps1" ) # Build NSIS package dependencies. We build the package in # two stages so that logray_nsis below doesn't trigger # any dependencies that might clobber any signed executables. add_custom_target(logray_nsis_prep DEPENDS ${LOGRAY_NSIS_FILES} copy_data_files user_guide_html faq_html ${DATAFILE_DIR}/uninstall-logray.exe ) set_target_properties(logray_nsis_prep PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) # Dump the installer into # ${CMAKE_CURRENT_SOURCE_DIR}/packaging/nsis # Note that executables and DLLs *must* be built separately add_custom_target(logray_nsis COMMAND ${MAKENSIS_EXECUTABLE} ${NSIS_OPTIONS} $<$<CONFIG:Debug>:-DBUNDLE_DEBUG_DLLS> logray.nsi WORKING_DIRECTORY ${_nsis_source_dir} ) set_target_properties(logray_nsis PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) endif() endmacro( ADD_NSIS_PACKAGE_TARGETS ) set(CLEAN_FILES #NEWS.txt #user-guide.chm ${DATAFILE_DIR}/uninstall-wireshark.exe wireshark-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe wireshark-config.nsh wireshark-manifest.nsh wireshark-qt-manifest.nsh ${DATAFILE_DIR}/uninstall-logray.exe logray-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe logray-config.nsh logray-manifest.nsh logray-qt-manifest.nsh )
Text
wireshark/packaging/nsis/custom_mibs.txt
; Add your custom SNMP MIBS directives here ; Example: ; Point to the dir of the MIBS ;File "mymibdirpath\mibs\*"
Text
wireshark/packaging/nsis/custom_plugins.txt
;Add your custom plugins directives here ; Example: ;File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\foo.dll"
INI Configuration
wireshark/packaging/nsis/DonatePage.ini
[Settings] NumFields=2 [Field 1] Type=Label Left=10 Right=250 Top=10 Bottom=34 Text=The Wireshark Foundation wants to help as many people as possible understand their networks as much as possible. Your donation helps to support Wireshark and host SharkFest. [Field 2] Type=Link Left=10 Right=250 Top=50 Bottom=58 Text=You can learn more and donate at https://wiresharkfoundation.org. State=https://wiresharkfoundation.org/
wireshark/packaging/nsis/GetWindowsVersion.nsh
; GetWindowsVersion 4.1.1 (2015-06-22) - alternate script with server versions ; ; https://nsis.sourceforge.io/Get_Windows_version ; ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ ; Update by Joost Verburg ; Update (Macro, Define, Windows 7 detection) - John T. Haller of PortableApps.com - 2008-01-07 ; Update (Windows 8 detection) - Marek Mizanin (Zanir) - 2013-02-07 ; Update (Windows 8.1 detection) - John T. Haller of PortableApps.com - 2014-04-04 ; Update (Windows 2008, 2008R2, 2012 and 2012R2 detection) - Francisco Simoões Filho [email protected] - 2014-08-25 ; Update (Windows 10 TP detection) - John T. Haller of PortableApps.com - 2014-10-01 ; Update (Windows 10 TP4 and 2016 detection, and added include guards) - Kairu - 2015-06-22 ; ; Usage: ${GetWindowsVersion} $R0 ; ; $R0 contains: 95, 98, ME, NT x.x, 2000, XP, 2003, Vista, 2008, 7, 2008R2, ; 8, 2012, 8.1, 2012R2, 10.0, 2016 or '' (for unknown) !ifndef __GET_WINDOWS_VERSION_NSH !define __GET_WINDOWS_VERSION_NSH Function GetWindowsVersion Push $R0 Push $R1 Push $R2 ClearErrors ; check if Windows NT family ReadRegStr $R0 HKLM \ "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion IfErrors 0 lbl_winnt ; we are not NT ReadRegStr $R0 HKLM \ "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber StrCpy $R1 $R0 1 StrCmp $R1 '4' 0 lbl_error StrCpy $R1 $R0 3 StrCmp $R1 '4.0' lbl_win32_95 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 lbl_win32_95: StrCpy $R0 '95' Goto lbl_done lbl_win32_98: StrCpy $R0 '98' Goto lbl_done lbl_win32_ME: StrCpy $R0 'ME' Goto lbl_done lbl_winnt: ; check if Windows is Client or Server. ReadRegStr $R2 HKLM \ "SOFTWARE\Microsoft\Windows NT\CurrentVersion" InstallationType StrCpy $R1 $R0 1 StrCmp $R1 '3' lbl_winnt_x StrCmp $R1 '4' lbl_winnt_x StrCpy $R1 $R0 3 StrCmp $R1 '5.0' lbl_winnt_2000 StrCmp $R1 '5.1' lbl_winnt_XP StrCmp $R1 '5.2' lbl_winnt_2003 StrCmp $R1 '6.0' lbl_winnt_vista_2008 StrCmp $R1 '6.1' lbl_winnt_7_2008R2 StrCmp $R1 '6.2' lbl_winnt_8_2012 StrCmp $R1 '6.3' lbl_winnt_81_2012R2 StrCmp $R1 '6.4' lbl_winnt_10_2016 ; the early Windows 10 tech previews used version 6.4 StrCpy $R1 $R0 4 StrCmp $R1 '10.0' lbl_winnt_10_2016 Goto lbl_error lbl_winnt_x: StrCpy $R0 "NT $R0" 6 Goto lbl_done lbl_winnt_2000: Strcpy $R0 '2000' Goto lbl_done lbl_winnt_XP: Strcpy $R0 'XP' Goto lbl_done lbl_winnt_2003: Strcpy $R0 '2003' Goto lbl_done ;----------------- Family - Vista / 2008 ------------- lbl_winnt_vista_2008: StrCmp $R2 'Client' go_vista StrCmp $R2 'Server' go_2008 go_vista: Strcpy $R0 'Vista' Goto lbl_done go_2008: Strcpy $R0 '2008' Goto lbl_done ;----------------------------------------------------- ;----------------- Family - 7 / 2008R2 ------------- lbl_winnt_7_2008R2: StrCmp $R2 'Client' go_7 StrCmp $R2 'Server' go_2008R2 go_7: Strcpy $R0 '7' Goto lbl_done go_2008R2: Strcpy $R0 '2008R2' Goto lbl_done ;----------------------------------------------------- ;----------------- Family - 8 / 2012 ------------- lbl_winnt_8_2012: StrCmp $R2 'Client' go_8 StrCmp $R2 'Server' go_2012 go_8: Strcpy $R0 '8' Goto lbl_done go_2012: Strcpy $R0 '2012' Goto lbl_done ;----------------------------------------------------- ;----------------- Family - 8.1 / 2012R2 ------------- lbl_winnt_81_2012R2: StrCmp $R2 'Client' go_81 StrCmp $R2 'Server' go_2012R2 go_81: Strcpy $R0 '8.1' Goto lbl_done go_2012R2: Strcpy $R0 '2012R2' Goto lbl_done ;----------------------------------------------------- ;----------------- Family - 10 / 2016 ------------- lbl_winnt_10_2016: StrCmp $R2 'Client' go_10 StrCmp $R2 'Server' go_2016 go_10: Strcpy $R0 '10.0' Goto lbl_done go_2016: Strcpy $R0 '2016' Goto lbl_done ;----------------------------------------------------- lbl_error: Strcpy $R0 '' lbl_done: Pop $R2 Pop $R1 Exch $R0 FunctionEnd !macro GetWindowsVersion OUTPUT_VALUE Call GetWindowsVersion Pop `${OUTPUT_VALUE}` !macroend !define GetWindowsVersion '!insertmacro "GetWindowsVersion"' !endif
CMake
wireshark/packaging/nsis/InstallMinGW.cmake
set(MINGW_SYSROOT "/usr/x86_64-w64-mingw32/sys-root/mingw" CACHE FILEPATH "Path to MinGW system root bindir") set(MINGW_BINDIR ${MINGW_SYSROOT}/bin) if(MINGW) # mingw-w64 dlls file(GLOB MINGW_DLLS ${MINGW_BINDIR}/iconv.dll ${MINGW_BINDIR}/icudata72.dll ${MINGW_BINDIR}/icui18n72.dll ${MINGW_BINDIR}/icuuc72.dll ${MINGW_BINDIR}/libbrotlicommon.dll ${MINGW_BINDIR}/libbrotlidec.dll ${MINGW_BINDIR}/libbrotlienc.dll ${MINGW_BINDIR}/libbz2-1.dll ${MINGW_BINDIR}/libcares-*.dll ${MINGW_BINDIR}/libcrypto-3-x64.dll ${MINGW_BINDIR}/libexpat-1.dll ${MINGW_BINDIR}/libffi-8.dll ${MINGW_BINDIR}/libfontconfig-1.dll ${MINGW_BINDIR}/libfreetype-6.dll ${MINGW_BINDIR}/libgcc_s_seh-1.dll ${MINGW_BINDIR}/libgcrypt-20.dll ${MINGW_BINDIR}/libglib-2.0-0.dll ${MINGW_BINDIR}/libgmodule-2.0-0.dll ${MINGW_BINDIR}/libgmp-10.dll ${MINGW_BINDIR}/libgnutls-30.dll ${MINGW_BINDIR}/libgpg-error-0.dll ${MINGW_BINDIR}/libgraphite2.dll ${MINGW_BINDIR}/libharfbuzz-0.dll ${MINGW_BINDIR}/libhogweed-6.dll ${MINGW_BINDIR}/libiconv-*.dll ${MINGW_BINDIR}/libidn2-*.dll ${MINGW_BINDIR}/libintl-8.dll ${MINGW_BINDIR}/liblz4.dll ${MINGW_BINDIR}/liblzma-5.dll ${MINGW_BINDIR}/libminizip-*.dll ${MINGW_BINDIR}/libnettle-8.dll ${MINGW_BINDIR}/libnghttp2-*.dll ${MINGW_BINDIR}/libopus-0.dll ${MINGW_BINDIR}/libp11-kit-0.dll ${MINGW_BINDIR}/libpcre2-16-0.dll ${MINGW_BINDIR}/libpcre2-8-0.dll ${MINGW_BINDIR}/libpng16-16.dll ${MINGW_BINDIR}/libsnappy.dll ${MINGW_BINDIR}/libspeexdsp-1.dll ${MINGW_BINDIR}/libssp-0.dll ${MINGW_BINDIR}/libstdc++-6.dll ${MINGW_BINDIR}/libtasn1-6.dll ${MINGW_BINDIR}/libunistring-*.dll ${MINGW_BINDIR}/libwinpthread-1.dll ${MINGW_BINDIR}/libxml2-2.dll ${MINGW_BINDIR}/libzstd.dll ${MINGW_BINDIR}/zlib1.dll ) endif()
CMake
wireshark/packaging/nsis/InstallMSYS2.cmake
set(MINGW_BIN $ENV{MINGW_PREFIX}/bin) if(USE_MSYSTEM) # mingw-w64 dlls # (use msys2checkdeps.py to list required libraries / check for missing or unused libraries) file(GLOB MINGW_DLLS ${MINGW_BIN}/libLerc.dll ${MINGW_BIN}/libb2-1.dll ${MINGW_BIN}/libbrotlicommon.dll ${MINGW_BIN}/libbrotlidec.dll ${MINGW_BIN}/libbrotlienc.dll ${MINGW_BIN}/libbz2-1.dll ${MINGW_BIN}/libbcg729.dll ${MINGW_BIN}/libcares-2.dll ${MINGW_BIN}/libcrypto-3-x64.dll ${MINGW_BIN}/libdeflate.dll ${MINGW_BIN}/libdouble-conversion.dll ${MINGW_BIN}/libexpat-1.dll ${MINGW_BIN}/libffi-8.dll ${MINGW_BIN}/libfreetype-6.dll ${MINGW_BIN}/libgcc_s_seh-1.dll ${MINGW_BIN}/libgcrypt-20.dll ${MINGW_BIN}/libglib-2.0-0.dll ${MINGW_BIN}/libgmodule-2.0-0.dll ${MINGW_BIN}/libgmp-10.dll ${MINGW_BIN}/libgnutls-30.dll ${MINGW_BIN}/libgpg-error-0.dll ${MINGW_BIN}/libgraphite2.dll ${MINGW_BIN}/libharfbuzz-0.dll ${MINGW_BIN}/libhogweed-6.dll ${MINGW_BIN}/libiconv-2.dll ${MINGW_BIN}/libicudt72.dll ${MINGW_BIN}/libicuin72.dll ${MINGW_BIN}/libicuuc72.dll ${MINGW_BIN}/libilbc.dll ${MINGW_BIN}/libidn2-0.dll ${MINGW_BIN}/libintl-8.dll ${MINGW_BIN}/libjbig-0.dll ${MINGW_BIN}/libjpeg-8.dll ${MINGW_BIN}/liblz4.dll ${MINGW_BIN}/liblzma-5.dll ${MINGW_BIN}/libmd4c.dll ${MINGW_BIN}/libmaxminddb.dll ${MINGW_BIN}/libminizip-1.dll ${MINGW_BIN}/libnettle-8.dll ${MINGW_BIN}/libnghttp2-14.dll ${MINGW_BIN}/libopus-0.dll ${MINGW_BIN}/libp11-kit-0.dll ${MINGW_BIN}/libpcre2-16-0.dll ${MINGW_BIN}/libpcre2-8-0.dll ${MINGW_BIN}/libpng16-16.dll ${MINGW_BIN}/libsbc-1.dll ${MINGW_BIN}/libsharpyuv-0.dll ${MINGW_BIN}/libsmi-2.dll ${MINGW_BIN}/libsnappy.dll ${MINGW_BIN}/libspandsp-2.dll ${MINGW_BIN}/libspeexdsp-1.dll ${MINGW_BIN}/libssh.dll ${MINGW_BIN}/libstdc++-6.dll ${MINGW_BIN}/libtasn1-6.dll ${MINGW_BIN}/libtiff-6.dll ${MINGW_BIN}/libunistring-2.dll ${MINGW_BIN}/libwebp-7.dll ${MINGW_BIN}/libunistring-5.dll ${MINGW_BIN}/libwinpthread-1.dll ${MINGW_BIN}/libxml2-2.dll ${MINGW_BIN}/libzstd.dll ${MINGW_BIN}/lua51.dll ${MINGW_BIN}/zlib1.dll ) endif()
wireshark/packaging/nsis/logray-additional-tasks.nsddef
<?xml version="1.0" encoding="UTF-8"?> <!-- This file was created by NSISDialogDesigner 1.5.0.0 https://coolsoft.altervista.org/nsisdialogdesigner Do not edit manually! --> <Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions."> <CreateFunctionCustomScript>; Defined in logray.nsi Call InitAdditionalTasksPage</CreateFunctionCustomScript> <Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." TabIndex="0" /> <CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Logray" TabIndex="1" /> <CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Logray Quick Launch Icon" TabIndex="2" /> <CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Logray Desktop Icon" TabIndex="3" /> <CheckBox Name="StartMenuCheckBox" Location="22, 34" Size="406, 14" Text="Logray Start Menu Item" TabIndex="4" /> <Label Name="FileExtensionsLabel" Location="12, 101" Size="426, 14" Text="Associate File Extensions" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="5" /> <Label Name="CreateShortcutsLabel" Location="12, 9" Size="426, 14" Text="Create Shortcuts" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="6" /> </Dialog>
wireshark/packaging/nsis/logray-additional-tasks.nsdinc
; ========================================================= ; This file was generated by NSISDialogDesigner 1.5.0.0 ; https://coolsoft.altervista.org/nsisdialogdesigner ; ; Do not edit it manually, use NSISDialogDesigner instead! ; ========================================================= ; handle variables Var hCtl_AdditionalTasksPage Var hCtl_AdditionalTasksPage_ExtensionsLabel Var hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox Var hCtl_AdditionalTasksPage_QuickLaunchCheckBox Var hCtl_AdditionalTasksPage_DesktopIconCheckBox Var hCtl_AdditionalTasksPage_StartMenuCheckBox Var hCtl_AdditionalTasksPage_FileExtensionsLabel Var hCtl_AdditionalTasksPage_CreateShortcutsLabel Var hCtl_AdditionalTasksPage_Font1 ; dialog create function Function fnc_AdditionalTasksPage_Create ; custom font definitions CreateFont $hCtl_AdditionalTasksPage_Font1 "Microsoft Sans Serif" "8.25" "700" ; === AdditionalTasksPage (type: Dialog) === nsDialogs::Create 1018 Pop $hCtl_AdditionalTasksPage ${If} $hCtl_AdditionalTasksPage == error Abort ${EndIf} !insertmacro MUI_HEADER_TEXT "Additional Tasks" "Create shortcuts and associate file extensions." ; === ExtensionsLabel (type: Label) === ${NSD_CreateLabel} 14u 93u 245u 32u "Extensions include scap." Pop $hCtl_AdditionalTasksPage_ExtensionsLabel ; === AssociateExtensionsCheckBox (type: Checkbox) === ${NSD_CreateCheckbox} 14u 78u 267u 9u "Associate log file extensions with Logray" Pop $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox ; === QuickLaunchCheckBox (type: Checkbox) === ${NSD_CreateCheckbox} 14u 46u 267u 9u "Logray Quick Launch Icon" Pop $hCtl_AdditionalTasksPage_QuickLaunchCheckBox ; === DesktopIconCheckBox (type: Checkbox) === ${NSD_CreateCheckbox} 14u 33u 267u 9u "Logray Desktop Icon" Pop $hCtl_AdditionalTasksPage_DesktopIconCheckBox ; === StartMenuCheckBox (type: Checkbox) === ${NSD_CreateCheckbox} 14u 21u 267u 9u "Logray Start Menu Item" Pop $hCtl_AdditionalTasksPage_StartMenuCheckBox ; === FileExtensionsLabel (type: Label) === ${NSD_CreateLabel} 8u 62u 280u 9u "Associate File Extensions" Pop $hCtl_AdditionalTasksPage_FileExtensionsLabel SendMessage $hCtl_AdditionalTasksPage_FileExtensionsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0 ; === CreateShortcutsLabel (type: Label) === ${NSD_CreateLabel} 8u 6u 280u 9u "Create Shortcuts" Pop $hCtl_AdditionalTasksPage_CreateShortcutsLabel SendMessage $hCtl_AdditionalTasksPage_CreateShortcutsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0 ; CreateFunctionCustomScript ; Defined in logray.nsi Call InitAdditionalTasksPage FunctionEnd ; dialog show function Function fnc_AdditionalTasksPage_Show Call fnc_AdditionalTasksPage_Create nsDialogs::Show FunctionEnd
wireshark/packaging/nsis/logray-common.nsh
; ============================================================================ ; Name and version information ; ============================================================================ Unicode true ; This improves the installer's appearance considerably here on a display scaled ; to 225%, but checkboxes are comically small. We might be able to fix this ; using the SysCompImg extension: ; http://forums.winamp.com/showthread.php?t=443754 ManifestDPIAware true ; These might be correct in the future, but are currently undocumented: ; http://forums.winamp.com/showthread.php?t=452632 ; ManifestDPIAware System ; ManifestDPIAwareness "PerMonitorV2,System" !ifdef NSIS_INCLUDE_DIR !addincludedir ${NSIS_INCLUDE_DIR} !endif !include "logray-config.nsh" !define DISPLAY_NAME "${PROGRAM_NAME} ${VERSION} ${WIRESHARK_TARGET_PLATFORM}" Name "${DISPLAY_NAME}" !define PROGRAM_FULL_NAME "The ${PROGRAM_NAME} Log Analyzer" !define PROGRAM_NAME_PATH "${PROGRAM_NAME}.exe" !define UNINSTALLER_NAME "uninstall-logray.exe" VIAddVersionKey "ProductName" "${PROGRAM_NAME}" VIAddVersionKey "Comments" "My manta ray is all right." VIAddVersionKey "CompanyName" "${PROGRAM_NAME} development team" ; NSIS handles U+00a9 but not a UTF-8 encoded copyright symbol. VIAddVersionKey "LegalCopyright" "${U+00a9} Gerald Combs and many others" VIAddVersionKey "LegalTrademarks" "Logray and the 'ray' logo are registered trademarks" VIAddVersionKey "FileDescription" "${PROGRAM_NAME} installer for Windows on ${WIRESHARK_TARGET_PLATFORM}" VIAddVersionKey "Language" "English" VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}" VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}" VIProductVersion "${PRODUCT_VERSION}" XPStyle on ; ============================================================================ ; Functions and macros ; ============================================================================ ; Used to refresh the display of file association !define SHCNE_ASSOCCHANGED 0x08000000 !define SHCNF_IDLIST 0 !macro UpdateIcons Push $R0 Push $R1 Push $R2 !define UPDATEICONS_UNIQUE ${__LINE__} IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}: System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)' Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}: MessageBox MB_OK|MB_ICONSTOP \ "Can't find 'shell32.dll' library. Impossible to update icons" \ /SD IDOK Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE} UpdateIcons.quit_${UPDATEICONS_UNIQUE}: !undef UPDATEICONS_UNIQUE Pop $R2 Pop $R1 Pop $R0 ; Force the icon cache to refresh ; https://superuser.com/questions/499078/refresh-icon-cache-without-rebooting IfFileExists "$SYSDIR\ie4uinit.exe" 0 +2 Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache' !macroend ; ============================================================================ ; Push our known file extensions onto the stack, prepended with a marker ; Note that this is a subset of dump_open_table in wiretap/file_access.c. We ; probably don't want to grab JPEG or MP3 files. ; ============================================================================ ; Used to add associations between file extensions and Logray !define LOGRAY_ASSOC "logray-log-file" !define FILE_EXTENSION_MARKER "FILE_EXTENSION_MARKER" !macro PushFileExtensions Push "${FILE_EXTENSION_MARKER}" Push ".scap" !macroend !macro IsLograyRunning ; See if Logray is running ; https://nsis.sourceforge.io/Check_whether_your_application_is_running ${Do} System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global\${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0' IntCmp $R0 0 checkRunningSession System::Call 'kernel32::CloseHandle(i $R0)' Goto isRunning checkRunningSession: System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0' IntCmp $R0 0 notRunning System::Call 'kernel32::CloseHandle(i $R0)' isRunning: ; You'd better go catch it. MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking Quit notRunning: ${ExitDo} continueChecking: ${Loop} !macroend
Inno Setup Script
wireshark/packaging/nsis/logray-config.nsh.in
# ============================================================================ # NSIS configuration definitions. Generated from wireshark-config.nsh.in. # ============================================================================ # Do not prefix comments with ";". They will be removed by CMake. # MUST match "<Product ... Name=" in wix/Wireshark.wxs. #define PROGRAM_NAME "@LOG_PROGRAM_NAME@" #define TOP_SRC_DIR "@TOP_SRC_DIR@" #define WIRESHARK_TARGET_PLATFORM @WIRESHARK_TARGET_PLATFORM@ #define EXTRA_INSTALLER_DIR "@EXTRA_INSTALLER_DIR@" #define VERSION @LOG_PROJECT_VERSION@ #define PRODUCT_VERSION @LOG_PRODUCT_VERSION@ # Plugins #define MAJOR_VERSION @PROJECT_MAJOR_VERSION@ #define MINOR_VERSION @PROJECT_MINOR_VERSION@ #define VCREDIST_DIR "@VCREDIST_DIR@" #define VCREDIST_EXE "@VCREDIST_EXE@" # Optional components #cmakedefine MMDBRESOLVE_EXE @MMDBRESOLVE_EXE@ # Skip the User's Guide until we have one of our own. #cmakeundefine DOCBOOK_DIR #cmakedefine SMI_DIR "@SMI_DIR@" #cmakedefine QT_DIR "@QT_DIR@"
wireshark/packaging/nsis/logray.nsi
; ; logray.nsi ; ; Set the compression mechanism first. ; As of NSIS 2.07, solid compression which makes installer about 1MB smaller ; is no longer the default, so use the /SOLID switch. ; This unfortunately is unknown to NSIS prior to 2.07 and creates an error. ; So if you get an error here, please update to at least NSIS 2.07! SetCompressor /SOLID lzma SetCompressorDictSize 64 ; MB !include "logray-common.nsh" !include 'LogicLib.nsh' !include "StrFunc.nsh" !include "WordFunc.nsh" ; See https://nsis.sourceforge.io/Check_if_a_file_exists_at_compile_time for documentation !macro !defineifexist _VAR_NAME _FILE_NAME !tempfile _TEMPFILE !ifdef NSIS_WIN32_MAKENSIS ; Windows - cmd.exe !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"' !else ; Posix - sh !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi' !endif !include '${_TEMPFILE}' !delfile '${_TEMPFILE}' !undef _TEMPFILE !macroend !define !defineifexist "!insertmacro !defineifexist" ; ============================================================================ ; Header configuration ; ============================================================================ ; The file to write OutFile "${OUTFILE_DIR}\${PROGRAM_NAME}-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe" ; Installer icon Icon "${TOP_SRC_DIR}\resources\icons\lograyinst.ico" ; ============================================================================ ; Modern UI ; ============================================================================ ; The modern user interface will look much better than the common one. ; However, as the development of the modern UI is still going on, and the script ; syntax changes, you will need exactly that NSIS version, which this script is ; made for. This is the current (December 2003) latest version: V2.0b4 ; If you are using a different version, it's not predictable what will happen. !include "MUI2.nsh" !include "InstallOptions.nsh" ;!addplugindir ".\Plugins" !define MUI_ICON "${TOP_SRC_DIR}\resources\icons\lograyinst.ico" BrandingText "Logray${U+00ae} Installer" !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PROGRAM_NAME}.$\r$\n$\r$\nBefore starting the installation, make sure ${PROGRAM_NAME} is not running.$\r$\n$\r$\nClick 'Next' to continue." ; NSIS shows Readme files by opening the Readme file with the default application for ; the file's extension. "README.win32" won't work in most cases, because extension "win32" ; is usually not associated with an appropriate text editor. We should use extension "txt" ; for a text file or "html" for an html README file. !define MUI_FINISHPAGE_TITLE_3LINES !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt" !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News" !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED ; NSIS runs as Administrator and will run Logray as Administrator ; if these are enabled. ;!define MUI_FINISHPAGE_RUN "$INSTDIR\${PROGRAM_NAME_PATH}" ;!define MUI_FINISHPAGE_RUN_NOTCHECKED ; ============================================================================ ; MUI Pages ; ============================================================================ !insertmacro MUI_PAGE_WELCOME !define MUI_LICENSEPAGE_TEXT_TOP "Logray is distributed under the GNU General Public License." !define MUI_LICENSEPAGE_TEXT_BOTTOM "This is not an end user license agreement (EULA). It is provided here for informational purposes only." !define MUI_LICENSEPAGE_BUTTON "Noted" !insertmacro MUI_PAGE_LICENSE "${STAGING_DIR}\COPYING.txt" !insertmacro MUI_PAGE_COMPONENTS !ifdef QT_DIR Page custom DisplayAdditionalTasksPage LeaveAdditionalTasksPage !endif !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ; ============================================================================ ; MUI Languages ; ============================================================================ !insertmacro MUI_LANGUAGE "English" ; ============================================================================ ; Reserve Files ; ============================================================================ ;Things that need to be extracted on first (keep these lines before any File command!) ;Only useful for BZIP2 compression ; Old Modern 1 UI: https://nsis.sourceforge.io/Docs/Modern%20UI/Readme.html ; To do: Upgrade to the Modern 2 UI: ;ReserveFile "AdditionalTasksPage.ini" ReserveFile /plugin InstallOptions.dll ; Modern UI 2 / nsDialog pages. ; https://nsis.sourceforge.io/Docs/Modern%20UI%202/Readme.html ; https://nsis.sourceforge.io/Docs/nsDialogs/Readme.html !ifdef QT_DIR !include "logray-additional-tasks.nsdinc" !endif ; ============================================================================ ; Section macros ; ============================================================================ !include "Sections.nsh" ; ============================================================================ ; Command Line ; ============================================================================ !include "FileFunc.nsh" !insertmacro GetParameters !insertmacro GetOptions ; ========= Install extcap binary and help file ========= !macro InstallExtcap EXTCAP_NAME SetOutPath $INSTDIR File "${STAGING_DIR}\${EXTCAP_NAME}.html" SetOutPath $INSTDIR\extcap File "${STAGING_DIR}\extcap\${EXTCAP_NAME}.exe" !macroend ; ========= Check if silent mode install of /EXTRACOMPONENTS ========= !macro CheckExtrasFlag EXTRAS_NAME !define EXTRAS_FLAG ${__LINE__} Section IfSilent +1 skip_${EXTRAS_FLAG} push $R0 push $R1 push $R2 ${GetParameters} $R0 ${GetOptions} $R0 "/EXTRACOMPONENTS=" $R1 IfErrors popreg_${EXTRAS_FLAG} ${WordFind} $R1 "," "E+1" $R0 ; No delimiters found - check for single word match ${If} $R0 = 1 StrCmp $R1 ${EXTRAS_NAME} install_${EXTRAS_FLAG} popreg_${EXTRAS_FLAG} ${ENDIF} ; Loop through all delimited words checking for match IntOp $R2 0 + 1 ${While} $R0 != 2 StrCmp $R0 ${EXTRAS_NAME} install_${EXTRAS_FLAG} 0 IntOp $R2 $R2 + 1 ${WordFind} $R1 "," "E+$R2" $R0 ${EndWhile} Goto popreg_${EXTRAS_FLAG} install_${EXTRAS_FLAG}: !insertmacro InstallExtcap ${EXTRAS_NAME} popreg_${EXTRAS_FLAG}: pop $R2 pop $R1 pop $R0 skip_${EXTRAS_FLAG}: !undef EXTRAS_FLAG SectionEnd !macroend ; ============================================================================ ; Component page configuration ; ============================================================================ ComponentText "The following components are available for installation." ; ============================================================================ ; Directory selection page configuration ; ============================================================================ ; The text to prompt the user to enter a directory DirText "Choose a directory in which to install ${PROGRAM_NAME}." ; The default installation directory InstallDir $PROGRAMFILES64\${PROGRAM_NAME} ; See if this is an upgrade; if so, use the old InstallDir as default InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} "InstallDir" ; ============================================================================ ; Install page configuration ; ============================================================================ ShowInstDetails show ; ============================================================================ ; Functions and macros ; ============================================================================ Var EXTENSION ; https://docs.microsoft.com/en-us/windows/win32/shell/fa-file-types Function Associate Push $R0 !insertmacro PushFileExtensions Pop $EXTENSION ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER} ReadRegStr $R0 HKCR $EXTENSION "" StrCmp $R0 "" Associate.doRegister Goto Associate.end Associate.doRegister: ;The extension is not associated to any program, we can do the link WriteRegStr HKCR $EXTENSION "" ${LOGRAY_ASSOC} DetailPrint "Registered file type: $EXTENSION" Associate.end: Pop $EXTENSION ${Loop} Pop $R0 FunctionEnd ; Control states Var START_MENU_STATE Var DESKTOP_ICON_STATE Var FILE_ASSOCIATE_STATE ; NSIS Var OLD_UNINSTALLER Var OLD_INSTDIR Var OLD_DISPLAYNAME Var TMP_UNINSTALLER ; WiX Var REGISTRY_BITS Var TMP_PRODUCT_GUID Var WIX_DISPLAYNAME Var WIX_DISPLAYVERSION Var WIX_UNINSTALLSTRING ; ============================================================================ ; 64-bit support ; ============================================================================ !include x64.nsh !include "GetWindowsVersion.nsh" !include WinMessages.nsh Function .onInit !if ${WIRESHARK_TARGET_PLATFORM} == "x64" ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873 ${IfNot} ${RunningX64} MessageBox MB_OK "Logray only runs on 64-bit machines." /SD IDOK Abort ${EndIf} !endif ; Get the Windows version ${GetWindowsVersion} $R0 ; This should match the following: ; - The NTDDI_VERSION and _WIN32_WINNT parts of cmakeconfig.h.in ; - The <compatibility><application> section in image\wireshark.exe.manifest.in ; - The VersionNT parts of packaging\wix\Prerequisites.wxi ; Uncomment to test. ; MessageBox MB_OK "You're running Windows $R0." ; Check if we're able to run with this version StrCmp $R0 '95' lbl_winversion_unsupported StrCmp $R0 '98' lbl_winversion_unsupported StrCmp $R0 'ME' lbl_winversion_unsupported StrCmp $R0 'NT 4.0' lbl_winversion_unsupported StrCmp $R0 '2000' lbl_winversion_unsupported StrCmp $R0 'XP' lbl_winversion_unsupported StrCmp $R0 '2003' lbl_winversion_unsupported StrCmp $R0 'Vista' lbl_winversion_unsupported StrCmp $R0 '2008' lbl_winversion_unsupported Goto lbl_winversion_supported lbl_winversion_unsupported: MessageBox MB_OK \ "Windows $R0 is not supported." \ /SD IDOK Quit lbl_winversion_supported: !insertmacro IsLograyRunning ; Default control values. StrCpy $START_MENU_STATE ${BST_CHECKED} StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED} StrCpy $FILE_ASSOCIATE_STATE ${BST_CHECKED} ; Copied from https://nsis.sourceforge.io/Auto-uninstall_old_before_installing_new ReadRegStr $OLD_UNINSTALLER HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ "UninstallString" StrCmp $OLD_UNINSTALLER "" check_wix ReadRegStr $OLD_INSTDIR HKLM \ "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" \ "Path" StrCmp $OLD_INSTDIR "" check_wix ReadRegStr $OLD_DISPLAYNAME HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ "DisplayName" StrCmp $OLD_DISPLAYNAME "" done ; We're reinstalling. Flip our control states according to what the ; user chose before. ; (we use the "all users" start menu, so select it first) SetShellVarContext all ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 1 sm $START_MENU_STATE di $DESKTOP_ICON_STATE" ${IfNot} ${FileExists} $SMPROGRAMS\${PROGRAM_NAME}.lnk StrCpy $START_MENU_STATE ${BST_UNCHECKED} ${Endif} ${If} ${FileExists} $DESKTOP\${PROGRAM_NAME}.lnk StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED} ${Endif} ; Leave FILE_ASSOCIATE_STATE checked. ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 2 sm $START_MENU_STATE $SMPROGRAMS\${PROGRAM_NAME}\${PROGRAM_NAME}.lnk \ ; $\ndi $DESKTOP_ICON_STATE $DESKTOP\${PROGRAM_NAME}.lnk MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \ "$OLD_DISPLAYNAME is already installed.\ $\n$\nWould you like to uninstall it first?" \ /SD IDYES \ IDYES prep_nsis_uninstaller \ IDNO done Abort ; Copy the uninstaller to $TEMP and run it. ; The uninstaller normally does this by itself, but doesn't wait around ; for the executable to finish, which means ExecWait won't work correctly. prep_nsis_uninstaller: ClearErrors StrCpy $TMP_UNINSTALLER "$TEMP\${PROGRAM_NAME}_uninstaller.exe" ; ...because we surround UninstallString in quotes. StrCpy $0 $OLD_UNINSTALLER -1 1 StrCpy $1 "$TEMP\${PROGRAM_NAME}_uninstaller.exe" StrCpy $2 1 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1' ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR" Delete "$TMP_UNINSTALLER" ; Look for a WiX-installed package. check_wix: StrCpy $REGISTRY_BITS 64 SetRegView 64 check_wix_restart: StrCpy $0 0 wix_reg_enum_loop: EnumRegKey $TMP_PRODUCT_GUID HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0 StrCmp $TMP_PRODUCT_GUID "" wix_enum_reg_done IntOp $0 $0 + 1 ReadRegStr $WIX_DISPLAYNAME HKLM \ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \ "DisplayName" ; MessageBox MB_OK|MB_ICONINFORMATION "Reading HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1 DisplayName = $2" ; Look for "Logray". StrCmp $WIX_DISPLAYNAME "${PROGRAM_NAME}" wix_found wix_reg_enum_loop wix_found: ReadRegStr $WIX_DISPLAYVERSION HKLM \ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \ "DisplayVersion" ReadRegStr $WIX_UNINSTALLSTRING HKLM \ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \ "UninstallString" StrCmp $WIX_UNINSTALLSTRING "" done MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \ "$WIX_DISPLAYNAME $WIX_DISPLAYVERSION (msi) is already installed.\ $\n$\nWould you like to uninstall it first?" \ /SD IDYES \ IDYES prep_wix_uninstaller \ IDNO done Abort ; Run the WiX-provided UninstallString. prep_wix_uninstaller: ClearErrors ExecWait "$WIX_UNINSTALLSTRING" Goto done wix_enum_reg_done: ; MessageBox MB_OK|MB_ICONINFORMATION "Checked $0 $REGISTRY_BITS bit keys" IntCmp $REGISTRY_BITS 32 done StrCpy $REGISTRY_BITS 32 SetRegView 32 Goto check_wix_restart done: ; Command line parameters ${GetParameters} $R0 ${GetOptions} $R0 "/desktopicon=" $R1 ${If} $R1 == "yes" StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED} ${ElseIf} $R1 == "no" StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED} ${Endif} ;Extract InstallOptions INI files ;!insertmacro INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini" FunctionEnd !ifdef QT_DIR Function DisplayAdditionalTasksPage Call fnc_AdditionalTasksPage_Show FunctionEnd !endif ; ============================================================================ ; Installation execution commands ; ============================================================================ Section "-Required" ;------------------------------------------- ; ; Install for every user ; SetShellVarContext all SetOutPath $INSTDIR File "${STAGING_DIR}\${UNINSTALLER_NAME}" File "${STAGING_DIR}\libwiretap.dll" File "${STAGING_DIR}\libwireshark.dll" File "${STAGING_DIR}\libwsutil.dll" !include logray-manifest.nsh File "${STAGING_DIR}\COPYING.txt" File "${STAGING_DIR}\NEWS.txt" File "${STAGING_DIR}\README.txt" File "${STAGING_DIR}\README.windows.txt" File "${STAGING_DIR}\wka" File "${STAGING_DIR}\pdml2html.xsl" File "${STAGING_DIR}\ws.css" ;File "${STAGING_DIR}\logray.html" File "${STAGING_DIR}\wireshark-filter.html" File "${STAGING_DIR}\dumpcap.exe" File "${STAGING_DIR}\dumpcap.html" File "${STAGING_DIR}\extcap.html" File "${STAGING_DIR}\ipmap.html" ; C-runtime redistributable ; vc_redist.x64.exe or vc_redist.x86.exe - copy and execute the redistributable installer File "${VCREDIST_DIR}\${VCREDIST_EXE}" ; If the user already has the redistributable installed they will see a ; Big Ugly Dialog by default, asking if they want to uninstall or repair. ; Ideally we should add a checkbox for this somewhere. In the meantime, ; just do a "quiet" install. ; http://asawicki.info/news_1597_installing_visual_c_redistributable_package_from_command_line.html ExecWait '"$INSTDIR\${VCREDIST_EXE}" /install /quiet /norestart' $0 DetailPrint "${VCREDIST_EXE} returned $0" ; https://docs.microsoft.com/en-us/windows/desktop/Msi/error-codes !define ERROR_SUCCESS 0 !define ERROR_SUCCESS_REBOOT_INITIATED 1641 !define ERROR_PRODUCT_VERSION 1638 !define ERROR_SUCCESS_REBOOT_REQUIRED 3010 ${Switch} $0 ${Case} ${ERROR_SUCCESS} ${Case} ${ERROR_PRODUCT_VERSION} ${Break} ${Case} ${ERROR_SUCCESS_REBOOT_INITIATED} ; Shouldn't happen. ${Case} ${ERROR_SUCCESS_REBOOT_REQUIRED} SetRebootFlag true ${Break} ${Default} MessageBox MB_OK "The Visual C++ Redistributable installer failed with error $0.$\nUnable to continue installation." /SD IDOK Abort ${Break} ${EndSwitch} Delete "$INSTDIR\${VCREDIST_EXE}" ; global config files - don't overwrite if already existing ;IfFileExists cfilters dont_overwrite_cfilters File "${STAGING_DIR}\cfilters" ;dont_overwrite_cfilters: ;IfFileExists colorfilters dont_overwrite_colorfilters File "${STAGING_DIR}\colorfilters" ;dont_overwrite_colorfilters: ;IfFileExists dfilters dont_overwrite_dfilters File "${STAGING_DIR}\dfilters" ;dont_overwrite_dfilters: ;IfFileExists smi_modules dont_overwrite_smi_modules File "${STAGING_DIR}\smi_modules" ;dont_overwrite_smi_modules: ; ; Install the Diameter DTD and XML files in the "diameter" subdirectory ; of the installation directory. ; SetOutPath $INSTDIR\diameter File "${STAGING_DIR}\diameter\AlcatelLucent.xml" File "${STAGING_DIR}\diameter\chargecontrol.xml" File "${STAGING_DIR}\diameter\Cisco.xml" File "${STAGING_DIR}\diameter\CiscoSystems.xml" File "${STAGING_DIR}\diameter\Custom.xml" File "${STAGING_DIR}\diameter\dictionary.dtd" File "${STAGING_DIR}\diameter\dictionary.xml" File "${STAGING_DIR}\diameter\eap.xml" File "${STAGING_DIR}\diameter\Ericsson.xml" File "${STAGING_DIR}\diameter\etsie2e4.xml" File "${STAGING_DIR}\diameter\HP.xml" File "${STAGING_DIR}\diameter\Huawei.xml" File "${STAGING_DIR}\diameter\Inovar.xml" File "${STAGING_DIR}\diameter\Juniper.xml" File "${STAGING_DIR}\diameter\Metaswitch.xml" File "${STAGING_DIR}\diameter\Microsoft.xml" File "${STAGING_DIR}\diameter\mobileipv4.xml" File "${STAGING_DIR}\diameter\mobileipv6.xml" File "${STAGING_DIR}\diameter\nasreq.xml" File "${STAGING_DIR}\diameter\Nokia.xml" File "${STAGING_DIR}\diameter\NokiaSolutionsAndNetworks.xml" File "${STAGING_DIR}\diameter\Oracle.xml" File "${STAGING_DIR}\diameter\Siemens.xml" File "${STAGING_DIR}\diameter\sip.xml" File "${STAGING_DIR}\diameter\Starent.xml" File "${STAGING_DIR}\diameter\sunping.xml" File "${STAGING_DIR}\diameter\Telefonica.xml" File "${STAGING_DIR}\diameter\TGPP.xml" File "${STAGING_DIR}\diameter\TGPP2.xml" File "${STAGING_DIR}\diameter\Vodafone.xml" File "${STAGING_DIR}\diameter\VerizonWireless.xml" !include "custom_diameter_xmls.txt" SetOutPath $INSTDIR ; ; Install the RADIUS directory files in the "radius" subdirectory ; of the installation directory. ; SetOutPath $INSTDIR\radius File "${STAGING_DIR}\radius\README.radius_dictionary" File "${STAGING_DIR}\radius\custom.includes" File "${STAGING_DIR}\radius\dictionary" File "${STAGING_DIR}\radius\dictionary.3com" File "${STAGING_DIR}\radius\dictionary.3gpp" File "${STAGING_DIR}\radius\dictionary.3gpp2" File "${STAGING_DIR}\radius\dictionary.5x9" File "${STAGING_DIR}\radius\dictionary.acc" File "${STAGING_DIR}\radius\dictionary.acme" File "${STAGING_DIR}\radius\dictionary.actelis" File "${STAGING_DIR}\radius\dictionary.aerohive" File "${STAGING_DIR}\radius\dictionary.airespace" File "${STAGING_DIR}\radius\dictionary.alcatel" File "${STAGING_DIR}\radius\dictionary.alcatel-lucent.aaa" File "${STAGING_DIR}\radius\dictionary.alcatel.esam" File "${STAGING_DIR}\radius\dictionary.alcatel.sr" File "${STAGING_DIR}\radius\dictionary.alteon" File "${STAGING_DIR}\radius\dictionary.altiga" File "${STAGING_DIR}\radius\dictionary.alvarion" File "${STAGING_DIR}\radius\dictionary.alvarion.wimax.v2_2" File "${STAGING_DIR}\radius\dictionary.apc" File "${STAGING_DIR}\radius\dictionary.aptilo" File "${STAGING_DIR}\radius\dictionary.aptis" File "${STAGING_DIR}\radius\dictionary.arbor" File "${STAGING_DIR}\radius\dictionary.aruba" File "${STAGING_DIR}\radius\dictionary.ascend" File "${STAGING_DIR}\radius\dictionary.asn" File "${STAGING_DIR}\radius\dictionary.audiocodes" File "${STAGING_DIR}\radius\dictionary.avaya" File "${STAGING_DIR}\radius\dictionary.azaire" File "${STAGING_DIR}\radius\dictionary.bay" File "${STAGING_DIR}\radius\dictionary.bintec" File "${STAGING_DIR}\radius\dictionary.bluecoat" File "${STAGING_DIR}\radius\dictionary.bristol" File "${STAGING_DIR}\radius\dictionary.broadsoft" File "${STAGING_DIR}\radius\dictionary.brocade" File "${STAGING_DIR}\radius\dictionary.bskyb" File "${STAGING_DIR}\radius\dictionary.bt" File "${STAGING_DIR}\radius\dictionary.cablelabs" File "${STAGING_DIR}\radius\dictionary.cabletron" File "${STAGING_DIR}\radius\dictionary.camiant" File "${STAGING_DIR}\radius\dictionary.chillispot" File "${STAGING_DIR}\radius\dictionary.cisco" File "${STAGING_DIR}\radius\dictionary.cisco.asa" File "${STAGING_DIR}\radius\dictionary.cisco.bbsm" File "${STAGING_DIR}\radius\dictionary.cisco.vpn3000" File "${STAGING_DIR}\radius\dictionary.cisco.vpn5000" File "${STAGING_DIR}\radius\dictionary.citrix" File "${STAGING_DIR}\radius\dictionary.clavister" File "${STAGING_DIR}\radius\dictionary.cnergee" File "${STAGING_DIR}\radius\dictionary.colubris" File "${STAGING_DIR}\radius\dictionary.columbia_university" File "${STAGING_DIR}\radius\dictionary.compat" File "${STAGING_DIR}\radius\dictionary.compatible" File "${STAGING_DIR}\radius\dictionary.cosine" File "${STAGING_DIR}\radius\dictionary.dante" File "${STAGING_DIR}\radius\dictionary.dellemc" File "${STAGING_DIR}\radius\dictionary.dhcp" File "${STAGING_DIR}\radius\dictionary.digium" File "${STAGING_DIR}\radius\dictionary.dlink" File "${STAGING_DIR}\radius\dictionary.dragonwave" File "${STAGING_DIR}\radius\dictionary.efficientip" File "${STAGING_DIR}\radius\dictionary.eltex" File "${STAGING_DIR}\radius\dictionary.enterasys" File "${STAGING_DIR}\radius\dictionary.epygi" File "${STAGING_DIR}\radius\dictionary.equallogic" File "${STAGING_DIR}\radius\dictionary.ericsson" File "${STAGING_DIR}\radius\dictionary.ericsson.ab" File "${STAGING_DIR}\radius\dictionary.ericsson.packet.core.networks" File "${STAGING_DIR}\radius\dictionary.extreme" File "${STAGING_DIR}\radius\dictionary.f5" File "${STAGING_DIR}\radius\dictionary.fdxtended" File "${STAGING_DIR}\radius\dictionary.fortinet" File "${STAGING_DIR}\radius\dictionary.foundry" File "${STAGING_DIR}\radius\dictionary.freedhcp" File "${STAGING_DIR}\radius\dictionary.freeradius" File "${STAGING_DIR}\radius\dictionary.freeradius.internal" File "${STAGING_DIR}\radius\dictionary.freeswitch" File "${STAGING_DIR}\radius\dictionary.gandalf" File "${STAGING_DIR}\radius\dictionary.garderos" File "${STAGING_DIR}\radius\dictionary.gemtek" File "${STAGING_DIR}\radius\dictionary.h3c" File "${STAGING_DIR}\radius\dictionary.hp" File "${STAGING_DIR}\radius\dictionary.huawei" File "${STAGING_DIR}\radius\dictionary.iana" File "${STAGING_DIR}\radius\dictionary.identity_engines" File "${STAGING_DIR}\radius\dictionary.iea" File "${STAGING_DIR}\radius\dictionary.infoblox" File "${STAGING_DIR}\radius\dictionary.infonet" File "${STAGING_DIR}\radius\dictionary.ipunplugged" File "${STAGING_DIR}\radius\dictionary.issanni" File "${STAGING_DIR}\radius\dictionary.itk" File "${STAGING_DIR}\radius\dictionary.jradius" File "${STAGING_DIR}\radius\dictionary.juniper" File "${STAGING_DIR}\radius\dictionary.karlnet" File "${STAGING_DIR}\radius\dictionary.kineto" File "${STAGING_DIR}\radius\dictionary.lancom" File "${STAGING_DIR}\radius\dictionary.livingston" File "${STAGING_DIR}\radius\dictionary.localweb" File "${STAGING_DIR}\radius\dictionary.lucent" File "${STAGING_DIR}\radius\dictionary.manzara" File "${STAGING_DIR}\radius\dictionary.meinberg" File "${STAGING_DIR}\radius\dictionary.meraki" File "${STAGING_DIR}\radius\dictionary.merit" File "${STAGING_DIR}\radius\dictionary.meru" File "${STAGING_DIR}\radius\dictionary.microsemi" File "${STAGING_DIR}\radius\dictionary.microsoft" File "${STAGING_DIR}\radius\dictionary.mikrotik" File "${STAGING_DIR}\radius\dictionary.motorola" File "${STAGING_DIR}\radius\dictionary.motorola.wimax" File "${STAGING_DIR}\radius\dictionary.navini" File "${STAGING_DIR}\radius\dictionary.netscreen" File "${STAGING_DIR}\radius\dictionary.networkphysics" File "${STAGING_DIR}\radius\dictionary.nexans" File "${STAGING_DIR}\radius\dictionary.nokia" File "${STAGING_DIR}\radius\dictionary.nokia.conflict" File "${STAGING_DIR}\radius\dictionary.nomadix" File "${STAGING_DIR}\radius\dictionary.nortel" File "${STAGING_DIR}\radius\dictionary.ntua" File "${STAGING_DIR}\radius\dictionary.openser" File "${STAGING_DIR}\radius\dictionary.packeteer" File "${STAGING_DIR}\radius\dictionary.paloalto" File "${STAGING_DIR}\radius\dictionary.patton" File "${STAGING_DIR}\radius\dictionary.perle" File "${STAGING_DIR}\radius\dictionary.propel" File "${STAGING_DIR}\radius\dictionary.prosoft" File "${STAGING_DIR}\radius\dictionary.proxim" File "${STAGING_DIR}\radius\dictionary.purewave" File "${STAGING_DIR}\radius\dictionary.quiconnect" File "${STAGING_DIR}\radius\dictionary.quintum" File "${STAGING_DIR}\radius\dictionary.redcreek" File "${STAGING_DIR}\radius\dictionary.rfc2865" File "${STAGING_DIR}\radius\dictionary.rfc2866" File "${STAGING_DIR}\radius\dictionary.rfc2867" File "${STAGING_DIR}\radius\dictionary.rfc2868" File "${STAGING_DIR}\radius\dictionary.rfc2869" File "${STAGING_DIR}\radius\dictionary.rfc3162" File "${STAGING_DIR}\radius\dictionary.rfc3576" File "${STAGING_DIR}\radius\dictionary.rfc3580" File "${STAGING_DIR}\radius\dictionary.rfc4072" File "${STAGING_DIR}\radius\dictionary.rfc4372" File "${STAGING_DIR}\radius\dictionary.rfc4603" File "${STAGING_DIR}\radius\dictionary.rfc4675" File "${STAGING_DIR}\radius\dictionary.rfc4679" File "${STAGING_DIR}\radius\dictionary.rfc4818" File "${STAGING_DIR}\radius\dictionary.rfc4849" File "${STAGING_DIR}\radius\dictionary.rfc5090" File "${STAGING_DIR}\radius\dictionary.rfc5176" File "${STAGING_DIR}\radius\dictionary.rfc5447" File "${STAGING_DIR}\radius\dictionary.rfc5580" File "${STAGING_DIR}\radius\dictionary.rfc5607" File "${STAGING_DIR}\radius\dictionary.rfc5904" File "${STAGING_DIR}\radius\dictionary.rfc6519" File "${STAGING_DIR}\radius\dictionary.rfc6572" File "${STAGING_DIR}\radius\dictionary.rfc6677" File "${STAGING_DIR}\radius\dictionary.rfc6911" File "${STAGING_DIR}\radius\dictionary.rfc6929" File "${STAGING_DIR}\radius\dictionary.rfc6930" File "${STAGING_DIR}\radius\dictionary.rfc7055" File "${STAGING_DIR}\radius\dictionary.rfc7155" File "${STAGING_DIR}\radius\dictionary.rfc7268" File "${STAGING_DIR}\radius\dictionary.rfc7499" File "${STAGING_DIR}\radius\dictionary.rfc7930" File "${STAGING_DIR}\radius\dictionary.riverbed" File "${STAGING_DIR}\radius\dictionary.riverstone" File "${STAGING_DIR}\radius\dictionary.roaringpenguin" File "${STAGING_DIR}\radius\dictionary.ruckus" File "${STAGING_DIR}\radius\dictionary.ruggedcom" File "${STAGING_DIR}\radius\dictionary.sangoma" File "${STAGING_DIR}\radius\dictionary.sg" File "${STAGING_DIR}\radius\dictionary.shasta" File "${STAGING_DIR}\radius\dictionary.shiva" File "${STAGING_DIR}\radius\dictionary.siemens" File "${STAGING_DIR}\radius\dictionary.slipstream" File "${STAGING_DIR}\radius\dictionary.sofaware" File "${STAGING_DIR}\radius\dictionary.sonicwall" File "${STAGING_DIR}\radius\dictionary.springtide" File "${STAGING_DIR}\radius\dictionary.starent" File "${STAGING_DIR}\radius\dictionary.starent.vsa1" File "${STAGING_DIR}\radius\dictionary.surfnet" File "${STAGING_DIR}\radius\dictionary.symbol" File "${STAGING_DIR}\radius\dictionary.t_systems_nova" File "${STAGING_DIR}\radius\dictionary.telebit" File "${STAGING_DIR}\radius\dictionary.telkom" File "${STAGING_DIR}\radius\dictionary.terena" File "${STAGING_DIR}\radius\dictionary.trapeze" File "${STAGING_DIR}\radius\dictionary.travelping" File "${STAGING_DIR}\radius\dictionary.tropos" File "${STAGING_DIR}\radius\dictionary.ukerna" File "${STAGING_DIR}\radius\dictionary.unisphere" File "${STAGING_DIR}\radius\dictionary.unix" File "${STAGING_DIR}\radius\dictionary.usr" File "${STAGING_DIR}\radius\dictionary.utstarcom" File "${STAGING_DIR}\radius\dictionary.valemount" File "${STAGING_DIR}\radius\dictionary.versanet" File "${STAGING_DIR}\radius\dictionary.verizon" File "${STAGING_DIR}\radius\dictionary.vqp" File "${STAGING_DIR}\radius\dictionary.walabi" File "${STAGING_DIR}\radius\dictionary.waverider" File "${STAGING_DIR}\radius\dictionary.wichorus" File "${STAGING_DIR}\radius\dictionary.wimax" File "${STAGING_DIR}\radius\dictionary.wimax.alvarion" File "${STAGING_DIR}\radius\dictionary.wimax.wichorus" File "${STAGING_DIR}\radius\dictionary.wispr" File "${STAGING_DIR}\radius\dictionary.xedia" File "${STAGING_DIR}\radius\dictionary.xylan" File "${STAGING_DIR}\radius\dictionary.yubico" File "${STAGING_DIR}\radius\dictionary.zeus" File "${STAGING_DIR}\radius\dictionary.zte" File "${STAGING_DIR}\radius\dictionary.zyxel" !include "custom_radius_dict.txt" SetOutPath $INSTDIR ; ; install the dtds in the dtds subdirectory ; SetOutPath $INSTDIR\dtds File "${STAGING_DIR}\dtds\dc.dtd" File "${STAGING_DIR}\dtds\itunes.dtd" File "${STAGING_DIR}\dtds\mscml.dtd" File "${STAGING_DIR}\dtds\pocsettings.dtd" File "${STAGING_DIR}\dtds\presence.dtd" File "${STAGING_DIR}\dtds\reginfo.dtd" File "${STAGING_DIR}\dtds\rlmi.dtd" File "${STAGING_DIR}\dtds\rss.dtd" File "${STAGING_DIR}\dtds\smil.dtd" File "${STAGING_DIR}\dtds\xcap-caps.dtd" File "${STAGING_DIR}\dtds\xcap-error.dtd" File "${STAGING_DIR}\dtds\watcherinfo.dtd" SetOutPath $INSTDIR ; Create the extcap directory CreateDirectory $INSTDIR\extcap ; ; install the protobuf .proto definitions in the protobuf subdirectory ; SetOutPath $INSTDIR\protobuf File "${STAGING_DIR}\protobuf\*.proto" ; Install the TPNCP DAT file in the "tpncp" subdirectory ; of the installation directory. SetOutPath $INSTDIR\tpncp File "${STAGING_DIR}\tpncp\tpncp.dat" ; Write the uninstall keys for Windows ; https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs ; https://docs.microsoft.com/en-us/previous-versions/ms954376(v=msdn.10) ; https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key !define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Comments" "${DISPLAY_NAME}" !ifdef QT_DIR WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${PROGRAM_NAME_PATH},0" !endif WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayName" "${DISPLAY_NAME}" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "HelpLink" "https://ask.wireshark.org/" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "InstallLocation" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Publisher" "The Logray developer community, https://www.wireshark.org" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLInfoAbout" "https://www.wireshark.org" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLUpdateInfo" "https://www.wireshark.org/download.html" WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoModify" 1 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoRepair" 1 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMajor" ${MAJOR_VERSION} WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMinor" ${MINOR_VERSION} WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}"' WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\${UNINSTALLER_NAME}" /S' ; To quote https://web.archive.org/web/20150911221413/http://download.microsoft.com/download/0/4/6/046bbd36-0812-4c22-a870-41911c6487a6/WindowsUserExperience.pdf: ; "Do not include Readme, Help, or Uninstall entries on the Programs menu." Delete "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Web Site.lnk" ; Create file extensions if the Associated Tasks page check box ; is checked. ${If} $FILE_ASSOCIATE_STATE == ${BST_CHECKED} WriteRegStr HKCR ${LOGRAY_ASSOC} "" "Logray log file" WriteRegStr HKCR "${LOGRAY_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME_PATH}" "%1"' WriteRegStr HKCR "${LOGRAY_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME_PATH}",1' ; We refresh the icon cache down in -Finally. Call Associate ; If you add something here be sure to sync it with the uninstall section and the ; AdditionalTasks page ${Endif} SectionEnd ; "Required" !ifdef QT_DIR Section "${PROGRAM_NAME}" SecLograyQt ;------------------------------------------- ; by default, Logray.exe is installed SetOutPath $INSTDIR File "${QT_DIR}\${PROGRAM_NAME_PATH}" ; Write an entry for ShellExecute WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "" '$INSTDIR\${PROGRAM_NAME_PATH}' WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "Path" '$INSTDIR' !include logray-qt-manifest.nsh ${!defineifexist} TRANSLATIONS_FOLDER "${QT_DIR}\translations" SetOutPath $INSTDIR !ifdef TRANSLATIONS_FOLDER ; Starting from Qt 5.5, *.qm files are put in a translations subfolder File /r "${QT_DIR}\translations" !else File "${QT_DIR}\*.qm" !endif ; Is the Start Menu check box checked? ${If} $START_MENU_STATE == ${BST_CHECKED} CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}" ${Endif} ${If} $DESKTOP_ICON_STATE == ${BST_CHECKED} CreateShortCut "$DESKTOP\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}" ${Endif} SectionEnd ; "SecLograyQt" !endif Section "TShark" SecTShark ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\tshark.exe" File "${STAGING_DIR}\tshark.html" SectionEnd SectionGroup "Plugins & Extensions" SecPluginsGroup Section "Dissector Plugins" SecPlugins ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\falco-bridge.dll" SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\falco' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\falco\cloudtrail.dll" !include "custom_plugins.txt" SectionEnd Section "Tree Statistics Plugin" SecStatsTree ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\stats_tree.dll" SectionEnd Section "Mate - Meta Analysis and Tracing Engine" SecMate ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\mate.dll" SectionEnd Section "Configuration Profiles" SecProfiles ;------------------------------------------- ; This should be a function or macro SetOutPath '$INSTDIR\profiles\Bluetooth' File "${STAGING_DIR}\profiles\Bluetooth\colorfilters" File "${STAGING_DIR}\profiles\Bluetooth\preferences" SetOutPath '$INSTDIR\profiles\Classic' File "${STAGING_DIR}\profiles\Classic\colorfilters" SetOutPath '$INSTDIR\profiles\No Reassembly' File "${STAGING_DIR}\profiles\No Reassembly\preferences" SectionEnd !ifdef SMI_DIR Section "SNMP MIBs" SecMIBs ;------------------------------------------- SetOutPath '$INSTDIR\snmp\mibs' File "${SMI_DIR}\share\mibs\iana\*" File "${SMI_DIR}\share\mibs\ietf\*" File "${SMI_DIR}\share\mibs\irtf\*" File "${SMI_DIR}\share\mibs\tubs\*" File "${SMI_DIR}\share\pibs\*" File "${SMI_DIR}\share\yang\*.yang" !include "custom_mibs.txt" SectionEnd !endif SectionGroupEnd ; "Plugins / Extensions" SectionGroup "Tools" SecToolsGroup Section "Editcap" SecEditcap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\editcap.exe" File "${STAGING_DIR}\editcap.html" SectionEnd Section "Text2Pcap" SecText2Pcap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\text2pcap.exe" File "${STAGING_DIR}\text2pcap.html" SectionEnd Section "Mergecap" SecMergecap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\mergecap.exe" File "${STAGING_DIR}\mergecap.html" SectionEnd Section "Reordercap" SecReordercap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\reordercap.exe" File "${STAGING_DIR}\reordercap.html" SectionEnd Section "Capinfos" SecCapinfos ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\capinfos.exe" File "${STAGING_DIR}\capinfos.html" SectionEnd Section "Captype" SecCaptype ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\captype.exe" File "${STAGING_DIR}\captype.html" SectionEnd Section /o "Randpkt" SecRandpkt ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\randpkt.exe" File "${STAGING_DIR}\randpkt.html" SectionEnd !ifdef MMDBRESOLVE_EXE Section "MMDBResolve" SecMMDBResolve ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\mmdbresolve.html" SetOutPath $INSTDIR File "${STAGING_DIR}\mmdbresolve.exe" SectionEnd !endif Section /o "Etwdump" SecEtwdump ;------------------------------------------- !insertmacro InstallExtcap "Etwdump" SectionEnd !insertmacro CheckExtrasFlag "Etwdump" SectionGroupEnd ; "Tools" !ifdef DOCBOOK_DIR Section "Documentation" SecDocumentation ;------------------------------------------- SetOutPath "$INSTDIR\Wireshark User's Guide" File /r "${DOCBOOK_DIR}\wsug_html_chunked\*.*" SetOutPath $INSTDIR File "${DOCBOOK_DIR}\faq.html" SectionEnd !endif Section "-Finally" !insertmacro UpdateIcons ; Compute and write the installation directory size ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 IntFmt $0 "0x%08X" $0 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "EstimatedSize" "$0" SectionEnd ; ============================================================================ ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD! ; ============================================================================ !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !ifdef QT_DIR !insertmacro MUI_DESCRIPTION_TEXT ${SecLograyQt} "The main network protocol analyzer application." !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "Text based network protocol analyzer." !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Plugins and extensions for both ${PROGRAM_NAME} and TShark." !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Additional protocol dissectors." !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Extended statistics." !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin - Meta Analysis and Tracing Engine (Experimental)." !insertmacro MUI_DESCRIPTION_TEXT ${SecProfiles} "Configuration profiles" !ifdef SMI_DIR !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection." !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools." !insertmacro MUI_DESCRIPTION_TEXT ${SecEtwdump} "Provide ETW reader" !insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Copy packets to a new file, optionally trimming packets, omitting them, or saving to a different format." !insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Read an ASCII hex dump and write the data into a libpcap-style capture file." !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Combine multiple saved capture files into a single output file" !insertmacro MUI_DESCRIPTION_TEXT ${SecReordercap} "Copy packets to a new file, sorted by time." !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Print information about capture files." !insertmacro MUI_DESCRIPTION_TEXT ${SecCaptype} "Print the types capture files." !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpkt} "Random packet generator." !insertmacro MUI_DESCRIPTION_TEXT ${SecMMDBResolve} "MaxMind Database resolution tool" !ifdef DOCBOOK_DIR !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} "Install an offline copy of the User's Guide and FAQ." !endif !insertmacro MUI_FUNCTION_DESCRIPTION_END ; ============================================================================ ; Callback functions ; ============================================================================ !ifdef QT_DIR Var QT_SELECTED ; Called from fnc_AdditionalTasksPage_Create via DisplayAdditionalTasksPage. Function InitAdditionalTasksPage ; We've created the Additional tasks page. Update our control states ; before they are shown. ; We set XXX_STATE -> XxxCheckBox here and go the other direction below. ${NSD_SetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE ${NSD_SetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE ${NSD_SetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE StrCpy $QT_SELECTED 0 ${If} ${SectionIsSelected} ${SecLograyQt} StrCpy $QT_SELECTED 1 ${Endif} EnableWindow $hCtl_AdditionalTasksPage_CreateShortcutsLabel $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_StartMenuCheckBox $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_DesktopIconCheckBox $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_ExtensionsLabel $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_FileExtensionsLabel $QT_SELECTED FunctionEnd Function LeaveAdditionalTasksPage ; We're leaving the Additional tasks page. Get our control states ; before they're destroyed. ; We set XxxCheckBox -> XXX_STATE here and go the other direction above. ${NSD_GetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE ${NSD_GetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE ${NSD_GetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE FunctionEnd !endif ; QT_DIR
wireshark/packaging/nsis/makeUninstall.ps1
# MakeUninstall.ps1 # # Runs the uninstall_installer to create the uninstall.exe that can be signed # Uses set __COMPAT_LAYER=RunAsInvoker to not request elevation # # Copyright 2020 Graham Bloice <[email protected]> # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later #requires -version 2 <# .SYNOPSIS Runs the uninstall_<application>_installer without invoking UAC. .DESCRIPTION This script runs the uninstall_<application>_installer that creates an uninstall exe but without invoking a UAC elevation prompt that is required by the uninstaller .PARAMETER Executable The path to the uninstall_<application>_installer.exe .INPUTS -Executable Path to the uninstaller installer. .OUTPUTS An unsigned uninstall-<application>.exe for signing .EXAMPLE C:\PS> .\makeUninstall.ps1 run\RelWithDebInfo\uninstall_wireshark_installer.exe #> Param( [Parameter(Mandatory=$true, Position=0)] [String] $Executable ) # Stop the process requesting elevation, runs as the user $env:__COMPAT_LAYER = "RunAsInvoker" # And run the process Start-Process $Executable -Wait -NoNewWindow
Text
wireshark/packaging/nsis/mingw64-qt-mapping.txt
# # Generated by running # "windeployqt6.exe --no-compiler-runtime --no-translations --list mapping /path/to/Wireshark.exe" # on a Windows machine and editing by hand. # "bin/Qt6Core.dll" "Qt6Core.dll" "bin/Qt6Core5Compat.dll" "Qt6Core5Compat.dll" "bin/Qt6Gui.dll" "Qt6Gui.dll" "bin/Qt6Multimedia.dll" "Qt6Multimedia.dll" "bin/Qt6Network.dll" "Qt6Network.dll" "bin/Qt6PrintSupport.dll" "Qt6PrintSupport.dll" #"bin/Qt6Svg.dll" "Qt6Svg.dll" "bin/Qt6Widgets.dll" "Qt6Widgets.dll" #"bin/opengl32sw.dll" "opengl32sw.dll" #"bin/D3Dcompiler_47.dll" "D3Dcompiler_47.dll" "lib/qt6/plugins/generic/qtuiotouchplugin.dll" "generic/qtuiotouchplugin.dll" #"lib/qt6/plugins/iconengines/qsvgicon.dll" "iconengines/qsvgicon.dll" "lib/qt6/plugins/imageformats/qgif.dll" "imageformats/qgif.dll" "lib/qt6/plugins/imageformats/qico.dll" "imageformats/qico.dll" "lib/qt6/plugins/imageformats/qjpeg.dll" "imageformats/qjpeg.dll" #"lib/qt6/plugins/imageformats/qsvg.dll" "imageformats/qsvg.dll" #"lib/qt6/plugins/multimedia/ffmpegmediaplugin.dll" "multimedia/ffmpegmediaplugin.dll" "lib/qt6/plugins/multimedia/windowsmediaplugin.dll" "multimedia/windowsmediaplugin.dll" "lib/qt6/plugins/networkinformation/qnetworklistmanager.dll" "networkinformation/qnetworklistmanager.dll" "lib/qt6/plugins/platforms/qwindows.dll" "platforms/qwindows.dll" "lib/qt6/plugins/styles/qwindowsvistastyle.dll" "styles/qwindowsvistastyle.dll" "lib/qt6/plugins/tls/qcertonlybackend.dll" "tls/qcertonlybackend.dll" "lib/qt6/plugins/tls/qopensslbackend.dll" "tls/qopensslbackend.dll" "lib/qt6/plugins/tls/qschannelbackend.dll" "tls/qschannelbackend.dll"
INI Configuration
wireshark/packaging/nsis/NpcapPage.ini
[Settings] NumFields=10 [Field 1] Type=GroupBox Left=0 Right=-1 Top=0 Bottom=25 Text=Currently installed Npcap or WinPcap version [Field 2] Type=Label Left=10 Right=250 Top=10 Bottom=18 Text=This text will be replaced with current Npcap installer version [Field 3] Type=GroupBox Left=0 Right=-1 Top=30 Bottom=65 Text=Install [Field 4] Type=CheckBox Left=10 Right=250 Top=40 Bottom=48 Text=This text will be replaced, depending on current Npcap version in wireshark.nsi State=1 [Field 5] Type=Label Left=20 Right=290 Top=50 Bottom=58 Text=This text will be replaced, depending on whether Npcap is already installed [Field 6] Type=GroupBox Left=0 Right=-1 Top=70 Bottom=105 Text=Important notice [Field 7] Type=Label Left=10 Right=290 Top=80 Bottom=88 Text=If your system has crashed during a Wireshark installation, you must run the command [Field 8] Type=Label Left=10 Right=295 Top=89 Bottom=97 Text='net stop npcap' as Administrator before upgrading Npcap, so that it doesn't crash again [Field 9] Type=Link Left=0 Right=290 Top=112 Bottom=120 Text=Get WinPcap State=https://www.winpcap.org/ [Field 10] Type=Link Left=0 Right=290 Top=127 Bottom=135 Text=Learn more about Npcap and WinPcap State=https://gitlab.com/wireshark/wireshark/-/wikis/WinPcap
wireshark/packaging/nsis/servicelib.nsh
; from https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Service_Lib&oldid=4726 ; un. functions disabled to prevent a NSIS warning ; ; NSIS SERVICE LIBRARY - servicelib.nsh ; Version 1.2 - 02/29/2004 ; Questions/Comments - [email protected] ; ; Description: ; Provides an interface to window services ; ; Inputs: ; action - systemlib action ie. create, delete, start, stop, pause, ; continue, installed, running, status ; name - name of service to manipulate ; param - action parameters; usage: var1=value1;var2=value2;...etc. ; ; Actions: ; create - creates a new windows service ; Parameters: ; path - path to service executable ; autostart - automatically start with system ie. 1|0 ; interact - interact with the desktop ie. 1|0 ; machine - machine name where to install service ; user - user that runs the service ; password - password of the above user ; ; delete - deletes a windows service ; start - start a stopped windows service ; stop - stops a running windows service ; pause - pauses a running windows service ; continue - continues a paused windows service ; installed - is the provided service installed ; Parameters: ; action - if true then invokes the specified action ; running - is the provided service running ; Parameters: ; action - if true then invokes the specified action ; status - check the status of the provided service ; ; If run from uninstall define "UN" as "un." gefore running. ; ; Usage: ; Method 1: ; Push "action" ; Push "name" ; Push "param" ; Call Service ; Pop $0 ;response ; ; Method 2: ; !insertmacro SERVICE "action" "name" "param" ; ; History: ; 1.0 - 09/15/2003 - Initial release ; 1.1 - 09/16/2003 - Changed &l to i, thx brainsucker ; 1.2 - 02/29/2004 - Fixed documentation. !ifndef SERVICELIB !define SERVICELIB !define SC_MANAGER_ALL_ACCESS 0x3F !define SERVICE_ALL_ACCESS 0xF01FF !define SERVICE_CONTROL_STOP 1 !define SERVICE_CONTROL_PAUSE 2 !define SERVICE_CONTROL_CONTINUE 3 !define SERVICE_STOPPED 0x1 !define SERVICE_START_PENDING 0x2 !define SERVICE_STOP_PENDING 0x3 !define SERVICE_RUNNING 0x4 !define SERVICE_CONTINUE_PENDING 0x5 !define SERVICE_PAUSE_PENDING 0x6 !define SERVICE_PAUSED 0x7 !ifndef UN !define UN "" !endif !macro SERVICE ACTION NAME PARAM Push '${ACTION}' Push '${NAME}' Push '${PARAM}' Call ${UN}Service !macroend !macro FUNC_GETPARAM Push $0 Push $1 Push $2 Push $3 Push $4 Push $5 Push $6 Push $7 Exch 8 Pop $1 ;name Exch 8 Pop $2 ;source StrCpy $0 "" StrLen $7 $2 StrCpy $3 0 lbl_loop: IntCmp $3 $7 0 0 lbl_done StrLen $4 "$1=" StrCpy $5 $2 $4 $3 StrCmp $5 "$1=" 0 lbl_next IntOp $5 $3 + $4 StrCpy $3 $5 lbl_loop2: IntCmp $3 $7 0 0 lbl_done StrCpy $6 $2 1 $3 StrCmp $6 ";" 0 lbl_next2 IntOp $6 $3 - $5 StrCpy $0 $2 $6 $5 Goto lbl_done lbl_next2: IntOp $3 $3 + 1 Goto lbl_loop2 lbl_next: IntOp $3 $3 + 1 Goto lbl_loop lbl_done: Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Exch 2 Pop $6 Pop $7 Exch $0 !macroend !macro CALL_GETPARAM VAR NAME DEFAULT LABEL Push $1 Push ${NAME} Call ${UN}GETPARAM Pop $6 StrCpy ${VAR} "${DEFAULT}" StrCmp $6 "" "${LABEL}" 0 StrCpy ${VAR} $6 !macroend !macro FUNC_SERVICE UN Push $0 Push $1 Push $2 Push $3 Push $4 Push $5 Push $6 Push $7 Exch 8 Pop $1 ;param Exch 8 Pop $2 ;name Exch 8 Pop $3 ;action ;$0 return ;$4 OpenSCManager ;$5 OpenService StrCpy $0 "false" System::Call 'advapi32::OpenSCManagerA(n, n, i ${SC_MANAGER_ALL_ACCESS}) i.r4' IntCmp $4 0 lbl_done StrCmp $3 "create" lbl_create System::Call 'advapi32::OpenServiceA(i r4, t r2, i ${SERVICE_ALL_ACCESS}) i.r5' IntCmp $5 0 lbl_done lbl_select: StrCmp $3 "delete" lbl_delete StrCmp $3 "start" lbl_start StrCmp $3 "stop" lbl_stop StrCmp $3 "pause" lbl_pause StrCmp $3 "continue" lbl_continue StrCmp $3 "installed" lbl_installed StrCmp $3 "running" lbl_running StrCmp $3 "status" lbl_status Goto lbl_done ; create service lbl_create: Push $R1 ;machine Push $R2 ;user Push $R3 ;password Push $R4 ;interact Push $R5 ;autostart Push $R6 ;path !insertmacro CALL_GETPARAM $R1 "machine" "n" "lbl_machine" lbl_machine: !insertmacro CALL_GETPARAM $R2 "user" "n" "lbl_user" lbl_user: !insertmacro CALL_GETPARAM $R3 "password" "n" "lbl_password" lbl_password: !insertmacro CALL_GETPARAM $R4 "interact" "0x10" "lbl_interact" StrCpy $6 0x10 IntCmp $R4 0 +2 IntOp $R4 $6 | 0x100 StrCpy $R4 $6 lbl_interact: !insertmacro CALL_GETPARAM $R5 "autostart" "0x3" "lbl_autostart" StrCpy $6 0x3 IntCmp $R5 0 +2 StrCpy $6 0x2 StrCpy $R5 $6 lbl_autostart: !insertmacro CALL_GETPARAM $R6 "path" "n" "lbl_path" lbl_path: System::Call 'advapi32::CreateServiceA(i r4, t r2, t r2, i ${SERVICE_ALL_ACCESS}, i R4, i R5, i 0, t R6, n, n, R1, R2, R3) i.r6' Pop $R6 Pop $R5 Pop $R4 Pop $R3 Pop $R2 Pop $R1 StrCmp $6 0 lbl_done lbl_good ; delete service lbl_delete: System::Call 'advapi32::DeleteService(i r5) i.r6' StrCmp $6 0 lbl_done lbl_good ; start service lbl_start: System::Call 'advapi32::StartServiceA(i r5, i 0, i 0) i.r6' StrCmp $6 0 lbl_done lbl_good ; stop service lbl_stop: Push $R1 System::Call '*(i,i,i,i,i,i,i) i.R1' System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_STOP}, i $R1) i' System::Free $R1 Pop $R1 StrCmp $6 0 lbl_done lbl_good ; pause service lbl_pause: Push $R1 System::Call '*(i,i,i,i,i,i,i) i.R1' System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_PAUSE}, i $R1) i' System::Free $R1 Pop $R1 StrCmp $6 0 lbl_done lbl_good ; continue service lbl_continue: Push $R1 System::Call '*(i,i,i,i,i,i,i) i.R1' System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_CONTINUE}, i $R1) i' System::Free $R1 Pop $R1 StrCmp $6 0 lbl_done lbl_good ; is installed lbl_installed: !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good" StrCpy $3 $7 Goto lbl_select ; is service running lbl_running: Push $R1 System::Call '*(i,i,i,i,i,i,i) i.R1' System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i' System::Call '*$R1(i, i.r6)' System::Free $R1 Pop $R1 IntFmt $6 "0x%X" $6 StrCmp $6 ${SERVICE_RUNNING} 0 lbl_done !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good" StrCpy $3 $7 Goto lbl_select lbl_status: Push $R1 System::Call '*(i,i,i,i,i,i,i) i.R1' System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i' System::Call '*$R1(i, i .r6)' System::Free $R1 Pop $R1 IntFmt $6 "0x%X" $6 StrCpy $0 "running" IntCmp $6 ${SERVICE_RUNNING} lbl_done StrCpy $0 "stopped" IntCmp $6 ${SERVICE_STOPPED} lbl_done StrCpy $0 "start_pending" IntCmp $6 ${SERVICE_START_PENDING} lbl_done StrCpy $0 "stop_pending" IntCmp $6 ${SERVICE_STOP_PENDING} lbl_done StrCpy $0 "running" IntCmp $6 ${SERVICE_RUNNING} lbl_done StrCpy $0 "continue_pending" IntCmp $6 ${SERVICE_CONTINUE_PENDING} lbl_done StrCpy $0 "pause_pending" IntCmp $6 ${SERVICE_PAUSE_PENDING} lbl_done StrCpy $0 "paused" IntCmp $6 ${SERVICE_PAUSED} lbl_done StrCpy $0 "unknown" lbl_good: StrCpy $0 "true" lbl_done: IntCmp $5 0 +2 System::Call 'advapi32::CloseServiceHandle(i r5) n' IntCmp $4 0 +2 System::Call 'advapi32::CloseServiceHandle(i r4) n' Pop $4 Pop $3 Pop $2 Pop $1 Exch 3 Pop $5 Pop $6 Pop $7 Exch $0 !macroend Function Service !insertmacro FUNC_SERVICE "" FunctionEnd ; Function un.Service ; !insertmacro FUNC_SERVICE "un." ; FunctionEnd Function GetParam !insertmacro FUNC_GETPARAM FunctionEnd ; Function un.GetParam ; !insertmacro FUNC_GETPARAM ; FunctionEnd !endif
wireshark/packaging/nsis/uninstall-logray.nsi
; ; uninstall-logray.nsi ; ; Create an installer that only writes an uninstaller. ; https://nsis.sourceforge.io/Signing_an_Uninstaller !include "logray-common.nsh" !include 'LogicLib.nsh' !include x64.nsh !include "StrFunc.nsh" SetCompress off OutFile "${STAGING_DIR}\uninstall_logray_installer.exe" ; InstType "un.Default (keep Personal Settings and Npcap)" InstType "un.All (remove all)" ; Uninstaller icon UninstallIcon "..\..\resources\icons\lograyinst.ico" !include "MUI.nsh" !define MUI_UNICON "..\..\resources\icons\lograyinst.ico" ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here) !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following ${PROGRAM_NAME} installation will be removed. Click 'Next' to continue." ; Uninstall stuff (this text isn't used with the MODERN_UI!) ;UninstallText "This will uninstall ${PROGRAM_NAME}.\r\nBefore starting the uninstallation, make sure ${PROGRAM_NAME} is not running.\r\nClick 'Next' to continue." !define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_FINISHPAGE_TITLE_3LINES !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH !insertmacro MUI_LANGUAGE "English" ; ============================================================================ ; Section macros ; ============================================================================ !include "Sections.nsh" ; ============================================================================ ; Uninstall page configuration ; ============================================================================ ShowUninstDetails show ; ============================================================================ ; Functions and macros ; ============================================================================ Function .onInit ; MUST be the absolute path to our staging directory. WriteUninstaller "${STAGING_DIR}\${UNINSTALLER_NAME}" SetErrorLevel 0 Quit FunctionEnd Var EXTENSION Function un.Disassociate Push $R0 !insertmacro PushFileExtensions Pop $EXTENSION ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER} ReadRegStr $R0 HKCR $EXTENSION "" StrCmp $R0 ${LOGRAY_ASSOC} un.Disassociate.doDeregister Goto un.Disassociate.end un.Disassociate.doDeregister: ; The extension is associated with Logray so, we must destroy this! DeleteRegKey HKCR $EXTENSION DetailPrint "Deregistered file type: $EXTENSION" un.Disassociate.end: Pop $EXTENSION ${Loop} Pop $R0 FunctionEnd Section "-Required" SectionEnd !define EXECUTABLE_MARKER "EXECUTABLE_MARKER" Var EXECUTABLE Section "Uninstall" un.SecUinstall ;------------------------------------------- ; ; UnInstall for every user ; SectionIn 1 2 SetShellVarContext all !insertmacro IsLograyRunning Push "${EXECUTABLE_MARKER}" Push "${PROGRAM_NAME}" Push "capinfos" Push "captype" Push "dftest" Push "dumpcap" Push "editcap" Push "mergecap" Push "reordercap" Push "text2pcap" !ifdef MMDBRESOLVE_EXE Push "mmdbresolve" !endif Pop $EXECUTABLE ${DoUntil} $EXECUTABLE == ${EXECUTABLE_MARKER} ; IsLograyRunning should make sure everything is closed down so we *shouldn't* run ; into any problems here. Delete "$INSTDIR\$EXECUTABLE.exe" IfErrors 0 deletionSuccess MessageBox MB_OK "$EXECUTABLE.exe could not be removed. Is it in use?" /SD IDOK IDOK 0 Abort "$EXECUTABLE.exe could not be removed. Aborting the uninstall process." deletionSuccess: Pop $EXECUTABLE ${Loop} DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" DeleteRegKey HKEY_LOCAL_MACHINE "Software\${PROGRAM_NAME}" DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" Call un.Disassociate DeleteRegKey HKCR ${LOGRAY_ASSOC} DeleteRegKey HKCR "${LOGRAY_ASSOC}\Shell\open\command" DeleteRegKey HKCR "${LOGRAY_ASSOC}\DefaultIcon" Delete "$INSTDIR\*.dll" Delete "$INSTDIR\*.exe" Delete "$INSTDIR\*.html" Delete "$INSTDIR\*.qm" Delete "$INSTDIR\accessible\*.*" Delete "$INSTDIR\AUTHORS-SHORT" Delete "$INSTDIR\COPYING*" Delete "$INSTDIR\audio\*.*" Delete "$INSTDIR\bearer\*.*" Delete "$INSTDIR\diameter\*.*" Delete "$INSTDIR\gpl-2.0-standalone.html" Delete "$INSTDIR\Acknowledgements.md" Delete "$INSTDIR\help\*.*" Delete "$INSTDIR\iconengines\*.*" Delete "$INSTDIR\imageformats\*.*" Delete "$INSTDIR\mediaservice\*.*" Delete "$INSTDIR\networkinformation\*.*" Delete "$INSTDIR\platforms\*.*" Delete "$INSTDIR\playlistformats\*.*" Delete "$INSTDIR\printsupport\*.*" Delete "$INSTDIR\share\glib-2.0\schemas\*.*" Delete "$INSTDIR\snmp\*.*" Delete "$INSTDIR\snmp\mibs\*.*" Delete "$INSTDIR\styles\translations\*.*" Delete "$INSTDIR\styles\*.*" Delete "$INSTDIR\protobuf\*.*" Delete "$INSTDIR\tls\*.*" Delete "$INSTDIR\tpncp\*.*" Delete "$INSTDIR\translations\*.*" Delete "$INSTDIR\ui\*.*" Delete "$INSTDIR\wimaxasncp\*.*" Delete "$INSTDIR\ws.css" Delete "$INSTDIR\README*" Delete "$INSTDIR\NEWS.txt" Delete "$INSTDIR\manuf" Delete "$INSTDIR\wka" Delete "$INSTDIR\services" Delete "$INSTDIR\pdml2html.xsl" Delete "$INSTDIR\pcrepattern.3.txt" Delete "$INSTDIR\example_snmp_users_file" Delete "$INSTDIR\ipmap.html" Delete "$INSTDIR\radius\*.*" Delete "$INSTDIR\dtds\*.*" RMDir "$INSTDIR\accessible" RMDir "$INSTDIR\audio" RMDir "$INSTDIR\bearer" RMDir "$INSTDIR\extcap" RMDir "$INSTDIR\iconengines" RMDir "$INSTDIR\imageformats" RMDir "$INSTDIR\mediaservice" RMDir "$INSTDIR\networkinformation" RMDir "$INSTDIR\platforms" RMDir "$INSTDIR\playlistformats" RMDir "$INSTDIR\printsupport" RMDir "$INSTDIR\styles\translations" RMDir "$INSTDIR\styles" RMDir "$SMPROGRAMS\${PROGRAM_NAME}" RMDir "$INSTDIR\help" ;RMDir /r "$INSTDIR\Wireshark User's Guide" RMDir "$INSTDIR\diameter" RMDir "$INSTDIR\snmp\mibs" RMDir "$INSTDIR\snmp" RMDir "$INSTDIR\radius" RMDir "$INSTDIR\dtds" RMDir "$INSTDIR\protobuf" RMDir "$INSTDIR\tpncp" RMDir "$INSTDIR\tls" RMDir "$INSTDIR\translations" RMDir "$INSTDIR\ui" RMDir "$INSTDIR\wimaxasncp" RMDir "$INSTDIR" SectionEnd ; "Uinstall" Section "Un.Plugins" un.SecPlugins ;------------------------------------------- SectionIn 1 2 ;Delete "$INSTDIR\plugins\${VERSION}\*.*" ;Delete "$INSTDIR\plugins\*.*" ;RMDir "$INSTDIR\plugins\${VERSION}" ;RMDir "$INSTDIR\plugins" RMDir /r "$INSTDIR\plugins" SectionEnd Section "Un.Global Profiles" un.SecProfiles ;------------------------------------------- SectionIn 1 2 RMDir /r "$INSTDIR\profiles" SectionEnd Section "Un.Global Settings" un.SecGlobalSettings ;------------------------------------------- SectionIn 1 2 Delete "$INSTDIR\cfilters" Delete "$INSTDIR\colorfilters" Delete "$INSTDIR\dfilters" Delete "$INSTDIR\enterprises.tsv" Delete "$INSTDIR\init.lua" Delete "$INSTDIR\console.lua" Delete "$INSTDIR\dtd_gen.lua" Delete "$INSTDIR\smi_modules" RMDir "$INSTDIR" SectionEnd Section /o "Un.Personal Settings" un.SecPersonalSettings ;------------------------------------------- SectionIn 2 SetShellVarContext current Delete "$APPDATA\${PROGRAM_NAME}\*.*" RMDir "$APPDATA\${PROGRAM_NAME}" DeleteRegKey HKCU "Software\${PROGRAM_NAME}" SectionEnd Section "-Un.Finally" ;------------------------------------------- SectionIn 1 2 !insertmacro UpdateIcons ; this test must be done after all other things uninstalled (e.g. Global Settings) IfFileExists "$INSTDIR" 0 NoFinalErrorMsg MessageBox MB_OK "Unable to remove $INSTDIR." /SD IDOK IDOK 0 ; skipped if dir doesn't exist NoFinalErrorMsg: SectionEnd !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all ${PROGRAM_NAME} components." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous ${PROGRAM_NAME} versions)." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecProfiles} "Uninstall all global configuration profiles." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters" !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE." !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
INI Configuration
wireshark/packaging/nsis/USBPcapPage.ini
[Settings] NumFields=9 [Field 1] Type=GroupBox Left=0 Right=-1 Top=0 Bottom=25 Text=Currently installed USBPcap version [Field 2] Type=Label Left=10 Right=250 Top=10 Bottom=18 Text=This text will be replaced with current USBPcap installer version [Field 3] Type=GroupBox Left=0 Right=-1 Top=30 Bottom=65 Text=Install [Field 4] Type=CheckBox Left=10 Right=250 Top=40 Bottom=48 Text=This text will be replaced, depending on current USBPcap version in wireshark.nsi State=0 [Field 5] Type=Label Left=20 Right=290 Top=50 Bottom=58 Text=This text will be replaced, depending if USBPcap is already installed [Field 6] Type=GroupBox Left=0 Right=-1 Top=70 Bottom=105 Text=Important notice [Field 7] Type=Label Left=10 Right=290 Top=80 Bottom=88 Text=In case of issue after installation, please use the system restore point created or read [Field 8] Type=Link Left=10 Right=250 Top=89 Bottom=97 Text=https://github.com/desowin/usbpcap/issues/3 State=https://github.com/desowin/usbpcap/issues/3 [Field 9] Type=Link Left=0 Right=290 Top=127 Bottom=135 Text=Learn more about USBPcap State=https://desowin.org/usbpcap/
wireshark/packaging/nsis/windeployqt-to-nsis.ps1
# windeployqt-to-nsh # # Windeployqt-to-nsh - Convert the output of windeployqt to an equivalent set of # NSIS "File" function calls. # # Copyright 2014 Gerald Combs <[email protected]> # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later #requires -version 2 <# .SYNOPSIS Creates NSIS "File" function calls required for Qt packaging. .DESCRIPTION This script creates an NSIS-compatible file based on the output of windeployqt. If Qt is present, version 5.3 or later is required. Otherwise a dummy file will be created. If building with Qt, QMake must be in your PATH. .PARAMETER Executable The path to a Qt application. It will be examined for dependent DLLs. .PARAMETER FilePath Output filename. .PARAMETER DebugConfig Assume debug binaries. .INPUTS -Executable Path to the Qt application. -FilePath Output NSIS file. .OUTPUTS List of NSIS commands required to package supporting DLLs. .EXAMPLE C:\PS> .\windeployqt-to-nsis.ps1 windeployqt.exe ..\..\staging\wireshark.exe wireshark-qt-manifest.nsh [-DebugConfig] #> Param( [Parameter(Mandatory=$true, Position=0)] [String] $Executable, [Parameter(Position=1)] [String] $FilePath = "wireshark-qt-manifest.nsh", [Parameter(Mandatory=$false)] [Switch] $DebugConfig ) try { $qtVersion = [version](qmake -query QT_VERSION) $nsisCommands = @("# Qt version " + $qtVersion ; "#") if ($qtVersion -lt "5.3") { Throw "Qt " + $qtVersion + " found. 5.3 or later is required." } $DebugOrRelease = If ($DebugConfig) {"--debug"} Else {"--release"} # windeployqt lists translation files that it don't exist (e.g. # qtbase_ar.qm), so we handle those by hand. # https://bugreports.qt.io/browse/QTBUG-65974 $wdqtList = windeployqt ` $DebugOrRelease ` --no-compiler-runtime ` --no-translations ` --list relative ` $Executable $basePath = Split-Path -Parent $Executable $currentDir = "" foreach ($entry in $wdqtList) { $dir = Split-Path -Parent $entry if ($dir -and $dir -ne $currentDir) { $nsisCommands += "SetOutPath `"`$INSTDIR\$dir`"" $currentDir = $dir } $nsisCommands += "File `"$basePath\$entry`"" } } catch { $nsisCommands = @" # Qt not configured # "@ } Set-Content $FilePath @" # # Automatically generated by $($MyInvocation.MyCommand.Name) # "@ Add-Content $FilePath $nsisCommands
Python
wireshark/packaging/nsis/windeployqt-to-nsis.py
#!/bin/env python3 # windeployqt-to-nsh # # Windeployqt-to-nsh - Convert the output of windeployqt to an equivalent set of # NSIS "File" function calls. # # Rewritten in python from windeployqt-to-nsis.ps1, that has the following copyright: # # Copyright 2014 Gerald Combs <[email protected]> # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later import sys import os import argparse import subprocess parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('--mapping') group.add_argument('--executable') parser.add_argument('--sysroot') parser.add_argument('outfile') args = parser.parse_args() if args.mapping: if not args.sysroot: sys.exit('Option --sysroot is required with option --mapping') qt_version = None with open(args.mapping, 'r', encoding='utf-8') as f: out = f.read() else: # Qt version qmake_command = [ 'qmake6.exe', '-query', 'QT_VERSION' ] qmake_out = subprocess.run(qmake_command, check=True, capture_output=True, encoding="utf-8") qt_version = qmake_out.stdout.strip() # XXX The powershell script asserts that the Qt version is greater than 5.3. We already require Qt6 to build the # installer using MSYS2 (currently not enforced). # Windeployqt output windeploy_command = [ "windeployqt6.exe", "--no-compiler-runtime", "--no-translations", "--list", "mapping", args.executable ] out = subprocess.run(windeploy_command, check=True, capture_output=True, encoding="utf-8").stdout with open(args.outfile, 'w') as f: header = """\ # # Automatically generated by {} #""".format(parser.prog) if qt_version: header += """\ # Qt version {} #""".format(qt_version) print(header, file=f) current_dir = "" for line in out.splitlines(): line = line.strip() if not line or line.startswith('#'): continue path, relative = line.split(" ") rel_path = os.path.split(relative) if len(rel_path) > 1: base_dir = rel_path[0].strip('"') if base_dir != current_dir: set_out_path = 'SetOutPath "$INSTDIR\{}"'.format(base_dir) print(set_out_path, file=f) current_dir = base_dir path = path.strip('"') if args.sysroot: path = os.path.join(args.sysroot, path) file_path = 'File "{}"'.format(path) print(file_path, file=f)
wireshark/packaging/nsis/wireshark-additional-tasks.nsddef
<?xml version="1.0" encoding="UTF-8"?> <!-- This file was created by NSISDialogDesigner 1.5.0.0 https://coolsoft.altervista.org/nsisdialogdesigner Do not edit manually! --> <Dialog Name="AdditionalTasksPage" Title="Additional Tasks" Subtitle="Create shortcuts and associate file extensions."> <CreateFunctionCustomScript>; Defined in wireshark.nsi Call InitAdditionalTasksPage</CreateFunctionCustomScript> <Label Name="ExtensionsLabel" Location="22, 151" Size="372, 52" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, rtp, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." TabIndex="0" /> <CheckBox Name="AssociateExtensionsCheckBox" Location="22, 126" Size="406, 14" Text="Associate trace file extensions with Wireshark" TabIndex="1" /> <CheckBox Name="QuickLaunchCheckBox" Location="22, 74" Size="406, 14" Text="Wireshark Quick Launch Icon" TabIndex="2" /> <CheckBox Name="DesktopIconCheckBox" Location="22, 54" Size="406, 14" Text="Wireshark Desktop Icon" TabIndex="3" /> <CheckBox Name="StartMenuCheckBox" Location="22, 34" Size="406, 14" Text="Wireshark Start Menu Item" TabIndex="4" /> <Label Name="FileExtensionsLabel" Location="12, 101" Size="426, 14" Text="Associate File Extensions" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="5" /> <Label Name="CreateShortcutsLabel" Location="12, 9" Size="426, 14" Text="Create Shortcuts" Font="Microsoft Sans Serif, 8.25pt, style=Bold" TabIndex="6" /> </Dialog>
wireshark/packaging/nsis/wireshark-additional-tasks.nsdinc
; ========================================================= ; This file was generated by NSISDialogDesigner 1.5.0.0 ; https://coolsoft.altervista.org/nsisdialogdesigner ; ; Do not edit it manually, use NSISDialogDesigner instead! ; ========================================================= ; handle variables Var hCtl_AdditionalTasksPage Var hCtl_AdditionalTasksPage_ExtensionsLabel Var hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox Var hCtl_AdditionalTasksPage_DesktopIconCheckBox Var hCtl_AdditionalTasksPage_StartMenuCheckBox Var hCtl_AdditionalTasksPage_FileExtensionsLabel Var hCtl_AdditionalTasksPage_CreateShortcutsLabel Var hCtl_AdditionalTasksPage_Font1 ; dialog create function Function fnc_AdditionalTasksPage_Create ; custom font definitions CreateFont $hCtl_AdditionalTasksPage_Font1 "Microsoft Sans Serif" "8.25" "700" ; === AdditionalTasksPage (type: Dialog) === nsDialogs::Create 1018 Pop $hCtl_AdditionalTasksPage ${If} $hCtl_AdditionalTasksPage == error Abort ${EndIf} !insertmacro MUI_HEADER_TEXT "Additional Tasks" "Create shortcuts and associate file extensions." ; === ExtensionsLabel (type: Label) === ${NSD_CreateLabel} 14u 93u 245u 32u "Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, ipfix, lcap, mplog, ntar, out, pcap, pcapng, pklg, pkt, rf5, rtp, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz." Pop $hCtl_AdditionalTasksPage_ExtensionsLabel ; === AssociateExtensionsCheckBox (type: Checkbox) === ${NSD_CreateCheckbox} 14u 78u 267u 9u "Associate trace file extensions with Wireshark" Pop $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox ; === DesktopIconCheckBox (type: Checkbox) === ${NSD_CreateCheckbox} 14u 33u 267u 9u "Wireshark Desktop Icon" Pop $hCtl_AdditionalTasksPage_DesktopIconCheckBox ; === StartMenuCheckBox (type: Checkbox) === ${NSD_CreateCheckbox} 14u 21u 267u 9u "Wireshark Start Menu Item" Pop $hCtl_AdditionalTasksPage_StartMenuCheckBox ; === FileExtensionsLabel (type: Label) === ${NSD_CreateLabel} 8u 62u 280u 9u "Associate File Extensions" Pop $hCtl_AdditionalTasksPage_FileExtensionsLabel SendMessage $hCtl_AdditionalTasksPage_FileExtensionsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0 ; === CreateShortcutsLabel (type: Label) === ${NSD_CreateLabel} 8u 6u 280u 9u "Create Shortcuts" Pop $hCtl_AdditionalTasksPage_CreateShortcutsLabel SendMessage $hCtl_AdditionalTasksPage_CreateShortcutsLabel ${WM_SETFONT} $hCtl_AdditionalTasksPage_Font1 0 ; CreateFunctionCustomScript ; Defined in wireshark.nsi Call InitAdditionalTasksPage FunctionEnd ; dialog show function Function fnc_AdditionalTasksPage_Show Call fnc_AdditionalTasksPage_Create nsDialogs::Show FunctionEnd
wireshark/packaging/nsis/wireshark-common.nsh
; ============================================================================ ; Name and version information ; ============================================================================ Unicode true ; This improves the installer's appearance considerably here on a display scaled ; to 225%, but checkboxes are comically small. We might be able to fix this ; using the SysCompImg extension: ; http://forums.winamp.com/showthread.php?t=443754 ManifestDPIAware true ; These might be correct in the future, but are currently undocumented: ; http://forums.winamp.com/showthread.php?t=452632 ; ManifestDPIAware System ; ManifestDPIAwareness "PerMonitorV2,System" !ifdef NSIS_INCLUDE_DIR !addincludedir ${NSIS_INCLUDE_DIR} !endif !include "wireshark-config.nsh" !define DISPLAY_NAME "${PROGRAM_NAME} ${VERSION} ${WIRESHARK_TARGET_PLATFORM}" Name "${DISPLAY_NAME}" !define PROGRAM_FULL_NAME "The ${PROGRAM_NAME} Network Protocol Analyzer" !define PROGRAM_NAME_PATH "${PROGRAM_NAME}.exe" !define UNINSTALLER_NAME "uninstall-wireshark.exe" VIAddVersionKey "ProductName" "${PROGRAM_NAME}" VIAddVersionKey "Comments" "It's a great product with a great story to tell. I'm pumped!" VIAddVersionKey "CompanyName" "${PROGRAM_NAME} development team" ; NSIS handles U+00a9 but not a UTF-8 encoded copyright symbol. VIAddVersionKey "LegalCopyright" "${U+00a9} Gerald Combs and many others" VIAddVersionKey "LegalTrademarks" "Wireshark and the 'fin' logo are registered trademarks of the Wireshark Foundation" VIAddVersionKey "FileDescription" "${PROGRAM_NAME} installer for Windows on ${WIRESHARK_TARGET_PLATFORM}" VIAddVersionKey "Language" "English" VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}" VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}" VIProductVersion "${PRODUCT_VERSION}" XPStyle on ; ============================================================================ ; Functions and macros ; ============================================================================ ; Used to refresh the display of file association !define SHCNE_ASSOCCHANGED 0x08000000 !define SHCNF_IDLIST 0 !macro UpdateIcons Push $R0 Push $R1 Push $R2 !define UPDATEICONS_UNIQUE ${__LINE__} IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE} UpdateIcons.ok_shell32_${UPDATEICONS_UNIQUE}: System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)' Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE} UpdateIcons.error_shell32_${UPDATEICONS_UNIQUE}: MessageBox MB_OK|MB_ICONSTOP \ "Can't find 'shell32.dll' library. Impossible to update icons" \ /SD IDOK Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE} UpdateIcons.quit_${UPDATEICONS_UNIQUE}: !undef UPDATEICONS_UNIQUE Pop $R2 Pop $R1 Pop $R0 ; Force the icon cache to refresh ; https://superuser.com/questions/499078/refresh-icon-cache-without-rebooting IfFileExists "$SYSDIR\ie4uinit.exe" 0 +2 Exec '"$SYSDIR\ie4uinit.exe" -ClearIconCache' !macroend ; ============================================================================ ; Push our known file extensions onto the stack, prepended with a marker ; Note that this is a subset of dump_open_table in wiretap/file_access.c. We ; probably don't want to grab JPEG or MP3 files. ; ============================================================================ ; Used to add associations between file extensions and Wireshark !define WIRESHARK_ASSOC "wireshark-capture-file" !define FILE_EXTENSION_MARKER "FILE_EXTENSION_MARKER" !macro PushFileExtensions Push "${FILE_EXTENSION_MARKER}" Push ".wpz" Push ".wpc" Push ".vwr" Push ".trc" Push ".trace" Push ".tr1" Push ".tpc" Push ".syc" Push ".snoop" Push ".rf5" Push ".pkt" Push ".pklg" Push ".pcapng" Push ".pcap" Push ".out" Push ".ntar" Push ".mplog" Push ".lcap" Push ".ipfix" Push ".fdc" Push ".erf" Push ".enc" Push ".cap" Push ".bfr" Push ".atc" Push ".apc" Push ".acp" Push ".5vw" Push ".rtp" !macroend !macro IsWiresharkRunning ; See if Wireshark is running ; https://nsis.sourceforge.io/Check_whether_your_application_is_running ${Do} System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global\${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0' IntCmp $R0 0 checkRunningSession System::Call 'kernel32::CloseHandle(i $R0)' Goto isRunning checkRunningSession: System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0' IntCmp $R0 0 notRunning System::Call 'kernel32::CloseHandle(i $R0)' isRunning: ; You'd better go catch it. MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking Quit notRunning: ${ExitDo} continueChecking: ${Loop} !macroend
Inno Setup Script
wireshark/packaging/nsis/wireshark-config.nsh.in
# ============================================================================ # NSIS configuration definitions. Generated from wireshark-config.nsh.in. # ============================================================================ # Do not prefix comments with ";". They will be removed by CMake. # MUST match "<Product ... Name=" in wix/Wireshark.wxs. #define PROGRAM_NAME "@PROGRAM_NAME@" #define TOP_SRC_DIR "@TOP_SRC_DIR@" #define WIRESHARK_TARGET_PLATFORM @WIRESHARK_TARGET_PLATFORM@ #define EXTRA_INSTALLER_DIR "@EXTRA_INSTALLER_DIR@" #define NPCAP_PACKAGE_VERSION @NPCAP_VERSION@ #define USBPCAP_PACKAGE_VERSION @USBPCAP_VERSION@ #define VERSION @PROJECT_VERSION@ #define MAJOR_VERSION @PROJECT_MAJOR_VERSION@ #define MINOR_VERSION @PROJECT_MINOR_VERSION@ #define PRODUCT_VERSION @PRODUCT_VERSION@ #define VCREDIST_DIR "@VCREDIST_DIR@" #define VCREDIST_EXE "@VCREDIST_EXE@" # Optional components #cmakedefine MMDBRESOLVE_EXE @MMDBRESOLVE_EXE@ #cmakedefine BUILD_etwdump #cmakedefine SPANDSP_FOUND #cmakedefine BCG729_FOUND #cmakedefine SBC_FOUND #cmakedefine ILBC_FOUND #cmakedefine OPUS_FOUND #cmakedefine LIBSSH_FOUND #cmakedefine DOCBOOK_DIR "@DOCBOOK_DIR@" #cmakedefine SMI_DIR "@SMI_DIR@" #cmakedefine QT_DIR "@QT_DIR@" #cmakedefine ENABLE_SIGNED_NSIS #cmakedefine SKIP_NSIS_QT_DLLS
wireshark/packaging/nsis/wireshark.nsi
; ; wireshark.nsi ; ; Set the compression mechanism first. ; As of NSIS 2.07, solid compression which makes installer about 1MB smaller ; is no longer the default, so use the /SOLID switch. ; This unfortunately is unknown to NSIS prior to 2.07 and creates an error. ; So if you get an error here, please update to at least NSIS 2.07! SetCompressor /SOLID lzma SetCompressorDictSize 64 ; MB !include "wireshark-common.nsh" !include 'LogicLib.nsh' !include "StrFunc.nsh" !include "WordFunc.nsh" ${StrRep} ${UnStrRep} ; See https://nsis.sourceforge.io/Check_if_a_file_exists_at_compile_time for documentation !macro !defineifexist _VAR_NAME _FILE_NAME !tempfile _TEMPFILE !ifdef NSIS_WIN32_MAKENSIS ; Windows - cmd.exe !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"' !else ; Posix - sh !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi' !endif !include '${_TEMPFILE}' !delfile '${_TEMPFILE}' !undef _TEMPFILE !macroend !define !defineifexist "!insertmacro !defineifexist" ; ============================================================================ ; Header configuration ; ============================================================================ ; The file to write OutFile "${OUTFILE_DIR}\${PROGRAM_NAME}-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.exe" ; Installer icon Icon "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico" ; Uninstaller icon UninstallIcon "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico" ; ============================================================================ ; Modern UI ; ============================================================================ ; The modern user interface will look much better than the common one. ; However, as the development of the modern UI is still going on, and the script ; syntax changes, you will need exactly that NSIS version, which this script is ; made for. This is the current (December 2003) latest version: V2.0b4 ; If you are using a different version, it's not predictable what will happen. !include "MUI2.nsh" !include "InstallOptions.nsh" ;!addplugindir ".\Plugins" !define MUI_ICON "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico" !define MUI_UNICON "${TOP_SRC_DIR}\resources\icons\wiresharkinst.ico" BrandingText "Wireshark${U+00ae} Installer" !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PROGRAM_NAME}.$\r$\n$\r$\nBefore starting the installation, make sure ${PROGRAM_NAME} is not running.$\r$\n$\r$\nClick 'Next' to continue." ;!define MUI_FINISHPAGE_LINK "Install Npcap to be able to capture packets from a network." ;!define MUI_FINISHPAGE_LINK_LOCATION "https://npcap.com/" ; NSIS shows Readme files by opening the Readme file with the default application for ; the file's extension. "README.win32" won't work in most cases, because extension "win32" ; is usually not associated with an appropriate text editor. We should use extension "txt" ; for a text file or "html" for an html README file. !define MUI_FINISHPAGE_TITLE_3LINES !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt" !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News" !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED ; NSIS runs as Administrator and will run Wireshark as Administrator ; if these are enabled. ;!define MUI_FINISHPAGE_RUN "$INSTDIR\${PROGRAM_NAME_PATH}" ;!define MUI_FINISHPAGE_RUN_NOTCHECKED !define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback ; ============================================================================ ; MUI Pages ; ============================================================================ !insertmacro MUI_PAGE_WELCOME !define MUI_LICENSEPAGE_TEXT_TOP "Wireshark is distributed under the GNU General Public License." !define MUI_LICENSEPAGE_TEXT_BOTTOM "This is not an end user license agreement (EULA). It is provided here for informational purposes only." !define MUI_LICENSEPAGE_BUTTON "Noted" !insertmacro MUI_PAGE_LICENSE "${STAGING_DIR}\COPYING.txt" Page custom DisplayDonatePage !insertmacro MUI_PAGE_COMPONENTS !ifdef QT_DIR Page custom DisplayAdditionalTasksPage LeaveAdditionalTasksPage !endif !insertmacro MUI_PAGE_DIRECTORY Page custom DisplayNpcapPage Page custom DisplayUSBPcapPage !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ; Uninstall stuff (NSIS 2.08: "\r\n" don't work here) !define MUI_UNCONFIRMPAGE_TEXT_TOP "The following ${PROGRAM_NAME} installation will be removed. Click 'Next' to continue." ; Uninstall stuff (this text isn't used with the MODERN_UI!) ;UninstallText "This will uninstall ${PROGRAM_NAME}.\r\nBefore starting the uninstallation, make sure ${PROGRAM_NAME} is not running.\r\nClick 'Next' to continue." !define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_FINISHPAGE_TITLE_3LINES !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ; ============================================================================ ; MUI Languages ; ============================================================================ !insertmacro MUI_LANGUAGE "English" ; ============================================================================ ; Reserve Files ; ============================================================================ ;Things that need to be extracted on first (keep these lines before any File command!) ;Only useful for BZIP2 compression ; Old Modern 1 UI: https://nsis.sourceforge.io/Docs/Modern%20UI/Readme.html ; To do: Upgrade to the Modern 2 UI: ;ReserveFile "AdditionalTasksPage.ini" ReserveFile "DonatePage.ini" ReserveFile "NpcapPage.ini" ReserveFile "USBPcapPage.ini" ReserveFile /plugin InstallOptions.dll ; Modern UI 2 / nsDialog pages. ; https://nsis.sourceforge.io/Docs/Modern%20UI%202/Readme.html ; https://nsis.sourceforge.io/Docs/nsDialogs/Readme.html !ifdef QT_DIR !include "wireshark-additional-tasks.nsdinc" !endif ; ============================================================================ ; Section macros ; ============================================================================ !include "Sections.nsh" ; ============================================================================ ; Command Line ; ============================================================================ !include "FileFunc.nsh" !insertmacro GetParameters !insertmacro GetOptions ; ========= Install extcap binary and help file ========= !macro InstallExtcap EXTCAP_NAME SetOutPath $INSTDIR File "${STAGING_DIR}\${EXTCAP_NAME}.html" SetOutPath $INSTDIR\extcap File "${STAGING_DIR}\extcap\${EXTCAP_NAME}.exe" !macroend ; ========= Check if silent mode install of /EXTRACOMPONENTS ========= !macro CheckExtrasFlag EXTRAS_NAME !define EXTRAS_FLAG ${__LINE__} Section IfSilent +1 skip_${EXTRAS_FLAG} push $R0 push $R1 push $R2 ${GetParameters} $R0 ${GetOptions} $R0 "/EXTRACOMPONENTS=" $R1 IfErrors popreg_${EXTRAS_FLAG} ${WordFind} $R1 "," "E+1" $R0 ; No delimiters found - check for single word match ${If} $R0 = 1 StrCmp $R1 ${EXTRAS_NAME} install_${EXTRAS_FLAG} popreg_${EXTRAS_FLAG} ${ENDIF} ; Loop through all delimited words checking for match IntOp $R2 0 + 1 ${While} $R0 != 2 StrCmp $R0 ${EXTRAS_NAME} install_${EXTRAS_FLAG} 0 IntOp $R2 $R2 + 1 ${WordFind} $R1 "," "E+$R2" $R0 ${EndWhile} Goto popreg_${EXTRAS_FLAG} install_${EXTRAS_FLAG}: !insertmacro InstallExtcap ${EXTRAS_NAME} popreg_${EXTRAS_FLAG}: pop $R2 pop $R1 pop $R0 skip_${EXTRAS_FLAG}: !undef EXTRAS_FLAG SectionEnd !macroend ; ============================================================================ ; Component page configuration ; ============================================================================ ComponentText "The following components are available for installation." ; ============================================================================ ; Directory selection page configuration ; ============================================================================ ; The text to prompt the user to enter a directory DirText "Choose a directory in which to install ${PROGRAM_NAME}." ; The default installation directory InstallDir $PROGRAMFILES64\${PROGRAM_NAME} ; See if this is an upgrade; if so, use the old InstallDir as default InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\${PROGRAM_NAME} "InstallDir" ; ============================================================================ ; Install page configuration ; ============================================================================ ShowInstDetails show ; ============================================================================ ; Functions and macros ; ============================================================================ Var EXTENSION ; https://docs.microsoft.com/en-us/windows/win32/shell/fa-file-types Function Associate Push $R0 !insertmacro PushFileExtensions Pop $EXTENSION ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER} ReadRegStr $R0 HKCR $EXTENSION "" StrCmp $R0 "" Associate.doRegister Goto Associate.end Associate.doRegister: ;The extension is not associated to any program, we can do the link WriteRegStr HKCR $EXTENSION "" ${WIRESHARK_ASSOC} DetailPrint "Registered file type: $EXTENSION" Associate.end: Pop $EXTENSION ${Loop} Pop $R0 FunctionEnd ; Control states Var START_MENU_STATE Var DESKTOP_ICON_STATE Var FILE_ASSOCIATE_STATE ; NSIS Var OLD_UNINSTALLER Var OLD_INSTDIR Var OLD_DISPLAYNAME Var TMP_UNINSTALLER ; WiX Var REGISTRY_BITS Var TMP_PRODUCT_GUID Var WIX_DISPLAYNAME Var WIX_DISPLAYVERSION Var WIX_UNINSTALLSTRING ; ============================================================================ ; 64-bit support ; ============================================================================ !include x64.nsh !include "GetWindowsVersion.nsh" !include WinMessages.nsh Function .onInit ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873 ${IfNot} ${RunningX64} MessageBox MB_OK "Wireshark only runs on 64 bit machines.$\nTry installing a 32 bit version (3.6 or earlier) instead." /SD IDOK Abort ${EndIf} !if ${WIRESHARK_TARGET_PLATFORM} == "x64" ${If} ${IsNativeARM64} MessageBox MB_OK "You're installing the x64 version of Wireshark on an Arm64 system.$\nThe native Arm64 installer might work better." /SD IDOK ${EndIf} !endif !if ${WIRESHARK_TARGET_PLATFORM} == "arm64" ${IfNot} ${IsNativeARM64} MessageBox MB_OK "You're trying to install the Arm64 version of Wireshark on an x64 system.$\nTry the native x64 installer instead." /SD IDOK Abort ${EndIf} !endif ; Get the Windows version ${GetWindowsVersion} $R0 ; This should match the following: ; - The NTDDI_VERSION and _WIN32_WINNT parts of cmakeconfig.h.in ; - The <compatibility><application> section in image\wireshark.exe.manifest.in ; - The VersionNT parts of packaging\wix\Prerequisites.wxi ; Uncomment to test. ; MessageBox MB_OK "You're running Windows $R0." ; Check if we're able to run with this version StrCmp $R0 '95' lbl_winversion_unsupported StrCmp $R0 '98' lbl_winversion_unsupported StrCmp $R0 'ME' lbl_winversion_unsupported StrCmp $R0 'NT 4.0' lbl_winversion_unsupported_nt4 StrCmp $R0 '2000' lbl_winversion_unsupported_2000 StrCmp $R0 'XP' lbl_winversion_unsupported_xp_2003 StrCmp $R0 '2003' lbl_winversion_unsupported_xp_2003 StrCmp $R0 'Vista' lbl_winversion_unsupported_vista_2008 StrCmp $R0 '2008' lbl_winversion_unsupported_vista_2008 Goto lbl_winversion_supported lbl_winversion_unsupported: MessageBox MB_OK \ "Windows $R0 is no longer supported.$\nPlease install Ethereal 0.99.0 instead." \ /SD IDOK Quit lbl_winversion_unsupported_nt4: MessageBox MB_OK \ "Windows $R0 is no longer supported.$\nPlease install Wireshark 0.99.4 instead." \ /SD IDOK Quit lbl_winversion_unsupported_2000: MessageBox MB_OK \ "Windows $R0 is no longer supported.$\nPlease install Wireshark 1.2 or 1.0 instead." \ /SD IDOK Quit lbl_winversion_unsupported_xp_2003: MessageBox MB_OK \ "Windows $R0 is no longer supported.$\nPlease install ${PROGRAM_NAME} 1.12 or 1.10 instead." \ /SD IDOK Quit lbl_winversion_unsupported_vista_2008: MessageBox MB_OK \ "Windows $R0 is no longer supported.$\nPlease install ${PROGRAM_NAME} 2.2 instead." \ /SD IDOK Quit lbl_winversion_supported: !insertmacro IsWiresharkRunning ; Default control values. StrCpy $START_MENU_STATE ${BST_CHECKED} StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED} StrCpy $FILE_ASSOCIATE_STATE ${BST_CHECKED} ; Copied from https://nsis.sourceforge.io/Auto-uninstall_old_before_installing_new ReadRegStr $OLD_UNINSTALLER HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ "UninstallString" StrCmp $OLD_UNINSTALLER "" check_wix ReadRegStr $OLD_INSTDIR HKLM \ "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" \ "Path" StrCmp $OLD_INSTDIR "" check_wix ReadRegStr $OLD_DISPLAYNAME HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ "DisplayName" StrCmp $OLD_DISPLAYNAME "" done ; We're reinstalling. Flip our control states according to what the ; user chose before. ; (we use the "all users" start menu, so select it first) SetShellVarContext all ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 1 sm $START_MENU_STATE di $DESKTOP_ICON_STATE" ${IfNot} ${FileExists} $SMPROGRAMS\${PROGRAM_NAME}.lnk StrCpy $START_MENU_STATE ${BST_UNCHECKED} ${Endif} ${If} ${FileExists} $DESKTOP\${PROGRAM_NAME}.lnk StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED} ${Endif} ; Leave FILE_ASSOCIATE_STATE checked. ; MessageBox MB_OK|MB_ICONINFORMATION "oninit 2 sm $START_MENU_STATE $SMPROGRAMS\${PROGRAM_NAME}\${PROGRAM_NAME}.lnk \ ; $\ndi $DESKTOP_ICON_STATE $DESKTOP\${PROGRAM_NAME}.lnk MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \ "$OLD_DISPLAYNAME is already installed.\ $\n$\nWould you like to uninstall it first?" \ /SD IDYES \ IDYES prep_nsis_uninstaller \ IDNO done Abort ; Copy the uninstaller to $TEMP and run it. ; The uninstaller normally does this by itself, but doesn't wait around ; for the executable to finish, which means ExecWait won't work correctly. prep_nsis_uninstaller: ClearErrors StrCpy $TMP_UNINSTALLER "$TEMP\${PROGRAM_NAME}_uninstaller.exe" ; ...because we surround UninstallString in quotes. StrCpy $0 $OLD_UNINSTALLER -1 1 StrCpy $1 "$TEMP\${PROGRAM_NAME}_uninstaller.exe" StrCpy $2 1 System::Call 'kernel32::CopyFile(t r0, t r1, b r2) 1' ExecWait "$TMP_UNINSTALLER /S _?=$OLD_INSTDIR" Delete "$TMP_UNINSTALLER" ; Look for a WiX-installed package. check_wix: StrCpy $REGISTRY_BITS 64 SetRegView 64 check_wix_restart: StrCpy $0 0 wix_reg_enum_loop: EnumRegKey $TMP_PRODUCT_GUID HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0 StrCmp $TMP_PRODUCT_GUID "" wix_enum_reg_done IntOp $0 $0 + 1 ReadRegStr $WIX_DISPLAYNAME HKLM \ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \ "DisplayName" ; MessageBox MB_OK|MB_ICONINFORMATION "Reading HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1 DisplayName = $2" ; Look for "Wireshark". StrCmp $WIX_DISPLAYNAME "${PROGRAM_NAME}" wix_found wix_reg_enum_loop wix_found: ReadRegStr $WIX_DISPLAYVERSION HKLM \ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \ "DisplayVersion" ReadRegStr $WIX_UNINSTALLSTRING HKLM \ "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TMP_PRODUCT_GUID" \ "UninstallString" StrCmp $WIX_UNINSTALLSTRING "" done MessageBox MB_YESNOCANCEL|MB_ICONQUESTION \ "$WIX_DISPLAYNAME $WIX_DISPLAYVERSION (msi) is already installed.\ $\n$\nWould you like to uninstall it first?" \ /SD IDYES \ IDYES prep_wix_uninstaller \ IDNO done Abort ; Run the WiX-provided UninstallString. prep_wix_uninstaller: ClearErrors ExecWait "$WIX_UNINSTALLSTRING" Goto done wix_enum_reg_done: ; MessageBox MB_OK|MB_ICONINFORMATION "Checked $0 $REGISTRY_BITS bit keys" IntCmp $REGISTRY_BITS 32 done StrCpy $REGISTRY_BITS 32 SetRegView 32 Goto check_wix_restart done: ; Command line parameters ${GetParameters} $R0 ${GetOptions} $R0 "/desktopicon=" $R1 ${If} $R1 == "yes" StrCpy $DESKTOP_ICON_STATE ${BST_CHECKED} ${ElseIf} $R1 == "no" StrCpy $DESKTOP_ICON_STATE ${BST_UNCHECKED} ${Endif} ;Extract InstallOptions INI files ;!insertmacro INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini" !insertmacro INSTALLOPTIONS_EXTRACT "DonatePage.ini" !insertmacro INSTALLOPTIONS_EXTRACT "NpcapPage.ini" !insertmacro INSTALLOPTIONS_EXTRACT "USBPcapPage.ini" FunctionEnd !ifdef QT_DIR Function DisplayAdditionalTasksPage Call fnc_AdditionalTasksPage_Show FunctionEnd !endif Function DisplayDonatePage !insertmacro MUI_HEADER_TEXT "Donate Today" "We could use your help." !insertmacro INSTALLOPTIONS_DISPLAY "DonatePage.ini" FunctionEnd Function DisplayNpcapPage !insertmacro MUI_HEADER_TEXT "Packet Capture" "Wireshark requires either Npcap or WinPcap to capture live network data." !insertmacro INSTALLOPTIONS_DISPLAY "NpcapPage.ini" FunctionEnd Function DisplayUSBPcapPage !insertmacro MUI_HEADER_TEXT "USB Capture" "USBPcap is required to capture USB traffic. Should USBPcap be installed (experimental)?" !insertmacro INSTALLOPTIONS_DISPLAY "USBPcapPage.ini" FunctionEnd ; ============================================================================ ; Installation execution commands ; ============================================================================ Var USBPCAP_UNINSTALL ;declare variable for holding the value of a registry key ;Var WIRESHARK_UNINSTALL ;declare variable for holding the value of a registry key Section "-Required" ;------------------------------------------- ; ; Install for every user ; SetShellVarContext all SetOutPath $INSTDIR !ifndef SKIP_UNINSTALLER WriteUninstaller "$INSTDIR\${UNINSTALLER_NAME}" !endif File "${STAGING_DIR}\libwiretap.dll" File "${STAGING_DIR}\libwireshark.dll" File "${STAGING_DIR}\libwsutil.dll" !include wireshark-manifest.nsh File "${STAGING_DIR}\COPYING.txt" File "${STAGING_DIR}\NEWS.txt" File "${STAGING_DIR}\README.txt" File "${STAGING_DIR}\README.windows.txt" File "${STAGING_DIR}\wka" File "${STAGING_DIR}\pdml2html.xsl" File "${STAGING_DIR}\ws.css" File "${STAGING_DIR}\wireshark.html" File "${STAGING_DIR}\wireshark-filter.html" File "${STAGING_DIR}\dumpcap.exe" File "${STAGING_DIR}\dumpcap.html" File "${STAGING_DIR}\extcap.html" File "${STAGING_DIR}\ipmap.html" !ifdef USE_VCREDIST ; C-runtime redistributable ; vc_redist.x64.exe or vc_redist.x86.exe - copy and execute the redistributable installer File "${VCREDIST_DIR}\${VCREDIST_EXE}" ; If the user already has the redistributable installed they will see a ; Big Ugly Dialog by default, asking if they want to uninstall or repair. ; Ideally we should add a checkbox for this somewhere. In the meantime, ; just do a "quiet" install. ; http://asawicki.info/news_1597_installing_visual_c_redistributable_package_from_command_line.html ExecWait '"$INSTDIR\${VCREDIST_EXE}" /install /quiet /norestart' $0 DetailPrint "${VCREDIST_EXE} returned $0" ; https://docs.microsoft.com/en-us/windows/desktop/Msi/error-codes !define ERROR_SUCCESS 0 !define ERROR_SUCCESS_REBOOT_INITIATED 1641 !define ERROR_PRODUCT_VERSION 1638 !define ERROR_SUCCESS_REBOOT_REQUIRED 3010 ${Switch} $0 ${Case} ${ERROR_SUCCESS} ${Case} ${ERROR_PRODUCT_VERSION} ${Break} ${Case} ${ERROR_SUCCESS_REBOOT_INITIATED} ; Shouldn't happen. ${Case} ${ERROR_SUCCESS_REBOOT_REQUIRED} SetRebootFlag true ${Break} ${Default} MessageBox MB_OK "The Visual C++ Redistributable installer failed with error $0.$\nUnable to continue installation." /SD IDOK Abort ${Break} ${EndSwitch} Delete "$INSTDIR\${VCREDIST_EXE}" !endif ; global config files - don't overwrite if already existing ;IfFileExists cfilters dont_overwrite_cfilters File "${STAGING_DIR}\cfilters" ;dont_overwrite_cfilters: ;IfFileExists colorfilters dont_overwrite_colorfilters File "${STAGING_DIR}\colorfilters" ;dont_overwrite_colorfilters: ;IfFileExists dfilters dont_overwrite_dfilters File "${STAGING_DIR}\dfilters" ;dont_overwrite_dfilters: ;IfFileExists smi_modules dont_overwrite_smi_modules File "${STAGING_DIR}\smi_modules" ;dont_overwrite_smi_modules: ; ; Install the Diameter DTD and XML files in the "diameter" subdirectory ; of the installation directory. ; SetOutPath $INSTDIR\diameter File "${STAGING_DIR}\diameter\AlcatelLucent.xml" File "${STAGING_DIR}\diameter\chargecontrol.xml" File "${STAGING_DIR}\diameter\Cisco.xml" File "${STAGING_DIR}\diameter\CiscoSystems.xml" File "${STAGING_DIR}\diameter\Custom.xml" File "${STAGING_DIR}\diameter\dictionary.dtd" File "${STAGING_DIR}\diameter\dictionary.xml" File "${STAGING_DIR}\diameter\eap.xml" File "${STAGING_DIR}\diameter\Ericsson.xml" File "${STAGING_DIR}\diameter\etsie2e4.xml" File "${STAGING_DIR}\diameter\HP.xml" File "${STAGING_DIR}\diameter\Huawei.xml" File "${STAGING_DIR}\diameter\Inovar.xml" File "${STAGING_DIR}\diameter\Juniper.xml" File "${STAGING_DIR}\diameter\Metaswitch.xml" File "${STAGING_DIR}\diameter\Microsoft.xml" File "${STAGING_DIR}\diameter\mobileipv4.xml" File "${STAGING_DIR}\diameter\mobileipv6.xml" File "${STAGING_DIR}\diameter\nasreq.xml" File "${STAGING_DIR}\diameter\Nokia.xml" File "${STAGING_DIR}\diameter\NokiaSolutionsAndNetworks.xml" File "${STAGING_DIR}\diameter\Oracle.xml" File "${STAGING_DIR}\diameter\Siemens.xml" File "${STAGING_DIR}\diameter\sip.xml" File "${STAGING_DIR}\diameter\Starent.xml" File "${STAGING_DIR}\diameter\sunping.xml" File "${STAGING_DIR}\diameter\Telefonica.xml" File "${STAGING_DIR}\diameter\TGPP.xml" File "${STAGING_DIR}\diameter\TGPP2.xml" File "${STAGING_DIR}\diameter\Vodafone.xml" File "${STAGING_DIR}\diameter\VerizonWireless.xml" !include "custom_diameter_xmls.txt" SetOutPath $INSTDIR ; ; Install the RADIUS directory files in the "radius" subdirectory ; of the installation directory. ; SetOutPath $INSTDIR\radius File "${STAGING_DIR}\radius\README.radius_dictionary" File "${STAGING_DIR}\radius\custom.includes" File "${STAGING_DIR}\radius\dictionary" File "${STAGING_DIR}\radius\dictionary.3com" File "${STAGING_DIR}\radius\dictionary.3gpp" File "${STAGING_DIR}\radius\dictionary.3gpp2" File "${STAGING_DIR}\radius\dictionary.5x9" File "${STAGING_DIR}\radius\dictionary.acc" File "${STAGING_DIR}\radius\dictionary.acme" File "${STAGING_DIR}\radius\dictionary.actelis" File "${STAGING_DIR}\radius\dictionary.aerohive" File "${STAGING_DIR}\radius\dictionary.airespace" File "${STAGING_DIR}\radius\dictionary.alcatel" File "${STAGING_DIR}\radius\dictionary.alcatel-lucent.aaa" File "${STAGING_DIR}\radius\dictionary.alcatel.esam" File "${STAGING_DIR}\radius\dictionary.alcatel.sr" File "${STAGING_DIR}\radius\dictionary.alteon" File "${STAGING_DIR}\radius\dictionary.altiga" File "${STAGING_DIR}\radius\dictionary.alvarion" File "${STAGING_DIR}\radius\dictionary.alvarion.wimax.v2_2" File "${STAGING_DIR}\radius\dictionary.apc" File "${STAGING_DIR}\radius\dictionary.aptilo" File "${STAGING_DIR}\radius\dictionary.aptis" File "${STAGING_DIR}\radius\dictionary.arbor" File "${STAGING_DIR}\radius\dictionary.aruba" File "${STAGING_DIR}\radius\dictionary.ascend" File "${STAGING_DIR}\radius\dictionary.asn" File "${STAGING_DIR}\radius\dictionary.audiocodes" File "${STAGING_DIR}\radius\dictionary.avaya" File "${STAGING_DIR}\radius\dictionary.azaire" File "${STAGING_DIR}\radius\dictionary.bay" File "${STAGING_DIR}\radius\dictionary.bintec" File "${STAGING_DIR}\radius\dictionary.bluecoat" File "${STAGING_DIR}\radius\dictionary.bristol" File "${STAGING_DIR}\radius\dictionary.broadsoft" File "${STAGING_DIR}\radius\dictionary.brocade" File "${STAGING_DIR}\radius\dictionary.bskyb" File "${STAGING_DIR}\radius\dictionary.bt" File "${STAGING_DIR}\radius\dictionary.cablelabs" File "${STAGING_DIR}\radius\dictionary.cabletron" File "${STAGING_DIR}\radius\dictionary.camiant" File "${STAGING_DIR}\radius\dictionary.chillispot" File "${STAGING_DIR}\radius\dictionary.cisco" File "${STAGING_DIR}\radius\dictionary.cisco.asa" File "${STAGING_DIR}\radius\dictionary.cisco.bbsm" File "${STAGING_DIR}\radius\dictionary.cisco.vpn3000" File "${STAGING_DIR}\radius\dictionary.cisco.vpn5000" File "${STAGING_DIR}\radius\dictionary.citrix" File "${STAGING_DIR}\radius\dictionary.clavister" File "${STAGING_DIR}\radius\dictionary.cnergee" File "${STAGING_DIR}\radius\dictionary.colubris" File "${STAGING_DIR}\radius\dictionary.columbia_university" File "${STAGING_DIR}\radius\dictionary.compat" File "${STAGING_DIR}\radius\dictionary.compatible" File "${STAGING_DIR}\radius\dictionary.cosine" File "${STAGING_DIR}\radius\dictionary.dante" File "${STAGING_DIR}\radius\dictionary.dellemc" File "${STAGING_DIR}\radius\dictionary.dhcp" File "${STAGING_DIR}\radius\dictionary.digium" File "${STAGING_DIR}\radius\dictionary.dlink" File "${STAGING_DIR}\radius\dictionary.dragonwave" File "${STAGING_DIR}\radius\dictionary.efficientip" File "${STAGING_DIR}\radius\dictionary.eltex" File "${STAGING_DIR}\radius\dictionary.enterasys" File "${STAGING_DIR}\radius\dictionary.epygi" File "${STAGING_DIR}\radius\dictionary.equallogic" File "${STAGING_DIR}\radius\dictionary.ericsson" File "${STAGING_DIR}\radius\dictionary.ericsson.ab" File "${STAGING_DIR}\radius\dictionary.ericsson.packet.core.networks" File "${STAGING_DIR}\radius\dictionary.extreme" File "${STAGING_DIR}\radius\dictionary.f5" File "${STAGING_DIR}\radius\dictionary.fdxtended" File "${STAGING_DIR}\radius\dictionary.fortinet" File "${STAGING_DIR}\radius\dictionary.foundry" File "${STAGING_DIR}\radius\dictionary.freedhcp" File "${STAGING_DIR}\radius\dictionary.freeradius" File "${STAGING_DIR}\radius\dictionary.freeradius.internal" File "${STAGING_DIR}\radius\dictionary.freeswitch" File "${STAGING_DIR}\radius\dictionary.gandalf" File "${STAGING_DIR}\radius\dictionary.garderos" File "${STAGING_DIR}\radius\dictionary.gemtek" File "${STAGING_DIR}\radius\dictionary.h3c" File "${STAGING_DIR}\radius\dictionary.hp" File "${STAGING_DIR}\radius\dictionary.huawei" File "${STAGING_DIR}\radius\dictionary.iana" File "${STAGING_DIR}\radius\dictionary.identity_engines" File "${STAGING_DIR}\radius\dictionary.iea" File "${STAGING_DIR}\radius\dictionary.infoblox" File "${STAGING_DIR}\radius\dictionary.infonet" File "${STAGING_DIR}\radius\dictionary.ipunplugged" File "${STAGING_DIR}\radius\dictionary.issanni" File "${STAGING_DIR}\radius\dictionary.itk" File "${STAGING_DIR}\radius\dictionary.jradius" File "${STAGING_DIR}\radius\dictionary.juniper" File "${STAGING_DIR}\radius\dictionary.karlnet" File "${STAGING_DIR}\radius\dictionary.kineto" File "${STAGING_DIR}\radius\dictionary.lancom" File "${STAGING_DIR}\radius\dictionary.livingston" File "${STAGING_DIR}\radius\dictionary.localweb" File "${STAGING_DIR}\radius\dictionary.lucent" File "${STAGING_DIR}\radius\dictionary.manzara" File "${STAGING_DIR}\radius\dictionary.meinberg" File "${STAGING_DIR}\radius\dictionary.meraki" File "${STAGING_DIR}\radius\dictionary.merit" File "${STAGING_DIR}\radius\dictionary.meru" File "${STAGING_DIR}\radius\dictionary.microsemi" File "${STAGING_DIR}\radius\dictionary.microsoft" File "${STAGING_DIR}\radius\dictionary.mikrotik" File "${STAGING_DIR}\radius\dictionary.motorola" File "${STAGING_DIR}\radius\dictionary.motorola.wimax" File "${STAGING_DIR}\radius\dictionary.navini" File "${STAGING_DIR}\radius\dictionary.netscreen" File "${STAGING_DIR}\radius\dictionary.networkphysics" File "${STAGING_DIR}\radius\dictionary.nexans" File "${STAGING_DIR}\radius\dictionary.nokia" File "${STAGING_DIR}\radius\dictionary.nokia.conflict" File "${STAGING_DIR}\radius\dictionary.nomadix" File "${STAGING_DIR}\radius\dictionary.nortel" File "${STAGING_DIR}\radius\dictionary.ntua" File "${STAGING_DIR}\radius\dictionary.openser" File "${STAGING_DIR}\radius\dictionary.packeteer" File "${STAGING_DIR}\radius\dictionary.paloalto" File "${STAGING_DIR}\radius\dictionary.patton" File "${STAGING_DIR}\radius\dictionary.perle" File "${STAGING_DIR}\radius\dictionary.propel" File "${STAGING_DIR}\radius\dictionary.prosoft" File "${STAGING_DIR}\radius\dictionary.proxim" File "${STAGING_DIR}\radius\dictionary.purewave" File "${STAGING_DIR}\radius\dictionary.quiconnect" File "${STAGING_DIR}\radius\dictionary.quintum" File "${STAGING_DIR}\radius\dictionary.redcreek" File "${STAGING_DIR}\radius\dictionary.rfc2865" File "${STAGING_DIR}\radius\dictionary.rfc2866" File "${STAGING_DIR}\radius\dictionary.rfc2867" File "${STAGING_DIR}\radius\dictionary.rfc2868" File "${STAGING_DIR}\radius\dictionary.rfc2869" File "${STAGING_DIR}\radius\dictionary.rfc3162" File "${STAGING_DIR}\radius\dictionary.rfc3576" File "${STAGING_DIR}\radius\dictionary.rfc3580" File "${STAGING_DIR}\radius\dictionary.rfc4072" File "${STAGING_DIR}\radius\dictionary.rfc4372" File "${STAGING_DIR}\radius\dictionary.rfc4603" File "${STAGING_DIR}\radius\dictionary.rfc4675" File "${STAGING_DIR}\radius\dictionary.rfc4679" File "${STAGING_DIR}\radius\dictionary.rfc4818" File "${STAGING_DIR}\radius\dictionary.rfc4849" File "${STAGING_DIR}\radius\dictionary.rfc5090" File "${STAGING_DIR}\radius\dictionary.rfc5176" File "${STAGING_DIR}\radius\dictionary.rfc5447" File "${STAGING_DIR}\radius\dictionary.rfc5580" File "${STAGING_DIR}\radius\dictionary.rfc5607" File "${STAGING_DIR}\radius\dictionary.rfc5904" File "${STAGING_DIR}\radius\dictionary.rfc6519" File "${STAGING_DIR}\radius\dictionary.rfc6572" File "${STAGING_DIR}\radius\dictionary.rfc6677" File "${STAGING_DIR}\radius\dictionary.rfc6911" File "${STAGING_DIR}\radius\dictionary.rfc6929" File "${STAGING_DIR}\radius\dictionary.rfc6930" File "${STAGING_DIR}\radius\dictionary.rfc7055" File "${STAGING_DIR}\radius\dictionary.rfc7155" File "${STAGING_DIR}\radius\dictionary.rfc7268" File "${STAGING_DIR}\radius\dictionary.rfc7499" File "${STAGING_DIR}\radius\dictionary.rfc7930" File "${STAGING_DIR}\radius\dictionary.riverbed" File "${STAGING_DIR}\radius\dictionary.riverstone" File "${STAGING_DIR}\radius\dictionary.roaringpenguin" File "${STAGING_DIR}\radius\dictionary.ruckus" File "${STAGING_DIR}\radius\dictionary.ruggedcom" File "${STAGING_DIR}\radius\dictionary.sangoma" File "${STAGING_DIR}\radius\dictionary.sg" File "${STAGING_DIR}\radius\dictionary.shasta" File "${STAGING_DIR}\radius\dictionary.shiva" File "${STAGING_DIR}\radius\dictionary.siemens" File "${STAGING_DIR}\radius\dictionary.slipstream" File "${STAGING_DIR}\radius\dictionary.sofaware" File "${STAGING_DIR}\radius\dictionary.sonicwall" File "${STAGING_DIR}\radius\dictionary.springtide" File "${STAGING_DIR}\radius\dictionary.starent" File "${STAGING_DIR}\radius\dictionary.starent.vsa1" File "${STAGING_DIR}\radius\dictionary.surfnet" File "${STAGING_DIR}\radius\dictionary.symbol" File "${STAGING_DIR}\radius\dictionary.t_systems_nova" File "${STAGING_DIR}\radius\dictionary.telebit" File "${STAGING_DIR}\radius\dictionary.telkom" File "${STAGING_DIR}\radius\dictionary.terena" File "${STAGING_DIR}\radius\dictionary.trapeze" File "${STAGING_DIR}\radius\dictionary.travelping" File "${STAGING_DIR}\radius\dictionary.tropos" File "${STAGING_DIR}\radius\dictionary.ukerna" File "${STAGING_DIR}\radius\dictionary.unisphere" File "${STAGING_DIR}\radius\dictionary.unix" File "${STAGING_DIR}\radius\dictionary.usr" File "${STAGING_DIR}\radius\dictionary.utstarcom" File "${STAGING_DIR}\radius\dictionary.valemount" File "${STAGING_DIR}\radius\dictionary.versanet" File "${STAGING_DIR}\radius\dictionary.verizon" File "${STAGING_DIR}\radius\dictionary.vqp" File "${STAGING_DIR}\radius\dictionary.walabi" File "${STAGING_DIR}\radius\dictionary.waverider" File "${STAGING_DIR}\radius\dictionary.wichorus" File "${STAGING_DIR}\radius\dictionary.wimax" File "${STAGING_DIR}\radius\dictionary.wimax.alvarion" File "${STAGING_DIR}\radius\dictionary.wimax.wichorus" File "${STAGING_DIR}\radius\dictionary.wispr" File "${STAGING_DIR}\radius\dictionary.xedia" File "${STAGING_DIR}\radius\dictionary.xylan" File "${STAGING_DIR}\radius\dictionary.yubico" File "${STAGING_DIR}\radius\dictionary.zeus" File "${STAGING_DIR}\radius\dictionary.zte" File "${STAGING_DIR}\radius\dictionary.zyxel" !include "custom_radius_dict.txt" SetOutPath $INSTDIR ; ; install the dtds in the dtds subdirectory ; SetOutPath $INSTDIR\dtds File "${STAGING_DIR}\dtds\dc.dtd" File "${STAGING_DIR}\dtds\itunes.dtd" File "${STAGING_DIR}\dtds\mscml.dtd" File "${STAGING_DIR}\dtds\pocsettings.dtd" File "${STAGING_DIR}\dtds\presence.dtd" File "${STAGING_DIR}\dtds\reginfo.dtd" File "${STAGING_DIR}\dtds\rlmi.dtd" File "${STAGING_DIR}\dtds\rss.dtd" File "${STAGING_DIR}\dtds\smil.dtd" File "${STAGING_DIR}\dtds\xcap-caps.dtd" File "${STAGING_DIR}\dtds\xcap-error.dtd" File "${STAGING_DIR}\dtds\watcherinfo.dtd" SetOutPath $INSTDIR ; Create the extcap directory CreateDirectory $INSTDIR\extcap ; ; install the protobuf .proto definitions in the protobuf subdirectory ; SetOutPath $INSTDIR\protobuf File "${STAGING_DIR}\protobuf\*.proto" ; Install the TPNCP DAT file in the "tpncp" subdirectory ; of the installation directory. SetOutPath $INSTDIR\tpncp File "${STAGING_DIR}\tpncp\tpncp.dat" ; ; install the wimaxasncp TLV definitions in the wimaxasncp subdirectory ; SetOutPath $INSTDIR\wimaxasncp File "${STAGING_DIR}\wimaxasncp\dictionary.xml" File "${STAGING_DIR}\wimaxasncp\dictionary.dtd" SetOutPath $INSTDIR ; Write the uninstall keys for Windows ; https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs ; https://docs.microsoft.com/en-us/previous-versions/ms954376(v=msdn.10) ; https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key !define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Comments" "${DISPLAY_NAME}" !ifdef QT_DIR WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${PROGRAM_NAME_PATH},0" !endif WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayName" "${DISPLAY_NAME}" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "HelpLink" "https://ask.wireshark.org/" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "InstallLocation" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "Publisher" "The Wireshark developer community, https://www.wireshark.org" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLInfoAbout" "https://www.wireshark.org" WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "URLUpdateInfo" "https://www.wireshark.org/download.html" WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoModify" 1 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "NoRepair" 1 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMajor" ${MAJOR_VERSION} WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "VersionMinor" ${MINOR_VERSION} WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}"' WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\${UNINSTALLER_NAME}" /S' ; To quote https://web.archive.org/web/20150911221413/http://download.microsoft.com/download/0/4/6/046bbd36-0812-4c22-a870-41911c6487a6/WindowsUserExperience.pdf: ; "Do not include Readme, Help, or Uninstall entries on the Programs menu." Delete "$SMPROGRAMS\${PROGRAM_NAME}\Wireshark Web Site.lnk" ; Create file extensions if the Associated Tasks page check box ; is checked. ${If} $FILE_ASSOCIATE_STATE == ${BST_CHECKED} WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file" WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\${PROGRAM_NAME_PATH}" "%1"' WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\${PROGRAM_NAME_PATH}",1' ; We refresh the icon cache down in -Finally. Call Associate ; If you add something here be sure to sync it with the uninstall section and the ; AdditionalTasks page ${Endif} ; if running as a silent installer, don't try to install npcap IfSilent SecRequired_skip_Npcap ; Install Npcap (depending on npcap page setting) ReadINIStr $0 "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" StrCmp $0 "0" SecRequired_skip_Npcap SetOutPath $INSTDIR File "${EXTRA_INSTALLER_DIR}\npcap-${NPCAP_PACKAGE_VERSION}.exe" ExecWait '"$INSTDIR\npcap-${NPCAP_PACKAGE_VERSION}.exe" /winpcap_mode=no /loopback_support=no' $0 DetailPrint "Npcap installer returned $0" SecRequired_skip_Npcap: ; If running as a silent installer, don't try to install USBPcap IfSilent SecRequired_skip_USBPcap ReadINIStr $0 "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State" StrCmp $0 "0" SecRequired_skip_USBPcap SetOutPath $INSTDIR File "${EXTRA_INSTALLER_DIR}\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe" ExecWait '"$INSTDIR\USBPcapSetup-${USBPCAP_PACKAGE_VERSION}.exe"' $0 DetailPrint "USBPcap installer returned $0" ${If} $0 == "0" ${If} ${RunningX64} ${DisableX64FSRedirection} SetRegView 64 ${EndIf} ReadRegStr $USBPCAP_UNINSTALL HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString" ${If} ${RunningX64} ${EnableX64FSRedirection} SetRegView 32 ${EndIf} ${StrRep} $0 '$USBPCAP_UNINSTALL' 'Uninstall.exe' 'USBPcapCMD.exe' ${StrRep} $1 '$0' '"' '' CopyFiles /SILENT $1 $INSTDIR\extcap SetRebootFlag true ${EndIf} SecRequired_skip_USBPcap: ; If no user profile exists for Wireshark but for Ethereal, copy it over SetShellVarContext current IfFileExists $APPDATA\Wireshark profile_done IfFileExists $APPDATA\Ethereal 0 profile_done ;MessageBox MB_YESNO "This seems to be the first time you use Wireshark. Copy over the personal settings from Ethereal?" /SD IDYES IDNO profile_done CreateDirectory $APPDATA\Wireshark CopyFiles $APPDATA\Ethereal\*.* $APPDATA\Wireshark profile_done: SetShellVarContext all SectionEnd ; "Required" !ifdef QT_DIR Section "${PROGRAM_NAME}" SecWiresharkQt ;------------------------------------------- ; by default, Wireshark.exe is installed SetOutPath $INSTDIR File "${QT_DIR}\${PROGRAM_NAME_PATH}" ; Write an entry for ShellExecute WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "" '$INSTDIR\${PROGRAM_NAME_PATH}' WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME_PATH}" "Path" '$INSTDIR' !ifndef SKIP_NSIS_QT_DLLS !include wireshark-qt-manifest.nsh !endif ${!defineifexist} TRANSLATIONS_FOLDER "${QT_DIR}\translations" SetOutPath $INSTDIR !ifdef TRANSLATIONS_FOLDER ; Starting from Qt 5.5, *.qm files are put in a translations subfolder File /r "${QT_DIR}\translations" !else File "${QT_DIR}\*.qm" !endif ; Is the Start Menu check box checked? ${If} $START_MENU_STATE == ${BST_CHECKED} CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}" ${Endif} ${If} $DESKTOP_ICON_STATE == ${BST_CHECKED} CreateShortCut "$DESKTOP\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME_PATH}" "" "$INSTDIR\${PROGRAM_NAME_PATH}" 0 "" "" "${PROGRAM_FULL_NAME}" ${Endif} SectionEnd ; "SecWiresharkQt" !endif Section "TShark" SecTShark ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\tshark.exe" File "${STAGING_DIR}\tshark.html" SectionEnd SectionGroup "Plugins & Extensions" SecPluginsGroup Section "Codec Plugins" SecCodec ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g711.dll" !ifdef SPANDSP_FOUND File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g722.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g726.dll" !endif !ifdef BCG729_FOUND File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\g729.dll" !endif File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\l16mono.dll" !ifdef SBC_FOUND File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\sbc.dll" !endif !ifdef ILBC_FOUND File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\ilbc.dll" !endif !ifdef OPUS_FOUND File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\codecs\opus_dec.dll" !endif SectionEnd Section "Configuration Profiles" SecProfiles ;------------------------------------------- ; This should be a function or macro SetOutPath '$INSTDIR\profiles\Bluetooth' File "${STAGING_DIR}\profiles\Bluetooth\colorfilters" File "${STAGING_DIR}\profiles\Bluetooth\preferences" SetOutPath '$INSTDIR\profiles\Classic' File "${STAGING_DIR}\profiles\Classic\colorfilters" SetOutPath '$INSTDIR\profiles\No Reassembly' File "${STAGING_DIR}\profiles\No Reassembly\preferences" SectionEnd Section "Dissector Plugins" SecPlugins ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan' 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" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\opcua.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\profinet.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\unistim.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimax.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimaxasncp.dll" File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\wimaxmacphy.dll" !include "custom_plugins.txt" SectionEnd Section "File Type Plugins - capture file support" SecWiretap ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\wiretap' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\wiretap\usbdump.dll" SectionEnd Section "Mate - Meta Analysis and Tracing Engine" SecMate ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\mate.dll" SectionEnd !ifdef SMI_DIR Section "SNMP MIBs" SecMIBs ;------------------------------------------- SetOutPath '$INSTDIR\snmp\mibs' File "${SMI_DIR}\share\mibs\iana\*" File "${SMI_DIR}\share\mibs\ietf\*" File "${SMI_DIR}\share\mibs\irtf\*" File "${SMI_DIR}\share\mibs\tubs\*" File "${SMI_DIR}\share\pibs\*" File "${SMI_DIR}\share\yang\*.yang" !include "custom_mibs.txt" SectionEnd !endif Section "TRANSUM - performance analysis" SecTransum ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\transum.dll" SectionEnd Section "Tree Statistics Plugin" SecStatsTree ;------------------------------------------- SetOutPath '$INSTDIR\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan' File "${STAGING_DIR}\plugins\${MAJOR_VERSION}.${MINOR_VERSION}\epan\stats_tree.dll" SectionEnd SectionGroupEnd ; "Plugins / Extensions" SectionGroup "Tools" SecToolsGroup Section "Capinfos" SecCapinfos ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\capinfos.exe" File "${STAGING_DIR}\capinfos.html" SectionEnd Section "Captype" SecCaptype ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\captype.exe" File "${STAGING_DIR}\captype.html" SectionEnd Section "Editcap" SecEditcap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\editcap.exe" File "${STAGING_DIR}\editcap.html" SectionEnd Section "Mergecap" SecMergecap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\mergecap.exe" File "${STAGING_DIR}\mergecap.html" SectionEnd !ifdef MMDBRESOLVE_EXE Section "MMDBResolve" SecMMDBResolve ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\mmdbresolve.html" SetOutPath $INSTDIR File "${STAGING_DIR}\mmdbresolve.exe" SectionEnd !endif Section /o "Randpkt" SecRandpkt ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\randpkt.exe" File "${STAGING_DIR}\randpkt.html" SectionEnd Section "Rawshark" SecRawshark ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\rawshark.exe" File "${STAGING_DIR}\rawshark.html" SectionEnd Section "Reordercap" SecReordercap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\reordercap.exe" File "${STAGING_DIR}\reordercap.html" SectionEnd Section "Text2Pcap" SecText2Pcap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\text2pcap.exe" File "${STAGING_DIR}\text2pcap.html" SectionEnd SectionGroupEnd ; "Tools" SectionGroup "External Capture (extcap)" SecExtcapGroup Section /o "Androiddump" SecAndroiddump ;------------------------------------------- !insertmacro InstallExtcap "androiddump" SectionEnd !insertmacro CheckExtrasFlag "androiddump" !ifdef BUILD_etwdump Section "Etwdump" SecEtwdump ;------------------------------------------- !insertmacro InstallExtcap "Etwdump" SectionEnd !insertmacro CheckExtrasFlag "Etwdump" !endif Section /o "Randpktdump" SecRandpktdump ;------------------------------------------- !insertmacro InstallExtcap "randpktdump" SectionEnd !insertmacro CheckExtrasFlag "randpktdump" !ifdef LIBSSH_FOUND Section /o "Sshdump, Ciscodump, and Wifidump" SecSshdump ;------------------------------------------- !insertmacro InstallExtcap "sshdump" !insertmacro InstallExtcap "ciscodump" !insertmacro InstallExtcap "wifidump" SectionEnd !insertmacro CheckExtrasFlag "sshdump" !insertmacro CheckExtrasFlag "ciscodump" !insertmacro CheckExtrasFlag "wifidump" !endif Section /o "UDPdump" SecUDPdump ;------------------------------------------- !insertmacro InstallExtcap "udpdump" SectionEnd !insertmacro CheckExtrasFlag "udpdump" SectionGroupEnd ; "External Capture (extcap)" Section "-Clear Partial Selected" !insertmacro ClearSectionFlag ${SecExtcapGroup} ${SF_PSELECTED} SectionEnd !ifdef DOCBOOK_DIR Section "Documentation" SecDocumentation ;------------------------------------------- SetOutPath "$INSTDIR\Wireshark User's Guide" File /r "${DOCBOOK_DIR}\wsug_html_chunked\*.*" SetOutPath $INSTDIR File "${DOCBOOK_DIR}\faq.html" SectionEnd !endif Section "-Finally" !insertmacro UpdateIcons ; Compute and write the installation directory size ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 IntFmt $0 "0x%08X" $0 WriteRegDWORD HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}" "EstimatedSize" "$0" SectionEnd ; ============================================================================ ; Section macros ; ============================================================================ !include "Sections.nsh" ; ============================================================================ ; Uninstall page configuration ; ============================================================================ ShowUninstDetails show ; ============================================================================ ; Functions and macros ; ============================================================================ Function un.Disassociate Push $R0 !insertmacro PushFileExtensions Pop $EXTENSION ${DoUntil} $EXTENSION == ${FILE_EXTENSION_MARKER} ReadRegStr $R0 HKCR $EXTENSION "" StrCmp $R0 ${WIRESHARK_ASSOC} un.Disassociate.doDeregister Goto un.Disassociate.end un.Disassociate.doDeregister: ; The extension is associated with Wireshark so, we must destroy this! DeleteRegKey HKCR $EXTENSION DetailPrint "Deregistered file type: $EXTENSION" un.Disassociate.end: Pop $EXTENSION ${Loop} Pop $R0 FunctionEnd Section "-Required" SectionEnd !define EXECUTABLE_MARKER "EXECUTABLE_MARKER" Var EXECUTABLE Section /o "Un.USBPcap" un.SecUSBPcap ;------------------------------------------- SectionIn 2 ${If} ${RunningX64} ${DisableX64FSRedirection} SetRegView 64 ${EndIf} ReadRegStr $1 HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "UninstallString" ${If} ${RunningX64} ${EnableX64FSRedirection} SetRegView 32 ${EndIf} ${If} $1 != "" ${UnStrRep} $2 '$1' '\Uninstall.exe' '' ${UnStrRep} $3 '$2' '"' '' ExecWait '$1 _?=$3' $0 DetailPrint "USBPcap uninstaller returned $0" ${If} $0 == "0" Delete "$3\Uninstall.exe" Delete "$INSTDIR\extcap\USBPcapCMD.exe" ${EndIf} ${EndIf} ClearErrors SectionEnd Section "Uninstall" un.SecUinstall ;------------------------------------------- ; ; UnInstall for every user ; SectionIn 1 2 SetShellVarContext all !insertmacro IsWiresharkRunning Push "${EXECUTABLE_MARKER}" Push "${PROGRAM_NAME}" Push "capinfos" Push "captype" Push "dftest" Push "dumpcap" Push "editcap" Push "mergecap" Push "randpkt" Push "rawshark" Push "reordercap" Push "text2pcap" Push "tshark" !ifdef MMDBRESOLVE_EXE Push "mmdbresolve" !endif Pop $EXECUTABLE ${DoUntil} $EXECUTABLE == ${EXECUTABLE_MARKER} ; IsWiresharkRunning should make sure everything is closed down so we *shouldn't* run ; into any problems here. Delete "$INSTDIR\$EXECUTABLE.exe" IfErrors 0 deletionSuccess MessageBox MB_OK "$EXECUTABLE.exe could not be removed. Is it in use?" /SD IDOK IDOK 0 Abort "$EXECUTABLE.exe could not be removed. Aborting the uninstall process." deletionSuccess: Pop $EXECUTABLE ${Loop} DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" DeleteRegKey HKEY_LOCAL_MACHINE "Software\${PROGRAM_NAME}" DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\${PROGRAM_NAME}.exe" Call un.Disassociate DeleteRegKey HKCR ${WIRESHARK_ASSOC} DeleteRegKey HKCR "${WIRESHARK_ASSOC}\Shell\open\command" DeleteRegKey HKCR "${WIRESHARK_ASSOC}\DefaultIcon" Delete "$INSTDIR\*.dll" Delete "$INSTDIR\*.exe" Delete "$INSTDIR\*.html" Delete "$INSTDIR\*.qm" Delete "$INSTDIR\accessible\*.*" Delete "$INSTDIR\AUTHORS-SHORT" Delete "$INSTDIR\COPYING*" Delete "$INSTDIR\audio\*.*" Delete "$INSTDIR\bearer\*.*" Delete "$INSTDIR\diameter\*.*" Delete "$INSTDIR\extcap\androiddump.*" Delete "$INSTDIR\extcap\ciscodump.*" Delete "$INSTDIR\extcap\etwdump.*" Delete "$INSTDIR\extcap\randpktdump.*" Delete "$INSTDIR\extcap\sshdump.*" Delete "$INSTDIR\extcap\udpdump.*" Delete "$INSTDIR\extcap\wifidump.*" Delete "$INSTDIR\gpl-2.0-standalone.html" Delete "$INSTDIR\Acknowledgements.md" Delete "$INSTDIR\generic\*.*" Delete "$INSTDIR\help\*.*" Delete "$INSTDIR\iconengines\*.*" Delete "$INSTDIR\imageformats\*.*" Delete "$INSTDIR\mediaservice\*.*" Delete "$INSTDIR\multimedia\*.*" Delete "$INSTDIR\networkinformation\*.*" Delete "$INSTDIR\platforms\*.*" Delete "$INSTDIR\playlistformats\*.*" Delete "$INSTDIR\printsupport\*.*" Delete "$INSTDIR\share\glib-2.0\schemas\*.*" Delete "$INSTDIR\snmp\*.*" Delete "$INSTDIR\snmp\mibs\*.*" Delete "$INSTDIR\styles\translations\*.*" Delete "$INSTDIR\styles\*.*" Delete "$INSTDIR\protobuf\*.*" Delete "$INSTDIR\tls\*.*" Delete "$INSTDIR\tpncp\*.*" Delete "$INSTDIR\translations\*.*" Delete "$INSTDIR\ui\*.*" Delete "$INSTDIR\wimaxasncp\*.*" Delete "$INSTDIR\ws.css" ; previous versions installed these files Delete "$INSTDIR\*.manifest" ; previous versions installed this file Delete "$INSTDIR\AUTHORS-SHORT-FORMAT" Delete "$INSTDIR\README*" Delete "$INSTDIR\NEWS.txt" Delete "$INSTDIR\manuf" Delete "$INSTDIR\wka" Delete "$INSTDIR\services" Delete "$INSTDIR\pdml2html.xsl" Delete "$INSTDIR\pcrepattern.3.txt" Delete "$INSTDIR\user-guide.chm" Delete "$INSTDIR\example_snmp_users_file" Delete "$INSTDIR\ipmap.html" Delete "$INSTDIR\radius\*.*" Delete "$INSTDIR\dtds\*.*" RMDir "$INSTDIR\accessible" RMDir "$INSTDIR\audio" RMDir "$INSTDIR\bearer" RMDir "$INSTDIR\extcap" RMDir "$INSTDIR\iconengines" RMDir "$INSTDIR\imageformats" RMDir "$INSTDIR\mediaservice" RMDir "$INSTDIR\multimedia" RMDir "$INSTDIR\networkinformation" RMDir "$INSTDIR\platforms" RMDir "$INSTDIR\playlistformats" RMDir "$INSTDIR\printsupport" RMDir "$INSTDIR\styles\translations" RMDir "$INSTDIR\styles" RMDir "$SMPROGRAMS\${PROGRAM_NAME}" RMDir "$INSTDIR\help" RMDir "$INSTDIR\generic" RMDir /r "$INSTDIR\Wireshark User's Guide" RMDir "$INSTDIR\diameter" RMDir "$INSTDIR\snmp\mibs" RMDir "$INSTDIR\snmp" RMDir "$INSTDIR\radius" RMDir "$INSTDIR\dtds" RMDir "$INSTDIR\protobuf" RMDir "$INSTDIR\tls" RMDir "$INSTDIR\tpncp" RMDir "$INSTDIR\translations" RMDir "$INSTDIR\ui" RMDir "$INSTDIR\wimaxasncp" RMDir "$INSTDIR" SectionEnd ; "Uinstall" Section "Un.Plugins" un.SecPlugins ;------------------------------------------- SectionIn 1 2 ;Delete "$INSTDIR\plugins\${VERSION}\*.*" ;Delete "$INSTDIR\plugins\*.*" ;RMDir "$INSTDIR\plugins\${VERSION}" ;RMDir "$INSTDIR\plugins" RMDir /r "$INSTDIR\plugins" SectionEnd Section "Un.Global Profiles" un.SecProfiles ;------------------------------------------- SectionIn 1 2 RMDir /r "$INSTDIR\profiles" SectionEnd Section "Un.Global Settings" un.SecGlobalSettings ;------------------------------------------- SectionIn 1 2 Delete "$INSTDIR\cfilters" Delete "$INSTDIR\colorfilters" Delete "$INSTDIR\dfilters" Delete "$INSTDIR\enterprises.tsv" Delete "$INSTDIR\init.lua" Delete "$INSTDIR\console.lua" Delete "$INSTDIR\dtd_gen.lua" Delete "$INSTDIR\smi_modules" RMDir "$INSTDIR" SectionEnd Section /o "Un.Personal Settings" un.SecPersonalSettings ;------------------------------------------- SectionIn 2 SetShellVarContext current Delete "$APPDATA\${PROGRAM_NAME}\*.*" RMDir "$APPDATA\${PROGRAM_NAME}" DeleteRegKey HKCU "Software\${PROGRAM_NAME}" SectionEnd ;VAR un.NPCAP_UNINSTALL Section /o "Un.Npcap" un.SecNpcap ;------------------------------------------- SectionIn 2 ReadRegStr $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "UninstallString" ;IfErrors un.lbl_npcap_notinstalled ;if RegKey is unavailable, Npcap is not installed ${If} $1 != "" ;MessageBox MB_OK "Npcap $1" /SD IDOK ExecWait '$1' $0 DetailPrint "Npcap uninstaller returned $0" ;SetRebootFlag true ${EndIf} ;un.lbl_npcap_notinstalled: SectionEnd Section "-Un.Finally" ;------------------------------------------- SectionIn 1 2 !insertmacro UpdateIcons ; this test must be done after all other things uninstalled (e.g. Global Settings) IfFileExists "$INSTDIR" 0 NoFinalErrorMsg MessageBox MB_OK "Unable to remove $INSTDIR." /SD IDOK IDOK 0 ; skipped if dir doesn't exist NoFinalErrorMsg: SectionEnd ; Sign our installer and uninstaller during compilation. !ifdef ENABLE_SIGNED_NSIS !finalize 'sign-wireshark.bat "%1"' = 0 ; %1 is replaced by the installer exe to be signed. !uninstfinalize 'sign-wireshark.bat "%1"' = 0 ; %1 is replaced by the uninstaller exe to be signed. !endif ; ============================================================================ ; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD! ; ============================================================================ !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !ifdef QT_DIR !insertmacro MUI_DESCRIPTION_TEXT ${SecWiresharkQt} "The main network protocol analyzer application." !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecTShark} "Text based network protocol analyzer." !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Plugins and extensions for both ${PROGRAM_NAME} and TShark." !insertmacro MUI_DESCRIPTION_TEXT ${SecCodec} "Additional codec support." !insertmacro MUI_DESCRIPTION_TEXT ${SecProfiles} "Additional configuration profiles." !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "Additional protocol dissectors." !insertmacro MUI_DESCRIPTION_TEXT ${SecWiretap} "Extend wiretap support for capture file types. (e.g. usbdump)" !insertmacro MUI_DESCRIPTION_TEXT ${SecMate} "Plugin that allows the user to specify how different frames are related to each other." !insertmacro MUI_DESCRIPTION_TEXT ${SecStatsTree} "Extended statistics. (see stats_tree in WSDG; Packet Lengths in WSUG)" !insertmacro MUI_DESCRIPTION_TEXT ${SecTransum} "Plugin to calculate Response Time Element (RTE) statistics." !ifdef SMI_DIR !insertmacro MUI_DESCRIPTION_TEXT ${SecMIBs} "SNMP MIBs for better SNMP dissection." !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsGroup} "Additional command line based tools." !insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Print information about capture files." !insertmacro MUI_DESCRIPTION_TEXT ${SecCaptype} "Print the type(format) of capture files." !insertmacro MUI_DESCRIPTION_TEXT ${SecEditCap} "Copy packets to a new file, optionally trimming packets, omitting them, or saving to a different format." !insertmacro MUI_DESCRIPTION_TEXT ${SecMergecap} "Combine multiple saved capture files into a single output file." !ifdef MMDBRESOLVE_EXE !insertmacro MUI_DESCRIPTION_TEXT ${SecMMDBResolve} "MaxMind Database resolution tool - read IPv4 and IPv6 addresses and print their IP geolocation information." !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpkt} "Create a pcap trace file full of random packets. (randpkt produces very bad packets)" !insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Dump and analyze raw pcap data." !insertmacro MUI_DESCRIPTION_TEXT ${SecReordercap} "Copy packets to a new file, sorted by time." !insertmacro MUI_DESCRIPTION_TEXT ${SecText2Pcap} "Generate a capture file from an ASCII hexdump of packets." !insertmacro MUI_DESCRIPTION_TEXT ${SecExtcapGroup} "External Capture Interfaces" !insertmacro MUI_DESCRIPTION_TEXT ${SecAndroiddump} "Provide capture interfaces from Android devices." !ifdef BUILD_etwdump !insertmacro MUI_DESCRIPTION_TEXT ${SecEtwdump} "Provide an interface to read Event Tracing for Windows (ETW) event trace (ETL)." !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecRandpktdump} "Provide an interface to the random packet generator. (see also randpkt)" !ifdef LIBSSH_FOUND !insertmacro MUI_DESCRIPTION_TEXT ${SecSshdump} "Provide remote capture through SSH. (tcpdump, Cisco EPC, wifi)" !endif !insertmacro MUI_DESCRIPTION_TEXT ${SecUDPdump} "Provide capture interface to receive UDP packets streamed from network devices." !ifdef DOCBOOK_DIR !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} "Install an offline copy of the User's Guide and FAQ." !endif !insertmacro MUI_FUNCTION_DESCRIPTION_END !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall all ${PROGRAM_NAME} components." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all Plugins (even from previous ${PROGRAM_NAME} versions)." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecProfiles} "Uninstall all global configuration profiles." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecGlobalSettings} "Uninstall global settings like: $INSTDIR\cfilters" !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences file from your profile: $PROFILE." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecNpcap} "Call Npcap's uninstall program." !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUSBPcap} "Call USBPcap's uninstall program." !insertmacro MUI_UNFUNCTION_DESCRIPTION_END ; ============================================================================ ; Callback functions ; ============================================================================ !ifdef QT_DIR Var QT_SELECTED ; Called from fnc_AdditionalTasksPage_Create via DisplayAdditionalTasksPage. Function InitAdditionalTasksPage ; We've created the Additional tasks page. Update our control states ; before they are shown. ; We set XXX_STATE -> XxxCheckBox here and go the other direction below. ${NSD_SetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE ${NSD_SetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE ${NSD_SetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE StrCpy $QT_SELECTED 0 ${If} ${SectionIsSelected} ${SecWiresharkQt} StrCpy $QT_SELECTED 1 ${Endif} EnableWindow $hCtl_AdditionalTasksPage_CreateShortcutsLabel $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_StartMenuCheckBox $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_DesktopIconCheckBox $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_ExtensionsLabel $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $QT_SELECTED EnableWindow $hCtl_AdditionalTasksPage_FileExtensionsLabel $QT_SELECTED FunctionEnd Function LeaveAdditionalTasksPage ; We're leaving the Additional tasks page. Get our control states ; before they're destroyed. ; We set XxxCheckBox -> XXX_STATE here and go the other direction above. ${NSD_GetState} $hCtl_AdditionalTasksPage_StartMenuCheckBox $START_MENU_STATE ${NSD_GetState} $hCtl_AdditionalTasksPage_DesktopIconCheckBox $DESKTOP_ICON_STATE ${NSD_GetState} $hCtl_AdditionalTasksPage_AssociateExtensionsCheckBox $FILE_ASSOCIATE_STATE FunctionEnd !endif ; QT_DIR Var NPCAP_NAME ; DisplayName from Npcap installation Var WINPCAP_NAME ; DisplayName from WinPcap installation Var NPCAP_DISPLAY_VERSION ; DisplayVersion from Npcap installation Var USBPCAP_NAME ; DisplayName from USBPcap installation Function myShowCallback ClearErrors ; detect if WinPcap should be installed WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Text" "Install Npcap ${NPCAP_PACKAGE_VERSION}" ReadRegStr $NPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayName" IfErrors 0 lbl_npcap_installed ; check also if WinPcap is installed ReadRegStr $WINPCAP_NAME HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "DisplayName" IfErrors 0 lbl_winpcap_installed ;if RegKey is available, WinPcap is already installed WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "Neither of these are installed" WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Flags" "DISABLED" WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old Npcap or WinPcap versions)" Goto lbl_npcap_done lbl_npcap_installed: ReadRegStr $NPCAP_DISPLAY_VERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NpcapInst" "DisplayVersion" WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 1" "Text" "Currently installed Npcap version" StrCmp $NPCAP_NAME "Npcap" 0 +3 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "Npcap $NPCAP_DISPLAY_VERSION" Goto +2 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$NPCAP_NAME" ; Compare the installed build against the one we have. StrCmp $NPCAP_DISPLAY_VERSION "" lbl_npcap_do_install ; Npcap wasn't installed improperly? ${VersionConvert} $NPCAP_DISPLAY_VERSION "" $R0 ; 0.99-r7 -> 0.99.114.7 ${VersionConvert} "${NPCAP_PACKAGE_VERSION}" "" $R1 ${VersionCompare} $R0 $R1 $1 StrCmp $1 "2" lbl_npcap_do_install WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "0" WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "Flags" "DISABLED" WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "If you wish to install Npcap, please uninstall $NPCAP_NAME manually first." WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Flags" "DISABLED" Goto lbl_npcap_done lbl_winpcap_installed: WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 2" "Text" "$WINPCAP_NAME" WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "1" WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed $WINPCAP_NAME may be uninstalled first." Goto lbl_npcap_done lbl_npcap_do_install: ; seems to be an old version, install newer one WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 4" "State" "1" StrCmp $NPCAP_NAME "Npcap" 0 +3 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed Npcap $NPCAP_DISPLAY_VERSION will be uninstalled first." Goto +2 WriteINIStr "$PLUGINSDIR\NpcapPage.ini" "Field 5" "Text" "The currently installed $NPCAP_NAME will be uninstalled first." lbl_npcap_done: ; detect if USBPcap should be installed WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Text" "Install USBPcap ${USBPCAP_PACKAGE_VERSION}" ${If} ${RunningX64} ${DisableX64FSRedirection} SetRegView 64 ${EndIf} ReadRegStr $USBPCAP_NAME HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\USBPcap" "DisplayName" ${If} ${RunningX64} ${EnableX64FSRedirection} SetRegView 32 ${EndIf} IfErrors 0 lbl_usbpcap_installed ;if RegKey is available, USBPcap is already installed WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "USBPcap is currently not installed" WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Flags" "DISABLED" WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "(Use Add/Remove Programs first to uninstall any undetected old USBPcap versions)" Goto lbl_usbpcap_done lbl_usbpcap_installed: WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 2" "Text" "$USBPCAP_NAME" WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "State" "0" WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 4" "Flags" "DISABLED" WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Text" "If you wish to install USBPcap ${USBPCAP_PACKAGE_VERSION}, please uninstall $USBPCAP_NAME manually first." WriteINIStr "$PLUGINSDIR\USBPcapPage.ini" "Field 5" "Flags" "DISABLED" Goto lbl_usbpcap_done lbl_usbpcap_done: FunctionEnd
wireshark/packaging/portableapps/appinfo.tmpl
[Format] Type=PortableApps.comFormat Version=3.0 [Details] Name=Wireshark Portable (@PORTABLEAPPS_BITS@-bit) AppID=@PORTABLEAPPS_NAME@ Publisher=Wireshark.org Homepage=https://www.wireshark.org/ Category=Internet Description=Wireshark is one of the world's foremost network protocol analyzers. Language=Multilingual Trademarks=Wireshark and the fin logo are registered trademarks of the Wireshark Foundation [License] Shareable=true OpenSource=true Freeware=true CommercialUse=true [Version] PackageVersion=@PORTABLEAPPS_PACKAGE_VERSION@ DisplayVersion=@PROJECT_VERSION@ [Control] Icons=1 Start=@[email protected]
Text
wireshark/packaging/portableapps/CMakeLists.txt
# CMakeLists.txt # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later # # PortableApps.com appears to use "FooAppPortable" for 32-bit packages # and "FooAppPortable64" for 64-bit packages. We deviate from that here # by always appending a bit suffix. # # PA.com also tends to ship 32-bit and 64-bit executables in combined # packages. We don't do that because a) we're large and b) we build # our 32-bit and 64-bit packages independently in separate pipelines. set(PORTABLEAPPS_BITS 64) set(PORTABLEAPPS_BITS ${PORTABLEAPPS_BITS} PARENT_SCOPE) set(PORTABLEAPPS_NAME "${CMAKE_PROJECT_NAME}Portable${PORTABLEAPPS_BITS}") set(PORTABLEAPPS_NAME ${PORTABLEAPPS_NAME} PARENT_SCOPE) set (_launcher_dir "${CMAKE_CURRENT_BINARY_DIR}/${PORTABLEAPPS_NAME}") set (PORTABLEAPPS_LAUNCHER_STAGING_DIR ${_launcher_dir} PARENT_SCOPE) set(PORTABLEAPPS_DIRS ${_launcher_dir} ${_launcher_dir}/App ${_launcher_dir}/App/AppInfo ${_launcher_dir}/App/AppInfo/Launcher ${_launcher_dir}/Data ${_launcher_dir}/Other ${_launcher_dir}/Other/Source PARENT_SCOPE ) macro( ADD_PORTABLEAPPS_PACKAGE_TARGET ) # Copy our binaries, libraries, and data files to the PortableApps build directory. set(_wireshark_portableapps_app_dir "${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/${CMAKE_PROJECT_NAME}") file(TO_NATIVE_PATH "${_wireshark_portableapps_app_dir}" _wireshark_portableapps_app_dir_native) file(TO_NATIVE_PATH "${DATAFILE_DIR}" _datafile_dir_native) file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}/packaging/portableapps/xcopy-deploy-exclude.txt" _xcopy_deploy_exclude) add_custom_target(wireshark_portableapps_app_dir # We "Deploy using XCopy," which is described at # https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/ms235291(v=vs.90) # We also assume that the project has been built at this point. COMMAND ${CMAKE_COMMAND} -E remove_directory ${_wireshark_portableapps_app_dir} COMMAND ${CMAKE_COMMAND} -E make_directory ${_wireshark_portableapps_app_dir} COMMAND xcopy ${_datafile_dir_native} ${_wireshark_portableapps_app_dir_native} /D /I /E /Y /exclude:${_xcopy_deploy_exclude} ) set_target_properties(wireshark_portableapps_app_dir PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) if(MSVCR_DLL) add_custom_target(wireshark_portableapps_runtime COMMAND xcopy "${MSVCR_DLL}" ${_wireshark_portableapps_app_dir_native} /D /I /Y ) else(MSVCR_DLL) add_custom_target(wireshark_portableapps_runtime COMMAND ${CMAKE_COMMAND} -E echo "C Runtime MUST be installed on target system." ) endif(MSVCR_DLL) set_target_properties(wireshark_portableapps_runtime PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) add_dependencies(wireshark_portableapps_runtime wireshark_portableapps_app_dir) # Build the PortableApps package. # wireshark_nsis_prep must be built prior to this. # XXX Rename this to wireshark_portableapps set (_portableapps_package ${CMAKE_BINARY_DIR}/packaging/portableapps/${PORTABLEAPPS_NAME}_${PROJECT_VERSION}.paf.exe) add_custom_target(wireshark_portableapps DEPENDS wireshark_portableapps_runtime ${_portableapps_package} ) set_target_properties(wireshark_portableapps PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) set(PORTABLEAPPS_PACKAGE_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.0") configure_file( ${CMAKE_SOURCE_DIR}/packaging/portableapps/appinfo.tmpl ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appinfo.ini NEWLINE_STYLE WIN32 ) foreach(_portableapps_dir ${PORTABLEAPPS_DIRS}) file(MAKE_DIRECTORY ${_portableapps_dir}) endforeach() set(_portableapps_launcher_ini ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/Launcher/${PORTABLEAPPS_NAME}.ini) configure_file( ${CMAKE_SOURCE_DIR}/packaging/portableapps/${CMAKE_PROJECT_NAME}Portable.tmpl ${_portableapps_launcher_ini} NEWLINE_STYLE WIN32 ) set(_portableapps_launcher_exe ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/${PORTABLEAPPS_NAME}.exe) file(TO_NATIVE_PATH "${PORTABLEAPPS_LAUNCHER_STAGING_DIR}" _portableapps_native ) add_custom_command(OUTPUT ${_portableapps_launcher_exe} DEPENDS ${_portableapps_launcher_ini} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/packaging/portableapps/help.html ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/help.html COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/packaging/portableapps/help.html ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/help.html COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/resources/icons/wireshark.ico ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon.ico COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/resources/icons/wsicon16.png ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon_16.png COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/resources/icons/wsicon32.png ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon_32.png COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/resources/icons/wsicon128.png ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appicon_128.png COMMAND ${PORTABLEAPPS_LAUNCHER_GENERATOR_EXECUTABLE} ${_portableapps_native} ) add_custom_command(OUTPUT ${_portableapps_package} DEPENDS ${PORTABLEAPPS_LAUNCHER_STAGING_DIR}/App/AppInfo/appinfo.ini ${_portableapps_launcher_ini} ${_portableapps_launcher_exe} COMMAND ${PORTABLEAPPS_INSTALLER_EXECUTABLE} ${_portableapps_native} ) endmacro( ADD_PORTABLEAPPS_PACKAGE_TARGET ) #set(CLEAN_FILES # ${_launcher_dir} # ${_portableapps_package} #)
HTML
wireshark/packaging/portableapps/help.html
<!DOCTYPE html> <html> <head> <title>Wireshark Portable · Help</title> </head> <body> Please see <a href="https://www.wireshark.org/docs/">the online documentation</a>. </body>
Text
wireshark/packaging/portableapps/readme.txt
Portable Wireshark ================== This directory contains experimental packaging for running Wireshark under the Portable Apps (https://portableapps.com). Currently only an additional menu item for Wireshark is added - the other tools could be added to Portable Apps menu if required. WinPcap ======= If you want to capture packets, then WinPcap needs to be installed. Wireshark Portable will try and install WinPcap if it doesn't find it installed on the local machine. If it does install it, it will uninstall it when Wireshark Portable quits. A quieter install/de-install for WinPcap would help matters - but ultimately a minimal installation mechanism needs to be identified for WinPcap. But that is not for the Wireshark forum. NSIS ==== The Portable Apps packaging uses the NullSoft Scriptable Installer System (NSIS) to create a installation package to install onto the USB drive, and a launcher to launch Wireshark from the USB drive. NSIS is used by the standard Win32 installation mechanism (packaging/nsis) but an additional plug-in is required for the Wireshark Portable launcher. This is now automatically downloaded and installed from the wireshark-win32-libs repository. INI Settings ============ The Wireshark Portable Launcher will look for an ini file called WiresharkPortable.ini within its directory. It is only necessary to have a ini file if you wish to change the default configuration. There is an example INI included with this package to get you started. The INI file is formatted as follows: [WiresharkPortable] WiresharkDirectory WiresharkExecutable AdditionalParameters DisableWinPcapInstall WinPcapInstaller MSVCRedist The WiresharkDirectory entry should be set to the *relative* path to the directory containing the Wireshark Portable Launcher (WiresharkPortable.exe). This entry must be present. The WiresharkExecutable entry allows you to set the Wireshark Portable Launcher to use an alternate EXE call to launch Wireshark. The AdditionalParameters entry allows you to pass additional commandline parameter entries to wireshark.exe. The DisableWinPcapInstall allows you to disable the installation of WinPcap, even if it it not present on the host system. The WinPcapInstaller allows you to specify a different WinPcap installer than the default one included in the distribution. For example, if you download a later version. The MSVCRedist allows you to specify a different redistributable package to be used than the default one included in the distribution.
wireshark/packaging/portableapps/WiresharkPortable.tmpl
# https://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.ini/launch.html [Launch] ProgramExecutable=Wireshark\Wireshark.exe SinglePortableAppInstance=false SingleAppInstance=false WaitForProgram=false MinOS=7 [Environment] WIRESHARK_APPDATA=%PAL:DataDir%
Inno Setup Script
wireshark/packaging/rpm/wireshark.spec.in
# Note that this is NOT a relocatable package # XXX is this still true? https://fedoraproject.org/wiki/Packaging:Cmake # says that recent CMake versions take care of rpathification. # To do: # - Support clang with non Fedora distributions %bcond_with toolchain_clang %bcond_with ninja %bcond_with ccache # In rpm 4.17.1 it's possible to define these so that # the one is set, the default is the inverse of the other %if 0%{?fedora} || 0%{?rhel} >= 9 %bcond_with qt5 %bcond_without qt6 %else %bcond_without qt5 %bcond_with qt6 %endif %bcond_with lua %bcond_with mmdbresolve %bcond_with lz4_and_snappy %bcond_with spandsp %bcond_with bcg729 %bcond_with libxml2 %bcond_with nghttp2 %bcond_with sdjournal %bcond_with guides %bcond_with brotli %bcond_with zstd %bcond_with ilbc %bcond_with opus # Fedora options to use clang as the compiler # https://docs.fedoraproject.org/en-US/packaging-guidelines/#compiler %if 0%{?fedora} %if %{with toolchain_clang} %global toolchain clang %else %global toolchain gcc %endif %endif # Set at most one of these two: # Note that setcap requires rpmbuild 4.7.0 or later. %global setuid_dumpcap 0 %global setcap_dumpcap 1 # Set to 1 if you want a group called 'wireshark' which users must be a member # of in order to run dumpcap. Only used if setuid_dumpcap or setcap_dumpcap # are set. %global use_wireshark_group 1 # RPM 4.11.2 and higher errors out on double dash in versions by default. # Some, but not all, distros make this a warning instead; ensure that it is. # We override the dashes with underscores for the main wireshark RPM version, # but rpmbuild will fail based on its generated dependency from the pkg-config # file (wireshark.pc), which has our original version with dashes. %global _wrong_version_format_terminate_build 0 %global package_version @PROJECT_VERSION@ Summary: The world's foremost protocol analyzer Name: wireshark Version: @RPM_VERSION@ Release: 1%{?dist} License: GPLv2+ Group: Applications/Internet Source: https://www.wireshark.org/download/src/%{name}-%{package_version}.tar.xz # Or this URL for automated builds: #Source: https://www.wireshark.org/download/automated/src/%%{name}-%%{package_version}.tar.xz URL: https://www.wireshark.org/ Packager: Gerald Combs <gerald[AT]wireshark.org> # 4.13 introduces Boolean dependencies BuildRequires: rpm-build >= 4.13.0 BuildRequires: cmake >= 3.13 BuildRequires: python3 %if %{with toolchain_clang} BuildRequires: clang %else BuildRequires: gcc BuildRequires: gcc-c++ %endif BuildRequires: flex %if %{with ninja} BuildRequires: (ninja or ninja-build) %endif # We always require Asciidoctor for packaging builds as of 84ab55cf75, # unfortunately it's not evenly distributed across distros. # Fedora & CentOS: rubygem-asciidoctor # CentOS 8: <added in - https://bugzilla.redhat.com/show_bug.cgi?id=1820896> # openSUSE 15.3: ruby2.5-rubygem-asciidoctor # All of the packages provide this, so we can rely on it: BuildRequires: /usr/bin/asciidoctor # For the HTML guides, we need xsltproc, and the docbook stylesheets %if %{with guides} BuildRequires: /usr/bin/xsltproc BuildRequires: (docbook-style-xsl or docbook-xsl-stylesheets) %endif BuildRequires: glib2-devel >= 2.54.0 BuildRequires: libpcap-devel BuildRequires: zlib-devel BuildRequires: libgcrypt-devel BuildRequires: pcre2-devel %if %{with lz4_and_snappy} BuildRequires: (lz4-devel or liblz4-devel) BuildRequires: snappy-devel %endif BuildRequires: (c-ares-devel or libcares-devel) # On SUSE speex-devel requires speexdsp-devel, but that # is not the case on RH/Fedora. I believe we only need # SpeexDSP BuildRequires: speexdsp-devel %if %{with lua} # We only support Lua before 5.3 (#10881) BuildRequires: (compat-lua-devel < 5.3 or lua51-devel) %endif %if %{with nghttp2} BuildRequires: libnghttp2-devel %endif %if %{with sdjournal} BuildRequires: systemd-devel %endif %if %{with brotli} BuildRequires: (brotli-devel or libbrotli-devel) %endif %if %{with zstd} BuildRequires: libzstd-devel %endif # Uncomment these if you want to be sure you get them... #BuildRequires: krb5-devel #BuildRequires: libsmi-devel #BuildRequires: pcre-devel #BuildRequires: libselinux #BuildRequires: gnutls-devel #BuildRequires: libcap-devel %if %{with mmdbresolve} BuildRequires: libmaxminddb-devel %endif %if %{use_wireshark_group} %if 0%{?suse_version} # SUSE's groupadd is in this package: Requires(pre): pwdutils %else # ... while Red Hat's is in this one: Requires(pre): shadow-utils %endif %endif # NOTE: the below description has been copied to org.wireshark.Wireshark.metainfo.xml (in the # top-level directory). %description Wireshark allows you to examine protocol data stored in files or as it is captured from wired or wireless (WiFi or Bluetooth) networks, USB devices, and many other sources. It supports dozens of protocol capture file formats and understands more than a thousand protocols. It has many powerful features including a rich display filter language and the ability to reassemble multiple protocol packets in order to, for example, view a complete TCP stream, save the contents of a file which was transferred over HTTP or CIFS, or play back an RTP audio stream. This package contains command-line utilities, plugins, and documentation for Wireshark. A Qt graphical user interface is packaged separately. %if %{with qt5} || %{with qt6} %package qt Summary: Wireshark's Qt-based GUI Group: Applications/Internet Obsoletes: wireshark-gnome < %{version} wireshark-gtk < %{version} Requires: %{name} = %{version}-%{release} %if %{with qt5} %if 0%{?suse_version} BuildRequires: libQt5Core-devel BuildRequires: libQt5Gui-devel BuildRequires: libQt5Widgets-devel BuildRequires: libQt5PrintSupport-devel BuildRequires: libQt5Concurrent-devel BuildRequires: libqt5-qtmultimedia-devel BuildRequires: libqt5-linguist-devel Requires: libQt5Svg5 # Need this for SUSE's suse_update_desktop_file macro BuildRequires: update-desktop-files %else BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtmultimedia-devel BuildRequires: qt5-linguist Requires: qt5-qtsvg %endif %endif %if %{with qt6} BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qtmultimedia-devel BuildRequires: qt6-qttools-devel BuildRequires: qt6-qt5compat-devel BuildRequires: libxkbcommon-devel %endif Requires: xdg-utils Requires: hicolor-icon-theme BuildRequires: desktop-file-utils Requires(post): desktop-file-utils # Add this for more readable fonts on some distributions/versions #Requires: dejavu-sans-mono-fonts %description qt This package contains the Qt Wireshark GUI and desktop integration files. %endif %package devel Summary: Development headers for Wireshark Group: Applications/Internet Requires: %{name} = %{version}-%{release} %description devel The wireshark-devel package contains the header and other files required for development of Wireshark scripts and plugins. %prep %setup -q -n %{name}-%{package_version} %build # The SUSE macros for cmake and ninja depend upon _bindir, which depends # on _prefix (and is thus wrong if _prefix is anything other than /usr). # Set _bindir to the correct value regardless of _prefix. %if 0%{?suse_version} %define _bindir /usr/bin %if %{with ninja} %define __builder %{_bindir}/ninja %endif %endif %if 0%{?rhel} %define __ninja /usr/bin/ninja-build %endif # How do we reliably run CMake for all of CentOS, Fedora, RHEL, and openSUSE? # https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/ # https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds # https://en.opensuse.org/openSUSE:Build_system_recipes#cmake # Fedora's new RPATH hardening means we need to enable $ORIGIN if the # prefix is anything other than /usr: # https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild %cmake \ %if 0%{?fedora} && ( "%{_prefix}" != "/usr" ) -DENABLE_RPATH_ORIGIN=ON \ %endif %if %{with ccache} -DENABLE_CCACHE=ON \ %endif %if %{with qt5} || %{with qt6} -DBUILD_wireshark=ON \ %if %{with qt5} -DUSE_qt6=OFF \ %endif %else -DBUILD_wireshark=OFF \ %endif %if %{with lua} -DENABLE_LUA=ON \ %else -DENABLE_LUA=OFF \ %endif %if %{with mmdbresolve} -DBUILD_mmdbresolve=ON \ %else -DBUILD_mmdbresolve=OFF \ %endif %if %{with lz4_and_snappy} -DENABLE_LZ4=ON \ -DENABLE_SNAPPY=ON \ %else -DENABLE_LZ4=OFF \ -DENABLE_SNAPPY=OFF \ %endif %if %{with spandsp} -DENABLE_SPANDSP=ON \ %else -DENABLE_SPANDSP=OFF \ %endif %if %{with bcg729} -DENABLE_BCG729=ON \ %else -DENABLE_BCG729=OFF \ %endif %if %{with libxml2} -DENABLE_LIBXML2=ON \ %else -DENABLE_LIBXML2=OFF \ %endif %if %{with nghttp2} -DENABLE_NGHTTP2=ON \ %else -DENABLE_NGHTTP2=OFF \ %endif %if %{with sdjournal} -DBUILD_sdjournal=ON \ %else -DBUILD_sdjournal=OFF \ %endif %if %{with brotli} -DENABLE_BROTLI=ON \ %else -DENABLE_BROTLI=OFF \ %endif -DENABLE_WERROR=OFF \ %if %{with ninja} -G Ninja \ %endif %if %{with ilbc} -DENABLE_ILBC=ON \ %else -DENABLE_ILBC=OFF \ %endif %if %{with opus} -DENABLE_OPUS=ON \ %else -DENABLE_OPUS=OFF \ %endif # Fedora and SUSE 15 do out of source builds by default, but they store # the build directory in different macros. Older distributions don't define # that macro at all. Let's make it so that one macro contains the build # directory (which will be "." for any distribution that doesn't define # either macro, and thus presumably does in-source builds.) %{?!__cmake_builddir: %global __cmake_builddir %{?__builddir}%{!?__builddir:.}} %cmake_build %install %if 0%{?suse_version} %define cmake_install DESTDIR=%{buildroot} %__cmake --install %{__cmake_builddir} %endif %cmake_install %cmake_install --component Development %if %{with guides} %cmake_install --component UserGuide %endif # If we're being installed in an unusual prefix tell the loader where # to find our libraries. %if "%{_prefix}" != "/usr" %define install_ld_so_conf 1 mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d echo %{_libdir} > $RPM_BUILD_ROOT/etc/ld.so.conf.d/wireshark.conf %endif %if %{with qt5} || %{with qt6} %if 0%{?suse_version} # SUSE's packaging conventions # (https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25suse_update_desktop_file) # require this: %if "%{_prefix}" != "/usr" install -Dm 0644 %{buildroot}%{_prefix}/share/applications/org.wireshark.Wireshark.desktop %{buildroot}/usr/share/applications/org.wireshark.Wireshark.desktop %endif %suse_update_desktop_file org.wireshark.Wireshark %else # Fedora's packaging guidelines (https://fedoraproject.org/wiki/Packaging:Guidelines) # require this (at least if desktop-file-install was not used to install it). desktop-file-validate %{buildroot}%{_datadir}/applications/org.wireshark.Wireshark.desktop %endif %endif %if %{use_wireshark_group} %pre getent group wireshark >/dev/null || groupadd -r wireshark %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %if %{with qt5} || %{with qt6} %post qt update-desktop-database %{_datadir}/applications &> /dev/null || : update-mime-database %{_datadir}/mime &> /dev/null || : touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun qt update-desktop-database %{_datadir}/applications &> /dev/null ||: update-mime-database %{_datadir}/mime &> /dev/null || : %endif %files %if 0%{?suse_version} # Before packing, we need to restore the bindir to the wireshark one %define _bindir %{_prefix}/bin %endif %defattr(-,root,root) %doc AUTHORS COPYING NEWS README.md %{_datadir}/doc/wireshark %docdir %{_datadir}/doc/wireshark # Don't pick up any of the wireshark (GUI) binaries here %exclude %{_bindir}/wireshark* %{_bindir}/* # This generates a warning because dumpcap is listed twice. That's # probably preferable to listing each program (and keeping the list up to # date)... %if %{use_wireshark_group} && %{setuid_dumpcap} # Setuid but only executable by members of the 'wireshark' group %attr(4750, root, wireshark) %{_bindir}/dumpcap %else %if %{use_wireshark_group} && %{setcap_dumpcap} # Setcap but only executable by members of the 'wireshark' group %attr(0750, root, wireshark) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/dumpcap %else %if %{setuid_dumpcap} # Setuid and executable by all %attr(4755, root, root) %{_bindir}/dumpcap %else %if %{setcap_dumpcap} # Setcap and executable by all %attr(0755, root, root) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/dumpcap %else # Executable by all but with no special permissions %attr(0755, root, root) %{_bindir}/dumpcap %endif %endif %endif %endif %{_libdir}/lib*.so* %{_libdir}/wireshark # Don't pick up the wireshark (GUI) man page here %exclude %{_mandir}/man1/wireshark.* %{_mandir}/man1/* %{_mandir}/man4/* %config(noreplace) %{_datadir}/wireshark/diameter/Custom.xml %{_datadir}/wireshark %if 0%{?install_ld_so_conf} /etc/ld.so.conf.d/wireshark.conf %endif %if %{with qt5} || %{with qt6} %files qt %defattr(-,root,root) %{_datadir}/applications/org.wireshark.Wireshark.desktop %if 0%{?suse_version} %if "%{_prefix}" != "/usr" /usr/share/applications/org.wireshark.Wireshark.desktop %endif %endif %{_datadir}/metainfo/org.wireshark.Wireshark.metainfo.xml %{_datadir}/icons/hicolor/*/apps/* %{_datadir}/icons/hicolor/*/mimetypes/* %{_datadir}/mime/packages/org.wireshark.Wireshark.xml %{_bindir}/wireshark %{_mandir}/man1/wireshark.* %endif %files devel %{_includedir}/wireshark %{_libdir}/cmake/wireshark %{_libdir}/pkgconfig/wireshark.pc %changelog * Wed Jun 14 2023 Joao Valverde - Update CMake devel files path * Wed Aug 24 2022 Joao Valverde - Add Qt6 support with Fedora build dependencies * Mon Apr 25 2022 John Thacker - Cleanup specfile to remove obsolete and deprecated syntax * Wed Jan 5 2022 John Thacker - pcre2 is required now (most distros will get this as part of a dependency chain glib2-devel->libselinux-devel->pcre2-devel anyway) - Remove Requires that automatic dependency handling picks up * Mon Mar 29 2021 Joao Valverde - Update HTML documentation location * Thu Nov 26 2020 Gerald Combs - Bison is no longer required * Tue Sep 29 2020 Lin Sun - Added opus codec as an option * Sun Jan 19 2020 Jiri Novak - Added ilbc codec as an option * Fri Nov 22 2019 Gerald Combs - c-ares is a required package * Thu Aug 15 2019 Gerald Combs - Add zstd * Mon Apr 22 2019 Daniel Bakai - Added brotli (as an option, defaulting to not required). * Fri Sep 28 2018 Gerald Combs - Add sdjournal * Thu Sep 27 2018 Jeff Morriss - Have the qt package obsolute the old gnome and gtk packages. This allows clean upgrades to the Qt version. - Set install prefix based on original cmake call's prefix. - Update capitalization of SUSE. * Wed Sep 26 2018 Jeff Morriss - Put development-related files in a new -devel RPM. * Mon Sep 24 2018 Jeff Morriss - Allow using ccache to (greatly) speed up rebuilds. * Mon Sep 24 2018 Jeff Morriss - Make the (optional) maxminddb dependencies actually work. * Wed Apr 11 2018 Gerald Combs - Make documentation installation conditional. * Tue Mar 20 2018 Gerald Combs - Migrate from Autotools to CMake. - Remove Qt4, GTK+ 2, and GTK+ 3 sections. - Require flex, bison, and libgcrypt. - Optionally build with Ninja. * Sat Dec 2 2017 Jeff Morriss - Include the User Guide (now installed by default by autotools). * Wed Jul 26 2017 Pascal Quantin - Added bcg729 (as an option, defaulting to not required). * Tue Apr 4 2017 Ahmad Fatoum - Added libxml2 (as an option, defaulting to required). * Tue Dec 20 2016 Anders Broman - Add with extcap (as an option, defaulting to yes). * Mon Dec 5 2016 Jeff Morriss - Add spandsp (as an option, defaulting to not required). * Tue Oct 18 2016 Benoit Canet - Add LZ4 and snappy compression support. * Mon Aug 29 2016 Jeff Morriss - Add libnghttp2 (as an option, defaulting to required). * Wed Aug 17 2016 Jeff Morriss - wireshark.pc is now installed with Wireshark, include it in the RPM. * Mon May 9 2016 Jeff Morriss - Make autoconf, automake, flex, and bison optional: most users (who aren't patching Wireshark) don't need them to build an RPM. * Tue Nov 10 2015 Jeff Morriss - Rename the gnome package to gtk: Wireshark uses Gtk+ but isn't part of GNOME. * Mon Sep 14 2015 Jeff Morriss - Follow ./configure's decision on whether to configure Lua or not rather than forcing it to be enabled (and thus failing on some distros which don't ship a compatible version of Lua any more). * Sat Sep 12 2015 Jeffrey Smith - Begin support for Qt5 * Thu Jan 22 2015 Jeff Morriss - Add appdata file. * Tue Jan 20 2015 Jeff Morriss - Make the license tag more specific: Wireshark is GPLv2+. * Mon Jan 12 2015 Jeff Morriss - Modernize the (base package) %%description. * Wed Dec 3 2014 Jeff Morriss - Don't run gtk-update-icon-cache when uninstalling the Qt package. But do run it when installing the gnome package. - Tell the loader where to find our libraries if we're being installed someplace other than /usr . - Attempt to get RPMs working with a prefix other than /usr (now that the (free)desktop files are no longer always installed /usr). Desktop integration doesn't work for prefixes other than "/usr" or "/usr/local". * Fri Aug 29 2014 Gerald Combs - The Qt UI is now the default. Update logic and prioritization to reflect this. * Mon Aug 4 2014 Jeff Morriss - Fix RPM builds with a prefix other than /usr: The location of update-alternatives does not depend on Wireshark's installation prefix: it's always in /usr/sbin/. * Fri Aug 1 2014 Jeff Morriss - Remove the old wireshark binary during RPM upgrades: this is needed because we now declare wireshark to be %%ghost so it doesn't get overwritten during an upgrade (but in older RPMs it was the real program). * Tue Jul 1 2014 Jeff Morriss - Get rid of rpath when we're building RPMs: Fedora prohibits it, we don't need it, and it gets in the way some times. * Tue Nov 26 2013 Jeff Morriss - Overhaul options handling to pull in the UI choice from ./configure. - Make it possible to not build the GNOME package. * Tue Nov 12 2013 Jeff Morriss - Add a qt package using 'alternatives' to allow the administrator to choose which one they actually use. * Fri Sep 20 2013 Jeff Morriss - If we're not using gtk3 add --with-gtk2 (since Wireshark now defaults to gtk3) * Thu Mar 28 2013 Jeff Morriss - Simplify check for rpmbuild's version. * Fri Mar 8 2013 Jeff Morriss - Put all icons in hicolor - Use SuSE's desktop-update macro. - Actually update MIME database when Wireshark's prefix is not /usr . * Thu Mar 7 2013 Jeff Morriss - List more build dependencies. - Update to work on SuSE too: some of their package names are different. * Wed Mar 6 2013 Gerald Combs - Enable c-ares by default * Thu Feb 7 2013 Jeff Morriss - Overhaul to make this file more useful/up to date. Many changes are based on Fedora's .spec file. Changes include: - Create a separate wireshark-gnome package (like Red Hat). - Control some things with variables set at the top of the file. - Allow the user to configure how dumpcap is installed. - Allow the user to choose some options including GTK2 or GTK3. - Greatly expand the BuildRequires entries; get the minimum versions of some things from 'configure'. - Install freedesktop files for better (free)desktop integration. * Thu Aug 10 2006 Joerg Mayer - Starting with X.org 7.x X11R6 is being phased out. Install wireshark and manpage into the standard path. * Mon Aug 01 2005 Gerald Combs - Add a desktop file and icon for future use - Take over the role of packager - Update descriptions and source locations * Thu Oct 28 2004 Joerg Mayer - Add openssl requirement (heimdal and net-snmp are still automatic) * Tue Jul 20 2004 Joerg Mayer - Redo install and files section to actually work with normal builds * Sat Feb 07 2004 Joerg Mayer - in case there are shared libs: include them * Tue Aug 24 1999 Gilbert Ramirez - changed to ethereal.spec.in so that 'configure' can update the version automatically * Tue Aug 03 1999 Gilbert Ramirez <[email protected]> - updated to 0.7.0 and changed gtk+ requirement * Sun Jan 03 1999 Gerald Combs <[email protected]> - updated to 0.5.1 * Fri Nov 20 1998 FastJack <[email protected]> - updated to 0.5.0 * Sun Nov 15 1998 FastJack <[email protected]> - created .spec file
Inno Setup Script
wireshark/packaging/source/git-export-release.sh.in
#!/bin/bash # # Creates a release tarball directly from git # Note that the tarball contents might not exactly match # a particular git commit, particularly for untagged # commits. # # An alternative approach would be to generate source tarballs # using CPack. That would remove our dependency on git, but if # Autotools is any indication it would require continuous # maintenance. # # Copyright 2011 Balint Reczey <[email protected]> # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later set -e -u -o pipefail DESTDIR=. while getopts "d:" OPTCHAR ; do case $OPTCHAR in d) DESTDIR=$OPTARG ;; *) printf "Unknown option %s\n" "$OPTCHAR" ;; esac done shift $(( OPTIND - 1 )) # The remaining parameter, if set, is a package version such as 3.4.5 # or 3.4.5-67-gabcd4321 # By default the version from make-version.py + CMake is used. PROJECT_VERSION=@PROJECT_VERSION@ if test -n "${1-}"; then PROJECT_VERSION="$1" fi TARBALL="${DESTDIR}/wireshark-${PROJECT_VERSION}.tar.xz" # A tarball produced by 'git archive' will have the $Format string # substituted due to the use of 'export-subst' in .gitattributes. # shellcheck disable=SC2016 COMMIT='17cd9891be299d3dd75524a61378ba39ab8e3199' if [[ $COMMIT != \$F* ]] ; then # This file was extracted from a tarball produced by git archive # and so we are not in a git repository. if [[ -f "$TARBALL" ]] ; then # git get-tar-commit-id works outside a git repo, as it # only reads the first 1024 bytes of the tar extended header. if [[ $(git get-tar-commit-id < <(xzcat "$TARBALL")) == "$COMMIT" ]] ; then echo "$TARBALL commit ID matches $COMMIT." else # Allow people to make changes to a downloaded source tarball # and re-tar it? echo "WARNING: $TARBALL is not the original git archive." fi exit 0 fi echo "" echo "The build system cannot produce a source tarball outside of a git repository." echo "If you are trying to build an RPM package from source extracted from a tarball," echo "copy it (i.e., wireshark-${PROJECT_VERSION}.tar.xz) to" echo "$DESTDIR" echo "and run the build command again." exit 1 fi STASH_ID=$(git stash create || echo "") if [[ -n "${CI_COMMIT_SHA-}" ]] ; then echo "Setting commit from CI_COMMIT_SHA" COMMIT="$CI_COMMIT_SHA" elif [[ -n "$STASH_ID" ]] ; then echo "Setting commit from stash" COMMIT="$STASH_ID" else COMMIT="HEAD" fi if [ -f "$TARBALL" ] ; then printf "Found %s\\n" "$TARBALL" if TARBALL_ID=$(git get-tar-commit-id < <(xzcat "$TARBALL")) && COMMIT_ID=$(git rev-parse --verify "$COMMIT") ; then if [[ $TARBALL_ID == "$COMMIT_ID" ]] ; then echo "$TARBALL commit ID matches $COMMIT." exit 0 fi fi fi echo "Creating $TARBALL from $COMMIT" XZ_OPTS= echo . | xz --threads=0 > /dev/null 2>&1 && XZ_OPTS=--threads=0 git archive --prefix="wireshark-${PROJECT_VERSION}/" "$COMMIT" | xz $XZ_OPTS > "$TARBALL"
Text
wireshark/packaging/wix/CMakeLists.txt
# CMakeLists.txt # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later # # We should use CPack to help generate a .msi using WIX. set(WIX_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/DependentComponents.wxs ${CMAKE_CURRENT_BINARY_DIR}/Diameter.wxs ${CMAKE_CURRENT_BINARY_DIR}/QtDependentComponents.wxs ${CMAKE_CURRENT_BINARY_DIR}/QtTranslation.wxs ${CMAKE_CURRENT_BINARY_DIR}/RadiusDict.wxs ${CMAKE_CURRENT_BINARY_DIR}/SNMPMibs.wxs ${CMAKE_CURRENT_BINARY_DIR}/UsersGuide.wxs ) set(WIX_GENERATED_FILES ${WIX_GENERATED_FILES} PARENT_SCOPE) set(WIX_SOURCE_FILES ${CMAKE_SOURCE_DIR}/packaging/wix/Wireshark.wxs ${CMAKE_SOURCE_DIR}/packaging/wix/WiresharkOptionsDlg.wxs ${CMAKE_SOURCE_DIR}/packaging/wix/WiresharkWixUI.wxs ${WIX_GENERATED_FILES} ) set(WIX_SOURCE_FILES ${WIX_SOURCE_FILES} PARENT_SCOPE) set(WIX_FILES ComponentGroups.wxi COPYING.rtf DirectoryStructure.wxi Features.wxi InputPaths.wxi Plugins.wxi Prerequisites.wxi UserInterface.wxi ${WIX_SOURCE_FILES} PARENT_SCOPE ) set(WIX_OUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/DependentComponents.wixobj ${CMAKE_CURRENT_BINARY_DIR}/Diameter.wixobj ${CMAKE_CURRENT_BINARY_DIR}/QtDependentComponents.wixobj ${CMAKE_CURRENT_BINARY_DIR}/QtTranslation.wixobj ${CMAKE_CURRENT_BINARY_DIR}/RadiusDict.wixobj ${CMAKE_CURRENT_BINARY_DIR}/SNMPMibs.wixobj ${CMAKE_CURRENT_BINARY_DIR}/UsersGuide.wixobj ${CMAKE_CURRENT_BINARY_DIR}/Wireshark.wixobj ${CMAKE_CURRENT_BINARY_DIR}/WiresharkOptionsDlg.wixobj ${CMAKE_CURRENT_BINARY_DIR}/WiresharkWixUI.wixobj ) set(WIX_OUT_FILES ${WIX_OUT_FILES} PARENT_SCOPE) # Variables required for Wireshark.wxs set(PROGRAM_NAME ${CMAKE_PROJECT_NAME}) file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}" TOP_SRC_DIR) # STAGING_DIR depends on the build configuration so we pass it # on the command line below. file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/docbook" DOCBOOK_DIR) # To do: # - Sync the various version names between CMake and Wix. # - Set CMakeLists.txt version strings in tools/make-version.py # - Add a VERSION_EXTRA cmake option set (VERSION "${PROJECT_VERSION}") set(PRODUCT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}.${PROJECT_BUILD_VERSION}) # Use the merge module that comes with our version of Visual Studio if(MSVC_VERSION GREATER_EQUAL 1930) set (MSVC_CRT_VERSION "VC143") elseif(MSVC_VERSION GREATER_EQUAL 1920) set (MSVC_CRT_VERSION "VC142") elseif(MSVC_VERSION GREATER_EQUAL 1910) set (MSVC_CRT_VERSION "VC141") elseif(MSVC_VERSION GREATER_EQUAL 1900) set (MSVC_CRT_VERSION "VC140") endif() # Starting with Visual Studio 2019 merge modules are deprecated but # are available as an individual component. # https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes#-deprecations set(MERGE_MODULE "Microsoft_${MSVC_CRT_VERSION}_CRT_${WIRESHARK_TARGET_PLATFORM}.msm") set (PF86_ENV "ProgramFiles(x86)") set(VC_TOOLS_MERGE_MODULES_DIR) if (DEFINED ENV{VCToolsRedistDir}) set(VC_TOOLS_MERGE_MODULES_DIR "$ENV{VCToolsRedistDir}/MergeModules") endif() find_path(MERGE_MODULE_DIR ${MERGE_MODULE} PATHS #"$ENV{VCINSTALLDIR}/VC/Redist/MSVC/how-do-we-get-this-version/Merge Modules" ${VC_TOOLS_MERGE_MODULES_DIR} "$ENV{${PF86_ENV}}/Common Files/Merge Modules" "$ENV{PROGRAMFILES}/Common Files/Merge Modules" NO_DEFAULT_PATH ) file(TO_NATIVE_PATH "${MERGE_MODULE_DIR}/Microsoft_${MSVC_CRT_VERSION}_CRT_${WIRESHARK_TARGET_PLATFORM}.msm" MSM_NATIVE_PATH) message(STATUS "Using ${MSM_NATIVE_PATH} for the WiX installer") # DependentComponents.wxi. Can be created at configure time. set(_all_manifest_wix "${CMAKE_CURRENT_BINARY_DIR}/DependentComponents.wxs") file(WRITE "${_all_manifest_wix}" "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n") file(APPEND "${_all_manifest_wix}" "<Wix xmlns=\"http://schemas.microsoft.com/wix/2006/wi\">\n\n") file(APPEND "${_all_manifest_wix}" " <!-- Files required for all sections. Generated by CMake. -->\n") file(APPEND "${_all_manifest_wix}" "<?include InputPaths.wxi ?>\n") file(APPEND "${_all_manifest_wix}" " <Fragment>\n") file(APPEND "${_all_manifest_wix}" " <DirectoryRef Id=\"INSTALLFOLDER\">\n") file(APPEND "${_all_manifest_wix}" " <?ifdef BUNDLE_DEBUG_DLLS ?>\n") foreach(_dll ${GLIB2_DLLS_DEBUG}) STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_dll}\"/>\n") file(APPEND "${_all_manifest_wix}" " </Component>\n") endforeach() file(APPEND "${_all_manifest_wix}" " <?else?>\n") foreach(_dll ${GLIB2_DLLS_RELEASE}) STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_dll}\"/>\n") file(APPEND "${_all_manifest_wix}" " </Component>\n") endforeach() file(APPEND "${_all_manifest_wix}" " <?endif?>\n") SET(unique_component "") foreach(_dll ${CARES_DLL} ${PCRE2_DLL} ${GCRYPT_DLLS} ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLLS} ${LUA_DLL} ${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL} ${ZLIB_DLL} ${BROTLI_DLLS} ${ZSTD_DLL} ${ILBC_DLL} ${OPUS_DLL} ${SPEEXDSP_DLL} # Required for mmdbresolve ${MAXMINDDB_DLL} ) #ensure uniqueness of files IF(NOT "${unique_component}" MATCHES "(^|;)${_dll}(;|$)") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_dll}\"/>\n") file(APPEND "${_all_manifest_wix}" " </Component>\n") SET(unique_component ${unique_component} ${_dll}) ENDIF(NOT "${unique_component}" MATCHES "(^|;)${_dll}(;|$)") endforeach() foreach(_script "init.lua" "browser_sslkeylog.lua") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_script}) file(APPEND "${_all_manifest_wix}" " <Component Id=\"cmp${_wix_name}\" Guid=\"*\">\n") file(APPEND "${_all_manifest_wix}" " <File Id=\"fil${_wix_name}\" KeyPath=\"yes\" Source=\"$(var.Staging.Dir)\\${_script}\"/>\n") file(APPEND "${_all_manifest_wix}" " </Component>\n") endforeach() file(APPEND "${_all_manifest_wix}" " </DirectoryRef>\n") file(APPEND "${_all_manifest_wix}" " </Fragment>\n") file(APPEND "${_all_manifest_wix}" " <Fragment>\n") file(APPEND "${_all_manifest_wix}" " <ComponentGroup Id=\"CG.RequiredDependencies\">\n") file(APPEND "${_all_manifest_wix}" " <?ifdef BUNDLE_DEBUG_DLLS ?>\n") foreach(_dll ${GLIB2_DLLS_DEBUG}) STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") endforeach() file(APPEND "${_all_manifest_wix}" " <?else?>\n") foreach(_dll ${GLIB2_DLLS_RELEASE}) STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") endforeach() file(APPEND "${_all_manifest_wix}" " <?endif?>\n") SET(unique_file "") foreach(_dll ${CARES_DLL} ${PCRE2_DLL} ${GCRYPT_DLLS} ${GNUTLS_DLLS} ${KERBEROS_DLLS} ${LIBSSH_DLLS} ${LUA_DLL} ${LZ4_DLL} ${NGHTTP2_DLL} ${SBC_DLL} ${SMI_DLL} ${SNAPPY_DLL} ${SPANDSP_DLL} ${BCG729_DLL} ${LIBXML2_DLLS} ${WINSPARKLE_DLL} ${ZLIB_DLL} ${BROTLI_DLLS} ${ZSTD_DLL} ${ILBC_DLL} ${OPUS_DLL} ${SPEEXDSP_DLL} # mmdbresolve ${MAXMINDDB_DLL} ) #ensure uniqueness of files IF(NOT "${unique_file}" MATCHES "(^|;)${_dll}(;|$)") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_dll}) file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") SET(unique_file ${unique_file} ${_dll}) ENDIF(NOT "${unique_file}" MATCHES "(^|;)${_dll}(;|$)") endforeach() foreach(_script "init.lua" "browser_sslkeylog.lua") STRING(REGEX REPLACE "[-|\\.]" "_" _wix_name ${_script}) file(APPEND "${_all_manifest_wix}" " <ComponentRef Id=\"cmp${_wix_name}\" />\n") endforeach() file(APPEND "${_all_manifest_wix}" " </ComponentGroup>\n") file(APPEND "${_all_manifest_wix}" " </Fragment>\n") file(APPEND "${_all_manifest_wix}" "\n</Wix>\n") if(SMI_DIR) set(d_smi_dir "-dSMI_DIR") endif() if (MAXMINDDB_FOUND) set(d_mmdbresolve_exe "-dMMDBRESOLVE_EXE") endif() set(WIX_CANDLE_DEFINES -v -sw1076 -dPlatform=${WIRESHARK_TARGET_PLATFORM} -dWiresharkName=${CMAKE_PROJECT_NAME} -dWiresharkVersion=${PRODUCT_VERSION} -dWiresharkMajorVersion=${PROJECT_MAJOR_VERSION} -dWiresharkMinorVersion=${PROJECT_MINOR_VERSION} -dAssetDir=${CMAKE_SOURCE_DIR}/packaging/wix -dBuildOutputDir=${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR} -dDiameterDir=${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/diameter -dIconDir=${CMAKE_SOURCE_DIR}/resources/icons -dQtTranslationDir=${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/translations -dRadiusDictDir=${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/radius -dSnmpMibDir=${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/snmp/mibs -dUsersGuideDir=${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/docbook/wsug_html_chunked -dVCRedistVersion=${MSVC_CRT_VERSION} -dVCRedistDir=${MERGE_MODULE_DIR} ${d_smi_dir} ${d_mmdbresolve_exe} -arch ${WIRESHARK_TARGET_PLATFORM} -ext WixUIExtension -I${CMAKE_SOURCE_DIR}/packaging/wix -out ${CMAKE_CURRENT_BINARY_DIR}/ PARENT_SCOPE ) # The NSIS CMakeFile sets the program name + version slightly differently. set(WIX_LIGHT_DEFINES -v -out ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-${WIRESHARK_TARGET_PLATFORM}.msi -sw1076 -ext WixUIExtension -loc ${CMAKE_CURRENT_SOURCE_DIR}/StringOverrides.wxl PARENT_SCOPE ) set(WIX_HEAT_FLAGS -v -ag -nologo -srd -sreg PARENT_SCOPE ) macro( ADD_WIX_PACKAGE_TARGET ) # # XXX - if we're not building Wireshark, we can't build # QtDependentComponents.wxs.. On the other hand, if we're # not building Wireshark, we have no need to include Qt # in the installer, so it's not clear we need that file. # # This should probably be fixed, so that people can produce # command-line-only installer packages. if(BUILD_wireshark) set (_wix_source_dir ${CMAKE_SOURCE_DIR}/packaging/wix ) set (_wix_binary_dir ${CMAKE_BINARY_DIR}/packaging/wix ) # QtDependentComponents.wxs. Created using Wireshark.exe. add_custom_command(OUTPUT ${_wix_binary_dir}/QtDependentComponents.wxs COMMAND set "PATH=${QT_BIN_PATH};%PATH%" COMMAND ${POWERSHELL_COMMAND} "${_wix_source_dir}/windeployqt-to-wix.ps1" -Executable $<TARGET_FILE:wireshark> -FilePath ${_wix_binary_dir}/QtDependentComponents.wxs DEPENDS "${_wix_source_dir}/windeployqt-to-wix.ps1" ) # UsersGuide.wxs. Collects the contents of wsug_html_chunked. # Generated with heat.exe add_custom_command(OUTPUT ${_wix_binary_dir}/UsersGuide.wxs COMMAND ${WIX_HEAT_EXECUTABLE} dir ${CMAKE_BINARY_DIR}/docbook/wsug_html_chunked ${WIX_HEAT_FLAGS} -cg CG.Documentation -dr dirUsersGuide -var var.UsersGuideDir -out ${_wix_binary_dir}/UsersGuide.wxs ) # SNMPMibs.wxs. Collects all MIBs in "output" snmp/mibs # directory. Generated with heat.exe add_custom_command(OUTPUT ${_wix_binary_dir}/SNMPMibs.wxs COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/snmp/mibs ${WIX_HEAT_FLAGS} -cg CG.Plugins.SNMP -dr dirSnmpMibs -var var.SnmpMibDir -out ${_wix_binary_dir}/SNMPMibs.wxs ) # RadiusDict.wxs. Collects all Radius dictionary files in # "output" radius directory. Generated with heat.exe add_custom_command(OUTPUT ${_wix_binary_dir}/RadiusDict.wxs COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/radius ${WIX_HEAT_FLAGS} -cg CG.RadiusDict -dr dirRadius -var var.RadiusDictDir -out ${_wix_binary_dir}/RadiusDict.wxs ) # Diameter.wxs. Collects all Diameter XML dictionary files # in "output" diameter directory. Generated with heat.exe add_custom_command(OUTPUT ${_wix_binary_dir}/Diameter.wxs COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/diameter ${WIX_HEAT_FLAGS} -cg CG.Diameter -dr dirDiameter -var var.DiameterDir -out ${_wix_binary_dir}/Diameter.wxs ) # QtTranslation.wxs. Collects all Qt translation files in # "output" translations directory. Generated with heat.exe add_custom_command(OUTPUT ${_wix_binary_dir}/QtTranslation.wxs COMMAND ${WIX_HEAT_EXECUTABLE} dir ${ARCHIVE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/translations ${WIX_HEAT_FLAGS} -cg CG.QtTranslations -dr dirTranslations -var var.QtTranslationDir -out ${_wix_binary_dir}/QtTranslation.wxs ) # Build WiX package dependencies. We build the package in # two stages so that wireshark_wix below doesn't trigger any # dependencies that might clobber any signed executables. # XXX Rename this to wireshark_wix_prep add_custom_target(wireshark_wix_prep DEPENDS ${WIX_FILES} copy_data_files user_guide_html faq_html ) set_target_properties(wireshark_wix_prep PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) # Dump the installer into # ${CMAKE_CURRENT_SOURCE_DIR}/packaging/wix # Note that executables and DLLs *must* be built separately # XXX Rename this to wireshark_wix add_custom_target(wireshark_wix COMMAND ${WIX_CANDLE_EXECUTABLE} ${WIX_CANDLE_DEFINES} $<$<CONFIG:Debug>:-dBUNDLE_DEBUG_DLLS> ${WIX_SOURCE_FILES} WORKING_DIRECTORY ${_wix_source_dir} COMMAND ${WIX_LIGHT_EXECUTABLE} ${WIX_LIGHT_DEFINES} ${WIX_OUT_FILES} WORKING_DIRECTORY ${_wix_binary_dir} ) set_target_properties(wireshark_wix PROPERTIES FOLDER "Packaging" EXCLUDE_FROM_DEFAULT_BUILD True ) else() message(WARNING "The WiX installer cannot be built if the Wireshark program isn't built.") endif() endmacro( ADD_WIX_PACKAGE_TARGET ) set(CLEAN_FILES DependentComponents.wxs QtDependentComponents.wxs UsersGuide.wxs SNMPMibs.wxs RadiusDict.wxs Diameter.wxs QtTranslation.wxs #NEWS.txt #user-guide.chm wireshark-${VERSION}-${WIRESHARK_TARGET_PLATFORM}.msi )
wireshark/packaging/wix/ComponentGroups.wxi
<?xml version="1.0" encoding="utf-8"?> <Include> <!-- Wireshark --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpWireshark_exe" Guid="*"> <File Id="filWireshark_exe" KeyPath="yes" Source="$(var.WiresharkQt.Dir)\Wireshark.exe" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Wireshark"> <ComponentRef Id="cmpWireshark_exe" /> </ComponentGroup> </Fragment> <!-- Install for every user --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpWiretap_dll" Guid="*"> <File Id="filWiretap_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwiretap.dll" /> </Component> <Component Id="cmpLibwireshark_dll" Guid="*"> <File Id="filLibwireshark_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwireshark.dll" /> </Component> <Component Id="cmpLibwsutil_dll" Guid="*"> <File Id="filLibwsutil_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwsutil.dll" /> </Component> <Component Id="cmpCOPYING_txt" Guid="*"> <File Id="filCOPYING_txt" KeyPath="yes" Source="$(var.Staging.Dir)\COPYING.txt" /> </Component> <Component Id="cmpNEWS_txt" Guid="*"> <File Id="filNEWS_txt" KeyPath="yes" Source="$(var.Staging.Dir)\NEWS.txt" /> </Component> <Component Id="cmpREADME_txt" Guid="*"> <File Id="filREADME_txt" KeyPath="yes" Source="$(var.Staging.Dir)\README.txt" /> </Component> <Component Id="cmpREADME_windows_txt" Guid="*"> <File Id="filREADME_windows_txt" KeyPath="yes" Source="$(var.Staging.Dir)\README.windows.txt" /> </Component> <Component Id="cmpWka" Guid="*"> <File Id="filWka" KeyPath="yes" Source="$(var.Staging.Dir)\wka" /> </Component> <Component Id="cmpPdml2html_xsl" Guid="*"> <File Id="filPdml2html_xsl" KeyPath="yes" Source="$(var.Staging.Dir)\pdml2html.xsl" /> </Component> <Component Id="cmpWs_css" Guid="*"> <File Id="filWs_css" KeyPath="yes" Source="$(var.Staging.Dir)\ws.css" /> </Component> <Component Id="cmpWireshark_html" Guid="*"> <File Id="filWireshark_html" KeyPath="yes" Source="$(var.Staging.Dir)\wireshark.html" /> </Component> <Component Id="cmpWireshark_filter_html" Guid="*"> <File Id="filWireshark_filter_html" KeyPath="yes" Source="$(var.Staging.Dir)\wireshark-filter.html" /> </Component> <Component Id="cmpDumpcap_exe" Guid="*"> <File Id="filDumpcap_exe" KeyPath="yes" Source="$(var.Staging.Dir)\dumpcap.exe" /> </Component> <Component Id="cmpDumpcap_html" Guid="*"> <File Id="filDumpcap_html" KeyPath="yes" Source="$(var.Staging.Dir)\dumpcap.html" /> </Component> <Component Id="cmpExtcap_html" Guid="*"> <File Id="filExtcap_html" KeyPath="yes" Source="$(var.Staging.Dir)\extcap.html" /> </Component> <Component Id="cmpIpmap_html" Guid="*"> <File Id="filIpmap_html" KeyPath="yes" Source="$(var.Staging.Dir)\ipmap.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.WiresharkRequired"> <ComponentRef Id="cmpWiretap_dll" /> <ComponentRef Id="cmpLibwireshark_dll" /> <ComponentRef Id="cmpLibwsutil_dll" /> <ComponentRef Id="cmpCOPYING_txt" /> <ComponentRef Id="cmpNEWS_txt" /> <ComponentRef Id="cmpREADME_txt" /> <ComponentRef Id="cmpREADME_windows_txt" /> <ComponentRef Id="cmpWka" /> <ComponentRef Id="cmpPdml2html_xsl" /> <ComponentRef Id="cmpWs_css" /> <ComponentRef Id="cmpWireshark_html" /> <ComponentRef Id="cmpWireshark_filter_html" /> <ComponentRef Id="cmpDumpcap_exe" /> <ComponentRef Id="cmpDumpcap_html" /> <ComponentRef Id="cmpExtcap_html" /> <ComponentRef Id="cmpIpmap_html" /> </ComponentGroup> </Fragment> <!-- global config files By design these shouldn't be overwritten if they already exist --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpCfilters" Guid="*"> <File Id="filCfilters" KeyPath="yes" Source="$(var.Staging.Dir)\cfilters" /> </Component> <Component Id="cmpColorfilters" Guid="*"> <File Id="filColorfilters" KeyPath="yes" Source="$(var.Staging.Dir)\colorfilters" /> </Component> <Component Id="cmpDfilters" Guid="*"> <File Id="filDfilters" KeyPath="yes" Source="$(var.Staging.Dir)\dfilters" /> </Component> <Component Id="cmpSmi_modules" Guid="*"> <File Id="filSmi_modules" KeyPath="yes" Source="$(var.Staging.Dir)\smi_modules" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.ColorFilters"> <ComponentRef Id="cmpCfilters" /> <ComponentRef Id="cmpColorfilters" /> <ComponentRef Id="cmpDfilters" /> <ComponentRef Id="cmpSmi_modules" /> </ComponentGroup> </Fragment> <!-- dtds --> <Fragment> <DirectoryRef Id="dirDtds"> <Component Id="cmpDc_dtd" Guid="*"> <File Id="filDc_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\dc.dtd" /> </Component> <Component Id="cmpItunes_dtd" Guid="*"> <File Id="filItunes_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\itunes.dtd" /> </Component> <Component Id="cmpMscml_dtd" Guid="*"> <File Id="filMscml_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\mscml.dtd" /> </Component> <Component Id="cmpPocsettings_dtd" Guid="*"> <File Id="filPocsettings_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\pocsettings.dtd" /> </Component> <Component Id="cmpPresence_dtd" Guid="*"> <File Id="filPresence_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\presence.dtd" /> </Component> <Component Id="cmpReginfo_dtd" Guid="*"> <File Id="filReginfo_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\reginfo.dtd" /> </Component> <Component Id="cmpRlmi_dtd" Guid="*"> <File Id="filRlmi_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\rlmi.dtd" /> </Component> <Component Id="cmpRss_dtd" Guid="*"> <File Id="filRss_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\rss.dtd" /> </Component> <Component Id="cmpSmil_dtd" Guid="*"> <File Id="filSmil_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\smil.dtd" /> </Component> <Component Id="cmpXcap_caps_dtd" Guid="*"> <File Id="filXcap_caps_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\xcap-caps.dtd" /> </Component> <Component Id="cmpXcap_error_dtd" Guid="*"> <File Id="filXcap_error_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\xcap-error.dtd" /> </Component> <Component Id="cmpWatcherinfo_dtd" Guid="*"> <File Id="filWatcherinfo_dtd" KeyPath="yes" Source="$(var.Dtds.Dir)\watcherinfo.dtd" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Dtds"> <ComponentRef Id="cmpDc_dtd" /> <ComponentRef Id="cmpItunes_dtd" /> <ComponentRef Id="cmpMscml_dtd" /> <ComponentRef Id="cmpPocsettings_dtd" /> <ComponentRef Id="cmpPresence_dtd" /> <ComponentRef Id="cmpReginfo_dtd" /> <ComponentRef Id="cmpRlmi_dtd" /> <ComponentRef Id="cmpRss_dtd" /> <ComponentRef Id="cmpSmil_dtd" /> <ComponentRef Id="cmpXcap_caps_dtd" /> <ComponentRef Id="cmpXcap_error_dtd" /> <ComponentRef Id="cmpWatcherinfo_dtd" /> </ComponentGroup> </Fragment> <!-- TPNCP DAT file --> <Fragment> <DirectoryRef Id="dirTpncp"> <Component Id="cmpTpncp_dat" Guid="*"> <File Id="filTpncp_dat" KeyPath="yes" Source="$(var.Tpncp.Dir)\tpncp.dat" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tpncp"> <ComponentRef Id="cmpTpncp_dat" /> </ComponentGroup> </Fragment> <!-- wimaxasncp TLV definitions --> <Fragment> <DirectoryRef Id="dirWimaxasncp"> <Component Id="cmpWimaxasncp_dictionary_xml" Guid="*"> <File Id="filWimaxasncp_dictionary_xml" KeyPath="yes" Source="$(var.Wimaxasncp.Dir)\dictionary.xml" /> </Component> <Component Id="cmpWimaxasncp_dictionary_dtd" Guid="*"> <File Id="filWimaxasncp_dictionary_dtd" KeyPath="yes" Source="$(var.Wimaxasncp.Dir)\dictionary.dtd" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Wimaxasncp"> <ComponentRef Id="cmpWimaxasncp_dictionary_xml" /> <ComponentRef Id="cmpWimaxasncp_dictionary_dtd" /> </ComponentGroup> </Fragment> <!-- protobuf TLV definitions --> <Fragment> <DirectoryRef Id="dirProtobuf"> <Component Id="cmpProtobuf_sparkplug_b_proto" Guid="*"> <File Id="filProtobuf_sparkplug_b_proto" KeyPath="yes" Source="$(var.Protobuf.Dir)\sparkplug_b.proto" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Protobuf"> <ComponentRef Id="cmpProtobuf_sparkplug_b_proto" /> </ComponentGroup> </Fragment> <!-- TShark --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpTShark_exe" Guid="*"> <File Id="filTShark_exe" KeyPath="yes" Source="$(var.Staging.Dir)\tshark.exe" /> </Component> <Component Id="cmpTShark_html" Guid="*"> <File Id="filTShark_html" KeyPath="yes" Source="$(var.Staging.Dir)\tshark.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.TShark"> <ComponentRef Id="cmpTShark_exe" /> <ComponentRef Id="cmpTShark_html" /> </ComponentGroup> </Fragment> <!-- Configuration Profiles --> <Fragment> <DirectoryRef Id="dirProfiles"> <Directory Id="dirBluetooth" Name="Bluetooth"> <Component Id="cmpBluetooth_colorfilters" Guid="*"> <File Id="filBluetooth_colorfilters" KeyPath="yes" Source="$(var.Profiles.Dir)\Bluetooth\colorfilters" /> </Component> <Component Id="cmpBluetooth_preferences" Guid="*"> <File Id="filBluetooth_preferences" KeyPath="yes" Source="$(var.Profiles.Dir)\Bluetooth\preferences" /> </Component> </Directory> <Directory Id="dirClassic" Name="Classic"> <Component Id="cmpClassic_colorfilters" Guid="*"> <File Id="filClassic_colorfilters" KeyPath="yes" Source="$(var.Profiles.Dir)\Classic\colorfilters" /> </Component> </Directory> <Directory Id="dirNoReassembly" Name="No Reassembly"> <Component Id="cmpNoReassembly_preferences" Guid="*"> <File Id="filNoReassembly_preferences" KeyPath="yes" Source="$(var.Profiles.Dir)\No Reassembly\preferences" /> </Component> </Directory> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Plugins.ConfigurationProfiles"> <ComponentRef Id="cmpBluetooth_colorfilters" /> <ComponentRef Id="cmpBluetooth_preferences" /> <ComponentRef Id="cmpClassic_colorfilters" /> <ComponentRef Id="cmpNoReassembly_preferences" /> </ComponentGroup> </Fragment> <!-- Editcap --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpEditcap_exe" Guid="*"> <File Id="filEditcap_exe" KeyPath="yes" Source="$(var.Staging.Dir)\editcap.exe" /> </Component> <Component Id="cmpEditcap_html" Guid="*"> <File Id="filEditcap_html" KeyPath="yes" Source="$(var.Staging.Dir)\editcap.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Editcap"> <ComponentRef Id="cmpEditcap_exe" /> <ComponentRef Id="cmpEditcap_html" /> </ComponentGroup> </Fragment> <!-- Text2Pcap --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpText2pcap_exe" Guid="*"> <File Id="filText2pcap_exe" KeyPath="yes" Source="$(var.Staging.Dir)\text2pcap.exe" /> </Component> <Component Id="cmpText2pcap_html" Guid="*"> <File Id="filText2pcap_html" KeyPath="yes" Source="$(var.Staging.Dir)\text2pcap.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Text2Pcap"> <ComponentRef Id="cmpText2pcap_exe" /> <ComponentRef Id="cmpText2pcap_html" /> </ComponentGroup> </Fragment> <!-- Mergecap --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpMergecap_exe" Guid="*"> <File Id="filMergecap_exe" KeyPath="yes" Source="$(var.Staging.Dir)\mergecap.exe" /> </Component> <Component Id="cmpMergecap_html" Guid="*"> <File Id="filMergecap_html" KeyPath="yes" Source="$(var.Staging.Dir)\mergecap.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Mergecap"> <ComponentRef Id="cmpMergecap_exe" /> <ComponentRef Id="cmpMergecap_html" /> </ComponentGroup> </Fragment> <!-- Reordercap --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpReordercap_exe" Guid="*"> <File Id="filReordercap_exe" KeyPath="yes" Source="$(var.Staging.Dir)\reordercap.exe" /> </Component> <Component Id="cmpReordercap_html" Guid="*"> <File Id="filReordercap_html" KeyPath="yes" Source="$(var.Staging.Dir)\reordercap.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Reordercap"> <ComponentRef Id="cmpReordercap_exe" /> <ComponentRef Id="cmpReordercap_html" /> </ComponentGroup> </Fragment> <!-- Capinfos --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpCapinfos_exe" Guid="*"> <File Id="filCapinfos_exe" KeyPath="yes" Source="$(var.Staging.Dir)\capinfos.exe" /> </Component> <Component Id="cmpCapinfos_html" Guid="*"> <File Id="filCapinfos_html" KeyPath="yes" Source="$(var.Staging.Dir)\capinfos.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Capinfos"> <ComponentRef Id="cmpCapinfos_exe" /> <ComponentRef Id="cmpCapinfos_html" /> </ComponentGroup> </Fragment> <!-- Captype --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpCaptype_exe" Guid="*"> <File Id="filCaptype_exe" KeyPath="yes" Source="$(var.Staging.Dir)\captype.exe" /> </Component> <Component Id="cmpCaptype_html" Guid="*"> <File Id="filCaptype_html" KeyPath="yes" Source="$(var.Staging.Dir)\captype.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Captype"> <ComponentRef Id="cmpCaptype_exe" /> <ComponentRef Id="cmpCaptype_html" /> </ComponentGroup> </Fragment> <!-- Rawshark --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpRawshark_exe" Guid="*"> <File Id="filRawshark_exe" KeyPath="yes" Source="$(var.Staging.Dir)\rawshark.exe" /> </Component> <Component Id="cmpRawshark_html" Guid="*"> <File Id="filRawshark_html" KeyPath="yes" Source="$(var.Staging.Dir)\rawshark.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Rawshark"> <ComponentRef Id="cmpRawshark_exe" /> <ComponentRef Id="cmpRawshark_html" /> </ComponentGroup> </Fragment> <!-- Randpkt --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpRandpkt_exe" Guid="*"> <File Id="filRandpkt_exe" KeyPath="yes" Source="$(var.Staging.Dir)\randpkt.exe" /> </Component> <Component Id="cmpRandpkt_html" Guid="*"> <File Id="filRandpkt_html" KeyPath="yes" Source="$(var.Staging.Dir)\randpkt.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Randpkt"> <ComponentRef Id="cmpRandpkt_exe" /> <ComponentRef Id="cmpRandpkt_html" /> </ComponentGroup> </Fragment> <!-- MMDBResolve --> <?ifdef MMDBRESOLVE_EXE?> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpMmdbresolve_exe" Guid="*"> <File Id="filMmdbresolve_exe" KeyPath="yes" Source="$(var.Staging.Dir)\mmdbresolve.exe" /> </Component> <Component Id="cmpMmdbresolve_html" Guid="*"> <File Id="filMmdbresolve_html" KeyPath="yes" Source="$(var.Staging.Dir)\mmdbresolve.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.MMDBResolve"> <ComponentRef Id="cmpMmdbresolve_exe" /> <ComponentRef Id="cmpMmdbresolve_html" /> </ComponentGroup> </Fragment> <?endif?> <!-- Androiddump --> <Fragment> <DirectoryRef Id="dirExtcap"> <Component Id="cmpAndroiddump_exe" Guid="*"> <File Id="filAndroiddump_exe" KeyPath="yes" Source="$(var.Extcap.Dir)\androiddump.exe" /> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpAndroiddump_html" Guid="*"> <File Id="filAndroiddump_html" KeyPath="yes" Source="$(var.Staging.Dir)\androiddump.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Androiddump"> <ComponentRef Id="cmpAndroiddump_exe" /> <ComponentRef Id="cmpAndroiddump_html" /> </ComponentGroup> </Fragment> <!-- Randpktdump --> <Fragment> <DirectoryRef Id="dirExtcap"> <Component Id="cmpRandpktdump_exe" Guid="*"> <File Id="filRandpktdump_exe" KeyPath="yes" Source="$(var.Extcap.Dir)\randpktdump.exe" /> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpRandpktdump_html" Guid="*"> <File Id="filRandpktdump_html" KeyPath="yes" Source="$(var.Staging.Dir)\randpktdump.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Randpktdump"> <ComponentRef Id="cmpRandpktdump_exe" /> <ComponentRef Id="cmpRandpktdump_html" /> </ComponentGroup> </Fragment> <!-- Etwdump --> <Fragment> <DirectoryRef Id="dirExtcap"> <Component Id="cmpEtwdump_exe" Guid="*"> <File Id="filEtwdump_exe" KeyPath="yes" Source="$(var.Extcap.Dir)\etwdump.exe" /> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpEtwdump_html" Guid="*"> <File Id="filEtwdump_html" KeyPath="yes" Source="$(var.Staging.Dir)\etwdump.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Etwdump"> <ComponentRef Id="cmpEtwdump_exe" /> <ComponentRef Id="cmpEtwdump_html" /> </ComponentGroup> </Fragment> <!-- Sshdump --> <Fragment> <DirectoryRef Id="dirExtcap"> <Component Id="cmpSshdump_exe" Guid="*"> <File Id="filSshdump_exe" KeyPath="yes" Source="$(var.Extcap.Dir)\sshdump.exe" /> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpSshdump_html" Guid="*"> <File Id="filSshdump_html" KeyPath="yes" Source="$(var.Staging.Dir)\sshdump.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Sshdump"> <ComponentRef Id="cmpSshdump_exe" /> <ComponentRef Id="cmpSshdump_html" /> </ComponentGroup> </Fragment> <!-- Ciscodump --> <Fragment> <DirectoryRef Id="dirExtcap"> <Component Id="cmpCiscodump_exe" Guid="*"> <File Id="filCiscodump_exe" KeyPath="yes" Source="$(var.Extcap.Dir)\Ciscodump.exe" /> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpCiscodump_html" Guid="*"> <File Id="filCiscodump_html" KeyPath="yes" Source="$(var.Staging.Dir)\Ciscodump.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Ciscodump"> <ComponentRef Id="cmpCiscodump_exe" /> <ComponentRef Id="cmpCiscodump_html" /> </ComponentGroup> </Fragment> <!-- Wifidump --> <Fragment> <DirectoryRef Id="dirExtcap"> <Component Id="cmpWifidump_exe" Guid="*"> <File Id="filWifidump_exe" KeyPath="yes" Source="$(var.Extcap.Dir)\wifidump.exe" /> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpWifidump_html" Guid="*"> <File Id="filWifidump_html" KeyPath="yes" Source="$(var.Staging.Dir)\wifidump.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Wifidump"> <ComponentRef Id="cmpWifidump_exe" /> <ComponentRef Id="cmpWifidump_html" /> </ComponentGroup> </Fragment> <!-- Udpdump --> <Fragment> <DirectoryRef Id="dirExtcap"> <Component Id="cmpUdpdump_exe" Guid="*"> <File Id="filUdpdump_exe" KeyPath="yes" Source="$(var.Extcap.Dir)\Udpdump.exe" /> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpUdpdump_html" Guid="*"> <File Id="filUdpdump_html" KeyPath="yes" Source="$(var.Staging.Dir)\Udpdump.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Tools.Udpdump"> <ComponentRef Id="cmpUdpdump_exe" /> <ComponentRef Id="cmpUdpdump_html" /> </ComponentGroup> </Fragment> <?ifdef DOCBOOK_DIR?> <!-- User Guide is created by heat --> <!-- FAQ --> <Fragment> <DirectoryRef Id="INSTALLFOLDER"> <Component Id="cmpFAQ_html" Guid="*"> <File Id="filFAQ_html" KeyPath="yes" Source="$(var.DOCBOOK_DIR)\faq.html" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Documentation"> <ComponentRef Id="cmpFAQ_html" /> </ComponentGroup> </Fragment> <?endif?> <!-- Shortcuts --> <Fragment> <ComponentGroup Id="CG.WiresharkStartMenu" Directory="ProgramMenuFolder"> <Component Id="cmpWiresharkShortcut"> <Shortcut Id="scWireshark" Name="$(var.WiresharkName)" Description="The $(var.WiresharkName) Network Protocol Analyzer" Target="[#filWireshark_exe]" WorkingDirectory="INSTALLFOLDER" /> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="StartMenuShortcut" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_START_MENU = "1"</Condition> </Component> </ComponentGroup> <ComponentGroup Id="CG.WiresharkDesktopIcon" Directory="DesktopFolder"> <Component Id="cmpWiresharkDesktopIcon"> <Shortcut Id="scWiresharkDesktop" Name="$(var.WiresharkName)" Description="The $(var.WiresharkName) Network Protocol Analyzer" Target="[#filWireshark_exe]" WorkingDirectory="INSTALLFOLDER" /> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="DesktopIcon" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_DESKTOP_ICON = "1"</Condition> </Component> </ComponentGroup> <ComponentGroup Id="CG.WiresharkQuickLaunchIcon" Directory="QuickLaunchFolder"> <Component Id="cmpWiresharkQuickLaunchIcon"> <Shortcut Id="scWiresharkQuickLaunch" Name="$(var.WiresharkName)" Description="The $(var.WiresharkName) Network Protocol Analyzer" Target="[#filWireshark_exe]" WorkingDirectory="INSTALLFOLDER" /> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="QuickLaunchIcon" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_QUICK_LAUNCH_ICON = "1"</Condition> <!-- Done to keep ICE64 happy --> <RemoveFolder Id="RemoveMicrosoftFolder" Directory="MicrosoftFolder" On="uninstall" /> <RemoveFolder Id="RemoveInternetExplorerFolder" Directory="InternetExplorerFolder" On="uninstall" /> <RemoveFolder Id="RemoveQuickLaunchFolder" Directory="QuickLaunchFolder" On="uninstall" /> </Component> </ComponentGroup> </Fragment> <!-- File Associations --> <Fragment> <ComponentGroup Id="CG.WiresharkFileAssociations" Directory="INSTALLFOLDER"> <Component Id="cmpFA5vw"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="5vw"> <Extension Id="5vw"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="5vw" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAacp"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="acp"> <Extension Id="acp"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="acp" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAapc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="apc"> <Extension Id="apc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="apc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAatc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="atc"> <Extension Id="atc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="atc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAbfr"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="bfr"> <Extension Id="bfr"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="bfr" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAcap"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="cap"> <Extension Id="cap"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="cap" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAenc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="enc"> <Extension Id="enc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="enc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAerf"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="erf"> <Extension Id="erf"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="erf" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAfdc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="fdc"> <Extension Id="fdc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="fdc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAipfix"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="ipfix"> <Extension Id="ipfix"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="ipfix" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAlcap"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="lcap"> <Extension Id="lcap"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="lcap" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAmplog"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="mplog"> <Extension Id="mplog"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="mplog" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAntar"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="ntar"> <Extension Id="ntar"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="ntar" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAout"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="out"> <Extension Id="out"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="out" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFApcap"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="pcap"> <Extension Id="pcap"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="pcap" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFApcapng"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="pcapng"> <Extension Id="pcapng"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="pcapng" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFApklg"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="pklg"> <Extension Id="pklg"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="pklg" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFApkt"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="pkt"> <Extension Id="pkt"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="pkt" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFArf5"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="rf5"> <Extension Id="rf5"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="rf5" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAsnoop"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="snoop"> <Extension Id="snoop"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="snoop" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAsyc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="syc"> <Extension Id="syc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="syc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAtpc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="tpc"> <Extension Id="tpc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="tpc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAtr1"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="tr1"> <Extension Id="tr1"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="tr1" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAtrace"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="trace"> <Extension Id="trace"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="trace" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAtrc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="trc"> <Extension Id="trc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="trc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAvwr"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="vwr"> <Extension Id="vwr"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="vwr" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAwpc"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="wpc"> <Extension Id="wpc"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="wpc" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> <Component Id="cmpFAwpz"> <ProgId Id="$(var.WiresharkFileAssociation)" Description="wpz"> <Extension Id="wpz"> <Verb Id="open" Command="open" TargetFile="filWireshark_exe" Argument="&quot;%1&quot;"/> </Extension> </ProgId> <RegistryValue Root="HKCU" Key="Software\$(var.WiresharkName)" Name="wpz" Type="integer" Value="1" KeyPath="yes"/> <Condition>WIRESHARK_FILE_EXTENSIONS = "1"</Condition> </Component> </ComponentGroup> </Fragment> <!-- C-runtime redistributable --> <Fragment> <DirectoryRef Id="TARGETDIR"> <Merge Id="VCRedist" SourceFile="$(var.VCRedistDir)\Microsoft_$(var.VCRedistVersion)_CRT_$(var.Platform).msm" DiskId="1" Language="0"/> </DirectoryRef> </Fragment> </Include>
wireshark/packaging/wix/COPYING.rtf
{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Calibri;}{\f1\froman\fprq2\fcharset0 Times New Roman;}} {\colortbl ;\red0\green0\blue255;} {\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\nowidctlpar\f0\fs20 This text consists of three parts:\par \par Part I: Some remarks regarding the license given in\par Part II: The actual license that covers Wireshark.\par Part III: Other applicable licenses.\par \par When in doubt: Part II/III is the legally binding part, Part I is just\par there to make it easier for people that are not familiar with the GPLv2.\par \par \par ------------------------------------------------------------------------\par Part I:\par \par Wireshark is distributed under the GNU GPLv2. There are no restrictions\par on its use. There are restrictions on its distribution in source or\par binary form.\par \par Most parts of Wireshark are covered by a "GPL version 2 or later" license.\par Some files are covered by different licenses that are compatible with\par the GPLv2.\par \par As a notable exception, some utilities distributed with the Wireshark source are\par covered by other licenses that are not themselves directly compatible with the\par GPLv2. This is OK, as only the tools themselves are licensed this way, the\par output of the tools is not considered a derived work, and so can be safely\par licensed for Wireshark's use. An incomplete selection of these tools includes:\par - the pidl utility (tools/pidl) is licensed under the GPLv3+.\par \par Parts of Wireshark can be built and distributed as libraries. These\par parts are still covered by the GPL, and NOT by the Lesser General Public\par License or any other license.\par \par If you integrate all or part of Wireshark into your own application, then\par that application must be released under a license compatible with the GPL.\par \par The full text of the GNU GPL and some of the other applicable licenses follows.\par \par ------------------------------------------------------------------------\par Part II:\par \par GNU GENERAL PUBLIC LICENSE\par Version 2, June 1991\par \par Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\par 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\par Everyone is permitted to copy and distribute verbatim copies\par of this license document, but changing it is not allowed.\par \par Preamble\par \par The licenses for most software are designed to take away your\par freedom to share and change it. By contrast, the GNU General Public\par License is intended to guarantee your freedom to share and change free\par software--to make sure the software is free for all its users. This\par General Public License applies to most of the Free Software\par Foundation's software and to any other program whose authors commit to\par using it. (Some other Free Software Foundation software is covered by\par the GNU Lesser General Public License instead.) You can apply it to\par your programs, too.\par \par When we speak of free software, we are referring to freedom, not\par price. Our General Public Licenses are designed to make sure that you\par have the freedom to distribute copies of free software (and charge for\par this service if you wish), that you receive source code or can get it\par if you want it, that you can change the software or use pieces of it\par in new free programs; and that you know you can do these things.\par \par To protect your rights, we need to make restrictions that forbid\par anyone to deny you these rights or to ask you to surrender the rights.\par These restrictions translate to certain responsibilities for you if you\par distribute copies of the software, or if you modify it.\par \par For example, if you distribute copies of such a program, whether\par gratis or for a fee, you must give the recipients all the rights that\par you have. You must make sure that they, too, receive or can get the\par source code. And you must show them these terms so they know their\par rights.\par \par We protect your rights with two steps: (1) copyright the software, and\par (2) offer you this license which gives you legal permission to copy,\par distribute and/or modify the software.\par \par Also, for each author's protection and ours, we want to make certain\par that everyone understands that there is no warranty for this free\par software. If the software is modified by someone else and passed on, we\par want its recipients to know that what they have is not the original, so\par that any problems introduced by others will not reflect on the original\par authors' reputations.\par \par Finally, any free program is threatened constantly by software\par patents. We wish to avoid the danger that redistributors of a free\par program will individually obtain patent licenses, in effect making the\par program proprietary. To prevent this, we have made it clear that any\par patent must be licensed for everyone's free use or not licensed at all.\par \par The precise terms and conditions for copying, distribution and\par modification follow.\par \par GNU GENERAL PUBLIC LICENSE\par TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\par \par 0. This License applies to any program or other work which contains\par a notice placed by the copyright holder saying it may be distributed\par under the terms of this General Public License. The "Program", below,\par refers to any such program or work, and a "work based on the Program"\par means either the Program or any derivative work under copyright law:\par that is to say, a work containing the Program or a portion of it,\par either verbatim or with modifications and/or translated into another\par language. (Hereinafter, translation is included without limitation in\par the term "modification".) Each licensee is addressed as "you".\par \par Activities other than copying, distribution and modification are not\par covered by this License; they are outside its scope. The act of\par running the Program is not restricted, and the output from the Program\par is covered only if its contents constitute a work based on the\par Program (independent of having been made by running the Program).\par Whether that is true depends on what the Program does.\par \par 1. You may copy and distribute verbatim copies of the Program's\par source code as you receive it, in any medium, provided that you\par conspicuously and appropriately publish on each copy an appropriate\par copyright notice and disclaimer of warranty; keep intact all the\par notices that refer to this License and to the absence of any warranty;\par and give any other recipients of the Program a copy of this License\par along with the Program.\par \par You may charge a fee for the physical act of transferring a copy, and\par you may at your option offer warranty protection in exchange for a fee.\par \par 2. You may modify your copy or copies of the Program or any portion\par of it, thus forming a work based on the Program, and copy and\par distribute such modifications or work under the terms of Section 1\par above, provided that you also meet all of these conditions:\par \par a) You must cause the modified files to carry prominent notices\par stating that you changed the files and the date of any change.\par \par b) You must cause any work that you distribute or publish, that in\par whole or in part contains or is derived from the Program or any\par part thereof, to be licensed as a whole at no charge to all third\par parties under the terms of this License.\par \par c) If the modified program normally reads commands interactively\par when run, you must cause it, when started running for such\par interactive use in the most ordinary way, to print or display an\par announcement including an appropriate copyright notice and a\par notice that there is no warranty (or else, saying that you provide\par a warranty) and that users may redistribute the program under\par these conditions, and telling the user how to view a copy of this\par License. (Exception: if the Program itself is interactive but\par does not normally print such an announcement, your work based on\par the Program is not required to print an announcement.)\par \par These requirements apply to the modified work as a whole. If\par identifiable sections of that work are not derived from the Program,\par and can be reasonably considered independent and separate works in\par themselves, then this License, and its terms, do not apply to those\par sections when you distribute them as separate works. But when you\par distribute the same sections as part of a whole which is a work based\par on the Program, the distribution of the whole must be on the terms of\par this License, whose permissions for other licensees extend to the\par entire whole, and thus to each and every part regardless of who wrote it.\par \par Thus, it is not the intent of this section to claim rights or contest\par your rights to work written entirely by you; rather, the intent is to\par exercise the right to control the distribution of derivative or\par collective works based on the Program.\par \par In addition, mere aggregation of another work not based on the Program\par with the Program (or with a work based on the Program) on a volume of\par a storage or distribution medium does not bring the other work under\par the scope of this License.\par \par 3. You may copy and distribute the Program (or a work based on it,\par under Section 2) in object code or executable form under the terms of\par Sections 1 and 2 above provided that you also do one of the following:\par \par a) Accompany it with the complete corresponding machine-readable\par source code, which must be distributed under the terms of Sections\par 1 and 2 above on a medium customarily used for software interchange; or,\par \par b) Accompany it with a written offer, valid for at least three\par years, to give any third party, for a charge no more than your\par cost of physically performing source distribution, a complete\par machine-readable copy of the corresponding source code, to be\par distributed under the terms of Sections 1 and 2 above on a medium\par customarily used for software interchange; or,\par \par c) Accompany it with the information you received as to the offer\par to distribute corresponding source code. (This alternative is\par allowed only for noncommercial distribution and only if you\par received the program in object code or executable form with such\par an offer, in accord with Subsection b above.)\par \par The source code for a work means the preferred form of the work for\par making modifications to it. For an executable work, complete source\par code means all the source code for all modules it contains, plus any\par associated interface definition files, plus the scripts used to\par control compilation and installation of the executable. However, as a\par special exception, the source code distributed need not include\par anything that is normally distributed (in either source or binary\par form) with the major components (compiler, kernel, and so on) of the\par operating system on which the executable runs, unless that component\par itself accompanies the executable.\par \par If distribution of executable or object code is made by offering\par access to copy from a designated place, then offering equivalent\par access to copy the source code from the same place counts as\par distribution of the source code, even though third parties are not\par compelled to copy the source along with the object code.\par \par 4. You may not copy, modify, sublicense, or distribute the Program\par except as expressly provided under this License. Any attempt\par otherwise to copy, modify, sublicense or distribute the Program is\par void, and will automatically terminate your rights under this License.\par However, parties who have received copies, or rights, from you under\par this License will not have their licenses terminated so long as such\par parties remain in full compliance.\par \par 5. You are not required to accept this License, since you have not\par signed it. However, nothing else grants you permission to modify or\par distribute the Program or its derivative works. These actions are\par prohibited by law if you do not accept this License. Therefore, by\par modifying or distributing the Program (or any work based on the\par Program), you indicate your acceptance of this License to do so, and\par all its terms and conditions for copying, distributing or modifying\par the Program or works based on it.\par \par 6. Each time you redistribute the Program (or any work based on the\par Program), the recipient automatically receives a license from the\par original licensor to copy, distribute or modify the Program subject to\par these terms and conditions. You may not impose any further\par restrictions on the recipients' exercise of the rights granted herein.\par You are not responsible for enforcing compliance by third parties to\par this License.\par \par 7. If, as a consequence of a court judgment or allegation of patent\par infringement or for any other reason (not limited to patent issues),\par conditions are imposed on you (whether by court order, agreement or\par otherwise) that contradict the conditions of this License, they do not\par excuse you from the conditions of this License. If you cannot\par distribute so as to satisfy simultaneously your obligations under this\par License and any other pertinent obligations, then as a consequence you\par may not distribute the Program at all. For example, if a patent\par license would not permit royalty-free redistribution of the Program by\par all those who receive copies directly or indirectly through you, then\par the only way you could satisfy both it and this License would be to\par refrain entirely from distribution of the Program.\par \par If any portion of this section is held invalid or unenforceable under\par any particular circumstance, the balance of the section is intended to\par apply and the section as a whole is intended to apply in other\par circumstances.\par \par It is not the purpose of this section to induce you to infringe any\par patents or other property right claims or to contest validity of any\par such claims; this section has the sole purpose of protecting the\par integrity of the free software distribution system, which is\par implemented by public license practices. Many people have made\par generous contributions to the wide range of software distributed\par through that system in reliance on consistent application of that\par system; it is up to the author/donor to decide if he or she is willing\par to distribute software through any other system and a licensee cannot\par impose that choice.\par \par This section is intended to make thoroughly clear what is believed to\par be a consequence of the rest of this License.\par \par 8. If the distribution and/or use of the Program is restricted in\par certain countries either by patents or by copyrighted interfaces, the\par original copyright holder who places the Program under this License\par may add an explicit geographical distribution limitation excluding\par those countries, so that distribution is permitted only in or among\par countries not thus excluded. In such case, this License incorporates\par the limitation as if written in the body of this License.\par \par 9. The Free Software Foundation may publish revised and/or new versions\par of the General Public License from time to time. Such new versions will\par be similar in spirit to the present version, but may differ in detail to\par address new problems or concerns.\par \par Each version is given a distinguishing version number. If the Program\par specifies a version number of this License which applies to it and "any\par later version", you have the option of following the terms and conditions\par either of that version or of any later version published by the Free\par Software Foundation. If the Program does not specify a version number of\par this License, you may choose any version ever published by the Free Software\par Foundation.\par \par 10. If you wish to incorporate parts of the Program into other free\par programs whose distribution conditions are different, write to the author\par to ask for permission. For software which is copyrighted by the Free\par Software Foundation, write to the Free Software Foundation; we sometimes\par make exceptions for this. Our decision will be guided by the two goals\par of preserving the free status of all derivatives of our free software and\par of promoting the sharing and reuse of software generally.\par \par NO WARRANTY\par \par 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\par FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\par OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\par PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\par OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\par MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\par TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\par PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\par REPAIR OR CORRECTION.\par \par 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\par WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\par REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\par INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\par OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\par TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\par YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\par PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\par POSSIBILITY OF SUCH DAMAGES.\par \par END OF TERMS AND CONDITIONS\par \par How to Apply These Terms to Your New Programs\par \par If you develop a new program, and you want it to be of the greatest\par possible use to the public, the best way to achieve this is to make it\par free software which everyone can redistribute and change under these terms.\par \par To do so, attach the following notices to the program. It is safest\par to attach them to the start of each source file to most effectively\par convey the exclusion of warranty; and each file should have at least\par the "copyright" line and a pointer to where the full notice is found.\par \par <one line to give the program's name and a brief idea of what it does.>\par Copyright (C) <year> <name of author>\par \par This program is free software; you can redistribute it and/or modify\par it under the terms of the GNU General Public License as published by\par the Free Software Foundation; either version 2 of the License, or \par (at your option) any later version.\par \par This program is distributed in the hope that it will be useful,\par but WITHOUT ANY WARRANTY; without even the implied warranty of\par MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\par GNU General Public License for more details.\par \par You should have received a copy of the GNU General Public License along\par with this program; if not, write to the Free Software Foundation, Inc.,\par 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\par \par Also add information on how to contact you by electronic and paper mail.\par \par If the program is interactive, make it output a short notice like this\par when it starts in an interactive mode:\par \par Gnomovision version 69, Copyright (C) year name of author\par Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\par This is free software, and you are welcome to redistribute it\par under certain conditions; type `show c' for details.\par \par The hypothetical commands `show w' and `show c' should show the appropriate\par parts of the General Public License. Of course, the commands you use may\par be called something other than `show w' and `show c'; they could even be\par mouse-clicks or menu items--whatever suits your program.\par \par You should also get your employer (if you work as a programmer) or your\par school, if any, to sign a "copyright disclaimer" for the program, if\par necessary. Here is a sample; alter the names:\par \par Yoyodyne, Inc., hereby disclaims all copyright interest in the program\par `Gnomovision' (which makes passes at compilers) written by James Hacker.\par \par <signature of Ty Coon>, 1 April 1989\par Ty Coon, President of Vice\par \par This General Public License does not permit incorporating your program into\par proprietary programs. If your program is a subroutine library, you may\par consider it more useful to permit linking proprietary applications with the\par library. If this is what you want to do, use the GNU Lesser General\par Public License instead of this License.\par \par ------------------------------------------------------------------------\par Part III:\par \par Parts of this software are licensed as follows\par \par Copyright (c) 1988, 1992, 1993\par The Regents of the University of California. All rights reserved.\par \par Redistribution and use in source and binary forms, with or without\par modification, are permitted provided that the following conditions\par are met:\par 1. Redistributions of source code must retain the above copyright\par notice, this list of conditions and the following disclaimer.\par 2. Redistributions in binary form must reproduce the above copyright\par notice, this list of conditions and the following disclaimer in the\par documentation and/or other materials provided with the distribution.\par 3. Neither the name of the University nor the names of its contributors\par may be used to endorse or promote products derived from this software\par without specific prior written permission.\par \par THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\par ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\par IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\par ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\par FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\par DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\par OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\par HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\par LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\par OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\par SUCH DAMAGE.\par \par \par Copyright (c) 2003 Markus Friedl. All rights reserved.\par \par Redistribution and use in source and binary forms, with or without\par modification, are permitted provided that the following conditions\par are met:\par 1. Redistributions of source code must retain the above copyright\par notice, this list of conditions and the following disclaimer.\par 2. Redistributions in binary form must reproduce the above copyright\par notice, this list of conditions and the following disclaimer in the\par documentation and/or other materials provided with the distribution.\par \par THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\par IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\par OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\par IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\par INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\par NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\par DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\par THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\par (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\par THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\par \par \par Copyright (c) 2003 Endace Technology Ltd, Hamilton, New Zealand.\par All rights reserved.\par \par This software and documentation has been developed by Endace Technology Ltd.\par along with the DAG PCI network capture cards. For further information please\par visit {\field{\*\fldinst{HYPERLINK "http://www.endace.com/"}}{\fldrslt{\ul\cf1 http://www.endace.com/}}}\f0\fs20 .\par \par Redistribution and use in source and binary forms, with or without\par modification, are permitted provided that the following conditions are met:\par \par 1. Redistributions of source code must retain the above copyright notice,\par this list of conditions and the following disclaimer.\par \par 2. Redistributions in binary form must reproduce the above copyright\par notice, this list of conditions and the following disclaimer in the\par documentation and/or other materials provided with the distribution.\par \par 3. The name of Endace Technology Ltd may not be used to endorse or promote\par products derived from this software without specific prior written\par permission.\par \par THIS SOFTWARE IS PROVIDED BY ENDACE TECHNOLOGY LTD ``AS IS'' AND ANY EXPRESS\par OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\par OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\par EVENT SHALL ENDACE TECHNOLOGY LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\par SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\par PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\par BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\par IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\par ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\par POSSIBILITY OF SUCH DAMAGE.\par \par \par Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.\par All rights reserved.\par \par Redistribution and use in source and binary forms, with or without\par modification, are permitted provided that the following conditions\par are met:\par 1. Redistributions of source code must retain the above copyright\par notice, this list of conditions and the following disclaimer.\par 2. Redistributions in binary form must reproduce the above copyright\par notice, this list of conditions and the following disclaimer in the\par documentation and/or other materials provided with the distribution.\par 3. Neither the name of the project nor the names of its contributors\par may be used to endorse or promote products derived from this software\par without specific prior written permission.\par \par THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND\par ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\par IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\par ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE\par FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\par DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\par OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\par HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\par LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\par OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\par SUCH DAMAGE.\par \par \par Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.\par \par Redistribution and use in source and binary forms, with or without\par modification, are permitted provided that the following conditions\par are met:\par 1. Redistributions of source code must retain the above copyright\par notice, this list of conditions and the following disclaimer.\par 2. Redistributions in binary form must reproduce the above copyright\par notice, this list of conditions and the following disclaimer in the\par documentation and/or other materials provided with the distribution.\par \par THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\par ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\par IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\par ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\par FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\par DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\par OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\par HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\par LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\par OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\par SUCH DAMAGE.\par \f1\par }
wireshark/packaging/wix/DirectoryStructure.wxi
<?xml version="1.0" encoding="utf-8"?> <Include> <!-- Basic directory structure --> <Fragment> <!-- "Special" directory, required for the root drive --> <Directory Id="TARGETDIR" Name="SourceDir"> <!-- "Special" directory for desktop --> <Directory Id="DesktopFolder" Name="Desktop"/> <!-- "Special" directory, required for the Program Files folder --> <Directory Id="$(var.PlatformProgramFilesFolder)"> <!-- These directories follow the typical hierarchical structure --> <Directory Id="INSTALLFOLDER" Name="$(var.WiresharkName)"> <Directory Id="dirDtds" Name="dtds"/> <Directory Id="dirDiameter" Name="diameter"/> <Directory Id="dirExtcap" Name="extcap"/> <Directory Id="dirHelp" Name="help"/> <Directory Id="dirRadius" Name="radius"/> <Directory Id="dirPlugins" Name="plugins"> <Directory Id="dirPluginsVersion" Name="$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)"> <Directory Id="dirPluginsVersionEpan" Name="epan"/> <Directory Id="dirPluginsVersionWtap" Name="wiretap"/> <Directory Id="dirPluginsVersionCodecs" Name="codecs"/> </Directory> </Directory> <Directory Id="dirUsersGuide" Name="Wireshark User's Guide"/> <Directory Id="dirProfiles" Name="profiles"/> <Directory Id="dirSnmp" Name="snmp"> <Directory Id="dirSnmpMibs" Name="mibs"/> </Directory> <Directory Id="dirTpncp" Name="tpncp"/> <Directory Id="dirTranslations" Name="translations"/> <Directory Id="dirWimaxasncp" Name="wimaxasncp"/> <Directory Id="dirProtobuf" Name="protobuf"/> </Directory> </Directory> <!-- "Special" directory for the Start Menu --> <Directory Id="ProgramMenuFolder"> <!-- Shortcuts directly in menu --> </Directory> <!-- "Special" directory for Quick Launch --> <Directory Id="AppDataFolder"> <Directory Id="MicrosoftFolder" Name="Microsoft"> <Directory Id="InternetExplorerFolder" Name="Internet Explorer"> <Directory Id="QuickLaunchFolder" Name="Quick Launch" /> </Directory> </Directory> </Directory> </Directory> </Fragment> </Include>
wireshark/packaging/wix/Features.wxi
<?xml version="1.0" encoding="utf-8"?> <Include> <!-- User-selectable features --> <Fragment> <Feature Id="Fe.Wireshark" Title="$(var.WiresharkName)" Level="1" AllowAdvertise="yes" Display="expand" Description="The main network protocol analyzer application."> <ComponentGroupRef Id="CG.Wireshark" /> <ComponentGroupRef Id="CG.QtDependencies" /> <ComponentGroupRef Id="CG.QtTranslations" /> <ComponentGroupRef Id="CG.WiresharkStartMenu" /> <ComponentGroupRef Id="CG.WiresharkDesktopIcon" /> <ComponentGroupRef Id="CG.WiresharkQuickLaunchIcon" /> <ComponentGroupRef Id="CG.WiresharkFileAssociations" /> </Feature> <Feature Id="Fe.WiresharkRequired" Title="Required" Level="1" AllowAdvertise="yes" Display="hidden" Description="Install for every user"> <ComponentGroupRef Id="CG.WiresharkRequired" /> <ComponentGroupRef Id="CG.ColorFilters" /> <ComponentGroupRef Id="CG.Diameter" /> <ComponentGroupRef Id="CG.RadiusDict" /> <ComponentGroupRef Id="CG.Dtds" /> <ComponentGroupRef Id="CG.Tpncp" /> <ComponentGroupRef Id="CG.Wimaxasncp" /> <ComponentGroupRef Id="CG.Protobuf" /> <ComponentGroupRef Id="CG.RequiredDependencies" /> </Feature> <Feature Id="Fe.TShark" Title="TShark" Level="1" AllowAdvertise="yes" Display="expand" Description="Text based network protocol analyzer."> <ComponentGroupRef Id="CG.TShark" /> </Feature> <Feature Id="Fe.Plugins" Title="Plugins &amp; Extensions" Level="1" AllowAdvertise="yes" Display="expand" Description="Plugins and extensions for both $(var.WiresharkName) and TShark."> <!-- XXX - Cleanup plugins directory on uninstall --> <Feature Id="Fe.Plugins.Dissector" Title="Dissector Plugins" Level="1" AllowAdvertise="yes" Display="expand" Description="Additional protocol dissectors."> <ComponentGroupRef Id="CG.Plugins.Dissector" /> </Feature> <Feature Id="Fe.Plugins.TreeStat" Title="Tree Statistics Plugin" Level="1" AllowAdvertise="yes" Display="expand" Description="Extended statistics."> <ComponentGroupRef Id="CG.Plugins.TreeStat" /> </Feature> <Feature Id="Fe.Plugins.Mate" Title="Mate - Meta Analysis and Tracing Engine" Level="1" AllowAdvertise="yes" Display="expand" Description="Plugin - Meta Analysis and Tracing Engine (Experimental)."> <ComponentGroupRef Id="CG.Plugins.Mate" /> </Feature> <Feature Id="Fe.Plugins.Transum" Title="TRANSUM - Network and application performance analysis" Level="1" AllowAdvertise="yes" Display="expand" Description="Plugin - Network and application performance analysis (Experimental)."> <ComponentGroupRef Id="CG.Plugins.Transum" /> </Feature> <Feature Id="Fe.Plugins.Wiretap" Title="Wiretap Plugins" Level="1" AllowAdvertise="yes" Display="expand" Description="Additional file formats support."> <ComponentGroupRef Id="CG.Plugins.Wiretap" /> </Feature> <Feature Id="Fe.Plugins.Codecs" Title="Codec Plugins" Level="1" AllowAdvertise="yes" Display="expand" Description="Codecs playback support."> <ComponentGroupRef Id="CG.Plugins.Codecs" /> </Feature> <Feature Id="Fe.Plugins.ConfigurationProfiles" Title="Configuration Profiles" Level="1" AllowAdvertise="yes" Display="expand" Description="Configuration Profiles"> <!-- XXX - Cleanup configuration profiles directory on uninstall --> <ComponentGroupRef Id="CG.Plugins.ConfigurationProfiles" /> </Feature> <?ifdef SMI_DIR?> <Feature Id="Fe.Plugins.SNMP" Title="SNMP MIBs" Level="1" AllowAdvertise="yes" Display="expand" Description="SNMP MIBs for better SNMP dissection."> <ComponentGroupRef Id="CG.Plugins.SNMP" /> </Feature> <?endif?> </Feature> <Feature Id="Fe.Tools" Title="Tools" Level="1" AllowAdvertise="yes" Display="expand" Description="Additional command line based tools."> <Feature Id="Fe.Tools.Editcap" Title="Editcap" Level="1" AllowAdvertise="yes" Display="expand" Description="Copy packets to a new file, optionally trimmming packets, omitting them, or saving to a different format."> <ComponentGroupRef Id="CG.Tools.Editcap" /> </Feature> <Feature Id="Fe.Tools.Text2Pcap" Title="Text2Pcap" Level="1" AllowAdvertise="yes" Display="expand" Description="Read an ASCII hex dump and write the data into a libpcap-style capture file."> <ComponentGroupRef Id="CG.Tools.Text2Pcap" /> </Feature> <Feature Id="Fe.Tools.Mergecap" Title="Mergecap" Level="1" AllowAdvertise="yes" Display="expand" Description="Combine multiple saved capture files into a single output file."> <ComponentGroupRef Id="CG.Tools.Mergecap" /> </Feature> <Feature Id="Fe.Tools.Reordercap" Title="Reordercap" Level="1" AllowAdvertise="yes" Display="expand" Description="Copy packets to a new file, sorted by time."> <ComponentGroupRef Id="CG.Tools.Reordercap" /> </Feature> <Feature Id="Fe.Tools.Capinfos" Title="Capinfos" Level="1" AllowAdvertise="yes" Display="expand" Description="Print information about capture files."> <ComponentGroupRef Id="CG.Tools.Capinfos" /> </Feature> <Feature Id="Fe.Tools.Captype" Title="Captype" Level="1" AllowAdvertise="yes" Display="expand" Description="Print the types of capture files."> <ComponentGroupRef Id="CG.Tools.Captype" /> </Feature> <Feature Id="Fe.Tools.Rawshark" Title="Rawshark" Level="1" AllowAdvertise="yes" Display="expand" Description="Raw packet filter."> <ComponentGroupRef Id="CG.Tools.Rawshark" /> </Feature> <?ifdef MMDBRESOLVE_EXE?> <Feature Id="Fe.Tools.MMDBResolve" Title="MMDBResolve" Level="1" AllowAdvertise="yes" Display="expand" Description="IP geolocation database resolution."> <ComponentGroupRef Id="CG.Tools.MMDBResolve" /> </Feature> <?endif?> <Feature Id="Fe.Tools.Androiddump" Title="Androiddump" Level="2" AllowAdvertise="yes" Display="expand" Description="Provide capture interfaces from Android devices."> <ComponentGroupRef Id="CG.Tools.Androiddump" /> </Feature> <Feature Id="Fe.Tools.Randpktdump" Title="Randpktdump" Level="2" AllowAdvertise="yes" Display="expand" Description="Provide random packet generator."> <ComponentGroupRef Id="CG.Tools.Randpktdump" /> </Feature> <Feature Id="Fe.Tools.Etwdump" Title="Etwdump" Level="2" AllowAdvertise="yes" Display="expand" Description="Provide ETW reader."> <ComponentGroupRef Id="CG.Tools.Etwdump" /> </Feature> <Feature Id="Fe.Tools.Sshdump" Title="Sshdump" Level="1" AllowAdvertise="yes" Display="expand" Description="Provide remote capture through SSH."> <ComponentGroupRef Id="CG.Tools.Sshdump" /> </Feature> <Feature Id="Fe.Tools.Ciscodump" Title="Ciscodump" Level="1" AllowAdvertise="yes" Display="expand" Description="Provide capture interface from a remote Cisco router through SSH."> <ComponentGroupRef Id="CG.Tools.Ciscodump" /> </Feature> <Feature Id="Fe.Tools.Udpdump" Title="Udpdump" Level="1" AllowAdvertise="yes" Display="expand" Description="Provide capture interface that gets UDP packets from network devices."> <ComponentGroupRef Id="CG.Tools.Udpdump" /> </Feature> <Feature Id="Fe.Tools.Wifidump" Title="Wifidump" Level="1" AllowAdvertise="yes" Display="expand" Description="Provide remote capture of Wi-Fi frames through SSH."> <ComponentGroupRef Id="CG.Tools.Wifidump" /> </Feature> </Feature> <?ifdef DOCBOOK_DIR?> <Feature Id="Fe.Documentation" Title="Documentation" Level="1" AllowAdvertise="yes" Display="expand" Description="Install an offline copy of the User's Guide and FAQ."> <ComponentGroupRef Id="CG.Documentation" /> </Feature> <?endif?> <Feature Id="VCRedist" Title="Visual C++ Runtime" AllowAdvertise="no" Display="hidden" Level="1"> <MergeRef Id="VCRedist"/> </Feature> </Fragment> </Include>
wireshark/packaging/wix/InputPaths.wxi
<?xml version="1.0" encoding="utf-8"?> <Include> <?if $(var.Platform) = x64 ?> <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?> <?else?> <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?> <?endif?> <?define Staging.Dir ="$(var.BuildOutputDir)" ?> <?define Plugins.Dir ="$(var.Staging.Dir)\plugins" ?> <?define Profiles.Dir ="$(var.Staging.Dir)\profiles" ?> <?define Extcap.Dir ="$(var.Staging.Dir)\extcap" ?> <?define WiresharkQt.Dir ="$(var.Staging.Dir)" ?> <?define Dtds.Dir ="$(var.Staging.Dir)\dtds" ?> <?define Tpncp.Dir ="$(var.Staging.Dir)\tpncp" ?> <?define Wimaxasncp.Dir ="$(var.Staging.Dir)\wimaxasncp" ?> <?define Protobuf.Dir ="$(var.Staging.Dir)\protobuf" ?> <?define Help.Dir ="$(var.Staging.Dir)\help" ?> <?define Epan.Lua.Dir ="..\..\epan\wslua" ?> </Include>
wireshark/packaging/wix/Plugins.wxi
<?xml version="1.0" encoding="utf-8"?> <Include> <!-- Plugins --> <Fragment> <DirectoryRef Id="dirPluginsVersionEpan"> <Component Id="cmpEthercat_dll" Guid="*"> <File Id="filEthercat_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\ethercat.dll" /> </Component> <Component Id="cmpGryphon_dll" Guid="*"> <File Id="filGryphon_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\gryphon.dll" /> </Component> <Component Id="cmpIrda_dll" Guid="*"> <File Id="filIrda_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\irda.dll" /> </Component> <Component Id="cmpOpcua_dll" Guid="*"> <File Id="filOpcua_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\opcua.dll" /> </Component> <Component Id="cmpProfinet_dll" Guid="*"> <File Id="filProfinet_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\profinet.dll" /> </Component> <Component Id="cmpUnistim_dll" Guid="*"> <File Id="filUnistim_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\unistim.dll" /> </Component> <Component Id="cmpWimax_dll" Guid="*"> <File Id="filWimax_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\wimax.dll" /> </Component> <Component Id="cmpWimaxasmcp_dll" Guid="*"> <File Id="filWimaxasmcp_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\wimaxasncp.dll" /> </Component> <Component Id="cmpWimaxmacphy_dll" Guid="*"> <File Id="filWimaxmacphy_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\wimaxmacphy.dll" /> </Component> <!-- Add custom plugin Components here --> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Plugins.Dissector"> <ComponentRef Id="cmpEthercat_dll" /> <ComponentRef Id="cmpGryphon_dll" /> <ComponentRef Id="cmpIrda_dll" /> <ComponentRef Id="cmpOpcua_dll" /> <ComponentRef Id="cmpProfinet_dll" /> <ComponentRef Id="cmpUnistim_dll" /> <ComponentRef Id="cmpWimax_dll" /> <ComponentRef Id="cmpWimaxasmcp_dll" /> <ComponentRef Id="cmpWimaxmacphy_dll" /> <!-- Add custom plugin ComponentRefs here --> </ComponentGroup> </Fragment> <!-- Stats Tree --> <Fragment> <DirectoryRef Id="dirPluginsVersionEpan"> <Component Id="cmpStatsTree_dll" Guid="*"> <File Id="filStatsTree_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\stats_tree.dll" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Plugins.TreeStat"> <ComponentRef Id="cmpStatsTree_dll" /> </ComponentGroup> </Fragment> <!-- MATE --> <Fragment> <DirectoryRef Id="dirPluginsVersionEpan"> <Component Id="cmpMate_dll" Guid="*"> <File Id="filMate_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\mate.dll" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Plugins.Mate"> <ComponentRef Id="cmpMate_dll" /> </ComponentGroup> </Fragment> <!-- TRANSUM --> <Fragment> <DirectoryRef Id="dirPluginsVersionEpan"> <Component Id="cmpTransum_dll" Guid="*"> <File Id="filTransum_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\epan\transum.dll" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Plugins.Transum"> <ComponentRef Id="cmpTransum_dll" /> </ComponentGroup> </Fragment> <!-- wiretap --> <Fragment> <DirectoryRef Id="dirPluginsVersionWtap"> <Component Id="cmpUsbdump_dll" Guid="*"> <File Id="filUsbdump_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\wiretap\usbdump.dll" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Plugins.Wiretap"> <ComponentRef Id="cmpUsbdump_dll" /> </ComponentGroup> </Fragment> <!-- codecs --> <Fragment> <DirectoryRef Id="dirPluginsVersionCodecs"> <Component Id="cmpG711_dll" Guid="*"> <File Id="filG711_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\g711.dll" /> </Component> <Component Id="cmpG722_dll" Guid="*"> <File Id="filG722_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\g722.dll" /> </Component> <Component Id="cmpG726_dll" Guid="*"> <File Id="filG726_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\g726.dll" /> </Component> <Component Id="cmpG729_dll" Guid="*"> <File Id="filG729_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\g729.dll" /> </Component> <Component Id="cmpL16mono_dll" Guid="*"> <File Id="filL16mono_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\l16mono.dll" /> </Component> <Component Id="cmpSBC_dll" Guid="*"> <File Id="filSBC_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\sbc.dll" /> </Component> <Component Id="cmpILBC_dll" Guid="*"> <File Id="filILBC_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\ilbc.dll" /> </Component> <Component Id="cmpOPUS_dll" Guid="*"> <File Id="filOPUS_dec_dll" KeyPath="yes" Source="$(var.Plugins.Dir)\$(var.WiresharkMajorVersion).$(var.WiresharkMinorVersion)\codecs\opus_dec.dll" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="CG.Plugins.Codecs"> <ComponentRef Id="cmpG711_dll" /> <ComponentRef Id="cmpG722_dll" /> <ComponentRef Id="cmpG726_dll" /> <ComponentRef Id="cmpG729_dll" /> <ComponentRef Id="cmpL16mono_dll" /> <ComponentRef Id="cmpSBC_dll" /> <ComponentRef Id="cmpILBC_dll" /> <ComponentRef Id="cmpOPUS_dll" /> </ComponentGroup> </Fragment> </Include>
wireshark/packaging/wix/Prerequisites.wxi
<?xml version="1.0" encoding="utf-8"?> <Include xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"> <!-- Check for required dependencies here --> <!-- You can debug the logic below (and lots of other things) by running msiexec /i packaging\wix\Wireshark-xxx.msi /l*v msilog.txt --> <Fragment> <!-- Do not remove: The contents of this "fragment" will not be included in the project, unless we reference at least one item defined within it. This "IncludePrerequisites" property is referenced in the "Product" element, to ensure the entire fragment is included. --> <Property Id="IncludePrerequisites">1</Property> <!-- This should match the following: - The NTDDI_VERSION and _WIN32_WINNT parts of cmakeconfig.h.in - The <compatibility><application> section in image\wireshark.exe.manifest.in - The GetWindowsVersion parts of packaging\nsis\wireshark.nsi --> <Condition Message="Windows 2000 is no longer supported. Please install $(var.WiresharkName) 1.2 or 1.0 instead."> <![CDATA[Installed OR (VersionNT < 500) OR (VersionNT > 500)]]> </Condition> <Condition Message="WindowsXP is no longer supported. Please install $(var.WiresharkName) 1.12 or 1.10 instead."> <![CDATA[Installed OR (VersionNT < 501) OR (VersionNT > 501)]]> </Condition> <Condition Message="Windows Server 2003 is no longer supported. Please install $(var.WiresharkName) 1.12 or 1.10 instead."> <![CDATA[Installed OR (VersionNT < 502) OR (VersionNT > 502)]]> </Condition> <Condition Message="Windows Vista and Server 2008 are no longer supported. Please install $(var.WiresharkName) 2.2 instead."> <![CDATA[Installed OR (VersionNT < 600) OR (VersionNT > 600)]]> </Condition> <Condition Message="$(var.WiresharkName)$(var.WiresharkVersion) is only supported on Windows 7, Windows Server 2008R2, or higher."> <![CDATA[Installed OR (VersionNT >= 601)]]> </Condition> <!-- NSIS package uninstallation. The NSIS installer writes a bunch of keys to 'HKEY_LOCAL_MACHINE\SOFTWARE\{Wow6432Node\,}Microsoft\Windows\CurrentVersion\Uninstall\Wireshark'. See the 'WriteRegStr HKEY_LOCAL_MACHINE "${UNINSTALL_PATH}"' statements starting at around line 780 in nsis\wireshark.nsi for a complete list. For now look for 'InstallLocation' and cancel the installation if it's defined and exists. Next steps: - look for 'QuietUninstallString' and offer to run it. - Show properties in condition messages as described below. --> <Property Id="NSIS_INSTALL_LOCATION_32" Secure="yes"> <RegistrySearch Id='NsisInstallRegistrySearch32' Type='raw' Root='HKLM' Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark' Name='InstallLocation' Win64='no'> <DirectorySearch Id='NsisInstallDirectorySearch32' AssignToProperty='yes'/> </RegistrySearch> </Property> <Property Id="NSIS_DISPLAY_NAME_32" Value="Wireshark" Secure="yes"> <RegistrySearch Id='NsisDisplayNameRegistrySearch32' Type='raw' Root='HKLM' Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark' Name='DisplayName' Win64='no'/> </Property> <Condition Message="[NSIS_DISPLAY_NAME_32] was installed in [NSIS_INSTALL_LOCATION_32] using the .exe installer. Please uninstall it using Programs and Features."> <![CDATA[Installed OR NOT NSIS_INSTALL_LOCATION_32]]> </Condition> <Property Id="NSIS_INSTALL_LOCATION_64" Secure="yes"> <RegistrySearch Id='NsisInstallRegistrySearch64' Type='raw' Root='HKLM' Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark' Name='InstallLocation' Win64='yes'> <DirectorySearch Id='NsisInstallDirectorySearch64' AssignToProperty='yes'/> </RegistrySearch> </Property> <Property Id="NSIS_DISPLAY_NAME_64" Value="Wireshark" Secure="yes"> <RegistrySearch Id='NsisDisplayNameRegistrySearch64' Type='raw' Root='HKLM' Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark' Name='DisplayName' Win64='yes'/> </Property> <Condition Message="[NSIS_DISPLAY_NAME_64] was installed in [NSIS_INSTALL_LOCATION_64] using the .exe installer. Please uninstall it using Programs and Features."> <![CDATA[Installed OR NOT NSIS_INSTALL_LOCATION_64]]> </Condition> </Fragment> </Include>
AsciiDoc
wireshark/packaging/wix/README.adoc
= WiX (.msi) Installer For Wireshark This is an experimental feature to provide Wireshark with an .msi installer as requested in https://gitlab.com/wireshark/wireshark/-/issues/8814[issue 8814]. It might one day replace the NSIS installer, but needs to be a little more complete before doing so. == Differences/Notes Compared To The NSIS Installer . You need the https://wixtoolset.org/[WiX toolset] to build the .msi installer. Version 3.10 or later is recommended. . The User's Guide, SNMP, Radius, Diameter, and Qt translations files are harvested to be included in the installer. Any custom/additional files just need to be written to the appropriate build output directory and the installer will pick them up. NSIS required modifying a file (custom_mibs.txt, etc) for inclusion . Plugin DLLs are not automatically harvested. To include your DLL, modify Plugins.wxi. . To build the WiX installer run: ---- > msbuild /m /p:Configuration=RelWithDebInfo wireshark_wix_prep.vcxproj > msbuild /m /p:Configuration=RelWithDebInfo wireshark_wix.vcxproj ---- == Known Issues . The .msi installer does not include and install Npcap or USBPcap like the NSIS installer does. These currently come as NSIS-generated .exe installers. We might be able to bundle them as https://wixtoolset.org/documentation/manual/v3/xsd/wix/exepackage.html[ExePackage elements]. // This appears to be fixed in the MERGE_MODULE_DIR code in CMakeLists.txt? // . Needs more flexible handling of VC CRT Merge module (need build script to provide appropriate macros). // Something like (or modifying existing) FindMSVC_REDIST.cmake. // Currently only VS2013 / CRT120 and VS 2015 / CRT140 are supported. . Transitioning, upgrading, downgrading, and reinstalling is more tricky. The NSIS-based installer handles previously-installed versions by running any existing uninstaller prior to installation, which empties the installation directory and removes registry entries. These are subsequently filled back in by the installer. The Windows Installer architecture keeps track of installed items in a https://docs.microsoft.com/en-us/windows/win32/msi/installer-database[database] and uses the https://docs.microsoft.com/en-us/windows/win32/msi/upgradecode[UpgradeCode property] to identify installed products and the https://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html[MajorUpgrade property] to control upgrade behavior. As a result, * We can't easily upgrade from an NSIS-based installation to a .msi installation, and vice versa. * We have to be careful about setting things like UpgradeCode, MajorUpgrade, and REINSTALLMODE in our WiX configuration. . The lax behavior of the NSIS-based installer lets you install more than one copy of Wireshark if you specify different installation directories. (The most recently installed version "wins" as far as registry entries and file associations go). The .msi installer doesn't allow this. Patches welcome to address any of the issues above or improvements you think can be made.
wireshark/packaging/wix/StringOverrides.wxl
<?xml version="1.0" encoding="utf-8"?> <WixLocalization Culture="en-US" Codepage="1252" xmlns="http://schemas.microsoft.com/wix/2006/localization"> <String Id="WelcomeDlgDescription" Overridable="yes">This will install [ProductName] [ProductVersion] on your computer. If you installed [ProductName] using the .exe installer please uninstall it first.</String> </WixLocalization>
wireshark/packaging/wix/UserInterface.wxi
<?xml version="1.0" encoding="utf-8"?> <Include> <!-- Define the appearance, sequence, and available options in the user interface --> <Fragment> <WixVariable Id="WixUILicenseRtf" Value="$(var.EulaPath)" /> <WixVariable Id="WixUIBannerBmp" Value="$(var.BannerImagePath)" /> <WixVariable Id="WixUIDialogBmp" Value="$(var.DialogImagePath)" /> <Icon Id="ProgramsFeaturesIcon" SourceFile="$(var.ProgramsFeaturesIconPath)"/> <Property Id="ARPPRODUCTICON" Value="ProgramsFeaturesIcon" /> <!-- This UI identifier will be used in the product definition--> <UI Id="UI.Wireshark"> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" ></Property> <UIRef Id="WiresharkWixUI" /> </UI> </Fragment> </Include>
wireshark/packaging/wix/windeployqt-to-wix.ps1
# windeployqt-to-wix # # Windeployqt-to-wix - Convert the output of windeployqt to an equivalent set of # Wix file and component statements. # # Copyright 2016 Michael Mann # # Wireshark - Network traffic analyzer # By Gerald Combs <[email protected]> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later #requires -version 2 <# .SYNOPSIS Creates Wix components required for Qt packaging. .DESCRIPTION This script creates n Wix-compatible include file based on the output of windeployqt. If Qt is present, version 5.3 or later is required. Otherwise a dummy file will be created. If building with Qt, QMake must be in your PATH. .PARAMETER Executable The path to a Qt application. It will be examined for dependent DLLs. .PARAMETER FilePath Output filename. .INPUTS -Executable Path to the Qt application. -FilePath Output Wix include file. .OUTPUTS Wix file required to package supporting DLLs. .EXAMPLE C:\PS> .\windeployqt-to-wix.ps1 windeployqt.exe ..\..\staging\wireshark.exe qt-dll-manifest.wxs #> Param( [Parameter(Mandatory=$true, Position=0)] [String] $Executable, [Parameter(Position=1)] [String] $FilePath = "qt-dll-manifest.wxs" ) try { $qtVersion = [version](qmake -query QT_VERSION) $wixComponents = "<Wix xmlns=`"http://schemas.microsoft.com/wix/2006/wi`"> <?include InputPaths.wxi ?> " $wixComponents += @("<!-- Qt version " + $qtVersion ; "--> ") if ($qtVersion -lt "5.3") { Throw "Qt " + $qtVersion + " found. 5.3 or later is required." } # windeployqt lists translation files that it don't exist (e.g. # qtbase_ar.qm), so we handle those by hand. # https://bugreports.qt.io/browse/QTBUG-65974 $wdqtList = windeployqt ` --release ` --no-compiler-runtime ` --no-translations ` --list relative ` $Executable $dllPath = Split-Path -Parent $Executable $dllList = " <Fragment> <DirectoryRef Id=`"INSTALLFOLDER`"> " $dirList = "" $currentDir = "" $startDirList = " <Fragment> <DirectoryRef Id=`"INSTALLFOLDER`"> " $endDirList = " </Directory> </DirectoryRef> </Fragment> " $currentDirList = $startDirList $componentGroup = " <Fragment> <ComponentGroup Id=`"CG.QtDependencies`"> " foreach ($entry in $wdqtList) { $dir = Split-Path -Parent $entry if ($dir) { if ($dir -ne $currentDir) { if ($currentDir -ne "") { # for everything but first directory found $currentDirList += $endDirList # Previous directory complete, add to list $dirList += $currentDirList } $currentDirList = $startDirList + " <Directory Id=`"dir$dir`" Name=`"$dir`"> " $currentDir = $dir } $wix_name = $entry -replace "[\\|\.]", "_" $currentDirList += " <Component Id=`"cmp$wix_name`" Guid=`"*`"> <File Id=`"fil$wix_name`" KeyPath=`"yes`" Source=`"`$(var.Staging.Dir)\$entry`" /> </Component> " $componentGroup += " <ComponentRef Id=`"cmp$wix_name`" /> " } else { $dllList += " <Component Id=`"cmp$entry`" Guid=`"*`"> <File Id=`"fil$entry`" KeyPath=`"yes`" Source=`"`$(var.Staging.Dir)\$entry`" /> </Component> " $componentGroup += " <ComponentRef Id=`"cmp$entry`" /> " } } #finish up the last directory $currentDirList += $endDirList $dirList += $currentDirList $dllList += " </DirectoryRef> </Fragment> " $componentGroup += " </ComponentGroup> </Fragment> " $wixComponents += $dllList + $dirList + $componentGroup $wixComponents += @" </Wix> "@ } catch { $wixComponents = "<?xml version=`"1.0`" encoding=`"utf-8`"?> <Include> <!--- Qt not configured --> </Include> " } Set-Content $FilePath @" <?xml version=`"1.0`" encoding=`"utf-8`"?> <!-- Automatically generated by $($MyInvocation.MyCommand.Name) --> "@ Add-Content $FilePath $wixComponents
wireshark/packaging/wix/Wireshark.wxs
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?define WiresharkFileAssociation = "wireshark-capture-file" ?> <!-- The path to the installer's End-User License Agreement, displayed during installation --> <?define EulaPath="$(var.AssetDir)\COPYING.rtf"?> <!-- Windows 8 and later supports PNG. Until then we use cave paintings^W^W BMP. --> <?define BannerImagePath="$(var.AssetDir)\banner.bmp"?> <?define DialogImagePath="$(var.AssetDir)\dialog.bmp"?> <!-- Use the application icon in "Programs and Features" This is apparently stored uncompressed, i.e. we should use a dedicated .ico file instead of pointing to wireshark.exe. --> <?define ProgramsFeaturesIconPath="$(var.IconDir)\wireshark.ico"?> <Product Id="*" Name="$(var.WiresharkName)" Language="1033" Version="$(var.WiresharkVersion)" Manufacturer="The Wireshark developer community, https://www.wireshark.org/" UpgradeCode="0d67aace-269a-4264-81a3-da8055c1c79c"> <Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" /> <!-- Values for Additional Tasks --> <Property Id="WIRESHARK_START_MENU" Value="1" Secure="yes"/> <Property Id="WIRESHARK_DESKTOP_ICON" Secure="yes"/> <Property Id="WIRESHARK_QUICK_LAUNCH_ICON" Value="1" Secure="yes" /> <Property Id="WIRESHARK_LEGACY_START_MENU" Value="1" Secure="yes" /> <Property Id="WIRESHARK_LEGACY_DESKTOP_ICON" Secure="yes"/> <Property Id="WIRESHARK_LEGACY_QUICK_LAUNCH_ICON" Value="1" Secure="yes" /> <Property Id="WIRESHARK_FILE_EXTENSIONS" Value="1"/> <!-- We set AllowSameVersionUpgrade so that automated builds (which only differ by micro version numbers) won't get installed side by side. The WiX documentation seems to warn against this, so we might want to find a better fix, e.g. REINSTALLMODE + AllowDowngrades: https://stackoverflow.com/questions/1544990/wix-major-upgrade-doesnt-completely-install-app-on-downgrade --> <MajorUpgrade DowngradeErrorMessage="A newer version of $(var.WiresharkName) is already installed." AllowSameVersionUpgrades="yes" /> <MediaTemplate EmbedCab="yes" CompressionLevel="high" /> <!-- Include the prerequisites, by referencing the placeholder property --> <PropertyRef Id="IncludePrerequisites" /> <!-- Include the top-most parent feature --> <FeatureRef Id="Fe.Wireshark" /> <!-- Include the installer UI definition --> <UIRef Id="UI.Wireshark"/> </Product> <?include InputPaths.wxi ?> <?include DirectoryStructure.wxi ?> <?include Prerequisites.wxi ?> <?include ComponentGroups.wxi ?> <?include Plugins.wxi ?> <?include Features.wxi ?> <?include UserInterface.wxi ?> </Wix>
wireshark/packaging/wix/WiresharkOptionsDlg.wxs
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Fragment> <UI> <!-- Recommended control sizing and spacing: https://docs.microsoft.com/en-us/windows/win32/uxguide/vis-layout#control-sizing https://docs.microsoft.com/en-us/windows/win32/uxguide/vis-layout#spacing The recommended spacing between unrelated controls is 7, but 10 looks better. --> <Dialog Id="WiresharkOptionsDlg" Width="370" Height="270" Title="!(loc.LicenseAgreementDlg_Title)"> <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)"/> <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0"/> <Control Id="Title" Type="Text" X="14" Y="7" Width="350" Height="15" Transparent="yes" NoPrefix="yes" Text="Packet capture, shortcuts, and file extensions"/> <Control Id="Description" Type="Text" X="20" Y="26" Width="350" Height="15" Transparent="yes" NoPrefix="yes" Text="You must install Npcap or WinPcap in order to capture packets."/> <!-- BannerLine y = 44, 44 + 7 = 51 --> <Control Id="NetworkCapture" Type="Text" X="14" Y="51" Width="350" Height="12" Text="{\WixUI_Font_Bold}Wireshark requires Npcap or WinPcap to capture network packets"/> <Control Id="NetworkCaptureNpcap" Type="Hyperlink" X="20" Y="63" Width="350" Height="11"> <Text><![CDATA[<a href="https://npcap.org">Download Npcap</a> (recommended)]]></Text> </Control> <!-- It looks Hyperlink controls only support one hyperlink, per control. --> <Control Id="NetworkCaptureWinPcap" Type="Hyperlink" X="20" Y="74" Width="350" Height="11"> <Text><![CDATA[…or <a href="https://www.winpcap.org">download WinPcap</a>]]></Text> </Control> <!-- NetworkCaptureWinPcap y = 74, 74 + 8 + 10 = 92 --> <Control Id="UsbCapture" Type="Text" X="14" Y="92" Width="350" Height="12" Text="{\WixUI_Font_Bold}Wireshark requires USBPcap to capture USB Packets"/> <Control Id="UsbCaptureUsbPcap" Type="Hyperlink" X="20" Y="104" Width="350" Height="11"> <Text><![CDATA[<a href="https://desowin.org/usbpcap/">Download USBPcap</a> (experimental)]]></Text> </Control> <!-- UsbCaptureUsbPcap y = 104, 104 + 8 + 10 = 122 --> <Control Id="Shortcuts" Type="Text" X="14" Y="122" Width="350" Height="11" Text="{\WixUI_Font_Bold}Create Shortcuts"/><!-- h = static text + label spacing = 8 + 3 --> <Control Id="WiresharkStartMenuCB" Type="CheckBox" X="20" Y="133" Width="350" Height="14" CheckBoxValue="1" Property="WIRESHARK_START_MENU" Text="Wireshark Start Menu Item"><!-- h = 10 + 4 --> <Condition Action="enable"><![CDATA[&Fe.Wireshark = 3]]></Condition> <Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition> </Control> <Control Id="WiresharkDesktopIconCB" Type="CheckBox" X="20" Y="147" Width="350" Height="14" CheckBoxValue="1" Property="WIRESHARK_DESKTOP_ICON" Text="Wireshark Desktop Icon"> <Condition Action="enable"><![CDATA[&Fe.Wireshark = 3]]></Condition> <Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition> </Control> <Control Id="WiresharkQuickLaunchIconCB" Type="CheckBox" X="20" Y="161" Width="350" Height="14" CheckBoxValue="1" Property="WIRESHARK_QUICK_LAUNCH_ICON" Text="Wireshark Quick Launch Icon"> <Condition Action="enable"><![CDATA[&Fe.Wireshark = 3]]></Condition> <Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition> </Control> <!-- WiresharkQuickLaunchIconCB y = 161, 161 + 10 + 10 = 181 --> <Control Id="FileExtensions" Type="Text" X="14" Y="181" Width="350" Height="11" Text="{\WixUI_Font_Bold}Associate File Extensions"/><!-- h = static text + label spacing = 8 + 3 --> <Control Id="FileExtensionsCB" Type="CheckBox" X="20" Y="192" Width="350" Height="14" CheckBoxValue="1" Property="WIRESHARK_FILE_EXTENSIONS" Text="Associate trace file extensions with Wireshark"> <Condition Action="enable"><![CDATA[&Fe.Wireshark = 3]]></Condition> <Condition Action="disable"><![CDATA[&Fe.Wireshark <> 3]]></Condition> </Control> <Control Id="FileExtensionsText1" Type="Text" X="20" Y="206" Width="350" Height="11" Transparent="yes" NoPrefix="yes" Text="Extensions include 5vw, acp, apc, atc, bfr, cap, enc, erf, fdc, lcap, mplog, ntar, out,"/> <Control Id="FileExtensionsText2" Type="Text" X="20" Y="217" Width="350" Height="11" Transparent="yes" NoPrefix="yes" Text="pcap, pcapng, pkt, rf5, snoop, syc, tpc, tr1, trace, trc, vwr, wpc, and wpz."/> <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/> <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)"/> <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"/> <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"> <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> </Control> </Dialog> </UI> </Fragment> </Wix>
wireshark/packaging/wix/WiresharkWixUI.wxs
<?xml version="1.0" encoding="UTF-8"?> <!-- <copyright file="WixUI_FeatureTree.wxs" company="Outercurve Foundation"> Copyright (c) 2004, Outercurve Foundation. This software is released under Microsoft Reciprocal License (MS-RL). The license and further copyright text can be found in the file LICENSE.TXT at the root directory of the distribution. </copyright> --> <!-- First-time install dialog sequence: - WixUI_WelcomeDlg - WixUI_LicenseAgreementDlg - WixUI_CustomizeDlg - WixUI_VerifyReadyDlg - WixUI_DiskCostDlg Maintenance dialog sequence: - WixUI_MaintenanceWelcomeDlg - WixUI_MaintenanceTypeDlg - WixUI_CustomizeDlg - WixUI_VerifyReadyDlg Patch dialog sequence: - WixUI_WelcomeDlg - WixUI_VerifyReadyDlg --> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Fragment> <UI Id="WiresharkWixUI"> <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> <TextStyle Id="WixUI_Font_Bold" FaceName="Tahoma" Size="8" Bold="yes"/> <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> <Property Id="WixUI_Mode" Value="FeatureTree" /> <DialogRef Id="ErrorDlg" /> <DialogRef Id="FatalError" /> <DialogRef Id="FilesInUse" /> <DialogRef Id="MsiRMFilesInUse" /> <DialogRef Id="PrepareDlg" /> <DialogRef Id="ProgressDlg" /> <DialogRef Id="ResumeDlg" /> <DialogRef Id="UserExit" /> <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish> <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish> <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish> <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">LicenseAccepted = "1"</Publish> <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish> <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="2">NOT Installed</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="WiresharkOptionsDlg">1</Publish> <Publish Dialog="WiresharkOptionsDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">1</Publish> <Publish Dialog="WiresharkOptionsDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">1</Publish> <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WiresharkOptionsDlg">1</Publish> <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish> <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish> <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish> <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish> <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish> <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish> <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish> <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish> <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish> <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish> <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish> </UI> <UIRef Id="WixUI_Common" /> </Fragment> </Wix>
Inno Setup Script
wireshark/plugins/plugin.rc.in
#include "winver.h" #pragma code_page(65001) VS_VERSION_INFO VERSIONINFO FILEVERSION @RC_MODULE_VERSION@ PRODUCTVERSION @RC_VERSION@ FILEFLAGSMASK 0x0L #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0 #endif FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "The Wireshark developer community, https://www.wireshark.org/\0" VALUE "FileDescription", "@MODULE_NAME@ dissector\0" VALUE "FileVersion", "@MODULE_VERSION@\0" VALUE "InternalName", "@MODULE_NAME@ @MODULE_VERSION@\0" VALUE "LegalCopyright", "Copyright © 1998 Gerald Combs <[email protected]>, Gilbert Ramirez <[email protected]> and others\0" VALUE "OriginalFilename", "@[email protected]\0" VALUE "ProductName", "Wireshark\0" VALUE "ProductVersion", "@PROJECT_VERSION@\0" VALUE "Comments", "Built with @MSVC_VARIANT@\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END
C
wireshark/plugins/codecs/amrnb/amrdecode.c
/* amrdecode.c * AMR codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <wireshark.h> #include "wsutil/codecs.h" #include "ws_attributes.h" #include <opencore-amrnb/interf_dec.h> void codec_register_amr(void); static void * codec_amr_init(codec_context_t *ctx _U_) { void *state; state = Decoder_Interface_init(); return state; } static void codec_amr_release(codec_context_t *state) { Decoder_Interface_exit(state->priv); } static unsigned codec_amr_get_channels(codec_context_t *ctx _U_) { return 1; } static unsigned codec_amr_get_frequency(codec_context_t *ctx _U_) { return 8000; } /* RTP doesn't allow the other SID types */ static const uint8_t speech_bits[16] = {95,103,118,134,148,159,204,244,39, 0, 0, 0, 0, 0, 0, 0}; /* The number of speech bits rounded up to bytes */ static const uint8_t block_size[16] = {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0}; static const uint8_t bit_mask8[] = { 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF }; /* Retrieve no_of_bits (<= 8) from in, starting at bit_offset. * Does not do bounds checking. */ static uint8_t get_bits8(uint8_t *in, unsigned bit_offset, const unsigned no_of_bits) { uint8_t ret; unsigned octet_offset = bit_offset >> 3; unsigned bits_in_first_octet = 8 - (bit_offset % 8); if (bits_in_first_octet >= no_of_bits) { ret = in[octet_offset] >> (bits_in_first_octet - no_of_bits) & bit_mask8[no_of_bits]; } else { unsigned left_shift = no_of_bits - bits_in_first_octet; ret = (in[octet_offset] << left_shift) & bit_mask8[no_of_bits]; ret |= (in[octet_offset + 1] >> (8 - left_shift)); } return ret; } static size_t codec_amr_decode_one(void *state, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes) { uint8_t *in; int mode; unsigned packet_size; packet_size = 2; /* CMR + TOC */ /* 160 samples per frame, two byte per frame, 20ms */ *outputSizeBytes = 160 * 2; /* If no room for CMR + TOC, insert silence */ if (packet_size > inputSizeBytes) { memset(output, 0, 160 * 2); return *outputSizeBytes; } in = (uint8_t*)input + 1; mode = (in[0] >> 3) & 0x0F; packet_size += block_size[mode]; /* If the size is screwed up, insert silence */ if (packet_size > inputSizeBytes) { memset(output, 0, 160 * 2); return *outputSizeBytes; } /* XXX: The last parameter is the BFI - we could invert the * Q-bit and pass it in, which might be better? */ Decoder_Interface_Decode(state, in, (short *)output, 0); return *outputSizeBytes; } static size_t codec_amr_decode_many(void *state, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes, unsigned frames) { int mode; unsigned packet_size = 1; /* CMR */ *outputSizeBytes = 160 * 2 * frames; uint8_t *toc = (uint8_t *)input + 1; uint8_t *speech = toc + frames; uint8_t in[32]; for (unsigned i = 0; i < frames; i++) { mode = (toc[i] >> 3) & 0x0F; packet_size += block_size[mode] + 1; /* include the TOC */ /* If the size is screwed up, insert silence */ if (packet_size > inputSizeBytes) { memset(output, 0, 160 * 2 * (frames - i)); return *outputSizeBytes; } /* OpenCORE-AMR ignores the F-bit (which is why we're doing * this memcpy) but might as well clear it. */ in[0] = toc[i] & 0x7F; memcpy(&in[1], speech, block_size[mode]); /* XXX: The last parameter is the BFI - we could invert the * Q-bit and pass it in, which might be better? */ Decoder_Interface_Decode(state, in, (short *)output, 0); speech += block_size[mode]; output = (uint8_t *)output + 160 * 2; } return *outputSizeBytes; } static size_t codec_amr_decode_oa(codec_context_t *ctx, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes) { bool f_bit; unsigned frames = 0; void *state = ctx->priv; /* First byte is CMR, second is the Payload TOC */ if (inputSizeBytes < 2) { frames = 1; } else { uint8_t *in = (uint8_t *)input; do { f_bit = (in[++frames] >> 7) & 0x01; } while (f_bit && inputSizeBytes > frames + 1); } /* 160 samples per frame, two byte per frame, 20ms */ if (!output || !outputSizeBytes) return 160 * 2 * frames; if (frames == 1) { return codec_amr_decode_one(state, input, inputSizeBytes, output, outputSizeBytes); } else { return codec_amr_decode_many(state, input, inputSizeBytes, output, outputSizeBytes, frames); } } static size_t codec_amr_decode(codec_context_t *ctx, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes) { bool f_bit; unsigned frames = 0; void *state = ctx->priv; if (ctx->fmtp_map) { const char* octet_align = (const char *)wmem_map_lookup(ctx->fmtp_map, "octet-align"); /* There's a few other lesser used options like "crc", "interleaving", * and "robust-sorting" that can change how it should be decoded. * (All of them imply octet-aligned.) Ideally we'd handle them too. */ if (g_strcmp0(octet_align, "1") == 0) { return codec_amr_decode_oa(ctx, input, inputSizeBytes, output, outputSizeBytes); } } unsigned bit_offset = 4; uint8_t *in = (uint8_t *)input; /* Per RFC 4867, if the format parameters don't indicate octet-align, * bandwidth-efficient mode is used. (For Decode As, we'll pass in * the value of the dissector's prefs.) * OpenCORE-AMR's interface only supports octet-aligned mode, so we * have to align the data. (From the source, the decode also supports * IF2, except that there's no way to access that from the interface.) */ /* First byte is CMR, second is the Payload TOC */ if (inputSizeBytes < 2) { frames = 1; } else { do { f_bit = get_bits8(in, bit_offset, 1); bit_offset += 6; frames++; } while (f_bit && inputSizeBytes > (bit_offset / 8)); } /* 160 samples per frame, two byte per frame, 20ms */ if (!output || !outputSizeBytes) return 160 * 2 * frames; *outputSizeBytes = 160 * 2 * frames; /* bit_offset is now where the speech bits begin */ unsigned toc_offset = 5; /* Mode start */ uint8_t aligned[32]; int mode; for (unsigned i = 0; i < frames; ++i) { mode = get_bits8(in, toc_offset, 4); /* If the size is screwed up, insert silence */ if ((bit_offset + speech_bits[mode] + 7) / 8 > inputSizeBytes) { memset(output, 0, 160 * 2 * (frames - i)); return *outputSizeBytes; } memset(aligned, 0, 32); aligned[0] = mode << 3; for (unsigned j = 0; j < speech_bits[mode] / 8; ++j) { aligned[1 + j] = get_bits8(in, bit_offset, 8); bit_offset += 8; } if (speech_bits[mode] % 8) { aligned[1 + block_size[mode]] = get_bits8(in, bit_offset, speech_bits[mode] % 8); } /* Padding might be different. */ /* XXX: The last parameter is the BFI - we could invert the * Q-bit and pass it in, which might be better? */ Decoder_Interface_Decode(state, aligned, (short *)output, 0); output = (uint8_t *)output + 160 * 2; } return *outputSizeBytes; } void codec_register_amr(void) { register_codec("AMR", codec_amr_init, codec_amr_release, codec_amr_get_channels, codec_amr_get_frequency, codec_amr_decode); } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
Text
wireshark/plugins/codecs/amrnb/CMakeLists.txt
# 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(amrnb 0 1 0 0) set(CODEC_SRC amrdecode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(amrnb codecs) target_include_directories(amrnb PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(amrnb wsutil ${AMRNB_LIBRARIES}) target_include_directories(amrnb SYSTEM PRIVATE ${AMRNB_INCLUDE_DIRS}) install_plugin(amrnb codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME amrnb SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
Text
wireshark/plugins/codecs/G711/CMakeLists.txt
# 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(g711 0 1 0 0) set(CODEC_SRC G711decode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(g711 codecs) target_include_directories(g711 PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(g711 wsutil) install_plugin(g711 codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME g711 SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/G711/G711decode.c
/* G711adecode.c * A-law G.711 codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <glib.h> #include "wsutil/codecs.h" #include "ws_attributes.h" static gint16 ulaw_exp_table[256] = { -32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956, -23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764, -15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412, -11900,-11388,-10876,-10364, -9852, -9340, -8828, -8316, -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140, -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092, -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004, -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, -1372, -1308, -1244, -1180, -1116, -1052, -988, -924, -876, -844, -812, -780, -748, -716, -684, -652, -620, -588, -556, -524, -492, -460, -428, -396, -372, -356, -340, -324, -308, -292, -276, -260, -244, -228, -212, -196, -180, -164, -148, -132, -120, -112, -104, -96, -88, -80, -72, -64, -56, -48, -40, -32, -24, -16, -8, 0, 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, 876, 844, 812, 780, 748, 716, 684, 652, 620, 588, 556, 524, 492, 460, 428, 396, 372, 356, 340, 324, 308, 292, 276, 260, 244, 228, 212, 196, 180, 164, 148, 132, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0 }; static gint16 alaw_exp_table[256] = { -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368, -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, -22016,-20992,-24064,-23040,-17920,-16896,-19968,-18944, -30208,-29184,-32256,-31232,-26112,-25088,-28160,-27136, -11008,-10496,-12032,-11520, -8960, -8448, -9984, -9472, -15104,-14592,-16128,-15616,-13056,-12544,-14080,-13568, -344, -328, -376, -360, -280, -264, -312, -296, -472, -456, -504, -488, -408, -392, -440, -424, -88, -72, -120, -104, -24, -8, -56, -40, -216, -200, -248, -232, -152, -136, -184, -168, -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184, -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696, -688, -656, -752, -720, -560, -528, -624, -592, -944, -912, -1008, -976, -816, -784, -880, -848, 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736, 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784, 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368, 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944, 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136, 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472, 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568, 344, 328, 376, 360, 280, 264, 312, 296, 472, 456, 504, 488, 408, 392, 440, 424, 88, 72, 120, 104, 24, 8, 56, 40, 216, 200, 248, 232, 152, 136, 184, 168, 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184, 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, 688, 656, 752, 720, 560, 528, 624, 592, 944, 912, 1008, 976, 816, 784, 880, 848 }; void codec_register_g711(void); static void * codec_g711u_init(codec_context_t *ctx _U_) { return NULL; } static void codec_g711u_release(codec_context_t *ctx _U_) { } static unsigned codec_g711u_get_channels(codec_context_t *ctx _U_) { return 1; } static unsigned codec_g711u_get_frequency(codec_context_t *ctx _U_) { return 8000; } static size_t codec_g711u_decode(codec_context_t *ctx _U_, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { const guint8 *dataIn = (const guint8 *) inputBytes; gint16 *dataOut = (gint16 *) outputSamples; size_t i; if (!outputSamples || !outputSamplesSize) { return inputBytesSize * 2; } for (i = 0; i < inputBytesSize; i++) { dataOut[i] = ulaw_exp_table[dataIn[i]]; } *outputSamplesSize = inputBytesSize * 2; return inputBytesSize * 2; } static void * codec_g711a_init(codec_context_t *ctx _U_) { return NULL; } static void codec_g711a_release(codec_context_t *ctx _U_) { } static unsigned codec_g711a_get_channels(codec_context_t *ctx _U_) { return 1; } static unsigned codec_g711a_get_frequency(codec_context_t *ctx _U_) { return 8000; } static size_t codec_g711a_decode(codec_context_t *ctx _U_, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { const guint8 *dataIn = (const guint8 *) inputBytes; gint16 *dataOut = (gint16 *) outputSamples; size_t i; if (!outputSamples || !outputSamplesSize) { return inputBytesSize * 2; } for (i = 0; i < inputBytesSize; i++) { dataOut[i] = alaw_exp_table[dataIn[i]]; } *outputSamplesSize = inputBytesSize * 2; return inputBytesSize * 2; } void codec_register_g711(void) { register_codec("g711U", codec_g711u_init, codec_g711u_release, codec_g711u_get_channels, codec_g711u_get_frequency, codec_g711u_decode); register_codec("g711A", codec_g711a_init, codec_g711a_release, codec_g711a_get_channels, codec_g711a_get_frequency, codec_g711a_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
Text
wireshark/plugins/codecs/G722/CMakeLists.txt
# 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(g722 0 1 0 0) set(CODEC_SRC G722decode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(g722 codecs) target_include_directories(g722 PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(g722 wsutil ${SPANDSP_LIBRARIES}) target_include_directories(g722 SYSTEM PRIVATE ${SPANDSP_INCLUDE_DIRS}) install_plugin(g722 codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME g722 SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/G722/G722decode.c
/* G722decode.c * G.722 codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <glib.h> #include "spandsp.h" #include "wsutil/codecs.h" #include "ws_attributes.h" void codec_register_g722(void); static void * codec_g722_init(codec_context_t *ctx _U_) { g722_decode_state_t *state; /* Valid values for bit_rate for G.722 are 48000, 56000, 64000, but RTP/AVP * profile requires 64kbps, aligned at octets. */ state = g722_decode_init(NULL, 64000, 0); return state; } static void codec_g722_release(codec_context_t *ctx) { g722_decode_state_t *state = (g722_decode_state_t *)ctx->priv; if (!state) { return; /* out-of-memory; */ } /* Note: replaces g722_decode_release since SpanDSP 20090211 */ g722_decode_free(state); } static unsigned codec_g722_get_channels(codec_context_t *ctx _U_) { /* G.722 has only one channel. */ return 1; } static unsigned codec_g722_get_frequency(codec_context_t *ctx _U_) { /* Note: RTP Clock rate is 8kHz due to a historic error, but actual sampling * rate is 16kHz (RFC 3551, section 4.5.2). */ return 16000; } static size_t codec_g722_decode(codec_context_t *ctx, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { g722_decode_state_t *state = (g722_decode_state_t *)ctx->priv; if (!state) { return 0; /* out-of-memory; */ } if (!outputSamples || !outputSamplesSize) { return 4 * inputBytesSize; } /* g722_decode returns the number of 16-bit samples. */ *outputSamplesSize = 2 * g722_decode(state, (int16_t *)outputSamples, (const uint8_t *)inputBytes, (int)inputBytesSize); return *outputSamplesSize; } void codec_register_g722(void) { register_codec("g722", codec_g722_init, codec_g722_release, codec_g722_get_channels, codec_g722_get_frequency, codec_g722_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
Text
wireshark/plugins/codecs/G726/CMakeLists.txt
# 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(g726 0 1 0 0) set(CODEC_SRC G726decode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(g726 codecs) target_include_directories(g726 PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(g726 wsutil ${SPANDSP_LIBRARIES}) target_include_directories(g726 SYSTEM PRIVATE ${SPANDSP_INCLUDE_DIRS}) install_plugin(g726 codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME g726 SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/G726/G726decode.c
/* G726decode.c * G.726 codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <glib.h> #include "spandsp.h" #include "wsutil/codecs.h" #include "ws_attributes.h" typedef struct _g726_codec_ctx { g726_state_t *state; int bit_rate; } g726_codec_ctx; void codec_register_g726(void); static void * codec_g726_init(int bit_rate, int packing) { g726_state_t *decoder = g726_init(NULL, bit_rate, G726_ENCODING_LINEAR, packing); if (!decoder) { return NULL; /* out-of-memory; */ } g726_codec_ctx *state = g_new(g726_codec_ctx, 1); state->state = decoder; state->bit_rate = bit_rate; return state; } static void *codec_g726_16_init(codec_context_t *ctx _U_) { return codec_g726_init(16000, G726_PACKING_RIGHT); } static void *codec_g726_24_init(codec_context_t *ctx _U_) { return codec_g726_init(24000, G726_PACKING_RIGHT); } static void *codec_g726_32_init(codec_context_t *ctx _U_) { return codec_g726_init(32000, G726_PACKING_RIGHT); } static void *codec_g726_40_init(codec_context_t *ctx _U_) { return codec_g726_init(40000, G726_PACKING_RIGHT); } static void *codec_aal2_g726_16_init(codec_context_t *ctx _U_) { return codec_g726_init(16000, G726_PACKING_LEFT); } static void *codec_aal2_g726_24_init(codec_context_t *ctx _U_) { return codec_g726_init(24000, G726_PACKING_LEFT); } static void *codec_aal2_g726_32_init(codec_context_t *ctx _U_) { return codec_g726_init(32000, G726_PACKING_LEFT); } static void *codec_aal2_g726_40_init(codec_context_t *ctx _U_) { return codec_g726_init(40000, G726_PACKING_LEFT); } static void codec_g726_release(codec_context_t *ctx) { g726_codec_ctx *state = (g726_codec_ctx *)(ctx->priv); if (!state) { return; /* out-of-memory; */ } /* Note: replaces g726_release since SpanDSP 20090211 */ g726_free(state->state); g_free(state); } static unsigned codec_g726_get_channels(codec_context_t *ctx _U_) { return 1; } static unsigned codec_g726_get_frequency(codec_context_t *ctx _U_) { return 8000; } static size_t codec_g726_decode(codec_context_t *ctx, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { g726_codec_ctx *state = (g726_codec_ctx *)ctx->priv; if (!state) { return 0; /* out-of-memory; */ } if (!outputSamples || !outputSamplesSize) { /* * sample rate 8kHz, for bitrate 16kHz we have 16/8 = 2 bits/sample, so * 1 input byte (8 bits) will expand to four 16-bit samples. Likewise, * for bitrate 40kHz we have 40/8 = 5 bits/sample. Alternatively: * bitsPerSample = bitRate / sampleRate (8kHz). * outputBytes = (inputBits / bitsPerSample) * sizeof(sample) */ return inputBytesSize * 8 / (state->bit_rate / 8000) * 2; } /* g726_decode returns the number of 16-bit samples. */ *outputSamplesSize = 2 * g726_decode(state->state, (int16_t *)outputSamples, (const uint8_t *) inputBytes, (int)inputBytesSize); return *outputSamplesSize; } void codec_register_g726(void) { register_codec("G726-16", codec_g726_16_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); register_codec("G726-24", codec_g726_24_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); register_codec("G726-32", codec_g726_32_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); register_codec("G726-40", codec_g726_40_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); register_codec("AAL2-G726-16", codec_aal2_g726_16_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); register_codec("AAL2-G726-24", codec_aal2_g726_24_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); register_codec("AAL2-G726-32", codec_aal2_g726_32_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); register_codec("AAL2-G726-40", codec_aal2_g726_40_init, codec_g726_release, codec_g726_get_channels, codec_g726_get_frequency, codec_g726_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
Text
wireshark/plugins/codecs/G729/CMakeLists.txt
# 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(g729 0 1 0 0) set(CODEC_SRC G729decode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(g729 codecs) target_include_directories(g729 PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(g729 wsutil ${BCG729_LIBRARIES}) target_include_directories(g729 SYSTEM PRIVATE ${BCG729_INCLUDE_DIRS}) install_plugin(g729 codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME g729 SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/G729/G729decode.c
/* G729decode.c * G.729 codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <glib.h> #include "bcg729/decoder.h" #include "wsutil/codecs.h" #include "ws_attributes.h" void codec_register_g729(void); static void * codec_g729_init(codec_context_t *ctx _U_) { return initBcg729DecoderChannel(); } static void codec_g729_release(codec_context_t *ctx) { closeBcg729DecoderChannel((bcg729DecoderChannelContextStruct *)ctx->priv); } static unsigned codec_g729_get_channels(codec_context_t *ctx _U_) { return 1; } static unsigned codec_g729_get_frequency(codec_context_t *ctx _U_) { return 8000; } static size_t codec_g729_decode(codec_context_t *ctx, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { bcg729DecoderChannelContextStruct *state = (bcg729DecoderChannelContextStruct *)ctx->priv; const guint8 *dataIn = (const guint8 *) inputBytes; gint16 *dataOut = (gint16 *) outputSamples; size_t i; if (!ctx) { return 0; } size_t full_frames = inputBytesSize / 10; /* Almost surely only one SID frame. SID frames come at the end of the payload, and 10 ms packets can be used when transitioning to avoid ambiguity. (RFC 3551 4.5.6 "G729") */ size_t sid_frames = (inputBytesSize % 10) / 2; if (!outputSamples || !outputSamplesSize) { return 80*2*(full_frames + sid_frames); } /* The G729 algorithm encodes 10ms of voice into 80bit (10 bytes). Based on the RTP packetization period (usually 20ms), we need to pass to the bcg729 decoder chunks of 10ms (10 bytes) */ for (i = 0; i < full_frames; i++) { /* As of version 1.1.0, the bcg729 decoder library declares the second argument to bcg729Decoder() to be a const pointer, but prior to that it did not (though it didn't modify the input and could be fixed to accept a const pointer.) Cast away the problem for now; in the future we could check the version of the library. */ bcg729Decoder(state, (guint8 *)dataIn + i*10, 10, 0, 0, 0, dataOut + i*80); } for (; i < full_frames + sid_frames; i++) { bcg729Decoder(state, (guint8 *)dataIn + full_frames*10 + (i - full_frames)*2, 2, 0, 1, 0, dataOut + i*80); } *outputSamplesSize = 80*2*(full_frames + sid_frames); return *outputSamplesSize; } void codec_register_g729(void) { register_codec("g729", codec_g729_init, codec_g729_release, codec_g729_get_channels, codec_g729_get_frequency, codec_g729_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
Text
wireshark/plugins/codecs/iLBC/CMakeLists.txt
# 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(ilbc 0 1 0 0) set(CODEC_SRC iLBCdecode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(ilbc codecs) target_include_directories(ilbc PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(ilbc wsutil ${ILBC_LIBRARIES}) target_include_directories(ilbc SYSTEM PRIVATE ${ILBC_INCLUDE_DIRS}) install_plugin(ilbc codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME ilbc SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/iLBC/iLBCdecode.c
/* iLBCdecode.c * iLBC codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <stdio.h> #include <glib.h> #include "ilbc.h" #include "wsutil/codecs.h" #include "ws_attributes.h" #define ILBC_20MS 20 #define ILBC_30MS 30 #define ILBC_PAYLOAD_LEN_20MS 38 #define ILBC_PAYLOAD_LEN_30MS 50 #define SAMPLE_SIZE 2 typedef struct { #ifdef LIBILBC_VERSION_MAJOR IlbcDecoderInstance *ilbc_ctx; /* Real iLBC context */ #else iLBC_decinst_t *ilbc_ctx; /* Real iLBC context */ #endif guint8 payload_len; /* Remember last payload_len */ } ilbc_ctx_t; void codec_register_iLBC(void); static void * codec_iLBC_init(codec_context_t *ctx _U_) { ilbc_ctx_t *priv; priv=(ilbc_ctx_t *)g_malloc0(sizeof(*priv)); WebRtcIlbcfix_DecoderCreate(&(priv->ilbc_ctx)); return priv; } static void codec_iLBC_release(codec_context_t *ctx) { WebRtcIlbcfix_DecoderFree(((ilbc_ctx_t *)ctx->priv)->ilbc_ctx); g_free(ctx); } static unsigned codec_iLBC_get_channels(codec_context_t *ctx _U_) { return 1; } static unsigned codec_iLBC_get_frequency(codec_context_t *ctx _U_) { return 8000; } static size_t codec_iLBC_decode(codec_context_t *ctx, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { int16_t speechType; // Not used in Wireshark code #ifdef LIBILBC_VERSION_MAJOR int8_t *dataIn = (int8_t *)inputBytes; #else int16_t *dataIn = (int16_t *)inputBytes; #endif int16_t *dataOut = (int16_t *)outputSamples; ilbc_ctx_t *dataCtx = (ilbc_ctx_t *)ctx->priv; size_t outputSamplesCount; if (!outputSamples || !outputSamplesSize) { if (0 == inputBytesSize%ILBC_PAYLOAD_LEN_20MS) { /* 20ms packet size = 160 samples = 320 bytes */ return BLOCKL_20MS*SAMPLE_SIZE; } else if (0 == inputBytesSize%ILBC_PAYLOAD_LEN_30MS) { /* 30ms packet size = 240 samples = 480 bytes */ return BLOCKL_30MS*SAMPLE_SIZE; } else { /* unknown packet size */ return 0; } } if (0 == inputBytesSize%ILBC_PAYLOAD_LEN_20MS) { /* 20ms packet size */ if (dataCtx->payload_len != ILBC_20MS) { WebRtcIlbcfix_DecoderInit(dataCtx->ilbc_ctx, ILBC_20MS); dataCtx->payload_len = ILBC_20MS; } outputSamplesCount = WebRtcIlbcfix_Decode(dataCtx->ilbc_ctx, dataIn, (int16_t)inputBytesSize, dataOut, &speechType); } else if (0 == inputBytesSize%ILBC_PAYLOAD_LEN_30MS) { /* 30ms packet size */ if (dataCtx->payload_len != ILBC_30MS) { WebRtcIlbcfix_DecoderInit(dataCtx->ilbc_ctx, ILBC_30MS); dataCtx->payload_len = ILBC_30MS; } outputSamplesCount = WebRtcIlbcfix_Decode(dataCtx->ilbc_ctx, dataIn, (int16_t)inputBytesSize, dataOut, &speechType); } else { /* unknown packet size */ outputSamplesCount = 0; } /* WebRtcIlbcfix_Decode returns count of samples, but we return count of bytes */ *outputSamplesSize = outputSamplesCount*SAMPLE_SIZE; return *outputSamplesSize; } void codec_register_iLBC(void) { register_codec("iLBC", codec_iLBC_init, codec_iLBC_release, codec_iLBC_get_channels, codec_iLBC_get_frequency, codec_iLBC_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
Text
wireshark/plugins/codecs/l16_mono/CMakeLists.txt
# 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(l16mono 0 1 0 0) set(CODEC_SRC l16decode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(l16mono codecs) target_include_directories(l16mono PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(l16mono wsutil) install_plugin(l16mono codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME l16mono SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/l16_mono/l16decode.c
/* l16decode.c * 16-bit audio, mono codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <glib.h> #include <string.h> #include "wsutil/codecs.h" #include "ws_attributes.h" void codec_register_l16(void); static void * codec_l16_init(codec_context_t *ctx _U_) { return NULL; } static void * codec_l16_mono_init(codec_context_t *ctx) { /* L16 mono as registered as PT 11 */ ctx->sample_rate = 44100; ctx->channels = 1; return NULL; } static void * codec_l16_stereo_init(codec_context_t *ctx) { /* L16 stereo as registered as PT 10 */ ctx->sample_rate = 44100; /* In practice, we will downmix to mono. */ ctx->channels = 2; return NULL; } static void codec_l16_release(codec_context_t *ctx _U_) { } static unsigned codec_l16_get_channels(codec_context_t *ctx _U_) { /* XXX: Downmix to mono regardless of the actual number of channels * because RTP Player expects mono, and doesn't actually do anything * with this. */ return 1; } static unsigned codec_l16_get_frequency(codec_context_t *ctx) { return ctx->sample_rate ? ctx->sample_rate : 44100; } static size_t codec_l16_decode(codec_context_t *ctx _U_, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { const guint16 *dataIn = (const guint16 *)inputBytes; guint16 *dataOut = (gint16 *)outputSamples; size_t i; unsigned channels = ctx->channels ? ctx->channels : 1; if (!outputSamples || !outputSamplesSize) { return inputBytesSize/channels; } /* Downmix to mono. No worries about overflow because tmp is 32 bit. */ for (i=0; i<inputBytesSize/(2 * channels); i++) { gint32 tmp = 0; for (unsigned j=0; j < channels; j++) { tmp += (gint16)g_ntohs(dataIn[channels*i + j]); } dataOut[i] = (gint16)(tmp / channels); } *outputSamplesSize = inputBytesSize/channels; return *outputSamplesSize; } void codec_register_l16(void) { register_codec("16-bit audio, monaural", codec_l16_mono_init, codec_l16_release, codec_l16_get_channels, codec_l16_get_frequency, codec_l16_decode); register_codec("16-bit audio, stereo", codec_l16_stereo_init, codec_l16_release, codec_l16_get_channels, codec_l16_get_frequency, codec_l16_decode); register_codec("L16", codec_l16_init, codec_l16_release, codec_l16_get_channels, codec_l16_get_frequency, codec_l16_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
wireshark/plugins/codecs/l16_mono/README
This codec plugin serves a dual purpose. First it is to add L16 codec suppport to Wireshark. Second it is an illustration of a basic codec plugin module.
Text
wireshark/plugins/codecs/opus_dec/CMakeLists.txt
# 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(opus_dec 0 1 0 0) set(CODEC_SRC opusdecode.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(opus_dec codecs) target_include_directories(opus_dec PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(opus_dec wsutil ${OPUS_LIBRARIES}) target_include_directories(opus_dec SYSTEM PRIVATE ${OPUS_INCLUDE_DIRS}) install_plugin(opus_dec codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME opus SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/opus_dec/opusdecode.c
/* opusdecode.c * opus codec * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <stdlib.h> #include "opus/opus.h" #include "wsutil/codecs.h" #include "ws_attributes.h" void codec_register_opus(void); static void * codec_opus_init(codec_context_t *ctx _U_) { OpusDecoder *state; int err = OPUS_INTERNAL_ERROR; /* Opus has in-band signaling and can convert what is sent to our * desired output. * always use maximum 48000 to cover all 8k/12k/16k/24k/48k * always downmix to mono because RTP Player only supports mono now */ state = opus_decoder_create(48000, 1, &err); return state; } static void codec_opus_release(codec_context_t *ctx) { OpusDecoder* state = (OpusDecoder*)ctx->priv; if (!state) { return; /* out-of-memory; */ } opus_decoder_destroy(state); } static unsigned codec_opus_get_channels(codec_context_t *ctx _U_) { return 1; } static unsigned codec_opus_get_frequency(codec_context_t *ctx _U_) { /* although can set kinds of fs, but we set 48K now */ return 48000; } static size_t codec_opus_decode(codec_context_t *ctx, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes) { OpusDecoder *state = (OpusDecoder *)ctx->priv; if (!state) { return 0; /* out-of-memory */ } const unsigned char *data = (const unsigned char *)input; opus_int32 len = (opus_int32)inputSizeBytes; int frame_samples = opus_decoder_get_nb_samples(state, data, len); if (frame_samples < 0) { // OPUS_INVALID_PACKET return 0; } // reserve space for the first time if (!output || !outputSizeBytes) { return frame_samples*2; } opus_int16 *pcm = (opus_int16*)(output); int ret = opus_decode(state, data, len, pcm, frame_samples, 0); if (ret < 0) { return 0; } *outputSizeBytes = ret * 2; return *outputSizeBytes; } void codec_register_opus(void) { register_codec("opus", codec_opus_init, codec_opus_release, codec_opus_get_channels, codec_opus_get_frequency, codec_opus_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
Text
wireshark/plugins/codecs/sbc/CMakeLists.txt
# 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(sbc 0 1 0 0) set(CODEC_SRC sbc.c ) set(PLUGIN_FILES plugin.c ${CODEC_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin_codec ${CODEC_SRC} ) add_wireshark_plugin_library(sbc codecs) target_include_directories(sbc PRIVATE ${CMAKE_SOURCE_DIR}/codecs) target_link_libraries(sbc wsutil ${SBC_LIBRARIES}) target_include_directories(sbc SYSTEM PRIVATE ${SBC_INCLUDE_DIRS}) install_plugin(sbc codecs) file(GLOB CODEC_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME sbc SWITCHES SOURCES ${CODEC_SRC} ${CODEC_HEADERS} ) # # 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: #
C
wireshark/plugins/codecs/sbc/sbc.c
/* sbc.c * Support for external Bluetooth SBC codec * * Copyright 2012, Michal Labedzki for Tieto Corporation * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <wireshark.h> #include <sbc/sbc.h> #include "wsutil/codecs.h" #define SBC_BUFFER 8192 void codec_register_sbc(void); static void * codec_sbc_init(codec_context_t *ctx _U_) { sbc_t *sbc; sbc = g_new(sbc_t, 1); sbc_init(sbc, 0L); return sbc; } static void codec_sbc_release(codec_context_t *ctx) { sbc_t *sbc = (sbc_t *) ctx->priv; sbc_finish(sbc); g_free(sbc); } static unsigned codec_sbc_get_channels(codec_context_t *ctx) { sbc_t *sbc = (sbc_t *) ctx->priv; if (sbc->mode == SBC_MODE_MONO) return 1; return 2; } static unsigned codec_sbc_get_frequency(codec_context_t *ctx) { sbc_t *sbc = (sbc_t *) ctx->priv; int frequency; switch (sbc->frequency) { case SBC_FREQ_16000: frequency = 16000; break; case SBC_FREQ_32000: frequency = 32000; break; case SBC_FREQ_44100: frequency = 44100; break; case SBC_FREQ_48000: frequency = 48000; break; default: frequency = 0; } return frequency; } static size_t codec_sbc_decode(codec_context_t *ctx, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes) { size_t size_in = (size_t) inputSizeBytes; size_t size_out = SBC_BUFFER; size_t len; size_t framelen; size_t xframe_pos = 0; const guint8 *data_in = (const guint8 *) input; guint8 *data_out = (guint8 *) output; sbc_t *sbc = (sbc_t *) ctx->priv; guint8 *i_data; guint8 tmp; if (!output || !outputSizeBytes) { return size_out; } sbc->endian = SBC_BE; *outputSizeBytes = 0; while (xframe_pos < inputSizeBytes) { framelen = sbc_decode(sbc, data_in, size_in, data_out, size_out, &len); xframe_pos += framelen; data_in += framelen; *outputSizeBytes += len; for (i_data = data_out; i_data < data_out + len; i_data += 2) { tmp = i_data[0]; i_data[0] = i_data[1]; i_data[1] = tmp; } data_out += len; } return *outputSizeBytes; } void codec_register_sbc(void) { register_codec("SBC", codec_sbc_init, codec_sbc_release, codec_sbc_get_channels, codec_sbc_get_frequency, codec_sbc_decode); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
wireshark/plugins/epan/ethercat/AUTHORS
Author : Richard Kuemmel <r.kuemmel[AT]beckhoff.de> Updates and bugfixes: Peter Johansson <peterjohansson73[AT]gmail.com>
Text
wireshark/plugins/epan/ethercat/CMakeLists.txt
# 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(ethercat 0 1 0 0) set(DISSECTOR_SRC packet-ams.c packet-ecatmb.c packet-esl.c packet-ethercat-datagram.c packet-ethercat-frame.c packet-ioraw.c packet-nv.c ) set(PLUGIN_FILES plugin.c ${DISSECTOR_SRC} ) set_source_files_properties( ${PLUGIN_FILES} PROPERTIES COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" ) register_plugin_files(plugin.c plugin ${DISSECTOR_SRC} ) add_wireshark_plugin_library(ethercat epan) target_link_libraries(ethercat epan) install_plugin(ethercat epan) file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") CHECKAPI( NAME ethercat SWITCHES --group dissectors-prohibited --group dissectors-restricted SOURCES ${DISSECTOR_SRC} ${DISSECTOR_HEADERS} ) # # 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: #
C
wireshark/plugins/epan/ethercat/packet-ams.c
/* packet-ams.c * Routines for ethercat packet disassembly * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Include files */ #include "config.h" #include <epan/packet.h> #include "packet-ams.h" void proto_register_ams(void); void proto_reg_handoff_ams(void); #define AMS_TCP_PORT 48898 /* Not IANA registered */ /* Define the ams proto */ int proto_ams = -1; static dissector_handle_t amstcp_handle; /* Define the tree for ams */ static int ett_ams = -1; static int ett_ams_stateflags = -1; static int ett_ams_adsreadrequest = -1; static int ett_ams_adsreadresponse = -1; static int ett_ams_adswriterequest = -1; static int ett_ams_adswriteresponse = -1; static int ett_ams_adsreadwriterequest = -1; static int ett_ams_adsreadwriteresponse = -1; static int ett_ams_adsreadstaterequest = -1; static int ett_ams_adsreadstateresponse = -1; static int ett_ams_adswritectrlrequest = -1; static int ett_ams_adswritectrlresponse = -1; static int ett_ams_adsreaddinforequest = -1; static int ett_ams_adsreaddinforesponse = -1; static int ett_ams_adsadddnrequest = -1; static int ett_ams_adsadddnresponse = -1; static int ett_ams_adsdeldnrequest = -1; static int ett_ams_adsdeldnresponse = -1; static int ett_ams_adsdnrequest = -1; static int hf_ams_sendernetid = -1; static int hf_ams_senderport = -1; static int hf_ams_targetnetid = -1; static int hf_ams_targetport = -1; static int hf_ams_cmdid = -1; static int hf_ams_stateflags = -1; static int hf_ams_stateresponse = -1; static int hf_ams_statenoreturn = -1; static int hf_ams_stateadscmd = -1; static int hf_ams_statesyscmd = -1; static int hf_ams_statehighprio = -1; static int hf_ams_statetimestampadded = -1; static int hf_ams_stateudp = -1; static int hf_ams_stateinitcmd = -1; static int hf_ams_statebroadcast = -1; static int hf_ams_cbdata = -1; static int hf_ams_errorcode = -1; static int hf_ams_invokeid = -1; static int hf_ams_data = -1; /*ads Commands */ static int hf_ams_adsindexgroup = -1; static int hf_ams_adsindexoffset = -1; static int hf_ams_adscblength = -1; static int hf_ams_adsreadrequest = -1; static int hf_ams_adsreadresponse = -1; static int hf_ams_adsinvokeid = -1; static int hf_ams_adsresult = -1; static int hf_ams_adsdata = -1; static int hf_ams_adswriterequest = -1; static int hf_ams_adswriteresponse = -1; static int hf_ams_adsreadwriterequest = -1; static int hf_ams_adsreadwriteresponse = -1; static int hf_ams_adscbreadlength = -1; static int hf_ams_adscbwritelength = -1; static int hf_ams_adsstate = -1; static int hf_ams_adsdevicestate = -1; static int hf_ams_adsnotificationhandle = -1; static int hf_ams_adsreadstaterequest = -1; static int hf_ams_adsreadstateresponse = -1; static int hf_ams_adswritectrlrequest = -1; static int hf_ams_adswritectrlresponse = -1; static int hf_ams_adsreaddinforequest = -1; static int hf_ams_adsreaddinforesponse = -1; static int hf_ams_adsadddnrequest = -1; static int hf_ams_adsadddnresponse = -1; static int hf_ams_adsdeldnrequest = -1; static int hf_ams_adsdeldnresponse = -1; static int hf_ams_adsdnrequest = -1; /* static int hf_ams_adsdnresponse = -1; */ /* static int hf_ams_adsnoteattrib = -1; */ /* static int hf_ams_adsnoteblocks = -1; */ /* static int hf_ams_adsversion = -1; */ static int hf_ams_adsdevicename = -1; static int hf_ams_adsversionversion = -1; static int hf_ams_adsversionrevision = -1; static int hf_ams_adsversionbuild = -1; static int hf_ams_adsnoteblocksstamps = -1; /* static int hf_ams_adsnoteblocksstamp = -1; */ /* static int hf_ams_adstimestamp = -1; */ /* static int hf_ams_adssamplecnt = -1; */ /* static int hf_ams_adsnoteblockssample = -1; */ static int hf_ams_adstransmode = -1; static int hf_ams_adsmaxdelay = -1; static int hf_ams_adscycletime = -1; /* static int hf_ams_adscmpmax = -1; */ /* static int hf_ams_adscmpmin = -1; */ static dissector_handle_t ams_handle; static const value_string TransMode[] = { { 0, "NO TRANS"}, { 1, "CLIENT CYCLE"}, { 2, "CLIENT ON CHANGE"}, { 3, "SERVER CYCLE"}, { 4, "SERVER ON CHANGE"}, { 10, "CLIENT FIRST REQUEST"}, { 0, NULL } }; static const value_string ErrorCode[] = { { ERR_NOERROR, "NO ERROR"}, { ERR_INTERNAL, "INTERNAL"}, { ERR_NORTIME, "NO RTIME"}, { ERR_ALLOCLOCKEDMEM, "ALLOC LOCKED MEM"}, { ERR_INSERTMAILBOX, "INSERT MAILBOX"}, { ERR_WRONGRECEIVEHMSG, "WRONGRECEIVEHMSG"}, { ERR_TARGETPORTNOTFOUND, "TARGET PORT NOT FOUND"}, { ERR_TARGETMACHINENOTFOUND, "TARGET MACHINE NOT FOUND"}, { ERR_UNKNOWNCMDID, "UNKNOWN CMDID"}, { ERR_BADTASKID, "BAD TASKID"}, { ERR_NOIO, "NOIO"}, { ERR_UNKNOWNAMSCMD, "UNKNOWN AMSCMD"}, { ERR_WIN32ERROR, "WIN32 ERROR"}, { ERR_PORTNOTCONNECTED, "PORT NOT CONNECTED"}, { ERR_INVALIDAMSLENGTH, "INVALID AMS LENGTH"}, { ERR_INVALIDAMSNETID, "INVALID AMS NETID"}, { ERR_LOWINSTLEVEL, "LOW INST LEVEL"}, { ERR_NODEBUGINTAVAILABLE, "NO DEBUG INT AVAILABLE"}, { ERR_PORTDISABLED, "PORT DISABLED"}, { ERR_PORTALREADYCONNECTED, "PORT ALREADY CONNECTED"}, { ERR_AMSSYNC_W32ERROR, "AMSSYNC_W32ERROR"}, { ERR_AMSSYNC_TIMEOUT, "AMSSYNC_TIMEOUT"}, { ERR_AMSSYNC_AMSERROR, "AMSSYNC_AMSERROR"}, { ERR_AMSSYNC_NOINDEXINMAP, "AMSSYNC_NOINDEXINMAP"}, { ERR_INVALIDAMSPORT, "INVALID AMSPORT"}, { ERR_NOMEMORY, "NO MEMORY"}, { ERR_TCPSEND, "TCP SEND"}, { ERR_HOSTUNREACHABLE, "HOST UNREACHABLE"}, { ROUTERERR_NOLOCKEDMEMORY, "ROUTERERR_NOLOCKEDMEMORY"}, { ROUTERERR_RESIZEMEMORY, "ROUTERERR_RESIZEMEMORY"}, { ROUTERERR_MAILBOXFULL, "ROUTERERR_MAILBOXFULL"}, { ROUTERERR_DEBUGBOXFULL, "ROUTERERR_DEBUGBOXFULL"}, { ROUTERERR_UNKNOWNPORTTYPE, "ROUTERERR_UNKNOWNPORTTYPE"}, { ROUTERERR_NOTINITIALIZED, "ROUTERERR_NOTINITIALIZED"}, { ROUTERERR_PORTALREADYINUSE, "ROUTERERR_PORTALREADYINUSE"}, { ROUTERERR_NOTREGISTERED, "ROUTERERR_NOTREGISTERED "}, { ROUTERERR_NOMOREQUEUES, "ROUTERERR_NOMOREQUEUES"}, { ROUTERERR_INVALIDPORT, "ROUTERERR_INVALIDPORT"}, { ROUTERERR_NOTACTIVATED, "ROUTERERR_NOTACTIVATED"}, { IOERR_INTERNAL, "IOERR_INTERNAL"}, { IOERR_BADCARDNO, "IOERR_BADCARDNO"}, { IOERR_INVALIDCARDADDR, "IOERR_INVALIDCARDADDR"}, { IOERR_CDLLISTFULL, "IOERR_CDLLISTFULL"}, { IOERR_BADCDLPARAM, "IOERR_BADCDLPARAM"}, { IOERR_OPENIOFAILED, "IOERR_OPENIOFAILED"}, { IOERR_RESETIOFAILED, "IOERR_RESETIOFAILED"}, { IOERR_UNKNOWNDEVICE, "IOERR_UNKNOWNDEVICE"}, { IOERR_UNKNOWNDEVICEID, "IOERR_UNKNOWNDEVICEID"}, { IOERR_UNKNOWNIMAGEID, "IOERR_UNKNOWNIMAGEID"}, { IOERR_GETIOSTATE, "IOERR_GETIOSTATE"}, { IOERR_BADIMAGEID, "IOERR_BADIMAGEID"}, { IOERR_NOMORECLIENTSPACE, "IOERR_NOMORECLIENTSPACE"}, { IOERR_CLIENTINFONOTFOUND, "IOERR_CLIENTINFONOTFOUND"}, { IOERR_CDLNOTINUSE, "IOERR_CDLNOTINUSE"}, { IOERR_TIMEOUTWITHDEVICE, "IOERR_TIMEOUTWITHDEVICE"}, { IOERR_C1220FUNC_1, "IOERR_C1220FUNC_1"}, { IOERR_C1220FUNC_9, "IOERR_C1220FUNC_9"}, { IOERR_C1220FUNC_C, "IOERR_C1220FUNC_C"}, { IOERR_C1220FUNC_10, "IOERR_C1220FUNC_10"}, { IOERR_C1220FUNC_1_MAXSEND, "IOERR_C1220FUNC_1_MAXSEND"}, { IOERR_C1220FUNC_1_ADDRSET, "IOERR_C1220FUNC_1_ADDRSET"}, { IOERR_C1220FUNC_1_BREAK, "IOERR_C1220FUNC_1_BREAK"}, { IOERR_C1220FUNC_1_BREAK0, "IOERR_C1220FUNC_1_BREAK0"}, { IOERR_C1220FUNC_1_BREAK1, "IOERR_C1220FUNC_1_BREAK1"}, { IOERR_C1220FUNC_1_BREAK2, "IOERR_C1220FUNC_1_BREAK2"}, { IOERR_C1220FUNC_1_BREAK3, "IOERR_C1220FUNC_1_BREAK3"}, { IOERR_C1220FUNC_1_BREAK4, "IOERR_C1220FUNC_1_BREAK4"}, { IOERR_C1220FUNC_1_BREAK5, "IOERR_C1220FUNC_1_BREAK5"}, { IOERR_C1220FUNC_1_BREAK6, "IOERR_C1220FUNC_1_BREAK6"}, { IOERR_C1220FUNC_1_BREAK7, "IOERR_C1220FUNC_1_BREAK7"}, { IOERR_C1220FUNC_1_BREAK8, "IOERR_C1220FUNC_1_BREAK8"}, { IOERR_C1220FUNC_1_BREAK9, "IOERR_C1220FUNC_1_BREAK9"}, { IOERR_C1220FUNC_1_BREAK10, "IOERR_C1220FUNC_1_BREAK10"}, { IOERR_C1220FUNC_1_BREAK11, "IOERR_C1220FUNC_1_BREAK11"}, { IOERR_C1220FUNC_1_BREAK12, "IOERR_C1220FUNC_1_BREAK12"}, { IOERR_C1220FUNC_1_BREAK13, "IOERR_C1220FUNC_1_BREAK13"}, { IOERR_C1220FUNC_1_BREAK14, "IOERR_C1220FUNC_1_BREAK14"}, { IOERR_C1220FUNC_1_BREAK15, "IOERR_C1220FUNC_1_BREAK15"}, { IOERR_C1220FUNC_1_BREAK16, "IOERR_C1220FUNC_1_BREAK16"}, { IOERR_SPC3DEVINITDP, "IOERR_SPC3DEVINITDP"}, { IOERR_SPC3UPDATEOUTPUT, "IOERR_SPC3UPDATEOUTPUT"}, { IOERR_CIF30READDIAG, "IOERR_CIF30READDIAG"}, { IOERR_CIF30COMMNOTSTARTED, "IOERR_CIF30COMMNOTSTARTED"}, { IOERR_CIF30SLAVEPARASIZE, "IOERR_CIF30SLAVEPARASIZE"}, { IOERR_CIF30NOPARAS, "IOERR_CIF30NOPARAS"}, { IOERR_CIF30SLAVEERROR, "IOERR_CIF30SLAVEERROR"}, { IOERR_CIF30WATCHDOGEXPIRED, "IOERR_CIF30WATCHDOGEXPIRED"}, { IOERR_UNKNOWNDEVICECMD, "IOERR_UNKNOWNDEVICECMD"}, { IOERR_CIF40MESSAGEHANDLING, "IOERR_CIF40MESSAGEHANDLING"}, { IOERR_CIF40PARAERROR, "IOERR_CIF40PARAERROR"}, { IOERR_CIF40WATCHDOGEXPIRED, "IOERR_CIF40WATCHDOGEXPIRED"}, { IOERR_CIF40FLAGERROR, "IOERR_CIF40FLAGERROR"}, { IOERR_CIF40COMMNOTSTARTED, "IOERR_CIF40COMMNOTSTARTED"}, { IOERR_CIF40READDIAG, "IOERR_CIF40READDIAG"}, { IOERR_CIF40SLAVEERROR, "IOERR_CIF40SLAVEERROR"}, { IOERR_CIF40GLOBALERROR, "IOERR_CIF40GLOBALERROR"}, { IOERR_CIF40CONFIGLIST, "IOERR_CIF40CONFIGLIST"}, { IOERR_CP5412A2SLAVEPARASIZE, "IOERR_CP5412A2SLAVEPARASIZE"}, { IOERR_CP5412A2NOPARAS, "IOERR_CP5412A2NOPARAS"}, { IOERR_CP5412A2SLAVEERROR, "IOERR_CP5412A2SLAVEERROR"}, { IOERR_CP5412A2FATAL, "IOERR_CP5412A2FATAL"}, { IOERR_CP5412A2MAILBOXUSED, "IOERR_CP5412A2MAILBOXUSED"}, { IOERR_BEGINCONFIGWHILETICKER, "IOERR_BEGINCONFIGWHILETICKER"}, { IOERR_UNEXPECTEDBOXCOUNT, "IOERR_UNEXPECTEDBOXCOUNT"}, { IOERR_C1200CHECKADDR, "IOERR_C1200CHECKADDR"}, { IOERR_C1200INTENSITYTEST, "IOERR_C1200INTENSITYTEST"}, { IOERR_NOIMAGE, "IOERR_NOIMAGE"}, { IOERR_INVALIDIMAGEOFFSSIZE, "IOERR_INVALIDIMAGEOFFSSIZE"}, { IOERR_FORCESCOUNTEXCEEDEDMAXIMUM, "IOERR_FORCESCOUNTEXCEEDEDMAXIMUM"}, { IOERR_SERCOSLIFECOUNTERERR, "IOERR_SERCOSLIFECOUNTERERR"}, { IOERR_C1220NOTFOUND, "IOERR_C1220NOTFOUND"}, { IOERR_AMSDEVICENOAMSINTF, "IOERR_AMSDEVICENOAMSINTF"}, { IOERR_AMSDEVICEAMSCMDIDNOTSUPP, "IOERR_AMSDEVICEAMSCMDIDNOTSUPP"}, { IOERR_AMSDEVICEAMSSERVICERUNNING, "IOERR_AMSDEVICEAMSSERVICERUNNING"}, { IOERR_PLCINTERFACE_BUSY, "IOERR_PLCINTERFACE_BUSY"}, { IOERR_PLCINTERFACE_FAULT, "IOERR_PLCINTERFACE_FAULT"}, { IOERR_PLCINTERFACE_TIMEOUT, "IOERR_PLCINTERFACE_TIMEOUT"}, { IOERR_PLCINTERFACE_RESETTIMEOUT, "IOERR_PLCINTERFACE_RESETTIMEOUT"}, { IOERR_PLCINTERFACE_NODATAEXCH, "IOERR_PLCINTERFACE_NODATAEXCH"}, { IOERR_PLCINTERFACE_RESET, "IOERR_PLCINTERFACE_RESET"}, { IOERR_CP5412A2INVALIDADDR, "IOERR_CP5412A2INVALIDADDR"}, { IOERR_CP5412A2INVALIDPORT, "IOERR_CP5412A2INVALIDPORT"}, { IOERR_AMSDEVICEBADBOXNO, "IOERR_AMSDEVICEBADBOXNO"}, { IOERR_AMSDEVICEBADTYPE, "IOERR_AMSDEVICEBADTYPE"}, { IOERR_AMSDEVICEILLEGALADDRESS, "IOERR_AMSDEVICEILLEGALADDRESS"}, { IOERR_CP5412A2INVALIDBOX, "IOERR_CP5412A2INVALIDBOX"}, { IOERR_AMSDEVICEFIFOOVERFLOW, "IOERR_AMSDEVICEFIFOOVERFLOW"}, { IOERR_AMSDEVICEAMSSEQUENCEERROR, "IOERR_AMSDEVICEAMSSEQUENCEERROR"}, { IOERR_CP5412A2DPV1SYNTAXERROR, "IOERR_CP5412A2DPV1SYNTAXERROR"}, { IOERR_CP5412A2DEVICENOTRUNNING, "IOERR_CP5412A2DEVICENOTRUNNING"}, { IOERR_AMSDEVICENOTRUNNING, "IOERR_AMSDEVICENOTRUNNING"}, { IOERR_AMSDEVICEBOXNOTDEFINED, "IOERR_AMSDEVICEBOXNOTDEFINED"}, { IOERR_CP5412A2BADSERVICEPARA, "IOERR_CP5412A2BADSERVICEPARA"}, { IOERR_CP5412A2FIFOOVERFLOW, "IOERR_CP5412A2FIFOOVERFLOW"}, { IOERR_COMPORTOPENFAILED, "IOERR_COMPORTOPENFAILED"}, { IOERR_CIF30BADMESSAGERESPONSE, "IOERR_CIF30BADMESSAGERESPONSE"}, { IOERR_CIF30DELETEDATABASE, "IOERR_CIF30DELETEDATABASE"}, { IOERR_CIF30STARTSEQFAILED, "IOERR_CIF30STARTSEQFAILED"}, { IOERR_CIF30DOWNLOADFAILED, "IOERR_CIF30DOWNLOADFAILED"}, { IOERR_CIF30ENDSEQFAILED, "IOERR_CIF30ENDSEQFAILED"}, { IOERR_CIF30BUSLOADFAILED, "IOERR_CIF30BUSLOADFAILED"}, { IOERR_PLCINTERFACE_RESETREQ, "IOERR_PLCINTERFACE_RESETREQ"}, { IOERR_CP5412A2INVALIDCYCLETICKS, "IOERR_CP5412A2INVALIDCYCLETICKS"}, { IOERR_CP5412A2DPBUSFAULT, "IOERR_CP5412A2DPBUSFAULT"}, { IOERR_INVALIDTERMCONFIG, "IOERR_INVALIDTERMCONFIG"}, { IOERR_SERCANSBREAK, "IOERR_SERCANSBREAK"}, { IOERR_SERCANSPHASE0, "IOERR_SERCANSPHASE0"}, { IOERR_SERCANSPHASE1, "IOERR_SERCANSPHASE1"}, { IOERR_SERCANSPHASE2, "IOERR_SERCANSPHASE2"}, { IOERR_SERCANSPHASE3, "IOERR_SERCANSPHASE3"}, { IOERR_SERCANSPHASE4, "IOERR_SERCANSPHASE4"}, { IOERR_SERCANSNCSERVICECHNFAILED, "IOERR_SERCANSNCSERVICECHNFAILED"}, { IOERR_RESOURCECONFICT, "IOERR_RESOURCECONFICT"}, { IOERR_C1220INITSTRINGCOMM, "IOERR_C1220INITSTRINGCOMM"}, { IOERR_C1220REGSTRINGSLAVE, "IOERR_C1220REGSTRINGSLAVE"}, { IOERR_C1220STRREGFAULT, "IOERR_C1220STRREGFAULT"}, { IOERR_IOSTATEBUSY, "IOERR_IOSTATEBUSY"}, { IOERR_IBSSCITWATCHDOGEXPIRED, "IOERR_IBSSCITWATCHDOGEXPIRED"}, { IOERR_IBSSCITSYNCMAILBOXERROR, "IOERR_IBSSCITSYNCMAILBOXERROR"}, { IOERR_IBSSCITCONFIRMDIAGERROR, "IOERR_IBSSCITCONFIRMDIAGERROR"}, { IOERR_IBSSCITCREATECFGERROR, "IOERR_IBSSCITCREATECFGERROR"}, { 0, NULL } }; static const value_string AdsErrorMode[] = { { ADSERR_NOERR, "NO ERROR", }, { ADSERR_DEVICE_ERROR, "ERROR", }, { ADSERR_DEVICE_SRVNOTSUPP, "SRV NOT SUPP", }, { ADSERR_DEVICE_INVALIDGRP, "INVALID GRP", }, { ADSERR_DEVICE_INVALIDOFFSET, "INVALID OFFSET", }, { ADSERR_DEVICE_INVALIDACCESS, "INVALID ACCESS", }, { ADSERR_DEVICE_INVALIDSIZE, "INVALID SIZE", }, { ADSERR_DEVICE_INVALIDDATA, "INVALID DATA", }, { ADSERR_DEVICE_NOTREADY, "NOT READY", }, { ADSERR_DEVICE_BUSY, "BUSY", }, { ADSERR_DEVICE_INVALIDCONTEXT, "INVALID CONTEXT", }, { ADSERR_DEVICE_NOMEMORY, "NO MEMORY", }, { ADSERR_DEVICE_INVALIDPARM, "INVALID PARM", }, { ADSERR_DEVICE_NOTFOUND, "NOT FOUND", }, { ADSERR_DEVICE_SYNTAX, "SYNTAX", }, { ADSERR_DEVICE_INCOMPATIBLE, "INCOMPATIBLE", }, { ADSERR_DEVICE_EXISTS, "EXISTS", }, { ADSERR_DEVICE_SYMBOLNOTFOUND, "SYMBOL NOT FOUND", }, { ADSERR_DEVICE_SYMBOLVERSIONINVALID, "SYMBOL VERSION INVALID", }, { ADSERR_DEVICE_INVALIDSTATE, "INVALID STATE", }, { ADSERR_DEVICE_TRANSMODENOTSUPP, "TRANS MODE NOT SUPP", }, { ADSERR_DEVICE_NOTIFYHNDINVALID, "NOTIFY HND INVALID", }, { ADSERR_DEVICE_CLIENTUNKNOWN, "CLIENT UNKNOWN", }, { ADSERR_DEVICE_NOMOREHDLS, "NO MORE HDLS", }, { ADSERR_DEVICE_INVALIDWATCHSIZE, "INVALID WATCHSIZE", }, { ADSERR_DEVICE_NOTINIT, "NOT INIT", }, { ADSERR_DEVICE_TIMEOUT, "TIMEOUT", }, { ADSERR_DEVICE_NOINTERFACE, "NO INTERFACE", }, { ADSERR_DEVICE_INVALIDINTERFACE, "INVALID INTERFACE", }, { ADSERR_DEVICE_INVALIDCLSID, "INVALID CLSID", }, { ADSERR_DEVICE_INVALIDOBJID, "INVALID OBJID", }, { ADSERR_DEVICE_PENDING, "PENDING", }, { ADSERR_DEVICE_ABORTED, "ABORTED", }, { ADSERR_DEVICE_WARNING, "WARNING", }, { ADSERR_DEVICE_INVALIDARRAYIDX, "INVALID ARRAY IDX", }, { ADSERR_CLIENT_ERROR, "CLIENT ERROR", }, { ADSERR_CLIENT_INVALIDPARM, "CLIENT INVALID PARM", }, { ADSERR_CLIENT_LISTEMPTY, "CLIENT LIST EMPTY", }, { ADSERR_CLIENT_VARUSED, "CLIENT VAR USED", }, { ADSERR_CLIENT_DUPLINVOKEID, "CLIENT DUPL INVOKEID", }, { ADSERR_CLIENT_SYNCTIMEOUT, "CLIENT SYNC TIMEOUT", }, { ADSERR_CLIENT_W32ERROR, "CLIENT W32ERROR", }, { ADSERR_CLIENT_TIMEOUTINVALID, "CLIENT TIMEOUT INVALID", }, { ADSERR_CLIENT_PORTNOTOPEN, "CLIENT PORT NOT OPEN", }, { ADSERR_CLIENT_NOAMSADDR, "CLIENT NO AMS ADDR", }, { ADSERR_CLIENT_SYNCINTERNAL, "CLIENT SYNC INTERNAL", }, { ADSERR_CLIENT_ADDHASH, "CLIENT ADD HASH", }, { ADSERR_CLIENT_REMOVEHASH, "CLIENT REMOVE HASH", }, { ADSERR_CLIENT_NOMORESYM, "CLIENT NO MORE SYM", }, { ADSERR_CLIENT_SYNCRESINVALID, "CLIENT SYNC RES INVALID", }, { ADSERR_CLIENT_SYNCPORTLOCKED, "CLIENT SYNC PORT LOCKED", }, { 0, NULL } }; /* AMS Command Id * https://infosys.beckhoff.com/english.php?content=../content/1033/tcadsamsspec/html/tcadsamsspec_adscmd_readstate.htm&id=10652 */ static const value_string AMS_CommandId_vals[] = { { ADSSRVID_INVALID, "Invalid", }, { ADSSRVID_READDEVICEINFO, "ADS Read Device Info", }, { ADSSRVID_READ, "ADS Read", }, { ADSSRVID_WRITE, "ADS Write", }, { ADSSRVID_READSTATE, "ADS Read State", }, { ADSSRVID_WRITECTRL, "ADS Write Control", }, { ADSSRVID_ADDDEVICENOTE, "ADS Add Device Notification", }, { ADSSRVID_DELDEVICENOTE, "ADS Delete Device Notification", }, { ADSSRVID_DEVICENOTE, "ADS Device Notification", }, { ADSSRVID_READWRITE, "ADS Read Write", }, { 0, NULL } }; static void NetIdFormater(tvbuff_t *tvb, guint offset, char *szText, gint nMax) { snprintf ( szText, nMax, "%d.%d.%d.%d.%d.%d", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2), tvb_get_guint8(tvb, offset+3), tvb_get_guint8(tvb, offset+4), tvb_get_guint8(tvb, offset+5) ); } /*ams*/ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { proto_item *ti, *anItem; proto_tree *ams_tree = NULL, *ams_adstree, *ams_statetree; guint ams_length = tvb_reported_length(tvb); guint16 stateflags = 0; guint16 cmdId = 0; guint32 cbdata = 0; char szText[200]; int nMax = sizeof(szText)-1; col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMS"); col_clear(pinfo->cinfo, COL_INFO); if( ams_length < AmsHead_Len ) return offset; if (tree) { ti = proto_tree_add_item(tree, proto_ams, tvb, 0, -1, ENC_NA); ams_tree = proto_item_add_subtree(ti, ett_ams); NetIdFormater(tvb, offset, szText, nMax); proto_tree_add_string(ams_tree, hf_ams_targetnetid, tvb, offset, AmsNetId_Len, szText); offset += AmsNetId_Len; proto_tree_add_item(ams_tree, hf_ams_targetport, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); offset += (int)sizeof(guint16); NetIdFormater(tvb, offset, szText, nMax); proto_tree_add_string(ams_tree, hf_ams_sendernetid, tvb, offset, AmsNetId_Len, szText); offset += AmsNetId_Len; proto_tree_add_item(ams_tree, hf_ams_senderport, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); offset += (int)sizeof(guint16); proto_tree_add_item(ams_tree, hf_ams_cmdid, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); cmdId = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16); anItem = proto_tree_add_item(ams_tree, hf_ams_stateflags, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); ams_statetree = proto_item_add_subtree(anItem, ett_ams_stateflags); proto_tree_add_item(ams_statetree, hf_ams_stateresponse,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_statenoreturn,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_stateadscmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_statesyscmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_statehighprio,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_statetimestampadded,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_stateudp,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_stateinitcmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_statetree, hf_ams_statebroadcast,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); stateflags = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16); proto_tree_add_item(ams_tree, hf_ams_cbdata, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); cbdata = tvb_get_letohl(tvb,offset); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_tree, hf_ams_errorcode, tvb, offset, (int)sizeof(guint32),ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_tree, hf_ams_invokeid, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); } else { offset+=AmsHead_Len; } if ( (stateflags & AMSCMDSF_ADSCMD) != 0 ) { /* ADS */ if ( (stateflags & AMSCMDSF_RESPONSE) == 0 ) { /* Request */ switch ( cmdId ) { case ADSSRVID_READ: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read Request"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadrequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadReq_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadrequest); proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); } } } break; case ADSSRVID_WRITE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Write Request"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adswriterequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsWriteReq_Len - (int)sizeof(guint16) ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswriterequest); proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA); } } } break; case ADSSRVID_READWRITE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read Write Request"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadwriterequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadWriteReq_Len - (int)sizeof(guint16)) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadwriterequest); proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscbreadlength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscbwritelength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA); } } } break; case ADSSRVID_READSTATE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read State Request"); if( tree && cbdata !=0 ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadstaterequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadStateReq_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadstaterequest); proto_tree_add_item(ams_adstree, hf_ams_adsinvokeid, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); } } } break; case ADSSRVID_WRITECTRL: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Write Control Request"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adswritectrlrequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsWriteControlReq_Len - (int)sizeof(guint16) ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswritectrlrequest); proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint16); proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint16); proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA); } } } break; case ADSSRVID_READDEVICEINFO: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read Device Info Request"); if( tree && cbdata !=0 ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreaddinforequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadDeviceInfoReq_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreaddinforequest); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); } } } break; case ADSSRVID_ADDDEVICENOTE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Add Device Notification Request"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsadddnrequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsAddDeviceNotificationReq_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsadddnrequest); proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adstransmode, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsmaxdelay, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscycletime, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); } } } break; case ADSSRVID_DELDEVICENOTE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Delete Device Notification Request"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsdeldnrequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsDelDeviceNotificationReq_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdeldnrequest); proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); } } } break; case ADSSRVID_DEVICENOTE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Device Notification Request"); if( tree ) { /*guint32 cbLength; guint32 nStamps;*/ anItem = proto_tree_add_item(ams_tree, hf_ams_adsdnrequest, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsDeviceNotificationReq_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdnrequest); proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); /*cbLength = tvb_get_letohs(tvb, offset);*/ offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsnoteblocksstamps, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); /*nStamps = tvb_get_letohs(tvb, offset);*/ offset+=(int)sizeof(guint32); /*ToDo: dissect noteblocks*/ } } } break; } } else { /* Response */ switch ( cmdId ) { case ADSSRVID_READ: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadresponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadRes_Len - (int)sizeof(guint16) ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadresponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA); } } } break; case ADSSRVID_WRITE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Write Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adswriteresponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsWriteRes_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswriteresponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); } } } break; case ADSSRVID_READWRITE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read Write Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadwriteresponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadWriteRes_Len - (int)sizeof(guint16) ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadwriteresponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA); } } } break; case ADSSRVID_READSTATE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read State Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadstateresponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadStateRes_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadstateresponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint16); proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); } } } break; case ADSSRVID_WRITECTRL: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Write Control Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adswritectrlresponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsWriteControlRes_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswritectrlresponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); } } } break; case ADSSRVID_READDEVICEINFO: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Read Device Info Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsreaddinforesponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsReadDeviceInfoRes_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreaddinforesponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsversionversion, tvb, offset++, (int)sizeof(guint8), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_adstree, hf_ams_adsversionrevision, tvb, offset++, (int)sizeof(guint8), ENC_LITTLE_ENDIAN); proto_tree_add_item(ams_adstree, hf_ams_adsversionbuild, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint16); proto_tree_add_item(ams_adstree, hf_ams_adsdevicename, tvb, offset, ams_length-offset, ENC_ASCII|ENC_NA); } } } break; case ADSSRVID_ADDDEVICENOTE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Device Notification Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsadddnresponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsAddDeviceNotificationRes_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsadddnresponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); offset+=(int)sizeof(guint32); proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); } } } break; case ADSSRVID_DELDEVICENOTE: { col_append_str(pinfo->cinfo, COL_INFO, "ADS Delete Device Notification Response"); if( tree ) { anItem = proto_tree_add_item(ams_tree, hf_ams_adsdeldnresponse, tvb, offset, ams_length-offset, ENC_NA); if( ams_length-offset >= TAdsDelDeviceNotificationRes_Len ) { ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdeldnresponse); proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN); } } } break; } } } else { if ( (stateflags & AMSCMDSF_RESPONSE) == 0 ) col_append_str(pinfo->cinfo, COL_INFO, "AMS Request"); else col_append_str(pinfo->cinfo, COL_INFO, "AMS Response"); if( tree && ams_length-offset > 0 ) proto_tree_add_item(ams_tree, hf_ams_data, tvb, offset, ams_length-offset, ENC_NA); } return offset; } /*ams*/ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return dissect_ams_pdu(tvb, pinfo, tree, 0); } static gint dissect_amstcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if( TcpAdsParserHDR_Len > tvb_reported_length(tvb)) return 0; return dissect_ams_pdu(tvb, pinfo, tree, TcpAdsParserHDR_Len); } void proto_register_ams(void) { static const true_false_string flags_set_truth = { "Set", "Not set" }; static hf_register_info hf[] = { { &hf_ams_sendernetid, { "AMS Sender Net Id", "ams.sendernetid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_senderport, { "AMS Sender port", "ams.senderport", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_targetnetid, { "AMS Target Net Id", "ams.targetnetid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_targetport, { "AMS Target port", "ams.targetport", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_cmdid, { "CmdId", "ams.cmdid", FT_UINT16, BASE_DEC, VALS(AMS_CommandId_vals), 0x0, NULL, HFILL } }, { &hf_ams_stateflags, { "StateFlags", "ams.stateflags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_stateresponse, { "RESPONSE", "ams.state_response", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_RESPONSE, NULL, HFILL } }, { &hf_ams_statenoreturn, { "NO RETURN", "ams.state_noreturn", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_NORETURN, NULL, HFILL } }, { &hf_ams_stateadscmd, { "ADS COMMAND", "ams.state_adscmd", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_ADSCMD, NULL, HFILL } }, { &hf_ams_statesyscmd, { "SYSTEM COMMAND", "ams.state_syscmd", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_SYSCMD, NULL, HFILL } }, { &hf_ams_statehighprio, { "HIGH PRIORITY COMMAND", "ams.state_highprio", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_HIGHPRIO, NULL, HFILL } }, { &hf_ams_statetimestampadded, { "TIMESTAMP ADDED", "ams.state_timestampadded", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_TIMESTAMPADDED, NULL, HFILL } }, { &hf_ams_stateudp, { "UDP COMMAND", "ams.state_udp", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_UDP, NULL, HFILL } }, { &hf_ams_stateinitcmd, { "INIT COMMAND", "ams.state_initcmd", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_INITCMD, NULL, HFILL } }, { &hf_ams_statebroadcast, { "BROADCAST", "ams.state_broadcast", FT_BOOLEAN, 16, TFS(&flags_set_truth), AMSCMDSF_BROADCAST, NULL, HFILL } }, { &hf_ams_cbdata, { "cbData", "ams.cbdata", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_errorcode, { "ErrorCode", "ams.errorcode", FT_UINT32, BASE_HEX, VALS(ErrorCode), 0x0, NULL, HFILL } }, { &hf_ams_invokeid, { "InvokeId", "ams.invokeid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsdata, { "Data", "ams.ads_data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_data, { "Data", "ams.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsindexgroup, { "IndexGroup", "ams.ads_indexgroup", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsindexoffset, { "IndexOffset", "ams.ads_indexoffset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adscblength, { "CbLength", "ams.ads_cblength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreadrequest, { "ADS Read Request", "ams.ads_read_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreadresponse, { "ADS Read Response", "ams.ads_read_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsinvokeid, { "InvokeId", "ams.ads_invokeid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsresult, { "Result", "ams.adsresult", FT_UINT32, BASE_HEX, VALS(AdsErrorMode), 0x0, NULL, HFILL } }, { &hf_ams_adswriterequest, { "ADS Write Request", "ams.ads_write_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adswriteresponse, { "ADS Write Response", "ams.ads_write_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreadwriterequest, { "ADS ReadWrite Request", "ams.ads_readwrite_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreadwriteresponse, { "ADS ReadWrite Response", "ams.ads_readwrite_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adscbreadlength, { "CBReadLength", "ams.ads_cbreadlength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adscbwritelength, { "CBWriteLength", "ams.ads_cbwritelength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsstate, { "AdsState", "ams.ads_state", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsdevicestate, { "DeviceState", "ams.ads_devicestate", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsnotificationhandle, { "NotificationHandle", "ams.ads_notificationhandle", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreadstaterequest, { "ADS Read State Request", "ams.ads_readstate_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreadstateresponse, { "ADS Read State Response", "ams.ads_readstate_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adswritectrlrequest, { "ADS Write Ctrl Request", "ams.ads_writectrl_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adswritectrlresponse, { "ADS Write Ctrl Response", "ams.ads_writectrl_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreaddinforequest, { "ADS Read Device Info Request", "ams.ads_readdinfo_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsreaddinforesponse, { "ADS Read Device Info Response", "ams.ads_readdinfo_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsadddnrequest, { "ADS Add Device Notification Request", "ams.ads_adddn_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsadddnresponse, { "ADS Add Device Notification Response", "ams.ads_adddn_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsdeldnrequest, { "ADS Delete Device Notification Request", "ams.ads_deldn_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsdeldnresponse, { "ADS Delete Device Notification Response", "ams.ads_deldn_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsdnrequest, { "ADS Device Notification Request", "ams.ads_dn_req", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ams_adsdnresponse, { "ADS Device Notification Response", "ams.ads_dn_res", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsnoteattrib, { "InvokeId", "ams.ads_noteattrib", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsnoteblocks, { "InvokeId", "ams.ads_noteblocks", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsversion, { "ADS Version", "ams.ads_version", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_ams_adsdevicename, { "Device Name","ams.ads_devicename", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsversionversion, { "ADS Major Version", "ams.ads_versionversion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsversionrevision, { "ADS Minor Version", "ams.ads_versionrevision", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsversionbuild, { "ADS Version Build", "ams.ads_versionbuild", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsnoteblocksstamps, { "Count of Stamps", "ams.ads_noteblocksstamps", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ams_adsnoteblocksstamp, { "Notification Stamp", "ams.ads_noteblocksstamp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adstimestamp, { "Time Stamp", "ams.ads_timestamp", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adssamplecnt, { "Count of Stamps", "ams.ads_samplecnt", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adsnoteblockssample, { "Notification Sample", "ams.ads_noteblockssample", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #endif { &hf_ams_adstransmode, { "Trans Mode", "ams.ads_transmode", FT_UINT32, BASE_DEC, VALS(TransMode), 0x0, NULL, HFILL } }, { &hf_ams_adsmaxdelay, { "Max Delay", "ams.ads_maxdelay", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adscycletime, { "Cycle Time", "ams.ads_cycletime", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ams_adscmpmax, { "Cmp Mad", "ams.ads_cmpmax", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ams_adscmpmin, { "Cmp Min", "ams.ads_cmpmin", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } } #endif }; static gint *ett[] = { &ett_ams, &ett_ams_stateflags, &ett_ams_adsreadrequest, &ett_ams_adsreadresponse, &ett_ams_adswriterequest, &ett_ams_adswriteresponse, &ett_ams_adsreadwriterequest, &ett_ams_adsreadwriteresponse, &ett_ams_adsreadstaterequest, &ett_ams_adsreadstateresponse, &ett_ams_adswritectrlrequest, &ett_ams_adswritectrlresponse, &ett_ams_adsreaddinforequest, &ett_ams_adsreaddinforesponse, &ett_ams_adsadddnrequest, &ett_ams_adsadddnresponse, &ett_ams_adsdeldnrequest, &ett_ams_adsdeldnresponse, &ett_ams_adsdnrequest }; proto_ams = proto_register_protocol("AMS", "AMS", "ams"); proto_register_field_array(proto_ams, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); ams_handle = register_dissector("ams", dissect_ams, proto_ams); amstcp_handle = register_dissector("ams.tcp", dissect_amstcp, proto_ams ); } /* The registration hand-off routing */ void proto_reg_handoff_ams(void) { dissector_add_uint_with_preference("tcp.port", AMS_TCP_PORT, amstcp_handle); dissector_add_uint("ecatf.type", 2, ams_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 3 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=3 tabstop=8 expandtab: * :indentSize=3:tabSize=8:noTabs=true: */
C/C++
wireshark/plugins/epan/ethercat/packet-ams.h
/* packet-ams.h * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_AMS_H__ #define __PACKET_AMS_H__ /* FIXED PORTS */ #define AMSPORT_ROUTER 1 #define AMSPORT_DEBUGGER 2 #define AMSPORT_LOGGER 100 #define AMSPORT_EVENTLOG 110 #define AMSPORT_R0_RTIME 200 #define AMSPORT_R0_TRACE (AMSPORT_R0_RTIME+90) #define AMSPORT_R0_IO 300 #define AMSPORT_R0_SPS 400 #define AMSPORT_R0_NC 500 #define AMSPORT_R0_NCSAF 501 #define AMSPORT_R0_NCSVB 511 #define AMSPORT_R0_ISG 550 #define AMSPORT_R0_CNC 600 #define AMSPORT_R0_LINE 700 #define AMSPORT_R0_PLC 800 #define AMSPORT_R0_CAM 900 #define AMSPORT_R0_CAMTOOL 950 #define AMSPORT_R0_IOPORTBEGIN 1000 #define AMSPORT_R0_IOPORTEND 1199 #define AMSPORT_R0_USER 2000 #define AMSPORT_R3_SYSSERV 10000 #define AMSPORT_R3_CTRLPROG 10000 #define AMSPORT_R3_SYSCTRL 10001 #define AMSPORT_R3_SYSSAMPLER 10100 #define AMSPORT_R3_TCPRAWCONN 10200 #define AMSPORT_R3_TCPIPSERVER 10201 #define AMSPORT_R3_SYSMANAGER 10300 #define AMSPORT_R3_SMSSERVER 10400 #define AMSPORT_R3_MODBUSSERVER 10500 #define AMSPORT_R3_PLCCONTROL 10800 #define AMSPORT_R3_NCCTRL 11000 #define AMSPORT_R3_NCINTERPRETER 11500 #define AMSPORT_R3_STRECKECTRL 12000 #define AMSPORT_R3_CAMCTRL 13000 #define AMSPORT_R3_SCOPE 14000 #define AMSPORT_R3_SINECH1 15000 #define AMSPORT_R3_CONTROLNET 16000 #define AMSPORT_R3_OPCSERVER 17000 #define AMSPORT_R3_OPCCLIENT 17500 #define AMSPORT_R3_CUSTOMER_FIRST 25000 #define AMSPORT_R3_CUSTOMER_LAST 25999 #define AMSPORT_FIRST 1 #define AMSPORT_LAST 0xFFFE #define AMSPORT_UNFIXEDPORT 0 #define AMSPORT_USEDEFAULT 0xFFFF #define AMSPORT_IOBOXBEGIN_USB 0x6E00 #define AMSPORT_IOBOXEND_USB 0x6EFF #define AMSPORT_IODEVBEGIN 0x7000 #define AMSPORT_IODEVEND 0x70FF #define AMSPORT_IOBOXBEGIN 0x7100 #define AMSPORT_IOBOXEND 0x7FFF #define AMSPORT_FREEBEGIN 0x8000 #define AMSPORT_FREEEND 0xBFFF #define AMSPORT_NAMESIZE 31 /* Port types */ typedef enum { PORTTYPE_INVALID = -1, PORTTYPE_ROUTER = 0x00, PORTTYPE_R3PORT = 0x01, PORTTYPE_R0CTRLPORT = 0x02, PORTTYPE_R0TASKPORT = 0x03, PORTTYPE_R0IOPORT = 0x04, PORTTYPE_TPPORT = 0x05, PORTTYPE_MAXVAL = 0xFF }AMSPORT_TYPE; /* Command IDs */ #define AMSCMD_LOGMESSAGE 0x0001 #define AMSCMD_ROUTERSHUTDOWN 0x0002 #define AMSCMD_ROUTERACTIVATED 0x0003 #define AMSCMD_SYSTEMREMOVED 0x0004 #define AMSCMD_CLOSECONNECTION 0x0005 #define AMSCMD_SIGNALSTART 0x00FB #define AMSCMD_SIGNALSTOP 0x00FC #define AMSCMD_HANDLERETAINDATA 0x00FD #define AMSCMD_DEVICECONFIGID 0x00FE #define AMSCMD_DOWNLOADSYMBOLS 0x00FF #define AMS_ERRLOGCMDS 0x100 #define AMS_TASKCMDS 0x500 #define AMS_CTRLCMDS 0x600 #define AMS_ROUTERCMDS 0x900 #define AMS_RTIMECMDS 0x1000 #define AMS_TRACECMDS (AMS_RTIMECMDS+0x900) #define AMS_IOCMDS 0x2000 #define AMS_C1220CMDS (AMS_IOCMDS+0x100) #define AMS_FCxxxxCMDS (AMS_IOCMDS+0x200) #define AMS_SPSCMDS 0x3000 #define AMS_NCCMDS 0x4000 #define AMS_PLCCMDS 0x5000 #define AMS_LINECMDS 0x6000 #define AMS_CAMCMDS 0x7000 #define AMS_CMDSPECIFIC 0x8000 #define AMSERRCODEISWARNING 0x80000000 /* Error Arrays */ #define ERR_ROUTERERRS 0x0500 #define ERR_TASKERRS 0x0600 #define ERR_ADSERRS 0x0700 #define ERR_SYSSMPLERRS 0x0800 #define ERR_RTIMEERRS 0x1000 #define ERR_TRACEERRS (ERR_RTIMEERRS+0x900) #define ERR_IOERRS 0x2000 #define ERR_DPSLAVE (ERR_IOERRS+0x900) #define ERR_CP5412A2 (ERR_IOERRS+0xA00) #define ERR_ASP (ERR_IOERRS+0xB00) #define ERR_CANSLAVE (ERR_IOERRS+0xC00) #define ERR_CIF30 (ERR_IOERRS+0xD00) #define ERR_IBSSLAVE (ERR_IOERRS+0xE00) #define ERR_SPSERRS 0x3000 #define ERR_NCERRS 0x4000 #define ERR_PLCERRS 0x6000 #define ERR_STRKERRS 0x7000 #define ERR_PRJSPECIFIC 0x7800 #define ERR_DRIVEERRS_C3D 0xD000 #define ERR_DRIVEERRS_C2D 0xE000 #define ERR_DRIVEERRS_C1D 0xF000 /* Global Error codes */ #define ERR_NOERROR 0 #define ERR_INTERNAL 1 #define ERR_NORTIME 2 #define ERR_ALLOCLOCKEDMEM 3 #define ERR_INSERTMAILBOX 4 #define ERR_WRONGRECEIVEHMSG 5 #define ERR_TARGETPORTNOTFOUND 6 #define ERR_TARGETMACHINENOTFOUND 7 #define ERR_UNKNOWNCMDID 8 #define ERR_BADTASKID 9 #define ERR_NOIO 10 #define ERR_UNKNOWNAMSCMD 11 #define ERR_WIN32ERROR 12 #define ERR_PORTNOTCONNECTED 13 #define ERR_INVALIDAMSLENGTH 14 #define ERR_INVALIDAMSNETID 15 #define ERR_LOWINSTLEVEL 16 #define ERR_NODEBUGINTAVAILABLE 17 #define ERR_PORTDISABLED 18 #define ERR_PORTALREADYCONNECTED 19 #define ERR_AMSSYNC_W32ERROR 20 #define ERR_AMSSYNC_TIMEOUT 21 #define ERR_AMSSYNC_AMSERROR 22 #define ERR_AMSSYNC_NOINDEXINMAP 23 #define ERR_INVALIDAMSPORT 24 #define ERR_NOMEMORY 25 #define ERR_TCPSEND 26 #define ERR_HOSTUNREACHABLE 27 #define ERR_INVALIDAMSFRAGMENT 28 /* ROUTER */ #define ROUTERERR_NOLOCKEDMEMORY 0 + ERR_ROUTERERRS #define ROUTERERR_RESIZEMEMORY 1 + ERR_ROUTERERRS #define ROUTERERR_MAILBOXFULL 2 + ERR_ROUTERERRS #define ROUTERERR_DEBUGBOXFULL 3 + ERR_ROUTERERRS #define ROUTERERR_UNKNOWNPORTTYPE 4 + ERR_ROUTERERRS #define ROUTERERR_NOTINITIALIZED 5 + ERR_ROUTERERRS #define ROUTERERR_PORTALREADYINUSE 6 + ERR_ROUTERERRS #define ROUTERERR_NOTREGISTERED 7 + ERR_ROUTERERRS #define ROUTERERR_NOMOREQUEUES 8 + ERR_ROUTERERRS #define ROUTERERR_INVALIDPORT 9 + ERR_ROUTERERRS #define ROUTERERR_NOTACTIVATED 10 + ERR_ROUTERERRS #define ROUTERERR_FRAGMENTBOXFULL 11 + ERR_ROUTERERRS #define ROUTERERR_FRAGMENTTIMEOUT 12 + ERR_ROUTERERRS #define ROUTERERR_TOBEREMOVED 13 + ERR_ROUTERERRS #define TASKERR_UNKNOWNTASKTYPE 0 + ERR_TASKERRS #define TASKERR_TASKTERMINATED 1 + ERR_TASKERRS #define TASKERR_EVENTTIMEOUT 2 + ERR_TASKERRS /* System Sampler */ #define SMPLERR_INTERNAL 0 + ERR_SYSSMPLERRS #define SMPLERR_INVALIDTYPE 1 + ERR_SYSSMPLERRS /* RTIME */ #define RTERR_INTERNAL 0 + ERR_RTIMEERRS #define RTERR_BADTIMERPERIODS 1 + ERR_RTIMEERRS #define RTERR_INVALIDTASKPTR 2 + ERR_RTIMEERRS #define RTERR_INVALIDSTACKPTR 3 + ERR_RTIMEERRS #define RTERR_PRIOEXISTS 4 + ERR_RTIMEERRS #define RTERR_NOMORETCB 5 + ERR_RTIMEERRS #define RTERR_NOMORESEMAS 6 + ERR_RTIMEERRS #define RTERR_NOMOREQUEUES 7 + ERR_RTIMEERRS #define RTERR_SHUTDOWNTIMEOUT 8 + ERR_RTIMEERRS #define RTERR_CHECKHOSTOSNOPCR 9 + ERR_RTIMEERRS #define RTERR_CHECKHOSTOSNOIDT 10 + ERR_RTIMEERRS #define RTERR_CHECKHOSTOSNOPHYSMEM 11 + ERR_RTIMEERRS #define RTERR_CHECKHOSTOSMAPERR 12 + ERR_RTIMEERRS #define RTERR_EXTIRQALREADYDEF 13 + ERR_RTIMEERRS #define RTERR_EXTIRQNOTDEF 14 + ERR_RTIMEERRS #define RTERR_EXTIRQINSTALLFAILED 15 + ERR_RTIMEERRS #define RTERR_IRQLNOTLESSOREQUAL 16 + ERR_RTIMEERRS #define RTERR_SYSCLOCKFAILURE 17 + ERR_RTIMEERRS /* TRACE */ #define TRACEERR_REGISTRY 0 + ERR_TRACEERRS #define TRACEERR_MEMMAP 1 + ERR_TRACEERRS #define TRACEERR_NOTAVAIL 2 + ERR_TRACEERRS /* IO */ #define IOERR_INTERNAL (0 + ERR_IOERRS) #define IOERR_BADCARDNO (1 + ERR_IOERRS) #define IOERR_INVALIDCARDADDR (2 + ERR_IOERRS) #define IOERR_CDLLISTFULL (3 + ERR_IOERRS) #define IOERR_BADCDLPARAM (4 + ERR_IOERRS) #define IOERR_OPENIOFAILED (5 + ERR_IOERRS) #define IOERR_RESETIOFAILED (6 + ERR_IOERRS) #define IOERR_UNKNOWNDEVICE (7 + ERR_IOERRS) #define IOERR_UNKNOWNDEVICEID (8 + ERR_IOERRS) #define IOERR_UNKNOWNIMAGEID (9 + ERR_IOERRS) #define IOERR_GETIOSTATE (10 + ERR_IOERRS) #define IOERR_BADIMAGEID (11 + ERR_IOERRS) #define IOERR_NOMORECLIENTSPACE (12 + ERR_IOERRS) #define IOERR_CLIENTINFONOTFOUND (13 + ERR_IOERRS) #define IOERR_CDLNOTINUSE (14 + ERR_IOERRS) #define IOERR_TIMEOUTWITHDEVICE (15 + ERR_IOERRS) #define IOERR_C1220FUNC_1 (16 + ERR_IOERRS) #define IOERR_C1220FUNC_9 (17 + ERR_IOERRS) #define IOERR_C1220FUNC_C (18 + ERR_IOERRS) #define IOERR_C1220FUNC_10 (19 + ERR_IOERRS) #define IOERR_C1220FUNC_1_MAXSEND (20 + ERR_IOERRS) #define IOERR_C1220FUNC_1_ADDRSET (21 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK (22 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK0 (23 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK1 (24 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK2 (25 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK3 (26 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK4 (27 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK5 (28 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK6 (29 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK7 (30 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK8 (31 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK9 (32 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK10 (33 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK11 (34 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK12 (35 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK13 (36 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK14 (37 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK15 (38 + ERR_IOERRS) #define IOERR_C1220FUNC_1_BREAK16 (39 + ERR_IOERRS) #define IOERR_SPC3DEVINITDP (40 + ERR_IOERRS) #define IOERR_SPC3UPDATEOUTPUT (41 + ERR_IOERRS) #define IOERR_CIF30READDIAG (42 + ERR_IOERRS) #define IOERR_CIF30COMMNOTSTARTED (43 + ERR_IOERRS) #define IOERR_CIF30SLAVEPARASIZE (44 + ERR_IOERRS) #define IOERR_CIF30NOPARAS (45 + ERR_IOERRS) #define IOERR_CIF30SLAVEERROR (46 + ERR_IOERRS) #define IOERR_CIF30WATCHDOGEXPIRED (47 + ERR_IOERRS) #define IOERR_UNKNOWNDEVICECMD (48 + ERR_IOERRS) #define IOERR_CIF40MESSAGEHANDLING (49 + ERR_IOERRS) #define IOERR_CIF40PARAERROR (50 + ERR_IOERRS) #define IOERR_CIF40WATCHDOGEXPIRED (51 + ERR_IOERRS) #define IOERR_CIF40FLAGERROR (52 + ERR_IOERRS) #define IOERR_CIF40COMMNOTSTARTED (53 + ERR_IOERRS) #define IOERR_CIF40READDIAG (54 + ERR_IOERRS) #define IOERR_CIF40SLAVEERROR (55 + ERR_IOERRS) #define IOERR_CIF40GLOBALERROR (56 + ERR_IOERRS) #define IOERR_CIF40CONFIGLIST (57 + ERR_IOERRS) #define IOERR_CP5412A2SLAVEPARASIZE (58 + ERR_IOERRS) #define IOERR_CP5412A2NOPARAS (59 + ERR_IOERRS) #define IOERR_CP5412A2SLAVEERROR (60 + ERR_IOERRS) #define IOERR_CP5412A2FATAL (61 + ERR_IOERRS) #define IOERR_CP5412A2MAILBOXUSED (62 + ERR_IOERRS) #define IOERR_BEGINCONFIGWHILETICKER (63 + ERR_IOERRS) #define IOERR_UNEXPECTEDBOXCOUNT (64 + ERR_IOERRS) #define IOERR_C1200CHECKADDR (65 + ERR_IOERRS) #define IOERR_C1200INTENSITYTEST (66 + ERR_IOERRS) #define IOERR_NOIMAGE (67 + ERR_IOERRS) #define IOERR_INVALIDIMAGEOFFSSIZE (68 + ERR_IOERRS) #define IOERR_FORCESCOUNTEXCEEDEDMAXIMUM (69 + ERR_IOERRS) #define IOERR_SERCOSLIFECOUNTERERR (70 + ERR_IOERRS) #define IOERR_C1220NOTFOUND (71 + ERR_IOERRS) #define IOERR_AMSDEVICENOAMSINTF (72 + ERR_IOERRS) #define IOERR_AMSDEVICEAMSCMDIDNOTSUPP (73 + ERR_IOERRS) #define IOERR_AMSDEVICEAMSSERVICERUNNING (74 + ERR_IOERRS) #define IOERR_PLCINTERFACE_BUSY (75 + ERR_IOERRS) #define IOERR_PLCINTERFACE_FAULT (76 + ERR_IOERRS) #define IOERR_PLCINTERFACE_TIMEOUT (77 + ERR_IOERRS) #define IOERR_PLCINTERFACE_RESETTIMEOUT (78 + ERR_IOERRS) #define IOERR_PLCINTERFACE_NODATAEXCH (79 + ERR_IOERRS) #define IOERR_PLCINTERFACE_RESET (80 + ERR_IOERRS) #define IOERR_CP5412A2INVALIDADDR (81 + ERR_IOERRS) #define IOERR_CP5412A2INVALIDPORT (82 + ERR_IOERRS) #define IOERR_AMSDEVICEBADBOXNO (83 + ERR_IOERRS) #define IOERR_AMSDEVICEBADTYPE (84 + ERR_IOERRS) #define IOERR_AMSDEVICEILLEGALADDRESS (85 + ERR_IOERRS) #define IOERR_CP5412A2INVALIDBOX (86 + ERR_IOERRS) #define IOERR_AMSDEVICEFIFOOVERFLOW (87 + ERR_IOERRS) #define IOERR_AMSDEVICEAMSSEQUENCEERROR (88 + ERR_IOERRS) #define IOERR_CP5412A2DPV1SYNTAXERROR (89 + ERR_IOERRS) #define IOERR_CP5412A2DEVICENOTRUNNING (90 + ERR_IOERRS) #define IOERR_AMSDEVICENOTRUNNING (91 + ERR_IOERRS) #define IOERR_AMSDEVICEBOXNOTDEFINED (92 + ERR_IOERRS) #define IOERR_CP5412A2BADSERVICEPARA (93 + ERR_IOERRS) #define IOERR_CP5412A2FIFOOVERFLOW (94 + ERR_IOERRS) #define IOERR_COMPORTOPENFAILED (95 + ERR_IOERRS) #define IOERR_CIF30BADMESSAGERESPONSE (96 + ERR_IOERRS) #define IOERR_CIF30DELETEDATABASE (97 + ERR_IOERRS) #define IOERR_CIF30STARTSEQFAILED (98 + ERR_IOERRS) #define IOERR_CIF30DOWNLOADFAILED (99 + ERR_IOERRS) #define IOERR_CIF30ENDSEQFAILED (100 + ERR_IOERRS) #define IOERR_CIF30BUSLOADFAILED (101 + ERR_IOERRS) #define IOERR_PLCINTERFACE_RESETREQ (102 + ERR_IOERRS) #define IOERR_CP5412A2INVALIDCYCLETICKS (103 + ERR_IOERRS) #define IOERR_CP5412A2DPBUSFAULT (104 + ERR_IOERRS) #define IOERR_INVALIDTERMCONFIG (105 + ERR_IOERRS) #define IOERR_SERCANSBREAK (106 + ERR_IOERRS) #define IOERR_SERCANSPHASE0 (107 + ERR_IOERRS) #define IOERR_SERCANSPHASE1 (108 + ERR_IOERRS) #define IOERR_SERCANSPHASE2 (109 + ERR_IOERRS) #define IOERR_SERCANSPHASE3 (110 + ERR_IOERRS) #define IOERR_SERCANSPHASE4 (111 + ERR_IOERRS) #define IOERR_SERCANSNCSERVICECHNFAILED (112 + ERR_IOERRS) #define IOERR_RESOURCECONFICT (113 + ERR_IOERRS) #define IOERR_C1220INITSTRINGCOMM (114 + ERR_IOERRS) #define IOERR_C1220REGSTRINGSLAVE (115 + ERR_IOERRS) #define IOERR_C1220STRREGFAULT (116 + ERR_IOERRS) #define IOERR_IOSTATEBUSY (117 + ERR_IOERRS) #define IOERR_IBSSCITWATCHDOGEXPIRED (118 + ERR_IOERRS) #define IOERR_IBSSCITSYNCMAILBOXERROR (119 + ERR_IOERRS) #define IOERR_IBSSCITCONFIRMDIAGERROR (120 + ERR_IOERRS) #define IOERR_IBSSCITCREATECFGERROR (121 + ERR_IOERRS) #define IOERR_IBSSCITCOMPLETEREADCFGERROR (122 + ERR_IOERRS) #define IOERR_IBSSCITSTARTDATATRANSFERERROR (123 + ERR_IOERRS) #define IOERR_IBSSCITSETFAULTINDICATION (124 + ERR_IOERRS) #define IOERR_IBSSCITSETDEVICESTATEINDICATION (125 + ERR_IOERRS) #define IOERR_IBSSCITSETBUSERRORINDICATION (126 + ERR_IOERRS) #define IOERR_IBSSCITSTOPDATATRANSFERERROR (127 + ERR_IOERRS) #define IOERR_IBSSCITSETVALUEINDICATION (128 + ERR_IOERRS) #define IOERR_IBSSCITINITIATEREQ (129 + ERR_IOERRS) #define IOERR_IBSSCITACTIVATECFGERROR (130 + ERR_IOERRS) #define IOERR_IBSSCITCOMPACTLOADPDRLERROR (131 + ERR_IOERRS) #define IOERR_IBSSCITCONTROLPARAMERROR (132 + ERR_IOERRS) #define IOERR_IBSSCITDEACTIVATECFGERROR (133 + ERR_IOERRS) #define IOERR_IBSSCITINVALIDPORT (134 + ERR_IOERRS) #define IOERR_C1220FUNC_7_ADDRESSTEST (135 + ERR_IOERRS) #define IOERR_FCXXXXMAILBOXUSED (136 + ERR_IOERRS) #define IOERR_FCXXXXDPRAMTOOSMALL (137 + ERR_IOERRS) #define IOERR_COMUPS_PORTINUSE (138 + ERR_IOERRS) #define IOERR_COMUPS_NOUPSORNOPOWER (139 + ERR_IOERRS) #define IOERR_COMUPS_LOWBATTERY (140 + ERR_IOERRS) #define IOERR_UPS_ALREADY_EXISTS (141 + ERR_IOERRS) #define IOERR_FCXXXXSTARTUPFAILED (142 + ERR_IOERRS) #define IOERR_C1220GETSTRINGCOMMTXSTATEFAILED (143 + ERR_IOERRS) #define IOERR_C1220SENDSTRINGTOSLAVEFAILED (144 + ERR_IOERRS) #define IOERR_CP5613FIRMWARELOADFAILED (145 + ERR_IOERRS) #define IOERR_CP5613DPOPENFAILED (146 + ERR_IOERRS) #define IOERR_CP5613FATALERROR (147 + ERR_IOERRS) #define IOERR_CP5613DPUSEROPENFAILED (148 + ERR_IOERRS) #define IOERR_CP5613DPSETMODESTOPFAILED (149 + ERR_IOERRS) #define IOERR_CP5613DPSETMODECLEARFAILED (150 + ERR_IOERRS) #define IOERR_CP5613DPSETMODEOPERATEFAILED (151 + ERR_IOERRS) #define IOERR_CP5613NODATAAVAILABLE (152 + ERR_IOERRS) #define IOERR_CP5613DPSERVICEFAILED (153 + ERR_IOERRS) #define IOERR_CP5613DPSETMODEOFFLINEFAILED (154 + ERR_IOERRS) #define IOERR_CP5613DPUSERCLOSEFAILED (155 + ERR_IOERRS) #define IOERR_CP5613DPCLOSEFAILED (156 + ERR_IOERRS) #define IOERR_CP5613OTHERSERVICERETURNED (157 + ERR_IOERRS) #define IOERR_CP5613DPOKASYNC (158 + ERR_IOERRS) #define IOERR_CP5613DPERROREVENT (159 + ERR_IOERRS) #define IOERR_CP5613DPERROREVENTNET (160 + ERR_IOERRS) #define IOERR_CP5613DPERRORREQPAR (161 + ERR_IOERRS) #define IOERR_CP5613DPERRORCI (162 + ERR_IOERRS) #define IOERR_CP5613DPERRORRES (163 + ERR_IOERRS) #define IOERR_CP5613DPERRORUSRABORT (164 + ERR_IOERRS) #define IOERR_PKWSYNTAXERROR (165 + ERR_IOERRS) #define IOERR_CP5412A2CDLCFGFAULT (166 + ERR_IOERRS) #define IOERR_IBSSCITINITLOADCFGERROR (168 + ERR_IOERRS) #define IOERR_IBSSCITLOADCFGERROR (169 + ERR_IOERRS) #define IOERR_IBSSCITTERMLOADCFGERROR (170 + ERR_IOERRS) #define IOERR_IBSSCITINITLOADPDRLERROR (171 + ERR_IOERRS) #define IOERR_IBSSCITLOADPDRLERROR (172 + ERR_IOERRS) #define IOERR_IBSSCITTERMLOADPDRLERROR (173 + ERR_IOERRS) #define IOERR_IBSSCITDELETEOBJECTERROR (174 + ERR_IOERRS) #define IOERR_IBSSCITCONTROLACTIVECFGGERROR (175 + ERR_IOERRS) #define IOERR_IBSSCITINITLOADPDDLERROR (176 + ERR_IOERRS) #define IOERR_IBSSCITLOADPDDLERROR (177 + ERR_IOERRS) #define IOERR_IBSSCITTERMLOADPDDLERROR (178 + ERR_IOERRS) #define IOERR_NOMOREMAPSINIMAGE (179 + ERR_IOERRS) #define IOERR_IBSSCITSETSLAVEINFOERROR (180 + ERR_IOERRS) #define IOERR_CIF40NOTREADY (190 + ERR_IOERRS) #define IOERR_C1220SETAMSNETIDFAILED (191 + ERR_IOERRS) #define IOERR_AMSDEVICEIORESETACTIVE (192 + ERR_IOERRS) #define IOERR_C1220INITPROGRAMMABLECDL (193 + ERR_IOERRS) #define IOERR_FCXXXXINVALIDBOXNODOWNLOADED (194 + ERR_IOERRS) #define IOERR_CP5412A2_RESET (4 + ERR_CP5412A2) #define IOERR_CP5412A2_LOADBUSPARA (5 + ERR_CP5412A2) #define IOERR_CP5412A2_LOADSLAVE (6 + ERR_CP5412A2) #define IOERR_CP5412A2_LOADPRMDATA (7 + ERR_CP5412A2) #define IOERR_CP5412A2_LOADCFGDATA (8 + ERR_CP5412A2) #define IOERR_CP5412A2_LOADSLAVECDL (9 + ERR_CP5412A2) #define IOERR_CP5412A2_ACTIVATESLAVE (10 + ERR_CP5412A2) #define IOERR_CP5412A2_ADDSLAVE (11 + ERR_CP5412A2) #define IOERR_CP5412A2_DELETESLAVE (12 + ERR_CP5412A2) #define IOERR_CP5412A2_STARTDATAEXCH (13 + ERR_CP5412A2) #define IOERR_CP5412A2_STOPDATAEXCH (14 + ERR_CP5412A2) #define IOERR_CP5412A2_DEBUGDPM (15 + ERR_CP5412A2) /* FC Box - stamndadisiert */ #define FCERR_FMNOERROR 0 #define FCERR_FMDEACTIVATED 1 #define FCERR_FMNOANSWER 2 #define FCERR_FMMASTERLOCK 3 #define FCERR_FMINVALIDRESPONSE 4 #define FCERR_FMPRMFAULT 5 #define FCERR_FMFEATURENOTSUPPORTED 6 #define FCERR_FMCFGFAULT 7 #define FCERR_FMSTATIONNOTREADY 8 #define FCERR_FMSTATDIAG 9 #define FCERR_FMDIAGOVERFLOW 10 #define FCERR_FMPHYSICALFAULT 11 #define FCERR_FMDATATRANSFERLEFT 12 #define FCERR_FMSYNIFAULT 13 #define FCERR_FMTELEGRAMFAULT 14 #define FCERR_FMNORESSOURCES 15 #define FCERR_FMSERVICENOTACTIVATED 16 #define FCERR_FMUNEXPECTEDTELEGRAM 17 #define FCERR_FMSTATIONREADY 18 #define FCERR_FMADSSTARTUP 19 #define FCERR_FMINVALIDINDICATION 20 #define FCERR_FMSTATIONINFAULT 21 #define FCERR_FMINDICATIONMISSED 22 #define FCERR_FMWAITFORINDICATIONS 23 #define FCERR_FMFBUSSPECIFIC_1 40 #define FCERR_FMFBUSSPECIFIC_2 41 #define FCERR_FMFBUSSPECIFIC_3 42 #define FCERR_FMFBUSSPECIFIC_4 43 #define FCERR_FMFBUSSPECIFIC_5 44 #define FCERR_FMFBUSSPECIFIC_6 45 #define FCERR_FMFBUSSPECIFIC_7 46 #define FCERR_FMFBUSSPECIFIC_8 47 #define FCERR_FMFBUSSPECIFIC_9 48 /* FC520x */ #define FCERR_FMFC520XHEARTBEATFAULT 40 #define FCERR_FMFC520XSHUTDOWNRECEIVED 41 #define FCERR_FMFC520XEKEYERROR_VENDOR 42 #define FCERR_FMFC520XEKEYERROR_DEVTYPE 43 #define FCERR_FMFC520XEKEYERROR_PRODCODE 44 #define FCERR_FMFC520XEKEYERROR_REVISION 45 #define FCERR_FMFC520XSTARTUPATTR 46 #define FCERR_FMFC520XIOLENGTH_PROD 47 #define FCERR_FMFC520XIOLENGTH_CONS 48 #define FCERR_FMFC520XDEVICEOPERATE_RUN 0 #define FCERR_FMFC520XDEVICEOPERATE_IDLE 1 #define FCERR_FMFC520XDEVICEDUPMAC 2 #define FCERR_FMFC520XDEVICESELFTEST 3 #define FCERR_FMFC520XDEVICESTANDBY 4 #define FCERR_FMFC520XDEVICEMAJORFAULT 5 #define FCERR_FMFC520XDEVICEMINORFAULT 6 #define FCERR_FMFC520XDEVICEBUSSENSEFAIL 7 #define FCERR_FMFC520XCANBUSON 0x01 #define FCERR_FMFC520XCANBUSOFF 0x02 #define FCERR_FMFC520XCANWARNINGLIMIT 0x04 #define FCERR_FMFC520XCANOVERRUN 0x08 /* DP-Slave-Errors */ #define DPSLAVEERROR_NOERROR (FCERR_FMNOERROR + ERR_DPSLAVE) #define DPSLAVEERROR_STATIONDEACTIVATED (FCERR_FMDEACTIVATED + ERR_DPSLAVE) #define DPSLAVEERROR_STATIONNONEXISTENT (FCERR_FMNOANSWER + ERR_DPSLAVE) #define DPSLAVEERROR_MASTERLOCK (FCERR_FMMASTERLOCK + ERR_DPSLAVE) #define DPSLAVEERROR_INVALIDSLAVERESPONSE (FCERR_FMINVALIDRESPONSE + ERR_DPSLAVE) #define DPSLAVEERROR_PRMFAULT (FCERR_FMPRMFAULT + ERR_DPSLAVE) #define DPSLAVEERROR_NOTSUPPORTED (FCERR_FMFEATURENOTSUPPORTED + ERR_DPSLAVE) #define DPSLAVEERROR_CFGFAULT (FCERR_FMCFGFAULT + ERR_DPSLAVE) #define DPSLAVEERROR_STATIONNOTREADY (FCERR_FMSTATIONNOTREADY + ERR_DPSLAVE) #define DPSLAVEERROR_STATDIAG (FCERR_FMSTATDIAG + ERR_DPSLAVE) #define DPSLAVEERROR_DIAGOVERFLOW (FCERR_FMDIAGOVERFLOW + ERR_DPSLAVE) #define DPSLAVEERROR_PHYSICALFAULT (FCERR_FMPHYSICALFAULT + ERR_DPSLAVE) #define DPSLAVEERROR_TELEGRAMFAULT (FCERR_FMTELEGRAMFAULT + ERR_DPSLAVE) #define DPSLAVEERROR_NORESSOURCES (FCERR_FMNORESSOURCES + ERR_DPSLAVE) #define DPSLAVEERROR_SERVICENOTACTIVATED (FCERR_FMSERVICENOTACTIVATED + ERR_DPSLAVE) #define DPSLAVEERROR_UNEXPECTEDTELEGRAM (FCERR_FMUNEXPECTEDTELEGRAM + ERR_DPSLAVE) #define DPSLAVEERROR_STATIONREADY (FCERR_FMSTATIONREADY + ERR_DPSLAVE) #define DPSLAVEERROR_ADSSTARTUP (FCERR_FMADSSTARTUP + ERR_DPSLAVE) /* CAN-Node-Errors */ #define CANNODEERROR_NOERROR (0 + ERR_CANSLAVE) #define CANNODEERROR_STATIONNONEXISTENT (1 + ERR_CANSLAVE) #define CANNODEERROR_PRMFAULT (4 + ERR_CANSLAVE) #define CANNODEERROR_CFGFAULT (6 + ERR_CANSLAVE) #define CANNODEERROR_DEACTIVATED (8 + ERR_CANSLAVE) #define CANNODEERROR_PREOPERATIONAL (12 + ERR_CANSLAVE) #define CANNODEERROR_NOT_OPERATIONAL (13 + ERR_CANSLAVE) /* IBS-Device-Errors */ #define IBSDEVICEERROR_NOERROR (0 + ERR_IBSSLAVE) #define IBSDEVICEERROR_STATIONDEACTIVATED (1 + ERR_IBSSLAVE) #define IBSDEVICEERROR_STATIONNONEXISTENT (2 + ERR_IBSSLAVE) #define IBSDEVICEERROR_CFGFAULT (6 + ERR_IBSSLAVE) #define IBSDEVICEERROR_DIAGOVERFLOW (10 + ERR_IBSSLAVE) #define IBSDEVICEERROR_PHYSICALFAULT (11 + ERR_IBSSLAVE) /* PLC */ #define PLCWRN_LOADINGBOOTPRJ ((0 + ERR_PLCERRS) | AMSERRCODEISWARNING) #define PLCWRN_LOADINGRETAINDATA ((1 + ERR_PLCERRS) | AMSERRCODEISWARNING) /* NC */ #define ERR_NCR0MANERRS (ERR_NCERRS+0x0000) #define ERR_NCCHNERRS (ERR_NCERRS+0x0100) /* NC: R0-Manager Error Codes */ #define NCERR_INTERNAL (0x0000 + ERR_NCR0MANERRS) #define NCERR_NOMEMORY (0x0001 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNCHANNELID (0x0010 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNGROUPID (0x0011 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNAXISID (0x0012 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNENCODERID (0x0013 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNCONTROLLERID (0x0014 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNDRIVEID (0x0015 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNTABULARID (0x0016 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNPLCTONCADDR (0x0020 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNNCTOPLCADDR (0x0021 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNENCINADDR (0x0022 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNENCOUTADDR (0x0023 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNDRIVEINADDR (0x0024 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNDRIVEOUTADDR (0x0025 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNDSLAVETYPE (0x0030 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNAXISTYPE (0x0031 + ERR_NCR0MANERRS) #define NCERR_UNKNOWNCHNTYPE (0x0032 + ERR_NCR0MANERRS) #define NCERR_AXISINCOMPATIBLE (0x0040 + ERR_NCR0MANERRS) #define NCERR_CHANNELINCOMPLETE (0x0050 + ERR_NCR0MANERRS) #define NCERR_GROUPINCOMPLETE (0x0051 + ERR_NCR0MANERRS) #define NCERR_AXISINCOMPLETE (0x0052 + ERR_NCR0MANERRS) #define NCERR_CHANNELEXISTS (0x0060 + ERR_NCR0MANERRS) #define NCERR_GROUPEXISTS (0x0061 + ERR_NCR0MANERRS) #define NCERR_AXISEXISTS (0x0062 + ERR_NCR0MANERRS) #define NCERR_TABULAREXISTS (0x0063 + ERR_NCR0MANERRS) #define NCERR_WRONGCHANNELINDEX (0x0070 + ERR_NCR0MANERRS) #define NCERR_WRONGGROUPINDEX (0x0071 + ERR_NCR0MANERRS) /* Channel Error Codes */ #define NCCHNERR_GROUPINDEX (0x0001 + ERR_NCCHNERRS) #define NCCHNERR_ADDR_GROUP (0x0002 + ERR_NCCHNERRS) #define NCCHNERR_NO_PLCINTERFACE (0x0003 + ERR_NCCHNERRS) #define NCCHNERR_ILLEGALMFUNCNR (0x0004 + ERR_NCCHNERRS) #define NCCHNERR_NOMEMORY (0x0005 + ERR_NCCHNERRS) #define NCCHNERR_ISBUSY (0x0006 + ERR_NCCHNERRS) #define NCCHNERR_NOTSUPPORTED (0x0007 + ERR_NCCHNERRS) #define NCCHNERR_ILLEGALSETTING (0x0008 + ERR_NCCHNERRS) #define NCCHNERR_NOFILE (0x0010 + ERR_NCCHNERRS) #define NCCHNERR_ITPSYNTAXLT (0x0011 + ERR_NCCHNERRS) #define NCCHNERR_ITPSYNTAXRT (0x0012 + ERR_NCCHNERRS) #define NCCHNERR_SUBNOTFOUND (0x0013 + ERR_NCCHNERRS) #define NCCHNERR_LOADBUFFERFULL (0x0014 + ERR_NCCHNERRS) #define NCCHNERR_INVALIDIDENTIFIER (0x0015 + ERR_NCCHNERRS) #define NCCHNERR_UNKNOWNIDENTIFIER (0x0016 + ERR_NCCHNERRS) #define NCCHNERR_SUBINCOMPLETE (0x0017 + ERR_NCCHNERRS) #define NCCHNERR_ZERODIVIDE (0x0020 + ERR_NCCHNERRS) #define NCCHNERR_BADCIRCLE (0x0021 + ERR_NCCHNERRS) #define NCCHNERR_INVALIDOPERATION (0x0022 + ERR_NCCHNERRS) #define NCCHNERR_CALLSTACKOVR (0x0030 + ERR_NCCHNERRS) #define NCCHNERR_CALLSTACKUDR (0x0031 + ERR_NCCHNERRS) #define NCCHNERR_CALCSTACKOVR (0x0032 + ERR_NCCHNERRS) #define NCCHNERR_CALCSTACKUDR (0x0033 + ERR_NCCHNERRS) #define NCCHNERR_REGINDEX (0x0040 + ERR_NCCHNERRS) #define NCCHNERR_GFUNCINDEX (0x0041 + ERR_NCCHNERRS) #define NCCHNERR_MFUNCINDEX (0x0042 + ERR_NCCHNERRS) #define NCCHNERR_EXTENDEDADDR (0x0043 + ERR_NCCHNERRS) #define NCCHNERR_INTERNALINDEXH (0x0044 + ERR_NCCHNERRS) #define NCCHNERR_MDBACCESSINDEX (0x0045 + ERR_NCCHNERRS) #define NCTRAFOERR_CANNOTCHANGE (0x0050 + ERR_NCCHNERRS) #define NCTRAFOERR_CANNOTCORRECT (0x0051 + ERR_NCCHNERRS) #define NCTRAFOERR_PLANE (0x0052 + ERR_NCCHNERRS) #define NCTRAFOERR_DPARAMINVALID (0x0053 + ERR_NCCHNERRS) #define NCTRAFOERR_TOOLRADIUSINV (0x0054 + ERR_NCCHNERRS) #define NCTRAFOERR_CHANGETOOLRAD (0x0055 + ERR_NCCHNERRS) #define NCTRAFOERR_CDOVERFLOW (0x0056 + ERR_NCCHNERRS) #define NCTRAFOERR_CDON (0x0057 + ERR_NCCHNERRS) #define NCTRAFOERR_CDCHECK (0x0058 + ERR_NCCHNERRS) #define NCTRAFOERR_CDUNEXPECTED (0x0059 + ERR_NCCHNERRS) #define NCTRAFOERR_CDNEGRADIUS (0x005A + ERR_NCCHNERRS) #define NCTRAFOERR_CDOCCURED (0x005B + ERR_NCCHNERRS) #define NCTRAFOERR_COOKEDTBLFULL (0x005C + ERR_NCCHNERRS) #define NCTRAFOERR_TFTBLFULL (0x005D + ERR_NCCHNERRS) #define NCTRAFOERR_EXECTFTBLFULL (0x005E + ERR_NCCHNERRS) #define NCTRAFOERR_EXECTFT (0x005F + ERR_NCCHNERRS) #define NCBACKUPERR_WRITEDATA (0x0060 + ERR_NCCHNERRS) #define NCBACKUPERR_TARGETENTRY (0x0061 + ERR_NCCHNERRS) #define MACHINEIDENTRYDONTCARE 0xFF #define AMS_NETIDLEN 23 typedef struct AmsNetId_ { guint8 b[6]; } AmsNetId; #define AmsNetId_Len (int)sizeof(AmsNetId) typedef struct AmsAddr_ { AmsNetId netId; guint16 port; } AmsAddr; typedef union ErrCodeUnion { gint32 errCode; gint32 hRcv; } ErrCodeUnion; typedef union tUserUnion { gint32 hUser; struct { guint16 fragmentNo; guint16 packetNo; } a; } UserUnion; typedef struct { AmsAddr target; AmsAddr sender; guint16 cmdId; guint16 stateFlags; guint32 cbData; ErrCodeUnion anErrCodeUnion; UserUnion aUserUnion; } AmsHead; #define AmsHead_Len (int)sizeof(AmsHead) /* State flags */ #define AMSCMDSF_RESPONSE 0x0001 #define AMSCMDSF_NORETURN 0x0002 #define AMSCMDSF_ADSCMD 0x0004 #define AMSCMDSF_SYSCMD 0x0008 #define AMSCMDSF_HIGHPRIO 0x0010 #define AMSCMDSF_TIMESTAMPADDED 0x0020 #define AMSCMDSF_UDP 0x0040 #define AMSCMDSF_INITCMD 0x0080 #define AMSCMDSF_BROADCAST 0x8000 /* AmsCmd */ typedef struct { AmsHead head; } AmsCmd, *PAmsCmd; /* ADS */ #define ADS_FIXEDNAMESIZE 16 /* ADS Service Ids */ #define ADSSRVID_INVALID 0x00 #define ADSSRVID_READDEVICEINFO 0x01 #define ADSSRVID_READ 0x02 #define ADSSRVID_WRITE 0x03 #define ADSSRVID_READSTATE 0x04 #define ADSSRVID_WRITECTRL 0x05 #define ADSSRVID_ADDDEVICENOTE 0x06 #define ADSSRVID_DELDEVICENOTE 0x07 #define ADSSRVID_DEVICENOTE 0x08 #define ADSSRVID_READWRITE 0x09 /* ADS reserved index groups */ #define ADSIGRP_SYMTAB 0xF000 #define ADSIGRP_SYMNAME 0xF001 #define ADSIGRP_SYMVAL 0xF002 #define ADSIGRP_SYM_HNDBYNAME 0xF003 #define ADSIGRP_SYM_VALBYNAME 0xF004 #define ADSIGRP_SYM_VALBYHND 0xF005 #define ADSIGRP_SYM_RELEASEHND 0xF006 #define ADSIGRP_SYM_INFOBYNAME 0xF007 #define ADSIGRP_SYM_VERSION 0xF008 #define ADSIGRP_SYM_INFOBYNAMEEX 0xF009 #define ADSIGRP_SYM_DOWNLOAD 0xF00A #define ADSIGRP_SYM_UPLOAD 0xF00B #define ADSIGRP_SYM_UPLOADINFO 0xF00C #define ADSIGRP_SYM_DOWNLOAD2 0xF00D #define ADSIGRP_SYM_DT_UPLOAD 0xF00E #define ADSIGRP_SYM_UPLOADINFO2 0xF00F #define ADSIGRP_SYMNOTE 0xF010 #define ADSIGRP_SYM_DT_INFOBYNAMEEX 0xF011 #define ADSIGRP_SYM_ADDRBYHND 0xF012 #define ADSIGRP_IOIMAGE_RWIB 0xF020 #define ADSIGRP_IOIMAGE_RWIX 0xF021 #define ADSIGRP_IOIMAGE_RISIZE 0xF025 #define ADSIGRP_IOIMAGE_RWOB 0xF030 #define ADSIGRP_IOIMAGE_RWOX 0xF031 #define ADSIGRP_IOIMAGE_ROSIZE 0xF035 #define ADSIGRP_IOIMAGE_CLEARI 0xF040 #define ADSIGRP_IOIMAGE_CLEARO 0xF050 #define ADSIGRP_IOIMAGE_RWIOB 0xF060 #define ADSIGRP_IOIMAGE_CREATE 0xF068 #define ADSIGRP_SUMUP_READ 0xF080 #define ADSIGRP_SUMUP_WRITE 0xF081 #define ADS_SUMUP_IGRP(p, i) (((guint32*)p)[(i)*3+0]) #define ADS_SUMUP_IOFFS(p, i) (((guint32*)p)[(i)*3+1]) #define ADS_SUMUP_LENGTH(p, i) (((guint32*)p)[(i)*3+2]) #define ADSIGRP_DEVICE_DATA 0xF100 #define ADSIOFFS_DEVDATA_ADSSTATE 0x0000 #define ADSIOFFS_DEVDATA_DEVSTATE 0x0002 #define ADSIOFFS_DEVDATA_CONFIGID 0x0004 #define ADSIOFFS_DEVDATA_ADSVERSIONCHECK 0x0005 #define ADSIGRP_TASK_DATA 0xF200 /* ADSIGRP_TASK_DATA reserved until 0xF2FF*/ #define ADSIGRP_CANOPEN_BEGIN 0xF300 #define ADSIGRP_CANOPEN_SDO 0xF302 #define ADSIGRP_CANOPEN_SDO_INFO_LIST 0xF3FC #define ADSIGRP_CANOPEN_SDO_INFO_OBJ 0xF3FD #define ADSIGRP_CANOPEN_SDO_INFO_ENTRY 0xF3FE #define ADSIGRP_CANOPEN_END 0xF3FF #define ADSIGRP_ECAT_FOE_BEGIN 0xF400 #define ADSIGRP_ECAT_FOE_FOPENREAD 0xF401 #define ADSIGRP_ECAT_FOE_FOPENWRITE 0xF402 #define ADSIGRP_ECAT_FOE_FCLOSE 0xF403 #define ADSIGRP_ECAT_FOE_FREAD 0xF404 #define ADSIGRP_ECAT_FOE_FWRITE 0xF405 #define ADSIGRP_ECAT_FOE_PROGRESSINFO 0xF406 #define ADSIGRP_ECAT_FOE_END 0xF41F #define ADSIGRP_ECAT_SOE 0xF420 #define ADSIOFFS_ECAT_SOE_ELEMENT_MASK 0x00FF0000 #define ADSIOFFS_ECAT_SOE_DATASTATE 0x00010000 #define ADSIOFFS_ECAT_SOE_NAME 0x00020000 #define ADSIOFFS_ECAT_SOE_ATTRIBUTE 0x00040000 #define ADSIOFFS_ECAT_SOE_UNIT 0x00080000 #define ADSIOFFS_ECAT_SOE_MIN 0x00100000 #define ADSIOFFS_ECAT_SOE_MAX 0x00200000 #define ADSIOFFS_ECAT_SOE_VALUE 0x00400000 #define ADSIOFFS_ECAT_SOE_DEFAULT 0x00800000 #define ADSIOFFS_ECAT_SOE_DRIVENO_MASK 0x07000000 #define ADSIOFFS_ECAT_SOE_COMMAND 0x08000000 #define ADSIGRP_ECAT_VOE 0xF430 typedef enum nAdsState { ADSSTATE_INVALID =0, ADSSTATE_IDLE =1, ADSSTATE_RESET =2, ADSSTATE_INIT =3, ADSSTATE_START =4, ADSSTATE_RUN =5, ADSSTATE_STOP =6, ADSSTATE_SAVECFG =7, ADSSTATE_LOADCFG =8, ADSSTATE_POWERFAILURE =9, ADSSTATE_POWERGOOD =10, ADSSTATE_ERROR =11, ADSSTATE_SHUTDOWN =12, ADSSTATE_SUSPEND =13, ADSSTATE_RESUME =14, ADSSTATE_CONFIG =15, ADSSTATE_RECONFIG =16, ADSSTATE_MAXSTATES } ADSSTATE; typedef enum nAdsTransMode { ADSTRANS_NOTRANS =0, ADSTRANS_CLIENTCYCLE =1, ADSTRANS_CLIENTONCHA =2, ADSTRANS_SERVERCYCLE =3, ADSTRANS_SERVERONCHA =4, ADSTRANS_CLIENT1REQ =10, ADSTRANS_MAXMODES }ADSTRANSMODE; /* ADS error codes */ #define ADSERR_NOERR 0x00 #define ADSERR_DEVICE_ERROR (0x700) #define ADSERR_DEVICE_SRVNOTSUPP (0x701) #define ADSERR_DEVICE_INVALIDGRP (0x702) #define ADSERR_DEVICE_INVALIDOFFSET (0x703) #define ADSERR_DEVICE_INVALIDACCESS (0x704) #define ADSERR_DEVICE_INVALIDSIZE (0x705) #define ADSERR_DEVICE_INVALIDDATA (0x706) #define ADSERR_DEVICE_NOTREADY (0x707) #define ADSERR_DEVICE_BUSY (0x708) #define ADSERR_DEVICE_INVALIDCONTEXT (0x709) #define ADSERR_DEVICE_NOMEMORY (0x70A) #define ADSERR_DEVICE_INVALIDPARM (0x70B) #define ADSERR_DEVICE_NOTFOUND (0x70C) #define ADSERR_DEVICE_SYNTAX (0x70D) #define ADSERR_DEVICE_INCOMPATIBLE (0x70E) #define ADSERR_DEVICE_EXISTS (0x70F) #define ADSERR_DEVICE_SYMBOLNOTFOUND (0x710) #define ADSERR_DEVICE_SYMBOLVERSIONINVALID (0x711) #define ADSERR_DEVICE_INVALIDSTATE (0x712) #define ADSERR_DEVICE_TRANSMODENOTSUPP (0x713) #define ADSERR_DEVICE_NOTIFYHNDINVALID (0x714) #define ADSERR_DEVICE_CLIENTUNKNOWN (0x715) #define ADSERR_DEVICE_NOMOREHDLS (0x716) #define ADSERR_DEVICE_INVALIDWATCHSIZE (0x717) #define ADSERR_DEVICE_NOTINIT (0x718) #define ADSERR_DEVICE_TIMEOUT (0x719) #define ADSERR_DEVICE_NOINTERFACE (0x71A) #define ADSERR_DEVICE_INVALIDINTERFACE (0x71B) #define ADSERR_DEVICE_INVALIDCLSID (0x71C) #define ADSERR_DEVICE_INVALIDOBJID (0x71D) #define ADSERR_DEVICE_PENDING (0x71E) #define ADSERR_DEVICE_ABORTED (0x71F) #define ADSERR_DEVICE_WARNING (0x720) #define ADSERR_DEVICE_INVALIDARRAYIDX (0x721) #define ADSERR_DEVICE_SYMBOLNOTACTIVE (0x722) #define ADSERR_DEVICE_ACCESSDENIED (0x723) #define ADSERR_CLIENT_ERROR (0x740) #define ADSERR_CLIENT_INVALIDPARM (0x741) #define ADSERR_CLIENT_LISTEMPTY (0x742) #define ADSERR_CLIENT_VARUSED (0x743) #define ADSERR_CLIENT_DUPLINVOKEID (0x744) #define ADSERR_CLIENT_SYNCTIMEOUT (0x745) #define ADSERR_CLIENT_W32ERROR (0x746) #define ADSERR_CLIENT_TIMEOUTINVALID (0x747) #define ADSERR_CLIENT_PORTNOTOPEN (0x748) #define ADSERR_CLIENT_NOAMSADDR (0x749) #define ADSERR_CLIENT_SYNCINTERNAL (0x750) #define ADSERR_CLIENT_ADDHASH (0x751) #define ADSERR_CLIENT_REMOVEHASH (0x752) #define ADSERR_CLIENT_NOMORESYM (0x753) #define ADSERR_CLIENT_SYNCRESINVALID (0x754) #define ADSERR_CLIENT_SYNCPORTLOCKED (0x755) #define FACILITY_TC_ADS 0x1811 #define FACILITY_TC_CNC 0x1821 #define FACILITY_TC_IO 0x1831 #if 0 /* Unused ?? */ #define ADS_E_ERROR (0x98110000L + ADSERR_DEVICE_ERROR) #define ADS_E_SRVNOTSUPP (0x98110000L + ADSERR_DEVICE_SRVNOTSUPP) #define ADS_E_INVALIDGRP (0x98110000L + ADSERR_DEVICE_INVALIDGRP) #define ADS_E_INVALIDOFFSET (0x98110000L + ADSERR_DEVICE_INVALIDOFFSET) #define ADS_E_INVALIDACCESS (0x98110000L + ADSERR_DEVICE_INVALIDACCESS) #define ADS_E_INVALIDSIZE (0x98110000L + ADSERR_DEVICE_INVALIDSIZE) #define ADS_E_INVALIDDATA (0x98110000L + ADSERR_DEVICE_INVALIDDATA) #define ADS_E_NOTREADY (0x98110000L + ADSERR_DEVICE_NOTREADY) #define ADS_E_BUSY (0x98110000L + ADSERR_DEVICE_BUSY) #define ADS_E_INVALIDCONTEXT (0x98110000L + ADSERR_DEVICE_INVALIDCONTEXT) #define ADS_E_NOMEMORY (0x98110000L + ADSERR_DEVICE_NOMEMORY) #define ADS_E_INVALIDPARM (0x98110000L + ADSERR_DEVICE_INVALIDPARM) #define ADS_E_NOTFOUND (0x98110000L + ADSERR_DEVICE_NOTFOUND) #define ADS_E_SYNTAX (0x98110000L + ADSERR_DEVICE_SYNTAX) #define ADS_E_INCOMPATIBLE (0x98110000L + ADSERR_DEVICE_INCOMPATIBLE) #define ADS_E_EXISTS (0x98110000L + ADSERR_DEVICE_EXISTS) #define ADS_E_SYMBOLNOTFOUND (0x98110000L + ADSERR_DEVICE_SYMBOLNOTFOUND) #define ADS_E_SYMBOLVERSIONINVALID (0x98110000L + ADSERR_DEVICE_SYMBOLVERSIONINVALID) #define ADS_E_INVALIDSTATE (0x98110000L + ADSERR_DEVICE_INVALIDSTATE) #define ADS_E_TRANSMODENOTSUPP (0x98110000L + ADSERR_DEVICE_TRANSMODENOTSUPP) #define ADS_E_NOTIFYHNDINVALID (0x98110000L + ADSERR_DEVICE_NOTIFYHNDINVALID) #define ADS_E_CLIENTUNKNOWN (0x98110000L + ADSERR_DEVICE_CLIENTUNKNOWN) #define ADS_E_NOMOREHDLS (0x98110000L + ADSERR_DEVICE_NOMOREHDLS) #define ADS_E_INVALIDWATCHSIZE (0x98110000L + ADSERR_DEVICE_INVALIDWATCHSIZE) #define ADS_E_NOTINIT (0x98110000L + ADSERR_DEVICE_NOTINIT) #define ADS_E_TIMEOUT (0x98110000L + ADSERR_DEVICE_TIMEOUT) #define ADS_E_NOINTERFACE (0x98110000L + ADSERR_DEVICE_NOINTERFACE) #define ADS_E_INVALIDINTERFACE (0x98110000L + ADSERR_DEVICE_INVALIDINTERFACE) #define ADS_E_INVALIDCLSID (0x98110000L + ADSERR_DEVICE_INVALIDCLSID) #define ADS_E_INVALIDOBJID (0x98110000L + ADSERR_DEVICE_INVALIDOBJID) #define ADS_E_PENDING (0x98110000L + ADSERR_DEVICE_PENDING) #define ADS_E_ABORTED (0x98110000L + ADSERR_DEVICE_ABORTED) #define ADS_E_WARNING (0x98110000L + ADSERR_DEVICE_WARNING) #define ADS_E_INVALIDARRAYIDX (0x98110000L + ADSERR_DEVICE_INVALIDARRAYIDX) #define ADS_E_SYMBOLNOTACTIVE (0x98110000L + ADSERR_DEVICE_SYMBOLNOTACTIVE) #define ADS_E_ACCESSDENIED (0x98110000L + ADSERR_DEVICE_ACCESSDENIED) #endif #ifndef ANYSIZE_ARRAY #define ANYSIZE_ARRAY 1 #endif /* ADS AMS command */ /*typedef struct { guint32 hNotification; guint32 cbSampleSize; guint8 data[ANYSIZE_ARRAY]; } AdsNotificationSample, *PAdsNotificationSample;*/ #define AdsNotificationSample_Min_Len 4 typedef struct { guint32 invokeId; } TAdsReadDeviceInfoReq; #define TAdsReadDeviceInfoReq_Len (int)sizeof(TAdsReadDeviceInfoReq) /*typedef struct { guint16 adsState; guint16 deviceState; guint32 cbLength; guint16 firstDataWord; } TAdsWriteControlReq, TAdsWriteControlInd;*/ #define TAdsWriteControlReq_Len 10 typedef struct { guint32 invokeId; } TAdsReadStateReq; #define TAdsReadStateReq_Len (int)sizeof(TAdsReadStateReq) typedef struct { guint32 indexGroup; guint32 indexOffset; guint32 cbLength; } TAdsReadReq; #define TAdsReadReq_Len (int)sizeof(TAdsReadReq) /*typedef struct { guint32 indexGroup; guint32 indexOffset; guint32 cbLength; guint16 firstDataWord; } TAdsWriteReq;*/ #define TAdsWriteReq_Len 14 /* typedef struct { guint32 indexGroup; guint32 indexOffset; guint32 cbReadLength; guint32 cbWriteLength; guint16 firstDataWord; } TAdsReadWriteReq;*/ #define TAdsReadWriteReq_Len 18 typedef struct { guint32 cbLength; guint32 nTransMode; guint32 nMaxDelay; guint32 nCycleTime; guint8 nCmpMax[sizeof(double)]; guint8 nCmpMin[sizeof(double)]; } AdsNotificationAttrib; typedef struct { guint32 indexGroup; guint32 indexOffset; AdsNotificationAttrib noteAttrib; } TAdsAddDeviceNotificationReq; #define TAdsAddDeviceNotificationReq_Len (int)sizeof(TAdsAddDeviceNotificationReq) typedef struct { guint32 hNotification; } TAdsDelDeviceNotificationReq; #define TAdsDelDeviceNotificationReq_Len (int)sizeof(TAdsDelDeviceNotificationReq) typedef struct { guint32 cbLength; guint32 nStamps; } TAdsDeviceNotificationReq; #define TAdsDeviceNotificationReq_Len (int)sizeof(TAdsDeviceNotificationReq) typedef struct { guint32 result; } TAdsRes; #define TAdsRes_Len (int)sizeof(TAdsRes) typedef struct { guint8 version; guint8 revision; guint16 build; } AdsVersion, *PAdsVersion; typedef struct { guint32 result; AdsVersion version; char sName[ADS_FIXEDNAMESIZE]; } TAdsReadDeviceInfoRes; #define TAdsReadDeviceInfoRes_Len (int)sizeof(TAdsReadDeviceInfoRes) typedef struct { guint32 result; } TAdsWriteControlRes; #define TAdsWriteControlRes_Len (int)sizeof(TAdsWriteControlRes) typedef struct { guint32 result; guint16 adsState; guint16 deviceState; } TAdsReadStateRes; #define TAdsReadStateRes_Len (int)sizeof(TAdsReadStateRes) typedef struct { guint32 result; guint32 cbLength; guint16 firstDataWord; } TAdsReadRes; #define TAdsReadRes_Len (int)sizeof(TAdsReadRes) typedef struct { guint32 result; guint32 cbLength; guint16 firstDataWord; } TAdsReadWriteRes; #define TAdsReadWriteRes_Len (int)sizeof(TAdsReadWriteRes) typedef struct { guint32 result; } TAdsWriteRes; #define TAdsWriteRes_Len (int)sizeof(TAdsWriteRes) typedef struct { guint32 result; guint32 handle; } TAdsAddDeviceNotificationRes; #define TAdsAddDeviceNotificationRes_Len (int)sizeof(TAdsAddDeviceNotificationRes) typedef struct { guint32 result; } TAdsDelDeviceNotificationRes; #define TAdsDelDeviceNotificationRes_Len (int)sizeof(TAdsDelDeviceNotificationRes) /* structure for decoding the header -----------------------------------------*/ /*typedef struct { guint16 reserved; guint32 cbLength; } TcpAdsParserHDR; typedef TcpAdsParserHDR;*/ #define TcpAdsParserHDR_Len 6 #endif /* * Editor modelines * * Local Variables: * c-basic-offset: 3 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=3 tabstop=8 expandtab: * :indentSize=3:tabSize=8:noTabs=true: */
C
wireshark/plugins/epan/ethercat/packet-ecatmb.c
/* packet-ecatmb.c * Routines for EtherCAT packet disassembly * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Include files */ #include "config.h" #include <string.h> #include <epan/packet.h> #include <epan/expert.h> #include "packet-ecatmb.h" #define BIT2BYTE(x) ((x+7)/8) #define ENDOF(p) ((p)+1) /* pointer to end of *p */ void proto_register_ecat_mailbox(void); void proto_reg_handoff_ecat_mailbox(void); static dissector_handle_t eth_handle; static dissector_handle_t ams_handle; static dissector_handle_t ecat_mailbox_handle; /* Define the EtherCAT mailbox proto */ int proto_ecat_mailbox = -1; static int ett_ecat_mailbox = -1; static int ett_ecat_mailbox_eoe = -1; static int ett_ecat_mailbox_eoe_init = -1; static int ett_ecat_mailbox_eoe_macfilter = -1; static int ett_ecat_mailbox_eoe_macfilter_filter = -1; static int ett_ecat_mailbox_eoe_macfilter_filtermask = -1; static int ett_ecat_mailbox_coe = -1; static int ett_ecat_mailbox_sdo = -1; static int ett_ecat_mailbox_coe_sdoccs = -1; static int ett_ecat_mailbox_coe_sdoscs = -1; static int ett_ecat_mailbox_foe = -1; static int ett_ecat_mailbox_foe_efw = -1; static int ett_ecat_mailbox_soeflag = -1; static int ett_ecat_mailbox_soe = -1; static int ett_ecat_mailbox_fraghead = -1; static int ett_ecat_mailbox_header = -1; static int hf_ecat_mailboxlength = -1; static int hf_ecat_mailboxaddress = -1; static int hf_ecat_mailboxpriority = -1; static int hf_ecat_mailboxtype = -1; static int hf_ecat_mailboxcounter = -1; static int hf_ecat_mailbox_eoe = -1; static int hf_ecat_mailbox_eoe_fraghead = -1; static int hf_ecat_mailbox_eoe_type = -1; static int hf_ecat_mailbox_eoe_fragno = -1; static int hf_ecat_mailbox_eoe_offset = -1; static int hf_ecat_mailbox_eoe_frame = -1; static int hf_ecat_mailbox_eoe_last = -1; static int hf_ecat_mailbox_eoe_timestampreq = -1; static int hf_ecat_mailbox_eoe_timestampapp = -1; static int hf_ecat_mailbox_eoe_fragment = -1; static int hf_ecat_mailbox_eoe_init = -1; static int hf_ecat_mailbox_eoe_init_contains_macaddr = -1; static int hf_ecat_mailbox_eoe_init_contains_ipaddr = -1; static int hf_ecat_mailbox_eoe_init_contains_subnetmask = -1; static int hf_ecat_mailbox_eoe_init_contains_defaultgateway = -1; static int hf_ecat_mailbox_eoe_init_contains_dnsserver = -1; static int hf_ecat_mailbox_eoe_init_contains_dnsname = -1; static int hf_ecat_mailbox_eoe_init_append_timestamp = -1; static int hf_ecat_mailbox_eoe_init_macaddr = -1; static int hf_ecat_mailbox_eoe_init_ipaddr = -1; static int hf_ecat_mailbox_eoe_init_subnetmask = -1; static int hf_ecat_mailbox_eoe_init_defaultgateway = -1; static int hf_ecat_mailbox_eoe_init_dnsserver = -1; static int hf_ecat_mailbox_eoe_init_dnsname = -1; static int hf_ecat_mailbox_eoe_macfilter = -1; static int hf_ecat_mailbox_eoe_macfilter_macfiltercount = -1; static int hf_ecat_mailbox_eoe_macfilter_maskcount = -1; static int hf_ecat_mailbox_eoe_macfilter_nobroadcasts = -1; static int hf_ecat_mailbox_eoe_macfilter_filter; static int hf_ecat_mailbox_eoe_macfilter_filters[16] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; static int hf_ecat_mailbox_eoe_macfilter_filtermask = -1; static int hf_ecat_mailbox_eoe_macfilter_filtermasks[4] = {-1,-1,-1,-1}; static int hf_ecat_mailbox_eoe_timestamp = -1; static int hf_ecat_mailbox_coe = -1; static int hf_ecat_mailbox_coe_number = -1; static int hf_ecat_mailbox_coe_type = -1; static int hf_ecat_mailbox_coe_sdoreq = -1; static int hf_ecat_mailbox_coe_sdoccsid = -1; static int hf_ecat_mailbox_coe_sdoccsid_sizeind = -1; static int hf_ecat_mailbox_coe_sdoccsid_expedited = -1; static int hf_ecat_mailbox_coe_sdoccsid_size0= -1; static int hf_ecat_mailbox_coe_sdoccsid_size1= -1; static int hf_ecat_mailbox_coe_sdoccsid_complete = -1; static int hf_ecat_mailbox_coe_sdoccsds = -1; static int hf_ecat_mailbox_coe_sdoccsds_lastseg = -1; static int hf_ecat_mailbox_coe_sdoccsds_size = -1; static int hf_ecat_mailbox_coe_sdoccsds_toggle = -1; static int hf_ecat_mailbox_coe_sdoccsus = -1; static int hf_ecat_mailbox_coe_sdoccsus_toggle = -1; static int hf_ecat_mailbox_coe_sdoccsiu = -1; /* static int hf_ecat_mailbox_coe_sdoccsiu_complete = -1; */ static int hf_ecat_mailbox_coe_sdoidx = -1; static int hf_ecat_mailbox_coe_sdoabortcode = -1; static int hf_ecat_mailbox_coe_sdosub = -1; static int hf_ecat_mailbox_coe_sdodata = -1; static int hf_ecat_mailbox_coe_sdodata1 = -1; static int hf_ecat_mailbox_coe_sdodata2 = -1; static int hf_ecat_mailbox_coe_sdoldata = -1; static int hf_ecat_mailbox_coe_sdolength = -1; /* static int hf_ecat_mailbox_coe_sdoerror = -1; */ static int hf_ecat_mailbox_coe_sdores = -1; static int hf_ecat_mailbox_coe_sdoscsds = -1; static int hf_ecat_mailbox_coe_sdoscsds_toggle = -1; static int hf_ecat_mailbox_coe_sdoscsiu = -1; static int hf_ecat_mailbox_coe_sdoscsiu_sizeind = -1; static int hf_ecat_mailbox_coe_sdoscsiu_expedited = -1; static int hf_ecat_mailbox_coe_sdoscsiu_size0 = -1; static int hf_ecat_mailbox_coe_sdoscsiu_size1 = -1; static int hf_ecat_mailbox_coe_sdoscsiu_complete = -1; static int hf_ecat_mailbox_coe_sdoscsus = -1; static int hf_ecat_mailbox_coe_sdoscsus_lastseg = -1; static int hf_ecat_mailbox_coe_sdoscsus_bytes = -1; static int hf_ecat_mailbox_coe_sdoscsus_toggle = -1; static int hf_ecat_mailbox_coe_sdoinfoopcode = -1; static int hf_ecat_mailbox_coe_sdoinfofrag = -1; static int hf_ecat_mailbox_coe_sdoinfolisttype = -1; static int hf_ecat_mailbox_coe_sdoinfolist = -1; static int hf_ecat_mailbox_coe_sdoinfoindex = -1; static int hf_ecat_mailbox_coe_sdoinfosubindex = -1; static int hf_ecat_mailbox_coe_sdoinfovalueinfo = -1; static int hf_ecat_mailbox_coe_sdoinfoerrorcode = -1; static int hf_ecat_mailbox_coe_sdoinfodatatype = -1; static int hf_ecat_mailbox_coe_sdoinfomaxsub = -1; static int hf_ecat_mailbox_coe_sdoinfoobjcode = -1; static int hf_ecat_mailbox_coe_sdoinfoname = -1; static int hf_ecat_mailbox_coe_sdoinfobitlen = -1; static int hf_ecat_mailbox_coe_sdoinfoobjaccess = -1; static int hf_ecat_mailbox_coe_sdoinfounittype = -1; static int hf_ecat_mailbox_coe_sdoinfodefaultvalue = -1; static int hf_ecat_mailbox_coe_sdoinfominvalue = -1; static int hf_ecat_mailbox_coe_sdoinfomaxvalue = -1; static int hf_ecat_mailboxdata = -1; static int hf_ecat_mailbox_foe = -1; static int hf_ecat_mailbox_foe_opmode = -1; static int hf_ecat_mailbox_foe_filelength = -1; static int hf_ecat_mailbox_foe_filename = -1; static int hf_ecat_mailbox_foe_packetno = -1; static int hf_ecat_mailbox_foe_errcode = -1; static int hf_ecat_mailbox_foe_errtext = -1; static int hf_ecat_mailbox_foe_busydone = -1; static int hf_ecat_mailbox_foe_busyentire = -1; static int hf_ecat_mailbox_foe_data = -1; static int hf_ecat_mailbox_foe_efw = -1; static int hf_ecat_mailbox_foe_efw_cmd = -1; static int hf_ecat_mailbox_foe_efw_size = -1; static int hf_ecat_mailbox_foe_efw_addresslw = -1; static int hf_ecat_mailbox_foe_efw_addresshw = -1; static int hf_ecat_mailbox_foe_efw_data = -1; static int hf_ecat_mailbox_soe = -1; static int hf_ecat_mailbox_soe_header = -1; static int hf_ecat_mailbox_soe_header_opcode = -1; static int hf_ecat_mailbox_soe_header_incomplete = -1; static int hf_ecat_mailbox_soe_header_error = -1; static int hf_ecat_mailbox_soe_header_driveno = -1; static int hf_ecat_mailbox_soe_header_datastate = -1; static int hf_ecat_mailbox_soe_header_name = -1; static int hf_ecat_mailbox_soe_header_attribute = -1; static int hf_ecat_mailbox_soe_header_unit = -1; static int hf_ecat_mailbox_soe_header_min = -1; static int hf_ecat_mailbox_soe_header_max = -1; static int hf_ecat_mailbox_soe_header_value = -1; static int hf_ecat_mailbox_soe_header_reserved = -1; static int hf_ecat_mailbox_soe_idn = -1; static int hf_ecat_mailbox_soe_data = -1; static int hf_ecat_mailbox_soe_frag = -1; static int hf_ecat_mailbox_soe_error = -1; static expert_field ei_ecat_mailbox_error = EI_INIT; static expert_field ei_ecat_mailbox_coe_error = EI_INIT; static expert_field ei_ecat_mailbox_eoe_error = EI_INIT; static expert_field ei_ecat_mailbox_soe_error = EI_INIT; static expert_field ei_ecat_mailbox_foe_error = EI_INIT; static const value_string EcMBoxType[] = { { 0, "Invalid", }, { 1, "AoE (Vendor specific; Beckhoff ADS over EtherCAT)", }, { 2, "EoE (Ethernet over EtherCAT)", }, { 3, "CoE (CANopen over EtherCAT)", }, { 4, "FoE (File access over EtherCAT)", }, { 5, "SoE (Servo profile over EtherCAT)", }, { 15, "VoE (Vendor specific over EtherCAT)"}, { 0x80+1, "AoE - Err", }, { 0x80+2, "EoE - Err", }, { 0x80+3, "CoE - Err", }, { 0x80+4, "FoE - Err", }, { 0x80+5, "SoE - Err", }, { 0, NULL } }; static const value_string FoEOpMode[] = { { 1, "RRQ", }, { 2, "WRQ", }, { 3, "DATA", }, { 4, "ACK", }, { 5, "ERROR", }, { 6, "BUSY", }, { 0, NULL } }; static const value_string FoEEfwCmd[] = { { 1, "Memory Transfer", }, { 2, "Write Code", }, { 3, "Check device id", }, { 4, "Checksum", }, { 5, "Write code checksum", }, { 6, "Set device id", }, { 8, "Set code id", }, { 9, "NOP", }, { 10, "Checksum checksum", }, { 11, "boot checksum", }, { 0, NULL } }; static const value_string SoeOpcode[] = { { 0, "unused" }, { 1, "readReq" }, { 2, "readRes"}, { 3, "writeReq"}, { 4, "writeRes" }, { 5, "notification" }, { 6, "emergency"}, { 0, NULL } }; static const value_string EoEType[] = { { EOE_TYPE_FRAME_FRAG, "Fragment" }, { EOE_TYPE_TIMESTAMP_RES, "TimeStamp" }, { EOE_TYPE_INIT_REQ, "Init Req"}, { EOE_TYPE_INIT_RES, "Init Res"}, { EOE_TYPE_MACFILTER_REQ, "MAC Req" }, { EOE_TYPE_MACFILTER_RES, "MAC Res" }, { 0, NULL } }; static const value_string CANopenType[] = { { ETHERCAT_COE_TYPE_EMERGENCY, "EMERGENCY" }, { ETHERCAT_COE_TYPE_SDOREQ, "SDO Req" }, { ETHERCAT_COE_TYPE_SDORES, "SDO Res"}, { ETHERCAT_COE_TYPE_TXPDO, "TxPDO"}, { ETHERCAT_COE_TYPE_RXPDO, "RxPDO" }, { ETHERCAT_COE_TYPE_TXPDO_RTR, "TxPDO_RTR" }, { ETHERCAT_COE_TYPE_RXPDO_RTR, "RxPDO_RTR" }, { ETHERCAT_COE_TYPE_SDOINFO, "SDO Information" }, { 0, NULL } }; static const value_string CANopenSdoInfo[] = { { ECAT_COE_INFO_OPCODE_LIST_Q, "List Req" }, { ECAT_COE_INFO_OPCODE_LIST_S, "List Res" }, { ECAT_COE_INFO_OPCODE_OBJ_Q, "Obj Req"}, { ECAT_COE_INFO_OPCODE_OBJ_S, "Obj Res"}, { ECAT_COE_INFO_OPCODE_ENTRY_Q, "Entry Req" }, { ECAT_COE_INFO_OPCODE_ENTRY_S, "Entry Res" }, { ECAT_COE_INFO_OPCODE_ERROR_S, "Error Res" }, { 0, NULL } }; static const true_false_string tfs_complete = { "Complete", "Legacy" }; void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, gint offset) { pMbox->Length = tvb_get_letohs(tvb, offset); offset+=2; pMbox->Address = tvb_get_letohs(tvb, offset); offset+=2; pMbox->aControlUnion.Control = tvb_get_letohs(tvb, offset); } static void init_eoe_header(PETHERCAT_EOE_HEADER pEoE, tvbuff_t *tvb, gint offset) { pEoE->anEoeHeaderInfoUnion.Info = tvb_get_letohs(tvb, offset); offset+=2; pEoE->anEoeHeaderDataUnion.Result = tvb_get_letohs(tvb, offset); } static void init_foe_header(PETHERCAT_FOE_HEADER pFoE, tvbuff_t *tvb, gint offset) { pFoE->OpMode = tvb_get_guint8(tvb, offset++); pFoE->Reserved1 = tvb_get_guint8(tvb, offset++); pFoE->aFoeHeaderDataUnion.FileLength = tvb_get_letohl(tvb, offset); } static void init_soe_header(PETHERCAT_SOE_HEADER pSoE, tvbuff_t *tvb, gint offset) { pSoE->anSoeHeaderControlUnion.v2.Control = tvb_get_guint8(tvb, offset++); pSoE->anSoeHeaderControlUnion.v2.Element = tvb_get_guint8(tvb, offset++); pSoE->anSoeHeaderDataUnion.FragmentsLeft = tvb_get_letohs(tvb, offset); } static void init_coe_header(PETHERCAT_COE_HEADER pCoE, tvbuff_t *tvb, gint offset) { pCoE->header = tvb_get_letohs(tvb, offset); } static void init_sdo_header(PETHERCAT_SDO_HEADER pSdo, tvbuff_t *tvb, gint offset) { pSdo->anSdoHeaderUnion.CS = tvb_get_guint8(tvb, offset++); pSdo->Index = tvb_get_letohs(tvb, offset);offset+=2; pSdo->SubIndex = tvb_get_guint8(tvb, offset++); pSdo->Data = tvb_get_letohl(tvb, offset); } static void init_sdo_info_header(PETHERCAT_SDO_INFO_HEADER pInfo, tvbuff_t *tvb, gint offset) { pInfo->anSdoControlUnion.Control = tvb_get_guint8(tvb, offset++); pInfo->Reserved = tvb_get_guint8(tvb, offset); pInfo->FragmentsLeft = 2; } static void CANopenSdoReqFormatter(PETHERCAT_SDO_HEADER pSdo, char *szText, gint nMax) { switch ( pSdo->anSdoHeaderUnion.Idq.Ccs ) { case SDO_CCS_INITIATE_DOWNLOAD: snprintf ( szText, nMax, "SDO Req : 'Initiate Download' (%d) Idx=0x%x Sub=%d", pSdo->anSdoHeaderUnion.Idq.Ccs, pSdo->Index, pSdo->SubIndex); break; case SDO_CCS_INITIATE_UPLOAD: snprintf ( szText, nMax, "SDO Req : 'Initiate Upload' (%d) Idx=0x%x Sub=%d", pSdo->anSdoHeaderUnion.Idq.Ccs, pSdo->Index, pSdo->SubIndex); break; case SDO_CCS_DOWNLOAD_SEGMENT: snprintf ( szText, nMax, "SDO Req : 'Download Segment' (%d)", pSdo->anSdoHeaderUnion.Idq.Ccs); break; case SDO_CCS_UPLOAD_SEGMENT: snprintf ( szText, nMax, "SDO Req : 'Upload Segment' (%d)", pSdo->anSdoHeaderUnion.Idq.Ccs); break; case SDO_CCS_ABORT_TRANSFER: snprintf ( szText, nMax, "SDO Req : 'Abort Transfer' (%d)", pSdo->anSdoHeaderUnion.Idq.Ccs); break; default: snprintf ( szText, nMax, "SDO Req : Ccs %d", pSdo->anSdoHeaderUnion.Idq.Ccs); } } static void FoeFormatter(tvbuff_t *tvb, wmem_allocator_t *scope, gint offset, char *szText, gint nMax, guint foe_length) { ETHERCAT_FOE_HEADER foe; char *tmp = NULL; init_foe_header(&foe, tvb, offset); switch ( foe.OpMode ) { case ECAT_FOE_OPMODE_RRQ: case ECAT_FOE_OPMODE_WRQ: case ECAT_FOE_OPMODE_ERR: if ( foe_length > ETHERCAT_FOE_HEADER_LEN ) { tmp = tvb_get_string_enc(scope, tvb, offset+ETHERCAT_FOE_HEADER_LEN, MIN(foe_length-ETHERCAT_FOE_HEADER_LEN, 49), ENC_ASCII); } break; } switch ( foe.OpMode ) { case ECAT_FOE_OPMODE_RRQ: snprintf ( szText, nMax, "FoE RRQ (%d) : '%s'", foe.aFoeHeaderDataUnion.FileLength, tmp ? tmp : ""); break; case ECAT_FOE_OPMODE_WRQ: snprintf ( szText, nMax, "FoE WRQ (%d) : '%s'", foe.aFoeHeaderDataUnion.FileLength, tmp ? tmp : ""); break; case ECAT_FOE_OPMODE_DATA: snprintf ( szText, nMax, "FoE DATA (%d) : %d Bytes", foe.aFoeHeaderDataUnion.v.PacketNo, foe_length-ETHERCAT_FOE_HEADER_LEN); break; case ECAT_FOE_OPMODE_ACK: snprintf ( szText, nMax, "FoE ACK (%d)", foe.aFoeHeaderDataUnion.v.PacketNo); break; case ECAT_FOE_OPMODE_ERR: snprintf ( szText, nMax, "FoE ERR (%d) : '%s'", foe.aFoeHeaderDataUnion.ErrorCode, tmp ? tmp : ""); break; case ECAT_FOE_OPMODE_BUSY: if ( foe.aFoeHeaderDataUnion.v2.Entire > 0 ) snprintf ( szText, nMax, "FoE BUSY (%d%%)", ((guint32)foe.aFoeHeaderDataUnion.v2.Done*100)/foe.aFoeHeaderDataUnion.v2.Entire); else snprintf ( szText, nMax, "FoE BUSY (%d/%d)", foe.aFoeHeaderDataUnion.v2.Done, foe.aFoeHeaderDataUnion.v2.Entire); break; default: snprintf ( szText, nMax, "FoE Unknown"); } } static void SoEIdToString( char* txt, guint16 id, int nMax) { if ( id & 0x8000 ) snprintf(txt, nMax, "P-%d-%04d", (id>>12) & 0x0007, id & 0x0FFF ); else snprintf(txt, nMax, "S-%d-%04d", id>>12, id & 0x0FFF ); } static void SoeFormatter(tvbuff_t *tvb, gint offset, char *szText, gint nMax, guint soe_length) { ETHERCAT_SOE_HEADER soe; char tmp[50]; char elm[50]; memset(tmp, 0, sizeof(tmp)); init_soe_header(&soe, tvb, offset); offset+=ETHERCAT_SOE_HEADER_LEN; if ( !soe.anSoeHeaderControlUnion.v.Error ) { if ( !soe.anSoeHeaderControlUnion.v.InComplete ) { SoEIdToString(tmp, soe.anSoeHeaderDataUnion.IDN, sizeof(tmp)-1); elm[0] = '\0'; if ( soe.anSoeHeaderControlUnion.v.DataState ) (void) g_strlcat(elm, "D", 50); if ( soe.anSoeHeaderControlUnion.v.Name ) (void) g_strlcat(elm, "N", 50); if ( soe.anSoeHeaderControlUnion.v.Attribute ) (void) g_strlcat(elm, "A", 50); if ( soe.anSoeHeaderControlUnion.v.Unit ) (void) g_strlcat(elm, "U", 50); if ( soe.anSoeHeaderControlUnion.v.Min ) (void) g_strlcat(elm, "I", 50); if ( soe.anSoeHeaderControlUnion.v.Max ) (void) g_strlcat(elm, "X", 50); if ( soe.anSoeHeaderControlUnion.v.Value ) (void) g_strlcat(elm, "V", 50); switch ( soe.anSoeHeaderControlUnion.v.OpCode ) { case ECAT_SOE_OPCODE_RRQ: snprintf ( szText, nMax, "SoE: RRQ (%s, '%s')", tmp, elm); break; case ECAT_SOE_OPCODE_RRS: snprintf ( szText, nMax, "SoE: RRS (%s, '%s') : %u Bytes", tmp, elm, (guint)(soe_length-ETHERCAT_SOE_HEADER_LEN)); break; case ECAT_SOE_OPCODE_WRS: snprintf ( szText, nMax, "SoE: WRS (%s, '%s')", tmp, elm); break; case ECAT_SOE_OPCODE_WRQ: snprintf ( szText, nMax, "SoE: WRQ (%s, '%s') : %u Bytes", tmp, elm, (guint)(soe_length-ETHERCAT_SOE_HEADER_LEN)); break; case ECAT_SOE_OPCODE_NFC: snprintf ( szText, nMax, "SoE: NFC (%s, '%s') : %u Bytes", tmp, elm, (guint)(soe_length-ETHERCAT_SOE_HEADER_LEN)); break; case 6: snprintf ( szText, nMax, "SoE: EMGCY"); break; default: snprintf ( szText, nMax, "SoE:"); } } else snprintf ( szText, nMax, "SoE: FragmentsLeft %d", soe.anSoeHeaderDataUnion.FragmentsLeft); } else snprintf ( szText, nMax, "SoE: Error %04x", tvb_get_letohs(tvb, offset)); } /* ethercat mailbox */ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { proto_tree *ecat_coe_tree = NULL, *ecat_sdo_tree, *ecat_coe_sdoccs_tree, *ecat_coe_sdoscs_tree; proto_item *anItem = NULL, *aparent = NULL; char szText[200]; int nMax = sizeof(szText)-1; guint coe_length = tvb_reported_length(tvb)-offset; guint16 len; if( tree ) { anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_coe, tvb, offset, coe_length, NULL, "CoE"); aparent = proto_item_get_parent(anItem); proto_item_append_text(aparent,":CoE "); } col_append_str(pinfo->cinfo, COL_INFO, "CoE "); if( coe_length >= ETHERCAT_COE_HEADER_LEN ) { ETHERCAT_COE_HEADER coe; init_coe_header(&coe, tvb, offset); if( tree ) { ecat_coe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe); proto_tree_add_uint(ecat_coe_tree, hf_ecat_mailbox_coe_number, tvb, offset, ETHERCAT_COE_HEADER_LEN, coe.v.Number); proto_tree_add_uint(ecat_coe_tree, hf_ecat_mailbox_coe_type, tvb, offset, ETHERCAT_COE_HEADER_LEN, coe.v.Type); } offset += ETHERCAT_COE_HEADER_LEN; switch (coe.v.Type) { case ETHERCAT_COE_TYPE_SDOREQ: { ETHERCAT_SDO_HEADER sdo; if( coe_length < ETHERCAT_COE_HEADER_LEN + ETHERCAT_SDO_HEADER_LEN ) { col_append_str(pinfo->cinfo, COL_INFO, "Sdo Req - invalid length"); expert_add_info_format(pinfo, ecat_coe_tree, &ei_ecat_mailbox_coe_error, "Sdo Req - invalid length"); break; } init_sdo_header(&sdo, tvb, offset); CANopenSdoReqFormatter(&sdo, szText, nMax); col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { proto_item_append_text(aparent, "%s", szText); anItem = proto_tree_add_uint(ecat_coe_tree, hf_ecat_mailbox_coe_sdoreq, tvb, offset, 1, sdo.anSdoHeaderUnion.Idq.Ccs); proto_item_set_text(anItem, "%s", szText); ecat_sdo_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_sdo); switch ( sdo.anSdoHeaderUnion.Idq.Ccs ) { case SDO_CCS_INITIATE_DOWNLOAD: anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsid, tvb, offset, 1, ENC_LITTLE_ENDIAN); ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_sizeind, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_expedited, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_size0, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_size1, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_complete, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); if ( sdo.anSdoHeaderUnion.Idq.SizeInd && !sdo.anSdoHeaderUnion.Idq.Expedited ) { len = coe_length - ETHERCAT_COE_HEADER_LEN - ETHERCAT_SDO_HEADER_LEN; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdolength, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); offset+=ETHERCAT_SDO_HEADER_LEN; if ( len > 0 ) proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, len, ENC_NA); } else { if ( sdo.anSdoHeaderUnion.Idq.Size == 3 ) proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata1, tvb, offset+4, 1, ENC_LITTLE_ENDIAN); else if ( sdo.anSdoHeaderUnion.Idq.Size == 2 ) proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata2, tvb, offset+4, 2, ENC_LITTLE_ENDIAN); else proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); } break; case SDO_CCS_INITIATE_UPLOAD: anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsiu, tvb, offset, 1, ENC_LITTLE_ENDIAN); ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_complete, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); break; case SDO_CCS_DOWNLOAD_SEGMENT: anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsds, tvb, offset, 1, ENC_LITTLE_ENDIAN); ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsds_lastseg, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsds_size, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsds_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset+=1; if ( coe_length-offset > 0 ) { anItem = proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, coe_length-offset, ENC_NA); proto_item_append_text(anItem, "(len = %d)", coe_length-offset); } break; case SDO_CCS_UPLOAD_SEGMENT: anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsus, tvb, offset, 1, ENC_LITTLE_ENDIAN); ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs); proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsus_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case SDO_CCS_ABORT_TRANSFER: proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoabortcode, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); break; } } } break; case ETHERCAT_COE_TYPE_SDORES: { ETHERCAT_SDO_HEADER sdo; if( coe_length < ETHERCAT_COE_HEADER_LEN + ETHERCAT_SDO_HEADER_LEN ) { col_append_str(pinfo->cinfo, COL_INFO, "Sdo Res - invalid length"); expert_add_info_format(pinfo, ecat_coe_tree, &ei_ecat_mailbox_coe_error, "Sdo Res - invalid length"); break; } init_sdo_header(&sdo, tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, "SDO Res: Scs %d", sdo.anSdoHeaderUnion.Ids.Scs); if( tree ) { proto_tree_add_uint_format_value(ecat_coe_tree, hf_ecat_mailbox_coe_sdores, tvb, offset, 1, sdo.anSdoHeaderUnion.Ids.Scs, "Scs %d", sdo.anSdoHeaderUnion.Ids.Scs); ecat_sdo_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_sdo); switch ( sdo.anSdoHeaderUnion.Ids.Scs ) { case SDO_SCS_INITIATE_DOWNLOAD: proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); break; case SDO_SCS_INITIATE_UPLOAD: anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoscsiu, tvb, offset, 1, ENC_LITTLE_ENDIAN); ecat_coe_sdoscs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoscs); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_sizeind, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_expedited, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_size0, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_size1, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_complete, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); if ( sdo.anSdoHeaderUnion.Ius.SizeInd && !sdo.anSdoHeaderUnion.Ius.Expedited ) { len = coe_length - ETHERCAT_COE_HEADER_LEN - ETHERCAT_SDO_HEADER_LEN; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdolength, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); offset+=ETHERCAT_SDO_HEADER_LEN; if ( len > 0 ) proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, len, ENC_NA); } else if ( sdo.anSdoHeaderUnion.Ius.SizeInd && sdo.anSdoHeaderUnion.Ius.Expedited && sdo.anSdoHeaderUnion.Ius.Size == 3 ) proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata1, tvb, offset+4, 1, ENC_LITTLE_ENDIAN); else if ( sdo.anSdoHeaderUnion.Ius.SizeInd && sdo.anSdoHeaderUnion.Ius.Expedited && sdo.anSdoHeaderUnion.Ius.Size == 2 ) proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata2, tvb, offset+4, 2, ENC_LITTLE_ENDIAN); else proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); break; case SDO_SCS_DOWNLOAD_SEGMENT: anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoscsds, tvb, offset, 1, ENC_LITTLE_ENDIAN); ecat_coe_sdoscs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoscs); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsds_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case SDO_SCS_UPLOAD_SEGMENT: anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoscsus, tvb, offset, 1, ENC_LITTLE_ENDIAN); ecat_coe_sdoscs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoscs); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsus_lastseg, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsus_bytes, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsus_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset+=1; if ( coe_length-offset> 0 ) { anItem = proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, coe_length-offset, ENC_NA); proto_item_append_text(anItem, "(len = %d)", coe_length-offset); } break; } } } break; case ETHERCAT_COE_TYPE_SDOINFO: { ETHERCAT_SDO_INFO_HEADER info; if( coe_length < ETHERCAT_COE_HEADER_LEN + ETHERCAT_SDO_INFO_LISTREQ_LEN ) { col_append_str(pinfo->cinfo, COL_INFO, "Sdo Info - invalid length"); expert_add_info_format(pinfo, ecat_coe_tree, &ei_ecat_mailbox_coe_error, "Sdo Info - invalid length"); break; } memset(&info, 0x0, sizeof(info)); init_sdo_info_header(&info, tvb, offset); col_append_str(pinfo->cinfo, COL_INFO, val_to_str(info.anSdoControlUnion.v.OpCode & 0x7F, CANopenSdoInfo, "%d (Unknown)")); if ( info.anSdoControlUnion.v.InComplete ) col_append_str(pinfo->cinfo, COL_INFO, " - More Follows"); if( tree ) { proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoopcode, tvb, offset++, 1, ENC_LITTLE_ENDIAN); offset++; /*Reserved*/ proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfofrag, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; switch ( info.anSdoControlUnion.v.OpCode ) { case ECAT_COE_INFO_OPCODE_LIST_Q: { proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfolisttype, tvb, offset, 2, ENC_LITTLE_ENDIAN); } break; case ECAT_COE_INFO_OPCODE_LIST_S: { proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfolisttype, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfolist, tvb, offset, coe_length-offset, ENC_NA); } break; case ECAT_COE_INFO_OPCODE_OBJ_Q: proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case ECAT_COE_INFO_OPCODE_OBJ_S: { proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfodatatype, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfomaxsub, tvb, offset++, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoobjcode, tvb, offset++, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoname, tvb, offset, coe_length-offset, ENC_ASCII|ENC_NA); } break; case ECAT_COE_INFO_OPCODE_ENTRY_Q: { proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfosubindex, tvb, offset++, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfovalueinfo, tvb, offset, 1, ENC_LITTLE_ENDIAN); } break; case ECAT_COE_INFO_OPCODE_ENTRY_S: { guint16 objlen; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfosubindex, tvb, offset++, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfovalueinfo, tvb, offset++, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfodatatype, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfobitlen, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoobjaccess, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x08) != 0 ) { proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfounittype, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; } if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x10) != 0 ) { objlen = BIT2BYTE(info.anSdoInfoUnion.Entry.Res.BitLen); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfodefaultvalue, tvb, offset, objlen, ENC_NA); offset+=objlen; } if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x20) != 0 ) { objlen = BIT2BYTE(info.anSdoInfoUnion.Entry.Res.BitLen); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfominvalue, tvb, offset, objlen, ENC_NA); offset+=objlen; } if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x40) != 0 ) { objlen = BIT2BYTE(info.anSdoInfoUnion.Entry.Res.BitLen); proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfomaxvalue, tvb, offset, objlen, ENC_NA); offset+=objlen; } proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoname, tvb, offset, coe_length-offset, ENC_ASCII|ENC_NA); } break; case ECAT_COE_INFO_OPCODE_ERROR_S: { proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoerrorcode, tvb, offset, 4, ENC_LITTLE_ENDIAN); } break; } } } break; } } else { col_append_str(pinfo->cinfo, COL_INFO, "- invalid length"); expert_add_info(pinfo, tree, &ei_ecat_mailbox_coe_error); } } static void dissect_ecat_soe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { proto_tree *ecat_soeflag_tree, *ecat_soe_tree; proto_item *anItem = NULL ,*aparent = NULL; char szText[200]; int nMax = sizeof(szText)-1; guint soe_length = tvb_reported_length(tvb)-offset; if( tree ) { anItem = proto_tree_add_item(tree, hf_ecat_mailbox_soe, tvb, offset, soe_length, ENC_NA); aparent = proto_item_get_parent(anItem); proto_item_append_text(aparent,":SoE "); } if( soe_length >= ETHERCAT_SOE_HEADER_LEN ) { SoeFormatter(tvb, offset, szText, nMax, soe_length); col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { ETHERCAT_SOE_HEADER soe; init_soe_header(&soe, tvb, offset); proto_item_append_text(aparent, "%s", szText); proto_item_set_text(anItem, "%s", szText); ecat_soe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_soe); anItem = proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_header, tvb, offset , 2, ENC_LITTLE_ENDIAN); ecat_soeflag_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_soeflag); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_incomplete, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_error, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_driveno, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_datastate, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_name, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_attribute, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_unit, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_min, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_max, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; if ( !soe.anSoeHeaderControlUnion.v.Error ) { if ( !soe.anSoeHeaderControlUnion.v.InComplete ) { switch (soe.anSoeHeaderControlUnion.v.OpCode) { case ECAT_SOE_OPCODE_RRQ: case ECAT_SOE_OPCODE_WRS: proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_idn, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case ECAT_SOE_OPCODE_RRS: case ECAT_SOE_OPCODE_WRQ: case ECAT_SOE_OPCODE_NFC: proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_idn, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(tree, hf_ecat_mailbox_soe_data, tvb, offset, soe_length-offset, ENC_NA); break; } } else { proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_frag, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(tree, hf_ecat_mailbox_soe_data, tvb, offset, soe_length-offset, ENC_NA); } } else { proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_idn, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ecat_mailbox_soe_error, tvb, offset, 2, ENC_LITTLE_ENDIAN); } } } else { col_append_str(pinfo->cinfo, COL_INFO, "SoE - invalid length"); expert_add_info(pinfo, tree, &ei_ecat_mailbox_soe_error); } } static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { proto_tree *ecat_eoe_tree = 0, *ecat_fraghead_tree, *ecat_eoe_init_tree, *ecat_eoe_macfilter_tree, *ecat_eoe_macfilter_filter_tree; tvbuff_t *next_tvb; proto_item *anItem = NULL, *aparent = NULL; int nCnt; guint eoe_length = tvb_reported_length(tvb)-offset; if( tree ) { anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_eoe, tvb, offset, eoe_length, NULL, "EoE Fragment"); aparent = proto_item_get_parent(anItem); proto_item_append_text(aparent,":EoE "); } if( eoe_length >= ETHERCAT_EOE_HEADER_LEN ) { ETHERCAT_EOE_HEADER eoe; init_eoe_header(&eoe, tvb, offset); if ( eoe.anEoeHeaderInfoUnion.v.Type == EOE_TYPE_FRAME_FRAG ) col_append_fstr(pinfo->cinfo, COL_INFO, "EoE-Frag %d", eoe.anEoeHeaderDataUnion.v.Fragment); else col_append_str(pinfo->cinfo, COL_INFO, "EoE"); { /* Do the following even 'if (tree == NULL)' since a call_dissector() is done */ ecat_eoe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe); anItem = proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_fraghead, tvb, offset, 4, ENC_NA); ecat_fraghead_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_fraghead); proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_type, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.Type); switch ( eoe.anEoeHeaderInfoUnion.v.Type ) { case EOE_TYPE_FRAME_FRAG: proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_fragno, tvb, offset, 4, eoe.anEoeHeaderDataUnion.v.Fragment); if (eoe.anEoeHeaderDataUnion.v.Fragment == 0) { proto_tree_add_uint_format(ecat_fraghead_tree, hf_ecat_mailbox_eoe_offset, tvb, offset, 4, 32*eoe.anEoeHeaderDataUnion.v.OffsetBuffer, "BufferSize: %d", 32*eoe.anEoeHeaderDataUnion.v.OffsetBuffer); } else { proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_offset, tvb, offset, 4, 32*eoe.anEoeHeaderDataUnion.v.OffsetBuffer); } proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_frame, tvb, offset, 4, eoe.anEoeHeaderDataUnion.v.FrameNo); proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_last, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.LastFragment); if ( eoe.anEoeHeaderInfoUnion.v.TimeStampRequested ) { proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_timestampreq, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.TimeStampRequested); } if ( eoe.anEoeHeaderInfoUnion.v.TimeStampAppended ) { proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_timestampapp, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.TimeStampAppended); } offset+=ETHERCAT_EOE_HEADER_LEN; proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_fragment, tvb, offset, eoe_length-offset, ENC_NA); if ( eoe.anEoeHeaderDataUnion.v.Fragment == 0 ) { next_tvb = tvb_new_subset_length(tvb, offset, eoe_length-offset); call_dissector( eth_handle, next_tvb, pinfo, ecat_eoe_tree); } if ( eoe.anEoeHeaderInfoUnion.v.TimeStampAppended ) { proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_timestamp, tvb, eoe_length-ETHERCAT_EOE_TIMESTAMP_LEN, ETHERCAT_EOE_TIMESTAMP_LEN, ENC_LITTLE_ENDIAN); } break; case EOE_TYPE_TIMESTAMP_RES: proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_timestamp, tvb, offset+ETHERCAT_EOE_HEADER_LEN, ETHERCAT_EOE_TIMESTAMP_LEN, ENC_LITTLE_ENDIAN); break; case EOE_TYPE_INIT_REQ: offset+=ETHERCAT_EOE_HEADER_LEN; anItem = proto_tree_add_item(ecat_fraghead_tree, hf_ecat_mailbox_eoe_init, tvb, offset, MIN(eoe_length-offset,ETHERCAT_EOE_INIT_LEN), ENC_NA); if( eoe_length-offset >= ETHERCAT_EOE_INIT_LEN ) { ecat_eoe_init_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_init); proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_macaddr, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_ipaddr, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_subnetmask, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_defaultgateway, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_dnsserver, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_dnsname, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_append_timestamp, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_macaddr, tvb, offset, ETHERNET_ADDRESS_LEN, ENC_NA); offset+=ETHERNET_ADDRESS_LEN; proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_ipaddr, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_subnetmask, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_defaultgateway, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_dnsserver, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_dnsname, tvb, offset, 32, ENC_ASCII|ENC_NA); } else { proto_item_append_text(anItem, " - Invalid length!"); expert_add_info(pinfo, anItem, &ei_ecat_mailbox_eoe_error); } break; case EOE_TYPE_MACFILTER_REQ: { EoeMacFilterOptionsUnion options; offset+=ETHERCAT_EOE_HEADER_LEN; anItem = proto_tree_add_item(ecat_fraghead_tree, hf_ecat_mailbox_eoe_macfilter, tvb, offset, MIN(eoe_length-offset, ETHERCAT_EOE_MACFILTER_LEN), ENC_NA); if( eoe_length-offset >= ETHERCAT_EOE_MACFILTER_LEN ) { proto_tree *ecat_eoe_macfilter_filtermask_tree; ecat_eoe_macfilter_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_macfilter); /* XXX: Is the field containing EoeMacFilterOptionsUnion 4 bytes or 2 bytes ? */ /* sizeof EoeMacFilterOptionsUnion = 2 bytes but the code below */ /* originally used a field width of 4 bytes. */ /* Given the size of the union, the code below was changed to */ /* use a field width of 2 bytes. */ /* The hf[] entries were also changed to match the union struct */ proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_macfiltercount, tvb, offset, /*4*/ 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_maskcount, tvb, offset, /*4*/ 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_nobroadcasts, tvb, offset, /*4*/ 2, ENC_LITTLE_ENDIAN); options.Options = tvb_get_letohs(tvb, offset); offset+=/*4*/ 2; anItem = proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_filter, tvb, offset, 16*ETHERNET_ADDRESS_LEN, ENC_NA); ecat_eoe_macfilter_filter_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_macfilter_filter); for( nCnt=0; nCnt<options.v.MacFilterCount; nCnt++) proto_tree_add_item(ecat_eoe_macfilter_filter_tree, hf_ecat_mailbox_eoe_macfilter_filters[nCnt], tvb, offset+nCnt*ETHERNET_ADDRESS_LEN, ETHERNET_ADDRESS_LEN, ENC_NA); offset+=16*ETHERNET_ADDRESS_LEN; anItem = proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_filtermask, tvb, offset, 4*4, ENC_NA); ecat_eoe_macfilter_filtermask_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_macfilter_filtermask); for( nCnt=0; nCnt<options.v.MacFilterMaskCount; nCnt++) proto_tree_add_item(ecat_eoe_macfilter_filtermask_tree, hf_ecat_mailbox_eoe_macfilter_filtermasks[nCnt], tvb, offset+nCnt*4, 4, ENC_NA); } else { proto_item_append_text(anItem, " - Invalid length!"); expert_add_info(pinfo, anItem, &ei_ecat_mailbox_eoe_error); } } break; case EOE_TYPE_INIT_RES: case EOE_TYPE_MACFILTER_RES: break; } } col_prepend_fstr(pinfo->cinfo, COL_INFO, "EoE("); col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "EoE-"); } else { expert_add_info(pinfo, tree, &ei_ecat_mailbox_eoe_error); col_append_str(pinfo->cinfo, COL_INFO, "EoE - invalid length!"); } } static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { proto_tree *ecat_foe_tree,*ecat_foe_efw_tree; proto_item *anItem= NULL,*aparent = NULL; char szText[200]; int nMax = sizeof(szText)-1; guint foe_length = tvb_reported_length(tvb)-offset; if( tree ) { anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_foe, tvb, offset, foe_length, NULL, "Foe"); aparent = proto_item_get_parent(anItem); proto_item_append_text(aparent,": FoE"); } if( foe_length >= ETHERCAT_FOE_HEADER_LEN ) { FoeFormatter(tvb, pinfo->pool, offset, szText, nMax, foe_length); col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { ETHERCAT_FOE_HEADER foe; init_foe_header(&foe, tvb, offset); ecat_foe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_foe); proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_opmode, tvb, offset++, 1, ENC_LITTLE_ENDIAN); offset++; /*Reserved1;*/ switch (foe.OpMode) { case ECAT_FOE_OPMODE_RRQ: case ECAT_FOE_OPMODE_WRQ: proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_filelength, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_filename, tvb, offset, foe_length-offset, ENC_ASCII|ENC_NA); break; case ECAT_FOE_OPMODE_DATA: { proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_packetno, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=4; /*+2 for Reserved2*/ if( foe_length-offset >= sizeof(TEFWUPDATE_HEADER) ) { anItem = proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_efw, tvb, offset, foe_length-offset, ENC_NA); ecat_foe_efw_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_foe_efw); proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_cmd, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_addresslw, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_addresshw, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_data, tvb, offset, foe_length-offset, ENC_NA); } else { proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_data, tvb, offset, foe_length-offset, ENC_NA); } } break; case ECAT_FOE_OPMODE_ACK: proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_packetno, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case ECAT_FOE_OPMODE_ERR: proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_errcode, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_errtext, tvb, offset, foe_length-offset, ENC_ASCII|ENC_NA); break; case ECAT_FOE_OPMODE_BUSY: proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_busydone, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_busyentire, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; } } } else { col_append_str(pinfo->cinfo, COL_INFO, "FoE - invalid length"); expert_add_info(pinfo, tree, &ei_ecat_mailbox_foe_error); } } static int dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *ecat_mailbox_tree = NULL; proto_tree *ecat_mailbox_header_tree = NULL; tvbuff_t *next_tvb; proto_item *anItem; gint offset = 0; gint mailbox_length = tvb_reported_length(tvb); if( mailbox_length >= ETHERCAT_MBOX_HEADER_LEN ) { ETHERCAT_MBOX_HEADER hdr; init_mbx_header(&hdr, tvb, offset); col_append_str(pinfo->cinfo, COL_INFO, " Mbx("); /* Create the mailbox sub tree */ anItem = proto_tree_add_item(tree, proto_ecat_mailbox, tvb, 0, ETHERCAT_MBOX_HEADER_LEN+hdr.Length, ENC_NA); ecat_mailbox_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox); /* Create a mailbox header subtree */ ecat_mailbox_header_tree = proto_tree_add_subtree(ecat_mailbox_tree, tvb, offset, ETHERCAT_MBOX_HEADER_LEN, ett_ecat_mailbox_header, NULL, "Header"); /* Add length information to the mailbox header */ proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxlength, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; /* Add address information to the mailbox header */ proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxaddress, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; /* Add priority information to the mailbox header */ proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxpriority, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset+=1; /* Add type information to the mailbox header */ proto_tree_add_uint(ecat_mailbox_header_tree, hf_ecat_mailboxtype, tvb, offset, 1, hdr.aControlUnion.v.Type); /* Add counter information to the mailbox header */ proto_tree_add_uint(ecat_mailbox_header_tree, hf_ecat_mailboxcounter, tvb, offset, 1, hdr.aControlUnion.v.Counter); offset++; if( mailbox_length >= ETHERCAT_MBOX_HEADER_LEN + hdr.Length ) { next_tvb = tvb_new_subset_length (tvb, offset, hdr.Length); switch ( hdr.aControlUnion.v.Type ) { case ETHERCAT_MBOX_TYPE_ADS: call_dissector(ams_handle, next_tvb, pinfo, ecat_mailbox_tree); break; case ETHERCAT_MBOX_TYPE_EOE: dissect_ecat_eoe(next_tvb, 0, pinfo, ecat_mailbox_tree); break; case ETHERCAT_MBOX_TYPE_COE: dissect_ecat_coe(next_tvb, 0, pinfo, ecat_mailbox_tree); break; case ETHERCAT_MBOX_TYPE_FOE: dissect_ecat_foe(next_tvb, 0, pinfo, ecat_mailbox_tree); break; case ETHERCAT_MBOX_TYPE_SOE: dissect_ecat_soe(next_tvb, 0, pinfo, ecat_mailbox_tree); break; default: proto_tree_add_item(ecat_mailbox_tree, hf_ecat_mailboxdata, tvb, offset, hdr.Length, ENC_NA); } } else { anItem =proto_tree_add_item(ecat_mailbox_tree, hf_ecat_mailboxdata, tvb, offset, mailbox_length-ETHERCAT_MBOX_HEADER_LEN, ENC_NA); expert_add_info_format(pinfo, anItem, &ei_ecat_mailbox_error,"Incorrect Mailbox data length(Expected:%d Actual:%d)", hdr.Length, mailbox_length-ETHERCAT_MBOX_HEADER_LEN); } col_append_str(pinfo->cinfo, COL_INFO, ")"); } return tvb_captured_length(tvb); } void proto_register_ecat_mailbox(void) { static const true_false_string flags_set_truth = { "Set", "Not set" }; static hf_register_info hf[] = { { &hf_ecat_mailboxlength, { "Length", "ecat_mailbox.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailboxaddress, { "Address", "ecat_mailbox.address", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailboxpriority, { "Priority", "ecat_mailbox.priority", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL } }, { &hf_ecat_mailboxtype, { "Type", "ecat_mailbox.type", FT_UINT8, BASE_DEC, VALS(EcMBoxType), 0x0, NULL, HFILL } }, { &hf_ecat_mailboxcounter, { "Counter", "ecat_mailbox.counter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe, { "EoE Fragment", "ecat_mailbox.eoe", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_fraghead, { "Header", "ecat_mailbox.eoe.fraghead", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_type, { "Type", "ecat_mailbox.eoe.type", FT_UINT32, BASE_DEC, VALS(EoEType), 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_fragno, { "FragNo", "ecat_mailbox.eoe.fragno", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_offset, { "Offset", "ecat_mailbox.eoe.offset", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL} }, { &hf_ecat_mailbox_eoe_frame, { "FrameNo", "ecat_mailbox.eoe.frame", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_last, { "Last Fragment", "ecat_mailbox.eoe.last", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_timestampapp, { "Time Stamp Appended", "ecat_mailbox.eoe.timestampapp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_timestampreq, { "Time Stamp Requested", "ecat_mailbox.eoe.timestampreq", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_fragment, { "EoE Frag Data", "ecat_mailbox.eoe.fragment", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init, { "Init", "ecat_mailbox.eoe.init", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_contains_macaddr, { "MacAddr", "ecat_mailbox.eoe.init.contains_macaddr", FT_BOOLEAN, 32, TFS(&flags_set_truth), 0x00000001, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_contains_ipaddr, { "IpAddr", "ecat_mailbox.eoe.init.contains_ipaddr", FT_BOOLEAN, 32, TFS(&flags_set_truth), 0x00000002, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_contains_subnetmask, { "SubnetMask", "ecat_mailbox.eoe.init.contains_subnetmask", FT_BOOLEAN, 32, TFS(&flags_set_truth), 0x00000004, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_contains_defaultgateway, { "DefaultGateway", "ecat_mailbox.eoe.init.contains_defaultgateway", FT_BOOLEAN, 32, TFS(&flags_set_truth), 0x00000008, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_contains_dnsserver, { "DnsServer", "ecat_mailbox.eoe.init.contains_dnsserver", FT_BOOLEAN, 32, TFS(&flags_set_truth), 0x00000010, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_contains_dnsname, { "DnsName", "ecat_mailbox.eoe.init.contains_dnsname", FT_BOOLEAN, 32, TFS(&flags_set_truth), 0x00000020, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_append_timestamp, { "AppendTimeStamp", "ecat_mailbox.eoe.init.append_timestamp", FT_BOOLEAN, 32, TFS(&flags_set_truth), 0x00010000, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_macaddr, { "Mac Addr", "ecat_mailbox.eoe.init.macaddr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_ipaddr, { "Ip Addr", "ecat_mailbox.eoe.init.ipaddr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_subnetmask, { "Subnet Mask", "ecat_mailbox.eoe.init.subnetmask", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_defaultgateway, { "Default Gateway", "ecat_mailbox.eoe.init.defaultgateway", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_dnsserver, { "Dns Server", "ecat_mailbox.eoe.init.dnsserver", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_init_dnsname, { "Dns Name", "ecat_mailbox.eoe.init.dnsname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter, { "Mac Filter", "ecat_mailbox.eoe.macfilter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* XXX: The following 3 fields may not be specified correctly */ /* See related comment above */ { &hf_ecat_mailbox_eoe_macfilter_macfiltercount, { "Mac Filter Count", "ecat_mailbox.eoe.macfilter.macfiltercount", FT_UINT16, BASE_DEC, NULL, 0xF000, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_maskcount, { "Mac Filter Mask Count", "ecat_mailbox.eoe.macfilter.maskcount", FT_UINT16, BASE_DEC, NULL, 0x0C00, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_nobroadcasts, { "No Broadcasts", "ecat_mailbox.eoe.macfilter.nobroadcasts", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x0100, NULL, HFILL } }, /* ... */ { &hf_ecat_mailbox_eoe_macfilter_filter, { "Filter", "ecat_mailbox.eoe.macfilter.filter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[0], { "Filter 0", "ecat_mailbox.eoe.macfilter.filter0", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[1], { "Filter 1", "ecat_mailbox.eoe.macfilter.filter1", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[2], { "Filter 2", "ecat_mailbox.eoe.macfilter.filter2", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[3], { "Filter 3", "ecat_mailbox.eoe.macfilter.filter3", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[4], { "Filter 4", "ecat_mailbox.eoe.macfilter.filter4", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[5], { "Filter 5", "ecat_mailbox.eoe.macfilter.filter5", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[6], { "Filter 6", "ecat_mailbox.eoe.macfilter.filter6", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[7], { "Filter 7", "ecat_mailbox.eoe.macfilter.filter7", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[8], { "Filter 8", "ecat_mailbox.eoe.macfilter.filter8", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[9], { "Filter 9", "ecat_mailbox.eoe.macfilter.filter9", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[10], { "Filter 10", "ecat_mailbox.eoe.macfilter.filter10", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[11], { "Filter 11", "ecat_mailbox.eoe.macfilter.filter11", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[12], { "Filter 12", "ecat_mailbox.eoe.macfilter.filter12", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[13], { "Filter 13", "ecat_mailbox.eoe.macfilter.filter13", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[14], { "Filter 14", "ecat_mailbox.eoe.macfilter.filter14", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[15], { "Filter 15", "ecat_mailbox.eoe.macfilter.filter15", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermask, { "Filter Mask", "ecat_mailbox.eoe.macfilter.filtermask", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[0], { "Mask 0", "ecat_mailbox.eoe.macfilter.filtermask0", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[1], { "Mask 1", "ecat_mailbox.eoe.macfilter.filtermask1", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[2], { "Mask 2", "ecat_mailbox.eoe.macfilter.filtermask2", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[3], { "Mask 3", "ecat_mailbox.eoe.macfilter.filtermask3", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_eoe_timestamp, { "Time Stamp", "ecat_mailbox.eoe.timestamp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe, { "CoE", "ecat_mailbox.coe", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_number, { "Number", "ecat_mailbox.coe.number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_type, { "Type", "ecat_mailbox.coe.type", FT_UINT16, BASE_DEC, VALS(CANopenType), 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoreq, { "SDO Req", "ecat_mailbox.coe.sdoreq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsid, { "Initiate Download", "ecat_mailbox.coe.sdoccsid", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsid_sizeind, { "Size Ind.", "ecat_mailbox.coe.sdoccsid.sizeind", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x01, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsid_expedited, { "Expedited", "ecat_mailbox.coe.sdoccsid.expedited", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x02, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsid_size0, { "Bytes", "ecat_mailbox.coe.sdoccsid.size0", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x04, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsid_size1, { "Bytes", "ecat_mailbox.coe.sdoccsid.size1", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x08, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsid_complete, { "Access", "ecat_mailbox.coe.sdoccsid.complete", FT_BOOLEAN, 8, TFS(&tfs_complete), 0x10, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsds, { "Download Segment", "ecat_mailbox.coe.sdoccsds", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsds_lastseg, { "Last Segment", "ecat_mailbox.coe.sdoccsds.lastseg", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x01, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsds_size, { "Size", "ecat_mailbox.coe.sdoccsds.size", FT_UINT8, BASE_DEC, NULL, 0x0E, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsds_toggle, { "Toggle Bit", "ecat_mailbox.coe.sdoccsds.toggle", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x10, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsiu, { "Init Upload", "ecat_mailbox.coe.sdoccsiu", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ecat_mailbox_coe_sdoccsiu_complete, { "Toggle Bit", "ecat_mailbox.coe.sdoccsiu.complete", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x10, NULL, HFILL } }, #endif { &hf_ecat_mailbox_coe_sdoccsus, { "Upload Segment", "ecat_mailbox.coe.sdoccsus", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoccsus_toggle, { "Toggle Bit", "ecat_mailbox.coe.sdoccsus_toggle", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x10, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoidx, { "Index", "ecat_mailbox.coe.sdoidx", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoabortcode, { "Abort code", "ecat_mailbox.coe.abortcode", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdosub, { "SubIndex", "ecat_mailbox.coe.sdosub", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdodata, { "Data", "ecat_mailbox.coe.sdodata", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdodata1, { "Data", "ecat_mailbox.coe.sdodata", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdodata2, { "Data", "ecat_mailbox.coe.sdodata", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoldata, { "Data", "ecat_mailbox.coe.dsoldata", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdolength, { "Length", "ecat_mailbox.coe.sdolength", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ecat_mailbox_coe_sdoerror, { "SDO Error", "ecat_mailbox.coe.sdoerror", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif { &hf_ecat_mailbox_coe_sdores, { "SDO Res", "ecat_mailbox.coe.sdores", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsiu, { "Initiate Upload Response", "ecat_mailbox.coe.sdoscsiu", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_sizeind, { "Size Ind.", "ecat_mailbox.coe.sdoscsiu_sizeind", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x01, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_expedited, { "Expedited", "ecat_mailbox.coe.sdoscsiu_expedited", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x02, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_size0, { "Bytes", "ecat_mailbox.coe.sdoscsiu_size0", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x04, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_size1, { "Bytes", "ecat_mailbox.coe.sdoscsiu_size1", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x08, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_complete, { "Access", "ecat_mailbox.coe.sdoscsiu_complete", FT_BOOLEAN, 8, TFS(&tfs_complete), 0x10, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsds, { "Download Segment Response", "ecat_mailbox.coe.sdoscsds", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsds_toggle, { "Toggle Bit", "ecat_mailbox.coe.sdoscsds_toggle", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x10, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsus, { "Upload Segment", "ecat_mailbox.coe.sdoscsus", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsus_lastseg, { "Last Segment", "ecat_mailbox.coe.sdoscsus_lastseg", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x01, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsus_bytes, { "Bytes", "ecat_mailbox.coe.sdoscsus_bytes", FT_UINT8, BASE_DEC, NULL, 0x0E, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoscsus_toggle, { "Toggle Bit", "ecat_mailbox.coe.sdoscsus_toggle", FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x10, NULL, HFILL } }, { &hf_ecat_mailbox_coe_sdoinfoopcode, { "Info OpCode", "ecat_mailbox.coe.sdoinfoopcode", FT_UINT8, BASE_DEC, VALS(CANopenSdoInfo), 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfofrag, { "Info Frag Left", "ecat_mailbox.coe.sdoinfofrag", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfolisttype, { "Info List Type", "ecat_mailbox.coe.sdoinfolisttype", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfolist, { "Info List", "ecat_mailbox.coe.sdoinfolist", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfoindex, { "Info Obj Index", "ecat_mailbox.coe.sdoinfoindex", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfosubindex, { "Info Obj SubIdx", "ecat_mailbox.coe.sdoinfosubindex", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfovalueinfo, { "Info Obj ValueInfo", "ecat_mailbox.coe.sdoinfovalueinfo", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfoerrorcode, { "Info Error Code", "ecat_mailbox.coe.sdoinfoerrorcode", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfodatatype, { "Info Data Type", "ecat_mailbox.coe.sdoinfodatatype", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfomaxsub, { "Info Max SubIdx", "ecat_mailbox.coe.sdoinfomaxsub", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfoobjcode, { "Info Obj Code", "ecat_mailbox.coe.sdoinfoobjcode", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfoname, { "Info Name", "ecat_mailbox.coe.sdoinfoname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfobitlen, { "Info Bit Len", "ecat_mailbox.coe.sdoinfobitlen", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfoobjaccess, { "Info Obj Access", "ecat_mailbox.coe.sdoinfoobjaccess", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfounittype, { "Info Data Type", "ecat_mailbox.coe.sdoinfounittype", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfodefaultvalue, { "Info Default Val", "ecat_mailbox.coe.sdoinfodefaultvalue", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfominvalue, { "Info Min Val", "ecat_mailbox.coe.sdoinfominvalue", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailbox_coe_sdoinfomaxvalue, { "Info Max Val", "ecat_mailbox.coe.sdoinfomaxvalue", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, { &hf_ecat_mailboxdata, { "MB Data", "ecat_mailbox.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe, { "Foe", "ecat_mailbox.foe", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_opmode, { "Foe OpMode", "ecat_mailbox.foe_opmode", FT_UINT8, BASE_HEX, VALS(FoEOpMode), 0x0, "Op modes", HFILL } }, { &hf_ecat_mailbox_foe_filelength, { "Foe FileLength", "ecat_mailbox.foe_filelength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_filename, { "Foe FileName", "ecat_mailbox.foe_filename", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_packetno, { "Foe PacketNo", "ecat_mailbox.foe_packetno", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_errcode, { "Foe ErrorCode", "ecat_mailbox.foe_errcode", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_errtext, { "Foe ErrorString", "ecat_mailbox.foe_errtext", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_busydone, { "Foe BusyDone", "ecat_mailbox.foe_busydone", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_busyentire, { "Foe BusyEntire", "ecat_mailbox.foe_busyentire", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_data, { "Foe Data", "ecat_mailbox.foe_busydata", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_efw, { "Firmware", "ecat_mailbox.foe.efw", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_efw_cmd, { "Cmd", "ecat_mailbox.foe.efw.cmd", FT_UINT16, BASE_HEX, VALS(FoEEfwCmd), 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_efw_size, { "Size", "ecat_mailbox.foe.efw.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_efw_addresslw, { "AddressLW", "ecat_mailbox.foe.efw.addresslw", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_efw_addresshw, { "AddressHW", "ecat_mailbox.foe.efw.addresshw", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_foe_efw_data, { "Data", "ecat_mailbox.foe.efw.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_soe, { "Soe", "ecat_mailbox.soe", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header, { "Soe Header", "ecat_mailbox.soe_header", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_opcode, { "SoE OpCode", "ecat_mailbox.soe_opcode", FT_UINT16, BASE_DEC, VALS(SoeOpcode), 0x0007, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_incomplete, { "More Follows...", "ecat_mailbox.soe_header_incomplete", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x0008, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_error, { "Error", "ecat_mailbox.soe_header_error", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x0010, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_driveno, { "Drive No", "ecat_mailbox.soe_header_driveno", FT_UINT16, BASE_DEC, NULL, 0x00e0, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_datastate, { "Datastate", "ecat_mailbox.soe_header_datastate", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x0100, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_name, { "Name", "ecat_mailbox.soe_header_name", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x0200, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_attribute, { "Attribute", "ecat_mailbox.soe_header_attribute", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x0400, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_unit, { "Unit", "ecat_mailbox.soe_header_unit", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x0800, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_min, { "Min", "ecat_mailbox.soe_header_min", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x1000, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_max, { "Max", "ecat_mailbox.soe_header_max", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x2000, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_value, { "Value", "ecat_mailbox.soe_header_value", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x4000, NULL, HFILL } }, { &hf_ecat_mailbox_soe_header_reserved, { "Reserved", "ecat_mailbox.soe_header_reserved", FT_BOOLEAN, 16, TFS(&flags_set_truth), 0x8000, NULL, HFILL } }, { &hf_ecat_mailbox_soe_idn, { "SoE IDN", "ecat_mailbox.soe_idn", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_soe_data, { "SoE Data", "ecat_mailbox.soe_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_soe_frag, { "SoE FragLeft", "ecat_mailbox.soe_frag", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_mailbox_soe_error, { "SoE Error", "ecat_mailbox.soe_error", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_ecat_mailbox, &ett_ecat_mailbox_eoe, &ett_ecat_mailbox_eoe_init, &ett_ecat_mailbox_eoe_macfilter, &ett_ecat_mailbox_eoe_macfilter_filter, &ett_ecat_mailbox_eoe_macfilter_filtermask, &ett_ecat_mailbox_coe, &ett_ecat_mailbox_sdo, &ett_ecat_mailbox_coe_sdoccs, &ett_ecat_mailbox_coe_sdoscs, &ett_ecat_mailbox_foe, &ett_ecat_mailbox_foe_efw, &ett_ecat_mailbox_soeflag, &ett_ecat_mailbox_soe, &ett_ecat_mailbox_fraghead, &ett_ecat_mailbox_header }; static ei_register_info ei[] = { { &ei_ecat_mailbox_error, { "ecat_mailbox.invalid", PI_MALFORMED, PI_ERROR, "Malformed mailbox data", EXPFILL } }, { &ei_ecat_mailbox_coe_error, { "ecat_mailbox.coe.invalid", PI_MALFORMED, PI_ERROR, "Malformed CoE data", EXPFILL } }, { &ei_ecat_mailbox_foe_error, { "ecat_mailbox.foe.invalid", PI_MALFORMED, PI_ERROR, "Malformed FoE data", EXPFILL } }, { &ei_ecat_mailbox_soe_error, { "ecat_mailbox.soe.invalid", PI_MALFORMED, PI_ERROR, "Malformed SoE data", EXPFILL } }, { &ei_ecat_mailbox_eoe_error, { "ecat_mailbox.eoe.invalid", PI_MALFORMED, PI_ERROR, "Malformed EoE data", EXPFILL } }, }; expert_module_t *expert_module; proto_ecat_mailbox = proto_register_protocol("EtherCAT Mailbox Protocol", "ECAT_MAILBOX", "ecat_mailbox"); expert_module = expert_register_protocol(proto_ecat_mailbox); expert_register_field_array(expert_module, ei, array_length(ei)); proto_register_field_array(proto_ecat_mailbox, hf,array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); ecat_mailbox_handle = register_dissector("ecat_mailbox", dissect_ecat_mailbox, proto_ecat_mailbox); } void proto_reg_handoff_ecat_mailbox(void) { /* Register this dissector as a sub dissector to E88A4 based on ether type. */ dissector_add_uint("ecatf.type", 5, ecat_mailbox_handle); eth_handle = find_dissector_add_dependency("eth_withoutfcs", proto_ecat_mailbox); ams_handle = find_dissector_add_dependency("ams", proto_ecat_mailbox); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 3 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=3 tabstop=8 expandtab: * :indentSize=3:tabSize=8:noTabs=true: */
C/C++
wireshark/plugins/epan/ethercat/packet-ecatmb.h
/* packet-ecatmb.h * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _PACKET_ECATMAILBOX_H_ #define _PACKET_ECATMAILBOX_H_ #include <ws_diag_control.h> DIAG_OFF_PEDANTIC /* Ensure the same data layout for all platforms */ typedef struct TETHERNET_ADDRESS { guint8 b[6]; } ETHERNET_ADDRESS, *PETHERNET_ADDRESS; #define ETHERNET_ADDRESS_LEN ((int) sizeof(ETHERNET_ADDRESS)) /* Mailbox*/ #define ETHERCAT_MBOX_TYPE_ADS 1 /* AMS/ADS header follows*/ #define ETHERCAT_MBOX_TYPE_EOE 2 /* ETHERCAT_EOE_HEADER follows*/ #define ETHERCAT_MBOX_TYPE_COE 3 /* ETHERCAT_COE_HEADER follows*/ #define ETHERCAT_MBOX_TYPE_FOE 4 /* ETHERCAT_FOE_HEADER follows*/ #define ETHERCAT_MBOX_TYPE_SOE 5 /* ETHERCAT_SOE_HEADER follows*/ typedef union tMbxHeaderControlUnion { guint16 Control; struct { guint16 Channel : 6; /* optional communication channels (default = 0)*/ guint16 Priority : 2; /* optional communication priority (default = 0)*/ guint16 Type : 4; /* TETHERCAT_MBOX_TYPE_xxx*/ guint16 Counter : 3; /* 0 = counter not used (old version)*/ guint16 Unsupported : 1; /* unsupported protocol detected*/ } v; } MbxHeaderControlUnion; typedef struct TETHERCAT_MBOX_HEADER { guint16 Length; /* following bytes*/ guint16 Address; /* S->M: phys addr of destination; M->S: phys addr of source; 0 = master*/ MbxHeaderControlUnion aControlUnion; } ETHERCAT_MBOX_HEADER, *PETHERCAT_MBOX_HEADER; #define ETHERCAT_MBOX_HEADER_LEN ((int) sizeof(ETHERCAT_MBOX_HEADER)) /* EoE*/ #define ETHERNET_FRAMENO_MASK 0x0000000F #define EOE_TYPE_FRAME_FRAG 0 /* ETHERCAT_EOE_HEADER followed by frame fragment (ETHERCAT_EOE_TIMESTAMP may included) */ #define EOE_TYPE_TIMESTAMP_RES 1 /* ETHERCAT_EOE_HEADER followed by ETHERCAT_EOE_TIMESTAMP */ #define EOE_TYPE_INIT_REQ 2 /* ETHERCAT_EOE_HEADER followed by ETHERCAT_EOE_INIT */ #define EOE_TYPE_INIT_RES 3 /* ETHERCAT_EOE_HEADER */ #define EOE_TYPE_MACFILTER_REQ 4 /* ETHERCAT_EOE_HEADER followed by ETHERCAT_EOE_MACFILTER */ #define EOE_TYPE_MACFILTER_RES 5 /* ETHERCAT_EOE_HEADER */ #define EOE_RESULT_NOERROR 0x0000 #define EOE_RESULT_UNSPECIFIED_ERROR 0x0001 #define EOE_RESULT_UNSUPPORTED_TYPE 0x0002 #define EOE_RESULT_NO_IP_SUPPORT 0x0201 #define EOE_RESULT_NO_MACFILTERMASK_SUPPORT 0x0401 /*typedef struct TETHERCAT_EOE_INIT { guint32 ContainsMacAddr :1; guint32 ContainsIpAddr :1; guint32 ContainsSubnetMask :1; guint32 ContainsDefaultGateway :1; guint32 ContainsDnsServer :1; guint32 ContainsDnsName :1; guint32 Reserved :26; ETHERNET_ADDRESS MacAddr; guint32 IpAddr; guint32 SubnetMask; guint32 DefaultGateway; guint32 DnsServer; char DnsName[32]; } ETHERCAT_EOE_INIT, *PETHERCAT_EOE_INIT;*/ #define ETHERCAT_EOE_INIT_LEN 58 /*sizeof(ETHERCAT_EOE_INIT)*/ typedef union tEoeMacFilterOptionsUnion { struct { guint16 MacFilterCount :4; guint16 MacFilterMaskCount :2; guint16 Reserved1 :1; guint16 NoBroadcasts :1; guint16 Reserved2 :8; } v; guint16 Options; } EoeMacFilterOptionsUnion; typedef struct TETHERCAT_EOE_MACFILTER { EoeMacFilterOptionsUnion anEoeMacFilterOptionsUnion; ETHERNET_ADDRESS MacFilter[16]; ETHERNET_ADDRESS MacFilterMask[4]; } ETHERCAT_EOE_MACFILTER; #define ETHERCAT_EOE_MACFILTER_LEN ((int) sizeof(ETHERCAT_EOE_MACFILTER)) typedef struct TETHERCAT_EOE_TIMESTAMP { guint32 TimeStamp; /* 32 bit time stamp */ } ETHERCAT_EOE_TIMESTAMP; #define ETHERCAT_EOE_TIMESTAMP_LEN ((int) sizeof(ETHERCAT_EOE_TIMESTAMP)) typedef union tEoeHeaderDataUnion { struct { /* EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only */ guint16 Fragment : 6; /* fragment number (EOE_TYPE_FRAME_FRAG only) */ guint16 OffsetBuffer : 6; /* byte offset multiplied by 32 (if Fragment != 0) (EOE_TYPE_FRAME_FRAG only) */ /* buffer size multiplied by 32 (if Fragment == 0) (EOE_TYPE_FRAME_FRAG only) */ guint16 FrameNo : 4; /* frame number (EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only) */ } v; guint16 Result; /* EOE_TYPE_INIT_RES and EOE_TYPE_MACFILTER_RES only */ } EoeHeaderDataUnion; typedef union tEoeHeaderInfoUnion { struct { guint16 Type : 4; /* specifies following data */ guint16 PortAssign : 4; /* 0 = unspecified, 1 = port 1 */ guint16 LastFragment : 1; /* TRUE if last fragment (EOE_TYPE_FRAME_FRAG only) */ guint16 TimeStampAppended : 1; /* 32 bit time stamp appended (EOE_TYPE_FRAME_FRAG with LastFragment=1 only) */ guint16 TimeStampRequested : 1; /* time stamp response requested (EOE_TYPE_FRAME_FRAG only) */ guint16 Reserved : 5; } v; guint16 Info; } EoeHeaderInfoUnion; typedef struct TETHERCAT_EOE_HEADER { EoeHeaderInfoUnion anEoeHeaderInfoUnion; EoeHeaderDataUnion anEoeHeaderDataUnion; } ETHERCAT_EOE_HEADER, *PETHERCAT_EOE_HEADER; #define ETHERCAT_EOE_HEADER_LEN ((int) sizeof(ETHERCAT_EOE_HEADER)) /* CANopen*/ #define ETHERCAT_COE_TYPE_EMERGENCY 1 #define ETHERCAT_COE_TYPE_SDOREQ 2 #define ETHERCAT_COE_TYPE_SDORES 3 #define ETHERCAT_COE_TYPE_TXPDO 4 #define ETHERCAT_COE_TYPE_RXPDO 5 #define ETHERCAT_COE_TYPE_TXPDO_RTR 6 /* Remote transmission request of TXPDO (master requested)*/ #define ETHERCAT_COE_TYPE_RXPDO_RTR 7 /* Remote transmission request of RXPDO (slave requested) */ #define ETHERCAT_COE_TYPE_SDOINFO 8 typedef union TETHERCAT_COE_HEADER { struct { guint16 Number : 9; /* e.g. PDO number*/ guint16 Reserved : 3; /* = 0*/ guint16 Type : 4; /* CANopen type*/ } v; guint16 header; } ETHERCAT_COE_HEADER, *PETHERCAT_COE_HEADER; #define ETHERCAT_COE_HEADER_LEN ((int) sizeof(ETHERCAT_COE_HEADER)) typedef union tSdoHeaderUnion { struct { /* Initiate Download Request*/ guint8 SizeInd : 1; guint8 Expedited : 1; guint8 Size : 2; guint8 Complete : 1; guint8 Ccs : 3; /* = 1*/ } Idq; struct { /* Initiate Download Response*/ guint8 Reserved : 5; guint8 Scs : 3; /* = 3*/ } Ids; struct { /* Download Segment Request*/ guint8 LastSeg : 1; guint8 Size : 3; guint8 Toggle : 1; guint8 Ccs : 3; /* = 0*/ } Dsq; struct { /* Download Segment Response*/ guint8 Reserved : 4; guint8 Toggle : 1; guint8 Scs : 3; /* = 1*/ } Dss; struct { /* Initiate Upload Request*/ guint8 Reserved : 4; guint8 Complete : 1; guint8 Ccs : 3; /* = 2*/ } Iuq; struct { /* Initiate Upload Response*/ guint8 SizeInd : 1; guint8 Expedited : 1; guint8 Size : 2; guint8 Complete : 1; guint8 Scs : 3; /* = 2*/ } Ius; struct { /* Upload Segment Request*/ guint8 Reserved : 4; guint8 Toggle : 1; guint8 Ccs : 3; /* = 3*/ } Usq; struct { /* Upload Segment Response*/ guint8 LastSeg : 1; guint8 Bytes : 3; guint8 Toggle : 1; guint8 Scs : 3; /* = 0*/ } Uss; struct { /* Abort Transfer*/ guint8 Reserved : 5; guint8 Ccs : 3; /* = 4*/ } Abt; guint8 CS; } SdoHeaderUnion; typedef struct TETHERCAT_SDO_HEADER { SdoHeaderUnion anSdoHeaderUnion; guint16 Index; guint8 SubIndex; guint32 Data; } ETHERCAT_SDO_HEADER, *PETHERCAT_SDO_HEADER; #define ETHERCAT_SDO_HEADER_LEN 8 /* sizeof(ETHERCAT_SDO_HEADER)*/ #define SDO_CCS_DOWNLOAD_SEGMENT 0 #define SDO_CCS_INITIATE_DOWNLOAD 1 #define SDO_CCS_INITIATE_UPLOAD 2 #define SDO_CCS_UPLOAD_SEGMENT 3 #define SDO_CCS_ABORT_TRANSFER 4 #define SDO_SCS_UPLOAD_SEGMENT 0 #define SDO_SCS_DOWNLOAD_SEGMENT 1 #define SDO_SCS_INITIATE_UPLOAD 2 #define SDO_SCS_INITIATE_DOWNLOAD 3 /* CoE SDO Information */ #define ECAT_COE_INFO_OPCODE_LIST_Q 1 #define ECAT_COE_INFO_OPCODE_LIST_S 2 #define ECAT_COE_INFO_OPCODE_OBJ_Q 3 #define ECAT_COE_INFO_OPCODE_OBJ_S 4 #define ECAT_COE_INFO_OPCODE_ENTRY_Q 5 #define ECAT_COE_INFO_OPCODE_ENTRY_S 6 #define ECAT_COE_INFO_OPCODE_ERROR_S 7 #define ECAT_COE_INFO_LIST_TYPE_LENGTH 0 #define ECAT_COE_INFO_LIST_TYPE_ALL 1 #define ECAT_COE_INFO_LIST_TYPE_PDOMAP 2 #define ECAT_COE_INFO_LIST_TYPE_BACKUP 3 #define ECAT_COE_INFO_OBJCODE_NULL 0 #define ECAT_COE_INFO_OBJCODE_DOMAIN 2 #define ECAT_COE_INFO_OBJCODE_DEFTYPE 5 #define ECAT_COE_INFO_OBJCODE_DEFSTRUCT 6 #define ECAT_COE_INFO_OBJCODE_VAR 7 #define ECAT_COE_INFO_OBJCODE_ARRAY 8 #define ECAT_COE_INFO_OBJCODE_RECORD 9 #define ECAT_COE_INFO_OBJCAT_OPTIONAL 0 #define ECAT_COE_INFO_OBJCAT_MANDATORY 1 #define ECAT_COE_INFO_OBJACCESS_RO 0x07 #define ECAT_COE_INFO_OBJACCESS_RW 0x3f typedef struct TETHERCAT_SDO_INFO_LIST { guint16 ListType; /* == SDO_INFO_LIST_TYPE_XXX */ struct { guint16 Index[1]; } Res; } ETHERCAT_SDO_INFO_LIST; typedef struct TETHERCAT_SDO_INFO_OBJ { guint16 Index; struct { guint16 DataType; /* refer to data type index */ guint8 MaxSubIndex; /* max subIndex */ guint8 ObjCode; /* defined in DS 301 (Table 37)*/ char Name[1]; /* rest of mailbox data*/ } Res; } ETHERCAT_SDO_INFO_OBJ; typedef struct TETHERCAT_SDO_INFO_ENTRY { guint16 Index; guint8 SubIdx; guint8 ValueInfo; /* bit0 = ObjAccess, bit1 = ObjCategory, bit2 = PdoMapping, bit3 = UnitType bit4 = DefaultValue, bit5 = MinValue, bit6 = MaxValue*/ struct { guint16 DataType; /* refer to data type index */ guint16 BitLen; guint16 ObjAccess; /* bit0 = read; bit1 = write; bit2 = const. bit3 = 'PRE-OP'; bit4 = 'SAFE-OP'; bit5 = 'OP'.*/ } Res; } ETHERCAT_SDO_INFO_ENTRY; typedef struct TETHERCAT_SDO_INFO_ERROR { guint32 ErrorCode; char ErrorText[1]; /* rest of mailbox data */ } ETHERCAT_SDO_INFO_ERROR; typedef union tSdoInfoUnion { ETHERCAT_SDO_INFO_LIST List; ETHERCAT_SDO_INFO_OBJ Obj; ETHERCAT_SDO_INFO_ENTRY Entry; ETHERCAT_SDO_INFO_ERROR Error; guint8 Data[1]; } SdoInfoUnion; typedef union tSdoControlUnion { struct { guint8 OpCode : 7; /* == SDO_INFO_TYPE_XXX */ guint8 InComplete : 1; } v; guint8 Control; } SdoControlUnion; typedef struct TETHERCAT_SDO_INFO_HEADER { SdoControlUnion anSdoControlUnion; guint8 Reserved; /* == 0 */ guint16 FragmentsLeft; SdoInfoUnion anSdoInfoUnion; } ETHERCAT_SDO_INFO_HEADER, *PETHERCAT_SDO_INFO_HEADER; #define ETHERCAT_SDO_INFO_LISTREQ_LEN 6 /*offsetof(ETHERCAT_SDO_INFO_HEADER, anSdoInfoUnion.List.Res)*/ /* FoE (File Access over EtherCAT)*/ #define ECAT_FOE_OPMODE_RRQ 1 #define ECAT_FOE_OPMODE_WRQ 2 #define ECAT_FOE_OPMODE_DATA 3 #define ECAT_FOE_OPMODE_ACK 4 #define ECAT_FOE_OPMODE_ERR 5 #define ECAT_FOE_OPMODE_BUSY 6 #define ECAT_FOE_ERRCODE_NOTDEFINED 0 #define ECAT_FOE_ERRCODE_NOTFOUND 1 #define ECAT_FOE_ERRCODE_ACCESS 2 #define ECAT_FOE_ERRCODE_DISKFULL 3 #define ECAT_FOE_ERRCODE_ILLEAGAL 4 #define ECAT_FOE_ERRCODE_PACKENO 5 #define ECAT_FOE_ERRCODE_EXISTS 6 #define ECAT_FOE_ERRCODE_NOUSER 7 #define ECAT_FOE_ERRCODE_BOOTSTRAPONLY 8 #define ECAT_FOE_ERRCODE_NOTINBOOTSTRAP 9 typedef union tFoeHeaderDataUnion { guint32 FileLength; /* (RRQ, WRQ) = 0 if unknown */ struct { guint16 PacketNo; /* (DATA, ACK)*/ guint16 Reserved2; /* (DATA, ACK)*/ } v; guint32 ErrorCode; /* (ERR)*/ struct { guint16 Done; /* (BUSY)*/ guint16 Entire; /* (BUSY)*/ } v2; } FoeHeaderDataUnion; typedef struct TETHERCAT_FOE_HEADER { guint8 OpMode; /* = 1 (RRQ), = 2 (WRQ), = 3 (DATA), = 4 (ACK), = 5 (ERR), = 6 (BUSY) */ guint8 Reserved1; /* = 0 */ FoeHeaderDataUnion aFoeHeaderDataUnion; /* typedef union tMailBoxDataUnion { char Name[] (RRQ, WRQ) rest of mailbox data guint8 Data[] (DATA) rest of mailbox data (if OpMode = 3) char ErrorText[] (ERR) rest of mailbox data } MailBoxDataUnion;*/ } ETHERCAT_FOE_HEADER, *PETHERCAT_FOE_HEADER; #define ETHERCAT_FOE_HEADER_LEN 6 /*sizeof(ETHERCAT_FOE_HEADER)*/ typedef struct { guint16 Cmd; guint16 Size; guint16 AddressLW; guint16 AddressHW; } TEFWUPDATE_HEADER; /* SoE (SOE over EtherCAT)*/ #define ECAT_SOE_OPCODE_RRQ 1 #define ECAT_SOE_OPCODE_RRS 2 #define ECAT_SOE_OPCODE_WRQ 3 #define ECAT_SOE_OPCODE_WRS 4 #define ECAT_SOE_OPCODE_NFC 5 typedef union tSoeHeaderControlUnion { struct { guint8 OpCode : 3; /* 0 = unused, 1 = readReq, 2 = readRes, 3 = writeReq, 4 = writeRes 5 = notification (command changed notification)*/ guint8 InComplete : 1; /* more follows*/ guint8 Error : 1; /* an error word follows */ guint8 DriveNo : 3; /* drive number */ guint8 DataState : 1; /* follows or requested */ guint8 Name : 1; /* follows or requested */ guint8 Attribute : 1; /* follows or requested */ guint8 Unit : 1; /* follows or requested */ guint8 Min : 1; /* follows or requested */ guint8 Max : 1; /* follows or requested */ guint8 Value : 1; /* follows or requested */ guint8 Reserved : 1; } v; struct { guint8 Control; guint8 Element; } v2; } SoeHeaderControlUnion; typedef union tSoeHeaderDataUnion { guint16 IDN; /* SOE IDN if (InComplete==0) */ guint16 FragmentsLeft; /* Pending fragments if (InComplete==1) */ } SoeHeaderDataUnion; typedef struct TETHERCAT_SOE_HEADER { SoeHeaderControlUnion anSoeHeaderControlUnion; SoeHeaderDataUnion anSoeHeaderDataUnion; /* typedef union tMailBoxDataUnion { guint8 Data[] rest of mailbox data if (Error==0) guint16 ErrorCode if (Error==1) } MailBoxDataUnion;*/ } ETHERCAT_SOE_HEADER, *PETHERCAT_SOE_HEADER; #define ETHERCAT_SOE_HEADER_LEN ((int) sizeof(ETHERCAT_SOE_HEADER)) extern void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, gint offset); DIAG_ON_PEDANTIC #endif /* _PACKET_ECATMAILBOX_H_ */
C
wireshark/plugins/epan/ethercat/packet-esl.c
/* packet-esl.c * Routines for EtherCAT Switch Link disassembly * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1999 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> void proto_register_esl(void); #if 0 /* XXX: using bitfields is compiler dependent: See README.developer */ typedef union _EslFlagsUnion { struct { guint16 port7 : 1; guint16 port6 : 1; guint16 port5 : 1; guint16 port4 : 1; guint16 port3 : 1; guint16 port2 : 1; guint16 port1 : 1; guint16 port0 : 1; guint16 extended : 1; guint16 port11 : 1; guint16 port10 : 1; guint16 alignError : 1; guint16 crcError : 1; guint16 timeStampEna : 1; guint16 port9 : 1; guint16 port8 : 1; }d; struct { guint8 loPorts : 1; guint8 flagsHiPorts : 1; }lo_hi_flags; guint flags; } EslFlagsUnion; #endif #define esl_port7_bitmask 0x0001 #define esl_port6_bitmask 0x0002 #define esl_port5_bitmask 0x0004 #define esl_port4_bitmask 0x0008 #define esl_port3_bitmask 0x0010 #define esl_port2_bitmask 0x0020 #define esl_port1_bitmask 0x0040 #define esl_port0_bitmask 0x0080 #define esl_extended_bitmask 0x0100 #define esl_port11_bitmask 0x0200 #define esl_port10_bitmask 0x0400 #define esl_alignError_bitmask 0x0800 #define esl_crcError_bitmask 0x1000 #define esl_timeStampEna_bitmask 0x2000 #define esl_port9_bitmask 0x4000 #define esl_port8_bitmask 0x8000 #if 0 typedef struct _EslHeader { guint8 eslCookie[6]; /* 01 01 05 10 00 00 */ EslFlagsUnion flags; guint64 timeStamp; } EslHeader, *PEslHeader; #endif #define SIZEOF_ESLHEADER 16 static dissector_handle_t eth_withoutfcs_handle; void proto_reg_handoff_esl(void); /* Define the esl proto */ int proto_esl = -1; static int ett_esl = -1; static int hf_esl_timestamp = -1; static int hf_esl_port = -1; static int hf_esl_crcerror = -1; static int hf_esl_alignerror = -1; /* Note: using external tfs strings apparently doesn't work in a plugin */ static const true_false_string flags_yes_no = { "yes", "no" }; #if 0 /* XXX: using bitfields is compiler dependent: See README.developer */ static guint16 flags_to_port(guint16 flagsValue) { EslFlagsUnion flagsUnion; flagsUnion.flags = flagsValue; if ( flagsUnion.d.port0 ) return 0; else if ( flagsUnion.d.port1 ) return 1; else if ( flagsUnion.d.port2 ) return 2; else if ( flagsUnion.d.port3 ) return 3; else if ( flagsUnion.d.port4 ) return 4; else if ( flagsUnion.d.port5 ) return 5; else if ( flagsUnion.d.port6 ) return 6; else if ( flagsUnion.d.port7 ) return 7; else if ( flagsUnion.d.port8 ) return 8; else if ( flagsUnion.d.port9 ) return 9; return -1; } #endif static guint16 flags_to_port(guint16 flagsValue) { if ( (flagsValue & esl_port0_bitmask) != 0 ) return 0; else if ( (flagsValue & esl_port1_bitmask) != 0 ) return 1; else if ( (flagsValue & esl_port2_bitmask) != 0 ) return 2; else if ( (flagsValue & esl_port3_bitmask) != 0 ) return 3; else if ( (flagsValue & esl_port4_bitmask) != 0 ) return 4; else if ( (flagsValue & esl_port5_bitmask) != 0 ) return 5; else if ( (flagsValue & esl_port6_bitmask) != 0 ) return 6; else if ( (flagsValue & esl_port7_bitmask) != 0 ) return 7; else if ( (flagsValue & esl_port8_bitmask) != 0 ) return 8; else if ( (flagsValue & esl_port9_bitmask) != 0 ) return 9; else if ( (flagsValue & esl_port10_bitmask) != 0 ) return 10; else if ( (flagsValue & esl_port11_bitmask) != 0 ) return 11; return -1; } /*esl*/ static int dissect_esl_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { proto_item *ti = NULL; proto_tree *esl_header_tree; gint offset = 0; guint esl_length = tvb_reported_length(tvb); if ( esl_length >= SIZEOF_ESLHEADER ) { if (tree) { guint16 flags; ti = proto_tree_add_item(tree, proto_esl, tvb, 0, SIZEOF_ESLHEADER, ENC_NA); esl_header_tree = proto_item_add_subtree(ti, ett_esl); offset+=6; flags = tvb_get_letohs(tvb, offset); proto_tree_add_uint(esl_header_tree, hf_esl_port, tvb, offset, 2, flags_to_port(flags)); proto_tree_add_item(esl_header_tree, hf_esl_alignerror, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(esl_header_tree, hf_esl_crcerror, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; proto_tree_add_item(esl_header_tree, hf_esl_timestamp, tvb, offset, 8, ENC_LITTLE_ENDIAN); } } return tvb_captured_length(tvb); } typedef struct _ref_time_frame_info { frame_data *fd; guint64 esl_ts; nstime_t abs_ts; guint32 num; } ref_time_frame_info; static ref_time_frame_info ref_time_frame; static gboolean is_esl_header(tvbuff_t *tvb, gint offset) { return tvb_get_guint8(tvb, offset) == 0x01 && tvb_get_guint8(tvb, offset+1) == 0x01 && tvb_get_guint8(tvb, offset+2) == 0x05 && (tvb_get_guint8(tvb, offset+3) == 0x10 ||tvb_get_guint8(tvb, offset+3) == 0x11)&& tvb_get_guint8(tvb, offset+4) == 0x00 && tvb_get_guint8(tvb, offset+5) == 0x00; } static void modify_times(tvbuff_t *tvb, gint offset, packet_info *pinfo) { if ( ref_time_frame.fd == NULL ) { ref_time_frame.esl_ts = tvb_get_letoh64(tvb, offset+8); ref_time_frame.fd = pinfo->fd; ref_time_frame.num = pinfo->num; ref_time_frame.abs_ts = pinfo->abs_ts; } else if ( !pinfo->fd->visited ) { guint64 nsecs = tvb_get_letoh64(tvb, offset+8) - ref_time_frame.esl_ts; guint64 secs = nsecs/1000000000; nstime_t ts; nstime_t ts_delta; ts.nsecs = ref_time_frame.abs_ts.nsecs + (int)(nsecs-(secs*1000000000)); if ( ts.nsecs > 1000000000 ) { ts.nsecs-=1000000000; secs++; } ts.secs = ref_time_frame.abs_ts.secs+(int)secs; nstime_delta(&ts_delta, &ts, &pinfo->abs_ts); pinfo->abs_ts = ts; pinfo->fd->abs_ts = ts; nstime_add(&pinfo->rel_ts, &ts_delta); } } static gboolean dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { static gboolean in_heur = FALSE; gboolean result; tvbuff_t *next_tvb; guint esl_length = tvb_captured_length(tvb); if ( in_heur ) return FALSE; in_heur = TRUE; /*TRY */ { if ( ref_time_frame.fd != NULL && !pinfo->fd->visited && pinfo->num <= ref_time_frame.num ) ref_time_frame.fd = NULL; /* Check that there's enough data */ if ( esl_length < SIZEOF_ESLHEADER ) return FALSE; /* check for Esl frame, this has a unique destination MAC from Beckhoff range First 6 bytes must be: 01 01 05 10 00 00 */ if ( is_esl_header(tvb, 0) ) { dissect_esl_header(tvb, pinfo, tree, data); if ( eth_withoutfcs_handle != NULL ) { next_tvb = tvb_new_subset_remaining(tvb, SIZEOF_ESLHEADER); call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } modify_times(tvb, 0, pinfo); result = TRUE; } else if ( is_esl_header(tvb, esl_length-SIZEOF_ESLHEADER) ) { if ( eth_withoutfcs_handle != NULL ) { next_tvb = tvb_new_subset_length(tvb, 0, esl_length-SIZEOF_ESLHEADER); call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } next_tvb = tvb_new_subset_length(tvb, esl_length-SIZEOF_ESLHEADER, SIZEOF_ESLHEADER); dissect_esl_header(next_tvb, pinfo, tree, data); modify_times(tvb, esl_length-SIZEOF_ESLHEADER, pinfo); result = TRUE; } else { result = FALSE; } } /*CATCH_ALL{ in_heur = FALSE; RETHROW; }ENDTRY;*/ in_heur = FALSE; return result; } void proto_register_esl(void) { static hf_register_info hf[] = { { &hf_esl_port, { "Port", "esl.port", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_esl_crcerror, { "Crc Error", "esl.crcerror", FT_BOOLEAN, 16, TFS(&flags_yes_no), esl_crcError_bitmask, NULL, HFILL } }, { &hf_esl_alignerror, { "Alignment Error", "esl.alignerror", FT_BOOLEAN, 16, TFS(&flags_yes_no), esl_alignError_bitmask, NULL, HFILL } }, { &hf_esl_timestamp, { "timestamp", "esl.timestamp", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_esl, }; module_t *esl_module; proto_esl = proto_register_protocol("EtherCAT Switch Link", "ESL","esl"); esl_module = prefs_register_protocol_obsolete(proto_esl); prefs_register_obsolete_preference(esl_module, "enable"); proto_register_field_array(proto_esl,hf,array_length(hf)); proto_register_subtree_array(ett,array_length(ett)); register_dissector("esl", dissect_esl_header, proto_esl); } void proto_reg_handoff_esl(void) { static gboolean initialized = FALSE; if (!initialized) { eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_esl); heur_dissector_add("eth", dissect_esl_heur, "EtherCAT over Ethernet", "esl_eth", proto_esl, HEURISTIC_DISABLE); initialized = TRUE; } } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/plugins/epan/ethercat/packet-ethercat-datagram.c
/* packet-ethercat-datagram.c * Routines for ethercat packet disassembly * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * https://download.beckhoff.com/download/document/io/ethercat-development-products/ethercat_esc_datasheet_sec1_technology_2i3.pdf */ /* Include files */ #include "config.h" #include <epan/packet.h> #include "packet-ethercat-datagram.h" #include "packet-ecatmb.h" void proto_register_ecat(void); void proto_reg_handoff_ecat(void); static heur_dissector_list_t heur_subdissector_list; static dissector_handle_t ecat_handle; static dissector_handle_t ecat_mailbox_handle; /* Define the EtherCAT proto */ static int proto_ecat_datagram = -1; /* Define the tree for EtherCAT */ static int ett_ecat = -1; static int ett_ecat_header = -1; static int ett_ecat_dc = -1; static int ett_ecat_length = -1; static int ett_ecat_padding = -1; static int ett_ecat_datagram_subtree = -1; static int ett_ecat_reg_esc_features = -1; static int ett_ecat_reg_dlctrl1 = -1; static int ett_ecat_reg_dlctrl2 = -1; static int ett_ecat_reg_dlctrl3 = -1; static int ett_ecat_reg_dlctrl4 = -1; static int ett_ecat_reg_dlstatus1 = -1; static int ett_ecat_reg_dlstatus2 = -1; static int ett_ecat_reg_alctrl = -1; static int ett_ecat_reg_alstatus = -1; static int ett_ecat_reg_pdictrl1 = -1; static int ett_ecat_reg_pdictrl2 = -1; static int ett_ecat_reg_ecat_mask = -1; static int ett_ecat_reg_pdiL = -1; static int ett_ecat_reg_ecat = -1; static int ett_ecat_reg_pdi1 = -1; static int ett_ecat_reg_crc0 = -1; static int ett_ecat_reg_crc1 = -1; static int ett_ecat_reg_crc2 = -1; static int ett_ecat_reg_crc3 = -1; static int ett_ecat_reg_wd_status = -1; static int ett_ecat_reg_eeprom_assign = -1; static int ett_ecat_reg_ctrlstat = -1; static int ett_ecat_reg_mio_ctrlstat = -1; static int ett_ecat_mio_addr = -1; static int ett_ecat_mio_access = -1; static int ett_ecat_mio_status0 = -1; static int ett_ecat_mio_status1 = -1; static int ett_ecat_mio_status2 = -1; static int ett_ecat_mio_status3 = -1; static int ett_ecat_reg_fmmu = -1; static int ett_ecat_reg_syncman = -1; static int ett_ecat_reg_syncman_ctrlstatus = -1; static int ett_ecat_reg_syncman_sm_enable = -1; static int ett_ecat_reg_dc_cycunitctrl = -1; static int ett_ecat_dc_activation = -1; static int ett_ecat_dc_activationstat = -1; static int ett_ecat_dc_sync0_status = -1; static int ett_ecat_dc_sync1_status = -1; static int ett_ecat_dc_latch0_ctrl = -1; static int ett_ecat_dc_latch1_ctrl = -1; static int ett_ecat_dc_latch0_status = -1; static int ett_ecat_dc_latch1_status = -1; static int hf_ecat_sub; static int hf_ecat_sub_data[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_cmd[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_idx[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_cnt[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_ado[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_adp[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_lad[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; /* static int hf_ecat_header = -1; */ static int hf_ecat_data = -1; static int hf_ecat_cnt = -1; static int hf_ecat_cmd = -1; static int hf_ecat_idx = -1; static int hf_ecat_adp = -1; static int hf_ecat_ado = -1; static int hf_ecat_lad = -1; /* static int hf_ecat_len = -1; */ static int hf_ecat_int = -1; static int hf_ecat_sub_dc_diff_da[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_dc_diff_bd[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_dc_diff_cb[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_dc_diff_cd[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_dc_diff_ba[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_sub_dc_diff_ca[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; static int hf_ecat_dc_diff_da = -1; static int hf_ecat_dc_diff_bd = -1; static int hf_ecat_dc_diff_cb = -1; static int hf_ecat_dc_diff_cd = -1; static int hf_ecat_dc_diff_ba = -1; static int hf_ecat_dc_diff_ca = -1; static int hf_ecat_length_len = -1; static int hf_ecat_length_r = -1; static int hf_ecat_length_c = -1; static int hf_ecat_length_m = -1; static int hf_ecat_padding = -1; static int hf_ecat_reg_revision = -1; static int hf_ecat_reg_esc_type = -1; static int hf_ecat_reg_esc_build = -1; static int hf_ecat_reg_esc_fmmucnt = -1; static int hf_ecat_reg_esc_smcnt = -1; static int hf_ecat_reg_esc_ports = -1; static int hf_ecat_reg_esc_dpram = -1; static int hf_ecat_reg_esc_features = -1; static int hf_ecat_reg_esc_features_fmmurestrict = -1; static int hf_ecat_reg_esc_features_smaddrrestrict = -1; static int hf_ecat_reg_esc_features_dcsupport = -1; static int hf_ecat_reg_esc_features_dc64support = -1; static int hf_ecat_reg_esc_features_ebuslowjitter = -1; static int hf_ecat_reg_esc_features_ebusextlinkdetect = -1; static int hf_ecat_reg_esc_features_miiextlinkdetect = -1; static int hf_ecat_reg_esc_features_crcext = -1; static int hf_ecat_reg_physaddr = -1; static int hf_ecat_reg_physaddr2 = -1; static int hf_ecat_reg_dlctrl1 = -1; static int hf_ecat_reg_dlctrl1_killnonecat = -1; static int hf_ecat_reg_dlctrl1_port0extlinkdetect = -1; static int hf_ecat_reg_dlctrl1_port1extlinkdetect = -1; static int hf_ecat_reg_dlctrl1_port2extlinkdetect = -1; static int hf_ecat_reg_dlctrl1_port3extlinkdetect = -1; static int hf_ecat_reg_dlctrl2 = -1; static int hf_ecat_reg_dlctrl2_port0 = -1; static int hf_ecat_reg_dlctrl2_port1 = -1; static int hf_ecat_reg_dlctrl2_port2 = -1; static int hf_ecat_reg_dlctrl2_port3 = -1; static int hf_ecat_reg_dlctrl3 = -1; static int hf_ecat_reg_dlctrl3_fifosize = -1; static int hf_ecat_reg_dlctrl3_lowebusjit = -1; static int hf_ecat_reg_dlctrl4 = -1; static int hf_ecat_reg_dlctrl4_2ndaddress = -1; static int hf_ecat_reg_dlstatus1 = -1; static int hf_ecat_reg_dlstatus1_operation = -1; static int hf_ecat_reg_dlstatus1_pdiwatchdog = -1; static int hf_ecat_reg_dlstatus1_enhlinkdetect = -1; static int hf_ecat_reg_dlstatus1_physlink_port0 = -1; static int hf_ecat_reg_dlstatus1_physlink_port1 = -1; static int hf_ecat_reg_dlstatus1_physlink_port2 = -1; static int hf_ecat_reg_dlstatus1_physlink_port3 = -1; static int hf_ecat_reg_dlstatus2 = -1; static int hf_ecat_reg_dlstatus2_port0 = -1; static int hf_ecat_reg_dlstatus2_port1 = -1; static int hf_ecat_reg_dlstatus2_port2 = -1; static int hf_ecat_reg_dlstatus2_port3 = -1; static int hf_ecat_reg_regprotect = -1; static int hf_ecat_reg_accessprotect = -1; static int hf_ecat_reg_resetecat = -1; static int hf_ecat_reg_resetpdi = -1; static int hf_ecat_reg_regphysrwoffs = -1; static int hf_ecat_reg_alctrl = -1; static int hf_ecat_reg_alctrl_ctrl = -1; static int hf_ecat_reg_alctrl_errack = -1; static int hf_ecat_reg_alctrl_id = -1; static int hf_ecat_reg_alstatus = -1; static int hf_ecat_reg_alstatus_status = -1; static int hf_ecat_reg_alstatus_err = -1; static int hf_ecat_reg_alstatus_id = -1; static int hf_ecat_reg_pdictrl1 = -1; static int hf_ecat_reg_pdictrl1_pdi = -1; static int hf_ecat_reg_pdictrl2 = -1; static int hf_ecat_reg_pdictrl2_devemul = -1; static int hf_ecat_reg_pdictrl2_enhlnkdetect = -1; static int hf_ecat_reg_pdictrl2_dcsyncout = -1; static int hf_ecat_reg_pdictrl2_dcsyncin = -1; static int hf_ecat_reg_pdictrl2_enhlnkdetect0 = -1; static int hf_ecat_reg_pdictrl2_enhlnkdetect1 = -1; static int hf_ecat_reg_pdictrl2_enhlnkdetect2 = -1; static int hf_ecat_reg_pdictrl2_enhlnkdetect3 = -1; static int hf_ecat_reg_alstatuscode = -1; static int hf_ecat_reg_ecat_mask = -1; static int hf_ecat_reg_ecat_mask_latchevt = -1; static int hf_ecat_reg_ecat_mask_escstatevt = -1; static int hf_ecat_reg_ecat_mask_alstatevt = -1; static int hf_ecat_reg_ecat_mask_sm0irq = -1; static int hf_ecat_reg_ecat_mask_sm1irq = -1; static int hf_ecat_reg_ecat_mask_sm2irq = -1; static int hf_ecat_reg_ecat_mask_sm3irq = -1; static int hf_ecat_reg_ecat_mask_sm4irq = -1; static int hf_ecat_reg_ecat_mask_sm5irq = -1; static int hf_ecat_reg_ecat_mask_sm6irq = -1; static int hf_ecat_reg_ecat_mask_sm7irq = -1; static int hf_ecat_reg_pdiL = -1; static int hf_ecat_reg_pdiL_alctrl = -1; static int hf_ecat_reg_pdiL_latchin = -1; static int hf_ecat_reg_pdiL_sync0 = -1; static int hf_ecat_reg_pdiL_sync1 = -1; static int hf_ecat_reg_pdiL_smchg = -1; static int hf_ecat_reg_pdiL_eepromcmdpen = -1; static int hf_ecat_reg_pdiL_sm0 = -1; static int hf_ecat_reg_pdiL_sm1 = -1; static int hf_ecat_reg_pdiL_sm2 = -1; static int hf_ecat_reg_pdiL_sm3 = -1; static int hf_ecat_reg_pdiL_sm4 = -1; static int hf_ecat_reg_pdiL_sm5 = -1; static int hf_ecat_reg_pdiL_sm6 = -1; static int hf_ecat_reg_pdiL_sm7 = -1; static int hf_ecat_reg_pdiH = -1; static int hf_ecat_reg_ecat = -1; static int hf_ecat_reg_ecat_latchevt = -1; static int hf_ecat_reg_ecat_escstatevt = -1; static int hf_ecat_reg_ecat_alstatevt = -1; static int hf_ecat_reg_ecat_sm0irq = -1; static int hf_ecat_reg_ecat_sm1irq = -1; static int hf_ecat_reg_ecat_sm2irq = -1; static int hf_ecat_reg_ecat_sm3irq = -1; static int hf_ecat_reg_ecat_sm4irq = -1; static int hf_ecat_reg_ecat_sm5irq = -1; static int hf_ecat_reg_ecat_sm6irq = -1; static int hf_ecat_reg_ecat_sm7irq = -1; static int hf_ecat_reg_pdi1 = -1; static int hf_ecat_reg_pdi1_alctrl = -1; static int hf_ecat_reg_pdi1_latchin = -1; static int hf_ecat_reg_pdi1_sync0 = -1; static int hf_ecat_reg_pdi1_sync1 = -1; static int hf_ecat_reg_pdi1_smchg = -1; static int hf_ecat_reg_pdi1_eepromcmdpen = -1; static int hf_ecat_reg_pdi1_sm0 = -1; static int hf_ecat_reg_pdi1_sm1 = -1; static int hf_ecat_reg_pdi1_sm2 = -1; static int hf_ecat_reg_pdi1_sm3 = -1; static int hf_ecat_reg_pdi1_sm4 = -1; static int hf_ecat_reg_pdi1_sm5 = -1; static int hf_ecat_reg_pdi1_sm6 = -1; static int hf_ecat_reg_pdi1_sm7 = -1; static int hf_ecat_reg_pdi2 = -1; static int hf_ecat_reg_crc0 = -1; static int hf_ecat_reg_crc0_frame = -1; static int hf_ecat_reg_crc0_rx = -1; static int hf_ecat_reg_crc1 = -1; static int hf_ecat_reg_crc1_frame = -1; static int hf_ecat_reg_crc1_rx = -1; static int hf_ecat_reg_crc2 = -1; static int hf_ecat_reg_crc2_frame = -1; static int hf_ecat_reg_crc2_rx = -1; static int hf_ecat_reg_crc3 = -1; static int hf_ecat_reg_crc3_frame = -1; static int hf_ecat_reg_crc3_rx = -1; static int hf_ecat_reg_crc_fwd0 = -1; static int hf_ecat_reg_crc_fwd1 = -1; static int hf_ecat_reg_crc_fwd2 = -1; static int hf_ecat_reg_crc_fwd3 = -1; static int hf_ecat_reg_processuniterr = -1; static int hf_ecat_reg_pdierr = -1; static int hf_ecat_reg_linklost0 = -1; static int hf_ecat_reg_linklost1 = -1; static int hf_ecat_reg_linklost2 = -1; static int hf_ecat_reg_linklost3 = -1; static int hf_ecat_reg_wd_divisor = -1; static int hf_ecat_reg_wd_timepdi = -1; static int hf_ecat_reg_wd_timesm = -1; static int hf_ecat_reg_wd_status = -1; static int hf_ecat_reg_wd_status_pdwatchdog = -1; static int hf_ecat_reg_wd_cntsm = -1; static int hf_ecat_reg_wd_cntpdi = -1; static int hf_ecat_reg_eeprom_assign = -1; static int hf_ecat_reg_eeprom_assign_ctrl = -1; static int hf_ecat_reg_eeprom_assign_pdiaccess = -1; static int hf_ecat_reg_eeprom_assign_status = -1; static int hf_ecat_reg_ctrlstat = -1; static int hf_ecat_reg_ctrlstat_wraccess = -1; static int hf_ecat_reg_ctrlstat_eepromemul = -1; static int hf_ecat_reg_ctrlstat_8bacc = -1; static int hf_ecat_reg_ctrlstat_2bacc = -1; static int hf_ecat_reg_ctrlstat_rdacc = -1; static int hf_ecat_reg_ctrlstat_wracc = -1; static int hf_ecat_reg_ctrlstat_reloadacc = -1; static int hf_ecat_reg_ctrlstat_crcerr = -1; static int hf_ecat_reg_ctrlstat_lderr = -1; static int hf_ecat_reg_ctrlstat_cmderr = -1; static int hf_ecat_reg_ctrlstat_wrerr = -1; static int hf_ecat_reg_ctrlstat_busy = -1; static int hf_ecat_reg_addrl = -1; static int hf_ecat_reg_addrh = -1; static int hf_ecat_reg_data0 = -1; static int hf_ecat_reg_data1 = -1; static int hf_ecat_reg_data2 = -1; static int hf_ecat_reg_data3 = -1; static int hf_ecat_reg_mio_ctrlstat = -1; static int hf_ecat_reg_mio_ctrlstat_wracc1 = -1; static int hf_ecat_reg_mio_ctrlstat_offsphy = -1; static int hf_ecat_reg_mio_ctrlstat_rdacc = -1; static int hf_ecat_reg_mio_ctrlstat_wracc2 = -1; static int hf_ecat_reg_mio_ctrlstat_wrerr = -1; static int hf_ecat_reg_mio_ctrlstat_busy = -1; static int hf_ecat_reg_mio_addr = -1; static int hf_ecat_reg_mio_addr_phyaddr = -1; static int hf_ecat_reg_mio_addr_mioaddr = -1; static int hf_ecat_reg_mio_data = -1; static int hf_ecat_reg_mio_access = -1; static int hf_ecat_reg_mio_access_ecatacc = -1; static int hf_ecat_reg_mio_access_pdiacc = -1; static int hf_ecat_reg_mio_access_forcereset = -1; static int hf_ecat_reg_mio_status0 = -1; static int hf_ecat_reg_mio_status0_physlink = -1; static int hf_ecat_reg_mio_status0_link = -1; static int hf_ecat_reg_mio_status0_linkstatuserr = -1; static int hf_ecat_reg_mio_status0_readerr = -1; static int hf_ecat_reg_mio_status0_linkpartnererr = -1; static int hf_ecat_reg_mio_status0_phycfgupdated = -1; static int hf_ecat_reg_mio_status1 = -1; static int hf_ecat_reg_mio_status1_physlink = -1; static int hf_ecat_reg_mio_status1_link = -1; static int hf_ecat_reg_mio_status1_linkstatuserr = -1; static int hf_ecat_reg_mio_status1_readerr = -1; static int hf_ecat_reg_mio_status1_linkpartnererr = -1; static int hf_ecat_reg_mio_status1_phycfgupdated = -1; static int hf_ecat_reg_mio_status2 = -1; static int hf_ecat_reg_mio_status2_physlink = -1; static int hf_ecat_reg_mio_status2_link = -1; static int hf_ecat_reg_mio_status2_linkstatuserr = -1; static int hf_ecat_reg_mio_status2_readerr = -1; static int hf_ecat_reg_mio_status2_linkpartnererr = -1; static int hf_ecat_reg_mio_status2_phycfgupdated = -1; static int hf_ecat_reg_mio_status3 = -1; static int hf_ecat_reg_mio_status3_physlink = -1; static int hf_ecat_reg_mio_status3_link = -1; static int hf_ecat_reg_mio_status3_linkstatuserr = -1; static int hf_ecat_reg_mio_status3_readerr = -1; static int hf_ecat_reg_mio_status3_linkpartnererr = -1; static int hf_ecat_reg_mio_status3_phycfgupdated = -1; static int hf_ecat_reg_fmmu = -1; static int hf_ecat_reg_fmmu_lstart = -1; static int hf_ecat_reg_fmmu_llen = -1; static int hf_ecat_reg_fmmu_lstartbit = -1; static int hf_ecat_reg_fmmu_lendbit = -1; static int hf_ecat_reg_fmmu_pstart = -1; static int hf_ecat_reg_fmmu_pstartbit = -1; static int hf_ecat_reg_fmmu_type = -1; static int hf_ecat_reg_fmmu_typeread = -1; static int hf_ecat_reg_fmmu_typewrite = -1; static int hf_ecat_reg_fmmu_activate = -1; static int hf_ecat_reg_fmmu_activate0 = -1; static int hf_ecat_reg_syncman_ctrlstatus = -1; static int hf_ecat_reg_syncman_pmode = -1; static int hf_ecat_reg_syncman_access = -1; static int hf_ecat_reg_syncman_irq_ecat = -1; static int hf_ecat_reg_syncman_irq_pdi = -1; static int hf_ecat_reg_syncman_wdt = -1; static int hf_ecat_reg_syncman_irq_write = -1; static int hf_ecat_reg_syncman_irq_read = -1; static int hf_ecat_reg_syncman_1bufstate = -1; static int hf_ecat_reg_syncman_3bufstate = -1; static int hf_ecat_reg_syncman_sm_enable = -1; static int hf_ecat_reg_syncman_enable = -1; static int hf_ecat_reg_syncman_repeatreq = -1; static int hf_ecat_reg_syncman_latchsmchg_ecat = -1; static int hf_ecat_reg_syncman_latchsmchg_pdi = -1; static int hf_ecat_reg_syncman_deactivate = -1; static int hf_ecat_reg_syncman_repeatack = -1; static int hf_ecat_reg_syncman = -1; static int hf_ecat_reg_syncman_start = -1; static int hf_ecat_reg_syncman_len = -1; static int hf_ecat_reg_dc_recv0 = -1; static int hf_ecat_reg_dc_recv1 = -1; static int hf_ecat_reg_dc_recv2 = -1; static int hf_ecat_reg_dc_recv3 = -1; static int hf_ecat_reg_dc_systime = -1; static int hf_ecat_reg_dc_systimeL = -1; static int hf_ecat_reg_dc_systimeH = -1; static int hf_ecat_reg_dc_recvtime64 = -1; static int hf_ecat_reg_dc_systimeoffs = -1; static int hf_ecat_reg_dc_systimeoffsl = -1; static int hf_ecat_reg_dc_systimeoffsh = -1; static int hf_ecat_reg_dc_systimedelay = -1; static int hf_ecat_reg_dc_ctrlerr = -1; static int hf_ecat_reg_dc_speedstart = -1; static int hf_ecat_reg_dc_speeddiff = -1; static int hf_ecat_reg_dc_fltdepth_systimediff = -1; static int hf_ecat_reg_dc_fltdepth_speedcnt = -1; static int hf_ecat_reg_dc_cycunitctrl = -1; static int hf_ecat_reg_dc_cycunitctrl_access_cyclic = -1; static int hf_ecat_reg_dc_cycunitctrl_access_latch0 = -1; static int hf_ecat_reg_dc_cycunitctrl_access_latch1 = -1; static int hf_ecat_reg_dc_activation = -1; static int hf_ecat_reg_dc_activation_enablecyclic = -1; static int hf_ecat_reg_dc_activation_gen_sync0 = -1; static int hf_ecat_reg_dc_activation_gen_sync1 = -1; static int hf_ecat_reg_dc_activation_autoactivation = -1; static int hf_ecat_reg_dc_activation_stimeext = -1; static int hf_ecat_reg_dc_activation_stimecheck = -1; static int hf_ecat_reg_dc_activation_hlfrange = -1; static int hf_ecat_reg_dc_activation_dblrange = -1; static int hf_ecat_reg_dc_cycimpuls = -1; static int hf_ecat_reg_dc_activationstat = -1; static int hf_ecat_reg_dc_activationstat_sync0pend = -1; static int hf_ecat_reg_dc_activationstat_sync1pend = -1; static int hf_ecat_reg_dc_activationstat_stimeoutofrange = -1; static int hf_ecat_reg_dc_sync0_status = -1; static int hf_ecat_reg_dc_sync0_status_triggered = -1; static int hf_ecat_reg_dc_sync1_status = -1; static int hf_ecat_reg_dc_sync1_status_triggered = -1; static int hf_ecat_reg_dc_starttime0 = -1; static int hf_ecat_reg_dc_starttime1 = -1; static int hf_ecat_reg_dc_cyctime0 = -1; static int hf_ecat_reg_dc_cyctime1 = -1; static int hf_ecat_reg_dc_latch0_ctrl_pos = -1; static int hf_ecat_reg_dc_latch0_ctrl_neg = -1; static int hf_ecat_reg_dc_latch1_ctrl_pos = -1; static int hf_ecat_reg_dc_latch1_ctrl_neg = -1; static int hf_ecat_reg_dc_latch0_status_eventpos = -1; static int hf_ecat_reg_dc_latch0_status_eventneg = -1; static int hf_ecat_reg_dc_latch0_status_pinstate = -1; static int hf_ecat_reg_dc_latch1_status_eventpos = -1; static int hf_ecat_reg_dc_latch1_status_eventneg = -1; static int hf_ecat_reg_dc_latch1_status_pinstate = -1; static int hf_ecat_reg_dc_latch0_ctrl = -1; static int hf_ecat_reg_dc_latch1_ctrl = -1; static int hf_ecat_reg_dc_latch0_status = -1; static int hf_ecat_reg_dc_latch1_status = -1; static int hf_ecat_reg_dc_latch0_pos = -1; static int hf_ecat_reg_dc_latch0_neg = -1; static int hf_ecat_reg_dc_latch1_pos = -1; static int hf_ecat_reg_dc_latch1_neg = -1; static int hf_ecat_reg_dc_rcvsyncmanchg = -1; static int hf_ecat_reg_dc_pdismstart = -1; static int hf_ecat_reg_dc_pdismchg = -1; static const value_string EcCmdShort[] = { { 0, "NOP" }, { 1, "APRD" }, { 2, "APWR" }, { 3, "APRW" }, { 4, "FPRD" }, { 5, "FPWR" }, { 6, "FPRW" }, { 7, "BRD" }, { 8, "BWR" }, { 9, "BRW" }, { 10, "LRD" }, { 11, "LWR" }, { 12, "LRW" }, { 13, "ARMW" }, { 14, "FRMW" }, { 255, "EXT" }, { 0, NULL } }; static const value_string EcCmdLong[] = { { 0, "No operation" }, { 1, "Auto Increment Physical Read" }, { 2, "Auto Increment Physical Write" }, { 3, "Auto Increment Physical ReadWrite" }, { 4, "Configured address Physical Read" }, { 5, "Configured address Physical Write" }, { 6, "Configured address Physical ReadWrite" }, { 7, "Broadcast Read" }, { 8, "Broadcast Write" }, { 9, "Broadcast ReadWrite" }, { 10, "Logical Read" }, { 11, "Logical Write" }, { 12, "Logical ReadWrite" }, { 13, "Auto Increment Physical Read Multiple Write" }, { 14, "Configured Address Physical Read Multiple Write" }, { 255, "EXT" }, { 0, NULL } }; static const value_string ecat_subframe_reserved_vals[] = { { 0, "Valid"}, { 0, NULL} }; static const true_false_string tfs_ecat_subframe_circulating_vals = { "Frame has circulated once", "Frame is not circulating" }; static const true_false_string tfs_ecat_subframe_more_vals = { "More EtherCAT datagrams will follow", "Last EtherCAT datagram" }; static const true_false_string tfs_ecat_fmmu_typeread = { "Read in use", "Read ignore" }; static const true_false_string tfs_ecat_fmmu_typewrite = { "Write in use", "Write ignore" }; static const true_false_string tfs_local_true_false = { "True", "False", }; static const true_false_string tfs_local_disabled_enabled = { "Enabled", "Disabled", }; static const true_false_string tfs_local_disable_enable = { "Enable", "Disable", }; static const true_false_string tfs_esc_reg_watchdog = { "Okay", "Run out", }; static const char* convertEcCmdToText(int cmd, const value_string ec_cmd[]) { return val_to_str(cmd, ec_cmd, "<UNKNOWN: %d>"); } #define ENDOF(p) ((p)+1) /* pointer to end of *p*/ typedef enum { EC_CMD_TYPE_NOP = 0, EC_CMD_TYPE_APRD = 1, EC_CMD_TYPE_APWR = 2, EC_CMD_TYPE_APRW = 3, EC_CMD_TYPE_FPRD = 4, EC_CMD_TYPE_FPWR = 5, EC_CMD_TYPE_FPRW = 6, EC_CMD_TYPE_BRD = 7, EC_CMD_TYPE_BWR = 8, EC_CMD_TYPE_BRW = 9, EC_CMD_TYPE_LRD = 10, EC_CMD_TYPE_LWR = 11, EC_CMD_TYPE_LRW = 12, EC_CMD_TYPE_ARMW = 13, EC_CMD_TYPE_FRMW = 14, EC_CMD_TYPE_EXT = 255 } EC_CMD_TYPE; /* Esc Feature Reg 8 */ static int * const ecat_esc_reg_8[] = { &hf_ecat_reg_esc_features_fmmurestrict, &hf_ecat_reg_esc_features_smaddrrestrict, &hf_ecat_reg_esc_features_dcsupport, &hf_ecat_reg_esc_features_dc64support, &hf_ecat_reg_esc_features_ebuslowjitter, &hf_ecat_reg_esc_features_ebusextlinkdetect, &hf_ecat_reg_esc_features_miiextlinkdetect, &hf_ecat_reg_esc_features_crcext, NULL }; /* Esc Status Reg 100 */ static int * const ecat_esc_reg_100[] = { &hf_ecat_reg_dlctrl1_killnonecat, &hf_ecat_reg_dlctrl1_port0extlinkdetect, &hf_ecat_reg_dlctrl1_port1extlinkdetect, &hf_ecat_reg_dlctrl1_port2extlinkdetect, &hf_ecat_reg_dlctrl1_port3extlinkdetect, NULL }; /* Esc Status Reg 101 */ static const value_string vals_esc_reg_101[] = { { 0, "Auto loop" }, { 1, "Auto close only" }, { 2, "Loop open" }, { 3, "Loop closed" }, { 0, NULL }, }; static int * const ecat_esc_reg_101[] = { &hf_ecat_reg_dlctrl2_port0, &hf_ecat_reg_dlctrl2_port1, &hf_ecat_reg_dlctrl2_port2, &hf_ecat_reg_dlctrl2_port3, NULL }; static int * const ecat_esc_reg_102[] = { &hf_ecat_reg_dlctrl3_fifosize, &hf_ecat_reg_dlctrl3_lowebusjit, NULL }; static int * const ecat_esc_reg_103[] = { &hf_ecat_reg_dlctrl4_2ndaddress, NULL }; /* Esc Status Reg 110 */ static int * const ecat_esc_reg_110[] = { &hf_ecat_reg_dlstatus1_operation, &hf_ecat_reg_dlstatus1_pdiwatchdog, &hf_ecat_reg_dlstatus1_enhlinkdetect, &hf_ecat_reg_dlstatus1_physlink_port0, &hf_ecat_reg_dlstatus1_physlink_port1, &hf_ecat_reg_dlstatus1_physlink_port2, &hf_ecat_reg_dlstatus1_physlink_port3, NULL }; /* Esc Status Reg 111 */ static const value_string vals_esc_reg_111[] = { { 0, "Loop open, no link" }, { 1, "Loop closed, no link" }, { 2, "Loop open, with link" }, { 3, "Loop closed, with link" }, { 0, NULL}, }; static int * const ecat_esc_reg_111[] = { &hf_ecat_reg_dlstatus2_port0, &hf_ecat_reg_dlstatus2_port1, &hf_ecat_reg_dlstatus2_port2, &hf_ecat_reg_dlstatus2_port3, NULL }; static const value_string vals_esc_reg_120[] = { { 1, "INIT" }, { 2, "PREOP" }, { 3, "BOOTSTRAP" }, { 4, "SAFEOP" }, { 8, "OP" }, { 0, NULL}, }; static int * const ecat_esc_reg_120[] = { &hf_ecat_reg_alctrl_ctrl, &hf_ecat_reg_alctrl_errack, &hf_ecat_reg_alctrl_id, NULL }; static int * const ecat_esc_reg_130[] = { &hf_ecat_reg_alstatus_status, &hf_ecat_reg_alstatus_err, &hf_ecat_reg_alstatus_id, NULL }; static const value_string vals_esc_reg_140[] = { { 0, "None" }, { 1, "4 bit dig. input" }, { 2, "4 bit dig. output" }, { 3, "2 bit dig. in/output" }, { 4, "dig. in/output" }, { 5, "SPI slave" }, { 7, "EtherCAT bridge" }, { 8, "16 bit uC (async)" }, { 9, "8 bit uC (async)" }, { 10, "16 bit uC (sync)" }, { 11, "8 bit uC (sync)" }, { 16, "32/0 bit dig. in/output" }, { 17, "24/8 bit dig. in/output" }, { 18, "16/16 bit dig. in/output" }, { 19, "8/24 bit dig. in/output" }, { 20, "0/32 bit dig. in/output" }, { 128, "On chip bus" }, { 0, NULL}, }; static int * const ecat_esc_reg_140[] = { &hf_ecat_reg_pdictrl1_pdi, NULL }; static int * const ecat_esc_reg_141[] = { &hf_ecat_reg_pdictrl2_devemul, &hf_ecat_reg_pdictrl2_enhlnkdetect, &hf_ecat_reg_pdictrl2_dcsyncout, &hf_ecat_reg_pdictrl2_dcsyncin, &hf_ecat_reg_pdictrl2_enhlnkdetect0, &hf_ecat_reg_pdictrl2_enhlnkdetect1, &hf_ecat_reg_pdictrl2_enhlnkdetect2, &hf_ecat_reg_pdictrl2_enhlnkdetect3, NULL }; static int * const ecat_esc_reg_200[] = { &hf_ecat_reg_ecat_mask_latchevt, &hf_ecat_reg_ecat_mask_escstatevt, &hf_ecat_reg_ecat_mask_alstatevt, &hf_ecat_reg_ecat_mask_sm0irq, &hf_ecat_reg_ecat_mask_sm1irq, &hf_ecat_reg_ecat_mask_sm2irq, &hf_ecat_reg_ecat_mask_sm3irq, &hf_ecat_reg_ecat_mask_sm4irq, &hf_ecat_reg_ecat_mask_sm5irq, &hf_ecat_reg_ecat_mask_sm6irq, &hf_ecat_reg_ecat_mask_sm7irq, NULL }; static int * const ecat_esc_reg_204[] = { &hf_ecat_reg_pdiL_alctrl, &hf_ecat_reg_pdiL_latchin, &hf_ecat_reg_pdiL_sync0, &hf_ecat_reg_pdiL_sync1, &hf_ecat_reg_pdiL_smchg, &hf_ecat_reg_pdiL_eepromcmdpen, &hf_ecat_reg_pdiL_sm0, &hf_ecat_reg_pdiL_sm1, &hf_ecat_reg_pdiL_sm2, &hf_ecat_reg_pdiL_sm3, &hf_ecat_reg_pdiL_sm4, &hf_ecat_reg_pdiL_sm5, &hf_ecat_reg_pdiL_sm6, &hf_ecat_reg_pdiL_sm7, NULL }; static int * const ecat_esc_reg_210[] = { &hf_ecat_reg_ecat_latchevt, &hf_ecat_reg_ecat_escstatevt, &hf_ecat_reg_ecat_alstatevt, &hf_ecat_reg_ecat_sm0irq, &hf_ecat_reg_ecat_sm1irq, &hf_ecat_reg_ecat_sm2irq, &hf_ecat_reg_ecat_sm3irq, &hf_ecat_reg_ecat_sm4irq, &hf_ecat_reg_ecat_sm5irq, &hf_ecat_reg_ecat_sm6irq, &hf_ecat_reg_ecat_sm7irq, NULL }; static int * const ecat_esc_reg_220[] = { &hf_ecat_reg_pdi1_alctrl, &hf_ecat_reg_pdi1_latchin, &hf_ecat_reg_pdi1_sync0, &hf_ecat_reg_pdi1_sync1, &hf_ecat_reg_pdi1_smchg, &hf_ecat_reg_pdi1_eepromcmdpen, &hf_ecat_reg_pdi1_sm0, &hf_ecat_reg_pdi1_sm1, &hf_ecat_reg_pdi1_sm2, &hf_ecat_reg_pdi1_sm3, &hf_ecat_reg_pdi1_sm4, &hf_ecat_reg_pdi1_sm5, &hf_ecat_reg_pdi1_sm6, &hf_ecat_reg_pdi1_sm7, NULL }; static int * const ecat_esc_reg_300[] = { &hf_ecat_reg_crc0_frame, &hf_ecat_reg_crc0_rx, NULL }; static int * const ecat_esc_reg_302[] = { &hf_ecat_reg_crc1_frame, &hf_ecat_reg_crc1_rx, NULL }; static int * const ecat_esc_reg_304[] = { &hf_ecat_reg_crc2_frame, &hf_ecat_reg_crc2_rx, NULL }; static int * const ecat_esc_reg_306[] = { &hf_ecat_reg_crc3_frame, &hf_ecat_reg_crc3_rx, NULL }; static int * const ecat_esc_reg_440[] = { &hf_ecat_reg_wd_status_pdwatchdog, NULL }; static const true_false_string tfs_esc_reg_500_0 = { "Local uC", "ECAT" }; static const true_false_string tfs_esc_reg_500_1 = { "Reset Bit 501.0 to 0", "Do not change Bit 501.0" }; static int * const ecat_esc_reg_500[] = { &hf_ecat_reg_eeprom_assign_ctrl, &hf_ecat_reg_eeprom_assign_pdiaccess, &hf_ecat_reg_eeprom_assign_status, NULL }; static const true_false_string tfs_esc_reg_502_5 = { "PDI emulates EEPROM", "Normal operation" }; static int * const ecat_esc_reg_502[] = { &hf_ecat_reg_ctrlstat_wraccess, &hf_ecat_reg_ctrlstat_eepromemul, &hf_ecat_reg_ctrlstat_8bacc, &hf_ecat_reg_ctrlstat_2bacc, &hf_ecat_reg_ctrlstat_rdacc, &hf_ecat_reg_ctrlstat_wracc, &hf_ecat_reg_ctrlstat_reloadacc, &hf_ecat_reg_ctrlstat_crcerr, &hf_ecat_reg_ctrlstat_lderr, &hf_ecat_reg_ctrlstat_cmderr, &hf_ecat_reg_ctrlstat_wrerr, &hf_ecat_reg_ctrlstat_busy, NULL }; static int * const ecat_esc_reg_510[] = { &hf_ecat_reg_mio_ctrlstat_wracc1, &hf_ecat_reg_mio_ctrlstat_offsphy, &hf_ecat_reg_mio_ctrlstat_rdacc, &hf_ecat_reg_mio_ctrlstat_wracc2, &hf_ecat_reg_mio_ctrlstat_wrerr, &hf_ecat_reg_mio_ctrlstat_busy, NULL }; static int * const ecat_esc_reg_512[] = { &hf_ecat_reg_mio_addr_phyaddr, &hf_ecat_reg_mio_addr_mioaddr, NULL }; static int * const ecat_esc_reg_516[] = { &hf_ecat_reg_mio_access_ecatacc, &hf_ecat_reg_mio_access_pdiacc, &hf_ecat_reg_mio_access_forcereset, NULL }; static int * const ecat_esc_reg_518[] = { &hf_ecat_reg_mio_status0_physlink, &hf_ecat_reg_mio_status0_link, &hf_ecat_reg_mio_status0_linkstatuserr, &hf_ecat_reg_mio_status0_readerr, &hf_ecat_reg_mio_status0_linkpartnererr, &hf_ecat_reg_mio_status0_phycfgupdated, NULL }; static int * const ecat_esc_reg_519[] = { &hf_ecat_reg_mio_status1_physlink, &hf_ecat_reg_mio_status1_link, &hf_ecat_reg_mio_status1_linkstatuserr, &hf_ecat_reg_mio_status1_readerr, &hf_ecat_reg_mio_status1_linkpartnererr, &hf_ecat_reg_mio_status1_phycfgupdated, NULL }; static int * const ecat_esc_reg_51A[] = { &hf_ecat_reg_mio_status2_physlink, &hf_ecat_reg_mio_status2_link, &hf_ecat_reg_mio_status2_linkstatuserr, &hf_ecat_reg_mio_status2_readerr, &hf_ecat_reg_mio_status2_linkpartnererr, &hf_ecat_reg_mio_status2_phycfgupdated, NULL }; static int * const ecat_esc_reg_51B[] = { &hf_ecat_reg_mio_status3_physlink, &hf_ecat_reg_mio_status3_link, &hf_ecat_reg_mio_status3_linkstatuserr, &hf_ecat_reg_mio_status3_readerr, &hf_ecat_reg_mio_status3_linkpartnererr, &hf_ecat_reg_mio_status3_phycfgupdated, NULL }; static const true_false_string tfs_ecat_fmmu_activate = { "activated", "deactivated" }; static int ecat_reg_600(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item* item; proto_tree* subtree; item = proto_tree_add_item(tree, hf_ecat_reg_fmmu, tvb, offset, 16, ENC_NA); subtree = proto_item_add_subtree(item, ett_ecat_reg_fmmu); proto_tree_add_item(subtree, hf_ecat_reg_fmmu_lstart, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(subtree, hf_ecat_reg_fmmu_llen, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_ecat_reg_fmmu_lstartbit, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(subtree, hf_ecat_reg_fmmu_lendbit, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(subtree, hf_ecat_reg_fmmu_pstart, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_ecat_reg_fmmu_pstartbit, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(subtree, hf_ecat_reg_fmmu_type, tvb, offset, 1, ENC_NA); proto_tree_add_item(subtree, hf_ecat_reg_fmmu_typeread, tvb, offset, 1, ENC_NA); proto_tree_add_item(subtree, hf_ecat_reg_fmmu_typewrite, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(subtree, hf_ecat_reg_fmmu_activate, tvb, offset, 1, ENC_NA); proto_tree_add_item(subtree, hf_ecat_reg_fmmu_activate0, tvb, offset, 1, ENC_NA); return 16; } static int ecat_reg_800(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item* item; proto_tree* subtree; static int * const reg4[] = { &hf_ecat_reg_syncman_pmode, &hf_ecat_reg_syncman_access, &hf_ecat_reg_syncman_irq_ecat, &hf_ecat_reg_syncman_irq_pdi, &hf_ecat_reg_syncman_wdt, &hf_ecat_reg_syncman_irq_write, &hf_ecat_reg_syncman_irq_read, &hf_ecat_reg_syncman_1bufstate, &hf_ecat_reg_syncman_3bufstate, NULL }; static int * const reg6[] = { &hf_ecat_reg_syncman_enable, &hf_ecat_reg_syncman_repeatreq, &hf_ecat_reg_syncman_latchsmchg_ecat, &hf_ecat_reg_syncman_latchsmchg_pdi, &hf_ecat_reg_syncman_deactivate, &hf_ecat_reg_syncman_repeatack, NULL }; item = proto_tree_add_item(tree, hf_ecat_reg_syncman, tvb, offset, 8, ENC_NA); subtree = proto_item_add_subtree(item, ett_ecat_reg_syncman); proto_tree_add_item(subtree, hf_ecat_reg_syncman_start, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_ecat_reg_syncman_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_bitmask(subtree, tvb, offset, hf_ecat_reg_syncman_ctrlstatus, ett_ecat_reg_syncman_ctrlstatus, reg4, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_bitmask(subtree, tvb, offset, hf_ecat_reg_syncman_sm_enable, ett_ecat_reg_syncman_sm_enable, reg6, ENC_LITTLE_ENDIAN); return 8; } static const value_string vals_esc_reg_8041[] = { { 0, "3 buffer" }, { 2, "1 buffer" }, { 3, "1 buffer direct" }, { 0, NULL}, }; static const value_string vals_esc_reg_8042[] = { { 0, "Read" }, { 1, "Write" }, { 0, NULL}, }; static const true_false_string tfs_esc_reg_8051 = { "Written", "Read" }; static const value_string vals_esc_reg_8052[] = { { 0, "1. buffer" }, { 1, "2. buffer" }, { 2, "3. buffer" }, { 3, "blocked (start)" }, { 0, NULL}, }; static const true_false_string tfs_esc_reg_9801 = { "PDI", "ECAT" }; static int * const ecat_esc_reg_980[] = { &hf_ecat_reg_dc_cycunitctrl_access_cyclic, &hf_ecat_reg_dc_cycunitctrl_access_latch0, &hf_ecat_reg_dc_cycunitctrl_access_latch1, NULL }; static int * const ecat_esc_reg_981[] = { &hf_ecat_reg_dc_activation_enablecyclic, &hf_ecat_reg_dc_activation_gen_sync0, &hf_ecat_reg_dc_activation_gen_sync1, &hf_ecat_reg_dc_activation_autoactivation, &hf_ecat_reg_dc_activation_stimeext, &hf_ecat_reg_dc_activation_stimecheck, &hf_ecat_reg_dc_activation_hlfrange, &hf_ecat_reg_dc_activation_dblrange, NULL }; static int * const ecat_esc_reg_984[] = { &hf_ecat_reg_dc_activationstat_sync0pend, &hf_ecat_reg_dc_activationstat_sync1pend, &hf_ecat_reg_dc_activationstat_stimeoutofrange, NULL }; static int * const ecat_esc_reg_98e[] = { &hf_ecat_reg_dc_sync0_status_triggered, NULL }; static int * const ecat_esc_reg_98f[] = { &hf_ecat_reg_dc_sync1_status_triggered, NULL }; static const true_false_string tfs_esc_reg_9A8E1 = { "Single event", "Continuous" }; static int * const ecat_esc_reg_9a8[] = { &hf_ecat_reg_dc_latch0_ctrl_pos, &hf_ecat_reg_dc_latch0_ctrl_neg, NULL }; static int * const ecat_esc_reg_9a9[] = { &hf_ecat_reg_dc_latch1_ctrl_pos, &hf_ecat_reg_dc_latch1_ctrl_neg, NULL }; static int * const ecat_esc_reg_9ae[] = { &hf_ecat_reg_dc_latch0_status_eventpos, &hf_ecat_reg_dc_latch0_status_eventneg, &hf_ecat_reg_dc_latch0_status_pinstate, NULL }; static int * const ecat_esc_reg_9af[] = { &hf_ecat_reg_dc_latch1_status_eventpos, &hf_ecat_reg_dc_latch1_status_eventneg, &hf_ecat_reg_dc_latch1_status_pinstate, NULL }; typedef int register_dissect_func(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); /* esc registers */ typedef struct { guint16 reg; guint16 length; guint16 repeat; int* phf; int* const *bitmask_info; gint* pett; register_dissect_func *dissect; } ecat_esc_reg_info; #define NO_SUBTREE_FILL NULL, NULL, NULL static ecat_esc_reg_info ecat_esc_registers [] = { { 0x0000, 1, 1, &hf_ecat_reg_revision, NO_SUBTREE_FILL}, { 0x0001, 1, 1, &hf_ecat_reg_esc_type, NO_SUBTREE_FILL}, { 0x0002, 2, 1, &hf_ecat_reg_esc_build, NO_SUBTREE_FILL}, { 0x0004, 1, 1, &hf_ecat_reg_esc_fmmucnt, NO_SUBTREE_FILL}, { 0x0005, 1, 1, &hf_ecat_reg_esc_smcnt, NO_SUBTREE_FILL}, { 0x0006, 1, 1, &hf_ecat_reg_esc_ports, NO_SUBTREE_FILL}, { 0x0007, 1, 1, &hf_ecat_reg_esc_dpram, NO_SUBTREE_FILL}, { 0x0008, 2, 1, &hf_ecat_reg_esc_features, ecat_esc_reg_8, &ett_ecat_reg_esc_features, NULL}, { 0x0010, 2, 1, &hf_ecat_reg_physaddr, NO_SUBTREE_FILL}, { 0x0012, 2, 1, &hf_ecat_reg_physaddr2, NO_SUBTREE_FILL}, { 0x0020, 2, 1, &hf_ecat_reg_regprotect, NO_SUBTREE_FILL}, { 0x0030, 2, 1, &hf_ecat_reg_accessprotect, NO_SUBTREE_FILL}, { 0x0040, 1, 1, &hf_ecat_reg_resetecat, NO_SUBTREE_FILL}, { 0x0041, 1, 1, &hf_ecat_reg_resetpdi, NO_SUBTREE_FILL}, { 0x0100, 1, 1, &hf_ecat_reg_dlctrl1, ecat_esc_reg_100, &ett_ecat_reg_dlctrl1, NULL}, { 0x0101, 1, 1, &hf_ecat_reg_dlctrl2, ecat_esc_reg_101, &ett_ecat_reg_dlctrl2, NULL}, { 0x0102, 1, 1, &hf_ecat_reg_dlctrl3, ecat_esc_reg_102, &ett_ecat_reg_dlctrl3, NULL}, { 0x0103, 1, 1, &hf_ecat_reg_dlctrl4, ecat_esc_reg_103, &ett_ecat_reg_dlctrl4, NULL}, { 0x0108, 2, 1, &hf_ecat_reg_regphysrwoffs, NO_SUBTREE_FILL}, { 0x0110, 1, 1, &hf_ecat_reg_dlstatus1, ecat_esc_reg_110, &ett_ecat_reg_dlstatus1, NULL}, { 0x0111, 1, 1, &hf_ecat_reg_dlstatus2, ecat_esc_reg_111, &ett_ecat_reg_dlstatus2, NULL}, { 0x0120, 2, 1, &hf_ecat_reg_alctrl, ecat_esc_reg_120, &ett_ecat_reg_alctrl, NULL}, { 0x0130, 2, 1, &hf_ecat_reg_alstatus, ecat_esc_reg_130, &ett_ecat_reg_alstatus, NULL}, { 0x0134, 2, 1, &hf_ecat_reg_alstatuscode, NO_SUBTREE_FILL}, { 0x0140, 1, 1, &hf_ecat_reg_pdictrl1, ecat_esc_reg_140, &ett_ecat_reg_pdictrl1, NULL}, { 0x0141, 1, 1, &hf_ecat_reg_pdictrl2, ecat_esc_reg_141, &ett_ecat_reg_pdictrl2, NULL}, { 0x0200, 2, 1, &hf_ecat_reg_ecat_mask, ecat_esc_reg_200, &ett_ecat_reg_ecat_mask, NULL}, { 0x0204, 2, 1, &hf_ecat_reg_pdiL, ecat_esc_reg_204, &ett_ecat_reg_pdiL, NULL}, { 0x0206, 2, 1, &hf_ecat_reg_pdiH, NO_SUBTREE_FILL}, { 0x0210, 2, 1, &hf_ecat_reg_ecat, ecat_esc_reg_210, &ett_ecat_reg_ecat, NULL}, { 0x0220, 2, 1, &hf_ecat_reg_pdi1, ecat_esc_reg_220, &ett_ecat_reg_pdi1, NULL}, { 0x0222, 2, 1, &hf_ecat_reg_pdi2, NO_SUBTREE_FILL}, { 0x0300, 2, 1, &hf_ecat_reg_crc0, ecat_esc_reg_300, &ett_ecat_reg_crc0, NULL}, { 0x0302, 2, 1, &hf_ecat_reg_crc1, ecat_esc_reg_302, &ett_ecat_reg_crc1, NULL}, { 0x0304, 2, 1, &hf_ecat_reg_crc2, ecat_esc_reg_304, &ett_ecat_reg_crc2, NULL}, { 0x0306, 2, 1, &hf_ecat_reg_crc3, ecat_esc_reg_306, &ett_ecat_reg_crc3, NULL}, { 0x0308, 1, 1, &hf_ecat_reg_crc_fwd0, NO_SUBTREE_FILL}, { 0x0309, 1, 1, &hf_ecat_reg_crc_fwd1, NO_SUBTREE_FILL}, { 0x030A, 1, 1, &hf_ecat_reg_crc_fwd2, NO_SUBTREE_FILL}, { 0x030B, 1, 1, &hf_ecat_reg_crc_fwd3, NO_SUBTREE_FILL}, { 0x030C, 1, 1, &hf_ecat_reg_processuniterr, NO_SUBTREE_FILL}, { 0x030D, 1, 1, &hf_ecat_reg_pdierr, NO_SUBTREE_FILL}, { 0x0310, 1, 1, &hf_ecat_reg_linklost0, NO_SUBTREE_FILL}, { 0x0311, 1, 1, &hf_ecat_reg_linklost1, NO_SUBTREE_FILL}, { 0x0312, 1, 1, &hf_ecat_reg_linklost2, NO_SUBTREE_FILL}, { 0x0313, 1, 1, &hf_ecat_reg_linklost3, NO_SUBTREE_FILL}, { 0x0400, 2, 1, &hf_ecat_reg_wd_divisor, NO_SUBTREE_FILL}, { 0x0410, 2, 1, &hf_ecat_reg_wd_timepdi, NO_SUBTREE_FILL}, { 0x0420, 2, 1, &hf_ecat_reg_wd_timesm, NO_SUBTREE_FILL}, { 0x0440, 1, 1, &hf_ecat_reg_wd_status, ecat_esc_reg_440, &ett_ecat_reg_wd_status, NULL}, { 0x0442, 1, 1, &hf_ecat_reg_wd_cntsm, NO_SUBTREE_FILL}, { 0x0443, 1, 1, &hf_ecat_reg_wd_cntpdi, NO_SUBTREE_FILL}, { 0x0500, 2, 1, &hf_ecat_reg_eeprom_assign, ecat_esc_reg_500, &ett_ecat_reg_eeprom_assign, NULL}, { 0x0502, 2, 1, &hf_ecat_reg_ctrlstat, ecat_esc_reg_502, &ett_ecat_reg_ctrlstat, NULL}, { 0x0504, 2, 1, &hf_ecat_reg_addrl, NO_SUBTREE_FILL}, { 0x0506, 2, 1, &hf_ecat_reg_addrh, NO_SUBTREE_FILL}, { 0x0508, 2, 1, &hf_ecat_reg_data0, NO_SUBTREE_FILL}, { 0x050a, 2, 1, &hf_ecat_reg_data1, NO_SUBTREE_FILL}, { 0x050c, 2, 1, &hf_ecat_reg_data2, NO_SUBTREE_FILL}, { 0x050e, 2, 1, &hf_ecat_reg_data3, NO_SUBTREE_FILL}, { 0x0510, 2, 1, &hf_ecat_reg_mio_ctrlstat, ecat_esc_reg_510, &ett_ecat_reg_mio_ctrlstat, NULL}, { 0x0512, 2, 1, &hf_ecat_reg_mio_addr, ecat_esc_reg_512, &ett_ecat_mio_addr, NULL}, { 0x0514, 2, 1, &hf_ecat_reg_mio_data, NO_SUBTREE_FILL}, { 0x0516, 2, 1, &hf_ecat_reg_mio_access, ecat_esc_reg_516, &ett_ecat_mio_access, NULL}, { 0x0518, 1, 1, &hf_ecat_reg_mio_status0, ecat_esc_reg_518, &ett_ecat_mio_status0, NULL}, { 0x0519, 1, 1, &hf_ecat_reg_mio_status1, ecat_esc_reg_519, &ett_ecat_mio_status1, NULL}, { 0x051A, 1, 1, &hf_ecat_reg_mio_status2, ecat_esc_reg_51A, &ett_ecat_mio_status2, NULL}, { 0x051B, 1, 1, &hf_ecat_reg_mio_status3, ecat_esc_reg_51B, &ett_ecat_mio_status3, NULL}, { 0x0600, 16, 16, &hf_ecat_reg_fmmu, NULL, NULL, ecat_reg_600}, { 0x0800, 8, 8, &hf_ecat_reg_syncman, NULL, NULL, ecat_reg_800}, { 0x0900, 4, 1, &hf_ecat_reg_dc_recv0, NO_SUBTREE_FILL}, { 0x0904, 4, 1, &hf_ecat_reg_dc_recv1, NO_SUBTREE_FILL}, { 0x0908, 4, 1, &hf_ecat_reg_dc_recv2, NO_SUBTREE_FILL}, { 0x090c, 4, 1, &hf_ecat_reg_dc_recv3, NO_SUBTREE_FILL}, { 0x0910, 8, 1, &hf_ecat_reg_dc_systime, NO_SUBTREE_FILL}, { 0x0910, 4, 1, &hf_ecat_reg_dc_systimeL, NO_SUBTREE_FILL}, { 0x0914, 4, 1, &hf_ecat_reg_dc_systimeH, NO_SUBTREE_FILL}, { 0x0918, 8, 1, &hf_ecat_reg_dc_recvtime64, NO_SUBTREE_FILL}, { 0x0920, 8, 1, &hf_ecat_reg_dc_systimeoffs, NO_SUBTREE_FILL}, { 0x0920, 4, 1, &hf_ecat_reg_dc_systimeoffsl, NO_SUBTREE_FILL}, { 0x0924, 4, 1, &hf_ecat_reg_dc_systimeoffsh, NO_SUBTREE_FILL}, { 0x0928, 4, 1, &hf_ecat_reg_dc_systimedelay, NO_SUBTREE_FILL}, { 0x092c, 4, 1, &hf_ecat_reg_dc_ctrlerr, NO_SUBTREE_FILL}, { 0x0930, 2, 1, &hf_ecat_reg_dc_speedstart, NO_SUBTREE_FILL}, { 0x0932, 2, 1, &hf_ecat_reg_dc_speeddiff, NO_SUBTREE_FILL}, { 0x0934, 1, 1, &hf_ecat_reg_dc_fltdepth_systimediff, NO_SUBTREE_FILL}, { 0x0935, 1, 1, &hf_ecat_reg_dc_fltdepth_speedcnt, NO_SUBTREE_FILL}, { 0x0980, 1, 1, &hf_ecat_reg_dc_cycunitctrl, ecat_esc_reg_980, &ett_ecat_reg_dc_cycunitctrl, NULL}, { 0x0981, 1, 1, &hf_ecat_reg_dc_activation, ecat_esc_reg_981, &ett_ecat_dc_activation, NULL}, { 0x0982, 2, 1, &hf_ecat_reg_dc_cycimpuls, NO_SUBTREE_FILL}, { 0x0984, 1, 1, &hf_ecat_reg_dc_activationstat, ecat_esc_reg_984, &ett_ecat_dc_activationstat, NULL}, { 0x098e, 1, 1, &hf_ecat_reg_dc_sync0_status, ecat_esc_reg_98e, &ett_ecat_dc_sync0_status, NULL}, { 0x098f, 1, 1, &hf_ecat_reg_dc_sync1_status, ecat_esc_reg_98f, &ett_ecat_dc_sync1_status, NULL}, { 0x0990, 8, 1, &hf_ecat_reg_dc_starttime0, NO_SUBTREE_FILL}, { 0x0998, 8, 1, &hf_ecat_reg_dc_starttime1, NO_SUBTREE_FILL}, { 0x09a0, 4, 1, &hf_ecat_reg_dc_cyctime0, NO_SUBTREE_FILL}, { 0x09a4, 4, 1, &hf_ecat_reg_dc_cyctime1, NO_SUBTREE_FILL}, { 0x09a8, 1, 1, &hf_ecat_reg_dc_latch0_ctrl, ecat_esc_reg_9a8, &ett_ecat_dc_latch0_ctrl, NULL}, { 0x09a9, 1, 1, &hf_ecat_reg_dc_latch1_ctrl, ecat_esc_reg_9a9, &ett_ecat_dc_latch1_ctrl, NULL}, { 0x09ae, 1, 1, &hf_ecat_reg_dc_latch0_status, ecat_esc_reg_9ae, &ett_ecat_dc_latch0_status, NULL}, { 0x09af, 1, 1, &hf_ecat_reg_dc_latch1_status, ecat_esc_reg_9af, &ett_ecat_dc_latch1_status, NULL}, { 0x09b0, 8, 1, &hf_ecat_reg_dc_latch0_pos, NO_SUBTREE_FILL}, { 0x09b8, 8, 1, &hf_ecat_reg_dc_latch0_neg, NO_SUBTREE_FILL}, { 0x09c0, 8, 1, &hf_ecat_reg_dc_latch1_pos, NO_SUBTREE_FILL}, { 0x09c8, 8, 1, &hf_ecat_reg_dc_latch1_neg, NO_SUBTREE_FILL}, { 0x09f0, 4, 1, &hf_ecat_reg_dc_rcvsyncmanchg, NO_SUBTREE_FILL}, { 0x09f8, 4, 1, &hf_ecat_reg_dc_pdismstart, NO_SUBTREE_FILL}, { 0x09fc, 4, 1, &hf_ecat_reg_dc_pdismchg, NO_SUBTREE_FILL}, }; /* esc dissector */ static int dissect_esc_register(packet_info* pinfo, proto_tree *tree, tvbuff_t *tvb, gint offset, guint32 len, EcParserHDR* hdr, guint16 cnt) { guint i; gint r; gint res = -1; gint regOffset; gint read = 0; if (len > 0 ) { switch ( hdr->cmd ) { case EC_CMD_TYPE_APRD: case EC_CMD_TYPE_BRD: case EC_CMD_TYPE_FPRD: read = 1; /* Fall through */ case EC_CMD_TYPE_APWR: case EC_CMD_TYPE_APRW: case EC_CMD_TYPE_FPWR: case EC_CMD_TYPE_FPRW: case EC_CMD_TYPE_BWR: case EC_CMD_TYPE_BRW: case EC_CMD_TYPE_ARMW: case EC_CMD_TYPE_FRMW: for ( i=0; i<array_length(ecat_esc_registers); i++ ) { if ( hdr->anAddrUnion.a.ado + len< ecat_esc_registers[i].reg ) break; regOffset = ecat_esc_registers[i].reg; for ( r=0; r<ecat_esc_registers[i].repeat; r++ ) { if ( regOffset >= hdr->anAddrUnion.a.ado && regOffset+ecat_esc_registers[i].length <= (guint16)(hdr->anAddrUnion.a.ado + len) ) { if ( cnt > 0 || !read ) { if (ecat_esc_registers[i].dissect != NULL) { ecat_esc_registers[i].dissect(pinfo, tree, tvb, offset+(regOffset-hdr->anAddrUnion.a.ado)); } else if (ecat_esc_registers[i].bitmask_info != NULL) { proto_tree_add_bitmask(tree, tvb, offset+(regOffset-hdr->anAddrUnion.a.ado), *ecat_esc_registers[i].phf, *ecat_esc_registers[i].pett, ecat_esc_registers[i].bitmask_info, ENC_LITTLE_ENDIAN); } else { proto_tree_add_item(tree, *ecat_esc_registers[i].phf, tvb, offset+(regOffset-hdr->anAddrUnion.a.ado), ecat_esc_registers[i].length, ENC_LITTLE_ENDIAN); } } res = 0; } regOffset+=ecat_esc_registers[i].length; } } break; } } return res; } static void init_EcParserHDR(EcParserHDR* pHdr, tvbuff_t *tvb, gint offset) { pHdr->cmd = tvb_get_guint8(tvb, offset++); pHdr->idx = tvb_get_guint8(tvb, offset++); pHdr->anAddrUnion.a.adp = tvb_get_letohs(tvb, offset); offset+=2; pHdr->anAddrUnion.a.ado = tvb_get_letohs(tvb, offset); offset+=2; pHdr->len = tvb_get_letohs(tvb, offset); offset+=2; pHdr->intr = tvb_get_letohs(tvb, offset); } static void init_dc_measure(guint32* pDC, tvbuff_t *tvb, gint offset) { int i; for ( i=0; i<4; i++ ) { pDC[i] = tvb_get_letohl(tvb, offset); offset+=4; } } static guint16 get_wc(EcParserHDR* pHdr, tvbuff_t *tvb, gint offset) { return tvb_get_letohs(tvb, offset+EcParserHDR_Len+(pHdr->len&0x07ff)); } static guint16 get_cmd_len(EcParserHDR* pHdr) { return (EcParserHDR_Len+(pHdr->len&0x07ff)+2); /*Header + data + wc*/ } static void EcSummaryFormater(guint32 datalength, tvbuff_t *tvb, gint offset, char *szText, gint nMax) { guint nSub=0; guint nLen=0; guint8 nCmds[4]; guint nLens[4]; EcParserHDR ecFirst; EcParserHDR ecParser; guint suboffset=0; init_EcParserHDR(&ecFirst, tvb, offset); while ( suboffset < datalength ) { PEcParserHDR pEcParser; if ( nSub > 0 ) { init_EcParserHDR(&ecParser, tvb, offset+suboffset); pEcParser = &ecParser; } else pEcParser = &ecFirst; if ( nSub < 4 ) { nCmds[nSub] = pEcParser->cmd; nLens[nSub] = pEcParser->len&0x07ff; } nSub++; nLen += (pEcParser->len&0x07ff); /* bit 14 -- roundtrip */ if ( (pEcParser->len&0x8000) == 0 ) break; suboffset+=get_cmd_len(pEcParser); } if ( nSub == 1 ) { guint16 len = ecFirst.len&0x07ff; guint16 cnt = get_wc(&ecFirst, tvb, offset); snprintf ( szText, nMax, "'%s': Len: %d, Adp 0x%x, Ado 0x%x, Wc %d ", convertEcCmdToText(ecFirst.cmd, EcCmdShort), len, ecFirst.anAddrUnion.a.adp, ecFirst.anAddrUnion.a.ado, cnt ); } else if ( nSub == 2 ) { snprintf ( szText, nMax, "%d Cmds, '%s': len %d, '%s': len %d ", nSub, convertEcCmdToText(nCmds[0], EcCmdShort), nLens[0], convertEcCmdToText(nCmds[1], EcCmdShort), nLens[1]); } else if ( nSub == 3 ) { snprintf ( szText, nMax, "%d Cmds, '%s': len %d, '%s': len %d, '%s': len %d", nSub, convertEcCmdToText(nCmds[0], EcCmdShort), nLens[0], convertEcCmdToText(nCmds[1], EcCmdShort), nLens[1], convertEcCmdToText(nCmds[2], EcCmdShort), nLens[2]); } else if ( nSub == 4 ) { snprintf ( szText, nMax, "%d Cmds, '%s': len %d, '%s': len %d, '%s': len %d, '%s': len %d", nSub, convertEcCmdToText(nCmds[0], EcCmdShort), nLens[0], convertEcCmdToText(nCmds[1], EcCmdShort), nLens[1], convertEcCmdToText(nCmds[2], EcCmdShort), nLens[2], convertEcCmdToText(nCmds[3], EcCmdShort), nLens[3]); } else snprintf ( szText, nMax, "%d Cmds, SumLen %d, '%s'... ", nSub, nLen, convertEcCmdToText(ecFirst.cmd, EcCmdShort)); } static void EcCmdFormatter(guint8 cmd, char *szText, gint nMax) { gint idx=0; const gchar *szCmd = try_val_to_str_idx((guint32)cmd, EcCmdLong, &idx); if ( idx != -1 ) snprintf(szText, nMax, "Cmd : %d (%s)", cmd, szCmd); else snprintf(szText, nMax, "Cmd : %d (Unknown command)", cmd); } static void EcSubFormatter(tvbuff_t *tvb, gint offset, char *szText, gint nMax) { EcParserHDR ecParser; guint16 len, cnt; init_EcParserHDR(&ecParser, tvb, offset); len = ecParser.len&0x07ff; cnt = get_wc(&ecParser, tvb, offset); switch ( ecParser.cmd ) { case EC_CMD_TYPE_NOP: case EC_CMD_TYPE_APRD: case EC_CMD_TYPE_APWR: case EC_CMD_TYPE_APRW: case EC_CMD_TYPE_FPRD: case EC_CMD_TYPE_FPWR: case EC_CMD_TYPE_FPRW: case EC_CMD_TYPE_BRD: case EC_CMD_TYPE_BWR: case EC_CMD_TYPE_BRW: case EC_CMD_TYPE_ARMW: case EC_CMD_TYPE_FRMW: snprintf ( szText, nMax, "EtherCAT datagram: Cmd: '%s' (%d), Len: %d, Adp 0x%x, Ado 0x%x, Cnt %d", convertEcCmdToText(ecParser.cmd, EcCmdShort), ecParser.cmd, len, ecParser.anAddrUnion.a.adp, ecParser.anAddrUnion.a.ado, cnt); break; case EC_CMD_TYPE_LRD: case EC_CMD_TYPE_LWR: case EC_CMD_TYPE_LRW: snprintf ( szText, nMax, "EtherCAT datagram: Cmd: '%s' (%d), Len: %d, Addr 0x%x, Cnt %d", convertEcCmdToText(ecParser.cmd, EcCmdShort), ecParser.cmd, len, ecParser.anAddrUnion.addr, cnt); break; case EC_CMD_TYPE_EXT: snprintf ( szText, nMax, "EtherCAT datagram: Cmd: 'EXT' (%d), Len: %d", ecParser.cmd, len); break; default: snprintf ( szText, nMax, "EtherCAT datagram: Cmd: 'Unknown' (%d), Len: %d", ecParser.cmd, len); } } /* Ethercat Datagram */ static int dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { tvbuff_t *next_tvb; proto_item *ti, *aitem = NULL; proto_tree *ecat_datagrams_tree = NULL; guint offset = 0; char szText[200]; int nMax = sizeof(szText)-1; guint ecLength=0; guint subCount = 0; const guint datagram_length = tvb_captured_length(tvb); guint datagram_padding_bytes = 0; EcParserHDR ecHdr; heur_dtbl_entry_t *hdtbl_entry; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ECAT"); col_clear(pinfo->cinfo, COL_INFO); /* If the data portion of an EtherCAT datagram is less than 44 bytes, then it must have been padded with an additional n number of bytes to reach a total Ethernet frame length of 64 bytes (Ethernet header + Ethernet Data + FCS). Hence at least 44 bytes data shall always be available in any EtherCAT datagram. */ /* tvb_ensure_bytes_exist(tvb, offset, 44); this is not correct, because the frame might have been captured before the os added the padding bytes. E.g. in Windows the frames are captured on the protocol layer. When another protocol driver sends a frame this frame does not include the padding bytes. */ /* Count the length of the individual EtherCAT datagrams (sub datagrams) that are part of this EtherCAT frame. Stop counting when the current sub datagram header tells that there are no more sub datagrams or when there is no more data available in the PDU. */ do { init_EcParserHDR(&ecHdr, tvb, ecLength); ecLength += get_cmd_len(&ecHdr); } while ((ecLength < datagram_length) && (ecHdr.len & 0x8000)); /* Calculate the amount of padding data available in the PDU */ datagram_padding_bytes = datagram_length - ecLength; EcSummaryFormater(ecLength, tvb, offset, szText, nMax); col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { /* Create the EtherCAT datagram(s) subtree */ ti = proto_tree_add_item(tree, proto_ecat_datagram, tvb, 0, -1, ENC_NA); ecat_datagrams_tree = proto_item_add_subtree(ti, ett_ecat); proto_item_append_text(ti,": %s", szText); } /* Dissect all sub frames of this EtherCAT PDU */ do { proto_tree *ecat_datagram_tree = NULL, *ecat_header_tree = NULL, *ecat_dc_tree = NULL; proto_item *hidden_item; guint32 subsize; guint32 suboffset; guint32 len; guint16 cnt; ETHERCAT_MBOX_HEADER mbox; suboffset = offset; init_EcParserHDR(&ecHdr, tvb, suboffset); subsize = get_cmd_len(&ecHdr); len = ecHdr.len & 0x07ff; cnt = get_wc(&ecHdr, tvb, suboffset); if( tree ) { /* Create the sub tree for the current datagram */ EcSubFormatter(tvb, suboffset, szText, nMax); ecat_datagram_tree = proto_tree_add_subtree(ecat_datagrams_tree, tvb, suboffset, subsize, ett_ecat_datagram_subtree, NULL, szText); /* Create a subtree placeholder for the Header */ ecat_header_tree = proto_tree_add_subtree(ecat_datagram_tree, tvb, offset, EcParserHDR_Len, ett_ecat_header, NULL, "Header"); EcCmdFormatter(ecHdr.cmd, szText, nMax); aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_cmd, tvb, suboffset, 1, ENC_LITTLE_ENDIAN); proto_item_set_text(aitem, "%s", szText); if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_sub_cmd[subCount], tvb, suboffset, 1, ENC_LITTLE_ENDIAN); proto_item_set_hidden(aitem); } suboffset+=1; proto_tree_add_item(ecat_header_tree, hf_ecat_idx, tvb, suboffset, 1, ENC_LITTLE_ENDIAN); if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_sub_idx[subCount], tvb, suboffset, 1, ENC_LITTLE_ENDIAN); proto_item_set_hidden(aitem); } suboffset+=1; switch ( ecHdr.cmd ) { case 10: case 11: case 12: proto_tree_add_item(ecat_header_tree, hf_ecat_lad, tvb, suboffset, 4, ENC_LITTLE_ENDIAN); if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_sub_lad[subCount], tvb, suboffset, 4, ENC_LITTLE_ENDIAN); proto_item_set_hidden(aitem); } suboffset+=4; break; default: proto_tree_add_item(ecat_header_tree, hf_ecat_adp, tvb, suboffset, 2, ENC_LITTLE_ENDIAN); if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_sub_adp[subCount], tvb, suboffset, 2, ENC_LITTLE_ENDIAN); proto_item_set_hidden(aitem); } suboffset+=2; proto_tree_add_item(ecat_header_tree, hf_ecat_ado, tvb, suboffset, 2, ENC_LITTLE_ENDIAN); if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_sub_ado[subCount], tvb, suboffset, 2, ENC_LITTLE_ENDIAN); proto_item_set_hidden(aitem); } suboffset+=2; } { proto_tree *length_sub_tree; /* Add information about the length field (11 bit length, 3 bits reserved, 1 bit circulating frame and 1 bit more in a sub tree */ length_sub_tree = proto_tree_add_subtree_format(ecat_header_tree, tvb, suboffset, 2, ett_ecat_length, NULL, "Length : %d (0x%x) - %s - %s", len, len, ecHdr.len & 0x4000 ? "Roundtrip" : "No Roundtrip", ecHdr.len & 0x8000 ? "More Follows..." : "Last Sub Command"); proto_tree_add_item(length_sub_tree, hf_ecat_length_len, tvb, suboffset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(length_sub_tree, hf_ecat_length_r, tvb, suboffset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(length_sub_tree, hf_ecat_length_c, tvb, suboffset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(length_sub_tree, hf_ecat_length_m, tvb, suboffset, 2, ENC_LITTLE_ENDIAN); suboffset+=2; } proto_tree_add_item(ecat_header_tree, hf_ecat_int, tvb, suboffset, 2, ENC_LITTLE_ENDIAN); suboffset+=2; } else { suboffset+=EcParserHDR_Len; } if ( (ecHdr.cmd == 1 || ecHdr.cmd == 4) && ecHdr.anAddrUnion.a.ado == 0x900 && ecHdr.len >= 16 && cnt > 0 ) { guint32 pDC[4]; init_dc_measure(pDC, tvb, suboffset); ecat_dc_tree = proto_tree_add_subtree(ecat_datagram_tree, tvb, suboffset, len, ett_ecat_dc, NULL, "Dc"); dissect_esc_register(pinfo, ecat_dc_tree, tvb, suboffset, len, &ecHdr, cnt); if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_datagram_tree, hf_ecat_sub_data[subCount], tvb, offset + EcParserHDR_Len, len, ENC_NA); proto_item_set_hidden(aitem); } if ( pDC[3] != 0 ) { proto_tree_add_uint(ecat_dc_tree, hf_ecat_dc_diff_da, tvb, suboffset, 4, pDC[3] - pDC[0]); if( subCount < 10 ){ hidden_item = proto_tree_add_uint(ecat_dc_tree, hf_ecat_sub_dc_diff_da[subCount], tvb, suboffset, 4, pDC[3] - pDC[0]); proto_item_set_hidden(hidden_item); } if ( pDC[1] != 0 ) { proto_tree_add_uint(ecat_dc_tree, hf_ecat_dc_diff_bd, tvb, suboffset, 4, pDC[1] - pDC[3]); if( subCount < 10 ){ hidden_item = proto_tree_add_uint(ecat_dc_tree, hf_ecat_sub_dc_diff_bd[subCount], tvb, suboffset, 4, pDC[1] - pDC[3]); proto_item_set_hidden(hidden_item); } } else if ( pDC[2] != 0 ) { proto_tree_add_uint(ecat_dc_tree, hf_ecat_dc_diff_cd, tvb, suboffset, 4, pDC[2] - pDC[3]); if( subCount < 10 ){ hidden_item = proto_tree_add_uint(ecat_dc_tree, hf_ecat_sub_dc_diff_cd[subCount], tvb, suboffset, 4, pDC[2] - pDC[3]); proto_item_set_hidden(hidden_item); } } } if ( pDC[1] != 0 ) { proto_tree_add_uint(ecat_dc_tree, hf_ecat_dc_diff_ba, tvb, suboffset, 4, pDC[1] - pDC[0]); if( subCount < 10 ){ hidden_item = proto_tree_add_uint(ecat_dc_tree, hf_ecat_sub_dc_diff_ba[subCount], tvb, suboffset, 4, pDC[1] - pDC[0]); proto_item_set_hidden(hidden_item); } if ( pDC[2] != 0 ) { proto_tree_add_uint(ecat_dc_tree, hf_ecat_dc_diff_cb, tvb, suboffset, 4, pDC[2] - pDC[1]); if( subCount < 10 ){ hidden_item = proto_tree_add_uint(ecat_dc_tree, hf_ecat_sub_dc_diff_cb[subCount], tvb, suboffset, 4, pDC[2] - pDC[1]); proto_item_set_hidden(hidden_item); } } } else if ( pDC[2] != 0 ) { proto_tree_add_uint(ecat_dc_tree, hf_ecat_dc_diff_ca, tvb, suboffset, 4, pDC[2] - pDC[0]); if( subCount < 10 ){ hidden_item = proto_tree_add_uint(ecat_dc_tree, hf_ecat_sub_dc_diff_ca[subCount], tvb, suboffset, 4, pDC[2] - pDC[0]); proto_item_set_hidden(hidden_item); } } } else if (dissect_esc_register(pinfo, ecat_datagram_tree, tvb, suboffset, len, &ecHdr, cnt) != 0) { guint startOfData = offset + EcParserHDR_Len; guint dataLength = len; if ( len >= ETHERCAT_MBOX_HEADER_LEN && ((ecHdr.cmd==EC_CMD_TYPE_FPWR || ecHdr.cmd == EC_CMD_TYPE_APWR || ecHdr.cmd == EC_CMD_TYPE_APRW || ecHdr.cmd == EC_CMD_TYPE_FPRW) || ((ecHdr.cmd==EC_CMD_TYPE_FPRD || ecHdr.cmd==EC_CMD_TYPE_APRD) && cnt==1) ) && ecHdr.anAddrUnion.a.ado>=0x1000 ) { init_mbx_header(&mbox, tvb, startOfData); switch ( mbox.aControlUnion.v.Type ) { case ETHERCAT_MBOX_TYPE_EOE: case ETHERCAT_MBOX_TYPE_ADS: case ETHERCAT_MBOX_TYPE_FOE: case ETHERCAT_MBOX_TYPE_COE: case ETHERCAT_MBOX_TYPE_SOE: if ( mbox.Length <= 1500 ) { guint MBoxLength = mbox.Length + ETHERCAT_MBOX_HEADER_LEN; if ( MBoxLength > len ) MBoxLength = len; next_tvb = tvb_new_subset_length(tvb, startOfData, MBoxLength); call_dissector_only(ecat_mailbox_handle, next_tvb, pinfo, ecat_datagram_tree, NULL); startOfData += MBoxLength; dataLength -= MBoxLength; } break; } } if( dataLength > 0 ) { /* Allow sub dissectors to have a chance with this data */ if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree, &hdtbl_entry, NULL)) { /* No sub dissector did recognize this data, dissect it as data only */ proto_tree_add_item(ecat_datagram_tree, hf_ecat_data, tvb, startOfData, dataLength, ENC_NA); } if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_datagram_tree, hf_ecat_sub_data[subCount], tvb, startOfData, dataLength, ENC_NA); proto_item_set_hidden(aitem); } } } if( tree ) { proto_tree_add_item(ecat_datagram_tree, hf_ecat_cnt, tvb, offset + EcParserHDR_Len + len , 2, ENC_LITTLE_ENDIAN); if( subCount < 10 ){ aitem = proto_tree_add_item(ecat_datagram_tree, hf_ecat_sub_cnt[subCount], tvb, offset + EcParserHDR_Len + len , 2, ENC_LITTLE_ENDIAN); proto_item_set_hidden(aitem); } } offset+=subsize; subCount++; } while((offset < datagram_length) && (ecHdr.len & 0x8000)); /* Add information that states which portion of the PDU that is pad bytes. These are added just to get an Ethernet frame size of at least 64 bytes, which is required by the protocol specification */ if(datagram_padding_bytes > 0) { proto_tree_add_item(tree, hf_ecat_padding, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA); } return tvb_captured_length(tvb); } void proto_register_ecat(void) { static hf_register_info hf[] = { { &hf_ecat_sub, { "EtherCAT Frame", "ecat.sub", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ecat_header, { "header", "ecat.header", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #endif { &hf_ecat_sub_data[0], { "Data", "ecat.sub1.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[1], { "Data", "ecat.sub2.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[2], { "Data", "ecat.sub3.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[3], { "Data", "ecat.sub4.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[4], { "Data", "ecat.sub5.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[5], { "Data", "ecat.sub6.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[6], { "Data", "ecat.sub7.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[7], { "Data", "ecat.sub8.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[8], { "Data", "ecat.sub9.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_data[9], { "Data", "ecat.sub10.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_data, { "Data", "ecat.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_cnt, { "Working Cnt", "ecat.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, "The working counter is increased once for each addressed device if at least one byte/bit of the data was successfully read and/or written by that device, it is increased once for every operation made by that device - read/write/read and write", HFILL } }, { &hf_ecat_sub_cnt[0], { "Working Cnt", "ecat.sub1.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[1], { "Working Cnt", "ecat.sub2.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[2], { "Working Cnt", "ecat.sub3.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[3], { "Working Cnt", "ecat.sub4.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[4], { "Working Cnt", "ecat.sub5.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[5], { "Working Cnt", "ecat.sub6.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[6], { "Working Cnt", "ecat.sub7.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[7], { "Working Cnt", "ecat.sub8.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[8], { "Working Cnt", "ecat.sub9.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_cnt[9], { "Working Cnt", "ecat.sub10.cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_cmd, { "Command", "ecat.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[0], { "Command", "ecat.sub1.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[1], { "Command", "ecat.sub2.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[2], { "Command", "ecat.sub3.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[3], { "Command", "ecat.sub4.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[4], { "Command", "ecat.sub5.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[5], { "Command", "ecat.sub6.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[6], { "Command", "ecat.sub7.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[7], { "Command", "ecat.sub8.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[8], { "Command", "ecat.sub9.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_sub_cmd[9], { "Command", "ecat.sub10.cmd", FT_UINT8, BASE_HEX, VALS(EcCmdShort), 0x0, NULL, HFILL } }, { &hf_ecat_idx, { "Index", "ecat.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[0], { "Index", "ecat.sub1.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[1], { "Index", "ecat.sub2.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[2], { "Index", "ecat.sub3.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[3], { "Index", "ecat.sub4.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[4], { "Index", "ecat.sub5.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[5], { "Index", "ecat.sub6.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[6], { "Index", "ecat.sub7.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[7], { "Index", "ecat.sub8.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[8], { "Index", "ecat.sub9.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_idx[9], { "Index", "ecat.sub10.idx", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_adp, { "Slave Addr", "ecat.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[0], { "Slave Addr", "ecat.sub1.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[1], { "Slave Addr", "ecat.sub2.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[2], { "Slave Addr", "ecat.sub3.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[3], { "Slave Addr", "ecat.sub4.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[4], { "Slave Addr", "ecat.sub5.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[5], { "Slave Addr", "ecat.sub6.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[6], { "Slave Addr", "ecat.sub7.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[7], { "Slave Addr", "ecat.sub8.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[8], { "Slave Addr", "ecat.sub9.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_adp[9], { "Slave Addr", "ecat.sub10.adp", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_ado, { "Offset Addr", "ecat.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[0], { "Offset Addr", "ecat.sub1.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[1], { "Offset Addr", "ecat.sub2.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[2], { "Offset Addr", "ecat.sub3.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[3], { "Offset Addr", "ecat.sub4.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[4], { "Offset Addr", "ecat.sub5.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[5], { "Offset Addr", "ecat.sub6.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[6], { "Offset Addr", "ecat.sub7.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[7], { "Offset Addr", "ecat.sub8.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[8], { "Offset Addr", "ecat.sub9.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_ado[9], { "Offset Addr", "ecat.sub10.ado", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_lad, { "Log Addr", "ecat.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[0], { "Log Addr", "ecat.sub1.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[1], { "Log Addr", "ecat.sub2.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[2], { "Log Addr", "ecat.sub3.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[3], { "Log Addr", "ecat.sub4.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[4], { "Log Addr", "ecat.sub5.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[5], { "Log Addr", "ecat.sub6.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[6], { "Log Addr", "ecat.sub7.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[7], { "Log Addr", "ecat.sub8.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[8], { "Log Addr", "ecat.sub9.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_lad[9], { "Log Addr", "ecat.sub10.lad", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_ecat_len, { "Length", "ecat.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_ecat_int, { "Interrupt", "ecat.int", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_dc_diff_da, { "DC D-A", "ecat.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_dc_diff_bd, { "DC B-D", "ecat.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_dc_diff_cb, { "DC C-B", "ecat.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_dc_diff_cd, { "DC C-D", "ecat.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_dc_diff_ba, { "DC B-A", "ecat.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_dc_diff_ca, { "DC C-A", "ecat.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[0], { "DC D-A", "ecat.sub1.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[1], { "DC D-A", "ecat.sub2.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[2], { "DC D-A", "ecat.sub3.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[3], { "DC D-A", "ecat.sub4.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[4], { "DC D-A", "ecat.sub5.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[5], { "DC D-A", "ecat.sub6.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[6], { "DC D-A", "ecat.sub7.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[7], { "DC D-A", "ecat.sub8.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[8], { "DC D-A", "ecat.sub9.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_da[9], { "DC D-A", "ecat.sub10.dc.dif.da", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[0], { "DC B-C", "ecat.sub1.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[1], { "DC B-C", "ecat.sub2.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[2], { "DC B-C", "ecat.sub3.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[3], { "DC B-C", "ecat.sub4.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[4], { "DC B-C", "ecat.sub5.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[5], { "DC B-C", "ecat.sub6.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[6], { "DC B-C", "ecat.sub7.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[7], { "DC B-C", "ecat.sub8.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[8], { "DC B-C", "ecat.sub9.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_bd[9], { "DC B-D", "ecat.sub10.dc.dif.bd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[0], { "DC C-B", "ecat.sub1.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[1], { "DC C-B", "ecat.sub2.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[2], { "DC C-B", "ecat.sub3.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[3], { "DC C-B", "ecat.sub4.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[4], { "DC C-B", "ecat.sub5.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[5], { "DC C-B", "ecat.sub6.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[6], { "DC C-B", "ecat.sub7.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[7], { "DC C-B", "ecat.sub8.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[8], { "DC C-B", "ecat.sub9.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cb[9], { "DC C-B", "ecat.sub10.dc.dif.cb", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[0], { "DC C-D", "ecat.sub1.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[1], { "DC C-D", "ecat.sub2.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[2], { "DC C-D", "ecat.sub3.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[3], { "DC C-D", "ecat.sub4.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[4], { "DC C-D", "ecat.sub5.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[5], { "DC C-D", "ecat.sub6.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[6], { "DC C-D", "ecat.sub7.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[7], { "DC C-D", "ecat.sub8.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[8], { "DC C-D", "ecat.sub9.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_cd[9], { "DC C-D", "ecat.sub10.dc.dif.cd", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[0], { "DC B-A", "ecat.sub1.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[1], { "DC B-A", "ecat.sub2.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[2], { "DC B-A", "ecat.sub3.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[3], { "DC B-A", "ecat.sub4.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[4], { "DC B-A", "ecat.sub5.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[5], { "DC B-A", "ecat.sub6.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[6], { "DC B-A", "ecat.sub7.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[7], { "DC B-A", "ecat.sub8.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[8], { "DC B-A", "ecat.sub9.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ba[9], { "DC B-A", "ecat.sub10.dc.dif.ba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[0], { "DC C-A", "ecat.sub1.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[1], { "DC C-A", "ecat.sub2.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[2], { "DC C-A", "ecat.sub3.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[3], { "DC C-A", "ecat.sub4.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[4], { "DC C-A", "ecat.sub5.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[5], { "DC C-A", "ecat.sub6.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[6], { "DC C-A", "ecat.sub7.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[7], { "DC C-A", "ecat.sub8.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[8], { "DC C-A", "ecat.sub9.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_sub_dc_diff_ca[9], { "DC C-A", "ecat.sub10.dc.dif.ca", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_length_len, { "Length", "ecat.subframe.length", FT_UINT16, BASE_DEC, NULL, 0x07ff, NULL, HFILL} }, { &hf_ecat_length_r, { "Reserved", "ecat.subframe.reserved", FT_UINT16, BASE_DEC, VALS(ecat_subframe_reserved_vals), 0x3800, NULL, HFILL} }, { &hf_ecat_length_c, { "Round trip", "ecat.subframe.circulating", FT_BOOLEAN, 16, TFS(&tfs_ecat_subframe_circulating_vals), 0x4000, NULL, HFILL} }, { &hf_ecat_length_m, { "Last indicator", "ecat.subframe.more", FT_BOOLEAN, 16, TFS(&tfs_ecat_subframe_more_vals), 0x8000, NULL, HFILL} }, { &hf_ecat_padding, { "Pad bytes", "ecat.subframe.pad_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} }, /* Registers */ { &hf_ecat_reg_revision, {"ESC Revision (0x0)", "ecat.reg.revision", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_type, {"ESC Type (0x1)", "ecat.reg.type", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_build, {"ESC Build (0x2)", "ecat.reg.build", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_fmmucnt, {"ESC FMMU Cnt (0x4)", "ecat.reg.fmmucnt", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_smcnt, {"ESC SM Cnt (0x5)", "ecat.reg.smcnt", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_ports, {"ESC Ports (0x6)", "ecat.reg.ports", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_dpram, {"ESC DPRAM (0x7)", "ecat.reg.dpram", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_features, {"ESC Features (0x8)", "ecat.reg.features", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_esc_features_fmmurestrict, {"FMMU bytewise restriction", "ecat.reg.features.fmmurestrict", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, { &hf_ecat_reg_esc_features_smaddrrestrict, {"SM addressing restriction", "ecat.reg.features.smaddrrestrict", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0002, NULL, HFILL } }, { &hf_ecat_reg_esc_features_dcsupport, {"DC support", "ecat.reg.features.dcsupport", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0004, NULL, HFILL } }, { &hf_ecat_reg_esc_features_dc64support, {"DC 64 bit support", "ecat.reg.features.dc64support", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0008, NULL, HFILL } }, { &hf_ecat_reg_esc_features_ebuslowjitter, {"E-Bus low jitter", "ecat.reg.features.ebuslowjitter", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0010, NULL, HFILL } }, { &hf_ecat_reg_esc_features_ebusextlinkdetect, {"E-Bus ext. link detection", "ecat.reg.features.ebusextlinkdetect", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0020, NULL, HFILL } }, { &hf_ecat_reg_esc_features_miiextlinkdetect, {"MII ext. link detection", "ecat.reg.features.miiextlinkdetect", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0040, NULL, HFILL } }, { &hf_ecat_reg_esc_features_crcext, {"CRC ext. detection", "ecat.reg.features.crcext", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0080, NULL, HFILL } }, { &hf_ecat_reg_physaddr, {"Phys Addr (0x10)", "ecat.reg.physaddr", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_physaddr2, {"Phys Addr 2nd (0x12)", "ecat.reg.physaddr2", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dlctrl1, {"ESC Ctrl (0x100)", "ecat.reg.dlctrl1", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dlctrl1_killnonecat, {"Kill non EtherCAT frames", "ecat.reg.dlctrl1.killnonecat", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dlctrl1_port0extlinkdetect, {"Port 0 ext. link detection", "ecat.reg.dlctrl1.port0extlinkdetect", FT_BOOLEAN, 8, TFS(&tfs_local_disabled_enabled), 0x10, NULL, HFILL } }, { &hf_ecat_reg_dlctrl1_port1extlinkdetect, {"Port 1 ext. link detection", "ecat.reg.dlctrl1.port1extlinkdetect", FT_BOOLEAN, 8, TFS(&tfs_local_disabled_enabled), 0x20, NULL, HFILL } }, { &hf_ecat_reg_dlctrl1_port2extlinkdetect, {"Port 2 ext. link detection", "ecat.reg.dlctrl1.port2extlinkdetect", FT_BOOLEAN, 8, TFS(&tfs_local_disabled_enabled), 0x40, NULL, HFILL } }, { &hf_ecat_reg_dlctrl1_port3extlinkdetect, {"Port 3 ext. link detection", "ecat.reg.dlctrl1.port3extlinkdetect", FT_BOOLEAN, 8, TFS(&tfs_local_disabled_enabled), 0x80, NULL, HFILL } }, { &hf_ecat_reg_dlctrl2, {"ESC Ctrl (0x101)", "ecat.reg.dlcrtl2", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dlctrl2_port0, {"Port 0", "ecat.reg.dlcrtl2.port0", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_101), 0x03, NULL, HFILL } }, { &hf_ecat_reg_dlctrl2_port1, {"Port 1", "ecat.reg.dlcrtl2.port1", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_101), 0x0C, NULL, HFILL } }, { &hf_ecat_reg_dlctrl2_port2, {"Port 2", "ecat.reg.dlcrtl2.port2", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_101), 0x30, NULL, HFILL } }, { &hf_ecat_reg_dlctrl2_port3, {"Port 3", "ecat.reg.dlcrtl2.port3", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_101), 0xC0, NULL, HFILL } }, { &hf_ecat_reg_dlctrl3, {"ESC Ctrl (0x102)", "ecat.reg.dlctrl3", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dlctrl3_fifosize, {"Fifo size", "ecat.reg.dlctrl3.fifosize", FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL } }, { &hf_ecat_reg_dlctrl3_lowebusjit, {"Low E-Bus jitter", "ecat.reg.dlctrl3.lowebusjit", FT_BOOLEAN, 8, TFS(&tfs_local_disabled_enabled), 0x08, NULL, HFILL } }, { &hf_ecat_reg_dlctrl4, {"ESC Ctrl (0x103)", "ecat.reg.dlctrl4", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dlctrl4_2ndaddress, {"Second address", "ecat.reg.dlctrl4.2ndaddress", FT_BOOLEAN, 8, TFS(&tfs_local_disabled_enabled), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1, {"ESC Status (0x110)", "ecat.reg.dlstatus1", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1_operation, {"Operation", "ecat.reg.dlstatus1.operation", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1_pdiwatchdog, {"PDI watchdog", "ecat.reg.dlstatus1.pdiwatchdog", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_watchdog), 0x02, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1_enhlinkdetect, {"Enh. Link Detection", "ecat.reg.dlstatus1.enhlinkdetect", FT_BOOLEAN, 8, TFS(&tfs_local_disabled_enabled), 0x04, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1_physlink_port0, {"Physical link Port 0", "ecat.reg.dlstatus1.physlink.port0", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x10, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1_physlink_port1, {"Physical link Port 1", "ecat.reg.dlstatus1.physlink.port1", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x20, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1_physlink_port2, {"Physical link Port 2", "ecat.reg.dlstatus1.physlink.port2", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x40, NULL, HFILL } }, { &hf_ecat_reg_dlstatus1_physlink_port3, {"Physical link Port 3", "ecat.reg.dlstatus1.physlink.port3", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x80, NULL, HFILL } }, { &hf_ecat_reg_dlstatus2, {"ESC Status (0x111)", "ecat.reg.dlstatus2", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dlstatus2_port0, {"Port 0", "ecat.reg.dlstatus2.port0", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_111), 0x03, NULL, HFILL } }, { &hf_ecat_reg_dlstatus2_port1, {"Port 1", "ecat.reg.dlstatus2.port1", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_111), 0x0C, NULL, HFILL } }, { &hf_ecat_reg_dlstatus2_port2, {"Port 2", "ecat.reg.dlstatus2.port2", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_111), 0x30, NULL, HFILL } }, { &hf_ecat_reg_dlstatus2_port3, {"Port 3", "ecat.reg.dlstatus2.port3", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_111), 0xC0, NULL, HFILL } }, { &hf_ecat_reg_regprotect, {"Write Register Protect (0x20)", "ecat.reg.regprotect", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_accessprotect, {"Access Protect (0x30)", "ecat.reg.accessprotect", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_resetecat, {"ESC reset Ecat (0x40)", "ecat.reg.resetecat", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_resetpdi, {"ESC reset Pdi (0x41)", "ecat.reg.resetpdi", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_regphysrwoffs, {"Phys. RW Offset (0x108)", "ecat.regphysrwoffs", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_alctrl, {"AL Ctrl (0x120)", "ecat.reg.alctrl", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_alctrl_ctrl, {"Al Ctrl", "ecat.reg.alctrl.ctrl", FT_UINT16, BASE_HEX, VALS(vals_esc_reg_120), 0x0f, NULL, HFILL } }, { &hf_ecat_reg_alctrl_errack, {"Error Ack", "ecat.reg.alctrl.errack", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0010, NULL, HFILL } }, { &hf_ecat_reg_alctrl_id, {"Id", "ecat.reg.alctrl.id", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0020, NULL, HFILL } }, { &hf_ecat_reg_alstatus, {"AL Status (0x130)", "ecat.reg.alstatus", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_alstatus_status, {"Al Status", "ecat.reg.alstatus.status", FT_UINT16, BASE_HEX, VALS(vals_esc_reg_120), 0x000f, NULL, HFILL } }, { &hf_ecat_reg_alstatus_err, {"Error", "ecat.reg.alstatus.err", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0010, NULL, HFILL } }, { &hf_ecat_reg_alstatus_id, {"Id", "ecat.reg.alstatus.id", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0020, NULL, HFILL } }, { &hf_ecat_reg_alstatuscode, {"AL Status Code (0x134)", "ecat.reg.alstatuscode", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_pdictrl1, {"PDI Ctrl (0x140)", "ecat.reg.pdictrl1", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_pdictrl1_pdi, {"PDI", "ecat.reg.pdictrl1.pdi", FT_UINT8, BASE_HEX, VALS(vals_esc_reg_140), 0xff, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2, {"PDI Ctrl (0x141)", "ecat.reg.pdictrl2", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_devemul, {"Device emulation", "ecat.reg.pdictrl2.devemul", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_enhlnkdetect, {"Enhanced link detection", "ecat.reg.pdictrl2.enhlnkdetect", FT_BOOLEAN, 8, TFS(&tfs_local_disable_enable), 0x02, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_dcsyncout, {"Enable DC sync out", "ecat.reg.pdictrl2.dcsyncout", FT_BOOLEAN, 8, TFS(&tfs_local_disable_enable), 0x04, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_dcsyncin, {"Enable DC latch in", "ecat.reg.pdictrl2.dcsyncin", FT_BOOLEAN, 8, TFS(&tfs_local_disable_enable), 0x08, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_enhlnkdetect0, {"Enhanced link detection port 0", "ecat.reg.pdictrl2.enhlnkdetect0", FT_BOOLEAN, 8, TFS(&tfs_local_disable_enable), 0x10, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_enhlnkdetect1, {"Enhanced link detection port 1", "ecat.reg.pdictrl2.enhlnkdetect1", FT_BOOLEAN, 8, TFS(&tfs_local_disable_enable), 0x20, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_enhlnkdetect2, {"Enhanced link detection port 2", "ecat.reg.pdictrl2.enhlnkdetect2", FT_BOOLEAN, 8, TFS(&tfs_local_disable_enable), 0x40, NULL, HFILL } }, { &hf_ecat_reg_pdictrl2_enhlnkdetect3, {"Enhanced link detection port 3", "ecat.reg.pdictrl2.enhlnkdetect3", FT_BOOLEAN, 8, TFS(&tfs_local_disable_enable), 0x80, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask, {"ECAT IRQ Mask (0x200)", "ecat.reg.irqmask.ecat_mask", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_latchevt, {"Latch event", "ecat.reg.irqmask.ecat_mask.latchevt", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_escstatevt, {"ESC Status event", "ecat.reg.irqmask.ecat_mask.escstatevt", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0004, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_alstatevt, {"AL Status event", "ecat.reg.irqmask.ecat_mask.alstatevt", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0008, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm0irq, {"SM 0 IRQ", "ecat.reg.irqmask.ecat_mask.sm0irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm1irq, {"SM 1 IRQ", "ecat.reg.irqmask.ecat_mask.sm1irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm2irq, {"SM 2 IRQ", "ecat.reg.irqmask.ecat_mask.sm2irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0400, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm3irq, {"SM 3 IRQ", "ecat.reg.irqmask.ecat_mask.sm3irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0800, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm4irq, {"SM 4 IRQ", "ecat.reg.irqmask.ecat_mask.sm4irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x1000, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm5irq, {"SM 5 IRQ", "ecat.reg.irqmask.ecat_mask.sm5irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x2000, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm6irq, {"SM 6 IRQ", "ecat.reg.irqmask.ecat_mask.sm6irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x4000, NULL, HFILL } }, { &hf_ecat_reg_ecat_mask_sm7irq, {"SM 7 IRQ", "ecat.reg.irqmask.ecat_mask.sm7irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x8000, NULL, HFILL } }, { &hf_ecat_reg_pdiL, {"PDI IRQ Mask L (0x204)", "ecat.reg.irqmask.pdiL", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_pdiL_alctrl, {"AL Ctrl", "ecat.reg.irqmask.pdiL.alctrl", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x1, NULL, HFILL } }, { &hf_ecat_reg_pdiL_latchin, {"Latch input", "ecat.reg.irqmask.pdiL.latchin", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0002, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sync0, {"SYNC 0", "ecat.reg.irqmask.pdiL.sync0", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0004, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sync1, {"SYNC 1", "ecat.reg.irqmask.pdiL.sync1", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0008, NULL, HFILL } }, { &hf_ecat_reg_pdiL_smchg, {"SM changed", "ecat.reg.irqmask.pdiL.smchg", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0010, NULL, HFILL } }, { &hf_ecat_reg_pdiL_eepromcmdpen, {"EEPROM command pending", "ecat.reg.irqmask.pdiL.eepromcmdpen", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0020, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm0, {"SM 0", "ecat.reg.irqmask.pdiL.sm0", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm1, {"SM 1", "ecat.reg.irqmask.pdiL.sm1", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm2, {"SM 2", "ecat.reg.irqmask.pdiL.sm2", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0400, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm3, {"SM 3", "ecat.reg.irqmask.pdiL.sm3", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0800, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm4, {"SM 4", "ecat.reg.irqmask.pdiL.sm4", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x1000, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm5, {"SM 5", "ecat.reg.irqmask.pdiL.sm5", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x2000, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm6, {"SM 6", "ecat.reg.irqmask.pdiL.sm6", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x4000, NULL, HFILL } }, { &hf_ecat_reg_pdiL_sm7, {"SM 7", "ecat.reg.irqmask.pdiL.sm7", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x8000, NULL, HFILL } }, { &hf_ecat_reg_pdiH, {"PDI IRQ Mask H (0x206)", "ecat.reg.irqmask.pdiH", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_ecat, {"ECAT IRQ (0x210)", "ecat.reg.irq.ecat", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_ecat_latchevt, {"Latch event", "ecat.reg.irq.ecat.latchevt", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, { &hf_ecat_reg_ecat_escstatevt, {"ESC Status event", "ecat.reg.irq.ecat.escstatevt", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0004, NULL, HFILL } }, { &hf_ecat_reg_ecat_alstatevt, {"AL Status event", "ecat.reg.irq.ecat.alstatevt", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0008, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm0irq, {"SM 0 IRQ", "ecat.reg.irq.ecat.sm0irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm1irq, {"SM 1 IRQ", "ecat.reg.irq.ecat.sm1irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm2irq, {"SM 2 IRQ", "ecat.reg.irq.ecat.sm2irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0400, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm3irq, {"SM 3 IRQ", "ecat.reg.irq.ecat.sm3irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0800, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm4irq, {"SM 4 IRQ", "ecat.reg.irq.ecat.sm4irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x1000, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm5irq, {"SM 5 IRQ", "ecat.reg.irq.ecat.sm5irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x2000, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm6irq, {"SM 6 IRQ", "ecat.reg.irq.ecat.sm6irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x4000, NULL, HFILL } }, { &hf_ecat_reg_ecat_sm7irq, {"SM 7 IRQ", "ecat.reg.irq.ecat.sm7irq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x8000, NULL, HFILL } }, { &hf_ecat_reg_pdi1, {"PDI IRQ 1 (0x220)", "ecat.reg.irq.pdi1", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_pdi1_alctrl, {"AL Ctrl", "ecat.reg.irq.pdi1.alctrl", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, { &hf_ecat_reg_pdi1_latchin, {"Latch input", "ecat.reg.irq.pdi1.latchin", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0002, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sync0, {"SYNC 0", "ecat.reg.irq.pdi1.sync0", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0004, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sync1, {"SYNC 1", "ecat.reg.irq.pdi1.sync1", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0008, NULL, HFILL } }, { &hf_ecat_reg_pdi1_smchg, {"SM changed", "ecat.reg.irq.pdi1.smchg", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0010, NULL, HFILL } }, { &hf_ecat_reg_pdi1_eepromcmdpen, {"EEPROM command pending", "ecat.reg.irq.pdi1.eepromcmdpen", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0020, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm0, {"SM 0", "ecat.reg.irq.pdi1.sm0", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm1, {"SM 1", "ecat.reg.irq.pdi1.sm1", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm2, {"SM 2", "ecat.reg.irq.pdi1.sm2", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0400, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm3, {"SM 3", "ecat.reg.irq.pdi1.sm3", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0800, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm4, {"SM 4", "ecat.reg.irq.pdi1.sm4", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x1000, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm5, {"SM 5", "ecat.reg.irq.pdi1.sm5", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x2000, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm6, {"SM 6", "ecat.reg.irq.pdi1.sm6", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x4000, NULL, HFILL } }, { &hf_ecat_reg_pdi1_sm7, {"SM 7", "ecat.reg.irq.pdi1.sm7", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x8000, NULL, HFILL } }, { &hf_ecat_reg_pdi2, {"PDI IRQ 2 (0x222)", "ecat.reg.irq.pdi2", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc0, {"CRC 0 (0x300)", "ecat.reg.crc0", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc1, {"CRC 1 (0x302)", "ecat.reg.crc1", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc2, {"CRC 2 (0x304)", "ecat.reg.crc2", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc3, {"CRC 3 (0x306)", "ecat.reg.crc3", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc0_frame, {"Invalid frame", "ecat.reg.crc0.frame", FT_UINT16, BASE_HEX, NULL, 0x00ff, NULL, HFILL } }, { &hf_ecat_reg_crc0_rx, {"RX error", "ecat.reg.crc0.rx", FT_UINT16, BASE_HEX, NULL, 0xff00, NULL, HFILL } }, { &hf_ecat_reg_crc1_frame, {"Invalid frame", "ecat.reg.crc1.frame", FT_UINT16, BASE_HEX, NULL, 0x00ff, NULL, HFILL } }, { &hf_ecat_reg_crc1_rx, {"RX error", "ecat.reg.crc1.rx", FT_UINT16, BASE_HEX, NULL, 0xff00, NULL, HFILL } }, { &hf_ecat_reg_crc2_frame, {"Invalid frame", "ecat.reg.crc2.frame", FT_UINT16, BASE_HEX, NULL, 0x00ff, NULL, HFILL } }, { &hf_ecat_reg_crc2_rx, {"RX error", "ecat.reg.crc2.rx", FT_UINT16, BASE_HEX, NULL, 0xff00, NULL, HFILL } }, { &hf_ecat_reg_crc3_frame, {"Invalid frame", "ecat.reg.crc3.frame", FT_UINT16, BASE_HEX, NULL, 0x00ff, NULL, HFILL } }, { &hf_ecat_reg_crc3_rx, {"RX error", "ecat.reg.crc3.rx", FT_UINT16, BASE_HEX, NULL, 0xff00, NULL, HFILL } }, { &hf_ecat_reg_crc_fwd0, {"Forw. CRC 0 (0x308)", "ecat.reg.crc.fwd0", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc_fwd1, {"Forw. CRC 1 (0x309)", "ecat.reg.crc.fwd1", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc_fwd2, {"Forw. CRC 2 (0x30A)", "ecat.reg.crc.fwd2", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_crc_fwd3, {"Forw. CRC 3 (0x30B)", "ecat.reg.crc.fwd3", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_processuniterr, {"Process unit error (0x30C)", "ecat.reg.processuniterr", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_pdierr, {"PDI error (0x30D)", "ecat.reg.pdierr", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_linklost0, {"Link Lost 0 (0x310)", "ecat.reg.linklost0", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_linklost1, {"Link Lost 1 (0x311)", "ecat.reg.linklost1", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_linklost2, {"Link Lost 2 (0x312)", "ecat.reg.linklost2", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_linklost3, {"Link Lost 3 (0x313)", "ecat.reg.linklost3", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_wd_divisor, {"WD Divisor (0x400)", "ecat.reg.wd.divisor", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_wd_timepdi, {"WD Time PDI (0x410)", "ecat.reg.wd.timepdi", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_wd_timesm, {"WD Time SM (0x420)", "ecat.reg.wd.timesm", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_wd_status, {"WD Status (0x440)", "ecat.reg.wd.status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_wd_status_pdwatchdog, {"PD watchdog", "ecat.reg.wd.status.pdwatchdog", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_watchdog), 0x1, NULL, HFILL } }, { &hf_ecat_reg_wd_cntsm, {"WD SM Counter (0x442)", "ecat.reg.wd.cntsm", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_wd_cntpdi, {"WD PDI Counter (0x443)", "ecat.reg.wd.cntpdi", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_eeprom_assign, {"EEPROM Assign (0x500)", "ecat.reg.eeprom.assign", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_eeprom_assign_ctrl, {"EEPROM access ctrl", "ecat.reg.eeprom.assign.ctrl", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_500_0), 0x1, NULL, HFILL } }, { &hf_ecat_reg_eeprom_assign_pdiaccess, {"Reset PDI access", "ecat.reg.eeprom.assign.pdiaccess", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_500_1), 0x02, NULL, HFILL } }, { &hf_ecat_reg_eeprom_assign_status, {"EEPROM access status", "ecat.reg.eeprom.assign.status", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_500_0), 0x10, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat, {"EEPROM Ctrl/Status (0x502)", "ecat.reg.ctrlstat", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_wraccess, {"Write access", "ecat.reg.ctrlstat.wraccess", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, /* Next 4 bits reserved */ { &hf_ecat_reg_ctrlstat_eepromemul, {"EEPROM emulation", "ecat.reg.ctrlstat.eepromemul", FT_BOOLEAN, 16, TFS(&tfs_esc_reg_502_5), 0x0020, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_8bacc, {"8 byte access", "ecat.reg.ctrlstat.8bacc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0040, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_2bacc, {"2 byte address", "ecat.reg.ctrlstat.2bacc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0080, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_rdacc, {"Read access", "ecat.reg.ctrlstat.rdacc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_wracc, {"Write access", "ecat.reg.ctrlstat.wracc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_reloadacc, {"Reload access", "ecat.reg.ctrlstat.reloadacc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0400, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_crcerr, {"CRC error", "ecat.reg.ctrlstat.crcerr", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0800, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_lderr, {"Load error", "ecat.reg.ctrlstat.lderr", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x1000, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_cmderr, {"Cmd error", "ecat.reg.ctrlstat.cmderr", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x2000, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_wrerr, {"Write error", "ecat.reg.ctrlstat.wrerr", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x4000, NULL, HFILL } }, { &hf_ecat_reg_ctrlstat_busy, {"Busy", "ecat.reg.ctrlstat.busy", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x8000, NULL, HFILL } }, { &hf_ecat_reg_addrl, {"EEPROM Address Lo (0x504)", "ecat.reg.addrl", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_addrh, {"EEPROM Address Hi (0x506)", "ecat.reg.addrh", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_data0, {"EEPROM Data 0 (0x508)", "ecat.reg.data0", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_data1, {"EEPROM Data 1 (0x50A)", "ecat.reg.data1", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_data2, {"EEPROM Data 2 (0x50c)", "ecat.reg.data2", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_data3, {"EEPROM Data 3 (0x50e)", "ecat.reg.data3", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_ctrlstat, {"Phy MIO Ctrl/Status (0x510)", "ecat.reg.mio.ctrlstat", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, /* TODO: check these masks (ecat_esc_reg_510) against spec. * In particular hf_ecat_reg_mio_ctrlstat_offsphy is non-contiguous and overlaps wracc1 */ { &hf_ecat_reg_mio_ctrlstat_wracc1, {"Write access", "ecat.reg.mio.ctrlstat.wracc1", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, { &hf_ecat_reg_mio_ctrlstat_offsphy, {"Offset Phy offset", "ecat.reg.mio.ctrlstat.offsphy", FT_UINT16, BASE_HEX, NULL, 0x008f, NULL, HFILL } }, { &hf_ecat_reg_mio_ctrlstat_rdacc, {"Read access", "ecat.reg.mio.ctrlstat.rdacc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_mio_ctrlstat_wracc2, {"Write access", "ecat.reg.mio.ctrlstat.wracc2", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_mio_ctrlstat_wrerr, {"Write error", "ecat.reg.mio.ctrlstat.wrerr", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x4000, NULL, HFILL } }, { &hf_ecat_reg_mio_ctrlstat_busy, {"Busy", "ecat.reg.mio.ctrlstat.busy", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x8000, NULL, HFILL } }, { &hf_ecat_reg_mio_addr, {"Phy MIO Address (0x512)", "ecat.reg.mio.addr", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_addr_phyaddr, {"Phy address", "ecat.reg.mio.addr.phyaddr", FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL } }, { &hf_ecat_reg_mio_addr_mioaddr, {"MIO address", "ecat.reg.mio.addr.mioaddr", FT_UINT16, BASE_HEX, NULL, 0x0F00, NULL, HFILL } }, { &hf_ecat_reg_mio_data, {"Phy MIO Data (0x514)", "ecat.reg.mio.data", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_access, {"MIO access (0x516)", "ecat.reg.mio.access", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_access_ecatacc, {"ECAT claims exclusive access", "ecat.reg.mio.access.ecatacc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, { &hf_ecat_reg_mio_access_pdiacc, {"PDI has access to MII management", "ecat.reg.mio.access.pdiacc", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_mio_access_forcereset, {"Force PDI to reset 0517.0", "ecat.reg.mio.access.forcereset", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_mio_status0, {"MIO port status 0 (0x518)", "ecat.reg.mio.status0", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_status0_physlink, {"Physical link detected", "ecat.reg.mio.status0.physlink", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_mio_status0_link, {"Link detected", "ecat.reg.mio.status0.link", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_mio_status0_linkstatuserr, {"Link status error", "ecat.reg.mio.status0.linkstatuserr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_mio_status0_readerr, {"Read error", "ecat.reg.mio.status0.readerr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x08, NULL, HFILL } }, { &hf_ecat_reg_mio_status0_linkpartnererr, {"Link partner error", "ecat.reg.mio.status0.linkpartnererr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x10, NULL, HFILL } }, { &hf_ecat_reg_mio_status0_phycfgupdated, {"Phy config updated", "ecat.reg.mio.status0.phycfgupdated", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x20, NULL, HFILL } }, { &hf_ecat_reg_mio_status1, {"MIO port status 1 (0x519)", "ecat.reg.mio.status1", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_status1_physlink, {"Physical link detected", "ecat.reg.mio.status1.physlink", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_mio_status1_link, {"Link detected", "ecat.reg.mio.status1.link", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_mio_status1_linkstatuserr, {"Link status error", "ecat.reg.mio.status1.linkstatuserr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_mio_status1_readerr, {"Read error", "ecat.reg.mio.status1.readerr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x08, NULL, HFILL } }, { &hf_ecat_reg_mio_status1_linkpartnererr, {"Link partner error", "ecat.reg.mio.status1.linkpartnererr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x10, NULL, HFILL } }, { &hf_ecat_reg_mio_status1_phycfgupdated, {"Phy config updated", "ecat.reg.mio.status1.phycfgupdated", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x20, NULL, HFILL } }, { &hf_ecat_reg_mio_status2, {"MIO port status 2 (0x51A)", "ecat.reg.mio.status2", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_status2_physlink, {"Physical link detected", "ecat.reg.mio.status2.physlink", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_mio_status2_link, {"Link detected", "ecat.reg.mio.status2.link", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_mio_status2_linkstatuserr, {"Link status error", "ecat.reg.mio.status2.linkstatuserr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_mio_status2_readerr, {"Read error", "ecat.reg.mio.status2.readerr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x08, NULL, HFILL } }, { &hf_ecat_reg_mio_status2_linkpartnererr, {"Link partner error", "ecat.reg.mio.status2.linkpartnererr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x10, NULL, HFILL } }, { &hf_ecat_reg_mio_status2_phycfgupdated, {"Phy config updated", "ecat.reg.mio.status2.phycfgupdated", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x20, NULL, HFILL } }, { &hf_ecat_reg_mio_status3, {"MIO port status 3 (0x51B)", "ecat.reg.mio.status3", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_mio_status3_physlink, {"Physical link detected", "ecat.reg.mio.status3.physlink", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_mio_status3_link, {"Link detected", "ecat.reg.mio.status3.link", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_mio_status3_linkstatuserr, {"Link status error", "ecat.reg.mio.status3.linkstatuserr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_mio_status3_readerr, {"Read error", "ecat.reg.mio.status3.readerr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x08, NULL, HFILL } }, { &hf_ecat_reg_mio_status3_linkpartnererr, {"Link partner error", "ecat.reg.mio.status3.linkpartnererr", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x10, NULL, HFILL } }, { &hf_ecat_reg_mio_status3_phycfgupdated, {"Phy config updated", "ecat.reg.mio.status3.phycfgupdated", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x20, NULL, HFILL } }, { &hf_ecat_reg_fmmu, {"FMMU", "ecat.fmmu", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_lstart, { "Log Start", "ecat.fmmu.lstart", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_llen, { "Log Length", "ecat.fmmu.llen", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_lstartbit, { "Log StartBit", "ecat.fmmu.lstartbit", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_lendbit, { "Log EndBit", "ecat.fmmu.lendbit", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_pstart, { "Phys Start", "ecat.fmmu.pstart", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_pstartbit, { "Phys StartBit", "ecat.fmmu.pstartbit", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_type, { "Type", "ecat.fmmu.type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_typeread, { "Type", "ecat.fmmu.typeread", FT_BOOLEAN, 8, TFS(&tfs_ecat_fmmu_typeread), 0x01, NULL, HFILL } }, { &hf_ecat_reg_fmmu_typewrite, { "Type", "ecat.fmmu.typewrite", FT_BOOLEAN, 8, TFS(&tfs_ecat_fmmu_typewrite), 0x02, NULL, HFILL } }, { &hf_ecat_reg_fmmu_activate, { "Activate", "ecat.fmmu.activate", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_fmmu_activate0, { "FMMU", "ecat.fmmu.activate0", FT_BOOLEAN, 8, TFS(&tfs_ecat_fmmu_activate), 0x01, NULL, HFILL } }, { &hf_ecat_reg_syncman, {"SyncManager", "ecat.syncman", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_syncman_start, {"SM Start", "ecat.syncman.start", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_syncman_len, {"SM Length", "ecat.syncman.len", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_syncman_ctrlstatus, {"SM Ctrl/Status", "ecat.syncman.ctrlstatus", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_syncman_pmode, {"OpMode", "ecat.syncman.opmode", FT_UINT16, BASE_HEX, VALS(vals_esc_reg_8041), 0x0003, NULL, HFILL } }, { &hf_ecat_reg_syncman_access, {"Access", "ecat.syncman.access", FT_UINT16, BASE_HEX, VALS(vals_esc_reg_8042), 0x000c, NULL, HFILL } }, { &hf_ecat_reg_syncman_irq_ecat, {"ECAT IRQ", "ecat.syncman.irq.ecat", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0010, NULL, HFILL } }, { &hf_ecat_reg_syncman_irq_pdi, {"PDI IRQ", "ecat.syncman.irq.pdi", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0020, NULL, HFILL } }, { &hf_ecat_reg_syncman_wdt, {"Watchdog trigger", "ecat.syncman.wdt", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0040, NULL, HFILL } }, { &hf_ecat_reg_syncman_irq_write, {"IRQ write", "ecat.syncman.irq.write", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_syncman_irq_read, {"IRQ read", "ecat.syncman.irq.read", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_syncman_1bufstate, {"1 buffer state", "ecat.syncman.1bufstate", FT_BOOLEAN, 16, TFS(&tfs_esc_reg_8051), 0x0800, NULL, HFILL } }, { &hf_ecat_reg_syncman_3bufstate, {"3 buffer state", "ecat.syncman.3bufstate", FT_UINT16, BASE_HEX, VALS(vals_esc_reg_8052), 0x3000, NULL, HFILL } }, { &hf_ecat_reg_syncman_sm_enable, {"SM Enable", "ecat.syncman.smenable", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ecat_reg_syncman_enable, {"Enable", "ecat.syncman.enable", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0001, NULL, HFILL } }, { &hf_ecat_reg_syncman_repeatreq, {"Repeat request", "ecat.syncman.repeatreq", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0002, NULL, HFILL } }, { &hf_ecat_reg_syncman_latchsmchg_ecat, {"Latch SyncMan Change ECAT", "ecat.syncman.latchsmchg.ecat", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0040, NULL, HFILL } }, { &hf_ecat_reg_syncman_latchsmchg_pdi, {"Latch SyncMan Change PDI", "ecat.syncman.latchsmchg.pdi", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0080, NULL, HFILL } }, { &hf_ecat_reg_syncman_deactivate, {"Deactivate", "ecat.syncman.deactivate", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0100, NULL, HFILL } }, { &hf_ecat_reg_syncman_repeatack, {"Repeat acknowledge", "ecat.syncman.repeatack", FT_BOOLEAN, 16, TFS(&tfs_local_true_false), 0x0200, NULL, HFILL } }, { &hf_ecat_reg_dc_recv0, {"DC RecvTime_0 (0x900)", "ecat.reg.dc.recv0", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_recv1, {"DC RecvTime_1 (0x904)", "ecat.reg.dc.recv1", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_recv2, {"DC RecvTime_2 (0x908)", "ecat.reg.dc.recv2", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_recv3, {"DC RecvTime_3 (0x90c)", "ecat.reg.dc.recv3", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_systime, {"DC SysTime (0x910)", "ecat.reg.dc.systime", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_systimeL, {"DC SysTime L (0x910)", "ecat.reg.dc.systimeL", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_systimeH, {"DC SysTime H (0x914)", "ecat.reg.dc.systimeH", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_recvtime64, {"DC RecvTime (0x918)", "ecat.reg.dc.recvtime64", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_systimeoffs, {"DC SysTimeOffs (0x920)", "ecat.reg.dc.systimeoffs", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_systimeoffsl, {"DC SysTimeOffs L (0x920)", "ecat.reg.dc.systimeoffsl", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_systimeoffsh, {"DC SysTimeOffs H (0x924)", "ecat.reg.dc.systimeoffsh", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_systimedelay, {"DC SysTimeDelay (0x928)", "ecat.reg.dc.systimedelay", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_ctrlerr, {"DC CtrlError (0x92c)", "ecat.reg.dc.ctrlerr", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_speedstart, {"DC SpeedStart (0x930)", "ecat.reg.dc.speedstart", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_speeddiff, {"DC SpeedDiff (0x932)", "ecat.reg.dc.speeddiff", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_fltdepth_systimediff, {"DC Filter Depth System Time difference (0x934)", "ecat.reg.dc.fltdepth.systimediff", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_fltdepth_speedcnt, {"DC Filter Depth Speed counter (0x935)", "ecat.reg.dc.fltdepth.speedcnt", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_cycunitctrl, {"DC Cyclic Unit Control (0x980)", "ecat.reg.dc.cycunitctrl", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_cycunitctrl_access_cyclic, {"Write access cyclic", "ecat.reg.dc.cycunitctrl.access_cyclic", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_9801), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_cycunitctrl_access_latch0, {"Write access latch 0", "ecat.reg.dc.cycunitctrl.access_latch0", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_9801), 0x10, NULL, HFILL } }, { &hf_ecat_reg_dc_cycunitctrl_access_latch1, {"Write access latch 1", "ecat.reg.dc.cycunitctrl.access_latch1", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_9801), 0x20, NULL, HFILL } }, { &hf_ecat_reg_dc_activation, {"DC Activation (0x981)", "ecat.reg.dc.activation", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_enablecyclic, {"Enable cyclic", "ecat.reg.dc.activation.enablecyclic", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_gen_sync0, {"Generate SYNC 0", "ecat.reg.dc.activation.gen_sync0", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_gen_sync1, {"Generate SYNC 1", "ecat.reg.dc.activation.gen_sync1", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_autoactivation, {"Auto activation", "ecat.reg.dc.activation.autoactivation", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x08, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_stimeext, {"Start time extension 32->64", "ecat.reg.dc.activation.stimeext", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x10, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_stimecheck, {"Start time chheck", "ecat.reg.dc.activation.stimecheck", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x20, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_hlfrange, {"Half range", "ecat.reg.dc.activation.hlfrange", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x40, NULL, HFILL } }, { &hf_ecat_reg_dc_activation_dblrange, {"Debug pulse", "ecat.reg.dc.activation.dblrange", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x80, NULL, HFILL } }, { &hf_ecat_reg_dc_cycimpuls, {"DC CycImpulse (0x982)", "ecat.reg.dc.cycimpuls", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_activationstat, {"DC Activation status (0x984)", "ecat.reg.dc.activationstat", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_activationstat_sync0pend, {"SYNC 0 pending", "ecat.reg.dc.activationstat.sync0pend", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_activationstat_sync1pend, {"SYNC 1 pending", "ecat.reg.dc.activationstat.sync1pend", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_dc_activationstat_stimeoutofrange, {"Start time out of range", "ecat.reg.dc.activationstat.stimeoutofrange", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_dc_sync0_status, {"DC Sync0 Status (0x98e)", "ecat.reg.dc.sync0.status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_sync0_status_triggered, {"triggered", "ecat.reg.dc.sync0.status.triggered", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_sync1_status, {"DC Sync0 Status1 (0x98f)", "ecat.reg.dc.sync1.status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_sync1_status_triggered, {"triggered", "ecat.reg.dc.sync1.status.triggered", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_starttime0, {"DC StartTime0 (0x990)", "ecat.reg.dc.starttime0", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_starttime1, {"DC StartTime1 (0x998)", "ecat.reg.dc.starttime1", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_cyctime0, {"DC CycTime0 (0x9a0)", "ecat.reg.dc.cyctime0", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_cyctime1, {"DC CycTime1 (0x9a4)", "ecat.reg.dc.cyctime1", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_ctrl, {"DC Latch0 Ctrl (0x9a8)", "ecat.reg.dc.latch0.ctrl", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_ctrl_pos, {"pos", "ecat.reg.dc.latch0.ctrl.pos", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_9A8E1), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_ctrl_neg, {"neg", "ecat.reg.dc.latch0.ctrl.neg", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_9A8E1), 0x02, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_ctrl, {"DC Latch1 Ctrl (0x9a9)", "ecat.reg.dc.latch1.ctrl", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_ctrl_pos, {"pos", "ecat.reg.dc.latch1.ctrl.pos", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_9A8E1), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_ctrl_neg, {"neg", "ecat.reg.dc.latch1.ctrl.neg", FT_BOOLEAN, 8, TFS(&tfs_esc_reg_9A8E1), 0x02, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_status, {"DC Latch0 Status (0x9ae)", "ecat.reg.dc.latch0.status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_status_eventpos, {"Event pos", "ecat.reg.dc.latch0.status.eventpos", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_status_eventneg, {"Event neg", "ecat.reg.dc.latch0.status.eventneg", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_status_pinstate, {"pin state", "ecat.reg.dc.latch0.status.pinstate", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_status, {"DC Latch1 Status (0x9af)", "ecat.reg.dc.latch1.status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_status_eventpos, {"Event pos", "ecat.reg.dc.latch1.status.eventpos", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x01, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_status_eventneg, {"Event neg", "ecat.reg.dc.latch1.status.eventneg", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x02, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_status_pinstate, {"pin state", "ecat.reg.dc.latch1.status.pinstate", FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x04, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_pos, {"DC Latch0 Pos (0x9b0)", "ecat.reg.dc.latch0.pos", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch0_neg, {"DC Latch0 Neg (0x9b8)", "ecat.reg.dc.latch0.neg", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_pos, {"DC Latch1 Pos (0x9c0)", "ecat.reg.dc.latch1.pos", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_latch1_neg, {"DC Latch1 Neg (0x9c8)", "ecat.reg.dc.latch1.neg", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_rcvsyncmanchg, {"DC RecvSyncManChange (0x9f0)", "ecat.reg.dc.rcvsyncmanchg", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_pdismstart, {"DC PdiSyncManStart (0x9f8)", "ecat.reg.dc.pdismstart", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_ecat_reg_dc_pdismchg, {"DC PdiSyncManChange (0x9fc)", "ecat.reg.dc.pdismchg", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, }; static gint *ett[] = { &ett_ecat, &ett_ecat_header, &ett_ecat_dc, &ett_ecat_length, &ett_ecat_padding, &ett_ecat_datagram_subtree, &ett_ecat_reg_esc_features, &ett_ecat_reg_dlctrl1, &ett_ecat_reg_dlctrl2, &ett_ecat_reg_dlctrl3, &ett_ecat_reg_dlctrl4, &ett_ecat_reg_dlstatus1, &ett_ecat_reg_dlstatus2, &ett_ecat_reg_alctrl, &ett_ecat_reg_alstatus, &ett_ecat_reg_pdictrl1, &ett_ecat_reg_pdictrl2, &ett_ecat_reg_ecat_mask, &ett_ecat_reg_pdiL, &ett_ecat_reg_ecat, &ett_ecat_reg_pdi1, &ett_ecat_reg_crc0, &ett_ecat_reg_crc1, &ett_ecat_reg_crc2, &ett_ecat_reg_crc3, &ett_ecat_reg_wd_status, &ett_ecat_reg_eeprom_assign, &ett_ecat_reg_ctrlstat, &ett_ecat_reg_mio_ctrlstat, &ett_ecat_mio_addr, &ett_ecat_mio_access, &ett_ecat_mio_status0, &ett_ecat_mio_status1, &ett_ecat_mio_status2, &ett_ecat_mio_status3, &ett_ecat_reg_fmmu, &ett_ecat_reg_syncman, &ett_ecat_reg_syncman_ctrlstatus, &ett_ecat_reg_syncman_sm_enable, &ett_ecat_reg_dc_cycunitctrl, &ett_ecat_dc_activation, &ett_ecat_dc_activationstat, &ett_ecat_dc_sync0_status, &ett_ecat_dc_sync1_status, &ett_ecat_dc_latch0_ctrl, &ett_ecat_dc_latch1_ctrl, &ett_ecat_dc_latch0_status, &ett_ecat_dc_latch1_status, }; proto_ecat_datagram = proto_register_protocol("EtherCAT datagram(s)", "ECAT", "ecat"); proto_register_field_array(proto_ecat_datagram, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); ecat_handle = register_dissector("ecat", dissect_ecat_datagram, proto_ecat_datagram); /* Sub dissector code */ heur_subdissector_list = register_heur_dissector_list("ecat.data", proto_ecat_datagram); } /* The registration hand-off routing */ void proto_reg_handoff_ecat(void) { /* Register this dissector as a sub dissector to EtherCAT frame based on ether type. */ dissector_add_uint("ecatf.type", 1 /* EtherCAT type */, ecat_handle); ecat_mailbox_handle = find_dissector_add_dependency("ecat_mailbox", proto_ecat_datagram); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 3 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=3 tabstop=8 expandtab: * :indentSize=3:tabSize=8:noTabs=true: */
C/C++
wireshark/plugins/epan/ethercat/packet-ethercat-datagram.h
/* packet-ethercat-datagram.h * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _PACKET_ETHERCAT_DATAGRAM_ #define _PACKET_ETHERCAT_DATAGRAM_ /* structure for decoding the header -----------------------------------------*/ typedef union { struct { guint16 adp; guint16 ado; } a; guint32 addr; } EcParserAddrUnion; typedef struct _EcParser { guint8 cmd; guint8 idx; EcParserAddrUnion anAddrUnion; guint16 len; guint16 intr; } EcParserHDR, *PEcParserHDR; #define EcParserHDR_Len 10/*sizeof(EcParserHDR)*/ #endif /* _PACKET_ETHERCAT_DATAGRAM_ */
C
wireshark/plugins/epan/ethercat/packet-ethercat-frame.c
/* packet-ethercat-frame.c * Routines for ethercat packet disassembly * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Include files */ #include "config.h" #include <epan/packet.h> #include <epan/etypes.h> #include "packet-ethercat-frame.h" void proto_register_ethercat_frame(void); void proto_reg_handoff_ethercat_frame(void); /* Define the Ethercat frame proto */ static int proto_ethercat_frame = -1; static dissector_table_t ethercat_frame_dissector_table; static dissector_handle_t ethercat_frame_handle; /* Define the tree for the EtherCAT frame */ static int ett_ethercat_frame = -1; static int hf_ethercat_frame_length = -1; static int hf_ethercat_frame_reserved = -1; static int hf_ethercat_frame_type = -1; static const value_string EthercatFrameTypes[] = { { 1, "EtherCAT command", }, { 2, "ADS", }, { 3, "RAW-IO", }, { 4, "NV", }, { 5, "Mailbox"}, { 0, NULL } }; static const value_string ethercat_frame_reserved_vals[] = { { 0, "Valid"}, { 1, "Invalid (must be zero for conformance with the protocol specification)"}, { 0, NULL} }; /* Ethercat Frame */ static int dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { tvbuff_t *next_tvb; proto_item *ti; proto_tree *ethercat_frame_tree; gint offset = 0; EtherCATFrameParserHDR hdr; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ECATF"); col_clear(pinfo->cinfo, COL_INFO); if (tree) { ti = proto_tree_add_item(tree, proto_ethercat_frame, tvb, offset, EtherCATFrameParserHDR_Len, ENC_NA); ethercat_frame_tree = proto_item_add_subtree(ti, ett_ethercat_frame); proto_tree_add_item(ethercat_frame_tree, hf_ethercat_frame_length, tvb, offset, EtherCATFrameParserHDR_Len, ENC_LITTLE_ENDIAN); proto_tree_add_item(ethercat_frame_tree, hf_ethercat_frame_reserved, tvb, offset, EtherCATFrameParserHDR_Len, ENC_LITTLE_ENDIAN); proto_tree_add_item(ethercat_frame_tree, hf_ethercat_frame_type, tvb, offset, EtherCATFrameParserHDR_Len, ENC_LITTLE_ENDIAN); } hdr.hdr = tvb_get_letohs(tvb, offset); offset = EtherCATFrameParserHDR_Len; /* The EtherCAT frame header has now been processed, allow sub dissectors to handle the rest of the PDU. */ next_tvb = tvb_new_subset_remaining (tvb, offset); if (!dissector_try_uint(ethercat_frame_dissector_table, hdr.v.protocol, next_tvb, pinfo, tree)) { col_add_fstr (pinfo->cinfo, COL_PROTOCOL, "0x%04x", hdr.v.protocol); /* No sub dissector wanted to handle this payload, decode it as general data instead. */ call_data_dissector(next_tvb, pinfo, tree); } return tvb_captured_length(tvb); } void proto_register_ethercat_frame(void) { static hf_register_info hf[] = { { &hf_ethercat_frame_length, { "Length", "ecatf.length", FT_UINT16, BASE_HEX, NULL, 0x07FF, NULL, HFILL } }, { &hf_ethercat_frame_reserved, { "Reserved", "ecatf.reserved", FT_UINT16, BASE_HEX, VALS(ethercat_frame_reserved_vals), 0x0800, NULL, HFILL} }, { &hf_ethercat_frame_type, { "Type", "ecatf.type", FT_UINT16, BASE_HEX, VALS(EthercatFrameTypes), 0xF000, "E88A4 Types", HFILL } } }; static gint *ett[] = { &ett_ethercat_frame }; proto_ethercat_frame = proto_register_protocol("EtherCAT frame header", "ETHERCAT", "ecatf"); proto_register_field_array(proto_ethercat_frame,hf,array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); ethercat_frame_handle = register_dissector("ecatf", dissect_ethercat_frame, proto_ethercat_frame); /* Define a handle (ecatf.type) for sub dissectors that want to dissect the Ethercat frame ether type (E88A4) payload. */ ethercat_frame_dissector_table = register_dissector_table("ecatf.type", "EtherCAT frame type", proto_ethercat_frame, FT_UINT8, BASE_DEC); } void proto_reg_handoff_ethercat_frame(void) { dissector_add_uint("ethertype", ETHERTYPE_ECATF, ethercat_frame_handle); dissector_add_uint_with_preference("udp.port", ETHERTYPE_ECATF, ethercat_frame_handle); dissector_add_uint_with_preference("tcp.port", ETHERTYPE_ECATF, ethercat_frame_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 3 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=3 tabstop=8 expandtab: * :indentSize=3:tabSize=8:noTabs=true: */
C/C++
wireshark/plugins/epan/ethercat/packet-ethercat-frame.h
/* paket-ethercat-frame.h * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _PACKET_ETHERCAT_FRAME_H #define _PACKET_ETHERCAT_FRAME_H #include <ws_diag_control.h> /* structure for decoding the header -----------------------------------------*/ DIAG_OFF_PEDANTIC typedef union _EtherCATFrameParser { struct { guint16 length : 11; guint16 reserved : 1; guint16 protocol : 4; } v; guint16 hdr; } EtherCATFrameParserHDR; DIAG_ON_PEDANTIC typedef EtherCATFrameParserHDR *PEtherCATFrameParserHDR; #define EtherCATFrameParserHDR_Len (int)sizeof(EtherCATFrameParserHDR) #endif /* _PACKET_ETHERCAT_FRAME_H */
C
wireshark/plugins/epan/ethercat/packet-ioraw.c
/* packet-ioraw.c * Routines for ethercat packet disassembly * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Include files */ #include "config.h" #include <epan/packet.h> #include "packet-ioraw.h" void proto_register_ioraw(void); void proto_reg_handoff_ioraw(void); /* Define the ioraw proto */ int proto_ioraw = -1; static int ett_ioraw = -1; static dissector_handle_t ioraw_handle; /* static int hf_ioraw_summary = -1; */ static int hf_ioraw_header = -1; static int hf_ioraw_data = -1; /*ioraw*/ static void IoRawSummaryFormater( char *szText, int nMax) { snprintf ( szText, nMax, "Raw IO Data" ); } static int dissect_ioraw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *ioraw_tree; gint offset = 0; char szText[200]; int nMax = sizeof(szText)-1; guint ioraw_length = tvb_reported_length(tvb); col_set_str(pinfo->cinfo, COL_PROTOCOL, "IO-RAW"); IoRawSummaryFormater(szText, nMax); col_add_str(pinfo->cinfo, COL_INFO, szText); if (tree) { ti = proto_tree_add_item(tree, proto_ioraw, tvb, 0, -1, ENC_NA); ioraw_tree = proto_item_add_subtree(ti, ett_ioraw); proto_item_append_text(ti,": %s",szText); proto_tree_add_item(ioraw_tree, hf_ioraw_header, tvb, offset, IoRawParserHDR_Len, ENC_NA); offset+=IoRawParserHDR_Len; proto_tree_add_item(ioraw_tree, hf_ioraw_data, tvb, offset, ioraw_length - offset, ENC_NA); } return tvb_captured_length(tvb); } void proto_register_ioraw(void) { static hf_register_info hf[] = { #if 0 { &hf_ioraw_summary, { "Summary of the IoRaw Packet", "ioraw.summary", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #endif { &hf_ioraw_header, { "Header", "ioraw.header", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ioraw_data, { "VarData", "ioraw.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_ioraw }; proto_ioraw = proto_register_protocol("TwinCAT IO-RAW", "IO-RAW","ioraw"); proto_register_field_array(proto_ioraw,hf,array_length(hf)); proto_register_subtree_array(ett,array_length(ett)); ioraw_handle = register_dissector("ioraw", dissect_ioraw, proto_ioraw); } void proto_reg_handoff_ioraw(void) { dissector_add_uint("ecatf.type", 3, ioraw_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 3 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=3 tabstop=8 expandtab: * :indentSize=3:tabSize=8:noTabs=true: */
C/C++
wireshark/plugins/epan/ethercat/packet-ioraw.h
/* packet-ioraw.h * * Copyright (c) 2007 by Beckhoff Automation GmbH * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _PACKET_IORAW_H_ #define _PACKET_IORAW_H_ /* headers are only used for size and offset calculation*/ typedef struct _IoRawParser { guint32 head; } IoRawParserHDR, *PIoRawParserHDR; #define IoRawParserHDR_Len (int)sizeof(IoRawParserHDR) #endif /* _PACKET_IORAW_H_*/