]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Show `match script SCRIPT` in running config
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 31 Mar 2022 06:34:14 +0000 (09:34 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 31 Mar 2022 06:39:52 +0000 (09:39 +0300)
Before:
```
route-map lua permit 10
exit
```

After:
```
route-map lua permit 10
 match script rm
exit
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
lib/routemap.h
lib/routemap_cli.c

index 6c4916898a36dd6cdf4d9401908b77896fdef19b..3ef60222bfeb983f94024743b3e9ebdde7ba4e77 100644 (file)
@@ -276,6 +276,7 @@ DECLARE_QOBJ_TYPE(route_map);
 #define IS_MATCH_LOCAL_PREF(C)                                                 \
        (strmatch(C, "frr-bgp-route-map:match-local-preference"))
 #define IS_MATCH_ALIAS(C) (strmatch(C, "frr-bgp-route-map:match-alias"))
+#define IS_MATCH_SCRIPT(C) (strmatch(C, "frr-bgp-route-map:match-script"))
 #define IS_MATCH_ORIGIN(C)                                                     \
        (strmatch(C, "frr-bgp-route-map:match-origin"))
 #define IS_MATCH_RPKI(C) (strmatch(C, "frr-bgp-route-map:rpki"))
index 2685bd2d79978b2606a944bb592f55e4e8f747f7..5597064d200b1acaa7f5ce724b933ac0f965ac5d 100644 (file)
@@ -635,6 +635,11 @@ void route_map_condition_show(struct vty *vty, const struct lyd_node *dnode,
                        yang_dnode_get_string(
                                dnode,
                                "./rmap-match-condition/frr-bgp-route-map:alias"));
+       } else if (IS_MATCH_SCRIPT(condition)) {
+               vty_out(vty, " match script %s\n",
+                       yang_dnode_get_string(
+                               dnode,
+                               "./rmap-match-condition/frr-bgp-route-map:script"));
        } else if (IS_MATCH_ORIGIN(condition)) {
                vty_out(vty, " match origin %s\n",
                        yang_dnode_get_string(