Skip to content

Commit

Permalink
Merge branch 'master' into standardize_capture_group_prefix_length
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanderaa committed Aug 7, 2023
2 parents 2616c07 + 4b9fe3d commit 7eeb79d
Show file tree
Hide file tree
Showing 18 changed files with 301 additions and 80 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Value INTERFACE (\S+)
Value PROCESS (\d+)
Value AREA (\d+)
Value IP_ADDRESS_MASK (\d+\.\d+\.\d+\.\d+/\d+\.\d+\.\d+\.\d+)
Value IP_ADDRESS (\d+\.\d+\.\d+\.\d+)
Value NETMASK (\d+\.\d+\.\d+\.\d+)
Value COST (\d+)
Value STATE (\S+)
Value NEIGHBORS_FC (\d+/\d+)

Start
^Interface\s+PID\s+Area\s+IP\s+Address/Mask\s+Cost\s+State\s+Nbrs\s+F/C\s*$$
^${INTERFACE}\s+${PROCESS}\s+${AREA}\s+${IP_ADDRESS_MASK}\s+${COST}\s+${STATE}\s+${NEIGHBORS_FC} -> Record
^${INTERFACE}\s+${PROCESS}\s+${AREA}\s+${IP_ADDRESS}\/${NETMASK}\s+${COST}\s+${STATE}\s+${NEIGHBORS_FC} -> Record
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Value INTERFACE (\S+)
Value PROCESS (\d+)
Value AREA (\d+)
Value IP_ADDRESS_MASK (\d+\.\d+\.\d+\.\d+/\d+)
Value IP_ADDRESS (\d+\.\d+\.\d+\.\d+)
Value PREFIX_LENGTH (\d+)
Value COST (\d+)
Value STATE (\S+)
Value NEIGHBORS_FC (\d+/\d+)

Start
^${INTERFACE}\s+${PROCESS}\s+${AREA}\s+${IP_ADDRESS_MASK}\s+${COST}\s+${STATE}\s+${NEIGHBORS_FC} -> Record
^${INTERFACE}\s+${PROCESS}\s+${AREA}\s+${IP_ADDRESS}\/${PREFIX_LENGTH}\s+${COST}\s+${STATE}\s+${NEIGHBORS_FC} -> Record
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Value INTERFACE_NAME (\S+)
Value MAC_ADDRESS (\w+\.\w+\.\w+|\w+\:\w+\:\w+\:\w+\:\w+\:\w+)
Value IP_ADDRESS (\d+.\d+.\d+.\d+)
Value NETMASK (\d+.\d+.\d+.\d+)
Value IP_GATEWAY (\d+.\d+.\d+.\d+)
Value GATEWAY (\d+.\d+.\d+.\d+)
Value PRIMARY_DHCP_SERVER (\d+.\d+.\d+.\d+|Unconfigured)
Value SECONDARY_DHCP_SERVER (\d+.\d+.\d+.\d+|Unconfigured)

Expand All @@ -11,7 +11,7 @@ Start
^\s*MAC\s+Address\.+\s+${MAC_ADDRESS}\s*$$
^\s*IP\s+Address\.+\s+${IP_ADDRESS}\s*$$
^\s*IP\s+Netmask\.+\s+${NETMASK}\s*$$
^\s*IP\s+Gateway\.+\s+${IP_GATEWAY}\s*$$
^\s*IP\s+Gateway\.+\s+${GATEWAY}\s*$$
^\s*Primary\s+DHCP\s+Server\.+\s+${PRIMARY_DHCP_SERVER}\s*$$
^\s*Secondary\s+DHCP\s+Server\.+\s+${SECONDARY_DHCP_SERVER}\s*$$ -> Record
^\s*External\s+NAT\s+IP\s+State.*$$
Expand Down
9 changes: 8 additions & 1 deletion ntc_templates/templates/hp_procurve_show_arp.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ Value TYPE (\S+)
Value PORT (\S+)

Start
^.*IP ARP table -> ARP
^.*IP ARP table
^.*IP Address -> ARP
^\s*$$
^. -> Error

ARP
^\s+${IP}\s+${MAC_ADDRESS}\s+${TYPE}\s+${PORT} -> Record
^\s+${IP}\s+${MAC_ADDRESS}\s+${TYPE} -> Record
^\s*------
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Value Required LOCAL_PORT (.+?)
Value NEIGHBOR_ID (.+?)
Value NEIGHBOR_ADDRESS (.+?)
Value NEIGHBOR_PLATFORM (.+?)
Value NEIGHBOR_CAPABILITY (.+?)
Value NEIGHBOR_PORT (.+?)
Value NEIGHBOR_VERSION (.+?)

