From 00ef4ae8c796ebd3991ad8e586f5519449f13aed Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 May 2022 12:13:36 +0000 Subject: [PATCH 1/8] review units --- .../CISCO_IOS_emulation/.meta_policy_map.xml | 4 +- LINUX/CISCO_IOS_emulation/policy_map.xml | 126 ++++++++---------- 2 files changed, 61 insertions(+), 69 deletions(-) diff --git a/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml b/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml index 182542d0..23999ea6 100755 --- a/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml +++ b/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml @@ -7,7 +7,7 @@ DATE_MODIFICATION - 1645640298302 + 1653912470578 REPOSITORY @@ -15,7 +15,7 @@ DATE_CREATION - 1645640298286 + 1653912470566 MODEL diff --git a/LINUX/CISCO_IOS_emulation/policy_map.xml b/LINUX/CISCO_IOS_emulation/policy_map.xml index ff0a6276..77a35a8a 100644 --- a/LINUX/CISCO_IOS_emulation/policy_map.xml +++ b/LINUX/CISCO_IOS_emulation/policy_map.xml @@ -25,152 +25,140 @@ params._order - - + + + + + + + bandwidth + - - + + + bandwidth + - - + + + bandwidth + - - + + + police + - - + - bandwidth + police - - + - bandwidth + police - - + - bandwidth + police + + + + + police - - + police - - + police - - + police - - + police - - + police - - + police - - + action - - + action - - + action - - + priority - - + priority - - + priority - - + priority - - + priority - - - - - - - - - - - - - - + + + + + random-detect - - + random-detect - - + random-detect - - + random-detect @@ -207,7 +195,7 @@ - @^\s*police ((rate\s*(?<police_rate>\d+))?|(rate percent\s*(?<police_rate_percent>\d+))?|(cir percent\s*(?<police_cir_percent>\d+))?)\s*(conform-action (?<conform_action>((?!exceed-action).)*))?\s*(exceed-action (?<exceed_action>((?!violate-action).)*))?\s*(violate-action (?<violate_action>.*))?$@ + @^\s*police ((rate\s*(?<police_rate>\d+)\s?(?<police_rate_unit>bps))?|(rate percent\s*(?<police_rate_percent>\d+))?|(cir percent\s*(?<police_cir_percent>\d+))?)\s*(conform-action (?<conform_action>((?!exceed-action).)*))?\s*(exceed-action (?<exceed_action>((?!violate-action).)*))?\s*(violate-action (?<violate_action>.*))?$@ @@ -265,9 +253,13 @@ @^\s*(?<priority>priority)$@ + + + @^\s*police rate\s*(?<police_rate>\d+)\s?(?<police_rate_unit>bps)?(\s?burst\s(?<police_rate_burst>\d+)\s?(?<police_rate_burst_unit>bytes))?(\s?peak-burst\s(?<police_rate_peak_burst>\d+)\s?(?<police_rate_peak_burst_unit>bytes))?@ + + - @^\s+class\s+(?<class_name>\S+)@ From 08f84e94eb98cfccc243e3bf598c36da4208d662 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 May 2022 13:35:21 +0000 Subject: [PATCH 2/8] fix policy map import for police rate and units --- LINUX/CISCO_IOS_emulation/.meta_policy_map.xml | 4 ++-- LINUX/CISCO_IOS_emulation/policy_map.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml b/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml index 23999ea6..cfa7aab5 100755 --- a/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml +++ b/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml @@ -7,7 +7,7 @@ DATE_MODIFICATION - 1653912470578 + 1653914136311 REPOSITORY @@ -15,7 +15,7 @@ DATE_CREATION - 1653912470566 + 1653914136232 MODEL diff --git a/LINUX/CISCO_IOS_emulation/policy_map.xml b/LINUX/CISCO_IOS_emulation/policy_map.xml index 77a35a8a..4bb847d6 100644 --- a/LINUX/CISCO_IOS_emulation/policy_map.xml +++ b/LINUX/CISCO_IOS_emulation/policy_map.xml @@ -260,6 +260,7 @@ + @^\s+class\s+(?<class_name>\S+)@ From 3b82775827a35fcbcee930d1e8587ca824478bee Mon Sep 17 00:00:00 2001 From: Antoine Brun Date: Mon, 30 May 2022 15:38:30 +0200 Subject: [PATCH 3/8] review policy map for Cisco IOS --- CISCO/IOS/policy_map.xml | 92 ++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 31 deletions(-) diff --git a/CISCO/IOS/policy_map.xml b/CISCO/IOS/policy_map.xml index 5bc2c078..9f322259 100644 --- a/CISCO/IOS/policy_map.xml +++ b/CISCO/IOS/policy_map.xml @@ -25,115 +25,140 @@ params._order - - - - - + + + + + bandwidth - + bandwidth - + bandwidth - + police - + police - + police - + police - + police - + police - + + + police + + + + + police + + + + + police + + + + + police + + + + + police + + + action - + action - + action - + priority - + priority - + priority - + priority - + priority - - - - - + + + + + random-detect - + random-detect - + random-detect - + random-detect @@ -143,7 +168,7 @@ - +
@\s*policy-map\s+(?<object_id>\S+).*$@ @@ -170,7 +195,7 @@ - @^\s*police ((rate\s*(?<police_rate>\d+))?|(rate percent\s*(?<police_rate_percent>\d+))?|(cir percent\s*(?<police_cir_percent>\d+))?)\s*(conform-action (?<conform_action>((?!exceed-action).)*))?\s*(exceed-action (?<exceed_action>((?!violate-action).)*))?\s*(violate-action (?<violate_action>.*))?$@ + @^\s*police ((rate\s*(?<police_rate>\d+)\s?(?<police_rate_unit>bps))?|(rate percent\s*(?<police_rate_percent>\d+))?|(cir percent\s*(?<police_cir_percent>\d+))?)\s*(conform-action (?<conform_action>((?!exceed-action).)*))?\s*(exceed-action (?<exceed_action>((?!violate-action).)*))?\s*(violate-action (?<violate_action>.*))?$@ @@ -228,6 +253,11 @@ @^\s*(?<priority>priority)$@ + + + @^\s*police rate\s*(?<police_rate>\d+)\s?(?<police_rate_unit>bps)?(\s?burst\s(?<police_rate_burst>\d+)\s?(?<police_rate_burst_unit>bytes))?(\s?peak-burst\s(?<police_rate_peak_burst>\d+)\s?(?<police_rate_peak_burst_unit>bytes))?@ + + @^\s+class\s+(?<class_name>\S+)@ From 4bb3cf47d8765162e7199b5324320b999eb0286a Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 May 2022 14:31:08 +0000 Subject: [PATCH 4/8] review again --- CISCO/IOS/.meta_policy_map.xml | 4 ++-- CISCO/IOS_XR/.meta_policy_map.xml | 4 ++-- CISCO/IOS_XR/policy_map.xml | 11 +++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CISCO/IOS/.meta_policy_map.xml b/CISCO/IOS/.meta_policy_map.xml index 6efde225..5aabd870 100755 --- a/CISCO/IOS/.meta_policy_map.xml +++ b/CISCO/IOS/.meta_policy_map.xml @@ -7,7 +7,7 @@ DATE_MODIFICATION - 1646387684463 + 1653918129487 REPOSITORY @@ -15,7 +15,7 @@ DATE_CREATION - 1646387684437 + 1653918129446 MODEL diff --git a/CISCO/IOS_XR/.meta_policy_map.xml b/CISCO/IOS_XR/.meta_policy_map.xml index 13b586d7..1703c103 100755 --- a/CISCO/IOS_XR/.meta_policy_map.xml +++ b/CISCO/IOS_XR/.meta_policy_map.xml @@ -7,7 +7,7 @@ DATE_MODIFICATION - 1653032348974 + 1653919106436 REPOSITORY @@ -15,7 +15,7 @@ DATE_CREATION - 1653032348909 + 1653919106424 MODEL diff --git a/CISCO/IOS_XR/policy_map.xml b/CISCO/IOS_XR/policy_map.xml index 1f7efd06..a02dcc3a 100644 --- a/CISCO/IOS_XR/policy_map.xml +++ b/CISCO/IOS_XR/policy_map.xml @@ -101,6 +101,11 @@ random-detect + + + police + + policy-map toCE-0-1152-0-640-60 @@ -225,10 +230,16 @@ policy-map {$params.object_id} {if isset($pmap_class.priority) && $pmap_class.priority} {$pmap_class.priority} {/if} + {* police CIR *} {if isset($pmap_class.police_cir_burst) && $pmap_class.police_cir_burst}police rate {$pmap_class.police_cir_burst} {/if}{if isset($pmap_class.police_bc_burst) && $pmap_class.police_bc_burst}burst {$pmap_class.police_bc_burst} {/if}{if isset($pmap_class.police_be_burst) && $pmap_class.police_be_burst} peak-burst {$pmap_class.police_be_burst} {/if} + {* police rate *} {if isset($pmap_class.police_cir_percent)} police rate percent {$pmap_class.police_cir_percent} {/if} + {if isset($pmap_class.police_rate)} police rate {$pmap_class.police_rate} {if isset($pmap_class.police_rate_unit)}{$pmap_class.police_rate_unit) {/if} + {/if} + + {* service policy *} {if isset($pmap_class.service_policy) && $pmap_class.service_policy} service-policy {$pmap_class.service_policy} {/if} From 732494726913c6a37dcdd4113c902f3b377d486b Mon Sep 17 00:00:00 2001 From: Antoine Brun Date: Mon, 30 May 2022 16:35:30 +0200 Subject: [PATCH 5/8] port variables from IOS --- CISCO/IOS_XR/policy_map.xml | 88 ++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 15 deletions(-) diff --git a/CISCO/IOS_XR/policy_map.xml b/CISCO/IOS_XR/policy_map.xml index a02dcc3a..16240437 100644 --- a/CISCO/IOS_XR/policy_map.xml +++ b/CISCO/IOS_XR/policy_map.xml @@ -25,25 +25,30 @@ params._order - + + - - + bandwidth - + bandwidth - + bandwidth + + + police + + police @@ -64,19 +69,76 @@ police + + + police + + police - + police - - - + + + police + + + + + police + + + + + police + + + + + action + + + + + action + + + + + action + + + + + priority + + + + + priority + + + + + priority + + + + + priority + + + + + priority + + @@ -96,17 +158,13 @@ random-detect - + random-detect - - - police - - + policy-map toCE-0-1152-0-640-60 class BLL From 7c9c5c23a4b4ebf7ff361c6ab0a0ecbe3feaafbf Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 May 2022 14:37:07 +0000 Subject: [PATCH 6/8] update policy_map --- .../CISCO_IOS_emulation/.meta_policy_map.xml | 4 ++-- LINUX/CISCO_IOS_emulation/policy_map.xml | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml b/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml index cfa7aab5..9b4319ab 100755 --- a/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml +++ b/LINUX/CISCO_IOS_emulation/.meta_policy_map.xml @@ -7,7 +7,7 @@ DATE_MODIFICATION - 1653914136311 + 1653921019678 REPOSITORY @@ -15,7 +15,7 @@ DATE_CREATION - 1653914136232 + 1653921019647 MODEL diff --git a/LINUX/CISCO_IOS_emulation/policy_map.xml b/LINUX/CISCO_IOS_emulation/policy_map.xml index 4bb847d6..0457ebdd 100644 --- a/LINUX/CISCO_IOS_emulation/policy_map.xml +++ b/LINUX/CISCO_IOS_emulation/policy_map.xml @@ -99,6 +99,21 @@ police + + + police + + + + + police + + + + + police + + action @@ -258,6 +273,11 @@ @^\s*police rate\s*(?<police_rate>\d+)\s?(?<police_rate_unit>bps)?(\s?burst\s(?<police_rate_burst>\d+)\s?(?<police_rate_burst_unit>bytes))?(\s?peak-burst\s(?<police_rate_peak_burst>\d+)\s?(?<police_rate_peak_burst_unit>bytes))?@ + + + @^\s*police\s*(?<police_target_bit_rate>\d+)(\s?conform-action\s(?<police_conform_action>(set-(\S+)|drop|transmit)\s?(af\d+|cs\d+|\d+|default)?))?(\s?exceed-action\s(?<police_exceed_action>\S+))?@ + + @^\s+class\s+(?<class_name>\S+)@ From e5e6d4cca988b005dcfed3dbab7dc0d2c4dec9a9 Mon Sep 17 00:00:00 2001 From: Antoine Brun Date: Mon, 30 May 2022 16:38:19 +0200 Subject: [PATCH 7/8] port from IOS emul --- CISCO/IOS/policy_map.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CISCO/IOS/policy_map.xml b/CISCO/IOS/policy_map.xml index 9f322259..f93cf39d 100644 --- a/CISCO/IOS/policy_map.xml +++ b/CISCO/IOS/policy_map.xml @@ -99,6 +99,21 @@ police + + + police + + + + + police + + + + + police + + action @@ -258,6 +273,11 @@ @^\s*police rate\s*(?<police_rate>\d+)\s?(?<police_rate_unit>bps)?(\s?burst\s(?<police_rate_burst>\d+)\s?(?<police_rate_burst_unit>bytes))?(\s?peak-burst\s(?<police_rate_peak_burst>\d+)\s?(?<police_rate_peak_burst_unit>bytes))?@ + + + @^\s*police\s*(?<police_target_bit_rate>\d+)(\s?conform-action\s(?<police_conform_action>(set-(\S+)|drop|transmit)\s?(af\d+|cs\d+|\d+|default)?))?(\s?exceed-action\s(?<police_exceed_action>\S+))?@ + + @^\s+class\s+(?<class_name>\S+)@ From c880f64037fff8dbab14cd4f21f1772038786844 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 31 May 2022 13:05:10 +0000 Subject: [PATCH 8/8] add blank lines --- CISCO/IOS_XR/.meta_policy_map.xml | 4 ++-- CISCO/IOS_XR/policy_map.xml | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CISCO/IOS_XR/.meta_policy_map.xml b/CISCO/IOS_XR/.meta_policy_map.xml index 1703c103..d187311a 100755 --- a/CISCO/IOS_XR/.meta_policy_map.xml +++ b/CISCO/IOS_XR/.meta_policy_map.xml @@ -7,7 +7,7 @@ DATE_MODIFICATION - 1653919106436 + 1653924596976 REPOSITORY @@ -15,7 +15,7 @@ DATE_CREATION - 1653919106424 + 1653924596961 MODEL diff --git a/CISCO/IOS_XR/policy_map.xml b/CISCO/IOS_XR/policy_map.xml index 16240437..15b480f8 100644 --- a/CISCO/IOS_XR/policy_map.xml +++ b/CISCO/IOS_XR/policy_map.xml @@ -164,7 +164,6 @@ - policy-map toCE-0-1152-0-640-60 class BLL @@ -285,16 +284,20 @@ policy-map {$params.object_id} {if isset($pmap_class.queue_limit) && $pmap_class.queue_limit} queue-limit {$pmap_class.queue_limit} {/if} + {if isset($pmap_class.priority) && $pmap_class.priority} {$pmap_class.priority} - {/if} - {* police CIR *} - {if isset($pmap_class.police_cir_burst) && $pmap_class.police_cir_burst}police rate {$pmap_class.police_cir_burst} {/if}{if isset($pmap_class.police_bc_burst) && $pmap_class.police_bc_burst}burst {$pmap_class.police_bc_burst} {/if}{if isset($pmap_class.police_be_burst) && $pmap_class.police_be_burst} peak-burst {$pmap_class.police_be_burst} {/if} + + {* police CIR *} + {*if isset($pmap_class.police_cir_burst) && $pmap_class.police_cir_burst}police rate {$pmap_class.police_cir_burst} {/if}{if isset($pmap_class.police_bc_burst) && $pmap_class.police_bc_burst}burst {$pmap_class.police_bc_burst} {/if}{if isset($pmap_class.police_be_burst) && $pmap_class.police_be_burst} peak-burst {$pmap_class.police_be_burst} + {/if*} + {* police rate *} {if isset($pmap_class.police_cir_percent)} police rate percent {$pmap_class.police_cir_percent} {/if} - {if isset($pmap_class.police_rate)} police rate {$pmap_class.police_rate} {if isset($pmap_class.police_rate_unit)}{$pmap_class.police_rate_unit) {/if} + + {if isset($pmap_class.police_rate)} police rate {$pmap_class.police_rate} {if isset($pmap_class.police_rate_unit)}{$pmap_class.police_rate_unit} {/if} {/if} {* service policy *}