Skip to content

Add multi-packet serialization (PacketSerializer, serializePackets) - #2267

Open
seladb wants to merge 8 commits into
protocol-layer-serializationfrom
multi-packet-serialization
Open

seladb wants to merge 8 commits into
protocol-layer-serializationfrom
multi-packet-serialization

Conversation

@seladb

@seladb seladb commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Adds serialization support for collections of packets, building on the packet/layer serialization framework from #2259.

What's included:

  • PacketSerializer: serializes a collection of packets into one JSON array, via addPacket()/addPackets()
  • serializePackets(): reads every packet from an IFileReaderDevice and serializes them into one array, returning the packet count
  • Tests for both, in PacketUtilsTests.cpp and FileTests.cpp

Depends on #2261.

Part of the packet serialization series (see #2259).

- Add `serializePackets()` to serialize a pcap file
@seladb seladb changed the title Packet collection serialization Add multi-packet serialization (PacketSerializer, serializePackets) Sep 21, 2026
- Add doxygen
- Open device if not already open
@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.34641% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.67%. Comparing base (a3edc64) to head (f4d082d).

Files with missing lines Patch % Lines
Tests/Packet++Test/Tests/PacketUtilsTests.cpp 98.78% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           protocol-layer-serialization    #2267      +/-   ##
================================================================
+ Coverage                         82.56%   82.67%   +0.10%     
================================================================
  Files                               339      340       +1     
  Lines                             62134    62217      +83     
  Branches                          12880    12759     -121     
================================================================
+ Hits                              51303    51435     +132     
+ Misses                             9951     9918      -33     
+ Partials                            880      864      -16     
Flag Coverage Δ
23.11.6 7.04% <0.00%> (+<0.01%) ⬆️
24.11.5 7.00% <0.00%> (-0.06%) ⬇️
25.11.1 7.00% <0.00%> (-0.04%) ⬇️
alpine320 76.54% <100.00%> (+0.08%) ⬆️
fedora42 76.05% <100.00%> (+0.06%) ⬆️
macos-15 82.37% <98.56%> (+0.04%) ⬆️
macos-26 82.37% <98.56%> (+0.03%) ⬆️
macos-26-intel 82.31% <98.56%> (+0.04%) ⬆️
mingw32 ?
mingw64 ?
npcap 85.34% <100.00%> (+0.01%) ⬆️
rhel94 75.89% <100.00%> (+0.10%) ⬆️
ubuntu2204 75.91% <100.00%> (+0.06%) ⬆️
ubuntu2404 76.20% <100.00%> (+0.08%) ⬆️
ubuntu2604 76.13% <100.00%> (+0.06%) ⬆️
ubuntu2604-arm64 76.03% <100.00%> (+0.08%) ⬆️
ubuntu2604-icpx 58.83% <75.00%> (-0.01%) ⬇️
unittest 82.67% <99.34%> (+0.10%) ⬆️
windows-2022 85.33% <100.00%> (+0.01%) ⬆️
windows-2025 85.05% <100.00%> (+0.01%) ⬆️
winpcap 85.23% <100.00%> (+0.01%) ⬆️
xdp 53.75% <67.50%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@seladb
seladb marked this pull request as ready for review September 21, 2026 08:21
Comment on lines +81 to +82
PacketSerializer(const PacketSerializer&) = delete;
PacketSerializer& operator=(const PacketSerializer&) = delete;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be moved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants