Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat cisco ios hqos #1883

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions ntc_templates/templates/cisco_ios_show_policy-map.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Value Required,Filldown POLICY_MAP (\S+)
Value Required CLASS (\S+)
Value CLASS_BW_RATIO (\d+)
Value CLASS_BW_ACCOUNT (\d+)
Value CLASS_SERVICE_POLICY (\S+)
Value CLASS_QUEUE_LIMIT (\d+)
Value CLASS_POLICE_CIR (\d+)
Value CLASS_POLICE_BC (\d+)
Value CLASS_POLICE_ACTION_CONFORM (\S+)
Value CLASS_POLICE_ACTION_EXCEED (\S+)
Value CLASS_POLICE_ACCOUNT (\d+)
Value CLASS_POLICE_PRIORITY (\d+)
Value CLASS_SHAPE_CIR (\d+)
Value CLASS_SHAPE_ACCOUNT (\d+)
Value CLASS_SHAPE_RATE_TYPE (\S+)

Start
^\s+Policy\sMap\s\S+$$ -> Continue.Record
^\s+Class\s\S+$$ -> Continue.Record
^\s+bandwidth\sremaining\sratio\s${CLASS_BW_RATIO}\saccount\suser-defined\s${CLASS_BW_ACCOUNT}$$
^\s+service-policy\s${CLASS_SERVICE_POLICY}$$
^\s+queue-limit\s${CLASS_QUEUE_LIMIT}\sms$$
^\s+police\scir\s${CLASS_POLICE_CIR}\sbc\s${CLASS_POLICE_BC}$$
^\s+conform-action\s${CLASS_POLICE_ACTION_CONFORM}$$
^\s+exceed-action\s${CLASS_POLICE_ACTION_EXCEED}$$
^\s+account\suser-defined\s${CLASS_POLICE_ACCOUNT}$$
^\s+priority\slevel\s${CLASS_POLICE_PRIORITY}$$
^\s+${CLASS_SHAPE_RATE_TYPE}\sRate\sTraffic\sShaping$$`
^\s+cir\s${CLASS_SHAPE_CIR}\s+\S+\s+account\suser-defined\s${CLASS_SHAPE_ACCOUNT}$$
^\s+Policy\sMap\s${POLICY_MAP}$$
^\s+Class\s${CLASS}$$
^[\S\s]*$$
^\s*$$
^. -> Error PolicyMap
5 changes: 3 additions & 2 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ cisco_ios_show_ap_summary.textfsm, .*, cisco_ios, sh[[ow]] ap sum[[mary]]
cisco_ios_show_dhcp_lease.textfsm, .*, cisco_ios, sh[[ow]] dh[[cp]] l[[ease]]
cisco_ios_show_interfaces.textfsm, .*, cisco_ios, sh[[ow]] int[[erfaces]](?: (?:\S+))?
cisco_ios_show_ipv6_route.textfsm, .*, cisco_ios, sh[[ow]] ipv6 r[[oute]]
cisco_ios_show_policy-map.textfsm, .*, cisco_ios, sh[[ow]] pol[[icy-map]]
cisco_ios_show_redundancy.textfsm, .*, cisco_ios, sh[[ow]] redu[[ndancy]]
cisco_ios_show_snmp_group.textfsm, .*, cisco_ios, sh[[ow]] snm[[p]] g[[roup]]
cisco_ios_show_vrf_detail.textfsm, .*, cisco_ios, sh[[ow]] vrf detail
Expand Down Expand Up @@ -501,7 +502,7 @@ cisco_xr_show_bgp_instance_all_summary.textfsm, .*, cisco_xr, sh[[ow]] bg[[p]] i
cisco_xr_admin_show_environment_power.textfsm, .*, cisco_xr, adm[[in]] sh[[ow]] env[[ironment]] p[[ower]]
cisco_xr_show_dhcp_ipv4_proxy_binding.textfsm, .*, cisco_xr, sh[[ow]] dh[[cp]] ipv4 p[[roxy]] b[[inding]]
cisco_xr_show_mpls_ldp_neighbor_brief.textfsm, .*, cisco_xr, sh[[ow]] mp[[ls]] ld[[p]] neigh[[bor]] br[[ief]]
cisco_xr_show_running-config_hostname.textfsm, .*, cisco_xr, sh[[ow]] run[[ning-config]] host[[name]]
cisco_xr_show_running-config_hostname.textfsm, .*, cisco_xr, sh[[ow]] run[[ning-config]] host[[name]]
cisco_xr_show_interfaces_description.textfsm, .*, cisco_xr, sh[[ow]] int[[erfaces]](?: (?:\S+))? des[[cription]]
cisco_xr_admin_show_environment_fan.textfsm, .*, cisco_xr, adm[[in]] sh[[ow]] env[[ironment]] f[[an]]
cisco_xr_show_lldp_neighbors_detail.textfsm, .*, cisco_xr, sh[[ow]] ll[[dp]] ne[[ighbors]] de[[tail]]
Expand Down Expand Up @@ -815,7 +816,7 @@ paloalto_panos_show_interface_management.textfsm, .*, paloalto_panos, sh[[ow]] i
paloalto_panos_show_interface_hardware.textfsm, .*, paloalto_panos, sh[[ow]] int[[erface]] hard[[ware]]
paloalto_panos_show_running_nat-policy.textfsm, .*, paloalto_panos, sh[[ow]] runn[[ing]] nat[[-policy]]
paloalto_panos_show_interface_logical.textfsm, .*, paloalto_panos, sh[[ow]] int[[erface]] logi[[cal]]
paloalto_panos_request_license_info.textfsm, .*, paloalto_panos, request license info
paloalto_panos_request_license_info.textfsm, .*, paloalto_panos, request license info
paloalto_panos_show_counter_global.textfsm, .*, paloalto_panos, sh[[ow]] coun[[ter]] glo[[bal]]
paloalto_panos_debug_swm_status.textfsm, .*, paloalto_panos, de[[bug]] s[[wm]] status
paloalto_panos_show_system_info.textfsm, .*, paloalto_panos, sh[[ow]] sys[[tem]] in[[fo]]
Expand Down
33 changes: 33 additions & 0 deletions tests/cisco_ios/show_policy-map/cisco_ios_show_policy-map.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Policy Map vpn-bandwidths
Class internet-private
bandwidth remaining ratio 5 account user-defined 4
service-policy internet-private_class
Class systems-m2m
bandwidth remaining ratio 5 account user-defined 4
service-policy systems-m2m_class
Class internal-office
bandwidth remaining ratio 5 account user-defined 4
service-policy internal-office_class
Class db-net-lst
bandwidth remaining ratio 5 account user-defined 4
service-policy db-net-lst_class
Class db-systems-abc
bandwidth remaining ratio 5 account user-defined 4
service-policy db-systems-abc_class
Class iot-systems
bandwidth remaining ratio 5 account user-defined 4
service-policy iot-systems_class
Class class-default
bandwidth remaining ratio 6 account user-defined 4
service-policy db-systems-net_class

Policy Map db-systems-abc_class
Class premium
bandwidth remaining ratio 10 account user-defined 1
queue-limit 50 ms
Class classic
bandwidth remaining ratio 20 account user-defined 2
queue-limit 50 ms
Class class-default
bandwidth remaining ratio 60 account user-defined 3
queue-limit 50 ms
152 changes: 152 additions & 0 deletions tests/cisco_ios/show_policy-map/cisco_ios_show_policy-map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
parsed_sample:
- class: "internet-private"
class_bw_account: "4"
class_bw_ratio: "5"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: ""
class_service_policy: "internet-private_class"
policy_map: "vpn-bandwidths"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "systems-m2m"
class_bw_account: "4"
class_bw_ratio: "5"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: ""
class_service_policy: "systems-m2m_class"
policy_map: "vpn-bandwidths"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "internal-office"
class_bw_account: "4"
class_bw_ratio: "5"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: ""
class_service_policy: "internal-office_class"
policy_map: "vpn-bandwidths"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "db-net-lst"
class_bw_account: "4"
class_bw_ratio: "5"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: ""
class_service_policy: "db-net-lst_class"
policy_map: "vpn-bandwidths"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "db-systems-abc"
class_bw_account: "4"
class_bw_ratio: "5"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: ""
class_service_policy: "db-systems-abc_class"
policy_map: "vpn-bandwidths"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "iot-systems"
class_bw_account: "4"
class_bw_ratio: "5"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: ""
class_service_policy: "iot-systems_class"
policy_map: "vpn-bandwidths"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "class-default"
class_bw_account: "4"
class_bw_ratio: "6"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: ""
class_service_policy: "db-systems-net_class"
policy_map: "vpn-bandwidths"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "premium"
class_bw_account: "1"
class_bw_ratio: "10"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: "50"
class_service_policy: ""
policy_map: "db-systems-abc_class"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "classic"
class_bw_account: "2"
class_bw_ratio: "20"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: "50"
class_service_policy: ""
policy_map: "db-systems-abc_class"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
- class: "class-default"
class_bw_account: "3"
class_bw_ratio: "60"
class_police_account: ""
class_police_action_conform: ""
class_police_action_exceed: ""
class_police_bc: ""
class_police_cir: ""
class_police_priority: ""
class_queue_limit: "50"
class_service_policy: ""
policy_map: "db-systems-abc_class"
class_shape_cir: ""
class_shape_account: ""
class_shape_rate_type: ""
71 changes: 71 additions & 0 deletions tests/cisco_ios/show_policy-map/cisco_ios_show_policy-map2.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Policy Map vpn-bandwidths
Class db-internet-private
bandwidth remaining ratio 5 account user-defined 4
service-policy db-internet-private_class
Class systems-m2m
bandwidth remaining ratio 5 account user-defined 4
service-policy systems-m2m_class
Class internal-office
bandwidth remaining ratio 5 account user-defined 4
service-policy internal-office_class
Class db-netz-lst
bandwidth remaining ratio 5 account user-defined 4
service-policy db-net-list_class
Class db-systems-abc
bandwidth remaining ratio 5 account user-defined 4
service-policy db-systems-abc_class
Class db-iot-konzern
bandwidth remaining ratio 5 account user-defined 4
service-policy db-iot-konzern_class
Class class-default
bandwidth remaining ratio 6 account user-defined 4
service-policy internal-systems-net_class

Policy Map db-net-list_class
Class network
police cir 200000 bc 6250
conform-action transmit
exceed-action drop
account user-defined 4
priority level 2
Class class-default
bandwidth remaining ratio 1 account user-defined 4
queue-limit 50 ms

Policy Map db-systems-abc_class
Class prioritaet
police cir 290000 bc 9062
conform-action transmit
exceed-action drop
account user-defined 4
priority level 1
Class network
police cir 200000 bc 6250
conform-action transmit
exceed-action drop
account user-defined 4
priority level 2
Class premium
bandwidth remaining ratio 10 account user-defined 4
queue-limit 50 ms
Class classic
bandwidth remaining ratio 20 account user-defined 4
queue-limit 50 ms
Class class-default
bandwidth remaining ratio 60 account user-defined 4
queue-limit 50 ms

Policy Map location-bandwidth
Class class-default
Average Rate Traffic Shaping
cir 3510000 (bps) account user-defined 4
service-policy vpn-bandwidths

Policy Map systems-m2m_class
Class network
police cir 200000 bc 6250
conform-action transmit
exceed-action drop
account user-defined 4
priority level 2
Class class-default
Loading
Loading