Skip to content

Commit

Permalink
Change OSPF and OSPF networks to mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
ubaumann committed Jul 11, 2021
1 parent e372e9a commit d60a637
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 53 deletions.
84 changes: 35 additions & 49 deletions example-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -1117,58 +1117,44 @@
"weight": null
},
"ospf": {
"router_id": "10.249.16.152",
"process": "7306",
"passive_interface_enabled": true,
"area": {
"area": "0.0.0.60",
"area_type": "nssa"
},
"no_passive_interface": {
"interface": "Loopback0"
},
"networks": [
{
"network": "10.249.16.152",
"wildcard": "0.0.0.0",
"area": "0.0.0.60"
},
{
"network": "10.249.24.136",
"wildcard": "0.0.0.7",
"area": "0.0.0.60"
},
{
"network": "10.249.29.24",
"wildcard": "0.0.0.7",
"area": "0.0.0.60"
},
{
"network": "10.251.250.94",
"wildcard": "0.0.0.1",
"area": "0.0.0.60"
},
{
"network": "10.251.250.180",
"wildcard": "0.0.0.1",
"area": "0.0.0.60"
},
{
"network": "10.251.253.88",
"wildcard": "0.0.0.1",
"area": "0.0.0.60"
"7306": {
"router_id": "10.249.16.152",
"passive_interface_enabled": true,
"area": {
"0.0.0.60": {
"area_type": "nssa"
}
},
{
"network": "10.251.253.90",
"wildcard": "0.0.0.1",
"area": "0.0.0.60"
"no_passive_interface": {
"interface": "Loopback0"
},
{
"network": "10.251.253.168",
"wildcard": "0.0.0.7",
"area": "0.0.0.60"
"networks": {
"10.249.16.152/0": {
"area": "0.0.0.60"
},
"10.249.24.136/29": {
"area": "0.0.0.60"
},
"10.249.29.24/29": {
"area": "0.0.0.60"
},
"10.251.250.94/31": {
"area": "0.0.0.60"
},
"10.251.250.180/31": {
"area": "0.0.0.60"
},
"10.251.253.88/31": {
"area": "0.0.0.60"
},
"10.251.253.90/31": {
"area": "0.0.0.60"
},
"10.251.253.168/29": {
"area": "0.0.0.60"
}
}
]
}
},
"rip": {
"redistribute": "static",
Expand Down
8 changes: 4 additions & 4 deletions show_run.ttp
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,20 @@ vrf {{ vrf | re(".+") | record(vrf) }}
exit-address-family
</group>

<group name="routing.ospf">
<group name="routing.ospf.{{process}}">
router ospf {{ process | re(".+") | record(process) }}
{{ router_id | set(None) }}
router-id {{ router_id }}
<group name="area">
<group name="area.{{area}}">
area {{ area }} {{ area_type }}
</group>
{{ passive_interface_enabled | set(False) }}
passive-interface default {{ passive_interface_enabled | set(True) }}
<group name="no_passive_interface">
no passive-interface {{interface}}
</group>
<group name="networks">
network {{network}} {{wildcard}} area {{area}}
<group name="networks.{{network}}" record="network">
network {{network | PHRASE | to_ip | with_prefixlen}} area {{area}}
</group>
</group>

Expand Down

0 comments on commit d60a637

Please sign in to comment.