feat: support RFC 5543 traffic engineering attribute - #322
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
TrafficEngineeringattribute model and wiresAttrType::TRAFFIC_ENGINEERINGinto 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.
Member
|
Good work, thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #290
Summary
BytesValidation
cargo fmt --checkcargo check --all-targets --all-featurescargo test --all-features traffic_engineeringcargo test --all-targets --all-features