]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Extend nexthop vty helper to display SRv6 encap behavior
authorCarmine Scarpitta <cscarpit@cisco.com>
Fri, 18 Apr 2025 17:11:19 +0000 (17:11 +0000)
committerCarmine Scarpitta <cscarpit@cisco.com>
Wed, 30 Apr 2025 16:54:43 +0000 (16:54 +0000)
This commit extends the `show ip route` and `show ipv6 route`
output to display the SRv6 encapsulation behavior associated with the
SRv6 nexthop.

```
router# show ipv6 route
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv6 unicast VRF default:
S>* 2001:db8:1:1::2/128 [1/0] is directly connected, sr0, seg6 fcbb:bbbb:7:8:fe00::, weight 1, 00:05:49
S>* 2001:db8:1:1::3/128 [1/0] is directly connected, sr0, seg6 fcbb:bbbb:7:8:fe00::, encap behavior H.Encaps.Red, weight 1, 00:05:49
...

```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
lib/nexthop.c

index 7526dd86f66f8dfb7f5a7b93546898e3c449c0ee..09ff295a98441bcc02a2542e9fb9bb989acf0a2a 100644 (file)
@@ -1492,6 +1492,11 @@ void nexthop_vty_helper(struct vty *vty, const struct nexthop *nexthop,
                                       sizeof(struct in6_addr));
                        snprintf_seg6_segs(seg_buf, SRV6_SEG_STRLEN, &segs);
                        vty_out(vty, ", seg6 %s", seg_buf);
+                       if (nexthop->nh_srv6->seg6_segs->encap_behavior !=
+                           SRV6_HEADEND_BEHAVIOR_H_ENCAPS)
+                               vty_out(vty, ", encap behavior %s",
+                                       srv6_headend_behavior2str(
+                                               nexthop->nh_srv6->seg6_segs->encap_behavior));
                }
        }