-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BugFix: IOS cdp nei - don't require leading space (#480)
- Loading branch information
1 parent
dccc8c7
commit 12a0bb3
Showing
3 changed files
with
146 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
Value Required NEIGHBOR (\S+) | ||
Value LOCAL_INTERFACE (\S+\s\S+) | ||
Value CAPABILITY ((?:\w(?:\s(?!\s))?){0,}) | ||
Value PLATFORM (\S{2,}\s\S{2,}|\S+) | ||
Value NEIGHBOR_INTERFACE (\S+\s\S+) | ||
Value LOCAL_INTERFACE (\S+(?:\s\S+)?) | ||
Value CAPABILITY ((?:\w\s*?)*?) | ||
Value PLATFORM (\S{2,}\s\S+|\S{2,}) | ||
Value NEIGHBOR_INTERFACE ([a-zA-Z]\S+(?:\s\S+)?) | ||
|
||
Start | ||
^Device.*ID -> CDP | ||
|
||
CDP | ||
^${NEIGHBOR}$$ | ||
^\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record | ||
^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s+${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record | ||
|
||
^\s*${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record | ||
^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITY}\s*${PLATFORM}\s+${NEIGHBOR_INTERFACE} -> Record |
112 changes: 112 additions & 0 deletions
112
tests/cisco_ios/show_cdp_neighbors/cisco_ios_show_cdp_neighbors_3.parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
--- | ||
parsed_sample: | ||
- capability: H P | ||
local_interface: Gig 1/0/16 | ||
neighbor: SEP000000000000 | ||
neighbor_interface: port 1 | ||
platform: IP Phone | ||
- capability: T B I | ||
local_interface: Gig 1/0/45 | ||
neighbor: AP000000000 | ||
neighbor_interface: Gig 0 | ||
platform: AIR-CAP35 | ||
- capability: T B I | ||
local_interface: Gig 1/0/46 | ||
neighbor: AP000000001 | ||
neighbor_interface: Gig 0 | ||
platform: AIR-CAP35 | ||
- capability: T | ||
local_interface: Gig 1/0/1 | ||
neighbor: WAAS0000000 | ||
neighbor_interface: InlinePort 1/1/lan | ||
platform: OE474 | ||
- capability: H | ||
local_interface: Gig 1/0/40 | ||
neighbor: WAAS0000000 | ||
neighbor_interface: Gig 1/0 | ||
platform: OE474 | ||
- capability: R B S | ||
local_interface: Gig 1/0/1 | ||
neighbor: router.domain.local | ||
neighbor_interface: Gig 0/0 | ||
platform: CISCO2911 | ||
- capability: H P M | ||
local_interface: Gig 1/0/33 | ||
neighbor: SEP000000000001 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/29 | ||
neighbor: SEP000000000002 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/30 | ||
neighbor: SEP000000000003 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/14 | ||
neighbor: SEP000000000004 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/8 | ||
neighbor: SEP000000000005 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/13 | ||
neighbor: SEP000000000006 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P | ||
local_interface: Gig 1/0/15 | ||
neighbor: SEP000000000007 | ||
neighbor_interface: eth0 | ||
platform: CTS-CODEC | ||
- capability: H P M | ||
local_interface: Gig 1/0/37 | ||
neighbor: SEP000000000008 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/34 | ||
neighbor: SEP000000000009 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P | ||
local_interface: Gig 1/0/21 | ||
neighbor: SEP00000000000A | ||
neighbor_interface: eth0 | ||
platform: CTS-CODEC | ||
- capability: H P M | ||
local_interface: Gig 1/0/35 | ||
neighbor: SEP00000000000B | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/24 | ||
neighbor: SEP00000000000C | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/9 | ||
neighbor: SEP00000000000D | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/17 | ||
neighbor: SEP00000000000E | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/20 | ||
neighbor: SEP00000000000F | ||
neighbor_interface: Port 1 | ||
platform: IP Phone | ||
- capability: H P M | ||
local_interface: Gig 1/0/36 | ||
neighbor: SEP000000000010 | ||
neighbor_interface: Port 1 | ||
platform: IP Phone |
28 changes: 28 additions & 0 deletions
28
tests/cisco_ios/show_cdp_neighbors/cisco_ios_show_cdp_neighbors_3.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge | ||
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone, | ||
D - Remote, C - CVTA, M - Two-port Mac Relay | ||
|
||
Device ID Local Intrfce Holdtme Capability Platform Port ID | ||
SEP000000000000 Gig 1/0/16 155 H P IP Phone port 1 | ||
AP000000000 Gig 1/0/45 158 T B I AIR-CAP35 Gig 0 | ||
AP000000001 Gig 1/0/46 173 T B I AIR-CAP35 Gig 0 | ||
WAAS0000000 Gig 1/0/1 138 T OE474 InlinePort 1/1/lan | ||
WAAS0000000 Gig 1/0/40 138 H OE474 Gig 1/0 | ||
router.domain.local | ||
Gig 1/0/1 134 R B S CISCO2911 Gig 0/0 | ||
SEP000000000001 Gig 1/0/33 152 H P M IP Phone Port 1 | ||
SEP000000000002 Gig 1/0/29 173 H P M IP Phone Port 1 | ||
SEP000000000003 Gig 1/0/30 160 H P M IP Phone Port 1 | ||
SEP000000000004 Gig 1/0/14 169 H P M IP Phone Port 1 | ||
SEP000000000005 Gig 1/0/8 140 H P M IP Phone Port 1 | ||
SEP000000000006 Gig 1/0/13 135 H P M IP Phone Port 1 | ||
SEP000000000007 Gig 1/0/15 164 H P CTS-CODEC eth0 | ||
SEP000000000008 Gig 1/0/37 173 H P M IP Phone Port 1 | ||
SEP000000000009 Gig 1/0/34 176 H P M IP Phone Port 1 | ||
SEP00000000000A Gig 1/0/21 179 H P CTS-CODEC eth0 | ||
SEP00000000000B Gig 1/0/35 177 H P M IP Phone Port 1 | ||
SEP00000000000C Gig 1/0/24 164 H P M IP Phone Port 1 | ||
SEP00000000000D Gig 1/0/9 176 H P M IP Phone Port 1 | ||
SEP00000000000E Gig 1/0/17 131 H P M IP Phone Port 1 | ||
SEP00000000000F Gig 1/0/20 136 H P M IP Phone Port 1 | ||
SEP000000000010 Gig 1/0/36 162 H P M IP Phone Port 1 |