mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-22 14:27:03 +00:00
maria's test aggregator automagically adds default routes and dumps nexthops
This commit is contained in:
parent
1a8c065a36
commit
887cc893b4
@ -140,22 +140,33 @@ t = IPTrie()
|
||||
p = input()
|
||||
data = p.split(" ")
|
||||
|
||||
nexthops = set()
|
||||
|
||||
try:
|
||||
t.add(AgrPointv6(data[0], data[1]))
|
||||
nexthops.add(data[1])
|
||||
try:
|
||||
while p := input():
|
||||
data = p.split(" ")
|
||||
t.add(AgrPointv6(data[0], data[1]))
|
||||
nexthops.add(data[1])
|
||||
except EOFError:
|
||||
pass
|
||||
if t.local is None:
|
||||
t.add(AgrPointv6("::/0", "__auto_unreachable"))
|
||||
nexthops.add("__auto_unreachable")
|
||||
except ipaddress.AddressValueError:
|
||||
t.add(AgrPointv4(data[0], data[1]))
|
||||
nexthops.add(data[1])
|
||||
try:
|
||||
while p := input():
|
||||
data = p.split(" ")
|
||||
t.add(AgrPointv4(data[0], data[1]))
|
||||
nexthops.add(data[1])
|
||||
except EOFError:
|
||||
pass
|
||||
if t.local is None:
|
||||
t.add(AgrPointv4("0.0.0.0/0", "__auto_unreachable"))
|
||||
nexthops.add("__auto_unreachable")
|
||||
|
||||
|
||||
# Dump
|
||||
print("Dump After Load")
|
||||
@ -168,3 +179,7 @@ tt = t.aggregate()
|
||||
ttt = tt.prune()
|
||||
print("Dump After Prune")
|
||||
print(ttt.dump())
|
||||
|
||||
print("Nexthops known")
|
||||
for n in nexthops:
|
||||
print(n)
|
||||
|
Loading…
x
Reference in New Issue
Block a user