]> git.puffer.fish Git - matthieu/frr.git/commitdiff
yang: static route BFD monitoring
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 24 Mar 2021 12:39:34 +0000 (09:39 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 13 Jan 2023 18:32:12 +0000 (15:32 -0300)
Define a generic BFD monitoring group template and use it to add support
for static route monitoring.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
yang/frr-bfdd.yang
yang/frr-staticd.yang

index 08b607347983e671f8c34eb69f3b628a9b247d15..d3e756e0bfce0a78593ec37161cbd89bac7109af 100644 (file)
@@ -242,6 +242,36 @@ module frr-bfdd {
     }
   }
 
+  grouping bfd-monitoring {
+    description
+      "BFD monitoring template for protocol integration.";
+
+    leaf source {
+      type inet:ip-address;
+      description
+        "Source address to use for liveness check.
+
+         When source is not set and multi-hop is `false` the source
+         address will be `0.0.0.0` (any).
+
+         When source is not set and multi-hop is `true` the source
+         address will be automatic selected through Next Hop Tracking (NHT).";
+    }
+
+    leaf multi-hop {
+      description
+        "Use multi hop session instead of single hop.";
+      type boolean;
+      default false;
+    }
+
+    leaf profile {
+      description
+        "BFD pre configured profile.";
+      type frr-bfdd:profile-ref;
+    }
+  }
+
   grouping session-states {
     /*
      * Local settings.
index 98ff3a83c65b7bfa9714dc40ee94a678faa0dc70..cb5e25b877fa750ea0cbede4258396ad59ffbb14 100644 (file)
@@ -15,6 +15,10 @@ module frr-staticd {
     prefix inet;
   }
 
+  import frr-bfdd {
+    prefix frr-bfdd;
+  }
+
   organization
     "FRRouting";
   contact
@@ -114,7 +118,19 @@ module frr-staticd {
             "AFI-SAFI type.";
         }
 
-        uses staticd-prefix-attributes;
+        uses staticd-prefix-attributes {
+          augment "path-list/frr-nexthops/nexthop" {
+            container bfd-monitoring {
+              description "BFD monitoring options.";
+              presence
+                "Present if BFD configuration is available.";
+
+              when "../nh-type = 'ip4' or ../nh-type = 'ip4-ifindex' or
+                    ../nh-type = 'ip6' or ../nh-type = 'ip6-ifindex'";
+              uses frr-bfdd:bfd-monitoring;
+            }
+          }
+        }
 
         list src-list {
           key "src-prefix";