Start
^\s*CDP\s+neighbors\s+information
^\s*Port\s*:\s*${LOCAL_PORT}\s*$$
^\s*Device\s+ID\s*:\s*${NEIGHBOR_ID}\s*$$
^\s*Address\s+Type
^\s*Address\s*:\s*${NEIGHBOR_ADDRESS}\s*$$
^\s*Platform\s*:\s*${NEIGHBOR_PLATFORM}\s*$$
^\s*Capability\s*:\s*${NEIGHBOR_CAPABILITY}\s*$$
^\s*Device\s+Port\s*:\s*${NEIGHBOR_PORT}\s*$$
^\s*Version\s*:\s*${NEIGHBOR_VERSION}\s*$$ -> Record
^\s*$$
^\s*----
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Value TYPE (\S*)
Value INTRUSION_ALERT (Yes|No)
Value ENABLED (Yes|No)
Value STATUS (Up|Down)
Value MODE (\S+)
Value MODE (\S*)
Value MDI_MODE (MDI\S*|Auto|NA)
Value FLOW_CTRL (on|off)
Value BCAST_LIMIT (\d+)
Expand All @@ -19,12 +19,14 @@ Start
showintbrief1
^\s+${PORT}\s+${TYPE}\s+\|\s+${INTRUSION_ALERT}\s+${ENABLED}\s+${STATUS}\s+${MODE}\s+(?:${MDI_MODE}\s+)?${FLOW_CTRL}\s*$$ -> Record
^\s*-+(?:\s|-|\+)+$$
^\s*\*\s+third-party.*$$
^\s*$$
^. -> Error

showintbrief2
^\s+${PORT}\s+${TYPE}\s+\|\s+${INTRUSION_ALERT}\s+${ENABLED}\s+${STATUS}\s+${MODE}\s+(?:${MDI_MODE}\s+)?${FLOW_CTRL}\s+${BCAST_LIMIT}\s*$$ -> Record
^\s*-+(?:\s|-|\+)+$$
^\s*\*\s+third-party.*$$
^\s*$$
^. -> Error

1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ hp_comware_display_arp.textfsm, .*, hp_comware, di[[splay]] a[[rp]]

