summaryrefslogtreecommitdiffstats
path: root/yang/frr-zebra-route-map.yang
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
commite2bbf175a2184bd76f6c54ccf8456babeb1a46fc (patch)
treef0b76550d6e6f500ada964a3a4ee933a45e5a6f1 /yang/frr-zebra-route-map.yang
parentInitial commit. (diff)
downloadfrr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.tar.xz
frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.zip
Adding upstream version 9.1.upstream/9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yang/frr-zebra-route-map.yang')
-rw-r--r--yang/frr-zebra-route-map.yang136
1 files changed, 136 insertions, 0 deletions
diff --git a/yang/frr-zebra-route-map.yang b/yang/frr-zebra-route-map.yang
new file mode 100644
index 0000000..de0f64d
--- /dev/null
+++ b/yang/frr-zebra-route-map.yang
@@ -0,0 +1,136 @@
+module frr-zebra-route-map {
+ yang-version 1.1;
+ namespace "http://frrouting.org/yang/zebra-route-map";
+ prefix frr-zebra-route-map;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import frr-route-map {
+ prefix frr-route-map;
+ }
+
+ import frr-route-types {
+ prefix frr-route-types;
+ }
+
+ organization
+ "Free Range Routing";
+ contact
+ "FRR Users List: <mailto:frog@lists.frrouting.org>
+ FRR Development List: <mailto:dev@lists.frrouting.org>";
+ description
+ "This module defines zebra route map settings";
+
+ revision 2020-01-02 {
+ description
+ "Initial revision";
+ }
+
+ identity ipv4-prefix-length {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv4 address prefix length";
+ }
+
+ identity ipv4-next-hop-prefix-length {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv4 next-hop address prefix length";
+ }
+
+ identity ipv6-prefix-length {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match IPv6 address prefix length";
+ }
+
+ identity source-instance {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match the protocol's instance number";
+ }
+
+ identity source-protocol {
+ base frr-route-map:rmap-match-type;
+ description
+ "Match protocol via which the route was learnt";
+ }
+
+ identity src-address {
+ base frr-route-map:rmap-set-type;
+ description
+ "Set IPv4/IPv6 source address for route";
+ }
+
+ augment "/frr-route-map:lib"
+ + "/frr-route-map:route-map"
+ + "/frr-route-map:entry"
+ + "/frr-route-map:match-condition"
+ + "/frr-route-map:rmap-match-condition"
+ + "/frr-route-map:match-condition" {
+ case ipv4-prefix-length {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv4-prefix-length') or "
+ + "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv4-next-hop-prefix-length')";
+ leaf ipv4-prefix-length {
+ type uint8 {
+ range "0..32";
+ }
+ }
+ }
+
+ case ipv6-prefix-length {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:ipv6-prefix-length')";
+ leaf ipv6-prefix-length {
+ type uint8 {
+ range "0..128";
+ }
+ }
+ }
+
+ case source-instance {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-route-map:source-instance')";
+ leaf source-instance {
+ type uint8 {
+ range "0..255";
+ }
+ }
+ }
+
+ case source-protocol {
+ when "derived-from-or-self(../frr-route-map:condition, 'frr-zebra-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" {
+ case src-address {
+ when "derived-from-or-self(../frr-route-map:action, 'frr-zebra-route-map:src-address')";
+ choice src-address {
+ description
+ "Value of the source address";
+ case ipv4-src-address {
+ leaf ipv4-src-address {
+ type inet:ipv4-address;
+ mandatory true;
+ }
+ }
+
+ case ipv6-src-address {
+ leaf ipv6-src-address {
+ type inet:ipv6-address;
+ mandatory true;
+ }
+ }
+ }
+ }
+ }
+}