-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from burningnode/master
Adding "get route" template for IPv4 for Juniper NetScreen (screenos)
- Loading branch information
Showing
4 changed files
with
91 additions
and
0 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
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 @@ | ||
Value Filldown VR (\S+) | ||
Value BEST (\S+) | ||
Value ID (\d+) | ||
Value Required PREFIX (\S+) | ||
Value OUTINTERFACE (\S+) | ||
Value NEXTHOP (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) | ||
Value PROTOCOL (\S+) | ||
Value PREF (\d+) | ||
Value METRIC (\d+) | ||
Value VSYS (\S+) | ||
|
||
Start | ||
# Match the VR | ||
^IPv\d\s+Dest-Routes\s+for\s+<${VR}> | ||
# Match route line | ||
^${BEST}\s+${ID}\s+${PREFIX}\s+${OUTINTERFACE}\s+${NEXTHOP}\s+${PROTOCOL}\s+${PREF}\s+${METRIC}\s+${VSYS} -> Record | ||
# Match table separator | ||
^-+\s*$$ | ||
# Match route type keys | ||
^\S+:\s+ | ||
# Match lines that are just space | ||
^\s+$$ | ||
# Match table header | ||
^\s+ID\s+IP-Prefix\s+Interface\s+Gateway\s+P\s+Pref\s+Mtr\s+Vsys\s*$$ | ||
# Error out if line does not match any expressions | ||
^.+ -> Error "Line not found" | ||
|
||
EOF |
46 changes: 46 additions & 0 deletions
46
tests/juniper_screenos/get_route/juniper_screenos_get_route.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,46 @@ | ||
--- | ||
parsed_sample: | ||
|
||
- vr: 'trust-vr' | ||
best: '*' | ||
id: '4' | ||
prefix: '1.1.1.2/32' | ||
outinterface: 'eth0/1' | ||
nexthop: '0.0.0.0' | ||
protocol: 'H' | ||
pref: '0' | ||
metric: '0' | ||
vsys: 'Root' | ||
|
||
- vr: 'trust-vr' | ||
best: '*' | ||
id: '2' | ||
prefix: '192.168.1.1/32' | ||
outinterface: 'eth0/0' | ||
nexthop: '0.0.0.0' | ||
protocol: 'H' | ||
pref: '0' | ||
metric: '0' | ||
vsys: 'Root' | ||
|
||
- vr: 'trust-vr' | ||
best: '*' | ||
id: '1' | ||
prefix: '192.168.1.0/24' | ||
outinterface: 'eth0/0' | ||
nexthop: '0.0.0.0' | ||
protocol: 'C' | ||
pref: '0' | ||
metric: '0' | ||
vsys: 'Root' | ||
|
||
- vr: 'trust-vr' | ||
best: '*' | ||
id: '3' | ||
prefix: '1.1.1.0/24' | ||
outinterface: 'eth0/1' | ||
nexthop: '0.0.0.0' | ||
protocol: 'C' | ||
pref: '0' | ||
metric: '0' | ||
vsys: 'Root' |
15 changes: 15 additions & 0 deletions
15
tests/juniper_screenos/get_route/juniper_screenos_get_route.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,15 @@ | ||
IPv4 Dest-Routes for <untrust-vr> (0 entries) | ||
---------------------------------------------------------------------- | ||
H: Host C: Connected S: Static A: Auto-Exported | ||
I: Imported R: RIP P: Permanent D: Auto-Discovered | ||
iB: IBGP eB: EBGP O: OSPF E1: OSPF external type 1 | ||
E2: OSPF external type 2 | ||
|
||
IPv4 Dest-Routes for <trust-vr> (4 entries) | ||
---------------------------------------------------------------------- | ||
ID IP-Prefix Interface Gateway P Pref Mtr Vsys | ||
---------------------------------------------------------------------- | ||
* 4 1.1.1.2/32 eth0/1 0.0.0.0 H 0 0 Root | ||
* 2 192.168.1.1/32 eth0/0 0.0.0.0 H 0 0 Root | ||
* 1 192.168.1.0/24 eth0/0 0.0.0.0 C 0 0 Root | ||
* 3 1.1.1.0/24 eth0/1 0.0.0.0 C 0 0 Root |