Skip to content

Commit

Permalink
New template: Huawei - display arp brief (#1208)
Browse files Browse the repository at this point in the history
Co-authored-by: Edouard Lavaud <[email protected]>
  • Loading branch information
elavaud and Edouard Lavaud authored Oct 26, 2022
1 parent 8edf576 commit e7e335e
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ntc_templates/templates/huawei_vrp_display_arp_brief.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Value IP_ADDRESS (\d+.\d+.\d+.\d+)
Value MAC_ADDRESS ((\w+-?)+)
Value EXPIRE (\d+)
Value TYPE (I\s-|[DS][F-][\d\s])
Value INTERFACE (\S+)
Value VLAN (\d+/(\d+|-))
Value PVC (\S+)

Start
^\s*IP\sADDRESS.+$$ -> Next
^\s+VLAN.+$$ -> Next
^-+ -> Next
^\s*\d+.\d+.\d+.\d+ -> Continue.Record
^\s*${IP_ADDRESS}\s+(${MAC_ADDRESS}\s+)?(${EXPIRE}\s+)?${TYPE}\s+${INTERFACE}(\s+${VLAN})?(\s+${PVC})?\s*$$
^\s*${VLAN}(\s+${PVC})?\s*$$
^Total:.+$$ -> Next
^.*$$ -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ huawei_vrp_display_interface_description.textfsm, .*, huawei_vrp, dis[[play]] in
huawei_vrp_display_interface_brief.textfsm, .*, huawei_vrp, dis[[play]] inter[[face]] br[[ief]]
huawei_vrp_display_lldp_neighbor.textfsm, .*, huawei_vrp, dis[[play]] lldp nei[[ghbor]]
huawei_vrp_display_temperature.textfsm, .*, huawei_vrp, dis[[play]] tem[[perature]]
huawei_vrp_display_arp_brief.textfsm, .*, huawei_vrp, dis[[play]] arp br[[ief]]
huawei_vrp_display_port_vlan.textfsm, .*, huawei_vrp, dis[[play]] port vl[[an]]
huawei_vrp_display_version.textfsm, .*, huawei_vrp, dis[[play]] ver[[sion]]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
IP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE VLAN/CEVLAN
------------------------------------------------------------------------------
192.168.120.251 60de-4474-9640 I - Vlanif1
192.168.120.1 7054-f5df-9b40 3 D-0 GE0/0/0 1/-
192.168.120.252 04f9-3895-8300 19 D-0 GE0/0/0 1/-
------------------------------------------------------------------------------
Total:3 Dynamic:2 Static:0 Interface:1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
parsed_sample:
- ip_address: "192.168.120.251"
mac_address: "60de-4474-9640"
expire: ""
type: "I -"
interface: "Vlanif1"
vlan: ""
pvc: ""
- ip_address: "192.168.120.1"
mac_address: "7054-f5df-9b40"
expire: "3"
type: "D-0"
interface: "GE0/0/0"
vlan: "1/-"
pvc: ""
- ip_address: "192.168.120.252"
mac_address: "04f9-3895-8300"
expire: "19"
type: "D-0"
interface: "GE0/0/0"
vlan: "1/-"
pvc: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
IP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE
VLAN/CEVLAN(SIP/DIP) PVC
------------------------------------------------------------------------------
192.168.1.1 fc73-fb9e-601c I - Vlanif1
192.168.1.118 a078-17b2-7bc0 20 D-0 Wlan-Bss7 1/-
192.168.120.1 fc73-fb9e-601c I - Vlanif2
10/-
100.95.15.241 fc73-fb9e-601c I - Vlanif100
------------------------------------------------------------------------------
Total:4 Dynamic:1 Static:0 Interface:3
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
parsed_sample:
- ip_address: "192.168.1.1"
mac_address: "fc73-fb9e-601c"
expire: ""
type: "I -"
interface: "Vlanif1"
vlan: ""
pvc: ""
- ip_address: "192.168.1.118"
mac_address: "a078-17b2-7bc0"
expire: "20"
type: "D-0"
interface: "Wlan-Bss7"
vlan: "1/-"
pvc: ""
- ip_address: "192.168.120.1"
mac_address: "fc73-fb9e-601c"
expire: ""
type: "I -"
interface: "Vlanif2"
vlan: "10/-"
pvc: ""
- ip_address: "100.95.15.241"
mac_address: "fc73-fb9e-601c"
expire: ""
type: "I -"
interface: "Vlanif100"
vlan: ""
pvc: ""

0 comments on commit e7e335e

Please sign in to comment.