Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attestation update #12

Merged
merged 26 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
316ea6e
Clang-format for Packet++ (#1510)
tigercosmos Aug 7, 2024
0a84311
support RawSocketDevice with timeout in millisecond precision. (#1529)
tigercosmos Aug 8, 2024
eba1e18
Merge branch 'dev' into attestation
egecetin Aug 11, 2024
39913f1
Fix precision issue on pcapng reader (#1514)
mserdarsanli Aug 12, 2024
650e6da
Broke up PcapLiveDeviceList initialization into steps. (#1515)
Dimi1010 Aug 12, 2024
8344607
Fix codecov reports (#1524)
egecetin Aug 12, 2024
28ac121
Merge branch 'dev' into attestation
tigercosmos Aug 12, 2024
0122aba
Fix LightPcapNg timestamp calculation (#1535)
seladb Aug 14, 2024
0cc772e
Replace netifaces by scapy (#1489)
zhengfeihe Aug 14, 2024
6627ab7
Fix unknown read in TelnetLayer (#1534)
egecetin Aug 14, 2024
b27e84f
Clang-format for Pcap++ (#1516)
Dimi1010 Aug 14, 2024
540a29b
Merge branch 'dev' into attestation
egecetin Aug 14, 2024
c845b40
Removed dead code from PcapRemoteDevice. (#1538)
Dimi1010 Aug 16, 2024
9d175ca
support ubuntu 24 in CI (#1486)
tigercosmos Aug 19, 2024
ee49adb
change logger output to stderr (#1541)
tigercosmos Aug 19, 2024
fee4e87
Parse ASN.1 root record in x509 certificates (#1540)
seladb Aug 20, 2024
2e9aebb
Update macOS packaging (#1542)
seladb Aug 20, 2024
a3a99cb
Added a RAII PcapHandle wrapper class that manages a Pcap handle. (#1…
Dimi1010 Aug 22, 2024
91cde5e
Disable jobs of old pushes to speed up PR runners (#1545)
egecetin Aug 22, 2024
fdd4caf
Refactor DHCP port checking code in DhcpLayer (#1546)
nadongjun Aug 23, 2024
8689c8d
Merge branch 'dev' into attestation
egecetin Aug 23, 2024
0a8c11b
Fixes various MSVC compiler warnings. (#1547)
Dimi1010 Aug 25, 2024
fa22ff2
Add new pre-commit hooks (#1543)
egecetin Aug 25, 2024
6f56f63
remove unnecessary id
egecetin Aug 25, 2024
d0109c3
Merge remote-tracking branch 'upstream/dev' into attestation
egecetin Aug 25, 2024
c69aad1
Merge branch 'master' into attestation
egecetin Aug 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 65 additions & 48 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ env:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest
Expand All @@ -32,6 +36,7 @@ jobs:
apk update && apk add cppcheck python3-dev
python3 -m pip install cmake-format clang-format==18.1.6

# TODO: investigate how to run pre-commit with `venv`
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

- name: CMake format
Expand All @@ -52,29 +57,24 @@ jobs:
container: seladb/${{ matrix.image }}
strategy:
matrix:
include:
include: # Check the images at https://github.com/seladb/PcapPlusPlus-DockerImages
- image: ubuntu2404
config-zstd: OFF
- image: ubuntu2204
python: python3
config-zstd: OFF
- image: ubuntu2204-icpx
python: python3
config-zstd: OFF
additional-flags: -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
additional-gcov-flags: --gcov-executable "llvm-cov gcov"
- image: ubuntu2004
python: python3
config-zstd: OFF
- image: rhel94
python: python3
config-zstd: OFF
- image: ubuntu2004-zstd
python: python3
config-zstd: ON
- image: fedora39
python: python3
config-zstd: OFF
- image: alpine317
python: python3
config-zstd: OFF

steps:
Expand All @@ -95,7 +95,10 @@ jobs:
id: ccache-restore
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ env.CCACHE_DIR }}
path: |
${{ env.CCACHE_DIR }}
!*.gcda
!*.gcno
key: ${{ matrix.image }}-ccache-${{ github.run_id }}
restore-keys: |
${{ matrix.image }}-ccache
Expand All @@ -106,18 +109,23 @@ jobs:
- name: Build PcapPlusPlus
run: cmake --build "$BUILD_DIR" -j

- name: Prepare environment for tests
run: |
python3 -m venv ./venv
. ./venv/bin/activate
python3 -m pip install -r ci/run_tests/requirements.txt

- name: Test PcapPlusPlus
run: |
${{ matrix.python }} -m pip install -U pip
${{ matrix.python }} -m pip install -r ci/run_tests/requirements.txt
${{ matrix.python }} ci/run_tests/run_tests.py --interface eth0 ${{ matrix.test-flags }}
. ./venv/bin/activate
python3 ci/run_tests/run_tests.py --interface eth0 ${{ matrix.test-flags }}

- name: Test Examples
run: |
. ./venv/bin/activate
cd Tests/ExamplesTest
${{ matrix.python }} -m pip install -U pip
${{ matrix.python }} -m pip install -r requirements.txt
${{ matrix.python }} -m pytest --interface eth0 --root-path=../../Dist/examples_bin
python3 -m pip install -r requirements.txt
python3 -m pytest --interface eth0 --root-path=../../Dist/examples_bin

- name: Check installation
run: |
Expand All @@ -133,20 +141,21 @@ jobs:
- name: Test Tutorials
run: cd build_examples/tutorials_bin && ./Tutorial-HelloWorld

# - name: Create Cobertura Report
# run: |
# ${{ matrix.python }} -m pip install gcovr
# gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml

# - name: Upload Coverage Results
# uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
# with:
# files: ./coverage.xml
# flags: ${{ matrix.image }},unittest
# fail_ci_if_error: false
# verbose: true
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Create Cobertura Report
run: |
. ./venv/bin/activate
python3 -m pip install gcovr
gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml

- name: Upload Coverage Results
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./coverage.xml
flags: ${{ matrix.image }},unittest
fail_ci_if_error: false
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Save Ccache
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down Expand Up @@ -340,19 +349,23 @@ jobs:
- name: Check architecture
run: lipo $BUILD_DIR/Pcap++/libPcap++.a -verify_arch ${{ matrix.arch }}

- name: Prepare environment for tests
run: |
python -m venv ./venv
. ./venv/bin/activate
python -m pip install -r ci/run_tests/requirements.txt

- name: Test PcapPlusPlus
# We can't run cross compiled binaries
if: ${{ matrix.host-arch == matrix.arch }}
run: |
python -m pip install -U pip
python -m pip install -r ci/run_tests/requirements.txt
. ./venv/bin/activate
python ci/run_tests/run_tests.py --interface en0

- name: Test Examples
if: ${{ matrix.host-arch == matrix.arch }}
run: |
cd Tests/ExamplesTest
python -m pip install -U pip
python -m pip install -r requirements.txt
python -m pytest --interface en0 --use-sudo --root-path=../../Dist/examples_bin

Expand All @@ -378,16 +391,16 @@ jobs:
python3 -m pip install gcovr
gcovr -v -r . $GCOVR_FLAGS -o coverage.xml

# - name: Upload Coverage Results
# uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
# if: ${{ matrix.host-arch == matrix.arch }}
# with:
# files: ./coverage.xml
# flags: ${{ matrix.os-version }},unittest
# fail_ci_if_error: false
# verbose: true
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload Coverage Results
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
if: ${{ matrix.host-arch == matrix.arch }}
with:
files: ./coverage.xml
flags: ${{ matrix.os-version }},unittest
fail_ci_if_error: false
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Save Ccache
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down Expand Up @@ -468,7 +481,7 @@ jobs:
run: gcovr -v -g -k -r . $env:GCOVR_FLAGS.split() -o coverage.xml

- name: Upload Coverage Results
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./coverage.xml
flags: ${{ matrix.sys }},unittest
Expand Down Expand Up @@ -559,7 +572,7 @@ jobs:
python -m pytest --root-path=../../Dist/examples_bin

- name: Upload Coverage Results
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./Tests/Pcap++Test/Pcap++Coverage.xml,./Tests/Packet++Test/Packet++Coverage.xml
flags: ${{ matrix.os }},unittest,${{ matrix.pcap_lib }}
Expand Down Expand Up @@ -602,7 +615,6 @@ jobs:

echo "Testing PcapPlusPlus examples"
cd Tests/ExamplesTest
python3 -m ensurepip
python3 -m pip install -r requirements.txt
python3 -m pytest --interface "$interface_name" --root-path=../../Dist/examples_bin

Expand Down Expand Up @@ -706,10 +718,15 @@ jobs:
- name: Build PcapPlusPlus
run: cmake --build $BUILD_DIR -j

- name: Test PcapPlusPlus
- name: Prepare environment for tests
run: |
python -m pip install -U pip
python -m venv ./venv
. ./venv/bin/activate
python -m pip install -r ci/run_tests/requirements.txt

- name: Test PcapPlusPlus
run: |
. ./venv/bin/activate
python ci/run_tests/run_tests.py --interface eth0 --use-sudo --pcap-test-args="-t xdp"

- name: Create Cobertura Report
Expand All @@ -718,7 +735,7 @@ jobs:
gcovr -v -r . $GCOVR_FLAGS -o coverage.xml

- name: Upload Coverage Results
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./coverage.xml
flags: xdp,unittest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Fuzzing:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
doxygen:
runs-on: ubuntu-latest
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
strategy:
matrix:
include:
- image: ubuntu2404
config-zstd: OFF
- image: ubuntu2204
config-zstd: OFF
- image: ubuntu2204-icpx
Expand Down Expand Up @@ -69,7 +71,6 @@ jobs:
run: cmake --build "$BUILD_DIR" --target package

- name: Generate artifact attestation
id: attestation
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ env.BUILD_DIR }}/*.tar.gz,${{ env.BUILD_DIR }}/*.deb,${{ env.BUILD_DIR }}/*.rpm"
Expand Down Expand Up @@ -112,7 +113,6 @@ jobs:
cmake --build "$BUILD_DIR" --target package

- name: Generate artifact attestation
id: attestation
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ env.BUILD_DIR }}/*.tar.gz"
Expand All @@ -127,14 +127,14 @@ jobs:
artifacts: "${{ env.BUILD_DIR }}/*.tar.gz"

macos:
runs-on: macos-12
runs-on: macos-14
permissions:
contents: write
attestations: write
id-token: write
strategy:
matrix:
xcode-version: [14.2.0, 13.4.1]
xcode-version: [15.4, 14.3.1]
arch: [x86_64, arm64]

steps:
Expand All @@ -156,7 +156,6 @@ jobs:
run: cmake --build "$BUILD_DIR" --target package

- name: Generate artifact attestation
id: attestation
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ env.BUILD_DIR }}/*.tar.gz,${{ env.BUILD_DIR }}/*.pkg"
Expand Down Expand Up @@ -227,7 +226,6 @@ jobs:
run: cmake --build "$BUILD_DIR" --target package

- name: Generate artifact attestation
id: attestation
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ env.BUILD_DIR }}/*.zip"
Expand Down Expand Up @@ -277,7 +275,6 @@ jobs:
run: cmake --build "$env:BUILD_DIR" --config ${{ matrix.configuration }} --target package

- name: Generate artifact attestation
id: attestation
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ env.BUILD_DIR }}/*.zip"
Expand Down Expand Up @@ -368,7 +365,6 @@ jobs:
tar cvf "${PACKAGE_DIR}.tar.gz" "${PACKAGE_DIR}"

- name: Generate artifact attestation
id: attestation
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ env.PACKAGE_DIR }}.tar.gz"
Expand Down
16 changes: 13 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-symlinks
- id: end-of-file-fixer
- id: forbid-submodules
- id: mixed-line-ending
args: ['--fix=lf']
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
Expand All @@ -23,8 +29,8 @@ repos:
rev: v1.3.5
hooks:
- id: clang-format
args: ["--style=file"] # Use the .clang-format file for configuration
files: ^(Common\+\+|Tests|Examples)/.*\.(cpp|h)$
args: ["--style=file", "-i"] # Use the .clang-format file for configuration and apply all fixes
files: ^(Common\+\+|Packet\+\+|Pcap\+\+|Tests|Examples)/.*\.(cpp|h)$
- id: cppcheck
args: ["--std=c++11", "--language=c++", "--suppressions-list=cppcheckSuppressions.txt", "--inline-suppr", "--force"]
- repo: https://github.com/codespell-project/codespell
Expand All @@ -38,3 +44,7 @@ repos:
- id: typos
args: ['--config=typos-config.toml']
pass_filenames: false
- repo: https://github.com/lovesegfault/beautysh
rev: v6.2.1
hooks:
- id: beautysh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef struct _light_pcapng_file_info {
size_t user_app_desc_size;
size_t interface_block_count;
uint16_t link_types[MAX_SUPPORTED_INTERFACE_BLOCKS];
double timestamp_resolution[MAX_SUPPORTED_INTERFACE_BLOCKS];
uint64_t timestamp_ticks_per_second[MAX_SUPPORTED_INTERFACE_BLOCKS]; // PCPP patch

} light_pcapng_file_info;

Expand Down
Loading
Loading