Skip to content

Commit

Permalink
Bugfix: Accounted for ASBR/ABR in cisco_ios_show_ip_ospf_database_rou…
Browse files Browse the repository at this point in the history
…ter (#691)
  • Loading branch information
FragmentedPacket authored May 7, 2020
1 parent 6791f81 commit 190cede
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/cisco_ios_show_ip_ospf_database_network.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Value Filldown LSA_SEQ_NUMBER (\S+)
Value Filldown LSA_CHECKSUM (\S+)
Value Filldown LSA_LENGTH (\d+)
Value Filldown LSA_NETWORK_MASK (\S+)
Value Filldown LSA_ABR (Area\s+Border\s+Router)
Value Filldown LSA_ASBR (AS\s+Boundary\s+Router)
Value LS_ATT_ROUTER (\d+\.\d+\.\d+\.\d+)

Start
Expand All @@ -27,13 +29,16 @@ LSAInfo
^\s+LS\s+Seq\s+Number:\s+${LSA_SEQ_NUMBER}
^\s+Checksum:\s+${LSA_CHECKSUM}
^\s+Length:\s+${LSA_LENGTH}
^\s+${LSA_ABR}$$
^\s+${LSA_ASBR}$$
^\s+Network\s+Mask:\s+${LSA_NETWORK_MASK} -> LSAs
^\s*$$
^. -> Error

LSAs
^\s+Attached\s+Router:\s+${LS_ATT_ROUTER} -> Next.Record
^\s+LS\s+age:\s+${LSA_AGE} -> LSAInfo
^\s+Router\s+Link\s+States\s+\(Area ${AREA}\) -> LSAInfo
^\s*$$
^. -> Error

Expand Down
5 changes: 5 additions & 0 deletions templates/cisco_ios_show_ip_ospf_database_router.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Value Filldown LSA_SEQ_NUMBER (\S+)
Value Filldown LSA_CHECKSUM (\S+)
Value Filldown LSA_LENGTH (\d+)
Value Filldown LSA_NUM_LINKS (\d+)
Value Filldown LSA_ABR (Area\s+Border\s+Router)
Value Filldown LSA_ASBR (AS\s+Boundary\s+Router)
Value LS_LINK_TYPE (.+?)
Value LS_LINK_ID (\d+\.\d+\.\d+\.\d+)
Value LS_LINK_DATA (\d+\.\d+\.\d+\.\d+)
Expand All @@ -31,6 +33,8 @@ LSAInfo
^\s+LS\s+Seq\s+Number:\s+${LSA_SEQ_NUMBER}
^\s+Checksum:\s+${LSA_CHECKSUM}
^\s+Length:\s+${LSA_LENGTH}
^\s+${LSA_ABR}$$
^\s+${LSA_ASBR}$$
^\s+Number\s+of\s+Links:\s+${LSA_NUM_LINKS} -> LSAs
^\s*$$
^. -> Error
Expand All @@ -42,6 +46,7 @@ LSAs
^\s+Number\s+of\s+MTID\s+metrics:\s+${LS_MTID_METRICS}
^\s+TOS\s+0\s+Metrics:\s+${LS_TOS_0_METRICS} -> Next.Record
^\s+LS\s+age:\s+${LSA_AGE} -> LSAInfo
^\s+Router\s+Link\s+States\s+\(Area ${AREA}\) -> LSAInfo
^\s*$$
^. -> Error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ parsed_sample:
lsa_checksum: "0x4B27"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.1.1.1"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -25,6 +27,8 @@ parsed_sample:
lsa_checksum: "0x4B27"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.2.2.2"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -38,6 +42,8 @@ parsed_sample:
lsa_checksum: "0x4816"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.4.4.4"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -51,6 +57,8 @@ parsed_sample:
lsa_checksum: "0x4816"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.2.2.2"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -64,6 +72,8 @@ parsed_sample:
lsa_checksum: "0x60F7"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.4.4.4"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -77,4 +87,6 @@ parsed_sample:
lsa_checksum: "0x60F7"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.3.3.3"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ parsed_sample:
lsa_checksum: "0x4B27"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.1.1.1"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -25,6 +27,8 @@ parsed_sample:
lsa_checksum: "0x4B27"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.2.2.2"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -38,6 +42,8 @@ parsed_sample:
lsa_checksum: "0x4816"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.4.4.4"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -51,6 +57,8 @@ parsed_sample:
lsa_checksum: "0x4816"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.2.2.2"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -64,6 +72,8 @@ parsed_sample:
lsa_checksum: "0x60F7"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.4.4.4"
- router_id: "100.1.1.1"
process_id: "1"
Expand All @@ -77,4 +87,6 @@ parsed_sample:
lsa_checksum: "0x60F7"
lsa_length: "32"
lsa_network_mask: "/30"
lsa_abr: ""
lsa_asbr: ""
ls_att_router: "100.3.3.3"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ parsed_sample:
lsa_checksum: "0x8A21"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Stub Network"
ls_link_id: "100.1.1.1"
ls_link_data: "255.255.255.255"
Expand All @@ -29,6 +31,8 @@ parsed_sample:
lsa_checksum: "0x8A21"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Transit Network"
ls_link_id: "192.168.2.1"
ls_link_data: "192.168.2.1"
Expand All @@ -46,6 +50,8 @@ parsed_sample:
lsa_checksum: "0x8A21"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "another Router (point-to-point)"
ls_link_id: "100.3.3.3"
ls_link_data: "192.168.1.1"
Expand All @@ -63,6 +69,8 @@ parsed_sample:
lsa_checksum: "0x8A21"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Stub Network"
ls_link_id: "192.168.1.0"
ls_link_data: "255.255.255.252"
Expand All @@ -80,6 +88,8 @@ parsed_sample:
lsa_checksum: "0xCA4F"
lsa_length: "60"
lsa_num_links: "3"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Stub Network"
ls_link_id: "100.2.2.2"
ls_link_data: "255.255.255.255"
Expand All @@ -97,6 +107,8 @@ parsed_sample:
lsa_checksum: "0xCA4F"
lsa_length: "60"
lsa_num_links: "3"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Transit Network"
ls_link_id: "192.168.3.2"
ls_link_data: "192.168.3.1"
Expand All @@ -114,6 +126,8 @@ parsed_sample:
lsa_checksum: "0xCA4F"
lsa_length: "60"
lsa_num_links: "3"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Transit Network"
ls_link_id: "192.168.2.1"
ls_link_data: "192.168.2.2"
Expand All @@ -131,6 +145,8 @@ parsed_sample:
lsa_checksum: "0x3969"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Stub Network"
ls_link_id: "100.3.3.3"
ls_link_data: "255.255.255.255"
Expand All @@ -148,6 +164,8 @@ parsed_sample:
lsa_checksum: "0x3969"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Transit Network"
ls_link_id: "192.168.4.2"
ls_link_data: "192.168.4.1"
Expand All @@ -165,6 +183,8 @@ parsed_sample:
lsa_checksum: "0x3969"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "another Router (point-to-point)"
ls_link_id: "100.1.1.1"
ls_link_data: "192.168.1.2"
Expand All @@ -182,6 +202,8 @@ parsed_sample:
lsa_checksum: "0x3969"
lsa_length: "72"
lsa_num_links: "4"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Stub Network"
ls_link_id: "192.168.1.0"
ls_link_data: "255.255.255.252"
Expand All @@ -199,6 +221,8 @@ parsed_sample:
lsa_checksum: "0x5CB0"
lsa_length: "60"
lsa_num_links: "3"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Stub Network"
ls_link_id: "100.4.4.4"
ls_link_data: "255.255.255.255"
Expand All @@ -216,6 +240,8 @@ parsed_sample:
lsa_checksum: "0x5CB0"
lsa_length: "60"
lsa_num_links: "3"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Transit Network"
ls_link_id: "192.168.4.2"
ls_link_data: "192.168.4.2"
Expand All @@ -233,6 +259,8 @@ parsed_sample:
lsa_checksum: "0x5CB0"
lsa_length: "60"
lsa_num_links: "3"
lsa_abr: ""
lsa_asbr: ""
ls_link_type: "a Transit Network"
ls_link_id: "192.168.3.2"
ls_link_data: "192.168.3.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
OSPF Router with ID (10.0.0.1) (Process ID 1)

Router Link States (Area 0)

LS age: 4
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 10.0.0.1
Advertising Router: 10.0.0.1
LS Seq Number: 80000006
Checksum: 0x5DAB
Length: 36
Area Border Router
AS Boundary Router
Number of Links: 1

Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.0.0.1
(Link Data) Network Mask: 255.255.255.255
Number of MTID metrics: 0
TOS 0 Metrics: 1



Router Link States (Area 1)

LS age: 4
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 10.0.0.2
Advertising Router: 10.0.0.2
LS Seq Number: 80000002
Checksum: 0x7694
Length: 36
Area Border Router
AS Boundary Router
Number of Links: 1

Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of MTID metrics: 0
TOS 0 Metrics: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
parsed_sample:
- router_id: "10.0.0.1"
process_id: "1"
area: "0"
lsa_age: "4"
lsa_options: "No TOS-capability, DC"
lsa_type: "Router Links"
lsa_id: "10.0.0.1"
lsa_adv_router: "10.0.0.1"
lsa_seq_number: "80000006"
lsa_checksum: "0x5DAB"
lsa_length: "36"
lsa_num_links: "1"
lsa_abr: "Area Border Router"
lsa_asbr: "AS Boundary Router"
ls_link_type: "a Stub Network"
ls_link_id: "10.0.0.1"
ls_link_data: "255.255.255.255"
ls_mtid_metrics: "0"
ls_tos_0_metrics: "1"
- router_id: "10.0.0.1"
process_id: "1"
area: "1"
lsa_age: "4"
lsa_options: "No TOS-capability, DC"
lsa_type: "Router Links"
lsa_id: "10.0.0.2"
lsa_adv_router: "10.0.0.2"
lsa_seq_number: "80000002"
lsa_checksum: "0x7694"
lsa_length: "36"
lsa_num_links: "1"
lsa_abr: "Area Border Router"
lsa_asbr: "AS Boundary Router"
ls_link_type: "a Stub Network"
ls_link_id: "10.1.1.1"
ls_link_data: "255.255.255.255"
ls_mtid_metrics: "0"
ls_tos_0_metrics: "1"
Loading

0 comments on commit 190cede

Please sign in to comment.