From a93866474ceb7ae1a5241bb39898151f72db7b3e Mon Sep 17 00:00:00 2001 From: Septs Date: Tue, 21 Jul 2020 10:54:26 +0800 Subject: [PATCH] Regular update: 2020-07-21T02:54:26Z --- .scripts/requirements.txt | 1 + .scripts/roa.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.scripts/requirements.txt b/.scripts/requirements.txt index 8c6f4d9..ce56533 100644 --- a/.scripts/requirements.txt +++ b/.scripts/requirements.txt @@ -1,2 +1,3 @@ +netaddr==0.8.0 tabulate==0.8.7 toml==0.10.1 diff --git a/.scripts/roa.py b/.scripts/roa.py index ccb2899..024ec56 100755 --- a/.scripts/roa.py +++ b/.scripts/roa.py @@ -12,6 +12,7 @@ from pathlib import Path import toml from tabulate import tabulate +import netaddr NEO_NETWORK_POOL = [ip_network("10.127.0.0/16"), ip_network("fd10:127::/32")] @@ -310,6 +311,14 @@ def make_summary(): tablefmt="presto", ) print(route_table) + print() + print("Unused CIDR Range:") + prefixes = netaddr.cidr_merge( + netaddr.IPNetwork(str(entity["supernet"] or entity["prefix"])) + for entity in route_to_roa(asn_table) + ) + for prefix in prefixes: + print(prefix) return stream.getvalue()