Repository navigation
Add QUIC v1 layer serialization - #2335
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2335 +/- ##
==========================================
+ Coverage 82.77% 82.90% +0.12%
==========================================
Files 343 350 +7
Lines 66095 69020 +2925
Branches 13582 14352 +770
==========================================
+ Hits 54713 57219 +2506
- Misses 10020 10898 +878
+ Partials 1362 903 -459
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @anyingiit — thanks for the QUIC serialization work (and for noting it's fine to close if it doesn't fit). I addressed @seladb's review comments locally on top of your PR: Branch: https://github.com/way-wei96/PcapPlusPlus/tree/quic-layer-serialization-review Happy to either open a small follow-up PR (crediting this one), or have you pull the changes here — whichever you prefer. If I don't hear back in a few days, I'll go with the follow-up PR so the review can keep moving. |
Thank you @way-wei96 ! I'll try to apply your changes to this PR so we can get it merged |
OSS-Fuzz migrated pcapplusplus to base_os_version ubuntu-24-04. The pinned CIFuzz action (April 2024) ran the bad-build check in the Ubuntu 20.04 runner, so fuzzers linked against glibc 2.38 failed to start. Newer CIFuzz reads base_os_version and pivots to the 24.04 runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you @anyingiit for working on this PR and @way-wei96 for addressing the comments 🙏 |
Description
Adds
serializeLayer()andSerializedFieldsfor the QUIC v1 layers, as part of the serialization rollout tracked in #2278 (QuicLayer had no PR listed there yet).The fields follow the class hierarchy, each level calling its parent's
serializeLayer()and continuing its field IDs (same scheme asGreLayer/GREv0Layer, with aMaxIDon every struct):QuicV1LayerpacketType(same names astoString():Initial,0-RTT,Handshake,Retry,Version Negotiation,1-RTT),headerForm(Long/Short),fixedBitQuicV1LongHeaderLayerversion(hex),destinationConnectionId,sourceConnectionId(hex strings)QuicV1EstablishmentLayer(Initial, 0-RTT, Handshake)payloadLength(the Length field; named so it doesn't clash with the commonlength)QuicV1InitialLayertoken(hex string)QuicV1RetryLayerretryToken,retryIntegrityTag(hex strings)QuicV1VersionNegotiationLayersupportedVersions(array of hex values)QuicV1OneRttLayerspinBit,keyPhaseBit(booleans)The packet-type names are moved from
toString()into a small static helper so both use the same strings;toString()output is unchanged. Everything is read through the existing getters, which already return empty values for truncated packets.Tests (
Tests/Packet++Test/Tests/QuicTests.cpp): JSON output for each packet type inQuicV1ParsingTest(Initial, Handshake, 0-RTT, Retry, Version Negotiation, 1-RTT), andall()size plus gap-free IDs for all nine classes. Without the source change the parsing test fails (only the common fields are written).Motivation / disclosure: I had some spare AI-assistant quota (Claude Code) and am using it to try to help projects with open good-first-issues. The change was prepared with Claude Code and verified as listed below. If it doesn't fit, isn't up to your bar, or you'd simply rather not take it, please feel free to close it, no hard feelings at all 🙂
Related issue
Part of #2278 (QuicLayer)
Checklist
Packet++Test -t quic→ 2/2 passed; fullPacket++Test→ 280/280 passed. Built with-DPCAPPP_BUILD_PCAPPP=OFF -DPCAPPP_USE_PCAP=OFF -DPCAPPP_BUILD_EXAMPLES=OFF(no libpcap in my environment), so Pcap++Test and examples were not run (this change only touches Packet++)cppcheckpre-commit hook not run locally (not installed)