summaryrefslogtreecommitdiff
path: root/yang
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-05-10 23:37:47 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2023-05-11 11:39:23 +0300
commit1c035c8c2c1bc57699697e7d35a631c9e6a1df55 (patch)
tree9b30bc92148b571a44cc1dfc177827d2ea9ec8ab /yang
parent052fa79dd23d5d495ea81a962633fe896054bb37 (diff)
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 <donatas@opensourcerouting.org>
Diffstat (limited to 'yang')
-rw-r--r--yang/frr-bgp-route-map.yang17
1 files changed, 17 insertions, 0 deletions
diff --git a/yang/frr-bgp-route-map.yang b/yang/frr-bgp-route-map.yang
index 23e5b0227c..b557cabb22 100644
--- a/yang/frr-bgp-route-map.yang
+++ b/yang/frr-bgp-route-map.yang
@@ -23,6 +23,10 @@ module frr-bgp-route-map {
prefix rt-types;
}
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
organization
"Free Range Routing";
contact
@@ -168,6 +172,12 @@ module frr-bgp-route-map {
"Match IPv6 next hop address";
}
+ identity source-protocol {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match protocol via which the route was learnt";
+ }
+
identity distance {
base frr-route-map:rmap-set-type;
description
@@ -759,6 +769,13 @@ module frr-bgp-route-map {
"IPv6 address";
}
}
+
+ case source-protocol {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-bgp-route-map:source-protocol')";
+ leaf source-protocol {
+ type frr-route-types:frr-route-types;
+ }
+ }
}
augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:rmap-set-action/frr-route-map:set-action" {