Skip to content

feat: support RFC 5543 traffic engineering attribute - #322

Merged
digizeph merged 1 commit into
bgpkit:mainfrom
downwithbgp:rfc5543-traffic-engineering
Aug 6, 2026
Merged

feat: support RFC 5543 traffic engineering attribute#322
digizeph merged 1 commit into
bgpkit:mainfrom
downwithbgp:rfc5543-traffic-engineering

Conversation

@downwithbgp

Copy link
Copy Markdown
Contributor

Fixes #290

Summary

  • add structured parsing for the RFC 5543 BGP Traffic Engineering attribute
  • expose the Switching Capability, Encoding, Reserved, and eight Maximum LSP Bandwidth fields
  • retain switching-capability-specific information as raw Bytes
  • support encoding while preserving the opaque capability-specific tail
  • wire attribute code 24 into the parser and encoder as optional non-transitive
  • add PSC-1, unknown-capability, truncated-input, exact-wire encoding, and round-trip tests
  • update the supported-RFC and attribute documentation

Validation

  • cargo fmt --check
  • cargo check --all-targets --all-features
  • cargo test --all-features traffic_engineering
  • cargo test --all-targets --all-features

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for the RFC 5543 BGP Traffic Engineering path attribute (code 24) to bgpkit-parser, moving it from raw-retained handling to a typed model with structured parsing/encoding while preserving the capability-specific tail as opaque bytes.

Changes:

  • Introduces TrafficEngineering attribute model and wires AttrType::TRAFFIC_ENGINEERING into attribute parsing/encoding and flag validation.
  • Implements RFC 5543 fixed-header parsing/encoding with raw retention of switching-capability-specific trailing bytes.
  • Adds unit tests for PSC-1, unknown capability retention, truncated input, and exact-wire round-trip; updates supported-RFC and attribute documentation.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/parser/mrt/mrt_elem.rs Includes TrafficEngineering in the relevant attribute set for MRT elements.
src/parser/bgp/attributes/README.md Updates attribute support tables to mark Traffic Engineering as implemented and fixes reference formatting.
src/parser/bgp/attributes/mod.rs Wires TRAFFIC_ENGINEERING into parsing/encoding, removes it from raw-retained list, and validates flags as optional non-transitive.
src/parser/bgp/attributes/attr_24_traffic_engineering.rs New parser/encoder implementation for RFC 5543 attribute (fixed portion + opaque tail) with comprehensive tests.
src/models/bgp/attributes/mod.rs Adds TrafficEngineering struct + enum variant and integrates type/category/flags behavior.
src/lib.rs Documents RFC 5543 typed attribute support in crate docs (source for README generation).
README.md Reflects updated generated documentation including RFC 5543 support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@digizeph

digizeph commented Aug 6, 2026

Copy link
Copy Markdown
Member

Good work, thanks for the contribution!

@digizeph
digizeph merged commit 850d0ab into bgpkit:main Aug 6, 2026
6 checks passed
@downwithbgp
downwithbgp deleted the rfc5543-traffic-engineering branch August 6, 2026 04:35
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.

Add structured parser for Traffic Engineering attribute (RFC 5543, code 24)

3 participants