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

Hp comware displ vpn inst det #1259

Merged
merged 2 commits into from
Dec 25, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
Value Required NAME ([^,]+)
Value Required ID (\d+)
Value RD (\d+:\d+)
Value List IPV4_EXPORT_RTS (\d+:\d+)
Value List IPV4_IMPORT_RTS (\d+:\d+)
Value List IPV6_EXPORT_RTS (\d+:\d+)
Value List IPV6_IMPORT_RTS (\d+:\d+)
Value DESCRIPTION (.*)
Value IPV4_EXPORT_POLICY (\S+)
Value IPV4_IMPORT_POLICY (\S+)
Value IPV4_TUNNEL_POLICY (\S+)
Value IPV6_EXPORT_POLICY (\S+)
Value IPV6_IMPORT_POLICY (\S+)
Value IPV6_TUNNEL_POLICY (\S+)
Value List INTERFACES ([^,]+)


Start
^\s*VPN-Instance\s+Name\s+and\s+(Index|ID)\s*:\s+${NAME}, ${ID}
^\s*Route\s+Distinguisher\s*:\s+${RD}
^\s*Description\s*:\s*${DESCRIPTION}
# IPv4 targets (block)
^\s*Address-family|s+IPv4 -> AFIPv4
# Export IPv4 targets (inline)
^\s*Export\s+VPN\s+Targets\s*:\s+${IPV4_EXPORT_RTS} -> Continue
^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV4_EXPORT_RTS},* -> Continue
^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV4_EXPORT_RTS},* -> Continue
^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV4_EXPORT_RTS},* -> Continue
^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV4_EXPORT_RTS},* -> Continue
^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV4_EXPORT_RTS},* -> Continue
^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV4_EXPORT_RTS},* -> Continue
^\s*Export\s+VPN\s+Targets\s*:
# Import IPv4 targets
^\s*Import\s+VPN\s+Targets\s*:\s+${IPV4_IMPORT_RTS} -> Continue
^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV4_IMPORT_RTS},* -> Continue
^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV4_IMPORT_RTS},* -> Continue
^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV4_IMPORT_RTS},* -> Continue
^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV4_IMPORT_RTS},* -> Continue
^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV4_IMPORT_RTS},* -> Continue
^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV4_IMPORT_RTS},* -> Continue
^\s*Import\s+VPN\s+Targets\s*:
# IPv4 policies
^\s*Import\s+Route\s+Policy\s*:\s+${IPV4_IMPORT_POLICY}
^\s*Export\s+Route\s+Policy\s*:\s+${IPV4_EXPORT_POLICY}
^\s*Tunnel\s+Policy\s*:\s+${IPV4_TUNNEL_POLICY}
# Export IPv6 targets
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:\s+${IPV6_EXPORT_RTS} -> Continue
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV6_EXPORT_RTS},* -> Continue
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV6_EXPORT_RTS},* -> Continue
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV6_EXPORT_RTS},* -> Continue
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV6_EXPORT_RTS},* -> Continue
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV6_EXPORT_RTS},* -> Continue
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV6_EXPORT_RTS},* -> Continue
^\s*IPv6\s+Export\s+VPN\s+Targets\s*:
# Import IPv6 targets
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:\s+${IPV6_IMPORT_RTS} -> Continue
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV6_IMPORT_RTS},* -> Continue
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV6_IMPORT_RTS},* -> Continue
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV6_IMPORT_RTS},* -> Continue
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV6_IMPORT_RTS},* -> Continue
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV6_IMPORT_RTS},* -> Continue
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV6_IMPORT_RTS},* -> Continue
^\s*IPv6\s+Import\s+VPN\s+Targets\s*:
# IPv6 policies
^\s*IPv6\s+Import\s+Route\s+Policy\s*:\s+${IPV6_IMPORT_POLICY}
^\s*IPv6\s+Export\s+Route\s+Policy\s*:\s+${IPV6_EXPORT_POLICY}
^\s*IPv6\s+Tunnel\s+Policy\s*:\s+${IPV6_TUNNEL_POLICY}
# Interfaces
^\s*Interfaces\s*:\s+${INTERFACES},* -> Continue
^\s*Interfaces\s*:(?:\s+[^,]+,){1}\s+${INTERFACES},* -> Continue
^\s*Interfaces\s*:(?:\s+[^,]+,){2}\s+${INTERFACES},* -> Continue
^\s*Interfaces\s*:(?:\s+[^,]+,){3}\s+${INTERFACES},* -> Continue
^\s*Interfaces\s*:(?:\s+[^,]+,){4}\s+${INTERFACES},* -> Continue
^\s{12,}${INTERFACES},* -> Continue
^\s{12,}(?:\s+[^,]+,){1}\s+${INTERFACES},* -> Continue
^\s{12,}(?:\s+[^,]+,){2}\s+${INTERFACES},* -> Continue
^\s{12,}(?:\s+[^,]+,){3}\s+${INTERFACES},* -> Continue
^\s{12,}(?:\s+[^,]+,){4}\s+${INTERFACES},* -> Continue
# End of Interfaces
^\s*Interfaces\s*:
^\s{12,}
# Drop
^\s*Create\s+time
^\s*Up\s+time
^\s*.*Maximum\s+Routes\s+Limit
^\s{4,}
^. -> Error

