Skip to content

(17b) net: model the optional LLDP TLVs - #1920

Draft
daniel-noland wants to merge 1 commit into
pr/daniel-noland/lldpfrom
pr/daniel-noland/lldp-optional-tlvs
Draft

daniel-noland wants to merge 1 commit into
pr/daniel-noland/lldpfrom
pr/daniel-noland/lldp-optional-tlvs

Conversation

@daniel-noland

@daniel-noland daniel-noland commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Native LLDP for the gateway. The dataplane owns its NICs, so nothing else can speak LLDP for them, and lldpd/lldpad are hostile to automation. LLDP itself is small, so the dataplane transmits and receives it.

This used to be one PR. It is now a stack of seven, each building on the one before:

Stacked on (16) #1905, capture. (18) #1907, rate limiting, and (19) #1919, traffic protection, build on top.

This PR: the optional TLVs

The second of three PRs adding net::lldp: the TLVs that may follow the mandatory three.

  • Port description, system name and system description (Text).
  • System capabilities. Reserved bits are preserved, not masked.
  • Management address, with its interface numbering and OID.
  • Organizationally specific TLVs, with the IEEE 802.1 port VLAN ID and VLAN name, and the IEEE 802.3 link aggregation and max frame size subtypes modelled.

Anything not modelled round-trips verbatim: unknown TLV types, OUIs and subtypes. The escape hatches for unmodelled TLVs refuse anything that has a structured representation, which keeps the mapping between octets and values one to one.

Testing

Property tests per TLV, as in the first PR.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.18220% with 121 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
net/src/lldp/org.rs 84.77% 55 Missing and 3 partials ⚠️
net/src/lldp/management.rs 85.31% 35 Missing and 2 partials ⚠️
net/src/lldp/capabilities.rs 88.69% 13 Missing ⚠️
net/src/lldp/optional.rs 93.51% 12 Missing ⚠️
net/src/lldp/tlv.rs 90.90% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/lldp-optional-tlvs branch 2 times, most recently from 25480aa to 9cf234a Compare October 17, 2026 03:26
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/lldp branch 2 times, most recently from 02506de to abac097 Compare October 17, 2026 05:59
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/lldp-optional-tlvs branch from 9cf234a to 6f7d9c4 Compare October 17, 2026 05:59
The second of three changes adding `net::lldp`: the TLVs which may follow
the mandatory three.  Port and system description, system name, system
capabilities and management address each get a type, as do the IEEE
802.1 and IEEE 802.3 extensions carried in the organizationally specific
TLV.

As with the mandatory TLVs, the subtypes this dataplane has a use for are
decoded and everything else is kept verbatim: an unknown TLV type, OUI
or 802.1/802.3 subtype round trips octet for octet.  The escape hatches
for unmodelled TLVs refuse anything with a structured representation,
which is what keeps the mapping between octets and values one to one.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/lldp-optional-tlvs branch from 6f7d9c4 to c5e9535 Compare October 17, 2026 06:17
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.

1 participant