From 2e8ad34d2aaefca364a0609a8143fcddd8edacb6 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:03:45 -0300 Subject: [PATCH] chore: update conan and GHA versions (#718) --- .github/actions/build-cpp/Dockerfile | 2 +- .github/workflows/build-develop.yml | 80 ++++++++++++------------- .github/workflows/build-release.yml | 54 ++++++++--------- .github/workflows/build_cross.yml | 19 +++--- .github/workflows/build_debug.yml | 16 ++--- .github/workflows/code-ql.yml | 4 +- docker/Dockerfile | 2 +- src/CMakeLists.txt | 5 +- src/handlers/flow/FlowStreamHandler.cpp | 26 ++++---- src/handlers/flow/FlowStreamHandler.h | 2 +- src/inputs/dnstap/UnixFrameSession.h | 1 + src/inputs/flow/SflowData.h | 8 +-- 12 files changed, 108 insertions(+), 111 deletions(-) diff --git a/.github/actions/build-cpp/Dockerfile b/.github/actions/build-cpp/Dockerfile index 9ae312f13..22ddda48c 100644 --- a/.github/actions/build-cpp/Dockerfile +++ b/.github/actions/build-cpp/Dockerfile @@ -15,7 +15,7 @@ WORKDIR /pktvisor-src RUN apt-get update && \ apt-get upgrade --yes --force-yes && \ apt-get install --yes --force-yes --no-install-recommends ${BUILD_DEPS} && \ - pip3 install 'conan==1.61.0' --force-reinstall + pip3 install 'conan==1.64.1' --force-reinstall RUN chmod +x /entrypoint.sh diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index f341dbdd2..52924ca72 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -26,7 +26,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory @@ -42,13 +42,13 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Setup OSX Environment run: echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -88,7 +88,7 @@ jobs: version_number: ${{ env.VERSION }} commit_hash: ${{ env.COMMIT }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory @@ -101,7 +101,7 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: linux package install run: | @@ -109,7 +109,7 @@ jobs: sudo apt-get install --yes --no-install-recommends jq - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -155,7 +155,7 @@ jobs: outputs: version_number: ${{ env.VERSION }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory @@ -168,7 +168,7 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Remove libpcap from conanfile shell: bash @@ -176,7 +176,7 @@ jobs: sed -i -e "s/libpcap.*//g" "${{github.workspace}}\conanfile.txt" - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -221,7 +221,7 @@ jobs: Get-ChildItem -Force ${{github.workspace}}\build\bin - name: Persist to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: windows-build path: | @@ -235,10 +235,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Attach to workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: windows-build @@ -283,13 +283,13 @@ jobs: outputs: version_number: ${{ env.VERSION }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -331,14 +331,14 @@ jobs: run: echo ${{ env.REF_TAG }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.ORB_DOCKERHUB_USERNAME }} password: ${{ secrets.ORB_DOCKERHUB_TOKEN }} @@ -389,7 +389,7 @@ jobs: runs-on: ubuntu-latest #if: github.event_name != 'pull_request' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build @@ -398,7 +398,7 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Configure CMake to generate VERSION shell: bash @@ -440,13 +440,13 @@ jobs: - name: Upload pktvisor-cli artifact env: BINARY_NAME: pktvisor-cli-linux-x86_64-${{ env.VERSION }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ env.BINARY_NAME }} path: ${{github.workspace}}/${{ env.BINARY_NAME }} - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.ORB_DOCKERHUB_USERNAME }} password: ${{ secrets.ORB_DOCKERHUB_TOKEN }} @@ -468,7 +468,7 @@ jobs: mv pktvisor-x86_64.AppImage pktvisor-x86_64-${{ env.VERSION }}.AppImage - name: Upload AppImage artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pktvisor-x86_64-${{ env.VERSION }}.AppImage path: ${{github.workspace}}/appimage/pktvisor-x86_64-${{ env.VERSION }}.AppImage @@ -493,7 +493,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Generate runner token id: token @@ -553,7 +553,7 @@ jobs: terraform output -raw ip > ip.txt - name: Persist IP to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ip path: | @@ -561,7 +561,7 @@ jobs: retention-days: 1 - name: Persist to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: terraform path: | @@ -577,7 +577,7 @@ jobs: if: github.event_name != 'pull_request' steps: - uses: AutoModality/action-clean@v1 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Locking pktvisor integration test state run: | @@ -618,7 +618,7 @@ jobs: echo ${{ needs.package-amd64.outputs.version_number }} > ./automated_tests/output/VERSION - name: Persist to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: workspace path: | @@ -636,7 +636,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: workspace @@ -661,7 +661,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ip @@ -689,10 +689,10 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: terraform path: .github/hosted-runner/amd64/ @@ -734,7 +734,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get branch name shell: bash @@ -797,7 +797,7 @@ jobs: terraform output -raw ip > ip.txt - name: Persist IP to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ip-arm path: | @@ -805,7 +805,7 @@ jobs: retention-days: 1 - name: Persist to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: terraform2 path: | @@ -822,13 +822,13 @@ jobs: sudo chown -R $USER:$USER $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -863,7 +863,7 @@ jobs: echo "DRAFT=true" >> $GITHUB_ENV - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -914,7 +914,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ip-arm @@ -942,10 +942,10 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: terraform2 path: .github/hosted-runner/arm64/ @@ -985,7 +985,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 539cfdccd..6a32bcf7d 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -23,7 +23,7 @@ jobs: os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build @@ -32,10 +32,10 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -70,7 +70,7 @@ jobs: branch_name: ${{ steps.branch.outputs.name }} if: github.event_name != 'pull_request' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Remove suffix from Cmakelists.txt file run: | @@ -84,7 +84,7 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Configure CMake to generate VERSION shell: bash @@ -105,7 +105,7 @@ jobs: echo "::set-output name=name::$(echo ${GITHUB_REF#refs/heads/} | tr / -)" - name: Persist to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: workspace path: ./ @@ -118,7 +118,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -134,7 +134,7 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Configure CMake to generate VERSION shell: bash @@ -179,7 +179,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Generate runner token id: token @@ -241,7 +241,7 @@ jobs: terraform output -raw ip > ip.txt - name: Persist IP to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ip-arm path: | @@ -249,7 +249,7 @@ jobs: retention-days: 1 - name: Persist to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: terraform path: | @@ -266,7 +266,7 @@ jobs: outputs: version_number: ${{ env.VERSION }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory @@ -279,7 +279,7 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Remove libpcap from conanfile shell: bash @@ -287,7 +287,7 @@ jobs: sed -i -e "s/libpcap.*//g" "${{github.workspace}}\conanfile.txt" - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -332,7 +332,7 @@ jobs: Get-ChildItem -Force ${{github.workspace}}\build\bin - name: Persist to workspace - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: windows-build path: | @@ -346,10 +346,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Attach to workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: windows-build @@ -394,7 +394,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: workspace @@ -402,7 +402,7 @@ jobs: run: cmake -E make_directory ${{github.workspace}}/build - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -463,7 +463,7 @@ jobs: run: echo ${{ env.REF_TAG }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -516,7 +516,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: workspace @@ -524,7 +524,7 @@ jobs: run: cmake -E make_directory ${{github.workspace}}/build - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -584,7 +584,7 @@ jobs: run: echo ${{ env.REF_TAG }} - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -634,7 +634,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ip-arm @@ -670,10 +670,10 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Attach to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: terraform path: .github/hosted-runner/arm64/ @@ -713,7 +713,7 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} diff --git a/.github/workflows/build_cross.yml b/.github/workflows/build_cross.yml index c27514eb9..f19639481 100644 --- a/.github/workflows/build_cross.yml +++ b/.github/workflows/build_cross.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Install sccache from cache id: cache-sccache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: bin/sccache key: sccache-v0.2.15 @@ -57,7 +57,7 @@ jobs: - name: Install compiler toolchain from cache id: cache-toolchain - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: toolchain key: toolchain-test-${{matrix.toolchain}} @@ -69,7 +69,7 @@ jobs: curl -L "${{matrix.toolchain}}" | tar -C toolchain -xz --strip-components=1 - name: Install Conan - run: pip install --no-cache-dir 'conan==1.61.0' --force-reinstall + run: pip install --no-cache-dir 'conan==1.64.1' --force-reinstall - name: Create Conan configuration run: | @@ -100,7 +100,7 @@ jobs: EOF - name: Restore sccache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/sccache key: sccache-${{matrix.arch}}-${{github.head_ref||github.event.ref}}-${{github.run_id}} @@ -109,7 +109,7 @@ jobs: sccache-${{matrix.arch}}-${{github.base_ref||github.event.repository.default_branch}}- - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: src @@ -134,7 +134,6 @@ jobs: -DCRASHPAD_NOT_SUPPORTED=true \ -DCMAKE_C_COMPILER_LAUNCHER="${{github.workspace}}/bin/sccache" -DCMAKE_CXX_COMPILER_LAUNCHER="${{github.workspace}}/bin/sccache" \ -DPKTVISOR_CONAN_INIT=OFF -DPKTVISOR_CONAN_BUILD="never" -DPKTVISOR_CONAN_BUILD_PROFILE="default" -DPKTVISOR_CONAN_HOST_PROFILE="host" \ - -DProtobuf_PROTOC_EXECUTABLE=$(command -v protoc) \ -DCORRADE_RC_PROGRAM=$(command -v corrade-rc) \ -DCMAKE_CXX_STANDARD_LIBRARIES=-latomic @@ -148,14 +147,14 @@ jobs: "${{github.workspace}}/bin/sccache" -s - name: Upload pktvisord - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pktvisord-linux-${{matrix.arch}}-static path: build/bin/pktvisord retention-days: 7 - name: Upload pktvisor-reader - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pktvisor-reader-linux-${{matrix.arch}}-static path: build/bin/pktvisor-reader @@ -173,7 +172,7 @@ jobs: arch: armv7lh steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure CMake to generate VERSION shell: bash @@ -212,7 +211,7 @@ jobs: goarch: "arm64" - name: Upload pktvisor-cli - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pktvisor-cli-${{matrix.os}}-${{matrix.arch}} path: pktvisor-cli diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index 573d2eaf1..13348cb41 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -20,7 +20,7 @@ jobs: outputs: version_number: ${{ steps.build.outputs.version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory @@ -33,10 +33,10 @@ jobs: id: conan uses: turtlebrowser/get-conan@main with: - version: 1.61.0 + version: 1.64.1 - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -91,13 +91,13 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build - name: Setup Conan Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{github.workspace}}/build/conan_home/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }} @@ -125,7 +125,7 @@ jobs: run: ls -lha . - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pktvisor-artifacts path: ./ @@ -136,7 +136,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download to workspace - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: pktvisor-artifacts @@ -183,7 +183,7 @@ jobs: sed -i -e "s/CP_URL/$ESCAPED_REPLACE/g" docker/run.sh - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/code-ql.yml b/.github/workflows/code-ql.yml index 42a34cadb..73aab310f 100644 --- a/.github/workflows/code-ql.yml +++ b/.github/workflows/code-ql.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -60,7 +60,7 @@ jobs: - run: | # Run Build - set up dependencies, env vars, compile, and make test #install conan - pip install --no-cache-dir 'conan==1.61.0' --force-reinstall + pip install --no-cache-dir 'conan==1.64.1' --force-reinstall # create conan config CONAN_V2_MODE=1 conan config init conan config set general.revisions_enabled=1 diff --git a/docker/Dockerfile b/docker/Dockerfile index fa53ffbd5..898700706 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ RUN \ apt-get update && \ apt-get upgrade --yes --force-yes && \ apt-get install --yes --force-yes --no-install-recommends ${BUILD_DEPS} && \ - pip3 install "conan==1.61.0" + pip3 install "conan==1.64.1" # need git for current hash for VERSION COPY ./.git/ /pktvisor-src/.git/ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa58586d4..56b1238e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,11 +4,8 @@ message(STATUS "visor-core") set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON) #generate cpp code from opentelemetry-proto -if(NOT CMAKE_CROSSCOMPILING) - # Workaround due to changes in protobuf conan receipt - set(PROTOC_PROGRAM ${CONAN_BIN_DIRS_PROTOBUF}/protoc) -endif() find_package(Protobuf REQUIRED) +find_program(PROTOBUF_PROTOC_EXECUTABLE NAMES protoc PATHS ${CONAN_BIN_DIRS_PROTOBUF}) set(OTELCPP_PROTO_PATH ${CONAN_OPENTELEMETRY-PROTO_ROOT}/res) set(BUILD_SHARED_LIBS FALSE) include(opentelemetry-tools) diff --git a/src/handlers/flow/FlowStreamHandler.cpp b/src/handlers/flow/FlowStreamHandler.cpp index aa90bcbba..023def7dc 100644 --- a/src/handlers/flow/FlowStreamHandler.cpp +++ b/src/handlers/flow/FlowStreamHandler.cpp @@ -339,13 +339,13 @@ void FlowStreamHandler::process_sflow_cb(const SFSample &payload, [[maybe_unused flow.is_ipv6 = true; } - flow.l4 = IP_PROTOCOL::UNKNOWN_IP; + flow.l4 = FLOW_IP_PROTOCOL::UNKNOWN_IP; switch (sample.dcd_ipProtocol) { - case IP_PROTOCOL::TCP: - flow.l4 = IP_PROTOCOL::TCP; + case FLOW_IP_PROTOCOL::TCP: + flow.l4 = FLOW_IP_PROTOCOL::TCP; break; - case IP_PROTOCOL::UDP: - flow.l4 = IP_PROTOCOL::UDP; + case FLOW_IP_PROTOCOL::UDP: + flow.l4 = FLOW_IP_PROTOCOL::UDP; break; } @@ -422,13 +422,13 @@ void FlowStreamHandler::process_netflow_cb(const std::string &senderIP, const NF flow.is_ipv6 = true; } - flow.l4 = IP_PROTOCOL::UNKNOWN_IP; + flow.l4 = FLOW_IP_PROTOCOL::UNKNOWN_IP; switch (sample.protocol) { - case IP_PROTOCOL::TCP: - flow.l4 = IP_PROTOCOL::TCP; + case FLOW_IP_PROTOCOL::TCP: + flow.l4 = FLOW_IP_PROTOCOL::TCP; break; - case IP_PROTOCOL::UDP: - flow.l4 = IP_PROTOCOL::UDP; + case FLOW_IP_PROTOCOL::UDP: + flow.l4 = FLOW_IP_PROTOCOL::UDP; break; } @@ -1302,10 +1302,10 @@ void FlowMetricsBucket::process_interface(bool deep, FlowInterface *iface, const } switch (flow.l4) { - case IP_PROTOCOL::UDP: + case FLOW_IP_PROTOCOL::UDP: iface->counters.at(type).UDP += aggregator; break; - case IP_PROTOCOL::TCP: + case FLOW_IP_PROTOCOL::TCP: iface->counters.at(type).TCP += aggregator; break; default: @@ -1319,7 +1319,7 @@ void FlowMetricsBucket::process_interface(bool deep, FlowInterface *iface, const } auto proto = network::Protocol::TCP; - if (flow.l4 == IP_PROTOCOL::UDP) { + if (flow.l4 == FLOW_IP_PROTOCOL::UDP) { proto = network::Protocol::UDP; } diff --git a/src/handlers/flow/FlowStreamHandler.h b/src/handlers/flow/FlowStreamHandler.h index 7c8733102..ecccf4cd4 100644 --- a/src/handlers/flow/FlowStreamHandler.h +++ b/src/handlers/flow/FlowStreamHandler.h @@ -78,7 +78,7 @@ typedef std::unordered_map EnrichData; struct FlowData { bool is_ipv6; - IP_PROTOCOL l4; + FLOW_IP_PROTOCOL l4; size_t payload_size; uint32_t packets; uint8_t tos; diff --git a/src/inputs/dnstap/UnixFrameSession.h b/src/inputs/dnstap/UnixFrameSession.h index 997c70d57..7c583c925 100644 --- a/src/inputs/dnstap/UnixFrameSession.h +++ b/src/inputs/dnstap/UnixFrameSession.h @@ -6,6 +6,7 @@ #include "DnstapException.h" #include +#include #include #include #include diff --git a/src/inputs/flow/SflowData.h b/src/inputs/flow/SflowData.h index 2c7a384c5..e7add12cb 100644 --- a/src/inputs/flow/SflowData.h +++ b/src/inputs/flow/SflowData.h @@ -34,7 +34,7 @@ enum DIRECTION { OUT_DIR = 4 }; -enum IP_PROTOCOL { +enum FLOW_IP_PROTOCOL { UNKNOWN_IP = 0, ICMP = 1, TCP = 6, @@ -468,14 +468,14 @@ static void decodeIPLayer4(SFSample *sample, uint8_t *ptr) return; } switch (sample->s.dcd_ipProtocol) { - case ICMP: { + case FLOW_IP_PROTOCOL::ICMP: { struct myicmphdr icmp; memcpy(&icmp, ptr, sizeof(icmp)); sample->s.dcd_sport = icmp.type; sample->s.dcd_dport = icmp.code; sample->s.offsetToPayload = ptr + sizeof(icmp) - sample->s.header; } break; - case TCP: { + case FLOW_IP_PROTOCOL::TCP: { struct mytcphdr tcp; int headerBytes; memcpy(&tcp, ptr, sizeof(tcp)); @@ -486,7 +486,7 @@ static void decodeIPLayer4(SFSample *sample, uint8_t *ptr) ptr += headerBytes; sample->s.offsetToPayload = ptr - sample->s.header; } break; - case UDP: { + case FLOW_IP_PROTOCOL::UDP: { struct myudphdr udp; memcpy(&udp, ptr, sizeof(udp)); sample->s.dcd_sport = ntohs(udp.uh_sport);