Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/route/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,28 @@ impl RouteNextHopBuilder {
self
}

/// Sets the nexthop SRv6 encapsulation mode and segments.
#[cfg(not(target_os = "android"))]
pub fn seg6(mut self, mode: Seg6Mode, segments: Vec<Ipv6Addr>) -> Self {
if segments.is_empty() {
return self;
}

let mut header = Seg6Header::default();
header.mode = mode;
header.segments = segments;

self.nexthop
.attributes
.push(RouteAttribute::EncapType(RouteLwEnCapType::Seg6));
let encap = RouteLwTunnelEncap::Seg6(RouteSeg6IpTunnel::Seg6(header));
self.nexthop
.attributes
.push(RouteAttribute::Encap(vec![encap]));

self
}

/// Set the nexthop weight
///
/// Equal to `weight` property in `ip route`, but please be advised the
Expand Down
Loading