|
|
|
@ -30,11 +30,13 @@ class Topology:
|
|
|
|
|
self.network_addrs[directive] = net_addr
|
|
|
|
|
|
|
|
|
|
# Fix the topology: find other networks (stubnets, external, ...) and links:
|
|
|
|
|
known = set()
|
|
|
|
|
for r, rd in self.routers:
|
|
|
|
|
for n, nd in rd:
|
|
|
|
|
if n.startswith(('network', 'stubnet', 'external')):
|
|
|
|
|
net_id = re.match(r'((network|stubnet|external) [^ ]+)', n).group(1)
|
|
|
|
|
if n.startswith(('stubnet', 'external')):
|
|
|
|
|
if n.startswith(('stubnet', 'external')) and net_id not in known:
|
|
|
|
|
known.add(net_id)
|
|
|
|
|
self.networks.append((net_id, []))
|
|
|
|
|
# Add dummy mapping
|
|
|
|
|
self.network_addrs[net_id] = net_id
|
|
|
|
|