]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Merge pull request #916 from stevekay/master
authorGuy Harris <[email protected]>
Sat, 10 Jul 2021 20:45:10 +0000 (13:45 -0700)
committerGitHub <[email protected]>
Sat, 10 Jul 2021 20:45:10 +0000 (13:45 -0700)
optional unit suffix on -C file size

34 files changed:
.appveyor.yml
.ci-coverity-scan-build.sh [moved from .travis-coverity-scan-build.sh with 79% similarity]
.cirrus.yml
CHANGES
CONTRIBUTING
Makefile.in
Readme.Win32 [deleted file]
aclocal.m4
build.sh
build_matrix.sh
config.guess
config.sub
configure
doc/README.Win32.md
nameser.h
netdissect.h
print-802_11.c
print-802_15_4.c
print-arp.c
print-bgp.c
print-domain.c
print-fr.c
print-juniper.c
print-macsec.c
print-sflow.c
print-zep.c
print-zephyr.c
tcpdump.c
tests/TESTLIST
tests/heapoverflow-atalk_2.out [moved from tests/heapoverflow-EXTRACT_16BITS.out with 100% similarity]
tests/heapoverflow-atalk_2.pcap [moved from tests/heapoverflow-EXTRACT_16BITS.pcap with 100% similarity]
tests/sflow-print-v6.out [new file with mode: 0644]
tests/sflow-print-v6.pcap [new file with mode: 0644]
update-test.sh

index 426d287b5f2e028789602c5ce020417750fbf730..62c297bec380a7248e26922ded02bc4d920791af 100644 (file)
@@ -12,8 +12,8 @@ matrix:
 install:
   - appveyor DownloadFile https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip
   - 7z x .\WpdPack_4_1_2.zip -oc:\projects\libpcap\Win32
-  - appveyor DownloadFile https://nmap.org/npcap/dist/npcap-sdk-1.05.zip
-  - 7z x .\npcap-sdk-1.05.zip -oc:\projects\libpcap\Win32\npcap-sdk-1.05
+  - appveyor DownloadFile https://nmap.org/npcap/dist/npcap-sdk-1.10.zip
+  - 7z x .\npcap-sdk-1.10.zip -oc:\projects\libpcap\Win32\npcap-sdk-1.10
 
 environment:
   matrix:
@@ -25,10 +25,10 @@ environment:
       SDK: WpdPack
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
       GENERATOR: "Visual Studio 14 2015"
-      SDK: npcap-sdk-1.05
+      SDK: npcap-sdk-1.10
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
       GENERATOR: "Visual Studio 14 2015 Win64"
-      SDK: npcap-sdk-1.05
+      SDK: npcap-sdk-1.10
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
       GENERATOR: "Visual Studio 15 2017"
       SDK: WpdPack
@@ -37,10 +37,10 @@ environment:
       SDK: WpdPack
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
       GENERATOR: "Visual Studio 15 2017"
-      SDK: npcap-sdk-1.05
+      SDK: npcap-sdk-1.10
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
       GENERATOR: "Visual Studio 15 2017 Win64"
-      SDK: npcap-sdk-1.05
+      SDK: npcap-sdk-1.10
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
       GENERATOR: "Visual Studio 16 2019"
       PLATFORM: Win32
@@ -52,11 +52,11 @@ environment:
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
       GENERATOR: "Visual Studio 16 2019"
       PLATFORM: Win32
-      SDK: npcap-sdk-1.05
+      SDK: npcap-sdk-1.10
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
       GENERATOR: "Visual Studio 16 2019"
       PLATFORM: x64
-      SDK: npcap-sdk-1.05
+      SDK: npcap-sdk-1.10
 
 build_script:
   #
similarity index 79%
rename from .travis-coverity-scan-build.sh
rename to .ci-coverity-scan-build.sh
index 7ea1dac9a2416e33c131724fa2f3a02fbcd67a0e..686806a3174cac7df9956abc53953ec7fb3570e7 100755 (executable)
@@ -6,7 +6,6 @@ set -e
 printf "\033[33;1mNote: COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN are available on Project Settings page on scan.coverity.com\033[0m\n"
 [ -z "$COVERITY_SCAN_PROJECT_NAME" ] && echo "ERROR: COVERITY_SCAN_PROJECT_NAME must be set" && exit 1
 #[ -z "$COVERITY_SCAN_NOTIFICATION_EMAIL" ] && echo "ERROR: COVERITY_SCAN_NOTIFICATION_EMAIL must be set" && exit 1
-[ -z "$COVERITY_SCAN_BRANCH_PATTERN" ] && echo "ERROR: COVERITY_SCAN_BRANCH_PATTERN must be set" && exit 1
 [ -z "$COVERITY_SCAN_BUILD_COMMAND" ] && echo "ERROR: COVERITY_SCAN_BUILD_COMMAND must be set" && exit 1
 [ -z "$COVERITY_SCAN_TOKEN" ] && echo "ERROR: COVERITY_SCAN_TOKEN must be set" && exit 1
 
@@ -17,31 +16,6 @@ TOOL_BASE=/tmp/coverity-scan-analysis
 UPLOAD_URL="https://scan.coverity.com/builds"
 SCAN_URL="https://scan.coverity.com"
 
-# Verify Coverity Scan run condition
-COVERITY_SCAN_RUN_CONDITION=${coverity_scan_run_condition:-true}
-printf "\033[33;1mTesting '%s' condition... " "$COVERITY_SCAN_RUN_CONDITION"
-if eval [ "$COVERITY_SCAN_RUN_CONDITION" ]; then
-  printf "True.\033[0m\n"
-else
-  printf "False. Exit.\033[0m\n"
-  exit 0
-fi
-
-# Do not run on pull requests
-if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then
-  printf "\033[33;1mINFO: Skipping Coverity Analysis: branch is a pull request.\033[0m\n"
-  exit 0
-fi
-
-# Verify this branch should run
-IS_COVERITY_SCAN_BRANCH=$(ruby -e "puts '${TRAVIS_BRANCH}' =~ /\\A$COVERITY_SCAN_BRANCH_PATTERN\\z/ ? 1 : 0")
-if [ "$IS_COVERITY_SCAN_BRANCH" = "1" ]; then
-  printf "\033[33;1mCoverity Scan configured to run on branch %s\033[0m\n" "$TRAVIS_BRANCH"
-else
-  printf "\033[33;1mCoverity Scan NOT configured to run on branch %s\033[0m\n" "$TRAVIS_BRANCH"
-  exit 1
-fi
-
 # Verify upload is permitted
 AUTH_RES=$(curl -s --form project="$COVERITY_SCAN_PROJECT_NAME" --form token="$COVERITY_SCAN_TOKEN" $SCAN_URL/api/upload_permitted)
 if [ "$AUTH_RES" = "Access denied" ]; then
@@ -82,6 +56,7 @@ RESULTS_DIR="cov-int"
 eval "${COVERITY_SCAN_BUILD_COMMAND_PREPEND}"
 # Do not quote COV_BUILD_OPTIONS so it collapses when it is empty and expands
 # when it is not.
+# shellcheck disable=SC2086
 COVERITY_UNSUPPORTED=1 cov-build --dir "$RESULTS_DIR" $COV_BUILD_OPTIONS "$COVERITY_SCAN_BUILD_COMMAND"
 cov-import-scm --dir $RESULTS_DIR --scm git --log $RESULTS_DIR/scm_log.txt 2>&1
 
index 657f947e215e67d7c41a9bc3ce02bf6d51c187d9..0a3e3d32c945e6a6f8cfbb354996d9a7e1a32f6a 100644 (file)
@@ -24,8 +24,9 @@ freebsd_task:
     MATRIX_CC: clang gcc10
   script:
     - pkg install -qy git autoconf gcc10
-    - pkg install -qy bash cmake # for build_matrix.sh and build.sh
+    - pkg install -qy cmake # for build_matrix.sh and build.sh
     - pkg install -qy pkgconf # for cmake, replaces pkg-config
+    - pkg install -qy sudo # for some tcpdump commands
     - echo '$ git clone [...] libpcap.git'
     - git -C .. clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT}
     - ./build_matrix.sh
@@ -49,6 +50,7 @@ linux_task:
     - apt-get -qy install git autoconf make cmake clang gcc
     - apt-get -qy install flex bison libdbus-1-dev libbluetooth-dev libnl-genl-3-dev libibverbs-dev # for libpcap
     - apt-get -qy install libssl-dev libsmi2-dev libcap-ng-dev libpcap-dev
+    - apt-get -qy install sudo # for some tcpdump commands
     - apt list --installed 'lib*-dev'
     - echo '$ git clone [...] libpcap.git'
     - git -C .. clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT}
@@ -83,13 +85,10 @@ coverity_task:
     COVERITY_SCAN_TOKEN: ENCRYPTED[1b6f994cabfe74267ce2dce81fd9e49f694e9cfe69fb99f7d1580907bec1266efd7b38df3a47ccab53d5af98636f8e9c]
     COVERITY_SCAN_BUILD_COMMAND_PREPEND: ./configure
     COVERITY_SCAN_BUILD_COMMAND: make
-    COVERITY_SCAN_BRANCH_PATTERN: $CIRRUS_BRANCH
-    TRAVIS_BRANCH: $CIRRUS_BRANCH
-    TRAVIS_PULL_REQUEST: ${CIRRUS_BASE_BRANCH:+true}
   script:
     - apt-get -qy update
     - apt-get -qy install autoconf make gcc
     - apt-get -qy install libssl-dev libsmi2-dev libcap-ng-dev libpcap-dev
     - apt-get -qy install git curl wget ruby rubygems ruby-json # for the coverity script
     - apt list --installed 'lib*-dev'
-    - ./.travis-coverity-scan-build.sh
+    - ./.ci-coverity-scan-build.sh
diff --git a/CHANGES b/CHANGES
index f6a9d64278a267e389cc32dd6ee90155ca620719..f9150f6e2b6e3d2da35950b2054aa7cb9b2a18b8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -19,16 +19,38 @@ Monthday, Month DD, YYYY by gharris and denis
       AppleTalk: Declutter appletalk.h.
       Introduce new ND_LCHECK*() macros to deduplicate more code.
       IEEE 802.11: Simplify handle_action().
-      OpenFlow 1.0: Get snapend right for nested frames.
-      ICMP: Update the snapend for some nested IP packets.
       RPKI-Router: Refine length and bounds checks.
-      MACsec: Update the snapend thus the ICV field is not payload for the caller
 
-Monthday, Month DD, YYYY by gharris
-  Summary for 4.99.1 tcpdump release (so far!)
+Wednesday, June 9, 2021 by gharris
+  Summary for 4.99.1 tcpdump release
     Source code:
       Squelch some compiler warnings
