]> git.puffer.fish Git - matthieu/frr.git/commitdiff
staticd: Extend SRv6 SIDs show CLI to display uA SIDs
authorCarmine Scarpitta <cscarpit@cisco.com>
Fri, 14 Feb 2025 16:22:00 +0000 (17:22 +0100)
committerCarmine Scarpitta <cscarpit@cisco.com>
Wed, 26 Feb 2025 06:19:52 +0000 (07:19 +0100)
This commit extends the SRv6 SIDs show CLI to display the configured
SRv6 uA SIDs.

```
segment-routing
 srv6
  static-sids
   sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
  !
 !
!
```

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

index 39776a41430152680e5223b04a3ee7749ea28237..6e9087363d1fd116ad936733af26832e3c3fd608 100644 (file)
@@ -1716,6 +1716,7 @@ static void srv6_sid_cli_show(struct vty *vty, const struct lyd_node *sid, bool
 {
        enum srv6_endpoint_behavior_codepoint srv6_behavior;
        struct prefix_ipv6 sid_value;
+       struct ipaddr nexthop;
 
        yang_dnode_get_ipv6p(&sid_value, sid, "sid");
 
@@ -1787,6 +1788,16 @@ static void srv6_sid_cli_show(struct vty *vty, const struct lyd_node *sid, bool
        if (yang_dnode_exists(sid, "vrf-name"))
                vty_out(vty, " vrf %s", yang_dnode_get_string(sid, "vrf-name"));
 
+       if (yang_dnode_exists(sid, "paths[path-index=0]/interface")) {
+               vty_out(vty, " interface %s",
+                       yang_dnode_get_string(sid, "paths[path-index=0]/interface"));
+
+               if (yang_dnode_exists(sid, "paths[path-index=0]/next-hop")) {
+                       yang_dnode_get_ip(&nexthop, sid, "paths[path-index=0]/next-hop");
+                       vty_out(vty, " nexthop %pI6", &nexthop.ipaddr_v6);
+               }
+       }
+
        vty_out(vty, "\n");
 }