From 1c035c8c2c1bc57699697e7d35a631c9e6a1df55 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 10 May 2023 23:37:47 +0300 Subject: bgpd: Implement `match source-protocol` for route-maps The main idea is to filter routes by matching source (originating) protocol for outgoing direction. For instance, filter outgoing routes to an arbitrary router that are static only. Or filter out only routes learned from RIP. Signed-off-by: Donatas Abraitis --- lib/routemap_cli.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/routemap_cli.c') diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c index 419086c4c6..0ccc78e838 100644 --- a/lib/routemap_cli.c +++ b/lib/routemap_cli.c @@ -599,11 +599,14 @@ void route_map_condition_show(struct vty *vty, const struct lyd_node *dnode, yang_dnode_get_string( dnode, "./rmap-match-condition/frr-zebra-route-map:ipv4-prefix-length")); - } else if (IS_MATCH_SRC_PROTO(condition)) { + } else if (IS_MATCH_SRC_PROTO(condition) || + IS_MATCH_BGP_SRC_PROTO(condition)) { vty_out(vty, " match source-protocol %s\n", yang_dnode_get_string( dnode, - "./rmap-match-condition/frr-zebra-route-map:source-protocol")); + IS_MATCH_SRC_PROTO(condition) + ? "./rmap-match-condition/frr-zebra-route-map:source-protocol" + : "./rmap-match-condition/frr-bgp-route-map:source-protocol")); } else if (IS_MATCH_SRC_INSTANCE(condition)) { vty_out(vty, " match source-instance %s\n", yang_dnode_get_string( -- cgit v1.2.3