AFIPv4
^\s*Export\s+VPN\s+Targets -> ExportIPv4Targets

ExportIPv4Targets
^\s{4,}${IPV4_EXPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){1}\s+${IPV4_EXPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){2}\s+${IPV4_EXPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){3}\s+${IPV4_EXPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){4}\s+${IPV4_EXPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){5}\s+${IPV4_EXPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){6}\s+${IPV4_EXPORT_RTS} -> Continue
^\s{4,}\d+:\d+
^\s*Import\s+VPN\s+Targets -> ImportIPv4Targets
^. -> Error

ImportIPv4Targets
^\s{4,}${IPV4_IMPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){1}\s+${IPV4_IMPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){2}\s+${IPV4_IMPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){3}\s+${IPV4_IMPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){4}\s+${IPV4_IMPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){5}\s+${IPV4_IMPORT_RTS} -> Continue
^\s{4,}(?:\s+\d+:\d+){6}\s+${IPV4_IMPORT_RTS} -> Continue
^\s{4,}\d+:\d+
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ fortinet_get_system_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] stat[[us]]
fortinet_get_system_arp.textfsm, .*, fortinet, g[[et]] sy[[stem]] arp

hp_comware_display_lldp_neighbor-information_verbose.textfsm, .*, hp_comware, di[[splay]] ll[[dp]] n[[eighbor-information]] v[[erbose]]
hp_comware_display_ip_vpn-instance_instance-name.textfsm, .*, hp_comware, di[[splay]] ip vpn[[-instance]] in[[instance-name]]
hp_comware_display_counters_bound_interface.textfsm, .*, hp_comware, di[[splay]] cou[[nters]] (\S+) i[[nterface]]
hp_comware_display_ip_routing-table.textfsm, .*, hp_comware, di[[splay]] ip r[[outing-table]]
hp_comware_display_device_manuinfo.textfsm, .*, hp_comware, di[[splay]] dev[[ice]] m[[anuinfo]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VPN-Instance Name and Index : vpna, 1
Route Distinguisher : 100:1
Interfaces : Vlan-interface10
Address-family IPv4:
Export VPN Targets :
111:1
Import VPN Targets :
111:1 222:2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
parsed_sample:
- name: "vpna"
id: "1"
rd: "100:1"
description: ""
ipv4_export_rts:
- "111:1"
ipv4_import_rts:
- "111:1"
- "222:2"
ipv4_export_policy: ""
ipv4_import_policy: ""
ipv4_tunnel_policy: ""
ipv6_export_rts: []
ipv6_import_rts: []
ipv6_export_policy: ""
ipv6_import_policy: ""
ipv6_tunnel_policy: ""
interfaces:
- "Vlan-interface10"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
VPN-Instance Name and ID : vpn1, 1
Create time : 2022/12/21 0520:27:29
Up time : 0 days, 00 hours, 07 minutes and 39 seconds
Route Distinguisher : 101:1
Description : This is vpn1
Export VPN Targets : 1:1
Import VPN Targets : 1:2
Import Route Policy : policy3
Export Route Policy : policy2
Tunnel Policy : policy1
Maximum Routes Limit : 600
IPv6 Export VPN Targets : 2:1
IPv6 Import VPN Targets : 2:2
IPv6 Import Route Policy : policy4
IPv6 Export Route Policy : policy1
IPv6 Tunnel Policy : policy1
IPv6 Maximum Routes Limit : 600
Interfaces : Ten-GigabitEthernet1/0/52
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
parsed_sample:
- name: "vpn1"
id: "1"
rd: "101:1"
description: "This is vpn1"
ipv4_export_rts:
- "1:1"
ipv4_import_rts:
- "1:2"
ipv4_export_policy: "policy2"
ipv4_import_policy: "policy3"
ipv4_tunnel_policy: "policy1"
ipv6_export_rts:
- "2:1"
ipv6_import_rts:
- "2:2"
ipv6_export_policy: "policy1"
ipv6_import_policy: "policy4"
ipv6_tunnel_policy: "policy1"
interfaces:
- "Ten-GigabitEthernet1/0/52"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
VPN-Instance Name and Index : vpnb, 2
Route Distinguisher : 100:2
Interfaces : Vlan-interface20, FortyGigE1/0/53,
GigabitEthernet1/0/25
Address-family IPv4:
Export VPN Targets :
222:2
Import VPN Targets :
222:2 111:1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
parsed_sample:
- name: "vpnb"
id: "2"
rd: "100:2"
description: ""
ipv4_export_rts:
- "222:2"
ipv4_import_rts:
- "222:2"
- "111:1"
ipv4_export_policy: ""
ipv4_import_policy: ""
ipv4_tunnel_policy: ""
ipv6_export_rts: []
ipv6_import_rts: []
ipv6_export_policy: ""
ipv6_import_policy: ""
ipv6_tunnel_policy: ""
interfaces:
- "Vlan-interface20"
- "FortyGigE1/0/53"
- "GigabitEthernet1/0/25"