Skip to content

Commit

Permalink
HP Comware 'display interface' template fix (#1528)
Browse files Browse the repository at this point in the history
* Add untagged vlan parsing
* Change untagged vlan value name
  • Loading branch information
PavloSkliarenko authored Nov 6, 2023
1 parent d296134 commit 1af0507
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ntc_templates/templates/hp_comware_display_interface.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Value BANDWIDTH (.*)
Value DUPLEX (\S+)
Value SPEED (\S+)
Value PORT_LINK_TYPE (\S+)
Value UNTAGGED_VLAN_ID (\d+)
Value VLAN_NATIVE (\d+)
Value List VLAN_PASSING ([^,]+)
Value List VLAN_PERMITTED ([^,]+)
Expand Down Expand Up @@ -37,6 +38,7 @@ Start
^\s*${SPEED},\s+${DUPLEX},\s+link\s+type
^\s*PVID:\s+${VLAN_NATIVE}
^\s*Port\s+link-type:\s+${PORT_LINK_TYPE}
^\s*Un[Tt]agged\s+VLAN\s+ID\s*:\s*${UNTAGGED_VLAN_ID}
# Trunk - Passing VLANs (parsing multiple times with Continue)
^\s+VLAN\s+[Pp]assing\s*:\s+${VLAN_PASSING},* -> Continue
# Skip initial VLANs and read the Nth + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "UP"
speed: ""
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Expand All @@ -31,6 +32,7 @@ parsed_sample:
port_link_type: "Trunk"
protocol_status: "UP"
speed: "40Gbps-speed"
untagged_vlan_id: ""
vlan_native: "1"
vlan_passing:
- "1(default vlan)"
Expand All @@ -53,6 +55,7 @@ parsed_sample:
port_link_type: "Trunk"
protocol_status: "DOWN"
speed: "Unknown-speed"
untagged_vlan_id: ""
vlan_native: "2190"
vlan_passing:
- "2000"
Expand All @@ -74,6 +77,7 @@ parsed_sample:
port_link_type: "Access"
protocol_status: "DOWN"
speed: "Unknown-speed"
untagged_vlan_id: ""
vlan_native: "1"
vlan_passing: []
vlan_permitted: []
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parsed_sample:
port_link_type: "Trunk"
protocol_status: ""
speed: "160Gbps-speed"
untagged_vlan_id: ""
vlan_native: "1"
vlan_passing:
- "2-21"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parsed_sample:
port_link_type: "Access"
protocol_status: "DOWN"
speed: "Unknown-speed"
untagged_vlan_id: ""
vlan_native: "1"
vlan_passing: []
vlan_permitted: []
Expand All @@ -28,6 +29,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "UP(spoofing)"
speed: ""
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Expand All @@ -45,6 +47,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "DOWN"
speed: "Unknown-speed"
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parsed_sample:
port_link_type: "Trunk"
protocol_status: ""
speed: "20Gbps-speed"
untagged_vlan_id: ""
vlan_native: "1"
vlan_passing:
- "1(default vlan)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parsed_sample:
port_link_type: "trunk"
protocol_status: ""
speed: "20Gbps-speed"
untagged_vlan_id: ""
vlan_native: "1"
vlan_passing:
- "1(default vlan)"
Expand All @@ -36,6 +37,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "UP"
speed: ""
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "UP"
speed: "1000Mb/s"
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parsed_sample:
port_link_type: "access"
protocol_status: ""
speed: "10Gbps-speed"
untagged_vlan_id: "1"
vlan_native: "1"
vlan_passing: []
vlan_permitted: []
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parsed_sample:
port_link_type: "Trunk"
protocol_status: "UP"
speed: "1000Mbps-speed"
untagged_vlan_id: ""
vlan_native: "1"
vlan_passing:
- "4050"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ parsed_sample:
port_link_type: ""
protocol_status: ""
speed: ""
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Expand All @@ -30,6 +31,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "UP"
speed: "1000Mbps-speed"
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Expand All @@ -46,6 +48,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "UP"
speed: ""
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "DOWN"
speed: "1000M"
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []
Expand All @@ -30,6 +31,7 @@ parsed_sample:
port_link_type: ""
protocol_status: "UP"
speed: ""
untagged_vlan_id: ""
vlan_native: ""
vlan_passing: []
vlan_permitted: []

0 comments on commit 1af0507

Please sign in to comment.