]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
fixup! split show_protocols_all to submodules, show memory and status updates
authorKaterina Kubecova <katerina.kubecova@nic.cz>
Thu, 16 Nov 2023 15:40:33 +0000 (16:40 +0100)
committerKaterina Kubecova <katerina.kubecova@nic.cz>
Thu, 16 Nov 2023 15:40:33 +0000 (16:40 +0100)
yang/show_protocols_all/show_protocols_all.yang
yang/show_protocols_all/show_protocols_bgp.yang

index 8bf416b925e39faf1100cfa08547176b3bdc5189..f3e077ef5583878c553435562543df7965fe5b76 100644 (file)
@@ -3,48 +3,16 @@ module show_protocols_all {
   namespace ".";
   
   prefix "protocols_all";
+
+  import ietf-yang-types {
+     prefix yang;
+  }
   
   include "show_protocols_bgp";
   include "show_protocols_rpki";
 
   description "cli show protocols all format";
 
-  typedef date-and-time {
-    type string {
-      pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
-          + '(Z|[\+\-]\d{2}:\d{2})';
-    }
-  }
-  
-  
-  typedef ip-address {
-    type union {
-      type ipv4-address;
-      type ipv6-address;
-    }
-  }
-
-  typedef ipv4-address {
-    type string {
-      pattern
-        '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
-      +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
-      + '(%[\p{N}\p{L}]+)?';
-    }
-  }
-
-  typedef ipv6-address {
-    type string {
-      pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
-             + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
-             + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
-             + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
-             + '(%[\p{N}\p{L}]+)?';
-      pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
-             + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
-             + '(%.+)?';
-    }
-  }
 
   typedef status {
     type enumeration {
@@ -125,7 +93,7 @@ module show_protocols_all {
         type state;
       }
       leaf since {
-        type date-and-time;
+        type yang:date-and-time;
       }
       leaf info {
         type string;
index a9dce9beafe508d0cac2e4e0fb78e4f0324704ba..10e3a4b4cd6113ea2e4e48e87ac7efd67edd3243 100644 (file)
@@ -3,6 +3,12 @@ submodule show_protocols_bgp {
   belongs-to show_protocols_all {
     prefix "show_protocols_all";
   }
+  import ietf-yang-types {
+     prefix yang;
+  }
+  import ietf-inet-types {
+    prefix inet;
+  }
 
   description "cli show bgp";
 
@@ -102,12 +108,12 @@ submodule show_protocols_bgp {
     choice is_dynamic {
       case dynamic {
         leaf neighbor_range {
-          type ip-address;
+          type inet:ip-address;
         }
       }
       case nondinamic {
         leaf neighbor_address {
-          type ip-address;
+          type inet:ip-address;
         }
       }
     }
@@ -128,7 +134,7 @@ submodule show_protocols_bgp {
       case start_state {
         container error_wait {
           leaf remains {
-            type date-and-time;
+            type yang:date-and-time;
           }
           leaf delay {
             type uint32;
@@ -136,7 +142,7 @@ submodule show_protocols_bgp {
         }
         container bs_active {
           leaf remains {
-            type date-and-time;
+            type yang:date-and-time;
           }
           leaf delay {
             type uint32;
@@ -144,7 +150,7 @@ submodule show_protocols_bgp {
         }
         container restart {
           leaf restart_timer{
-            type date-and-time;
+            type yang:date-and-time;
           }
         }
       }
@@ -179,7 +185,7 @@ submodule show_protocols_bgp {
           }
         }
         leaf source_address {
-          type ip-address;
+          type inet:ip-address;
         }
         container hold_timer {
           uses timer;
@@ -201,14 +207,14 @@ submodule show_protocols_bgp {
             type string;
           }
           leaf ll_stale_timer {
-            type date-and-time;
+            type yang:date-and-time;
           }
           container ipa_zero {
             leaf next_hop_addr {
-        type ip-address;
+        type inet:ip-address;
             }
             leaf link_addr {
-        type ip-address;
+        type inet:ip-address;
             }
           }
           leaf ipv4_table {
@@ -224,7 +230,7 @@ submodule show_protocols_bgp {
       }
     }
     leaf bgp_next_hop {
-      type ip-address;
+      type inet:ip-address;
     }
   }
 }