mirror of
https://github.com/NeoCloud/NeoNetwork
synced 2024-11-22 12:00:40 +08:00
allow general netname
This commit is contained in:
parent
4cee8eb874
commit
0c3d4bf9a8
1 changed files with 2 additions and 7 deletions
|
@ -118,7 +118,6 @@ def node2asn():
|
|||
NODE_TABLE = node2asn()
|
||||
|
||||
def neonet_route2roa(dirname, is_ipv6=False):
|
||||
net_names = set()
|
||||
roa_entries = list()
|
||||
for f in (cwd / dirname).iterdir():
|
||||
try:
|
||||
|
@ -133,9 +132,7 @@ def neonet_route2roa(dirname, is_ipv6=False):
|
|||
assert asn in ASNS
|
||||
route = f.name.replace(',', '/')
|
||||
supernet = get_supernet(fc.get('supernet'))
|
||||
netname = name2nichdl(fc.get('name'))
|
||||
assert netname not in net_names
|
||||
net_names.add(netname)
|
||||
netname = fc.get('name')
|
||||
roa_entries.append(dict(zip(roa_entries_key, [asn, nettype(route, strict=True), supernet, netname])))
|
||||
elif fc.get('type').lower().startswith('tun'):
|
||||
assert NODE_TABLE[fc.get('downstream')] # extra check for downstream
|
||||
|
@ -143,9 +140,7 @@ def neonet_route2roa(dirname, is_ipv6=False):
|
|||
assert asn in ASNS
|
||||
route = f.name.replace(',', '/')
|
||||
supernet = get_supernet(fc.get('supernet'))
|
||||
netname = name2nichdl("%s-%s" % (fc.get('type'), route))
|
||||
assert netname not in net_names
|
||||
net_names.add(netname)
|
||||
netname = "%s-%s" % (fc.get('type'), route)
|
||||
roa_entries.append(dict(zip(roa_entries_key, [asn, nettype(route, strict=True), supernet, netname])))
|
||||
else:
|
||||
assert fc.get('type').lower() in ('ptp',)
|
||||
|
|
Loading…
Reference in a new issue