Stub detection + no path protection for crawl converter

This commit is contained in:
Sebastian Lohff 2020-06-13 19:52:22 +02:00
parent e3c83bc83e
commit ba59fd48d1
1 changed files with 5 additions and 1 deletions

View File

@ -196,7 +196,11 @@ def convert_crawl(crawl):
prefix = "{}/{}".format(ann.ip, ann.prefix) prefix = "{}/{}".format(ann.ip, ann.prefix)
path = list(map(int, ann.ASPath.split())) path = list(map(int, ann.ASPath.split()))
net.nodes[asn.number]['routing_table'].add((prefix, tuple(path))) net.nodes[asn.number]['routing_table'].add((prefix, tuple(path)))
net.nodes[path[-1]]['prefixes'].add(prefix) if path:
net.nodes[path[-1]]['prefixes'].add(prefix)
for path_asn in path:
if path_asn not in (path[-1], path[0]):
net.nodes[path_asn]['stub'] = False
# add neighbor count # add neighbor count
for node, data in net.nodes(data=True): for node, data in net.nodes(data=True):