Skip to content

Add API for Seg6 Encapsulation#159

Open
Aperence wants to merge 2 commits intorust-netlink:mainfrom
Aperence:seg6-builder
Open

Add API for Seg6 Encapsulation#159
Aperence wants to merge 2 commits intorust-netlink:mainfrom
Aperence:seg6-builder

Conversation

@Aperence
Copy link
Copy Markdown

Following rust-netlink/netlink-packet-route#227, we can now create Seg6Header outside of the netlink-packet-route crate. This commit adds a new output_seg6 function to RouteMessageBuilder, allowing to easily create new routes with SRv6 encapsulation.

An example of route creation is present in examples/.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces SRv6 (Segment Routing over IPv6) support by adding an output_seg6 method to the RouteMessageBuilder and providing a new example script, add_route_seg6.rs. The review feedback focuses on improving the example's robustness and idiomaticity, specifically by refining error handling with non-zero exit codes, replacing unwrap() calls, and adjusting the gateway parsing logic to use Ipv6Addr. Additionally, suggestions were made to clean up imports and formatting within both the builder and the example files.

Comment thread src/route/builder.rs Outdated
Comment thread src/route/builder.rs Outdated
Comment thread examples/add_route_seg6.rs Outdated
Comment thread examples/add_route_seg6.rs
Comment thread examples/add_route_seg6.rs Outdated
Comment thread examples/add_route_seg6.rs Outdated
Comment thread examples/add_route_seg6.rs
Comment thread examples/add_route_seg6.rs
Comment thread examples/add_route_seg6.rs Outdated
Comment thread examples/add_route_seg6.rs Outdated
@Aperence
Copy link
Copy Markdown
Author

Applied recommended changes

@ffmancera
Copy link
Copy Markdown
Contributor

Could you please squash the commits? In addition please address the rustfmt/clippy warning. There is one warning not related to the code you are touching. Address it on a separated commit please.

Following rust-netlink/netlink-packet-route#227,
we can now create Seg6Header outside of the netlink-packet-route
crate. This commit adds a new `output_seg6` function to RouteMessageBuilder,
allowing to easily create new routes with SRv6 encapsulation.

An example of route creation is present in `examples/`.

Signed-off-by: Aperence <anthony.doeraene@hotmail.com>
@Aperence
Copy link
Copy Markdown
Author

I squashed the two commits and created a new commit for the fix of the clippy warning in traffic_control/test.rs. Normally all warnings should have been corrected.

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