hp_procurve_show_lldp_info_remote-device_detail.textfsm, .*, hp_procurve, sh[[ow]] ll[[dp]] i[[nfo]] r[[emote-device]] .+
hp_procurve_show_lldp_info_remote-device.textfsm, .*, hp_procurve, sh[[ow]] ll[[dp]] i[[nfo]] r[[emote-device]]
hp_procurve_show_cdp_neighbors_detail.textfsm, .*, hp_procurve, sh[[ow]] cd[[p]] nei[[ghbors]] d[[etail]]
hp_procurve_show_interfaces_brief.textfsm, .*, hp_procurve, sh[[ow]] int[[erfaces]] b[[rief]]
hp_procurve_show_port-security.textfsm, .*, hp_procurve, sh[[ow]] port-s[[ecurity]]
hp_procurve_show_tech_buffers.textfsm, .*, hp_procurve, sh[[ow]] tec[[h]] buf[[ffers]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
---
parsed_sample:
- interface: "Outside"
process: "101"
area: "101"
ip_address_mask: "10.10.100.10/255.255.255.248"
- area: "101"
cost: "10"
state: "P2P"
interface: "Outside"
ip_address: "10.10.100.10"
neighbors_fc: "1/1"
- interface: "Transit"
process: "100"
area: "100"
ip_address_mask: "10.255.111.1/255.255.255.248"
netmask: "255.255.255.248"
process: "101"
state: "P2P"
- area: "100"
cost: "10"
state: "BDR"
interface: "Transit"
ip_address: "10.255.111.1"
neighbors_fc: "1/1"
- interface: "Inside"
netmask: "255.255.255.248"
process: "100"
area: "110"
ip_address_mask: "10.25.1.17/255.255.255.240"
state: "BDR"
- area: "110"
cost: "10"
state: "DR"
interface: "Inside"
ip_address: "10.25.1.17"
neighbors_fc: "2/2"
netmask: "255.255.255.240"
process: "100"
state: "DR"
Original file line number Diff line number Diff line change
@@ -1,86 +1,98 @@
---
parsed_sample:
- interface: "Lo0"
process: "1"
area: "0"
ip_address_mask: "172.16.0.11/32"
- area: "0"
cost: "1"
state: "LOOP"
interface: "Lo0"
ip_address: "172.16.0.11"
neighbors_fc: "0/0"
- interface: "Se0/0/0.100"
prefix_length: "32"
process: "1"
area: "0"
ip_address_mask: "172.16.1.1/30"
state: "LOOP"
- area: "0"
cost: "50"
state: "P2P"
interface: "Se0/0/0.100"
ip_address: "172.16.1.1"
neighbors_fc: "1/1"
- interface: "Fa0/0"
prefix_length: "30"
process: "1"
area: "0"
ip_address_mask: "10.0.0.5/24"
state: "P2P"
- area: "0"
cost: "1"
state: "BDR"
interface: "Fa0/0"
ip_address: "10.0.0.5"
neighbors_fc: "1/1"
- interface: "Fa0/1"
prefix_length: "24"
process: "1"
area: "11"
ip_address_mask: "10.1.2.1/24"
state: "BDR"
- area: "11"
cost: "1"
state: "DR"
interface: "Fa0/1"
ip_address: "10.1.2.1"
neighbors_fc: "0/0"
- interface: "Tu1610"
prefix_length: "24"
process: "1"
area: "0"
ip_address_mask: "0.0.0.0/0"
state: "DR"
- area: "0"
cost: "50"
state: "P2P"
interface: "Tu1610"
ip_address: "0.0.0.0"
neighbors_fc: "0/0"
- interface: "Lo5"
prefix_length: "0"
process: "1"
area: "0"
ip_address_mask: "10.48.8.5/32"
state: "P2P"
- area: "0"
cost: "1"
state: "LOOP"
interface: "Lo5"
ip_address: "10.48.8.5"
neighbors_fc: "0/0"
- interface: "Lo4"
prefix_length: "32"
process: "1"
area: "0"
ip_address_mask: "10.48.8.4/32"
cost: "1"
state: "LOOP"
- area: "0"
cost: "1"
interface: "Lo4"
ip_address: "10.48.8.4"
neighbors_fc: "0/0"
- interface: "Tu1603"
prefix_length: "32"
process: "1"
area: "0"
ip_address_mask: "0.0.0.0/0"
state: "LOOP"
- area: "0"
cost: "50"
state: "DOWN"
interface: "Tu1603"
ip_address: "0.0.0.0"
neighbors_fc: "0/0"
- interface: "Tu1602"
prefix_length: "0"
process: "1"
area: "0"
ip_address_mask: "0.0.0.0/0"
state: "DOWN"
- area: "0"
cost: "50"
state: "P2P"
interface: "Tu1602"
ip_address: "0.0.0.0"
neighbors_fc: "0/0"
- interface: "PO4/0"
prefix_length: "0"
process: "1"
area: "0"
ip_address_mask: "10.1.232.6/30"
cost: "6"
state: "P2P"
- area: "0"
cost: "6"
interface: "PO4/0"
ip_address: "10.1.232.6"
neighbors_fc: "1/1"
- interface: "Se3/2:0"
prefix_length: "30"
process: "1"
area: "0"
ip_address_mask: "10.1.224.218/30"
cost: "6"
state: "P2P"
- area: "0"
cost: "6"
interface: "Se3/2:0"
ip_address: "10.1.224.218"
neighbors_fc: "1/1"
- interface: "Se3/1:0"
prefix_length: "30"
process: "1"
area: "0"
ip_address_mask: "10.1.225.150/30"
cost: "6"
state: "P2P"
- area: "0"
cost: "6"
interface: "Se3/1:0"
ip_address: "10.1.225.150"
neighbors_fc: "1/1"
prefix_length: "30"
process: "1"
state: "P2P"
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
parsed_sample:
- interface_name: "my-interface"
- gateway: "8.8.8.1"
interface_name: "my-interface"
ip_address: "8.8.8.8"
ip_gateway: "8.8.8.1"
mac_address: "c0:12:43:56:78:90"
netmask: "255.255.254.0"
mac_address: "c0:12:43:56:78:90"
primary_dhcp_server: "1.1.1.1"
secondary_dhcp_server: "1.1.1.2"
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
parsed_sample:
- interface_name: "my-interface"
- gateway: "8.8.8.1"
interface_name: "my-interface"
ip_address: "8.8.8.8"
ip_gateway: "8.8.8.1"
mac_address: "c0:12:43:56:78:90"
netmask: "255.255.254.0"
mac_address: "c0:12:43:56:78:90"
primary_dhcp_server: "Unconfigured"
secondary_dhcp_server: "Unconfigured"
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
parsed_sample:
- interface_name: "my-interface"
- gateway: "8.8.8.1"
interface_name: "my-interface"
ip_address: "8.8.8.8"
ip_gateway: "8.8.8.1"
mac_address: "c0:12:43:56:78:90"
netmask: "255.255.254.0"
mac_address: "c0:12:43:56:78:90"
primary_dhcp_server: "Unconfigured"
secondary_dhcp_server: "Unconfigured"
6 changes: 6 additions & 0 deletions tests/hp_procurve/show_arp/hp_procurve_show_arp_2.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

IP ARP table

IP Address MAC Address Type Port
--------------- ----------------- ------- ----
10.11.12.11 0015b2-a45078 dynamic
6 changes: 6 additions & 0 deletions tests/hp_procurve/show_arp/hp_procurve_show_arp_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
parsed_sample:
- ip: "10.11.12.11"
mac_address: "0015b2-a45078"
type: "dynamic"
port: ""
Loading

0 comments on commit 7eeb79d

Please sign in to comment.