]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: cleanup yang lint warnings
authorChristian Hopps <chopps@labn.net>
Sat, 20 Jan 2024 00:33:09 +0000 (00:33 +0000)
committerChristian Hopps <chopps@labn.net>
Sun, 21 Jan 2024 13:12:26 +0000 (13:12 +0000)
Signed-off-by: Christian Hopps <chopps@labn.net>
yang/frr-filter.yang
yang/frr-ripd.yang

index a1946d8342406550832544ba9fd207fd9c977f12..867e59826c7f21126506718dbe8b4cd52a9eaa95 100644 (file)
@@ -45,114 +45,112 @@ module frr-filter {
 
   revision 2019-07-04 {
     description "Initial revision";
+    reference "FRRouting";
   }
 
   /*
    * Types.
    */
   typedef access-list-name {
-    description "Access list name formatting";
     type string {
       length 1..128;
     }
+    description "Access list name formatting";
   }
 
   typedef access-list-sequence {
-    description "Access list sequence number";
     type uint32 {
       range "1..4294967295";
     }
+    description "Access list sequence number";
   }
 
   typedef access-list-action {
-    description "Access list return action on match";
     type enumeration {
       enum deny {
-        description "Deny an entry";
         value 0;
+        description "Deny an entry";
       }
       enum permit {
-        description "Accept an entry";
         value 1;
+        description "Accept an entry";
       }
     }
+    description "Access list return action on match";
   }
 
   /*
    * Configuration data.
    */
   container lib {
+    description "Filter library";
     list access-list {
-      description "Access list instance";
-
       key "type name";
+      description "Access list instance";
 
       leaf type {
-        description "Access list content type";
         type enumeration {
           enum ipv4 {
-            description "Internet Protocol address version 4";
             value 0;
+            description "Internet Protocol address version 4";
           }
           enum ipv6 {
-            description "Internet Protocol address version 6";
             value 1;
+            description "Internet Protocol address version 6";
           }
           enum mac {
-            description "Media Access Control address";
             value 2;
+            description "Media Access Control address";
           }
         }
+        description "Access list content type";
       }
 
       leaf name {
-        description "Access list name";
         type access-list-name;
+        description "Access list name";
       }
 
       leaf remark {
-        description "Access list remark";
         type string;
+        description "Access list remark";
       }
 
       list entry {
-        description "Access list entry";
-
         key "sequence";
-
+        description "Access list entry";
         leaf sequence {
-          description "Access list sequence value";
           type access-list-sequence;
+          description "Access list sequence value";
         }
-
         leaf action {
-          description "Access list action on match";
           type access-list-action;
           mandatory true;
+          description "Access list action on match";
         }
 
         choice value {
-          description "Access list value to match";
           mandatory true;
+          description "Access list value to match";
 
           case ipv4-prefix {
             when "../type = 'ipv4'";
 
             choice style {
-              description "Access list entry style selection: zebra or cisco.";
               mandatory true;
+              description "Access list entry style selection: zebra or cisco.";
 
               case zebra {
                 leaf ipv4-prefix {
-                  description "Configure IPv4 prefix to match";
                   type inet:ipv4-prefix;
                   mandatory true;
+                  description "Configure IPv4 prefix to match";
                 }
 
                 leaf ipv4-exact-match {
-                  description "Exact match of prefix";
                   type boolean;
                   default false;
+                  description "Exact match of prefix";
                 }
               }
               case cisco {
@@ -160,19 +158,20 @@ module frr-filter {
                   description "Source value to match";
 
                   leaf host {
-                    description "Host to match";
                     type inet:ipv4-address;
+                    description "Host to match";
                   }
                   container network {
+                    description "Network to match";
                     leaf address {
+                      type inet:ipv4-address;
                       mandatory true;
                       description "Network address part.";
-                      type inet:ipv4-address;
                     }
                     leaf mask {
+                      type inet:ipv4-address;
                       mandatory true;
                       description "Network mask/wildcard part.";
-                      type inet:ipv4-address;
                     }
                   }
                   leaf source-any {
@@ -180,8 +179,8 @@ module frr-filter {
                      * Was `any`, however it conflicts with `any` leaf
                      * outside this choice.
                      */
-                    description "Match any";
                     type empty;
+                    description "Match any";
                   }
                 }
 
@@ -189,24 +188,25 @@ module frr-filter {
                   description "Destination value to match";
 
                   leaf destination-host {
-                    description "Host to match";
                     type inet:ipv4-address;
+                    description "Host to match";
                   }
                   container destination-network {
+                    description "Destination network to match";
                     leaf address {
+                      type inet:ipv4-address;
                       mandatory true;
                       description "Network address part.";
-                      type inet:ipv4-address;
                     }
                     leaf mask {
+                      type inet:ipv4-address;
                       mandatory true;
                       description "Network mask/wildcard part.";
-                      type inet:ipv4-address;
                     }
                   }
                   leaf destination-any {
-                    description "Match any";
                     type empty;
+                    description "Match any";
                   }
                 }
               }
@@ -216,29 +216,29 @@ module frr-filter {
             when "../type = 'ipv6'";
 
             leaf ipv6-prefix {
-              description "Configure IPv6 prefix to match";
               type inet:ipv6-prefix;
               mandatory true;
+              description "Configure IPv6 prefix to match";
             }
 
             leaf ipv6-exact-match {
-              description "Exact match of prefix";
               type boolean;
               default false;
+              description "Exact match of prefix";
             }
           }
           case mac {
             when "../type = 'mac'";
 
             leaf mac {
-              description "Configure MAC address to match";
               type yang:mac-address;
+              description "Configure MAC address to match";
             }
           }
           case any {
             leaf any {
-              description "Match anything";
               type empty;
+              description "Match anything";
             }
           }
         }
@@ -246,108 +246,104 @@ module frr-filter {
     }
 
     list prefix-list {
-      description "Prefix list instance";
-
       key "type name";
-
+      description "Prefix list instance";
       leaf type {
-        description "Prefix list type";
         type enumeration {
           enum ipv4 {
-            description "Internet Protocol address version 4";
             value 0;
+            description "Internet Protocol address version 4";
           }
           enum ipv6 {
-            description "Internet Protocol address version 6";
             value 1;
+            description "Internet Protocol address version 6";
           }
         }
+        description "Prefix list type";
       }
 
       leaf name {
-        description "Prefix list name";
         type access-list-name;
+        description "Prefix list name";
       }
 
       leaf remark {
-        description "Prefix list user description";
         type string;
+        description "Prefix list user description";
       }
 
       list entry {
-        description "Prefix list entry";
-
         key "sequence";
-
+        description "Prefix list entry";
         leaf sequence {
-          description "Prefix list sequence value";
           type access-list-sequence;
+          description "Prefix list sequence value";
         }
 
         leaf action {
-          description "Prefix list action on match";
           type access-list-action;
           mandatory true;
+          description "Prefix list action on match";
         }
 
         choice value {
-          description "Prefix list value to match";
           mandatory true;
+          description "Prefix list value to match";
 
           case ipv4-prefix {
             leaf ipv4-prefix {
-              description "Configure IPv4 prefix to match";
               type inet:ipv4-prefix;
               mandatory true;
+              description "Configure IPv4 prefix to match";
             }
 
             leaf ipv4-prefix-length-greater-or-equal {
-              description
-                "Specifies if matching prefixes with length greater than
-                 or equal to value";
               type uint8 {
                 range "0..32";
               }
+              description
+                "Specifies if matching prefixes with length greater than
+                 or equal to value";
             }
 
             leaf ipv4-prefix-length-lesser-or-equal {
-              description
-                "Specifies if matching prefixes with length lesser than
-                 or equal to value";
               type uint8 {
                 range "0..32";
               }
+              description
+                "Specifies if matching prefixes with length lesser than
+                 or equal to value";
             }
           }
           case ipv6-prefix {
             leaf ipv6-prefix {
-              description "Configure IPv6 prefix to match";
               type inet:ipv6-prefix;
               mandatory true;
+              description "Configure IPv6 prefix to match";
             }
 
             leaf ipv6-prefix-length-greater-or-equal {
-              description
-                "Specifies if matching prefixes with length greater than
-                 or equal to value";
               type uint8 {
                 range "0..128";
               }
+              description
+                "Specifies if matching prefixes with length greater than
+                 or equal to value";
             }
 
             leaf ipv6-prefix-length-lesser-or-equal {
-              description
-                "Specifies if matching prefixes with length lesser than
-                 or equal to value";
               type uint8 {
                 range "0..128";
               }
+              description
+                "Specifies if matching prefixes with length lesser than
+                 or equal to value";
             }
           }
           case any {
             leaf any {
-              description "Match anything";
               type empty;
+              description "Match anything";
             }
           }
         }
index 5f85a4cabc1b092f1f7cf38439176ec934468301..756e70b29256a5cebcb9f331fd5c4a30be142549 100644 (file)
@@ -380,9 +380,9 @@ module frr-ripd {
       }
 
       leaf default-bfd-profile {
+        type frr-bfdd:profile-ref;
         description
           "Use this BFD profile for all peers by default.";
-        type frr-bfdd:profile-ref;
       }
 
       /*
@@ -691,12 +691,13 @@ module frr-ripd {
       container bfd-monitoring {
         presence
           "Present if BFD is configured for RIP peers in this interface.";
+        description "Configure BFD use in RIPD";
 
         leaf enable {
           type boolean;
+          default false;
           description
             "Enable/disable BFD monitoring.";
-          default false;
         }
 
         leaf profile {