From cebae0202344e913e37f5bd9f1852ad0c62a4d47 Mon Sep 17 00:00:00 2001 From: Katerina Kubecova Date: Thu, 16 Nov 2023 16:40:33 +0100 Subject: [PATCH] fixup! split show_protocols_all to submodules, show memory and status updates --- .../show_protocols_all.yang | 42 +++---------------- .../show_protocols_bgp.yang | 26 +++++++----- 2 files changed, 21 insertions(+), 47 deletions(-) diff --git a/yang/show_protocols_all/show_protocols_all.yang b/yang/show_protocols_all/show_protocols_all.yang index 8bf416b9..f3e077ef 100644 --- a/yang/show_protocols_all/show_protocols_all.yang +++ b/yang/show_protocols_all/show_protocols_all.yang @@ -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; diff --git a/yang/show_protocols_all/show_protocols_bgp.yang b/yang/show_protocols_all/show_protocols_bgp.yang index a9dce9be..10e3a4b4 100644 --- a/yang/show_protocols_all/show_protocols_bgp.yang +++ b/yang/show_protocols_all/show_protocols_bgp.yang @@ -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; } } }