Skip to content

Add serialization for: EthDot3, VLAN, VXLAN, LLC, SLL, SLL2, MPLS, Null/loopback, TPKT, WOL - #2277

Merged
seladb merged 3 commits into
devfrom
protocol-layer-serialization2
Sep 29, 2026
Merged

seladb merged 3 commits into
devfrom
protocol-layer-serialization2

Conversation

@seladb

@seladb seladb commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Adds serialization support for the following layers, following the pattern introduced in : EthDot3, VLAN, VXLAN, LLC, SLL, SLL2, MPLS, Null/Loopback, TPKT and Wake-on-LAN.

Each layer now:

  • Declares a SerializedFields struct with a FieldDescriptor per field and an all() method that returns the layer's fields together with those of Layer::SerializedFields
  • Overrides serializeLayer(ObjectScope&) to write those fields

…LLC, SLL, SLL2, MPLS, Null/loopback, TPKT, WOL
@seladb seladb changed the title Add serialization for the following protocols: EthDot3, VLAN, VXLAN, … Add serialization for: EthDot3, VLAN, VXLAN, LLC, SLL, SLL2, MPLS, Null/loopback, TPKT, WOL Sep 28, 2026
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.69%. Comparing base (ad344a8) to head (fc05698).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2277      +/-   ##
==========================================
+ Coverage   82.61%   82.69%   +0.08%     
==========================================
  Files         339      339              
  Lines       61875    62024     +149     
  Branches    13036    12830     -206     
==========================================
+ Hits        51115    51289     +174     
+ Misses       9877     9855      -22     
+ Partials      883      880       -3     
Flag Coverage Δ
23.11.6 7.08% <0.00%> (-0.02%) ⬇️
24.11.5 7.05% <0.00%> (-0.02%) ⬇️
25.11.1 7.09% <0.00%> (-0.02%) ⬇️
alpine320 76.71% <100.00%> (+0.12%) ⬆️
fedora42 76.23% <100.00%> (+0.09%) ⬆️
macos-15 82.41% <100.00%> (+0.07%) ⬆️
macos-26 82.42% <100.00%> (+0.07%) ⬆️
macos-26-intel 82.34% <100.00%> (+0.07%) ⬆️
mingw32 71.14% <97.36%> (+0.07%) ⬆️
mingw64 70.71% <97.36%> (+0.19%) ⬆️
npcap 85.47% <100.00%> (+0.11%) ⬆️
rhel94 76.05% <100.00%> (+0.12%) ⬆️
ubuntu2204 76.08% <100.00%> (+0.10%) ⬆️
ubuntu2404 76.38% <100.00%> (+0.12%) ⬆️
ubuntu2604 76.31% <100.00%> (+0.09%) ⬆️
ubuntu2604-arm64 76.20% <100.00%> (+0.13%) ⬆️
ubuntu2604-icpx 58.99% <46.06%> (-0.02%) ⬇️
unittest 82.69% <100.00%> (+0.08%) ⬆️
windows-2022 85.46% <100.00%> (+0.11%) ⬆️
windows-2025 85.18% <100.00%> (+0.09%) ⬆️
winpcap 85.38% <100.00%> (+0.09%) ⬆️
xdp 53.86% <100.00%> (+0.16%) ⬆️

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 28, 2026 08:35

@Dimi1010 Dimi1010 left a comment

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.

Overall, LGTM.

But, I have some concerns about SerializedFields structs inside the layers since they shadow the same structs inside the base class. This might get messy down the line. 🤔

Comment thread Packet++/header/EthDot3Layer.h Outdated
…ializedFields`

- Add `@brief` to all `SerializedFields` fields
@seladb

seladb commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

But, I have some concerns about SerializedFields structs inside the layers since they shadow the same structs inside the base class. This might get messy down the line. 🤔

You're right, I updated them to inherit from Layer::SerializedFields in this commit: fc05698

@Dimi1010 is it good to merge now?

@Dimi1010 Dimi1010 left a comment

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.

LGTM

@seladb
seladb merged commit c9d247c into dev Sep 29, 2026
83 of 85 checks passed
@seladb
seladb deleted the protocol-layer-serialization2 branch September 29, 2026 07:51
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