+      ICMP: Update the snapend for some nested IP packets.
+      MACsec: Update the snapend thus the ICV field is not payload
+        for the caller.
+      EIGRP: Fix packet header fields
+      SMB: Disable printer by default in CMake builds
+      OLSR: Print the protocol name even if the packet is invalid
+      MSDP: Print ": " before the protocol name
+      ESP: Remove padding, padding length and next header from the buffer
+      DHCPv6: Update the snapend for nested DHCPv6 packets
+      OpenFlow 1.0: Get snapend right for nested frames.
+      TCP: Update the snapend before decoding a MPTCP option
+      Ethernet, IEEE 802.15.4, IP, L2TP, TCP, ZEP: Add bounds checks
+      ForCES: Refine SPARSEDATA-TLV length check.
+      ASCII/hex: Use nd_trunc_longjmp() in truncation cases
+      GeoNet: Add a ND_TCHECK_LEN() call
+      Replace ND_TCHECK_/memcpy() pairs with GET_CPY_BYTES().
+      BGP: Fix overwrites of global 'astostr' temporary buffer
+      ARP: fix overwrites of static buffer in q922_string().
+      Frame Relay: have q922_string() handle errors better.
+    Building and testing:
       Rebuild configure script when building release
+      Fix "make clean" for out-of-tree autotools builds
+      CMake: add stuff from CMAKE_PREFIX_PATH to PKG_CONFIG_PATH.
+    Documentation:
+      man: Update a reference as www.cifs.org is gone. [skip ci]
+      man: Update DNS sections
     Solaris:
       Fix a compile error with Sun C
 
index 1a1a309c145723836460bae8199ebe75e773ef6b..26fb1ecd29a88941bc12cc13056b8837e8c37540 100644 (file)
@@ -45,14 +45,9 @@ How to add new code and to update existing code
    https://github.com/the-tcpdump-group/tcpdump
    (See https://help.github.com/articles/fork-a-repo/)
 
-2) Setup optional continuous integration (CI) builds
-   You can setup Travis CI, Cirrus CI and AppVeyor builds for your fork to
-   test your changes on Linux, FreeBSD, macOS and Windows before opening a
-   pull request.
-   (See https://docs.travis-ci.com/user/tutorial/ for information
-   on setting up Travis CI; go to https://ci.appveyor.com/login and log
-   in with your GitHub account and select "NEW PROJECT" to set up an
-   AppVeyor build.)
+2) The easiest way to test your changes on multiple operating systems and
+   architectures is to let the upstream CI test your pull request (more on
+   this below).
 
 3) Setup your git working copy
    git clone https://github.com/<username>/tcpdump.git
@@ -106,7 +101,6 @@ How to add new code and to update existing code
 
 9) Once 100% happy, put your work into your forked repository.
    git push
-   This will trigger your fork CI tests, if set up in step 2.
 
 10) Initiate and send a pull request
     (See https://help.github.com/articles/using-pull-requests/)
index 5fbccaf2231a1f9ed69d45f79935eb5af212b281..4ffca817b328357d79d1f992dca700f14c7505a2 100644 (file)
@@ -337,7 +337,6 @@ EXTRA_DIST = \
        Makefile.in \
        Makefile-devel-adds \
        README.md \
-       Readme.Win32 \
        VERSION \
        aclocal.m4 \
        atime.awk \
@@ -464,8 +463,17 @@ releasetar:
           tar -c -z -f $$name.tar.gz $$name; \
           rm -rf $$name
 
+rc1 rc2 rc3 rc4 rc5:
+       @VER=`cat $(srcdir)/VERSION`; \
+       sed -i "s/$$VER/$${VER}$@/" VERSION ; \
+       make releasetar; \
+       git checkout VERSION configure
+
 testlist:
        echo $(TEST_DIST)
 
 depend:
        $(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC)
+
+shellcheck:
+       shellcheck -f gcc build.sh build_matrix.sh
diff --git a/Readme.Win32 b/Readme.Win32
deleted file mode 100644 (file)
index 4c07992..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-To build tcpdump under Windows, you need:
-
-- Microsoft Visual Studio 2015 or later
-- the WinPcap or Npcap SDK, which includes libpcap for win32. The
-  WinPcap SDK can be doneloaded from
-
-    https://www.winpcap.org/devel.htm
-
-  and the Npcap SDK can be downloaded from
-
-    https://nmap.org/npcap/
-- CMake, which can be downloadd from
-
-    https://cmake.org
-
-First, make a build directory, either as a subdirectory of the tcpdump
-source directory or as a separate directory.
-
-Second, change to the build directory, and run CMake with the following
-arguments:
-
-  -DCMAKE_PREFIX_PATH={pathname of the WinPcap/Npcap SDK}
-
-  -G {generator}
-
-  the pathname of the tcpdump source directory relative to the build
-  directory (".." if the build directory is a subdirectory of the
-  tcpdump source directory).
-
-"{generator}" would be the string "Visual Studio N YYYY", where "N" is
-the version of Visual Studio and "YYYY" is the year number for that
-version; if you are building a 64-bit version of tcpdump, YYYY must be
-followed by a space and "Win64".  For example, to build a 32-bit version
-of tcpdump with Visual Studio 2015, "{generator}" would be "Visual
-Studio 14 2015" and to build a 64-bit version of tcpdump with Visual
-Studio 2017, "{generator}" would be "Visual Studio 15 2017 Win64".
-
-Third, from the build directory, run the command
-
-  msbuild /m /nologo /p:Configuration={configuration} tcpdump.sln
-
-where {configuration} can be "Release", "Debug", or "RelWithDebInfo", or
-build tcpdump from the Visual Studio application using the solution file
-in question.
-
-(XXX - rules for building with MinGW should be added.)
index bd4e27a5a1f2a6ceb279c8ef1cf06f078bd752f0..ef5efe02387bc146ba9000048bb265746f70a6bc 100644 (file)
@@ -495,9 +495,9 @@ AC_DEFUN(AC_LBL_LIBPCAP,
         AC_MSG_CHECKING(for local pcap library)
         lastdir=FAIL
         places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
-            egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
+            egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT|rc.)?$'`
         places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
-            egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
+            egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT|rc.)?$'`
         for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
             basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
                 sed -e 's/-PRE-GIT$//' `
index eae8765ddbf9b49935a429461eb3711eab9c3517..78def6a50b58198380e14d923e80407c0c39f964 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,11 +1,9 @@
-#!/usr/bin/env bash
+#!/bin/sh -e
 
 # This script runs one build with setup environment variables: BUILD_LIBPCAP,
 # REMOTE, CC, CMAKE, CRYPTO and SMB
 # (default: BUILD_LIBPCAP=no, REMOTE=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no).
 
-set -e
-
 # BUILD_LIBPCAP: no or yes
 BUILD_LIBPCAP=${BUILD_LIBPCAP:-no}
 # REMOTE: no or yes
@@ -29,26 +27,16 @@ fi
 # For TESTrun
 export TCPDUMP_BIN="$PREFIX/bin/tcpdump"
 
-travis_fold() {
-    local action=${1:?}
-    local name=${2:?}
-    if [ "$TRAVIS" != true ]; then return; fi
-    echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
-    sleep 1
-}
-
 # Run a command after displaying it
 run_after_echo() {
-    echo -n '$ '
+    printf '$ '
     echo "$@"
+    # shellcheck disable=SC2068
     $@
 }
 
-# LABEL is needed to build the travis fold labels
-LABEL="$BUILD_LIBPCAP.$REMOTE.$CC.$CMAKE.$CRYPTO.$SMB"
 if [ "$CMAKE" = no ]; then
     echo '$ ./configure [...]'
-    travis_fold start configure
     if [ "$BUILD_LIBPCAP" = yes ]; then
         echo "Using PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
         ./configure --with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix="$PREFIX"
@@ -56,35 +44,35 @@ if [ "$CMAKE" = no ]; then
     else
         ./configure --disable-local-libpcap --with-crypto="$CRYPTO" --enable-smb="$SMB" --prefix="$PREFIX"
     fi
-    travis_fold end configure
 else
     rm -rf build
     mkdir build
     cd build
     echo '$ cmake [...]'
-    travis_fold start cmake
     if [ "$BUILD_LIBPCAP" = yes ]; then
         cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_PREFIX_PATH="$PREFIX" -DCMAKE_INSTALL_PREFIX="$PREFIX" ..
         export LD_LIBRARY_PATH="$PREFIX/lib"
     else
         cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" -DCMAKE_INSTALL_PREFIX="$PREFIX" ..
     fi
-    travis_fold end cmake
 fi
 run_after_echo "make -s clean"
 run_after_echo "make -s CFLAGS=-Werror"
 echo '$ make install'
-travis_fold start make_install
 make install
-travis_fold end make_install
 run_after_echo "$TCPDUMP_BIN --version"
 run_after_echo "$TCPDUMP_BIN -h"
 run_after_echo "$TCPDUMP_BIN -D"
 system=$(uname -s)
-if [ "$system" = Linux ]; then
+case "$system" in
+Linux|FreeBSD|NetBSD|OpenBSD)
     run_after_echo "ldd $TCPDUMP_BIN"
-fi
-if [ "$TRAVIS" = true ]; then
+    ;;
+Darwin)
+    run_after_echo "otool -L $TCPDUMP_BIN"
+    ;;
+esac
+if [ "$CIRRUS_CI" = true ]; then
     if [ -n "$LD_LIBRARY_PATH" ]; then
         run_after_echo "sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH $TCPDUMP_BIN -J"
         run_after_echo "sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH $TCPDUMP_BIN -L"
@@ -102,32 +90,25 @@ if [ "$CMAKE" = no ]; then
         run_after_echo "make releasetar"
     fi
 fi
-if [ "$TRAVIS" = true ]; then
-    if [ "$TRAVIS_OS_NAME" = linux ] && [ "$TRAVIS_CPU_ARCH" != ppc64le ] && [ "$TRAVIS_CPU_ARCH" != s390x ] && [ "$TRAVIS_CPU_ARCH" != arm64 ]; then
-        if [ -n "$LD_LIBRARY_PATH" ]; then
-            run_after_echo "sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH $TCPDUMP_BIN -#n -c 10"
-        else
-            run_after_echo "sudo $TCPDUMP_BIN -#n -c 10"
-        fi
+if [ "$CIRRUS_CI" = true ]; then
+    if [ -n "$LD_LIBRARY_PATH" ]; then
+        run_after_echo "sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH $TCPDUMP_BIN -#n -c 10"
+    else
+        run_after_echo "sudo $TCPDUMP_BIN -#n -c 10"
     fi
 fi
-# The DEBUG_BUILD variable is not set by default to avoid Travis error message:
-# "The job exceeded the maximum log length, and has been terminated."
-# Setting it needs to reduce the matrix cases.
-if [ "$TRAVIS" = true ] && [ -n "$DEBUG_BUILD" ] ; then
+# Beware that setting MATRIX_DEBUG will produce A LOT of additional output
+# here and in any nested libpcap builds. Multiplied by the matrix size, the
+# full output log size might exceed limits of some CI systems (as previously
+# happened with Travis CI). Use with caution on a reduced matrix.
+if [ "$MATRIX_DEBUG" = true ]; then
     echo '$ cat Makefile [...]'
-    travis_fold start cat_makefile
     sed '/DO NOT DELETE THIS LINE -- mkdep uses it/q' < Makefile
-    travis_fold end cat_makefile
     echo '$ cat config.h'
-    travis_fold start cat_config_h
     cat config.h
-    travis_fold end cat_config_h
     if [ "$CMAKE" = no ]; then
         echo '$ cat config.log'
-        travis_fold start cat_config_log
         cat config.log
-        travis_fold end cat_config_log
     fi
 fi
 if [ "$DELETE_PREFIX" = yes ]; then
index 63d01f736051335cdd695d7aafa1ce027645a7f1..5c5df5eaf8bc63894730d0ef62e8697486ec9897 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh -e
 
 # This script executes the matrix loops, exclude tests and cleaning.
 # It calls the build.sh script which runs one build with setup environment
 # MATRIX_CC='gcc clang', MATRIX_CMAKE='no yes', MATRIX_CRYPTO='no yes',
 # MATRIX_SMB='no yes').
 
-set -e
-
-# ANSI color escape sequences
-ANSI_MAGENTA="\\033[35;1m"
-ANSI_RESET="\\033[0m"
 uname -a
 date
 # Install directory prefix
@@ -26,19 +21,11 @@ if [ -z "$PREFIX" ]; then
 fi
 COUNT=0
 
-travis_fold() {
-    local action=${1:?}
-    local name=${2:?}
-    if [ "$TRAVIS" != true ]; then return; fi
-    echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
-    sleep 1
-}
-
 # Display text in magenta
 echo_magenta() {
-    echo -ne "$ANSI_MAGENTA"
+    printf '\033[35;1m' # ANSI magenta
     echo "$@"
-    echo -ne "$ANSI_RESET"
+    printf '\033[0m' # ANSI reset
 }
 
 build_tcpdump() {
@@ -57,19 +44,15 @@ build_tcpdump() {
                     export SMB
                     COUNT=$((COUNT+1))
                     echo_magenta "===== SETUP $COUNT: BUILD_LIBPCAP=$BUILD_LIBPCAP REMOTE=${REMOTE:-?} CC=$CC CMAKE=$CMAKE CRYPTO=$CRYPTO SMB=$SMB ====="
-                    # LABEL is needed to build the travis fold labels
-                    LABEL="$BUILD_LIBPCAP.$REMOTE.$CC.$CMAKE.$CRYPTO.$SMB"
                     # Run one build with setup environment variables:
                     # BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB
                     ./build.sh
                     echo 'Cleaning...'
-                    travis_fold start cleaning
                     if [ "$CMAKE" = yes ]; then rm -rf build; else make distclean; fi
                     rm -rf "$PREFIX"/bin/tcpdump*
                     git status -suall
                     # Cancel changes in configure
                     git checkout configure
-                    travis_fold end cleaning
                 done
             done
         done
@@ -93,7 +76,7 @@ for BUILD_LIBPCAP in ${MATRIX_BUILD_LIBPCAP:-no yes}; do
         done
     else
         echo_magenta 'Use system libpcap'
-        rm -rf "$PREFIX"/*
+        rm -rf "${PREFIX:?}"/*
         make -C ../libpcap distclean || :
         build_tcpdump
     fi
index 7f748177972d7a9b754fe92d49e2ff1c3bceb859..1972fda8eb05d040c1390495644252fc92fa2d10 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2020 Free Software Foundation, Inc.
+#   Copyright 1992-2021 Free Software Foundation, Inc.
 
-timestamp='2020-12-22'
+timestamp='2021-01-25'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2020 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -188,10 +188,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        #
        # Note: NetBSD doesn't particularly care about the vendor
        # portion of the name.  We always set it to "unknown".
-       sysctl="sysctl -n hw.machine_arch"
        UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
-           "/sbin/$sysctl" 2>/dev/null || \
-           "/usr/sbin/$sysctl" 2>/dev/null || \
+           /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+           /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
            echo unknown))
        case "$UNAME_MACHINE_ARCH" in
            aarch64eb) machine=aarch64_be-unknown ;;
@@ -1087,7 +1086,7 @@ EOF
     ppcle:Linux:*:*)
        echo powerpcle-unknown-linux-"$LIBC"
        exit ;;
-    riscv32:Linux:*:* | riscv64:Linux:*:*)
+    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
@@ -1483,8 +1482,8 @@ EOF
     i*86:rdos:*:*)
        echo "$UNAME_MACHINE"-pc-rdos
        exit ;;
-    i*86:AROS:*:*)
-       echo "$UNAME_MACHINE"-pc-aros
+    *:AROS:*:*)
+       echo "$UNAME_MACHINE"-unknown-aros
        exit ;;
     x86_64:VMkernel:*:*)
        echo "$UNAME_MACHINE"-unknown-esx
index 90bb8aeda63842a27931741f77f33a5bd3c20af7..7f7d0b055ac53ea6bfc7532e101395b8f4ef48c4 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2020 Free Software Foundation, Inc.
+#   Copyright 1992-2021 Free Software Foundation, Inc.
 
-timestamp='2020-12-22'
+timestamp='2021-03-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ Report bugs and patches to <[email protected]>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2020 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -1230,7 +1230,7 @@ case $cpu-$vendor in
                        | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
                        | pru \
                        | pyramid \
-                       | riscv | riscv32 | riscv64 \
+                       | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
                        | rl78 | romp | rs6000 | rx \
                        | s390 | s390x \
                        | score \
@@ -1683,11 +1683,14 @@ fi
 
 # Now, validate our (potentially fixed-up) OS.
 case $os in
-       # Sometimes we do "kernel-abi", so those need to count as OSes.
+       # Sometimes we do "kernel-libc", so those need to count as OSes.
        musl* | newlib* | uclibc*)
                ;;
-       # Likewise for "kernel-libc"
-       eabi | eabihf | gnueabi | gnueabihf)
+       # Likewise for "kernel-abi"
+       eabi* | gnueabi*)
+               ;;
+       # VxWorks passes extra cpu info in the 4th filed.
+       simlinux | simwindows | spe)
                ;;
        # Now accept the basic system types.
        # The portable systems comes first.
@@ -1709,7 +1712,7 @@ case $os in
             | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
             | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
             | udi* | lites* | ieee* | go32* | aux* | hcos* \
-            | chorusrdb* | cegcc* | glidix* \
+            | chorusrdb* | cegcc* | glidix* | serenity* \
             | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
             | midipix* | mingw32* | mingw64* | mint* \
             | uxpv* | beos* | mpeix* | udk* | moxiebox* \
@@ -1751,6 +1754,8 @@ case $kernel-$os in
                ;;
        kfreebsd*-gnu* | kopensolaris*-gnu*)
                ;;
+       vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+               ;;
        nto-qnx*)
                ;;
        os2-emx)
index 03cc6b09d1166deb0c86d00ff16a96cd411dcc8f..18412939c5badbe978db355a26d09b4f4e014b61 100755 (executable)
--- a/configure
+++ b/configure
@@ -5161,9 +5161,9 @@ $as_echo "yes" >&6; }
 $as_echo_n "checking for local pcap library... " >&6; }
         lastdir=FAIL
         places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
-            egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
+            egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT|rc.)?$'`
         places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
-            egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
+            egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT|rc.)?$'`
         for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
             basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \
                 sed -e 's/-PRE-GIT$//' `
index 7c869c3bc7522afdb9b484f6f0e0a7110dcab852..f500aecab7041a766dd729067b44e0ce647bc34a 100644 (file)
@@ -47,7 +47,7 @@ Required build tools
 The Developer's Kit is a ZIP archive; it contains a folder named
 WpdPack, which you should place on your C: drive, e.g. C:\WpdPack.
 
-Building tcpdumpp on Windows requires Visual Studio 2015 or later.  The
+Building tcpdump on Windows requires Visual Studio 2015 or later.  The
 Community Edition of Visual Studio can be downloaded at no cost from
 
   https://visualstudio.microsoft.com
@@ -172,14 +172,29 @@ of the tcpdump source directory.
 
 Run the command
 
-       cmake "-DPacket_ROOT={path-to-sdk}" {path-to-tcpdump-source}
+    cmake "-DPacket_ROOT={path-to-sdk}" -G {generator} {path-to-tcpdump-source}
 
-where {path-to-sdk} is the path of the directory containing the Npcap or
-WinPcap SDK and {path-to-tcpdump-source} is the pathname of the
-top-level source directory for tcpdump.
+{path-to-sdk} is the path of the directory containing the Npcap or
+WinPcap SDK.
+
+{generator} is the string "Visual Studio N YYYY", where "N" is the
+version of Visual Studio and "YYYY" is the year number for that version;
+if you are building a 64-bit version of tcpdump, YYYY must be followed
+by a space and "Win64".  For example, to build a 32-bit version of
+tcpdump with Visual Studio 2017, "{generator}" would be "Visual Studio
+15 2017" and to build a 64-bit version of tcpdump with Visual Studio
+2017, "{generator}" would be "Visual Studio 15 2017 Win64".
+
+{path-to-tcpdump-source} is the pathname of the top-level source
+directory for tcpdump.
 
 Run the command
 
-       msbuild /m tcpdump.sln
+    msbuild /m /nologo /p:Configuration={configuration} tcpdump.sln
+
+where {configuration} can be "Release", "Debug", or "RelWithDebInfo".
+
+Building with MinGW
+-------------------
 
-to compile tcpdump.
+(XXX - this should be added)
index 526c60cab3b94a86c27a1abffe577b459e6aa61b..2a1854fdf4f1de0c143dc2d7945c62467a031e54 100644 (file)
--- a/nameser.h
+++ b/nameser.h
 #define T_RRSIG                46              /* new security signature */
 #define T_NSEC         47              /* provable insecure information */
 #define T_DNSKEY       48              /* new security key */
+#define T_DHCID                49              /* DHCP IDentifier */
+#define T_NSEC3                50              /* Next SECure record v3 */
+#define T_NSEC3PARAM   51              /* NSEC3 PARAMeter */
+#define T_TLSA         52              /* TLS Authentication */
+#define T_SMIMEA       53              /* S/MIME Authentication */
+/* Unassigned */
+#define T_HIP          55              /* Host Identity Protocol */
+#define T_NINFO                56              /* zone status information */
+#define T_RKEY         57              /* Record encryption KEY */
+#define T_TALINK       58              /* Trust Anchor LINK */
+#define T_CDS          59              /* Child Delegation Signer */
+#define T_CDNSKEY      60              /* Child DNSKEY */
+#define T_OPENPGPKEY   61              /* OpenPGP KEY */
+#define T_CSYNC                62              /* Child to parent SYNCronization */
+#define T_ZONEMD       63              /* ZONE data Message Digest */
+#define T_SVCB         64              /* SerViCe Binding */
+#define T_HTTPS                65              /* HTTPS binding */
        /* non standard */
 #define T_SPF          99              /* sender policy framework */
 #define T_UINFO                100             /* user (finger) information */
 #define T_UID          101             /* user ID */
 #define T_GID          102             /* group ID */
 #define T_UNSPEC       103             /* Unspecified format (binary data) */
-#define T_UNSPECA      104             /* "unspecified ASCII". Ugly MIT hack */
+#define T_NID          104             /* Node IDentifier */
+#define T_L32          105             /* Locator 32-bit */
+#define T_L64          106             /* Locator 64-bit */
+#define T_LP           107             /* Locator Pointer */
+#define T_EUI48                108             /* an EUI-48 address */
+#define T_EUI64                109             /* an EUI-64 address */
        /* Query type values which do not appear in resource records */
 #define T_TKEY         249             /* Transaction Key [RFC2930] */
 #define T_TSIG         250             /* Transaction Signature [RFC2845] */
 #define T_MAILA                254             /* transfer mail agent records */
 #define T_ANY          255             /* wildcard match */
 #define T_URI          256             /* uri records [RFC7553] */
+#define T_CAA          257             /* Certification Authority Authorization */
+#define T_AVC          258             /* Application Visibility and Control */
+#define T_DOA          259             /* Digital Object Architecture */
+#define T_AMTRELAY     260             /* Automatic Multicast Tunneling RELAY */
+#define T_TA           32768           /* DNSSEC Trust Authorities */
+#define T_DLV          32769           /* DNSSEC Lookaside Validation */
 
 /*
  * Values for class field
index 6f38fa6c3ab1bbc9a0e35e41be4cabb5f86dba71..644997d8bb3353567c7d7b0d90ff1c567452902c 100644 (file)
@@ -575,7 +575,7 @@ extern int ah_print(netdissect_options *, const u_char *);
 extern void ahcp_print(netdissect_options *, const u_char *, u_int);
 extern void aodv_print(netdissect_options *, const u_char *, u_int, int);
 extern void aoe_print(netdissect_options *, const u_char *, const u_int);
-extern int  arista_ethertype_print(netdissect_options *,const u_char *, u_int);
+extern int arista_ethertype_print(netdissect_options *,const u_char *, u_int);
 extern void arp_print(netdissect_options *, const u_char *, u_int, u_int);
 extern void ascii_print(netdissect_options *, const u_char *, u_int);
 extern void atalk_print(netdissect_options *, const u_char *, u_int);
@@ -597,6 +597,7 @@ extern void cnfp_print(netdissect_options *, const u_char *);
 extern void dccp_print(netdissect_options *, const u_char *, const u_char *, u_int);
 extern void decnet_print(netdissect_options *, const u_char *, u_int, u_int);
 extern void dhcp6_print(netdissect_options *, const u_char *, u_int);
+extern void domain_print(netdissect_options *, const u_char *, u_int, int, int);
 extern int dstopt_process(netdissect_options *, const u_char *);
 extern void dtp_print(netdissect_options *, const u_char *, u_int);
 extern void dvmrp_print(netdissect_options *, const u_char *, u_int);
@@ -610,6 +611,7 @@ extern u_int ether_switch_tag_print(netdissect_options *, const u_char *, u_int,
 extern int ethertype_print(netdissect_options *, u_short, const u_char *, u_int, u_int, const struct lladdr_info *, const struct lladdr_info *);
 extern u_int fddi_print(netdissect_options *, const u_char *, u_int, u_int);
 extern void forces_print(netdissect_options *, const u_char *, u_int);
+extern const u_char *fqdn_print(netdissect_options *, const u_char *, const u_char *);
 extern u_int fr_print(netdissect_options *, const u_char *, u_int);
 extern int frag6_print(netdissect_options *, const u_char *, const u_char *);
 extern void ftp_print(netdissect_options *, const u_char *, u_int);
@@ -625,8 +627,8 @@ extern void hsrp_print(netdissect_options *, const u_char *, u_int);
 extern void http_print(netdissect_options *, const u_char *, u_int);
 extern void icmp6_print(netdissect_options *, const u_char *, u_int, const u_char *, int);
 extern void icmp_print(netdissect_options *, const u_char *, u_int, const u_char *, int);
-extern u_int ieee802_15_4_print(netdissect_options *, const u_char *, u_int);
 extern u_int ieee802_11_radio_print(netdissect_options *, const u_char *, u_int, u_int);
+extern u_int ieee802_15_4_print(netdissect_options *, const u_char *, u_int);
 extern void igmp_print(netdissect_options *, const u_char *, u_int);
 extern void igrp_print(netdissect_options *, const u_char *, u_int);
 extern void ip6_print(netdissect_options *, const u_char *, u_int);
@@ -653,9 +655,7 @@ extern void lwapp_control_print(netdissect_options *, const u_char *, u_int, int
 extern void lwapp_data_print(netdissect_options *, const u_char *, u_int);
 extern void lwres_print(netdissect_options *, const u_char *, u_int);
 extern void m3ua_print(netdissect_options *, const u_char *, const u_int);
-extern int macsec_print(netdissect_options *, const u_char **,
-                        u_int *, u_int *, u_int *, const struct lladdr_info *,
-                        const struct lladdr_info *);
+extern int macsec_print(netdissect_options *, const u_char **, u_int *, u_int *, u_int *, const struct lladdr_info *, const struct lladdr_info *);
 extern u_int mfr_print(netdissect_options *, const u_char *, u_int);
 extern void mobile_print(netdissect_options *, const u_char *, u_int);
 extern int mobility_print(netdissect_options *, const u_char *, const u_char *);
@@ -668,19 +668,17 @@ extern void nbt_tcp_print(netdissect_options *, const u_char *, u_int);
 extern void nbt_udp137_print(netdissect_options *, const u_char *, u_int);
 extern void nbt_udp138_print(netdissect_options *, const u_char *, u_int);
 extern void netbeui_print(netdissect_options *, u_short, const u_char *, u_int);
-extern void nfsreply_print(netdissect_options *, const u_char *, u_int, const u_char *);
 extern void nfsreply_noaddr_print(netdissect_options *, const u_char *, u_int, const u_char *);
+extern void nfsreply_print(netdissect_options *, const u_char *, u_int, const u_char *);
 extern void nfsreq_noaddr_print(netdissect_options *, const u_char *, u_int, const u_char *);
-extern const u_char *fqdn_print(netdissect_options *, const u_char *, const u_char *);
-extern void domain_print(netdissect_options *, const u_char *, u_int, int, int);
 extern void nsh_print(netdissect_options *, const u_char *, u_int);
 extern void ntp_print(netdissect_options *, const u_char *, u_int);
 extern void oam_print(netdissect_options *, const u_char *, u_int, u_int);
 extern void olsr_print(netdissect_options *, const u_char *, u_int, int);
 extern void openflow_print(netdissect_options *, const u_char *, u_int);
 extern void ospf6_print(netdissect_options *, const u_char *, u_int);
-extern void ospf_print(netdissect_options *, const u_char *, u_int, const u_char *);
 extern int ospf_grace_lsa_print(netdissect_options *, const u_char *, u_int);
+extern void ospf_print(netdissect_options *, const u_char *, u_int, const u_char *);
 extern int ospf_te_lsa_print(netdissect_options *, const u_char *, u_int);
 extern void otv_print(netdissect_options *, const u_char *, u_int);
 extern void pgm_print(netdissect_options *, const u_char *, u_int, const u_char *);
@@ -689,8 +687,8 @@ extern void pimv1_print(netdissect_options *, const u_char *, u_int);
 extern u_int ppp_print(netdissect_options *, const u_char *, u_int);
 extern u_int pppoe_print(netdissect_options *, const u_char *, u_int);
 extern void pptp_print(netdissect_options *, const u_char *);
-extern void ptp_print(netdissect_options *, const u_char *, u_int);
 extern int print_unknown_data(netdissect_options *, const u_char *, const char *, u_int);
+extern void ptp_print(netdissect_options *, const u_char *, u_int);
 extern const char *q922_string(netdissect_options *, const u_char *, u_int);
 extern void q933_print(netdissect_options *, const u_char *, u_int);
 extern void radius_print(netdissect_options *, const u_char *, u_int);
@@ -705,13 +703,14 @@ extern void rtsp_print(netdissect_options *, const u_char *, u_int);
 extern void rx_print(netdissect_options *, const u_char *, u_int, uint16_t, uint16_t, const u_char *);
 extern void sctp_print(netdissect_options *, const u_char *, const u_char *, u_int);
 extern void sflow_print(netdissect_options *, const u_char *, u_int);
-extern void ssh_print(netdissect_options *, const u_char *, u_int);
 extern void sip_print(netdissect_options *, const u_char *, u_int);
 extern void slow_print(netdissect_options *, const u_char *, u_int);
 extern void smb_tcp_print(netdissect_options *, const u_char *, u_int);
 extern void smtp_print(netdissect_options *, const u_char *, u_int);
 extern int snap_print(netdissect_options *, const u_char *, u_int, u_int, const struct lladdr_info *, const struct lladdr_info *, u_int);
 extern void snmp_print(netdissect_options *, const u_char *, u_int);
+extern void someip_print(netdissect_options *, const u_char *, const u_int);
+extern void ssh_print(netdissect_options *, const u_char *, u_int);
 extern void stp_print(netdissect_options *, const u_char *, u_int);
 extern void sunrpc_print(netdissect_options *, const u_char *, u_int, const u_char *);
 extern void syslog_print(netdissect_options *, const u_char *, u_int);
@@ -731,10 +730,9 @@ extern void vxlan_gpe_print(netdissect_options *, const u_char *, u_int);
 extern void vxlan_print(netdissect_options *, const u_char *, u_int);
 extern void wb_print(netdissect_options *, const u_char *, u_int);
 extern void zep_print(netdissect_options *, const u_char *, u_int);
-extern void zephyr_print(netdissect_options *, const u_char *, int);
-extern void zmtp1_print(netdissect_options *, const u_char *, u_int);
+extern void zephyr_print(netdissect_options *, const u_char *, u_int);
 extern void zmtp1_datagram_print(netdissect_options *, const u_char *, const u_int);
-extern void someip_print(netdissect_options *, const u_char *, const u_int);
+extern void zmtp1_print(netdissect_options *, const u_char *, u_int);
 
 /* checksum routines */
 extern void init_checksum(void);
index fdd96f051f4bdab235e142d931d0899d3a11308d..1600d0e7f2a7f0dff1b7aa2147952fa8742b0ae1 100644 (file)
@@ -193,26 +193,22 @@ struct mgmt_header_t {
 #define        CAPABILITY_PRIVACY(cap) ((cap) & 0x0010)
 
 struct ssid_t {
-       uint8_t         element_id;
-       uint8_t         length;
+       u_int           length;
        u_char          ssid[33];  /* 32 + 1 for null */
 };
 
 struct rates_t {
-       uint8_t         element_id;
-       uint8_t         length;
+       u_int           length;
        uint8_t         rate[16];
 };
 
 struct challenge_t {
-       uint8_t         element_id;
-       uint8_t         length;
+       u_int           length;
        uint8_t         text[254]; /* 1-253 + 1 for null */
 };
 
 struct fh_t {
-       uint8_t         element_id;
-       uint8_t         length;
+       u_int           length;
        uint16_t        dwell_time;
        uint8_t         hop_set;
        uint8_t hop_pattern;
@@ -220,14 +216,12 @@ struct fh_t {
 };
 
 struct ds_t {
-       uint8_t         element_id;
-       uint8_t         length;
+       u_int           length;
        uint8_t         channel;
 };
 
 struct cf_t {
-       uint8_t         element_id;
-       uint8_t         length;
+       u_int           length;
        uint8_t         count;
        uint8_t         period;
        uint16_t        max_duration;
@@ -235,8 +229,7 @@ struct cf_t {
 };
 
 struct tim_t {
-       uint8_t         element_id;
-       uint8_t         length;
+       u_int           length;
        uint8_t         count;
        uint8_t         period;
        uint8_t         bitmap_control;
@@ -410,15 +403,15 @@ struct meshcntl_t {
        ND_PRINT("%s%2.1f%s", _sep, (.5 * ((_r) & 0x7f)), _suf)
 #define PRINT_RATES(p) \
        if (p.rates_present) { \
-               int z; \
                const char *sep = " ["; \
-               for (z = 0; z < p.rates.length ; z++) { \
-                       PRINT_RATE(sep, p.rates.rate[z], \
-                               (p.rates.rate[z] & 0x80 ? "*" : "")); \
-                       sep = " "; \
-               } \
-               if (p.rates.length != 0) \
+               if (p.rates.length != 0) { \
+                       for (u_int z = 0; z < p.rates.length ; z++) { \
+                               PRINT_RATE(sep, p.rates.rate[z], \
+                                       (p.rates.rate[z] & 0x80 ? "*" : "")); \
+                               sep = " "; \
+                       } \
                        ND_PRINT(" Mbit]"); \
+               } \
        }
 
 #define PRINT_DS_CHANNEL(p) \
@@ -1170,7 +1163,7 @@ parse_elements(netdissect_options *ndo,
 
                switch (GET_U_1(p + offset)) {
                case E_SSID:
-                       memcpy(&ssid, p + offset, 2);
+                       ssid.length = elementlen;
                        offset += 2;
                        length -= 2;
                        if (ssid.length != 0) {
@@ -1194,7 +1187,7 @@ parse_elements(netdissect_options *ndo,
                        }
                        break;
                case E_CHALLENGE:
-                       memcpy(&challenge, p + offset, 2);
+                       challenge.length = elementlen;
                        offset += 2;
                        length -= 2;
                        if (challenge.length != 0) {
@@ -1220,7 +1213,7 @@ parse_elements(netdissect_options *ndo,
                        }
                        break;
                case E_RATES:
-                       memcpy(&rates, p + offset, 2);
+                       rates.length = elementlen;
                        offset += 2;
                        length -= 2;
                        if (rates.length != 0) {
@@ -1252,7 +1245,7 @@ parse_elements(netdissect_options *ndo,
                        }
                        break;
                case E_DS:
-                       memcpy(&ds, p + offset, 2);
+                       ds.length = elementlen;
                        offset += 2;
                        length -= 2;
                        if (ds.length != 1) {
@@ -1276,7 +1269,7 @@ parse_elements(netdissect_options *ndo,
                        }
                        break;
                case E_CF:
-                       memcpy(&cf, p + offset, 2);
+                       cf.length = elementlen;
                        offset += 2;
                        length -= 2;
                        if (cf.length != 6) {
@@ -1300,7 +1293,7 @@ parse_elements(netdissect_options *ndo,
                        }
                        break;
                case E_TIM:
-                       memcpy(&tim, p + offset, 2);
+                       tim.length = elementlen;
                        offset += 2;
                        length -= 2;
                        if (tim.length <= 3U) {
@@ -1908,7 +1901,7 @@ get_data_src_dst_mac(uint16_t fc, const u_char *p, const uint8_t **srcp,
                }
        } else {
                if (!FC_FROM_DS(fc)) {
-                       /* From DS and not To DS */
+                       /* To DS and not From DS */
                        *srcp = ADDR2;
                        *dstp = ADDR3;
                } else {
index d3371641c21974377db3652d50c3ced371ad8ea3..5687d4556d891b2b780818e4a6ea030171430452 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "addrtoname.h"
 
@@ -2020,6 +2021,7 @@ ieee802_15_4_std_frames(netdissect_options *ndo,
                if (len < 0) {
                        return 0;
                }
+               ND_TCHECK_LEN(p, len);
                p += len;
                caplen -= len;
        } else {
@@ -2138,6 +2140,7 @@ ieee802_15_4_std_frames(netdissect_options *ndo,
                                if (len < 0) {
                                        break;
                                }
+                               ND_TCHECK_LEN(p, len);
                                p += len;
                                caplen -= len;
                        }
@@ -2331,6 +2334,7 @@ ieee802_15_4_mp_frame(netdissect_options *ndo,
                if (len < 0) {
                        return 0;
                }
+               ND_TCHECK_LEN(p, len);
                p += len;
                caplen -= len;
        } else {
index 4855332bbae2b88a70b6ef49e4d7a70bb7351eaf..7d3efe74fa02e74b2e9f092338d3111a98cda594 100644 (file)
@@ -424,8 +424,16 @@ arp_print(netdissect_options *ndo,
                break;
 
        case ARPOP_REVREQUEST:
-               ND_PRINT("who-is %s tell %s",
-                         GET_LINKADDR_STRING(THA(ap), linkaddr, HRD_LEN(ap)),
+               /*
+                * XXX - GET_LINKADDR_STRING() may return a pointer to
+                * a static buffer, so we only have one call to it per
+                * ND_PRINT() call.
+                *
+                * This should be done in a cleaner fashion.
+                */
+               ND_PRINT("who-is %s",
+                         GET_LINKADDR_STRING(THA(ap), linkaddr, HRD_LEN(ap)));
+               ND_PRINT(" tell %s",
                          GET_LINKADDR_STRING(SHA(ap), linkaddr, HRD_LEN(ap)));
                break;
 
@@ -436,8 +444,16 @@ arp_print(netdissect_options *ndo,
                break;
 
        case ARPOP_INVREQUEST:
-               ND_PRINT("who-is %s tell %s",
-                         GET_LINKADDR_STRING(THA(ap), linkaddr, HRD_LEN(ap)),
+               /*
+                * XXX - GET_LINKADDR_STRING() may return a pointer to
+                * a static buffer, so we only have one call to it per
+                * ND_PRINT() call.
+                *
+                * This should be done in a cleaner fashion.
+                */
+               ND_PRINT("who-is %s",
+                         GET_LINKADDR_STRING(THA(ap), linkaddr, HRD_LEN(ap)));
+               ND_PRINT(" tell %s",
                          GET_LINKADDR_STRING(SHA(ap), linkaddr, HRD_LEN(ap)));
                break;
 
index a20953726df5572eae27c97e78d241106ffb755e..269055f568acb8ca0b6123fc665740088e56dffc 100644 (file)
@@ -557,8 +557,7 @@ static const struct tok bgp_add_path_recvsend[] = {
     { 0, NULL },
 };
 
-/* allocate space for the largest possible string */
-static char astostr[sizeof("xxxxx.xxxxx")];
+#define AS_STR_SIZE sizeof("xxxxx.xxxxx")
 
 /*
  * as_printf
@@ -761,6 +760,8 @@ bgp_vpn_rd_print(netdissect_options *ndo,
     /* allocate space for the largest possible string */
     static char rd[sizeof("xxxxx.xxxxx:xxxxx (xxx.xxx.xxx.xxx:xxxxx)")];
     char *pos = rd;
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
 
     /* ok lets load the RD format */
     switch (GET_BE_U_2(pptr)) {
@@ -810,6 +811,8 @@ bgp_extended_community_print(netdissect_options *ndo,
         float f;
         uint32_t i;
     } bw;
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
 
     switch (GET_BE_U_2(pptr)) {
 
@@ -915,6 +918,8 @@ bgp_rt_prefix_print(netdissect_options *ndo,
     char rtc_prefix_in_hex[20] = "";
     u_int rtc_prefix_in_hex_len = 0;
     static char output[61]; /* max response string */
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
     uint16_t ec_type = 0;
     u_int octet_count;
     u_int i;
@@ -988,7 +993,8 @@ decode_rt_routing_info(netdissect_options *ndo,
 {
     uint8_t route_target[8];
     u_int plen;
-    char asbuf[sizeof(astostr)]; /* bgp_vpn_rd_print() overwrites astostr */
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
     u_int num_octets;
 
     /* NLRI "prefix length" from RFC 2858 Section 4. */
@@ -1010,7 +1016,7 @@ decode_rt_routing_info(netdissect_options *ndo,
     }
 
     /* With at least "origin AS", possibly with "route target". */
-    as_printf(ndo, asbuf, sizeof(asbuf), GET_BE_U_4(pptr + 1));
+    as_printf(ndo, astostr, sizeof(astostr), GET_BE_U_4(pptr + 1));
 
     plen -= 32; /* adjust prefix length */
 
@@ -1032,7 +1038,7 @@ decode_rt_routing_info(netdissect_options *ndo,
             ((0xff00 >> (plen % 8)) & 0xff);
     }
     ND_PRINT("\n\t      origin AS: %s, %s",
-             asbuf,
+             astostr,
              bgp_rt_prefix_print(ndo, (u_char *)&route_target, plen));
 
     return 5 + num_octets;
@@ -1138,6 +1144,8 @@ static int
 decode_multicast_vpn(netdissect_options *ndo,
                      const u_char *pptr, char *buf, size_t buflen)
 {
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
     uint8_t route_type, route_length;
     u_int addr_length, sg_length;
     u_int offset;
@@ -1863,6 +1871,8 @@ bgp_attr_print(netdissect_options *ndo,
                uint8_t atype, const u_char *pptr, u_int len,
                const unsigned attr_set_level)
 {
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
     u_int i;
     uint16_t af;
     uint8_t safi, snpa, nhlen;
@@ -2508,6 +2518,8 @@ static void
 bgp_capabilities_print(netdissect_options *ndo,
                        const u_char *opt, u_int caps_len)
 {
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
     u_int cap_type, cap_len, tcap_len, cap_offset;
     u_int i = 0;
 
@@ -2636,6 +2648,8 @@ static void
 bgp_open_print(netdissect_options *ndo,
                const u_char *dat, u_int length)
 {
+    /* allocate space for the largest possible string */
+    char astostr[AS_STR_SIZE];
     const struct bgp_open *bgp_open_header;
     u_int optslen;
     const struct bgp_opt *bgpopt;
index c3c6fd8f3d542650f89ade1fa5d114031f56af2a..dcfc9fd21c98b979b488ada95c3dda866c4e0f84 100644 (file)
@@ -495,30 +495,30 @@ const struct tok ns_type2str[] = {
        { T_MX,         "MX" },                 /* RFC 1035 */
        { T_TXT,        "TXT" },                /* RFC 1035 */
        { T_RP,         "RP" },                 /* RFC 1183 */
-       { T_AFSDB,      "AFSDB" },              /* RFC 1183 */
+       { T_AFSDB,      "AFSDB" },              /* RFC 5864 */
        { T_X25,        "X25" },                /* RFC 1183 */
        { T_ISDN,       "ISDN" },               /* RFC 1183 */
        { T_RT,         "RT" },                 /* RFC 1183 */
        { T_NSAP,       "NSAP" },               /* RFC 1706 */
-       { T_NSAP_PTR,   "NSAP_PTR" },
-       { T_SIG,        "SIG" },                /* RFC 2535 */
-       { T_KEY,        "KEY" },                /* RFC 2535 */
+       { T_NSAP_PTR,   "NSAP_PTR" },           /* RFC 1706 */
+       { T_SIG,        "SIG" },                /* RFC 3008 */
+       { T_KEY,        "KEY" },                /* RFC 3110 */
        { T_PX,         "PX" },                 /* RFC 2163 */
        { T_GPOS,       "GPOS" },               /* RFC 1712 */
-       { T_AAAA,       "AAAA" },               /* RFC 1886 */
+       { T_AAAA,       "AAAA" },               /* RFC 3596 */
        { T_LOC,        "LOC" },                /* RFC 1876 */
-       { T_NXT,        "NXT" },                /* RFC 2535 */
+       { T_NXT,        "NXT" },                /* RFC 3755 */
        { T_EID,        "EID" },                /* Nimrod */
        { T_NIMLOC,     "NIMLOC" },             /* Nimrod */
        { T_SRV,        "SRV" },                /* RFC 2782 */
        { T_ATMA,       "ATMA" },               /* ATM Forum */
-       { T_NAPTR,      "NAPTR" },              /* RFC 2168, RFC 2915 */
+       { T_NAPTR,      "NAPTR" },              /* RFC 3403 */
        { T_KX,         "KX" },                 /* RFC 2230 */
-       { T_CERT,       "CERT" },               /* RFC 2538 */
-       { T_A6,         "A6" },                 /* RFC 2874 */
-       { T_DNAME,      "DNAME" },              /* RFC 2672 */
+       { T_CERT,       "CERT" },               /* RFC 4398 */
+       { T_A6,         "A6" },                 /* RFC 6563 */
+       { T_DNAME,      "DNAME" },              /* RFC 6672 */
        { T_SINK,       "SINK" },
-       { T_OPT,        "OPT" },                /* RFC 2671 */
+       { T_OPT,        "OPT" },                /* RFC 6891 */
        { T_APL,        "APL" },                /* RFC 3123 */
        { T_DS,         "DS" },                 /* RFC 4034 */
        { T_SSHFP,      "SSHFP" },              /* RFC 4255 */
@@ -526,20 +526,47 @@ const struct tok ns_type2str[] = {
        { T_RRSIG,      "RRSIG" },              /* RFC 4034 */
        { T_NSEC,       "NSEC" },               /* RFC 4034 */
        { T_DNSKEY,     "DNSKEY" },             /* RFC 4034 */
-       { T_SPF,        "SPF" },                /* RFC-schlitt-spf-classic-02.txt */
+       { T_DHCID,      "DHCID" },              /* RFC 4071 */
+       { T_NSEC3,      "NSEC3" },              /* RFC 5155 */
+       { T_NSEC3PARAM, "NSEC3PARAM" },         /* RFC 5155 */
+       { T_TLSA,       "TLSA" },               /* RFC 6698 */
+       { T_SMIMEA,     "SMIMEA" },             /* RFC 8162 */
+       { T_HIP,        "HIP" },                /* RFC 8005 */
+       { T_NINFO,      "NINFO" },
+       { T_RKEY,       "RKEY" },
+       { T_TALINK,     "TALINK" },
+       { T_CDS,        "CDS" },                /* RFC 7344 */
+       { T_CDNSKEY,    "CDNSKEY" },            /* RFC 7344 */
+       { T_OPENPGPKEY, "OPENPGPKEY" },         /* RFC 7929 */
+       { T_CSYNC,      "CSYNC" },              /* RFC 7477 */
+       { T_ZONEMD,     "ZONEMD" },             /* RFC 8976 */
+       { T_SVCB,       "SVCB" },
+       { T_HTTPS,      "HTTPS" },
+       { T_SPF,        "SPF" },                /* RFC 7208 */
        { T_UINFO,      "UINFO" },
        { T_UID,        "UID" },
        { T_GID,        "GID" },
        { T_UNSPEC,     "UNSPEC" },
-       { T_UNSPECA,    "UNSPECA" },
+       { T_NID,        "NID" },                /* RFC 6742 */
+       { T_L32,        "L32" },                /* RFC 6742 */
+       { T_L64,        "L64" },                /* RFC 6742 */
+       { T_LP,         "LP" },                 /* RFC 6742 */
+       { T_EUI48,      "EUI48" },              /* RFC 7043 */
+       { T_EUI64,      "EUI64" },              /* RFC 7043 */
        { T_TKEY,       "TKEY" },               /* RFC 2930 */
-       { T_TSIG,       "TSIG" },               /* RFC 2845 */
+       { T_TSIG,       "TSIG" },               /* RFC 8945 */
        { T_IXFR,       "IXFR" },               /* RFC 1995 */
-       { T_AXFR,       "AXFR" },               /* RFC 1035 */
+       { T_AXFR,       "AXFR" },               /* RFC 5936 */
        { T_MAILB,      "MAILB" },              /* RFC 1035 */
        { T_MAILA,      "MAILA" },              /* RFC 1035 */
-       { T_ANY,        "ANY" },
+       { T_ANY,        "ANY" },                /* RFC 8482 */
        { T_URI,        "URI" },                /* RFC 7553 */
+       { T_CAA,        "CAA" },                /* RFC 8659 */
+       { T_AVC,        "AVC" },
+       { T_DOA,        "DOA" },
+       { T_AMTRELAY,   "AMTRELAY" },           /* RFC 8777 */
+       { T_TA,         "TA" },
+       { T_DLV,        "DLV" },                /* RFC 8749 */
        { 0,            NULL }
 };
 
@@ -834,13 +861,6 @@ ns_rprint(netdissect_options *ndo,
         }
                break;
 
-       case T_UNSPECA:         /* One long string */
-               if (!ND_TTEST_LEN(cp, len))
-                       return(NULL);
-               if (nd_printn(ndo, cp, len, ndo->ndo_snapend))
-                       return(NULL);
-               break;
-
        case T_TSIG:
            {
                if (cp + len > ndo->ndo_snapend)
index 98f436fefd509c7e9141caae0ca1e5fb63ff3b07..f0d7fbeb12b38d4019a4f0bfa618e6124ec74966 100644 (file)
@@ -147,14 +147,22 @@ q922_string(netdissect_options *ndo, const u_char *p, u_int length)
 
     static u_int dlci, addr_len;
     static uint32_t flags;
-    static char buffer[sizeof("DLCI xxxxxxxxxx")];
+    static char buffer[sizeof("parse_q922_header() returned XXXXXXXXXXX")];
+    int ret;
     memset(buffer, 0, sizeof(buffer));
 
-    if (parse_q922_header(ndo, p, &dlci, &addr_len, &flags, length) == 1){
+    ret = parse_q922_header(ndo, p, &dlci, &addr_len, &flags, length);
+    if (ret == 1) {
         snprintf(buffer, sizeof(buffer), "DLCI %u", dlci);
+        return buffer;
+    } else if (ret == 0) {
+        return "<Invalid DLCI>";
+    } else if (ret == -1) {
+        return "<Truncated>";
+    } else {
+        snprintf(buffer, sizeof(buffer), "parse_q922_header() returned %d", ret);
+        return buffer;
     }
-
-    return buffer;
 }
 
 
index 7c3df49ff2b145ec638c74245ed42c675042edb5..e024b6be7fb160251c36a02dfcd94e0ac745945c 100644 (file)
@@ -30,6 +30,7 @@ __RCSID("NetBSD: print-juniper.c,v 1.3 2007/07/25 06:31:32 dogcow Exp ");
 
 #include <string.h>
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "addrtoname.h"
 #include "extract.h"
@@ -516,11 +517,6 @@ juniper_ggsn_if_print(netdissect_options *ndo,
         }
 
         ndo->ndo_ll_hdr_len += l2info.header_len;
-        return;
-
-trunc:
-        nd_print_trunc(ndo);
-        ndo->ndo_ll_hdr_len += l2info.header_len;
 }
 #endif
 
@@ -599,11 +595,6 @@ juniper_es_if_print(netdissect_options *ndo,
 
         ip_print(ndo, p, l2info.length);
         ndo->ndo_ll_hdr_len += l2info.header_len;
-        return;
-
-trunc:
-        nd_print_trunc(ndo);
-        ndo->ndo_ll_hdr_len += l2info.header_len;
 }
 #endif
 
@@ -643,11 +634,6 @@ juniper_monitor_if_print(netdissect_options *ndo,
         ip_heuristic_guess (ndo, p, l2info.length);
 
         ndo->ndo_ll_hdr_len += l2info.header_len;
-        return;
-
-trunc:
-        nd_print_trunc(ndo);
-        ndo->ndo_ll_hdr_len += l2info.header_len;
 }
 #endif
 
@@ -689,11 +675,6 @@ juniper_services_if_print(netdissect_options *ndo,
         ip_heuristic_guess (ndo, p, l2info.length);
 
         ndo->ndo_ll_hdr_len += l2info.header_len;
-        return;
-
-trunc:
-        nd_print_trunc(ndo);
-        ndo->ndo_ll_hdr_len += l2info.header_len;
 }
 #endif
 
@@ -968,6 +949,8 @@ juniper_mfr_if_print(netdissect_options *ndo,
             ND_PRINT("Bundle-ID %u, ", l2info.bundle);
         switch (l2info.proto) {
         case (LLCSAP_ISONS<<8 | LLCSAP_ISONS):
+            /* At least one byte is required */
+            ND_TCHECK_LEN(p, 1);
             isoclns_print(ndo, p + 1, l2info.length - 1);
             break;
         case (LLC_UI<<8 | NLPID_Q933):
@@ -1068,6 +1051,8 @@ juniper_atm1_if_print(netdissect_options *ndo,
         }
 
         if (GET_U_1(p) == 0x03) { /* Cisco style NLPID encaps ? */
+            /* At least one byte is required */
+            ND_TCHECK_LEN(p, 1);
             isoclns_print(ndo, p + 1, l2info.length - 1);
             /* FIXME check if frame was recognized */
             ndo->ndo_ll_hdr_len += l2info.header_len;
@@ -1135,6 +1120,8 @@ juniper_atm2_if_print(netdissect_options *ndo,
         }
 
         if (GET_U_1(p) == 0x03) { /* Cisco style NLPID encaps ? */
+            /* At least one byte is required */
+            ND_TCHECK_LEN(p, 1);
             isoclns_print(ndo, p + 1, l2info.length - 1);
             /* FIXME check if frame was recognized */
             ndo->ndo_ll_hdr_len += l2info.header_len;
index 632570b0ca69f1e4f958b33f81c8830731002bdb..8b4b318bae31c80c5e9bcaaed86ea1315e3b6156 100644 (file)
@@ -25,7 +25,7 @@
 #include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include "netdissect.h"
 #include "addrtoname.h"
index 51325e28226054caa594250f19ee8a1906d869a2..4a7322cec5421657b62f1246f505d00d55e174d4 100644 (file)
@@ -65,6 +65,16 @@ struct sflow_datagram_t {
     nd_uint32_t        samples;
 };
 
+struct sflow_v6_datagram_t {
+    nd_uint32_t version;
+    nd_uint32_t ip_version;
+    nd_ipv6     agent;
+    nd_uint32_t        agent_id;
+    nd_uint32_t        seqnum;
+    nd_uint32_t        uptime;
+    nd_uint32_t        samples;
+};
+
 struct sflow_sample_header {
     nd_uint32_t        format;
     nd_uint32_t        len;
@@ -806,18 +816,24 @@ sflow_print(netdissect_options *ndo,
             const u_char *pptr, u_int len)
 {
     const struct sflow_datagram_t *sflow_datagram;
+    const struct sflow_v6_datagram_t *sflow_v6_datagram;
     const struct sflow_sample_header *sflow_sample;
 
     const u_char *tptr;
     u_int tlen;
     uint32_t sflow_sample_type, sflow_sample_len;
     uint32_t nsamples;
+    uint32_t ip_version;
 
     ndo->ndo_protocol = "sflow";
     tptr = pptr;
     tlen = len;
     sflow_datagram = (const struct sflow_datagram_t *)pptr;
-    if (len < sizeof(struct sflow_datagram_t)) {
+    sflow_v6_datagram = (const struct sflow_v6_datagram_t *)pptr;
+    ip_version = GET_BE_U_4(sflow_datagram->ip_version);
+
+    if ((len < sizeof(struct sflow_datagram_t) && (ip_version == 1)) ||
+        (len < sizeof(struct sflow_v6_datagram_t) && (ip_version == 2))) {
         ND_PRINT("sFlowv%u", GET_BE_U_4(sflow_datagram->version));
         ND_PRINT(" [length %u < %zu]", len, sizeof(struct sflow_datagram_t));
         nd_print_invalid(ndo);
@@ -837,29 +853,47 @@ sflow_print(netdissect_options *ndo,
     if (ndo->ndo_vflag < 1) {
         ND_PRINT("sFlowv%u, %s agent %s, agent-id %u, length %u",
                GET_BE_U_4(sflow_datagram->version),
-               GET_BE_U_4(sflow_datagram->ip_version) == 1 ? "IPv4" : "IPv6",
-               GET_IPADDR_STRING(sflow_datagram->agent),
-               GET_BE_U_4(sflow_datagram->agent_id),
+               ip_version == 1 ? "IPv4" : "IPv6",
+               ip_version == 1 ? GET_IPADDR_STRING(sflow_datagram->agent) :
+                                 GET_IP6ADDR_STRING( sflow_v6_datagram->agent),
+               ip_version == 1 ? GET_BE_U_4(sflow_datagram->agent_id) :
+                                 GET_BE_U_4(sflow_v6_datagram->agent_id),
                len);
         return;
     }
 
     /* ok they seem to want to know everything - lets fully decode it */
-    nsamples=GET_BE_U_4(sflow_datagram->samples);
-    ND_PRINT("sFlowv%u, %s agent %s, agent-id %u, seqnum %u, uptime %u, samples %u, length %u",
-           GET_BE_U_4(sflow_datagram->version),
-           GET_BE_U_4(sflow_datagram->ip_version) == 1 ? "IPv4" : "IPv6",
-           GET_IPADDR_STRING(sflow_datagram->agent),
-           GET_BE_U_4(sflow_datagram->agent_id),
-           GET_BE_U_4(sflow_datagram->seqnum),
-           GET_BE_U_4(sflow_datagram->uptime),
-           nsamples,
-           len);
-
-    /* skip Common header */
-    tptr += sizeof(struct sflow_datagram_t);
-    tlen -= sizeof(struct sflow_datagram_t);
+    if (ip_version == 1) {
+        nsamples = GET_BE_U_4(sflow_datagram->samples);
+        ND_PRINT("sFlowv%u, %s agent %s, agent-id %u, seqnum %u, uptime %u, samples %u, length %u",
+               GET_BE_U_4(sflow_datagram->version),
+               "IPv4",
+               GET_IPADDR_STRING(sflow_datagram->agent),
+               GET_BE_U_4(sflow_datagram->agent_id),
+               GET_BE_U_4(sflow_datagram->seqnum),
+               GET_BE_U_4(sflow_datagram->uptime),
+               nsamples,
+               len);
+
+        /* skip Common header */
+        tptr += sizeof(struct sflow_datagram_t);
+        tlen -= sizeof(struct sflow_datagram_t);
+    } else {
+        nsamples = GET_BE_U_4(sflow_v6_datagram->samples);
+        ND_PRINT("sFlowv%u, %s agent %s, agent-id %u, seqnum %u, uptime %u, samples %u, length %u",
+               GET_BE_U_4(sflow_v6_datagram->version),
+               "IPv6",
+               GET_IP6ADDR_STRING(sflow_v6_datagram->agent),
+               GET_BE_U_4(sflow_v6_datagram->agent_id),
+               GET_BE_U_4(sflow_v6_datagram->seqnum),
+               GET_BE_U_4(sflow_v6_datagram->uptime),
+               nsamples,
+               len);
 
+        /* skip Common header */
+        tptr += sizeof(struct sflow_v6_datagram_t);
+        tlen -= sizeof(struct sflow_v6_datagram_t);
+    }
     while (nsamples > 0 && tlen > 0) {
         sflow_sample = (const struct sflow_sample_header *)tptr;
 
@@ -878,7 +912,7 @@ sflow_print(netdissect_options *ndo,
                sflow_sample_len);
 
         /* basic sanity check */
-        if (sflow_sample_type == 0 || sflow_sample_len ==0) {
+        if (sflow_sample_type == 0 || sflow_sample_len == 0) {
             return;
         }
 
index ac4e017c0dbf6ff75841ff0ee59c79332a181153..e10ecb35771ac849f12674f9053f608f56270d2c 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 
 #include "extract.h"
@@ -166,6 +167,7 @@ zep_print(netdissect_options *ndo,
                /* Call 802.15.4 dissector. */
                ND_PRINT("\n\t");
                if (ieee802_15_4_print(ndo, bp, inner_len)) {
+                       ND_TCHECK_LEN(bp, len);
                        bp += len;
                        len = 0;
                }
index 7f60f1fdc207d0370bccae7e21be79a1294156c0..aa552aaa657092e3e94746e3735e61e93403c697 100644 (file)
@@ -140,7 +140,7 @@ str_to_lower(const char *string)
 }
 
 void
-zephyr_print(netdissect_options *ndo, const u_char *cp, int length)
+zephyr_print(netdissect_options *ndo, const u_char *cp, u_int length)
 {
     struct z_packet z = {
         NULL,  /* version */
index b9c02c1da7f75e64993d2447023a3c015054b13c..2efb549b5226faf7b8d9b2462dfe267f8d48af8d 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -419,15 +419,15 @@ show_tstamp_types_and_exit(pcap_t *pc, const char *device)
                    device);
                exit_tcpdump(S_SUCCESS);
        }
-       fprintf(stderr, "Time stamp types for %s (use option -j to set):\n",
+       fprintf(stdout, "Time stamp types for %s (use option -j to set):\n",
            device);
        for (i = 0; i < n_tstamp_types; i++) {
                tstamp_type_name = pcap_tstamp_type_val_to_name(tstamp_types[i]);
                if (tstamp_type_name != NULL) {
-                       (void) fprintf(stderr, "  %s (%s)\n", tstamp_type_name,
+                       (void) fprintf(stdout, "  %s (%s)\n", tstamp_type_name,
                            pcap_tstamp_type_val_to_description(tstamp_types[i]));
                } else {
-                       (void) fprintf(stderr, "  %d\n", tstamp_types[i]);
+                       (void) fprintf(stdout, "  %d\n", tstamp_types[i]);
                }
        }
        pcap_free_tstamp_types(tstamp_types);
@@ -456,28 +456,30 @@ show_dlts_and_exit(pcap_t *pc, const char *device)
         * monitor mode might be different from the ones available when
         * not in monitor mode).
         */
+       (void) fprintf(stdout, "Data link types for ");
        if (supports_monitor_mode)
-               (void) fprintf(stderr, "Data link types for %s %s (use option -y to set):\n",
+               (void) fprintf(stdout, "%s %s",
                    device,
                    Iflag ? "when in monitor mode" : "when not in monitor mode");
        else
-               (void) fprintf(stderr, "Data link types for %s (use option -y to set):\n",
+               (void) fprintf(stdout, "%s",
                    device);
+       (void) fprintf(stdout, " (use option -y to set):\n");
 
        for (i = 0; i < n_dlts; i++) {
                dlt_name = pcap_datalink_val_to_name(dlts[i]);
                if (dlt_name != NULL) {
-                       (void) fprintf(stderr, "  %s (%s)", dlt_name,
+                       (void) fprintf(stdout, "  %s (%s)", dlt_name,
                            pcap_datalink_val_to_description(dlts[i]));
 
                        /*
                         * OK, does tcpdump handle that type?
                         */
                        if (!has_printer(dlts[i]))
-                               (void) fprintf(stderr, " (printing not supported)");
-                       fprintf(stderr, "\n");
+                               (void) fprintf(stdout, " (printing not supported)");
+                       fprintf(stdout, "\n");
                } else {
-                       (void) fprintf(stderr, "  DLT %d (printing not supported)\n",
+                       (void) fprintf(stdout, "  DLT %d (printing not supported)\n",
                            dlts[i]);
                }
        }
index 252838c4897869add949d18dc71d9a47bffef0e9..1994335e678a8724e4272c5b8e9e6629e7007f51 100644 (file)
@@ -158,6 +158,8 @@ qinqv           QinQpacket.pcap         QinQpacketv.out  -e -v
 # now SFLOW tests
 sflow1          sflow_multiple_counter_30_pdus.pcap     sflow_multiple_counter_30_pdus.out      -v
 sflow2          sflow_multiple_counter_30_pdus.pcap     sflow_multiple_counter_30_pdus-nv.out
+# ipv6 sflow support
+sflow-v6       sflow-print-v6.pcap                     sflow-print-v6.out                      -vvv
 
 # AHCP and Babel tests
 ahcp-vv         ahcp.pcapng            ahcp-vv.out     -vv
@@ -511,7 +513,7 @@ bfd-raw-auth-sha1-v bfd-raw-auth-sha1.pcap bfd-raw-auth-sha1-v.out -v
 # heap-overflow-1 is in non-bsd.tests
 heap-overflow-2        heap-overflow-2.pcap            heap-overflow-2.out     -v
 heapoverflow-atalk_print       heapoverflow-atalk_print.pcap   heapoverflow-atalk_print.out    -v
-heapoverflow-EXTRACT_16BITS    heapoverflow-EXTRACT_16BITS.pcap        heapoverflow-EXTRACT_16BITS.out -v
+heapoverflow-atalk_2   heapoverflow-atalk_2.pcap       heapoverflow-atalk_2.out        -v
 heapoverflow-ppp_hdlc_if_print heapoverflow-ppp_hdlc_if_print.pcap     heapoverflow-ppp_hdlc_if_print.out      -v
 heapoverflow-q933_printq       heapoverflow-q933_printq.pcap   heapoverflow-q933_printq.out    -v
 heapoverflow-sl_if_print       heapoverflow-sl_if_print.pcap   heapoverflow-sl_if_print.out    -v
diff --git a/tests/sflow-print-v6.out b/tests/sflow-print-v6.out
new file mode 100644 (file)
index 0000000..f6462e4
--- /dev/null
@@ -0,0 +1,666 @@
+    1  04:42:22.951505 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 224) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 109, uptime 113000, samples 1, length 216
+       counter sample (2), length 168, seqnum 28, type 0, idx 23001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 23001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+    2  04:42:23.951517 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 110, uptime 114000, samples 2, length 392
+       counter sample (2), length 168, seqnum 27, type 0, idx 20001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 20001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 3001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 3001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+    3  04:42:24.951541 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 752) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 111, uptime 115000, samples 4, length 744
+       counter sample (2), length 168, seqnum 27, type 0, idx 21001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 21001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 11759, unicast pkts 2, multicast pkts 96, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 18001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 18001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 10001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 10001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 93062, unicast pkts 109, multicast pkts 88, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 1001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 1001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+    4  04:42:25.951447 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 724) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 112, uptime 116000, samples 4, length 716
+       counter sample (2), length 168, seqnum 27, type 0, idx 19001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 19001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 8001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 8001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 4001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 4001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       flow sample (1), length 140, seqnum 3, type 0, idx 7001, rate 1, pool 3, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+    5  04:42:26.951696 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 113, uptime 117000, samples 2, length 392
+       counter sample (2), length 168, seqnum 28, type 0, idx 13001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 13001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 27, type 0, idx 5001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 5001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+    6  04:42:27.951754 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 114, uptime 118000, samples 2, length 392
+       counter sample (2), length 168, seqnum 28, type 0, idx 9001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 9001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 27, type 0, idx 7001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 7001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 192, unicast pkts 3, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 11262, unicast pkts 0, multicast pkts 93, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+    7  04:42:29.952133 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 224) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 115, uptime 120000, samples 1, length 216
+       counter sample (2), length 168, seqnum 27, type 0, idx 14001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 14001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+    8  04:42:31.952116 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 264) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 116, uptime 122000, samples 1, length 256
+       flow sample (1), length 208, seqnum 4, type 0, idx 7001, rate 1, pool 4, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 144
+             protocol Ethernet (1), length 250, stripped bytes 4, header_size 128
+    9  04:42:32.952344 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 224) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 117, uptime 123000, samples 1, length 216
+       counter sample (2), length 168, seqnum 29, type 0, idx 23001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 23001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   10  04:42:33.952451 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 118, uptime 124000, samples 2, length 392
+       counter sample (2), length 168, seqnum 28, type 0, idx 20001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 20001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 3001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 3001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   11  04:42:34.952794 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 752) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 119, uptime 125000, samples 4, length 744
+       counter sample (2), length 168, seqnum 28, type 0, idx 21001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 21001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 12073, unicast pkts 4, multicast pkts 96, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 18001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 18001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 10001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 10001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 96914, unicast pkts 117, multicast pkts 88, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 1001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 1001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   12  04:42:35.952945 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 576) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 120, uptime 126000, samples 3, length 568
+       counter sample (2), length 168, seqnum 28, type 0, idx 19001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 19001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 8001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 8001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 4001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 4001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   13  04:42:36.952896 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 121, uptime 127000, samples 2, length 392
+       counter sample (2), length 168, seqnum 29, type 0, idx 13001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 13001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 5001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 5001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   14  04:42:37.952960 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 616) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 122, uptime 128000, samples 3, length 608
+       counter sample (2), length 168, seqnum 29, type 0, idx 9001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 9001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 28, type 0, idx 7001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 7001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 442, unicast pkts 4, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 11262, unicast pkts 0, multicast pkts 93, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       flow sample (1), length 208, seqnum 5, type 0, idx 7001, rate 1, pool 5, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 144
+             protocol Ethernet (1), length 500, stripped bytes 4, header_size 128
+   15  04:42:39.952953 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 224) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 123, uptime 130000, samples 1, length 216
+       counter sample (2), length 168, seqnum 28, type 0, idx 14001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 14001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   16  04:42:42.952991 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 224) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 124, uptime 133000, samples 1, length 216
+       counter sample (2), length 168, seqnum 30, type 0, idx 23001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 23001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   17  04:42:43.952984 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 125, uptime 134000, samples 2, length 392
+       counter sample (2), length 168, seqnum 29, type 0, idx 20001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 20001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 30, type 0, idx 3001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 3001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   18  04:42:44.953346 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 752) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 126, uptime 135000, samples 4, length 744
+       counter sample (2), length 168, seqnum 29, type 0, idx 21001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 21001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 12573, unicast pkts 5, multicast pkts 96, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 30, type 0, idx 18001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 18001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 30, type 0, idx 10001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 10001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 100512, unicast pkts 124, multicast pkts 88, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 30, type 0, idx 1001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 1001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   19  04:42:45.953345 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 576) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 127, uptime 136000, samples 3, length 568
+       counter sample (2), length 168, seqnum 29, type 0, idx 19001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 19001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 30, type 0, idx 8001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 8001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 30, type 0, idx 4001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 4001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   20  04:42:46.073266 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 1288) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 128, uptime 136000, samples 8, length 1280
+       counter sample (2), length 168, seqnum 30, type 0, idx 13001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 13001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 5001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 5001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       flow sample (1), length 140, seqnum 6, type 0, idx 7001, rate 1, pool 6, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 7, type 0, idx 7001, rate 1, pool 7, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 8, type 0, idx 7001, rate 1, pool 8, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 9, type 0, idx 7001, rate 1, pool 9, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 10, type 0, idx 7001, rate 1, pool 10, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 11, type 0, idx 7001, rate 1, pool 11, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+   21  04:42:46.953386 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 640) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 129, uptime 137000, samples 4, length 632
+       flow sample (1), length 140, seqnum 12, type 0, idx 7001, rate 1, pool 12, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 13, type 0, idx 7001, rate 1, pool 13, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 14, type 0, idx 7001, rate 1, pool 14, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+       flow sample (1), length 140, seqnum 15, type 0, idx 7001, rate 1, pool 15, drops 0, input 7001 output 2147483648 records 2
+           enterprise 0 Extended Switch data (1001) length 16
+             src vlan 10, src pri 0, dst vlan 10, dst pri 0
+           enterprise 0 Raw packet (1) length 76
+             protocol Ethernet (1), length 64, stripped bytes 4, header_size 60
+   22  04:42:47.953302 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 130, uptime 138000, samples 2, length 392
+       counter sample (2), length 168, seqnum 30, type 0, idx 9001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 9001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 29, type 0, idx 7001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 7001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 942, unicast pkts 5, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 11262, unicast pkts 0, multicast pkts 93, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   23  04:42:49.953379 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 224) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 131, uptime 140000, samples 1, length 216
+       counter sample (2), length 168, seqnum 29, type 0, idx 14001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 14001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   24  04:42:52.953435 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 224) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 132, uptime 143000, samples 1, length 216
+       counter sample (2), length 168, seqnum 31, type 0, idx 23001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 23001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+   25  04:42:53.953481 IP6 (flowlabel 0xd50aa, hlim 64, next-header UDP (17) payload length: 400) 30::1:1:1.36123 > 20::1:1:2.6343: [udp sum ok] sFlowv5, IPv6 agent 30::1:1:1, agent-id 0, seqnum 133, uptime 144000, samples 2, length 392
+       counter sample (2), length 168, seqnum 30, type 0, idx 20001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 20001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9717, unicast pkts 0, multicast pkts 79, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
+       counter sample (2), length 168, seqnum 31, type 0, idx 3001, records 2
+           enterprise 0, Ethernet counter (2) length 52
+             align errors 0, fcs errors 0, single collision 0, multiple collision 0, test error 0
+             deferred 0, late collision 0, excessive collision 0, mac trans error 0
+             carrier error 0, frames too long 0, mac receive errors 0, symbol errors 0
+           enterprise 0, Generic counter (1) length 88
+             ifindex 3001, iftype 6, ifspeed 400000000000, ifdirection 1 (full-duplex)
+             ifstatus 3, adminstatus: up, operstatus: up
+             In octets 0, unicast pkts 0, multicast pkts 0, broadcast pkts 0, discards 0
+             In errors 0, unknown protos 0
+             Out octets 9348, unicast pkts 0, multicast pkts 76, broadcast pkts 0, discards 0
+             Out errors 0, promisc mode 0
diff --git a/tests/sflow-print-v6.pcap b/tests/sflow-print-v6.pcap
new file mode 100644 (file)
index 0000000..d44d3bd
Binary files /dev/null and b/tests/sflow-print-v6.pcap differ
index 6ee18cae9e4f9fb03ed3ff82d285660d297ebbe5..ad2c7ecadfd2386cf556331eac15b04ca2eec8d3 100755 (executable)
@@ -7,13 +7,15 @@ TZ=GMT0; export TZ
 for TEST in "$@"; do
     PREFIX=tests
     MATCH=0
-    while read name input output options
+    while read -r name input output options
     do
-        [ _$name = _ ] && continue        # ignore empty lines
-        [ _${name#\#} != _$name ] && continue    # ignore comment lines
-        [ $name != "$TEST" ] && continue    # not the requested test
-        [ _$output = _ ] && continue    # ignore incomplete lines
+        [ -z "$name" ] && continue        # ignore empty lines
+        [ "${name#\#}" != "$name" ] && continue    # ignore comment lines
+        [ "$name" != "$TEST" ] && continue    # not the requested test
+        [ -z "$output" ] && continue    # ignore incomplete lines
         MATCH=1
+        # Word splitting is intentional for $options.
+        # shellcheck disable=SC2086
         ./tcpdump -# -n -r "$PREFIX/$input" $options >"$PREFIX/$output"
     done < $PREFIX/TESTLIST
     [ $MATCH = 0 ] && echo "test $TEST not found" >&2