From 06632f11d6da79fca4a8d6e09e59f51d8adfb5b5 Mon Sep 17 00:00:00 2001 From: Dustrain Date: Fri, 22 May 2020 17:42:58 +0800 Subject: [PATCH 01/23] Add an address space usage record (#80) * new file: route6/fd10:127:0233:1c3c::,64 * Add an address space usage record --- route/10.127.255.117,32 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 route/10.127.255.117,32 diff --git a/route/10.127.255.117,32 b/route/10.127.255.117,32 new file mode 100644 index 0000000..61a704a --- /dev/null +++ b/route/10.127.255.117,32 @@ -0,0 +1,4 @@ +TYPE="LO" +NAME="magicneko-tw" +DESC="magicneko-tw/frr" +ASN="4201270008" From 19c6a44bc324a024c511e1110b89abad4513fb8b Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:06:35 +0800 Subject: [PATCH 02/23] route: 10.127.5.0/28: removed "AS" in ASN --- route/10.127.5.0,28 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/10.127.5.0,28 b/route/10.127.5.0,28 index d4c1f14..b0bd832 100644 --- a/route/10.127.5.0,28 +++ b/route/10.127.5.0,28 @@ -1,4 +1,4 @@ TYPE=SUBNET NAME="yhi-h" DESC="Yhi Interconnect H" -ASN="AS4201270012" +ASN="4201270012" From 17b3cb3ed1045ba4b0bf56db7577847f120423a2 Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:11:28 +0800 Subject: [PATCH 03/23] route: Added 10.127.41.0/24 --- route/10.127.41.0,24 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 route/10.127.41.0,24 diff --git a/route/10.127.41.0,24 b/route/10.127.41.0,24 new file mode 100644 index 0000000..d21acec --- /dev/null +++ b/route/10.127.41.0,24 @@ -0,0 +1,4 @@ +TYPE="SUBNET" +NAME="Septs IX IPv4 Pool" +DESC="" +ASN="4201270001" From ca8721c7a70ae55b990c23d15548f4f80ae2f1dc Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:12:01 +0800 Subject: [PATCH 04/23] route6: Added fd10:127:41::/48 --- route6/fd10:127:41::,48 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 route6/fd10:127:41::,48 diff --git a/route6/fd10:127:41::,48 b/route6/fd10:127:41::,48 new file mode 100644 index 0000000..8769c80 --- /dev/null +++ b/route6/fd10:127:41::,48 @@ -0,0 +1,4 @@ +TYPE="SUBNET" +NAME="Septs IX IPv6 Pool" +DESC="" +ASN="4201270001" From ddfa48a9d103f84c8ff4d4086b2e566b0dae1d69 Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:13:08 +0800 Subject: [PATCH 05/23] document: up --- document/asn-dir.txt | 1 + document/route-dir.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/document/asn-dir.txt b/document/asn-dir.txt index 2da5a95..897485f 100644 --- a/document/asn-dir.txt +++ b/document/asn-dir.txt @@ -1,6 +1,7 @@ # as-dir Template # =============== # Filename format: AS +# ASN range: 4201270000 ~ 4201279999 # Remove any line which starts with '#' when applying # AS Name NAME="" diff --git a/document/route-dir.txt b/document/route-dir.txt index da0fa53..b40a59d 100644 --- a/document/route-dir.txt +++ b/document/route-dir.txt @@ -36,7 +36,7 @@ Detailed Information of Each Variable Available options are: Tinc, WireGuard, L2TP, GRE, IPsec/L2TP, IPsec/GRE, OpenVPN, SLIRP, PPP 3. NAME: Name -4. ASN: ASN +4. ASN: ASN (without prefix "AS") 5. UPSTREAM: Upstream Node Name 6. DOWNSTREAM: Downstream Node Name 7. DESC: Description From 3766d1a350b9e19e5b995d71d1119118d035dc37 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 22 May 2020 18:13:42 +0800 Subject: [PATCH 06/23] strict asn checking --- scripts/roa.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/roa.py b/scripts/roa.py index 31e681f..eeddd88 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -54,13 +54,17 @@ def shell2dict(shellscript): cwd = Path() assert not [d for d in ("asn", "route", "route6", "node", "entity") if not (cwd / d).is_dir()] -def str2asn(s_asn): +def str2asn(s_asn, strict=None): + """ strict: 1 with prefix AS, other bool(x)==True without prefix AS """ s_asn = s_asn.strip().lower() + if strict == 1: + assert s_asn.startswith('as') + elif strict: + assert int(s_asn) if s_asn.startswith('as'): s_asn = s_asn[2:] return int(s_asn) - def name2nichdl(name): r, num = re.subn(r'[^0-9A-Z]', '-', name.upper()) _r = len(r.replace('-', '')) @@ -109,9 +113,9 @@ def neonet_get_asns(): continue fc = shell2dict(f.read_text()) present_keys = ('name', 'owner', 'desc') - asns[str2asn(f.name)] = {k: fc.get(k) for k in present_keys} + asns[str2asn(f.name, 1)] = {k: fc.get(k) for k in present_keys} assert fc.get('owner') in PEOPLE - for v in asns[str2asn(f.name)].values(): + for v in asns[str2asn(f.name, 1)].values(): assert v is not None except Exception: print("[!] Error while processing file", f) @@ -126,7 +130,7 @@ def node2asn(): if not f.is_file(): continue fc = shell2dict(f.read_text()) - asn = str2asn(fc.get('asn')) + asn = str2asn(fc.get('asn'), 2) assert asn in ASNS node_table[f.name] = asn except Exception: @@ -162,7 +166,7 @@ def neonet_route2roa(dirname, is_ipv6=False): get_supernet = lambda s_net: None if not s_net else nettype(s_net, strict=True) roa_entries_key = ("asn", "prefix", "supernet", "netname") if fc.get('type').lower() in ('lo', 'subnet'): - asn = str2asn(fc.get('asn')) + asn = str2asn(fc.get('asn'), 2) assert asn in ASNS # asn not in as-dir route = f.name.replace(',', '/') net = nettype(route, strict=True) From 66cd47a84a1e8d211d79d6825f57884b03b7af87 Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:20:15 +0800 Subject: [PATCH 07/23] node: yhi-h: removed "AS" in ASN --- node/yhi-h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/yhi-h b/node/yhi-h index f13f128..5ed897e 100644 --- a/node/yhi-h +++ b/node/yhi-h @@ -1,4 +1,4 @@ -ASN="AS4201270012" +ASN="4201270012" DESC="" IP=( ) From 75d7176722ecdfd76ed3a29b68863c7fdf7cdfbe Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 22 May 2020 18:29:07 +0800 Subject: [PATCH 08/23] assert as range --- scripts/roa.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/roa.py b/scripts/roa.py index eeddd88..9248dc7 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -9,6 +9,7 @@ import re NEONET_ADDR_POOL = ('10.127.0.0/16', 'fd10:127::/32') NEONET_ADDR_POOL = [ip_network(neo) for neo in NEONET_ADDR_POOL] IS_NEONET = lambda net: bool([True for neo in NEONET_ADDR_POOL if net.version == neo.version and net.subnet_of(neo)]) +AS_IS_NEONET = lambda asn: 4201270000 <= asn <= 4201279999 assert hasattr(IPv4Network, 'subnet_of') # needs at least python 3.7 class BashParser: @@ -113,10 +114,12 @@ def neonet_get_asns(): continue fc = shell2dict(f.read_text()) present_keys = ('name', 'owner', 'desc') - asns[str2asn(f.name, 1)] = {k: fc.get(k) for k in present_keys} + asn = str2asn(f.name, 1) + asns[asn] = {k: fc.get(k) for k in present_keys} assert fc.get('owner') in PEOPLE - for v in asns[str2asn(f.name, 1)].values(): + for v in asns[asn].values(): assert v is not None + assert AS_IS_NEONET(asn) or asns[asn].get('external') except Exception: print("[!] Error while processing file", f) raise From ed346ecf21a382cf426486cae5fa01e7e571c0ec Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:34:16 +0800 Subject: [PATCH 09/23] document: asn-dir: EXTERNAL --- document/asn-dir.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/document/asn-dir.txt b/document/asn-dir.txt index 897485f..7ea6728 100644 --- a/document/asn-dir.txt +++ b/document/asn-dir.txt @@ -9,6 +9,9 @@ NAME="" OWNER="" # Description DESC="" +# Whether or not it's a ASN from external source, e.g. DN42 or other VPNs. +# Any value other than "" or "FALSE" will be seen as "TRUE" +EXTERNAL="" # if it's a ASN registered from *NIC, this variable records # whether members of NeoNetwork have validated its ownership yet # possible value: "YES" "NO" From 291adf0db1b09ff10f40f58b2669b01448c746cc Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:38:35 +0800 Subject: [PATCH 10/23] asn-dir: EXTERNAL --- asn/AS134098 | 1 + asn/AS4201270000 | 1 + asn/AS4201270001 | 1 + asn/AS4201270002 | 1 + asn/AS4201270003 | 1 + asn/AS4201270004 | 1 + asn/AS4201270005 | 1 + asn/AS4201270006 | 1 + asn/AS4201270007 | 1 + asn/AS4201270008 | 1 + asn/AS4201270009 | 1 + asn/AS4201270010 | 1 + asn/AS4201270011 | 1 + asn/AS4201270012 | 1 + asn/AS4201270013 | 1 + asn/AS4201270014 | 1 + asn/AS4201270015 | 1 + asn/AS4242420140 | 1 + asn/AS4242420916 | 1 + asn/AS4242421037 | 1 + asn/AS4242423088 | 1 + 21 files changed, 21 insertions(+) diff --git a/asn/AS134098 b/asn/AS134098 index 815baf4..06241cd 100644 --- a/asn/AS134098 +++ b/asn/AS134098 @@ -1,4 +1,5 @@ NAME="Licson Internal Network" OWNER="licson" DESC="" +EXTERNAL="INET" VALID="YES" diff --git a/asn/AS4201270000 b/asn/AS4201270000 index a67f605..5b24d18 100644 --- a/asn/AS4201270000 +++ b/asn/AS4201270000 @@ -1,3 +1,4 @@ NAME="NeoNetwork Origin" OWNER="Neo_Chen" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270001 b/asn/AS4201270001 index 054edd7..c0d302f 100644 --- a/asn/AS4201270001 +++ b/asn/AS4201270001 @@ -1,3 +1,4 @@ NAME="Septs Inter-NeoNetwork Exchange" OWNER="Septs" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270002 b/asn/AS4201270002 index 2fec38c..512c708 100644 --- a/asn/AS4201270002 +++ b/asn/AS4201270002 @@ -1,3 +1,4 @@ NAME="Septs Home" OWNER="Septs" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270003 b/asn/AS4201270003 index 4ff23e1..8d4cae6 100644 --- a/asn/AS4201270003 +++ b/asn/AS4201270003 @@ -1,3 +1,4 @@ NAME="chenx97" OWNER="chenx97" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270004 b/asn/AS4201270004 index d6c95d0..ce2ea40 100644 --- a/asn/AS4201270004 +++ b/asn/AS4201270004 @@ -1,3 +1,4 @@ NAME="frank" OWNER="frank" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270005 b/asn/AS4201270005 index 0280be9..baecd0a 100644 --- a/asn/AS4201270005 +++ b/asn/AS4201270005 @@ -1,3 +1,4 @@ NAME="Icecat" OWNER="Icecat" DESC="NextMoe Group Access Network" +EXTERNAL="FALSE" diff --git a/asn/AS4201270006 b/asn/AS4201270006 index c537221..2256800 100644 --- a/asn/AS4201270006 +++ b/asn/AS4201270006 @@ -1,3 +1,4 @@ NAME="Jerry Network" OWNER="JerryXiao" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270007 b/asn/AS4201270007 index 9cd8510..bc16aeb 100644 --- a/asn/AS4201270007 +++ b/asn/AS4201270007 @@ -1,3 +1,4 @@ NAME="Staph" OWNER="Staph" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270008 b/asn/AS4201270008 index c2ca8a1..bd81c84 100644 --- a/asn/AS4201270008 +++ b/asn/AS4201270008 @@ -1,3 +1,4 @@ NAME="MagicNeko" OWNER="Icecat" DESC="MagicNeko Network Internet exchange" +EXTERNAL="FALSE" diff --git a/asn/AS4201270009 b/asn/AS4201270009 index 6e52268..8aeb9f4 100644 --- a/asn/AS4201270009 +++ b/asn/AS4201270009 @@ -1,3 +1,4 @@ NAME="santost12" OWNER="santost12" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270010 b/asn/AS4201270010 index d98b671..726619a 100644 --- a/asn/AS4201270010 +++ b/asn/AS4201270010 @@ -1,3 +1,4 @@ NAME="Lan Tian" OWNER="Lan Tian" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270011 b/asn/AS4201270011 index 0e86a36..366a57b 100644 --- a/asn/AS4201270011 +++ b/asn/AS4201270011 @@ -1,3 +1,4 @@ NAME="LINE-NZ" OWNER="LINE-NZ" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270012 b/asn/AS4201270012 index b675043..ecec6df 100644 --- a/asn/AS4201270012 +++ b/asn/AS4201270012 @@ -1,3 +1,4 @@ NAME="Yhi Interconnect" OWNER="Junde Yhi" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270013 b/asn/AS4201270013 index 85c8683..0def7da 100644 --- a/asn/AS4201270013 +++ b/asn/AS4201270013 @@ -1,3 +1,4 @@ NAME="NDOSKRNL" OWNER="Ndoskrnl" DESC="Ndoskrnl's Network" +EXTERNAL="FALSE" diff --git a/asn/AS4201270014 b/asn/AS4201270014 index 54ad6c3..810360d 100644 --- a/asn/AS4201270014 +++ b/asn/AS4201270014 @@ -1,3 +1,4 @@ NAME="leedagee" OWNER="leedagee" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4201270015 b/asn/AS4201270015 index dfba16a..ea4f386 100644 --- a/asn/AS4201270015 +++ b/asn/AS4201270015 @@ -1,3 +1,4 @@ NAME="James58899" OWNER="James58899" DESC="" +EXTERNAL="FALSE" diff --git a/asn/AS4242420140 b/asn/AS4242420140 index f3e7c37..2068d52 100644 --- a/asn/AS4242420140 +++ b/asn/AS4242420140 @@ -1,3 +1,4 @@ NAME="Yangfl Network" OWNER="Yangfl" DESC="" +EXTERNAL="DN42" diff --git a/asn/AS4242420916 b/asn/AS4242420916 index 87bb8e9..c684272 100644 --- a/asn/AS4242420916 +++ b/asn/AS4242420916 @@ -1,3 +1,4 @@ NAME="alanyhq" OWNER="alanyhq" DESC="alanyhq main" +EXTERNAL="DN42" diff --git a/asn/AS4242421037 b/asn/AS4242421037 index f62bb42..9c09df1 100644 --- a/asn/AS4242421037 +++ b/asn/AS4242421037 @@ -1,3 +1,4 @@ NAME="LibreHouse" OWNER="LibreHouse" DESC="" +EXTERNAL="DN42" diff --git a/asn/AS4242423088 b/asn/AS4242423088 index da30e17..42f2b8d 100644 --- a/asn/AS4242423088 +++ b/asn/AS4242423088 @@ -1,3 +1,4 @@ NAME="SUNNET" OWNER="SUNNET" DESC="" +EXTERNAL="DN42" From a9b5ae328cd9a359f73a33ca336bf405d74f26a6 Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Fri, 22 May 2020 18:46:37 +0800 Subject: [PATCH 11/23] asn-dir: EXTERNAL -> SOURCE --- asn/AS134098 | 2 +- asn/AS4201270000 | 2 +- asn/AS4201270001 | 2 +- asn/AS4201270002 | 2 +- asn/AS4201270003 | 2 +- asn/AS4201270004 | 2 +- asn/AS4201270005 | 2 +- asn/AS4201270006 | 2 +- asn/AS4201270007 | 2 +- asn/AS4201270008 | 2 +- asn/AS4201270009 | 2 +- asn/AS4201270010 | 2 +- asn/AS4201270011 | 2 +- asn/AS4201270012 | 2 +- asn/AS4201270013 | 2 +- asn/AS4201270014 | 2 +- asn/AS4201270015 | 2 +- asn/AS4242420140 | 2 +- asn/AS4242420916 | 2 +- asn/AS4242421037 | 2 +- asn/AS4242423088 | 2 +- document/asn-dir.txt | 8 ++++---- 22 files changed, 25 insertions(+), 25 deletions(-) diff --git a/asn/AS134098 b/asn/AS134098 index 06241cd..0cca0ee 100644 --- a/asn/AS134098 +++ b/asn/AS134098 @@ -1,5 +1,5 @@ NAME="Licson Internal Network" OWNER="licson" DESC="" -EXTERNAL="INET" +SOURCE="INET" VALID="YES" diff --git a/asn/AS4201270000 b/asn/AS4201270000 index 5b24d18..c3f437f 100644 --- a/asn/AS4201270000 +++ b/asn/AS4201270000 @@ -1,4 +1,4 @@ NAME="NeoNetwork Origin" OWNER="Neo_Chen" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270001 b/asn/AS4201270001 index c0d302f..8ff9d3f 100644 --- a/asn/AS4201270001 +++ b/asn/AS4201270001 @@ -1,4 +1,4 @@ NAME="Septs Inter-NeoNetwork Exchange" OWNER="Septs" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270002 b/asn/AS4201270002 index 512c708..e18d2dd 100644 --- a/asn/AS4201270002 +++ b/asn/AS4201270002 @@ -1,4 +1,4 @@ NAME="Septs Home" OWNER="Septs" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270003 b/asn/AS4201270003 index 8d4cae6..056da0c 100644 --- a/asn/AS4201270003 +++ b/asn/AS4201270003 @@ -1,4 +1,4 @@ NAME="chenx97" OWNER="chenx97" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270004 b/asn/AS4201270004 index ce2ea40..1e9ce4b 100644 --- a/asn/AS4201270004 +++ b/asn/AS4201270004 @@ -1,4 +1,4 @@ NAME="frank" OWNER="frank" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270005 b/asn/AS4201270005 index baecd0a..d00d7a7 100644 --- a/asn/AS4201270005 +++ b/asn/AS4201270005 @@ -1,4 +1,4 @@ NAME="Icecat" OWNER="Icecat" DESC="NextMoe Group Access Network" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270006 b/asn/AS4201270006 index 2256800..22a0342 100644 --- a/asn/AS4201270006 +++ b/asn/AS4201270006 @@ -1,4 +1,4 @@ NAME="Jerry Network" OWNER="JerryXiao" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270007 b/asn/AS4201270007 index bc16aeb..9b60ab1 100644 --- a/asn/AS4201270007 +++ b/asn/AS4201270007 @@ -1,4 +1,4 @@ NAME="Staph" OWNER="Staph" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270008 b/asn/AS4201270008 index bd81c84..bd31f5f 100644 --- a/asn/AS4201270008 +++ b/asn/AS4201270008 @@ -1,4 +1,4 @@ NAME="MagicNeko" OWNER="Icecat" DESC="MagicNeko Network Internet exchange" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270009 b/asn/AS4201270009 index 8aeb9f4..cbf9180 100644 --- a/asn/AS4201270009 +++ b/asn/AS4201270009 @@ -1,4 +1,4 @@ NAME="santost12" OWNER="santost12" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270010 b/asn/AS4201270010 index 726619a..ea9b4fb 100644 --- a/asn/AS4201270010 +++ b/asn/AS4201270010 @@ -1,4 +1,4 @@ NAME="Lan Tian" OWNER="Lan Tian" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270011 b/asn/AS4201270011 index 366a57b..2494f33 100644 --- a/asn/AS4201270011 +++ b/asn/AS4201270011 @@ -1,4 +1,4 @@ NAME="LINE-NZ" OWNER="LINE-NZ" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270012 b/asn/AS4201270012 index ecec6df..e96e0e4 100644 --- a/asn/AS4201270012 +++ b/asn/AS4201270012 @@ -1,4 +1,4 @@ NAME="Yhi Interconnect" OWNER="Junde Yhi" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270013 b/asn/AS4201270013 index 0def7da..4d39b1d 100644 --- a/asn/AS4201270013 +++ b/asn/AS4201270013 @@ -1,4 +1,4 @@ NAME="NDOSKRNL" OWNER="Ndoskrnl" DESC="Ndoskrnl's Network" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270014 b/asn/AS4201270014 index 810360d..1aebc98 100644 --- a/asn/AS4201270014 +++ b/asn/AS4201270014 @@ -1,4 +1,4 @@ NAME="leedagee" OWNER="leedagee" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4201270015 b/asn/AS4201270015 index ea4f386..ccabbdf 100644 --- a/asn/AS4201270015 +++ b/asn/AS4201270015 @@ -1,4 +1,4 @@ NAME="James58899" OWNER="James58899" DESC="" -EXTERNAL="FALSE" +SOURCE="NeoNetwork" diff --git a/asn/AS4242420140 b/asn/AS4242420140 index 2068d52..be5d858 100644 --- a/asn/AS4242420140 +++ b/asn/AS4242420140 @@ -1,4 +1,4 @@ NAME="Yangfl Network" OWNER="Yangfl" DESC="" -EXTERNAL="DN42" +SOURCE="DN42" diff --git a/asn/AS4242420916 b/asn/AS4242420916 index c684272..947fe70 100644 --- a/asn/AS4242420916 +++ b/asn/AS4242420916 @@ -1,4 +1,4 @@ NAME="alanyhq" OWNER="alanyhq" DESC="alanyhq main" -EXTERNAL="DN42" +SOURCE="DN42" diff --git a/asn/AS4242421037 b/asn/AS4242421037 index 9c09df1..49454e5 100644 --- a/asn/AS4242421037 +++ b/asn/AS4242421037 @@ -1,4 +1,4 @@ NAME="LibreHouse" OWNER="LibreHouse" DESC="" -EXTERNAL="DN42" +SOURCE="DN42" diff --git a/asn/AS4242423088 b/asn/AS4242423088 index 42f2b8d..0722e17 100644 --- a/asn/AS4242423088 +++ b/asn/AS4242423088 @@ -1,4 +1,4 @@ NAME="SUNNET" OWNER="SUNNET" DESC="" -EXTERNAL="DN42" +SOURCE="DN42" diff --git a/document/asn-dir.txt b/document/asn-dir.txt index 7ea6728..1cd5252 100644 --- a/document/asn-dir.txt +++ b/document/asn-dir.txt @@ -9,10 +9,10 @@ NAME="" OWNER="" # Description DESC="" -# Whether or not it's a ASN from external source, e.g. DN42 or other VPNs. -# Any value other than "" or "FALSE" will be seen as "TRUE" -EXTERNAL="" +# Source of this ASN +# Possible values: "NeoNetwork", "DN42" or name of other VPN Networks +SOURCE="" # if it's a ASN registered from *NIC, this variable records # whether members of NeoNetwork have validated its ownership yet -# possible value: "YES" "NO" +# Possible values: "YES" "NO" VALID="" From 555c6ce53e90ee7adf8f036bc1a17dbf932f1008 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 22 May 2020 18:57:13 +0800 Subject: [PATCH 12/23] update roa.py for external asn check --- scripts/roa.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/roa.py b/scripts/roa.py index 9248dc7..7f0bbcc 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -113,12 +113,13 @@ def neonet_get_asns(): if not f.is_file(): continue fc = shell2dict(f.read_text()) - present_keys = ('name', 'owner', 'desc') + present_keys = ('name', 'owner', 'desc', 'external') + required_keys = ('name', 'owner') asn = str2asn(f.name, 1) asns[asn] = {k: fc.get(k) for k in present_keys} assert fc.get('owner') in PEOPLE - for v in asns[asn].values(): - assert v is not None + for k in required_keys: + assert asns[asn].get(k) # required fields missing assert AS_IS_NEONET(asn) or asns[asn].get('external') except Exception: print("[!] Error while processing file", f) From 37f3cb5ebe9fa9b37a2af5c69750b797bae89acc Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 22 May 2020 19:48:54 +0800 Subject: [PATCH 13/23] fix roa --- scripts/roa.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/roa.py b/scripts/roa.py index 7f0bbcc..2454c23 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -113,14 +113,16 @@ def neonet_get_asns(): if not f.is_file(): continue fc = shell2dict(f.read_text()) - present_keys = ('name', 'owner', 'desc', 'external') - required_keys = ('name', 'owner') + present_keys = ('name', 'owner', 'desc', 'source') + required_keys = ('name', 'owner', 'source') asn = str2asn(f.name, 1) asns[asn] = {k: fc.get(k) for k in present_keys} assert fc.get('owner') in PEOPLE for k in required_keys: assert asns[asn].get(k) # required fields missing - assert AS_IS_NEONET(asn) or asns[asn].get('external') + as_src = asns[asn].get('source') + assert as_src in ('NeoNetwork', 'DN42', 'INET') + assert AS_IS_NEONET(asn) or as_src != 'NeoNetwork' except Exception: print("[!] Error while processing file", f) raise From ec2dca732ca0b5fc497dc0faa694350feb4b8ac5 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 22 May 2020 19:49:54 +0800 Subject: [PATCH 14/23] change possible values :) --- document/asn-dir.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/asn-dir.txt b/document/asn-dir.txt index 1cd5252..fa30658 100644 --- a/document/asn-dir.txt +++ b/document/asn-dir.txt @@ -10,7 +10,7 @@ OWNER="" # Description DESC="" # Source of this ASN -# Possible values: "NeoNetwork", "DN42" or name of other VPN Networks +# Possible values: "NeoNetwork", "DN42" or "INET" SOURCE="" # if it's a ASN registered from *NIC, this variable records # whether members of NeoNetwork have validated its ownership yet From 7b933cc469e1324e1c260f953ed12387c5398fbc Mon Sep 17 00:00:00 2001 From: Septs Date: Sat, 23 May 2020 19:00:02 +0800 Subject: [PATCH 15/23] Migrate to TOML format (#81) --- .editorconfig | 8 + .github/workflows/roa.yml | 102 +++--- .github/workflows/test-your-pr.yml | 63 ++-- .vscode/extensions.json | 3 + .vscode/settings.json | 4 + asn/AS134098 | 5 - asn/AS134098.toml | 4 + asn/AS4201270000 | 4 - asn/AS4201270000.toml | 2 + asn/AS4201270001 | 4 - asn/AS4201270001.toml | 2 + asn/AS4201270002 | 4 - asn/AS4201270002.toml | 2 + asn/AS4201270003 | 4 - asn/AS4201270003.toml | 2 + asn/AS4201270004 | 4 - asn/AS4201270004.toml | 2 + asn/AS4201270005 | 4 - asn/AS4201270005.toml | 3 + asn/AS4201270006 | 4 - asn/AS4201270006.toml | 2 + asn/AS4201270007 | 4 - asn/AS4201270007.toml | 2 + asn/AS4201270008 | 4 - asn/AS4201270008.toml | 3 + asn/AS4201270009 | 4 - asn/AS4201270009.toml | 2 + asn/AS4201270010 | 4 - asn/AS4201270010.toml | 2 + asn/AS4201270011 | 4 - asn/AS4201270011.toml | 2 + asn/AS4201270012 | 4 - asn/AS4201270012.toml | 2 + asn/AS4201270013 | 4 - asn/AS4201270013.toml | 3 + asn/AS4201270014 | 4 - asn/AS4201270014.toml | 2 + asn/AS4201270015 | 4 - asn/AS4201270015.toml | 2 + asn/AS4242420140 | 4 - asn/AS4242420140.toml | 2 + asn/AS4242420916 | 4 - asn/AS4242420916.toml | 3 + asn/AS4242421037 | 4 - asn/AS4242421037.toml | 2 + asn/AS4242423088 | 4 - asn/AS4242423088.toml | 2 + entity/Icecat | 13 - entity/Icecat.toml | 5 + entity/James58899 | 13 - entity/James58899.toml | 1 + entity/JerryXiao | 13 - entity/JerryXiao.toml | 10 + entity/Junde Yhi | 19 -- entity/Junde Yhi.toml | 20 ++ entity/LINE-NZ | 13 - entity/LINE-NZ.toml | 6 + entity/Lan Tian | 13 - entity/Lan Tian.toml | 1 + entity/LibreHouse | 17 - entity/LibreHouse.toml | 11 + entity/Ndoskrnl | 13 - entity/Ndoskrnl.toml | 7 + entity/Neo_Chen | 14 - entity/Neo_Chen.toml | 12 + entity/SUNNET | 13 - entity/SUNNET.toml | 1 + entity/Septs | 13 - entity/Staph | 17 - entity/Staph.toml | 9 + entity/Yangfl | 13 - entity/Yangfl.toml | 1 + entity/alanyhq | 14 - entity/alanyhq.toml | 5 + entity/chenx97 | 13 - entity/chenx97.toml | 5 + entity/frank | 13 - entity/frank.toml | 1 + entity/leedagee | 13 - entity/leedagee.toml | 8 + entity/licson | 13 - entity/licson.toml | 6 + entity/santost12 | 13 - entity/santost12.toml | 5 + entity/septs.toml | 6 + node/Icecat-GroupAccessNetwork | 6 - node/Icecat.toml | 3 + node/James58899 | 4 - node/James58899.toml | 2 + node/JerryXiao | 5 - node/JerryXiao-HK1 | 4 - node/JerryXiao-HK2 | 4 - node/JerryXiao-SH1 | 4 - node/JerryXiao.toml | 11 + node/LINE-NZ-AU01 | 5 - node/LINE-NZ-NZ01 | 5 - node/LINE-NZ.toml | 9 + node/LanTian | 4 - node/LanTian.toml | 2 + node/MagicNeko-HK01 | 6 - node/MagicNeko-JP03 | 6 - node/MagicNeko-RU01 | 6 - node/MagicNeko.toml | 14 + node/Ndoskrnl-CN01 | 5 - node/Ndoskrnl-US01 | 5 - node/Ndoskrnl.toml | 9 + node/NeoPDP-11 | 7 - node/NeoSystem | 6 - node/NeoVAX | 4 - node/Neo_Chen.toml | 17 + node/SUNNET | 4 - node/SUNNET.toml | 2 + node/caasih | 4 - node/caasih.toml | 2 + node/chenx97 | 4 - node/chenx97.toml | 2 + node/cklvax | 5 - node/cklvax.toml | 3 + node/dfceaef | 4 - node/dfceaef.toml | 2 + node/frank-hsinchu | 4 - node/frank.toml | 2 + node/leedagee | 4 - node/leedagee.toml | 2 + node/megumiLHS | 4 - node/megumiLHS.toml | 2 + node/pan | 5 - node/santost12 | 4 - node/santost12.toml | 2 + node/septs | 4 - node/septs.toml | 2 + node/staph | 5 - node/staph.toml | 4 + node/ucbvax | 4 - node/yhi-h | 4 - node/yhi-h.toml | 2 + peer/JerryXiao-HK1.toml | 1 + peer/JerryXiao-HK1~JerryXiao-HK2 | 1 - peer/JerryXiao-SH1.toml | 1 + peer/JerryXiao-SH1~JerryXiao-HK1 | 1 - peer/JerryXiao.toml | 1 + peer/JerryXiao~JerryXiao-HK1 | 1 - peer/JerryXiao~JerryXiao-SH1 | 1 - peer/JerryXiao~LanTian | 1 - peer/JerryXiao~dfceaef | 1 - peer/JerryXiao~ucbvax | 1 - peer/MagicNeko-HK01.toml | 1 + peer/MagicNeko-HK01~Icecat-GroupAccessNetwork | 1 - peer/MagicNeko-HK01~SUNNET | 1 - peer/MagicNeko-JP03.toml | 8 + peer/MagicNeko-JP03~JerryXiao | 1 - peer/MagicNeko-JP03~Ndoskrnl-US01 | 1 - peer/MagicNeko-JP03~chenx97 | 1 - peer/MagicNeko-JP03~frank-hsinchu | 1 - peer/MagicNeko-JP03~megumiLHS | 1 - peer/MagicNeko-JP03~santost12 | 1 - peer/Ndoskrnl-US01.toml | 1 + peer/Ndoskrnl-US01~Ndoskrnl-CN01 | 1 - peer/NeoSystem.toml | 1 + peer/NeoSystem~NeoVAX | 1 - peer/caasih.toml | 1 + peer/caasih~NeoPDP-11 | 1 - peer/caasih~staph | 1 - peer/caasih~ucbvax | 1 - peer/cklvax.toml | 1 + peer/cklvax~NeoSystem | 1 - peer/pan.toml | 1 + peer/pan~MagicNeko-JP03 | 1 - peer/pan~NeoPDP-11 | 1 - peer/pan~NeoSystem | 1 - peer/septs.toml | 10 + peer/septs~James58899 | 1 - peer/septs~JerryXiao | 1 - peer/septs~LanTian | 1 - peer/septs~MagicNeko-JP03 | 1 - peer/septs~MagicNeko-RU01 | 1 - peer/septs~frank-hsinchu | 1 - peer/septs~megumiLHS | 1 - peer/septs~ucbvax | 1 - peer/staph.toml | 1 + peer/staph~MagicNeko-RU01 | 1 - peer/staph~santost12 | 1 - peer/staph~septs | 1 - peer/ucbvax.toml | 9 + peer/ucbvax~MagicNeko-HK01 | 1 - peer/ucbvax~NeoPDP-11 | 1 - peer/ucbvax~NeoSystem | 1 - peer/ucbvax~chenx97 | 1 - peer/ucbvax~megumiLHS | 1 - peer/ucbvax~pan | 1 - peer/ucbvax~santost12 | 1 - pyproject.toml | 2 + route/10.127.0.0,24 | 4 - route/10.127.1.0,24 | 4 - route/10.127.10.0,24 | 4 - route/10.127.11.0,24 | 4 - route/10.127.12.0,24 | 4 - route/10.127.13.0,24 | 4 - route/10.127.14.0,23 | 4 - route/10.127.2.0,24 | 4 - route/10.127.22.0,29 | 4 - route/10.127.22.8,29 | 4 - route/10.127.23.0,29 | 4 - route/10.127.233.0,24 | 4 - route/10.127.255.1,32 | 4 - route/10.127.255.117,32 | 4 - route/10.127.255.2,32 | 4 - route/10.127.255.4,32 | 4 - route/10.127.255.53,32 | 4 - route/10.127.255.56,32 | 4 - route/10.127.255.80,32 | 4 - route/10.127.3.0,24 | 4 - route/10.127.4.0,24 | 4 - route/10.127.41.0,24 | 4 - route/10.127.5.0,28 | 4 - route/10.127.56.0,24 | 4 - route/10.127.69.0,29 | 4 - route/10.127.8.0,26 | 4 - route/10.127.8.184,29 | 4 - route/10.127.8.192,26 | 4 - route/10.127.9.0,24 | 4 - route/AS134098.toml | 3 + route/AS4201270000.toml | 43 +++ route/AS4201270001.toml | 7 + route/AS4201270004.toml | 9 + route/AS4201270005.toml | 10 + route/AS4201270006.toml | 19 ++ route/AS4201270007.toml | 9 + route/AS4201270008.toml | 14 + route/AS4201270009.toml | 4 + route/AS4201270010.toml | 9 + route/AS4201270011.toml | 9 + route/AS4201270012.toml | 4 + route/AS4201270013.toml | 9 + route/AS4201270014.toml | 9 + route/AS4242420140.toml | 4 + route/AS4242421037.toml | 4 + route/AS4242423088.toml | 4 + route6/fd10:127:0023::,48 | 4 - route6/fd10:127:0233:1c3c::,64 | 5 - route6/fd10:127:0233::,48 | 4 - route6/fd10:127:10::,48 | 4 - route6/fd10:127:13::,48 | 4 - route6/fd10:127:41::,48 | 4 - route6/fd10:127:53::,48 | 4 - route6/fd10:127:5f37:59df::,64 | 4 - route6/fd10:127:6969::,48 | 4 - route6/fd10:127:7::,48 | 4 - scripts/dns-reverse-generator.py | 36 ++ scripts/dns-reverse-generator.sh | 51 --- scripts/roa-ng.py | 316 ++++++++++++++++++ scripts/roa.sh | 33 -- 252 files changed, 922 insertions(+), 857 deletions(-) create mode 100644 .editorconfig create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json delete mode 100644 asn/AS134098 create mode 100644 asn/AS134098.toml delete mode 100644 asn/AS4201270000 create mode 100644 asn/AS4201270000.toml delete mode 100644 asn/AS4201270001 create mode 100644 asn/AS4201270001.toml delete mode 100644 asn/AS4201270002 create mode 100644 asn/AS4201270002.toml delete mode 100644 asn/AS4201270003 create mode 100644 asn/AS4201270003.toml delete mode 100644 asn/AS4201270004 create mode 100644 asn/AS4201270004.toml delete mode 100644 asn/AS4201270005 create mode 100644 asn/AS4201270005.toml delete mode 100644 asn/AS4201270006 create mode 100644 asn/AS4201270006.toml delete mode 100644 asn/AS4201270007 create mode 100644 asn/AS4201270007.toml delete mode 100644 asn/AS4201270008 create mode 100644 asn/AS4201270008.toml delete mode 100644 asn/AS4201270009 create mode 100644 asn/AS4201270009.toml delete mode 100644 asn/AS4201270010 create mode 100644 asn/AS4201270010.toml delete mode 100644 asn/AS4201270011 create mode 100644 asn/AS4201270011.toml delete mode 100644 asn/AS4201270012 create mode 100644 asn/AS4201270012.toml delete mode 100644 asn/AS4201270013 create mode 100644 asn/AS4201270013.toml delete mode 100644 asn/AS4201270014 create mode 100644 asn/AS4201270014.toml delete mode 100644 asn/AS4201270015 create mode 100644 asn/AS4201270015.toml delete mode 100644 asn/AS4242420140 create mode 100644 asn/AS4242420140.toml delete mode 100644 asn/AS4242420916 create mode 100644 asn/AS4242420916.toml delete mode 100644 asn/AS4242421037 create mode 100644 asn/AS4242421037.toml delete mode 100644 asn/AS4242423088 create mode 100644 asn/AS4242423088.toml delete mode 100644 entity/Icecat create mode 100644 entity/Icecat.toml delete mode 100644 entity/James58899 create mode 100644 entity/James58899.toml delete mode 100644 entity/JerryXiao create mode 100644 entity/JerryXiao.toml delete mode 100644 entity/Junde Yhi create mode 100644 entity/Junde Yhi.toml delete mode 100644 entity/LINE-NZ create mode 100644 entity/LINE-NZ.toml delete mode 100644 entity/Lan Tian create mode 100644 entity/Lan Tian.toml delete mode 100644 entity/LibreHouse create mode 100644 entity/LibreHouse.toml delete mode 100644 entity/Ndoskrnl create mode 100644 entity/Ndoskrnl.toml delete mode 100644 entity/Neo_Chen create mode 100644 entity/Neo_Chen.toml delete mode 100644 entity/SUNNET create mode 100644 entity/SUNNET.toml delete mode 100644 entity/Septs delete mode 100644 entity/Staph create mode 100644 entity/Staph.toml delete mode 100644 entity/Yangfl create mode 100644 entity/Yangfl.toml delete mode 100644 entity/alanyhq create mode 100644 entity/alanyhq.toml delete mode 100644 entity/chenx97 create mode 100644 entity/chenx97.toml delete mode 100644 entity/frank create mode 100644 entity/frank.toml delete mode 100644 entity/leedagee create mode 100644 entity/leedagee.toml delete mode 100644 entity/licson create mode 100644 entity/licson.toml delete mode 100644 entity/santost12 create mode 100644 entity/santost12.toml create mode 100644 entity/septs.toml delete mode 100644 node/Icecat-GroupAccessNetwork create mode 100644 node/Icecat.toml delete mode 100644 node/James58899 create mode 100644 node/James58899.toml delete mode 100644 node/JerryXiao delete mode 100644 node/JerryXiao-HK1 delete mode 100644 node/JerryXiao-HK2 delete mode 100644 node/JerryXiao-SH1 create mode 100644 node/JerryXiao.toml delete mode 100644 node/LINE-NZ-AU01 delete mode 100644 node/LINE-NZ-NZ01 create mode 100644 node/LINE-NZ.toml delete mode 100644 node/LanTian create mode 100644 node/LanTian.toml delete mode 100644 node/MagicNeko-HK01 delete mode 100644 node/MagicNeko-JP03 delete mode 100644 node/MagicNeko-RU01 create mode 100644 node/MagicNeko.toml delete mode 100644 node/Ndoskrnl-CN01 delete mode 100644 node/Ndoskrnl-US01 create mode 100644 node/Ndoskrnl.toml delete mode 100644 node/NeoPDP-11 delete mode 100644 node/NeoSystem delete mode 100644 node/NeoVAX create mode 100644 node/Neo_Chen.toml delete mode 100644 node/SUNNET create mode 100644 node/SUNNET.toml delete mode 100644 node/caasih create mode 100644 node/caasih.toml delete mode 100644 node/chenx97 create mode 100644 node/chenx97.toml delete mode 100644 node/cklvax create mode 100644 node/cklvax.toml delete mode 100644 node/dfceaef create mode 100644 node/dfceaef.toml delete mode 100644 node/frank-hsinchu create mode 100644 node/frank.toml delete mode 100644 node/leedagee create mode 100644 node/leedagee.toml delete mode 100644 node/megumiLHS create mode 100644 node/megumiLHS.toml delete mode 100644 node/pan delete mode 100644 node/santost12 create mode 100644 node/santost12.toml delete mode 100644 node/septs create mode 100644 node/septs.toml delete mode 100644 node/staph create mode 100644 node/staph.toml delete mode 100644 node/ucbvax delete mode 100644 node/yhi-h create mode 100644 node/yhi-h.toml create mode 100644 peer/JerryXiao-HK1.toml delete mode 100644 peer/JerryXiao-HK1~JerryXiao-HK2 create mode 100644 peer/JerryXiao-SH1.toml delete mode 100644 peer/JerryXiao-SH1~JerryXiao-HK1 create mode 100644 peer/JerryXiao.toml delete mode 100644 peer/JerryXiao~JerryXiao-HK1 delete mode 100644 peer/JerryXiao~JerryXiao-SH1 delete mode 100644 peer/JerryXiao~LanTian delete mode 100644 peer/JerryXiao~dfceaef delete mode 100644 peer/JerryXiao~ucbvax create mode 100644 peer/MagicNeko-HK01.toml delete mode 100644 peer/MagicNeko-HK01~Icecat-GroupAccessNetwork delete mode 100644 peer/MagicNeko-HK01~SUNNET create mode 100644 peer/MagicNeko-JP03.toml delete mode 100644 peer/MagicNeko-JP03~JerryXiao delete mode 100644 peer/MagicNeko-JP03~Ndoskrnl-US01 delete mode 100644 peer/MagicNeko-JP03~chenx97 delete mode 100644 peer/MagicNeko-JP03~frank-hsinchu delete mode 100644 peer/MagicNeko-JP03~megumiLHS delete mode 100644 peer/MagicNeko-JP03~santost12 create mode 100644 peer/Ndoskrnl-US01.toml delete mode 100644 peer/Ndoskrnl-US01~Ndoskrnl-CN01 create mode 100644 peer/NeoSystem.toml delete mode 100644 peer/NeoSystem~NeoVAX create mode 100644 peer/caasih.toml delete mode 100644 peer/caasih~NeoPDP-11 delete mode 100644 peer/caasih~staph delete mode 100644 peer/caasih~ucbvax create mode 100644 peer/cklvax.toml delete mode 100644 peer/cklvax~NeoSystem create mode 100644 peer/pan.toml delete mode 100644 peer/pan~MagicNeko-JP03 delete mode 100644 peer/pan~NeoPDP-11 delete mode 100644 peer/pan~NeoSystem create mode 100644 peer/septs.toml delete mode 100644 peer/septs~James58899 delete mode 100644 peer/septs~JerryXiao delete mode 100644 peer/septs~LanTian delete mode 100644 peer/septs~MagicNeko-JP03 delete mode 100644 peer/septs~MagicNeko-RU01 delete mode 100644 peer/septs~frank-hsinchu delete mode 100644 peer/septs~megumiLHS delete mode 100644 peer/septs~ucbvax create mode 100644 peer/staph.toml delete mode 100644 peer/staph~MagicNeko-RU01 delete mode 100644 peer/staph~santost12 delete mode 100644 peer/staph~septs create mode 100644 peer/ucbvax.toml delete mode 100644 peer/ucbvax~MagicNeko-HK01 delete mode 100644 peer/ucbvax~NeoPDP-11 delete mode 100644 peer/ucbvax~NeoSystem delete mode 100644 peer/ucbvax~chenx97 delete mode 100644 peer/ucbvax~megumiLHS delete mode 100644 peer/ucbvax~pan delete mode 100644 peer/ucbvax~santost12 create mode 100644 pyproject.toml delete mode 100644 route/10.127.0.0,24 delete mode 100644 route/10.127.1.0,24 delete mode 100644 route/10.127.10.0,24 delete mode 100644 route/10.127.11.0,24 delete mode 100644 route/10.127.12.0,24 delete mode 100644 route/10.127.13.0,24 delete mode 100644 route/10.127.14.0,23 delete mode 100644 route/10.127.2.0,24 delete mode 100644 route/10.127.22.0,29 delete mode 100644 route/10.127.22.8,29 delete mode 100644 route/10.127.23.0,29 delete mode 100644 route/10.127.233.0,24 delete mode 100644 route/10.127.255.1,32 delete mode 100644 route/10.127.255.117,32 delete mode 100644 route/10.127.255.2,32 delete mode 100644 route/10.127.255.4,32 delete mode 100644 route/10.127.255.53,32 delete mode 100644 route/10.127.255.56,32 delete mode 100644 route/10.127.255.80,32 delete mode 100644 route/10.127.3.0,24 delete mode 100644 route/10.127.4.0,24 delete mode 100644 route/10.127.41.0,24 delete mode 100644 route/10.127.5.0,28 delete mode 100644 route/10.127.56.0,24 delete mode 100644 route/10.127.69.0,29 delete mode 100644 route/10.127.8.0,26 delete mode 100644 route/10.127.8.184,29 delete mode 100644 route/10.127.8.192,26 delete mode 100644 route/10.127.9.0,24 create mode 100644 route/AS134098.toml create mode 100644 route/AS4201270000.toml create mode 100644 route/AS4201270001.toml create mode 100644 route/AS4201270004.toml create mode 100644 route/AS4201270005.toml create mode 100644 route/AS4201270006.toml create mode 100644 route/AS4201270007.toml create mode 100644 route/AS4201270008.toml create mode 100644 route/AS4201270009.toml create mode 100644 route/AS4201270010.toml create mode 100644 route/AS4201270011.toml create mode 100644 route/AS4201270012.toml create mode 100644 route/AS4201270013.toml create mode 100644 route/AS4201270014.toml create mode 100644 route/AS4242420140.toml create mode 100644 route/AS4242421037.toml create mode 100644 route/AS4242423088.toml delete mode 100644 route6/fd10:127:0023::,48 delete mode 100644 route6/fd10:127:0233:1c3c::,64 delete mode 100644 route6/fd10:127:0233::,48 delete mode 100644 route6/fd10:127:10::,48 delete mode 100644 route6/fd10:127:13::,48 delete mode 100644 route6/fd10:127:41::,48 delete mode 100644 route6/fd10:127:53::,48 delete mode 100644 route6/fd10:127:5f37:59df::,64 delete mode 100644 route6/fd10:127:6969::,48 delete mode 100644 route6/fd10:127:7::,48 create mode 100755 scripts/dns-reverse-generator.py delete mode 100755 scripts/dns-reverse-generator.sh create mode 100755 scripts/roa-ng.py delete mode 100755 scripts/roa.sh diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c9d49d6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*.toml] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = false \ No newline at end of file diff --git a/.github/workflows/roa.yml b/.github/workflows/roa.yml index 731cc4a..f1a1e6c 100644 --- a/.github/workflows/roa.yml +++ b/.github/workflows/roa.yml @@ -4,9 +4,9 @@ name: roa_generator on: push: - branches: [ master ] + branches: [master] schedule: - - cron: '0 6 * * 1' + - cron: "0 6 * * 1" jobs: build: @@ -15,54 +15,56 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@master - - name: Install dependencies - shell: bash - run: | - sudo apt update -qq - sudo apt install -y python3 git openssh-client - sudo apt install -y curl - curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash - export PATH="$HOME/.pyenv/bin:$PATH" - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" - pyenv install 3.8.2 - pyenv shell 3.8.2 + - name: Install dependencies + shell: bash + run: | + sudo apt update -qq + sudo apt install -y python3 git openssh-client + sudo apt install -y curl + curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" + pyenv install 3.8.2 + pyenv shell 3.8.2 + pip install toml - - name: Run roa script - shell: bash - run: | - export PATH="$HOME/.pyenv/bin:$PATH" - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" - pyenv shell 3.8.2 - maxlen4=29 - maxlen6=64 - mkdir -p roa_dir - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json + - name: Run roa script + shell: bash + run: | + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" + pyenv shell 3.8.2 + maxlen4=29 + maxlen6=64 + mkdir -p roa_dir + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json + pyenv exec python3 scripts/roa-ng.py --summary --output roa_dir/README.txt - - name: Upload files - env: - SSHPRIVKEY: ${{ secrets.KEY }} - shell: bash - run: | - cd roa_dir - [ -n "$SSHPRIVKEY" ] || (echo SSHPRIVKEY is not set; exit 1) - ( set -e; - mkdir -p ~/.ssh - echo "$SSHPRIVKEY" |base64 -d > ~/.ssh/id_ed25519 - chmod 0600 ~/.ssh/id_ed25519 - ssh -o StrictHostKeyChecking=no git@github.com || true - git init && git add . - git config user.name "neonet roa bot" - git config user.email "bot@github.com" - git commit -m "Generated at $(TZ='UTC' date +%Y%m%d-%H%M%S.%N)" - git push --force --quiet "git@github.com:NeoCloud/NeoNetwork-ROA.git" HEAD:master - ) || (shred ~/.ssh/id_ed25519; exit 1) - shred ~/.ssh/id_ed25519 + - name: Upload files + env: + SSHPRIVKEY: ${{ secrets.KEY }} + shell: bash + run: | + cd roa_dir + [ -n "$SSHPRIVKEY" ] || (echo SSHPRIVKEY is not set; exit 1) + ( set -e; + mkdir -p ~/.ssh + echo "$SSHPRIVKEY" | base64 -d > ~/.ssh/id_ed25519 + chmod 0600 ~/.ssh/id_ed25519 + ssh -o StrictHostKeyChecking=no git@github.com || true + git init && git add . + git config user.name "neonet roa bot" + git config user.email "bot@github.com" + git commit -m "Generated at $(TZ='UTC' date +%Y%m%d-%H%M%S.%N)" + git push --force --quiet "git@github.com:NeoCloud/NeoNetwork-ROA.git" HEAD:master + ) || (shred ~/.ssh/id_ed25519; exit 1) + shred ~/.ssh/id_ed25519 diff --git a/.github/workflows/test-your-pr.yml b/.github/workflows/test-your-pr.yml index 0f1ff26..de6fa4c 100644 --- a/.github/workflows/test-your-pr.yml +++ b/.github/workflows/test-your-pr.yml @@ -13,36 +13,37 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - with: - ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/checkout@master + with: + ref: ${{ github.event.pull_request.head.sha }} - - name: Install dependencies - shell: bash - run: | - sudo apt update -qq - sudo apt install -y python3 git openssh-client - sudo apt install -y curl - curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash - export PATH="$HOME/.pyenv/bin:$PATH" - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" - pyenv install 3.8.2 - pyenv shell 3.8.2 + - name: Install dependencies + shell: bash + run: | + sudo apt update -qq + sudo apt install -y python3 git openssh-client + sudo apt install -y curl + curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" + pyenv install 3.8.2 + pyenv shell 3.8.2 + pip install toml - - name: Run roa script - shell: bash - run: | - export PATH="$HOME/.pyenv/bin:$PATH" - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" - pyenv shell 3.8.2 - maxlen4=29 - maxlen6=64 - mkdir -p roa_dir - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json - pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json + - name: Run roa script + shell: bash + run: | + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" + pyenv shell 3.8.2 + maxlen4=29 + maxlen6=64 + mkdir -p roa_dir + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json + pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..fc8a844 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["bungcip.better-toml", "bodil.prettier-toml"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3800c30 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.formatOnSave": true, + "python.formatting.provider": "black" +} diff --git a/asn/AS134098 b/asn/AS134098 deleted file mode 100644 index 0cca0ee..0000000 --- a/asn/AS134098 +++ /dev/null @@ -1,5 +0,0 @@ -NAME="Licson Internal Network" -OWNER="licson" -DESC="" -SOURCE="INET" -VALID="YES" diff --git a/asn/AS134098.toml b/asn/AS134098.toml new file mode 100644 index 0000000..e9ef3eb --- /dev/null +++ b/asn/AS134098.toml @@ -0,0 +1,4 @@ +name = "Licson Internal Network" +owner = "licson" +source = "Internet" +vaild = true diff --git a/asn/AS4201270000 b/asn/AS4201270000 deleted file mode 100644 index c3f437f..0000000 --- a/asn/AS4201270000 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="NeoNetwork Origin" -OWNER="Neo_Chen" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270000.toml b/asn/AS4201270000.toml new file mode 100644 index 0000000..3576d35 --- /dev/null +++ b/asn/AS4201270000.toml @@ -0,0 +1,2 @@ +name = "NeoNetwork Origin" +owner = "Neo_Chen" diff --git a/asn/AS4201270001 b/asn/AS4201270001 deleted file mode 100644 index 8ff9d3f..0000000 --- a/asn/AS4201270001 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Septs Inter-NeoNetwork Exchange" -OWNER="Septs" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270001.toml b/asn/AS4201270001.toml new file mode 100644 index 0000000..07ac282 --- /dev/null +++ b/asn/AS4201270001.toml @@ -0,0 +1,2 @@ +name = "Septs Inter-NeoNetwork Exchange" +owner = "septs" diff --git a/asn/AS4201270002 b/asn/AS4201270002 deleted file mode 100644 index e18d2dd..0000000 --- a/asn/AS4201270002 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Septs Home" -OWNER="Septs" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270002.toml b/asn/AS4201270002.toml new file mode 100644 index 0000000..8162c19 --- /dev/null +++ b/asn/AS4201270002.toml @@ -0,0 +1,2 @@ +name = "Septs HomeLabs" +owner = "septs" diff --git a/asn/AS4201270003 b/asn/AS4201270003 deleted file mode 100644 index 056da0c..0000000 --- a/asn/AS4201270003 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="chenx97" -OWNER="chenx97" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270003.toml b/asn/AS4201270003.toml new file mode 100644 index 0000000..5c6317e --- /dev/null +++ b/asn/AS4201270003.toml @@ -0,0 +1,2 @@ +name = "chenx97" +owner = "chenx97" diff --git a/asn/AS4201270004 b/asn/AS4201270004 deleted file mode 100644 index 1e9ce4b..0000000 --- a/asn/AS4201270004 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="frank" -OWNER="frank" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270004.toml b/asn/AS4201270004.toml new file mode 100644 index 0000000..ffd4c37 --- /dev/null +++ b/asn/AS4201270004.toml @@ -0,0 +1,2 @@ +name = "frank" +owner = "frank" diff --git a/asn/AS4201270005 b/asn/AS4201270005 deleted file mode 100644 index d00d7a7..0000000 --- a/asn/AS4201270005 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Icecat" -OWNER="Icecat" -DESC="NextMoe Group Access Network" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270005.toml b/asn/AS4201270005.toml new file mode 100644 index 0000000..0cc99d8 --- /dev/null +++ b/asn/AS4201270005.toml @@ -0,0 +1,3 @@ +name = "Icecat" +owner = "Icecat" +description = "NextMoe Group Access Network" diff --git a/asn/AS4201270006 b/asn/AS4201270006 deleted file mode 100644 index 22a0342..0000000 --- a/asn/AS4201270006 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Jerry Network" -OWNER="JerryXiao" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270006.toml b/asn/AS4201270006.toml new file mode 100644 index 0000000..3eecbdd --- /dev/null +++ b/asn/AS4201270006.toml @@ -0,0 +1,2 @@ +name = "Jerry Network" +owner = "JerryXiao" diff --git a/asn/AS4201270007 b/asn/AS4201270007 deleted file mode 100644 index 9b60ab1..0000000 --- a/asn/AS4201270007 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Staph" -OWNER="Staph" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270007.toml b/asn/AS4201270007.toml new file mode 100644 index 0000000..173d477 --- /dev/null +++ b/asn/AS4201270007.toml @@ -0,0 +1,2 @@ +name = "Staph" +owner = "Staph" diff --git a/asn/AS4201270008 b/asn/AS4201270008 deleted file mode 100644 index bd31f5f..0000000 --- a/asn/AS4201270008 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="MagicNeko" -OWNER="Icecat" -DESC="MagicNeko Network Internet exchange" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270008.toml b/asn/AS4201270008.toml new file mode 100644 index 0000000..ac74d13 --- /dev/null +++ b/asn/AS4201270008.toml @@ -0,0 +1,3 @@ +name = "MagicNeko" +owner = "Icecat" +description = "MagicNeko Network Internet exchange" diff --git a/asn/AS4201270009 b/asn/AS4201270009 deleted file mode 100644 index cbf9180..0000000 --- a/asn/AS4201270009 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="santost12" -OWNER="santost12" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270009.toml b/asn/AS4201270009.toml new file mode 100644 index 0000000..843338e --- /dev/null +++ b/asn/AS4201270009.toml @@ -0,0 +1,2 @@ +name = "santost12" +owner = "santost12" diff --git a/asn/AS4201270010 b/asn/AS4201270010 deleted file mode 100644 index ea9b4fb..0000000 --- a/asn/AS4201270010 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Lan Tian" -OWNER="Lan Tian" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270010.toml b/asn/AS4201270010.toml new file mode 100644 index 0000000..bc240bf --- /dev/null +++ b/asn/AS4201270010.toml @@ -0,0 +1,2 @@ +name = "Lan Tian" +owner = "Lan Tian" diff --git a/asn/AS4201270011 b/asn/AS4201270011 deleted file mode 100644 index 2494f33..0000000 --- a/asn/AS4201270011 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="LINE-NZ" -OWNER="LINE-NZ" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270011.toml b/asn/AS4201270011.toml new file mode 100644 index 0000000..acd8459 --- /dev/null +++ b/asn/AS4201270011.toml @@ -0,0 +1,2 @@ +name = "LINE-NZ" +owner = "LINE-NZ" diff --git a/asn/AS4201270012 b/asn/AS4201270012 deleted file mode 100644 index e96e0e4..0000000 --- a/asn/AS4201270012 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Yhi Interconnect" -OWNER="Junde Yhi" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270012.toml b/asn/AS4201270012.toml new file mode 100644 index 0000000..08eda8f --- /dev/null +++ b/asn/AS4201270012.toml @@ -0,0 +1,2 @@ +name = "Yhi Interconnect" +owner = "Junde Yhi" diff --git a/asn/AS4201270013 b/asn/AS4201270013 deleted file mode 100644 index 4d39b1d..0000000 --- a/asn/AS4201270013 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="NDOSKRNL" -OWNER="Ndoskrnl" -DESC="Ndoskrnl's Network" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270013.toml b/asn/AS4201270013.toml new file mode 100644 index 0000000..72c0e9c --- /dev/null +++ b/asn/AS4201270013.toml @@ -0,0 +1,3 @@ +name = "NDOSKRNL" +owner = "Ndoskrnl" +description = "Ndoskrnl's Network" diff --git a/asn/AS4201270014 b/asn/AS4201270014 deleted file mode 100644 index 1aebc98..0000000 --- a/asn/AS4201270014 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="leedagee" -OWNER="leedagee" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270014.toml b/asn/AS4201270014.toml new file mode 100644 index 0000000..c62a079 --- /dev/null +++ b/asn/AS4201270014.toml @@ -0,0 +1,2 @@ +name = "leedagee" +owner = "leedagee" diff --git a/asn/AS4201270015 b/asn/AS4201270015 deleted file mode 100644 index ccabbdf..0000000 --- a/asn/AS4201270015 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="James58899" -OWNER="James58899" -DESC="" -SOURCE="NeoNetwork" diff --git a/asn/AS4201270015.toml b/asn/AS4201270015.toml new file mode 100644 index 0000000..c16f8b2 --- /dev/null +++ b/asn/AS4201270015.toml @@ -0,0 +1,2 @@ +name = "James58899" +owner = "James58899" diff --git a/asn/AS4242420140 b/asn/AS4242420140 deleted file mode 100644 index be5d858..0000000 --- a/asn/AS4242420140 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="Yangfl Network" -OWNER="Yangfl" -DESC="" -SOURCE="DN42" diff --git a/asn/AS4242420140.toml b/asn/AS4242420140.toml new file mode 100644 index 0000000..c33f368 --- /dev/null +++ b/asn/AS4242420140.toml @@ -0,0 +1,2 @@ +name = "Yangfl Network" +owner = "Yangfl" diff --git a/asn/AS4242420916 b/asn/AS4242420916 deleted file mode 100644 index 947fe70..0000000 --- a/asn/AS4242420916 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="alanyhq" -OWNER="alanyhq" -DESC="alanyhq main" -SOURCE="DN42" diff --git a/asn/AS4242420916.toml b/asn/AS4242420916.toml new file mode 100644 index 0000000..c0c3477 --- /dev/null +++ b/asn/AS4242420916.toml @@ -0,0 +1,3 @@ +name = "alanyhq" +owner = "alanyhq" +description = "alanyhq main" diff --git a/asn/AS4242421037 b/asn/AS4242421037 deleted file mode 100644 index 49454e5..0000000 --- a/asn/AS4242421037 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="LibreHouse" -OWNER="LibreHouse" -DESC="" -SOURCE="DN42" diff --git a/asn/AS4242421037.toml b/asn/AS4242421037.toml new file mode 100644 index 0000000..d3e9af9 --- /dev/null +++ b/asn/AS4242421037.toml @@ -0,0 +1,2 @@ +name = "SUNNET" +owner = "SUNNET" diff --git a/asn/AS4242423088 b/asn/AS4242423088 deleted file mode 100644 index 0722e17..0000000 --- a/asn/AS4242423088 +++ /dev/null @@ -1,4 +0,0 @@ -NAME="SUNNET" -OWNER="SUNNET" -DESC="" -SOURCE="DN42" diff --git a/asn/AS4242423088.toml b/asn/AS4242423088.toml new file mode 100644 index 0000000..c33f368 --- /dev/null +++ b/asn/AS4242423088.toml @@ -0,0 +1,2 @@ +name = "Yangfl Network" +owner = "Yangfl" diff --git a/entity/Icecat b/entity/Icecat deleted file mode 100644 index f794757..0000000 --- a/entity/Icecat +++ /dev/null @@ -1,13 +0,0 @@ -NAME="Icecat" -DESC="" -CONTACT=( - "EMAIL:" - "TELEGRAM:@fakeicecat" - "IRC:" - "MASTODON:" - "GITHUB:Myer921" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/Icecat.toml b/entity/Icecat.toml new file mode 100644 index 0000000..25fe6c9 --- /dev/null +++ b/entity/Icecat.toml @@ -0,0 +1,5 @@ +name = "Icecat" + +[contact] +telegram = "fakeicecat" +github = "Myer921" diff --git a/entity/James58899 b/entity/James58899 deleted file mode 100644 index 7c6219c..0000000 --- a/entity/James58899 +++ /dev/null @@ -1,13 +0,0 @@ -NAME="James58899" -DESC="" -CONTACT=( - "EMAIL:" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/James58899.toml b/entity/James58899.toml new file mode 100644 index 0000000..8e6a0e3 --- /dev/null +++ b/entity/James58899.toml @@ -0,0 +1 @@ +name = "James58899" diff --git a/entity/JerryXiao b/entity/JerryXiao deleted file mode 100644 index 45cb524..0000000 --- a/entity/JerryXiao +++ /dev/null @@ -1,13 +0,0 @@ -NAME="JerryXiao" -DESC="" -CONTACT=( - "EMAIL:neonet@mail.jerryxiao.cc" - "TELEGRAM:@JerryXiao" - "IRC:JerryXiao@hackint" - "MASTODON:" - "GITHUB:isjerryxiao" -) -BABEL=( - "" -) -AUTH="PGP:186242204A2EC70438E9CE3B9D9CE43650FF2BAA" diff --git a/entity/JerryXiao.toml b/entity/JerryXiao.toml new file mode 100644 index 0000000..e926f0c --- /dev/null +++ b/entity/JerryXiao.toml @@ -0,0 +1,10 @@ +name = "JerryXiao" + +[contact] +email = "neonet@mail.jerryxiao.cc" +telegram = "JerryXiao" +irc = "JerryXiao@hackint" +github = "isjerryxiao" + +[persona] +pgp = "186242204A2EC70438E9CE3B9D9CE43650FF2BAA" diff --git a/entity/Junde Yhi b/entity/Junde Yhi deleted file mode 100644 index 5b94a98..0000000 --- a/entity/Junde Yhi +++ /dev/null @@ -1,19 +0,0 @@ -NAME="Junde Yhi" -DESC="" -CONTACT=( - "EMAIL:lmy441900@live.com" - "TELEGRAM:@lmy441900" - "MASTODON:@lmy441900@sn.angry.im" - "GITHUB:lmy441900" -) -BABEL=( - "zh-N" - "zh-hans-N" - "zh-hant-2" - "en-3" - "de-0" - "ru-0" - "jp-0" - "fi-0" -) -AUTH="PGP:E6C74782A1FBEE741D09885FD274286F672C800A" diff --git a/entity/Junde Yhi.toml b/entity/Junde Yhi.toml new file mode 100644 index 0000000..ec221d3 --- /dev/null +++ b/entity/Junde Yhi.toml @@ -0,0 +1,20 @@ +name = "Junde Yhi" +babel = [ + "zh-N", + "zh-hans-N", + "zh-hant-2", + "en-3", + "de-0", + "ru-0", + "jp-0", + "fi-0", +] + +[contact] +email = "lmy441900@live.com" +telegram = "lmy441900" +mastodon = "@lmy441900@sn.angry.im" +github = "lmy441900" + +[persona] +pgp = "E6C74782A1FBEE741D09885FD274286F672C800A" diff --git a/entity/LINE-NZ b/entity/LINE-NZ deleted file mode 100644 index 26eae7b..0000000 --- a/entity/LINE-NZ +++ /dev/null @@ -1,13 +0,0 @@ -NAME="LINE-NZ" -DESC="" -CONTACT=( - "EMAIL:dn42@line.co.nz" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:line-nz" -) -BABEL=( - "en" -) -AUTH="" diff --git a/entity/LINE-NZ.toml b/entity/LINE-NZ.toml new file mode 100644 index 0000000..eeab0fd --- /dev/null +++ b/entity/LINE-NZ.toml @@ -0,0 +1,6 @@ +name = "LINE-NZ" +babel = ["en"] + +[contact] +email = "dn42@line.co.nz" +github = "line-nz" diff --git a/entity/Lan Tian b/entity/Lan Tian deleted file mode 100644 index 690f116..0000000 --- a/entity/Lan Tian +++ /dev/null @@ -1,13 +0,0 @@ -NAME="Lan Tian" -DESC="" -CONTACT=( - "EMAIL:" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/Lan Tian.toml b/entity/Lan Tian.toml new file mode 100644 index 0000000..edd54c8 --- /dev/null +++ b/entity/Lan Tian.toml @@ -0,0 +1 @@ +name = "Lan Tian" diff --git a/entity/LibreHouse b/entity/LibreHouse deleted file mode 100644 index ccbb13b..0000000 --- a/entity/LibreHouse +++ /dev/null @@ -1,17 +0,0 @@ -NAME="LibreHouse" -DESC="" -CONTACT=( - "EMAIL:i+noc@outv.im" - "TELEGRAM:@outvi" - "IRC:" - "MASTODON:@outvi@moe.cat" - "GITHUB:@outloudvi" -) -BABEL=( - "zh-N" - "zh-hans-N" - "zh-hant-3" - "en-2" - "ja-0" -) -AUTH="" diff --git a/entity/LibreHouse.toml b/entity/LibreHouse.toml new file mode 100644 index 0000000..7b81796 --- /dev/null +++ b/entity/LibreHouse.toml @@ -0,0 +1,11 @@ +name = "LibreHouse" +babel = ["zh-N", "en-2"] + +[contact] +email = "i+noc@outv.im" +telegram = "outvi" +mastodon = "@outvi@moe.cat" +github = "outloudvi" + +[persona] +pgp = "47627D2288B20CC033C7B7D72D83E4E89C15DA36" diff --git a/entity/Ndoskrnl b/entity/Ndoskrnl deleted file mode 100644 index d178abe..0000000 --- a/entity/Ndoskrnl +++ /dev/null @@ -1,13 +0,0 @@ -NAME="Ndoskrnl" -DESC="We can start chat happily with Google Translate :)" -CONTACT=( - "EMAIL:lollipop.studio.cn@gmail.com" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:magic0whi" -) -BABEL=( - "zh|en-1" -) -AUTH="" diff --git a/entity/Ndoskrnl.toml b/entity/Ndoskrnl.toml new file mode 100644 index 0000000..578d76f --- /dev/null +++ b/entity/Ndoskrnl.toml @@ -0,0 +1,7 @@ +name = "Ndoskrnl" +description = "We can start chat happily with Google Translate :)" +babel = ["en-1", "zh-1"] + +[contact] +email = "lollipop.studio.cn@gmail.com" +github = "magic0whi" diff --git a/entity/Neo_Chen b/entity/Neo_Chen deleted file mode 100644 index 518e662..0000000 --- a/entity/Neo_Chen +++ /dev/null @@ -1,14 +0,0 @@ -NAME="Neo_Chen" -DESC="" -CONTACT=( - "EMAIL:chenkolei@gmail.com" - "TELEGRAM:@Neo_Chen" - "IRC:Neo_Chen" - "MASTODON:@Neo_Chen@mastodon.xyz" - "GITHUB:NeoChen1024" -) -BABEL=( - "zh-N" - "en-2" -) -AUTH="PGP:D306BB628837043150CD1E42CA0957540FD996CD" diff --git a/entity/Neo_Chen.toml b/entity/Neo_Chen.toml new file mode 100644 index 0000000..fedddd2 --- /dev/null +++ b/entity/Neo_Chen.toml @@ -0,0 +1,12 @@ +name = "Neo_Chen" +babel = ["zh-N", "en-2"] + +[contact] +email = "chenkolei@gmail.com" +telegram = "Neo_Chen" +irc = "Neo_Chen" +mastodon = "@Neo_Chen@mastodon.xyz" +github = "Neo_Chen" + +[persona] +pgp = "D306BB628837043150CD1E42CA0957540FD996CD" diff --git a/entity/SUNNET b/entity/SUNNET deleted file mode 100644 index df0d2d7..0000000 --- a/entity/SUNNET +++ /dev/null @@ -1,13 +0,0 @@ -NAME="SUNNET" -DESC="" -CONTACT=( - "EMAIL:" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/SUNNET.toml b/entity/SUNNET.toml new file mode 100644 index 0000000..79b3fc6 --- /dev/null +++ b/entity/SUNNET.toml @@ -0,0 +1 @@ +name = "SUNNET" diff --git a/entity/Septs b/entity/Septs deleted file mode 100644 index fa76f99..0000000 --- a/entity/Septs +++ /dev/null @@ -1,13 +0,0 @@ -NAME="Septs" -DESC="" -CONTACT=( - "EMAIL:bgp@septs.email" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/Staph b/entity/Staph deleted file mode 100644 index 5ef685a..0000000 --- a/entity/Staph +++ /dev/null @@ -1,17 +0,0 @@ -NAME="Staph" -DESC="A programming prokaryotic organism" -CONTACT=( - "EMAIL: staph@aosc.io" - "TELEGRAM: @Staph" - "IRC: Staph_aureus" - "MASTODON:" - "GITHUB: StephDC" -) -BABEL=( - "zh-N" - "en-4" - "ja-2" - "es-1" - "fr-1" -) -AUTH="" diff --git a/entity/Staph.toml b/entity/Staph.toml new file mode 100644 index 0000000..b6111f0 --- /dev/null +++ b/entity/Staph.toml @@ -0,0 +1,9 @@ +name = "Staph" +description = "A programming prokaryotic organism" +babel = ["zh-N", "en-4", "ja-2", "es-1", "fr-1"] + +[contact] +email = "staph@aosc.io" +telegram = "Staph" +irc = "Staph_aureus" +github = "StephDC" diff --git a/entity/Yangfl b/entity/Yangfl deleted file mode 100644 index 7d29678..0000000 --- a/entity/Yangfl +++ /dev/null @@ -1,13 +0,0 @@ -NAME="Yangfl Network" -DESC="" -CONTACT=( - "EMAIL:" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/Yangfl.toml b/entity/Yangfl.toml new file mode 100644 index 0000000..bfc05b1 --- /dev/null +++ b/entity/Yangfl.toml @@ -0,0 +1 @@ +name = "Yangfl Network" diff --git a/entity/alanyhq b/entity/alanyhq deleted file mode 100644 index ca1bf27..0000000 --- a/entity/alanyhq +++ /dev/null @@ -1,14 +0,0 @@ -NAME="alanyhq" -DESC="" -CONTACT=( - "EMAIL:" - "TELEGRAM:@alanyhq" - "IRC:alanyhq" - "MASTODON:" - "GITHUB:" -) -BABEL=( - "zh-N" - "en-2" -) -AUTH="" diff --git a/entity/alanyhq.toml b/entity/alanyhq.toml new file mode 100644 index 0000000..269f93f --- /dev/null +++ b/entity/alanyhq.toml @@ -0,0 +1,5 @@ +name = "alanyhq" +babel = ["zh-N", "en-2"] + +[contact] +telegram = "alanyhq" diff --git a/entity/chenx97 b/entity/chenx97 deleted file mode 100644 index e05de6d..0000000 --- a/entity/chenx97 +++ /dev/null @@ -1,13 +0,0 @@ -NAME="chenx97" -DESC="" -CONTACT=( - "EMAIL:chenx97@gmail.com" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:chenx97" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/chenx97.toml b/entity/chenx97.toml new file mode 100644 index 0000000..a1b534b --- /dev/null +++ b/entity/chenx97.toml @@ -0,0 +1,5 @@ +name = "chenx97" + +[contact] +email = "chenx97@gmail.com" +github = "chenx97" diff --git a/entity/frank b/entity/frank deleted file mode 100644 index 64d8408..0000000 --- a/entity/frank +++ /dev/null @@ -1,13 +0,0 @@ -NAME="frank" -DESC="" -CONTACT=( - "EMAIL:" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/frank.toml b/entity/frank.toml new file mode 100644 index 0000000..be67da4 --- /dev/null +++ b/entity/frank.toml @@ -0,0 +1 @@ +name = "frank" diff --git a/entity/leedagee b/entity/leedagee deleted file mode 100644 index 9f3b587..0000000 --- a/entity/leedagee +++ /dev/null @@ -1,13 +0,0 @@ -NAME="leedagee" -DESC="" -CONTACT=( - "EMAIL:leedageea@gmail.com" - "TELEGRAM:@leedagee" - "IRC:lizr" - "GITHUB:leedagee" -) -BABEL=( - "zh-N" - "en-2" -) -AUTH="PGP:47627D2288B20CC033C7B7D72D83E4E89C15DA36" diff --git a/entity/leedagee.toml b/entity/leedagee.toml new file mode 100644 index 0000000..a61df64 --- /dev/null +++ b/entity/leedagee.toml @@ -0,0 +1,8 @@ +name = "leedagee" +babel = ["zh-N", "zh-hans-N", "zh-hant-3", "en-2", "ja-0"] + +[contact] +email = "leedageea@gmail.com" +telegram = "leedagee" +irc = "lizr" +github = "leedagee" diff --git a/entity/licson b/entity/licson deleted file mode 100644 index 4d0806d..0000000 --- a/entity/licson +++ /dev/null @@ -1,13 +0,0 @@ -NAME="licson" -DESC="" -CONTACT=( - "EMAIL:admin@licson.net" - "TELEGRAM:licson" - "IRC:licson" - "MASTODON:" - "GITHUB:licson0729" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/licson.toml b/entity/licson.toml new file mode 100644 index 0000000..e0953cf --- /dev/null +++ b/entity/licson.toml @@ -0,0 +1,6 @@ +name = "licson" + +[contact] +email = "admin@licson.net" +telegram = "licson" +github = "licson0729" diff --git a/entity/santost12 b/entity/santost12 deleted file mode 100644 index e0a429a..0000000 --- a/entity/santost12 +++ /dev/null @@ -1,13 +0,0 @@ -NAME="santost12" -DESC="" -CONTACT=( - "EMAIL:tylersantos12@protonmail.com" - "TELEGRAM:" - "IRC:" - "MASTODON:" - "GITHUB:santost12" -) -BABEL=( - "" -) -AUTH="" diff --git a/entity/santost12.toml b/entity/santost12.toml new file mode 100644 index 0000000..1f4d2b5 --- /dev/null +++ b/entity/santost12.toml @@ -0,0 +1,5 @@ +name = "santost12" + +[contact] +email = "tylersantos12@protonmail.com" +github = "santost12" diff --git a/entity/septs.toml b/entity/septs.toml new file mode 100644 index 0000000..291935d --- /dev/null +++ b/entity/septs.toml @@ -0,0 +1,6 @@ +name = "septs" + +[contact] +email = "bgp@septs.email" +telegram = "septs" +github = "septs" diff --git a/node/Icecat-GroupAccessNetwork b/node/Icecat-GroupAccessNetwork deleted file mode 100644 index 32df470..0000000 --- a/node/Icecat-GroupAccessNetwork +++ /dev/null @@ -1,6 +0,0 @@ -ASN="4201270005" -DESC="" -IP=( - "10.127.233.1/24" - "fd10:127:233:1c3c::1/64" -) diff --git a/node/Icecat.toml b/node/Icecat.toml new file mode 100644 index 0000000..2847f79 --- /dev/null +++ b/node/Icecat.toml @@ -0,0 +1,3 @@ +[Icecat-GroupAccessNetwork] +asn = 4201270005 +cidr = ["10.127.233.1/24", "fd10:127:233:1c3c::1/64"] diff --git a/node/James58899 b/node/James58899 deleted file mode 100644 index 754ed68..0000000 --- a/node/James58899 +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270015" -DESC="" -IP=( -) diff --git a/node/James58899.toml b/node/James58899.toml new file mode 100644 index 0000000..c6f8254 --- /dev/null +++ b/node/James58899.toml @@ -0,0 +1,2 @@ +[James58899] +asn = 4201270015 diff --git a/node/JerryXiao b/node/JerryXiao deleted file mode 100644 index 43192a5..0000000 --- a/node/JerryXiao +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270006" -DESC="" -IP=( - "10.127.x.x/x" -) diff --git a/node/JerryXiao-HK1 b/node/JerryXiao-HK1 deleted file mode 100644 index 9db28da..0000000 --- a/node/JerryXiao-HK1 +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270006" -DESC="" -IP=( -) diff --git a/node/JerryXiao-HK2 b/node/JerryXiao-HK2 deleted file mode 100644 index 9db28da..0000000 --- a/node/JerryXiao-HK2 +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270006" -DESC="" -IP=( -) diff --git a/node/JerryXiao-SH1 b/node/JerryXiao-SH1 deleted file mode 100644 index 9db28da..0000000 --- a/node/JerryXiao-SH1 +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270006" -DESC="" -IP=( -) diff --git a/node/JerryXiao.toml b/node/JerryXiao.toml new file mode 100644 index 0000000..8483665 --- /dev/null +++ b/node/JerryXiao.toml @@ -0,0 +1,11 @@ +[JerryXiao] +asn = 4201270006 + +[JerryXiao-SH1] +asn = 4201270006 + +[JerryXiao-HK1] +asn = 4201270006 + +[JerryXiao-HK2] +asn = 4201270006 diff --git a/node/LINE-NZ-AU01 b/node/LINE-NZ-AU01 deleted file mode 100644 index aff1ee2..0000000 --- a/node/LINE-NZ-AU01 +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270011" -DESC="LINE-NZ Cloud" -IP=( - "10.127.22.9/29" -) diff --git a/node/LINE-NZ-NZ01 b/node/LINE-NZ-NZ01 deleted file mode 100644 index e1dbd5f..0000000 --- a/node/LINE-NZ-NZ01 +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270011" -DESC="LINE-NZ Home" -IP=( - "10.127.22.1/29" -) diff --git a/node/LINE-NZ.toml b/node/LINE-NZ.toml new file mode 100644 index 0000000..2b3b003 --- /dev/null +++ b/node/LINE-NZ.toml @@ -0,0 +1,9 @@ +[LINE-NZ-NZ01] +asn = 4201270011 +description = "LINE-NZ Home" +cidr = ["10.127.22.1/29"] + +[LINE-NZ-AU01] +asn = 4201270011 +description = "LINE-NZ Cloud" +cidr = ["10.127.22.9/29"] diff --git a/node/LanTian b/node/LanTian deleted file mode 100644 index c4b07a8..0000000 --- a/node/LanTian +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270010" -DESC="" -IP=( -) diff --git a/node/LanTian.toml b/node/LanTian.toml new file mode 100644 index 0000000..0c166a5 --- /dev/null +++ b/node/LanTian.toml @@ -0,0 +1,2 @@ +[LanTian] +asn = 4201270010 diff --git a/node/MagicNeko-HK01 b/node/MagicNeko-HK01 deleted file mode 100644 index 2eed6ac..0000000 --- a/node/MagicNeko-HK01 +++ /dev/null @@ -1,6 +0,0 @@ -ASN="4201270008" -DESC="Magicneko IX LAN interconnection" -IP=( - "10.127.4.10/24" - "fd10:127:0233:7170:2021::10.127.4.10/80" -) diff --git a/node/MagicNeko-JP03 b/node/MagicNeko-JP03 deleted file mode 100644 index d15a293..0000000 --- a/node/MagicNeko-JP03 +++ /dev/null @@ -1,6 +0,0 @@ -ASN="4201270008" -DESC="MagicNeko IX LAN interconnection" -IP=( - "10.127.4.15/24" - "fd10:127:0233:7170:2021::10.127.4.15/80" -) diff --git a/node/MagicNeko-RU01 b/node/MagicNeko-RU01 deleted file mode 100644 index f61598b..0000000 --- a/node/MagicNeko-RU01 +++ /dev/null @@ -1,6 +0,0 @@ -ASN="4201270008" -DESC="Magicneko IX LAN interconnection" -IP=( - "10.127.4.14/24" - "fd10:127:0233:7170:2021::10.127.4.14/80" -) diff --git a/node/MagicNeko.toml b/node/MagicNeko.toml new file mode 100644 index 0000000..99c616f --- /dev/null +++ b/node/MagicNeko.toml @@ -0,0 +1,14 @@ +[MagicNeko-HK01] +asn = 4201270008 +description = "Magicneko IX LAN interconnection" +cidr = ["10.127.4.10/24", "fd10:127:0233:7170:2021::10.127.4.10/80"] + +[MagicNeko-RU01] +asn = 4201270008 +description = "Magicneko IX LAN interconnection" +cidr = ["10.127.4.14/24", "fd10:127:0233:7170:2021::10.127.4.14/80"] + +[MagicNeko-JP03] +asn = 4201270008 +description = "MagicNeko IX LAN interconnection" +cidr = ["10.127.4.15/24", "fd10:127:0233:7170:2021::10.127.4.15/80"] diff --git a/node/Ndoskrnl-CN01 b/node/Ndoskrnl-CN01 deleted file mode 100644 index 2ab72ac..0000000 --- a/node/Ndoskrnl-CN01 +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270013" -DESC="Ndoskrnl's first node" -IP=( - "10.127.13.2/24" -) diff --git a/node/Ndoskrnl-US01 b/node/Ndoskrnl-US01 deleted file mode 100644 index b2d1b2c..0000000 --- a/node/Ndoskrnl-US01 +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270013" -DESC="Ndoskrnl's first node" -IP=( - "10.127.13.1/24" -) diff --git a/node/Ndoskrnl.toml b/node/Ndoskrnl.toml new file mode 100644 index 0000000..8268328 --- /dev/null +++ b/node/Ndoskrnl.toml @@ -0,0 +1,9 @@ +[Ndoskrnl-US01] +asn = 4201270013 +description = "Ndoskrnls first node" +cidr = ["10.127.13.1/24"] + +[Ndoskrnl-CN01] +asn = 4201270013 +description = "Ndoskrnls first node" +cidr = ["10.127.13.2/24"] diff --git a/node/NeoPDP-11 b/node/NeoPDP-11 deleted file mode 100644 index bc5e675..0000000 --- a/node/NeoPDP-11 +++ /dev/null @@ -1,7 +0,0 @@ -ASN="4201270000" -DESC="" -IP=( - "10.127.1.1/24" - "10.127.254.1/24" - "10.127.255.1/24" -) diff --git a/node/NeoSystem b/node/NeoSystem deleted file mode 100644 index 0f1cd75..0000000 --- a/node/NeoSystem +++ /dev/null @@ -1,6 +0,0 @@ -ASN="4201270000" -DESC="" -IP=( - "10.127.1.80/24" - "10.127.2.1/24" -) diff --git a/node/NeoVAX b/node/NeoVAX deleted file mode 100644 index 148e772..0000000 --- a/node/NeoVAX +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270000" -DESC="" -IP=( -) diff --git a/node/Neo_Chen.toml b/node/Neo_Chen.toml new file mode 100644 index 0000000..06fadbc --- /dev/null +++ b/node/Neo_Chen.toml @@ -0,0 +1,17 @@ +[NeoPDP-11] +asn = 4201270000 +cidr = ["10.127.1.1/24", "10.127.254.1/24", "10.127.255.1/24"] + +[NeoSystem] +asn = 4201270000 +cidr = ["10.127.1.80/24", "10.127.2.1/24"] + +[NeoVAX] +asn = 4201270000 + +[pan] +asn = 4201270000 +cidr = ["10.127.3.1/24"] + +[ucbvax] +asn = 4201270000 diff --git a/node/SUNNET b/node/SUNNET deleted file mode 100644 index 84e693c..0000000 --- a/node/SUNNET +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4242423088" -DESC="" -IP=( -) diff --git a/node/SUNNET.toml b/node/SUNNET.toml new file mode 100644 index 0000000..e0d41b1 --- /dev/null +++ b/node/SUNNET.toml @@ -0,0 +1,2 @@ +[SUNNET] +asn = 4242423088 diff --git a/node/caasih b/node/caasih deleted file mode 100644 index 148e772..0000000 --- a/node/caasih +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270000" -DESC="" -IP=( -) diff --git a/node/caasih.toml b/node/caasih.toml new file mode 100644 index 0000000..97a8596 --- /dev/null +++ b/node/caasih.toml @@ -0,0 +1,2 @@ +[caasih] +asn = 4201270000 diff --git a/node/chenx97 b/node/chenx97 deleted file mode 100644 index be88d85..0000000 --- a/node/chenx97 +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270003" -DESC="" -IP=( -) diff --git a/node/chenx97.toml b/node/chenx97.toml new file mode 100644 index 0000000..552390c --- /dev/null +++ b/node/chenx97.toml @@ -0,0 +1,2 @@ +[chenx97] +asn = 4201270003 diff --git a/node/cklvax b/node/cklvax deleted file mode 100644 index 7d06530..0000000 --- a/node/cklvax +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270000" -DESC="" -IP=( - "10.127.1.40/24" -) diff --git a/node/cklvax.toml b/node/cklvax.toml new file mode 100644 index 0000000..f4891ad --- /dev/null +++ b/node/cklvax.toml @@ -0,0 +1,3 @@ +[cklvax] +asn = 4201270000 +cidr = ["10.127.1.40/24"] diff --git a/node/dfceaef b/node/dfceaef deleted file mode 100644 index c9eb510..0000000 --- a/node/dfceaef +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4242420140" -DESC="" -IP=( -) diff --git a/node/dfceaef.toml b/node/dfceaef.toml new file mode 100644 index 0000000..c64b289 --- /dev/null +++ b/node/dfceaef.toml @@ -0,0 +1,2 @@ +[dfceaef] +asn = 4242420140 diff --git a/node/frank-hsinchu b/node/frank-hsinchu deleted file mode 100644 index 1432605..0000000 --- a/node/frank-hsinchu +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270004" -DESC="" -IP=( -) diff --git a/node/frank.toml b/node/frank.toml new file mode 100644 index 0000000..3f00853 --- /dev/null +++ b/node/frank.toml @@ -0,0 +1,2 @@ +[frank-hsinchu] +asn = 4201270004 diff --git a/node/leedagee b/node/leedagee deleted file mode 100644 index d478866..0000000 --- a/node/leedagee +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270014" -DESC="" -IP=( -) diff --git a/node/leedagee.toml b/node/leedagee.toml new file mode 100644 index 0000000..fc7ef48 --- /dev/null +++ b/node/leedagee.toml @@ -0,0 +1,2 @@ +[leedagee] +asn = 4201270014 diff --git a/node/megumiLHS b/node/megumiLHS deleted file mode 100644 index f40f182..0000000 --- a/node/megumiLHS +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4242421037" -DESC="" -IP=( -) diff --git a/node/megumiLHS.toml b/node/megumiLHS.toml new file mode 100644 index 0000000..b36ceb2 --- /dev/null +++ b/node/megumiLHS.toml @@ -0,0 +1,2 @@ +[megumiLHS] +asn = 4242421037 diff --git a/node/pan b/node/pan deleted file mode 100644 index 9ee2974..0000000 --- a/node/pan +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270000" -DESC="" -IP=( - "10.127.3.1/24" -) diff --git a/node/santost12 b/node/santost12 deleted file mode 100644 index 7cbbb67..0000000 --- a/node/santost12 +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270009" -DESC="" -IP=( -) diff --git a/node/santost12.toml b/node/santost12.toml new file mode 100644 index 0000000..2a7ce0e --- /dev/null +++ b/node/santost12.toml @@ -0,0 +1,2 @@ +[santost12] +asn = 4201270009 diff --git a/node/septs b/node/septs deleted file mode 100644 index ecfc372..0000000 --- a/node/septs +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270001" -DESC="" -IP=( -) diff --git a/node/septs.toml b/node/septs.toml new file mode 100644 index 0000000..d8c9966 --- /dev/null +++ b/node/septs.toml @@ -0,0 +1,2 @@ +[septs] +asn = 4201270001 diff --git a/node/staph b/node/staph deleted file mode 100644 index e5afb33..0000000 --- a/node/staph +++ /dev/null @@ -1,5 +0,0 @@ -ASN="4201270007" -DESC="Home of S. aureus in Amsterdam" -IP=( - "10.127.8.185/29" -) diff --git a/node/staph.toml b/node/staph.toml new file mode 100644 index 0000000..d96b3ec --- /dev/null +++ b/node/staph.toml @@ -0,0 +1,4 @@ +[staph] +asn = 4201270007 +description = "Home of S. aureus in Amsterdam" +cidr = ["10.127.8.185/29"] diff --git a/node/ucbvax b/node/ucbvax deleted file mode 100644 index 148e772..0000000 --- a/node/ucbvax +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270000" -DESC="" -IP=( -) diff --git a/node/yhi-h b/node/yhi-h deleted file mode 100644 index 5ed897e..0000000 --- a/node/yhi-h +++ /dev/null @@ -1,4 +0,0 @@ -ASN="4201270012" -DESC="" -IP=( -) diff --git a/node/yhi-h.toml b/node/yhi-h.toml new file mode 100644 index 0000000..77c68bd --- /dev/null +++ b/node/yhi-h.toml @@ -0,0 +1,2 @@ +[yhi-h] +asn = 4201270012 diff --git a/peer/JerryXiao-HK1.toml b/peer/JerryXiao-HK1.toml new file mode 100644 index 0000000..4b17104 --- /dev/null +++ b/peer/JerryXiao-HK1.toml @@ -0,0 +1 @@ +to-peer = ["JerryXiao-HK2"] diff --git a/peer/JerryXiao-HK1~JerryXiao-HK2 b/peer/JerryXiao-HK1~JerryXiao-HK2 deleted file mode 100644 index 3837914..0000000 --- a/peer/JerryXiao-HK1~JerryXiao-HK2 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/JerryXiao-SH1.toml b/peer/JerryXiao-SH1.toml new file mode 100644 index 0000000..b511eed --- /dev/null +++ b/peer/JerryXiao-SH1.toml @@ -0,0 +1 @@ +to-peer = ["JerryXiao-HK1"] diff --git a/peer/JerryXiao-SH1~JerryXiao-HK1 b/peer/JerryXiao-SH1~JerryXiao-HK1 deleted file mode 100644 index 3837914..0000000 --- a/peer/JerryXiao-SH1~JerryXiao-HK1 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/JerryXiao.toml b/peer/JerryXiao.toml new file mode 100644 index 0000000..2aa49ee --- /dev/null +++ b/peer/JerryXiao.toml @@ -0,0 +1 @@ +to-peer = ["JerryXiao-HK1", "JerryXiao-SH1", "LanTian", "dfceaef", "ucbvax"] diff --git a/peer/JerryXiao~JerryXiao-HK1 b/peer/JerryXiao~JerryXiao-HK1 deleted file mode 100644 index 3837914..0000000 --- a/peer/JerryXiao~JerryXiao-HK1 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/JerryXiao~JerryXiao-SH1 b/peer/JerryXiao~JerryXiao-SH1 deleted file mode 100644 index 3837914..0000000 --- a/peer/JerryXiao~JerryXiao-SH1 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/JerryXiao~LanTian b/peer/JerryXiao~LanTian deleted file mode 100644 index 3837914..0000000 --- a/peer/JerryXiao~LanTian +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/JerryXiao~dfceaef b/peer/JerryXiao~dfceaef deleted file mode 100644 index 3837914..0000000 --- a/peer/JerryXiao~dfceaef +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/JerryXiao~ucbvax b/peer/JerryXiao~ucbvax deleted file mode 100644 index 3837914..0000000 --- a/peer/JerryXiao~ucbvax +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-HK01.toml b/peer/MagicNeko-HK01.toml new file mode 100644 index 0000000..1a43d55 --- /dev/null +++ b/peer/MagicNeko-HK01.toml @@ -0,0 +1 @@ +to-peer = ["Icecat-GroupAccessNetwork", "SUNNET"] diff --git a/peer/MagicNeko-HK01~Icecat-GroupAccessNetwork b/peer/MagicNeko-HK01~Icecat-GroupAccessNetwork deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-HK01~Icecat-GroupAccessNetwork +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-HK01~SUNNET b/peer/MagicNeko-HK01~SUNNET deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-HK01~SUNNET +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-JP03.toml b/peer/MagicNeko-JP03.toml new file mode 100644 index 0000000..afb7e30 --- /dev/null +++ b/peer/MagicNeko-JP03.toml @@ -0,0 +1,8 @@ +to-peer = [ + "JerryXiao", + "Ndoskrnl-US01", + "chenx97", + "frank-hsinchu", + "megumiLHS", + "santost12", +] diff --git a/peer/MagicNeko-JP03~JerryXiao b/peer/MagicNeko-JP03~JerryXiao deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-JP03~JerryXiao +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-JP03~Ndoskrnl-US01 b/peer/MagicNeko-JP03~Ndoskrnl-US01 deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-JP03~Ndoskrnl-US01 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-JP03~chenx97 b/peer/MagicNeko-JP03~chenx97 deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-JP03~chenx97 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-JP03~frank-hsinchu b/peer/MagicNeko-JP03~frank-hsinchu deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-JP03~frank-hsinchu +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-JP03~megumiLHS b/peer/MagicNeko-JP03~megumiLHS deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-JP03~megumiLHS +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/MagicNeko-JP03~santost12 b/peer/MagicNeko-JP03~santost12 deleted file mode 100644 index 3837914..0000000 --- a/peer/MagicNeko-JP03~santost12 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/Ndoskrnl-US01.toml b/peer/Ndoskrnl-US01.toml new file mode 100644 index 0000000..b1fcabb --- /dev/null +++ b/peer/Ndoskrnl-US01.toml @@ -0,0 +1 @@ +to-peer = ["Ndoskrnl-CN01"] diff --git a/peer/Ndoskrnl-US01~Ndoskrnl-CN01 b/peer/Ndoskrnl-US01~Ndoskrnl-CN01 deleted file mode 100644 index 3837914..0000000 --- a/peer/Ndoskrnl-US01~Ndoskrnl-CN01 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/NeoSystem.toml b/peer/NeoSystem.toml new file mode 100644 index 0000000..ba7ae8c --- /dev/null +++ b/peer/NeoSystem.toml @@ -0,0 +1 @@ +to-peer = ["NeoVAX"] diff --git a/peer/NeoSystem~NeoVAX b/peer/NeoSystem~NeoVAX deleted file mode 100644 index 3837914..0000000 --- a/peer/NeoSystem~NeoVAX +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/caasih.toml b/peer/caasih.toml new file mode 100644 index 0000000..48c23d8 --- /dev/null +++ b/peer/caasih.toml @@ -0,0 +1 @@ +to-peer = ["NeoPDP-11", "staph", "ucbvax"] diff --git a/peer/caasih~NeoPDP-11 b/peer/caasih~NeoPDP-11 deleted file mode 100644 index 3837914..0000000 --- a/peer/caasih~NeoPDP-11 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/caasih~staph b/peer/caasih~staph deleted file mode 100644 index 3837914..0000000 --- a/peer/caasih~staph +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/caasih~ucbvax b/peer/caasih~ucbvax deleted file mode 100644 index 3837914..0000000 --- a/peer/caasih~ucbvax +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/cklvax.toml b/peer/cklvax.toml new file mode 100644 index 0000000..76bd223 --- /dev/null +++ b/peer/cklvax.toml @@ -0,0 +1 @@ +to-peer = ["NeoSystem"] diff --git a/peer/cklvax~NeoSystem b/peer/cklvax~NeoSystem deleted file mode 100644 index 3837914..0000000 --- a/peer/cklvax~NeoSystem +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/pan.toml b/peer/pan.toml new file mode 100644 index 0000000..1c8cacf --- /dev/null +++ b/peer/pan.toml @@ -0,0 +1 @@ +to-peer = ["MagicNeko-JP03", "NeoPDP-11", "NeoSystem"] diff --git a/peer/pan~MagicNeko-JP03 b/peer/pan~MagicNeko-JP03 deleted file mode 100644 index 3837914..0000000 --- a/peer/pan~MagicNeko-JP03 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/pan~NeoPDP-11 b/peer/pan~NeoPDP-11 deleted file mode 100644 index 3837914..0000000 --- a/peer/pan~NeoPDP-11 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/pan~NeoSystem b/peer/pan~NeoSystem deleted file mode 100644 index 3837914..0000000 --- a/peer/pan~NeoSystem +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs.toml b/peer/septs.toml new file mode 100644 index 0000000..5daafb7 --- /dev/null +++ b/peer/septs.toml @@ -0,0 +1,10 @@ +to-peer = [ + "James58899", + "JerryXiao", + "LanTian", + "MagicNeko-JP03", + "MagicNeko-RU01", + "frank-hsinchu", + "megumiLHS", + "ucbvax", +] diff --git a/peer/septs~James58899 b/peer/septs~James58899 deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~James58899 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs~JerryXiao b/peer/septs~JerryXiao deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~JerryXiao +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs~LanTian b/peer/septs~LanTian deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~LanTian +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs~MagicNeko-JP03 b/peer/septs~MagicNeko-JP03 deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~MagicNeko-JP03 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs~MagicNeko-RU01 b/peer/septs~MagicNeko-RU01 deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~MagicNeko-RU01 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs~frank-hsinchu b/peer/septs~frank-hsinchu deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~frank-hsinchu +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs~megumiLHS b/peer/septs~megumiLHS deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~megumiLHS +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/septs~ucbvax b/peer/septs~ucbvax deleted file mode 100644 index 3837914..0000000 --- a/peer/septs~ucbvax +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/staph.toml b/peer/staph.toml new file mode 100644 index 0000000..99bb6ec --- /dev/null +++ b/peer/staph.toml @@ -0,0 +1 @@ +to-peer = ["MagicNeko-RU01", "santost12", "septs"] diff --git a/peer/staph~MagicNeko-RU01 b/peer/staph~MagicNeko-RU01 deleted file mode 100644 index 3837914..0000000 --- a/peer/staph~MagicNeko-RU01 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/staph~santost12 b/peer/staph~santost12 deleted file mode 100644 index 3837914..0000000 --- a/peer/staph~santost12 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/staph~septs b/peer/staph~septs deleted file mode 100644 index 3837914..0000000 --- a/peer/staph~septs +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/ucbvax.toml b/peer/ucbvax.toml new file mode 100644 index 0000000..52130df --- /dev/null +++ b/peer/ucbvax.toml @@ -0,0 +1,9 @@ +to-peer = [ + "MagicNeko-HK01", + "NeoPDP-11", + "NeoSystem", + "chenx97", + "megumiLHS", + "pan", + "santost12", +] diff --git a/peer/ucbvax~MagicNeko-HK01 b/peer/ucbvax~MagicNeko-HK01 deleted file mode 100644 index 3837914..0000000 --- a/peer/ucbvax~MagicNeko-HK01 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/ucbvax~NeoPDP-11 b/peer/ucbvax~NeoPDP-11 deleted file mode 100644 index 3837914..0000000 --- a/peer/ucbvax~NeoPDP-11 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/ucbvax~NeoSystem b/peer/ucbvax~NeoSystem deleted file mode 100644 index 3837914..0000000 --- a/peer/ucbvax~NeoSystem +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/ucbvax~chenx97 b/peer/ucbvax~chenx97 deleted file mode 100644 index 3837914..0000000 --- a/peer/ucbvax~chenx97 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/ucbvax~megumiLHS b/peer/ucbvax~megumiLHS deleted file mode 100644 index 3837914..0000000 --- a/peer/ucbvax~megumiLHS +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/ucbvax~pan b/peer/ucbvax~pan deleted file mode 100644 index 3837914..0000000 --- a/peer/ucbvax~pan +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/peer/ucbvax~santost12 b/peer/ucbvax~santost12 deleted file mode 100644 index 3837914..0000000 --- a/peer/ucbvax~santost12 +++ /dev/null @@ -1 +0,0 @@ -DESC="" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8bb6ee5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] +line-length = 88 diff --git a/route/10.127.0.0,24 b/route/10.127.0.0,24 deleted file mode 100644 index 9b4afee..0000000 --- a/route/10.127.0.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="RESERVED" -DESC="Reserved" -ASN="4201270000" diff --git a/route/10.127.1.0,24 b/route/10.127.1.0,24 deleted file mode 100644 index e5cde16..0000000 --- a/route/10.127.1.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="CROOM" -DESC="LAN at school" -ASN="4201270000" diff --git a/route/10.127.10.0,24 b/route/10.127.10.0,24 deleted file mode 100644 index 2e9c465..0000000 --- a/route/10.127.10.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Lan Tian LAN" -DESC="For LAN" -ASN="4201270010" diff --git a/route/10.127.11.0,24 b/route/10.127.11.0,24 deleted file mode 100644 index 1500028..0000000 --- a/route/10.127.11.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="SUNNET" -DESC="For SUN" -ASN="4242423088" diff --git a/route/10.127.12.0,24 b/route/10.127.12.0,24 deleted file mode 100644 index dd0abaf..0000000 --- a/route/10.127.12.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="dfceaef NET" -DESC="For Yangfl Network" -ASN="4242420140" diff --git a/route/10.127.13.0,24 b/route/10.127.13.0,24 deleted file mode 100644 index 7e69f3e..0000000 --- a/route/10.127.13.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Ndoskrnl's LAN" -DESC="For devices which being connected locally to Ndoskrnl's Master Router" -ASN="4201270013" diff --git a/route/10.127.14.0,23 b/route/10.127.14.0,23 deleted file mode 100644 index 61095a7..0000000 --- a/route/10.127.14.0,23 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="LICSON-NET-SUBALLOC-1" -DESC="" -ASN="134098" diff --git a/route/10.127.2.0,24 b/route/10.127.2.0,24 deleted file mode 100644 index 9c9a288..0000000 --- a/route/10.127.2.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="NeoSystem" -DESC="" -ASN="4201270000" diff --git a/route/10.127.22.0,29 b/route/10.127.22.0,29 deleted file mode 100644 index c21f26f..0000000 --- a/route/10.127.22.0,29 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="LINE-NZ" -DESC="For home" -ASN="4201270011" diff --git a/route/10.127.22.8,29 b/route/10.127.22.8,29 deleted file mode 100644 index e41fc64..0000000 --- a/route/10.127.22.8,29 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="LINE-NZ" -DESC="For cloud" -ASN="4201270011" diff --git a/route/10.127.23.0,29 b/route/10.127.23.0,29 deleted file mode 100644 index d6dec21..0000000 --- a/route/10.127.23.0,29 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="leedagee" -DESC="leedagee" -ASN="4201270014" diff --git a/route/10.127.233.0,24 b/route/10.127.233.0,24 deleted file mode 100644 index bb3cc80..0000000 --- a/route/10.127.233.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Icecat-Mobile-devices" -DESC="For Mobile device internal network segment for testing connectivity quality, No SLA(=172.24.5.0/24)" -ASN="4201270005" diff --git a/route/10.127.255.1,32 b/route/10.127.255.1,32 deleted file mode 100644 index 8857ce3..0000000 --- a/route/10.127.255.1,32 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="LO" -NAME="NeoPDP-11" -DESC="FreeBSD/frr" -ASN="4201270000" diff --git a/route/10.127.255.117,32 b/route/10.127.255.117,32 deleted file mode 100644 index 61a704a..0000000 --- a/route/10.127.255.117,32 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="LO" -NAME="magicneko-tw" -DESC="magicneko-tw/frr" -ASN="4201270008" diff --git a/route/10.127.255.2,32 b/route/10.127.255.2,32 deleted file mode 100644 index d0d1864..0000000 --- a/route/10.127.255.2,32 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="LO" -NAME="ucbvax" -DESC="Arch Linux/frr" -ASN="4201270000" diff --git a/route/10.127.255.4,32 b/route/10.127.255.4,32 deleted file mode 100644 index 6c3b0f0..0000000 --- a/route/10.127.255.4,32 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="LO" -NAME="pan" -DESC="Arch Linux/frr" -ASN="4201270000" diff --git a/route/10.127.255.53,32 b/route/10.127.255.53,32 deleted file mode 100644 index 7d308e0..0000000 --- a/route/10.127.255.53,32 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="LO" -NAME="JerryXiao-Anycast" -DESC="Anycast Recursive DNS" -ASN="4201270006" diff --git a/route/10.127.255.56,32 b/route/10.127.255.56,32 deleted file mode 100644 index 710fdca..0000000 --- a/route/10.127.255.56,32 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="LO" -NAME="frank-hsinchu-1" -DESC="Ubuntu/bird" -ASN="4201270004" diff --git a/route/10.127.255.80,32 b/route/10.127.255.80,32 deleted file mode 100644 index 54e1819..0000000 --- a/route/10.127.255.80,32 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="LO" -NAME="NeoSystem" -DESC="Arch Linux/frr" -ASN="4201270000" diff --git a/route/10.127.3.0,24 b/route/10.127.3.0,24 deleted file mode 100644 index 89e0143..0000000 --- a/route/10.127.3.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="pan hub" -DESC="For non-multihome connection in Taiwan" -ASN="4201270000" diff --git a/route/10.127.4.0,24 b/route/10.127.4.0,24 deleted file mode 100644 index d9cd897..0000000 --- a/route/10.127.4.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Icecat-Explosion" -DESC="For Magicneko Explosion Network Interworking address, No SLA" -ASN="4201270008" diff --git a/route/10.127.41.0,24 b/route/10.127.41.0,24 deleted file mode 100644 index d21acec..0000000 --- a/route/10.127.41.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Septs IX IPv4 Pool" -DESC="" -ASN="4201270001" diff --git a/route/10.127.5.0,28 b/route/10.127.5.0,28 deleted file mode 100644 index b0bd832..0000000 --- a/route/10.127.5.0,28 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE=SUBNET -NAME="yhi-h" -DESC="Yhi Interconnect H" -ASN="4201270012" diff --git a/route/10.127.56.0,24 b/route/10.127.56.0,24 deleted file mode 100644 index b5ba205..0000000 --- a/route/10.127.56.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="frank-hsinchu" -DESC="For home" -ASN="4201270004" diff --git a/route/10.127.69.0,29 b/route/10.127.69.0,29 deleted file mode 100644 index da74626..0000000 --- a/route/10.127.69.0,29 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="santost12" -DESC="For home" -ASN="4201270009" diff --git a/route/10.127.8.0,26 b/route/10.127.8.0,26 deleted file mode 100644 index 04b603d..0000000 --- a/route/10.127.8.0,26 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="LibreHouse" -DESC="For infrastratures in our network" -ASN="4242421037" diff --git a/route/10.127.8.184,29 b/route/10.127.8.184,29 deleted file mode 100644 index 0ec7caa..0000000 --- a/route/10.127.8.184,29 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="StaphNet" -DESC="For Staph-infected equipments around the world" -ASN="4201270007" diff --git a/route/10.127.8.192,26 b/route/10.127.8.192,26 deleted file mode 100644 index 91d8989..0000000 --- a/route/10.127.8.192,26 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="JerryXiao-Infrastructure" -DESC="For cloud instances" -ASN="4201270006" diff --git a/route/10.127.9.0,24 b/route/10.127.9.0,24 deleted file mode 100644 index 3f3399b..0000000 --- a/route/10.127.9.0,24 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="JerryXiao-Home" -DESC="For home" -ASN="4201270006" diff --git a/route/AS134098.toml b/route/AS134098.toml new file mode 100644 index 0000000..352454f --- /dev/null +++ b/route/AS134098.toml @@ -0,0 +1,3 @@ +["10.127.14.0/23"] +type = "subnet" +name = "LICSON-NET-SUBALLOC-1" diff --git a/route/AS4201270000.toml b/route/AS4201270000.toml new file mode 100644 index 0000000..a1317d2 --- /dev/null +++ b/route/AS4201270000.toml @@ -0,0 +1,43 @@ +["10.127.0.0/24"] +type = "subnet" +name = "RESERVED" +description = "Reserved" + +["10.127.1.0/24"] +type = "subnet" +name = "CROOM" +description = "LAN at school" + +["10.127.2.0/24"] +type = "subnet" +name = "NeoSystem" + +["10.127.3.0/24"] +type = "subnet" +name = "pan hub" +description = "For non-multihome connection in Taiwan" + +["10.127.255.1/32"] +type = "loopback" +name = "NeoPDP-11" +description = "FreeBSD/frr" + +["10.127.255.2/32"] +type = "loopback" +name = "ucbvax" +description = "Arch Linux/frr" + +["10.127.255.4/32"] +type = "loopback" +name = "pan" +description = "Arch Linux/frr" + +["10.127.255.80/32"] +type = "loopback" +name = "NeoSystem" +description = "Arch Linux/frr" + +["fd10:127:5f37:59df::/64"] +type = "subnet" +name = "NeoNetwork Origin" +description = "Neo_Chens Network" diff --git a/route/AS4201270001.toml b/route/AS4201270001.toml new file mode 100644 index 0000000..9113cbe --- /dev/null +++ b/route/AS4201270001.toml @@ -0,0 +1,7 @@ +["10.127.41.0/24"] +type = "subnet" +name = "Septs IX IPv4 Pool" + +["fd10:127:41::/48"] +type = "subnet" +name = "Septs IX IPv6 Pool" diff --git a/route/AS4201270004.toml b/route/AS4201270004.toml new file mode 100644 index 0000000..d11dd71 --- /dev/null +++ b/route/AS4201270004.toml @@ -0,0 +1,9 @@ +["10.127.56.0/24"] +type = "subnet" +name = "frank-hsinchu" +description = "For home" + +["10.127.255.56/32"] +type = "loopback" +name = "frank-hsinchu-1" +description = "Ubuntu/bird" diff --git a/route/AS4201270005.toml b/route/AS4201270005.toml new file mode 100644 index 0000000..5f351cb --- /dev/null +++ b/route/AS4201270005.toml @@ -0,0 +1,10 @@ +["10.127.233.0/24"] +type = "subnet" +name = "Icecat-Mobile-devices" +description = "For Mobile device internal network segment for testing connectivity quality, No SLA(=172.24.5.0/24)" + +["fd10:127:0233:1c3c::/64"] +type = "subnet" +name = "icecat" +description = "NextMoe Radvd IPv6 Address" +supernet = "fd10:127:0233::/48" diff --git a/route/AS4201270006.toml b/route/AS4201270006.toml new file mode 100644 index 0000000..d018061 --- /dev/null +++ b/route/AS4201270006.toml @@ -0,0 +1,19 @@ +["10.127.8.192/26"] +type = "subnet" +name = "JerryXiao-Infrastructure" +description = "For cloud instances" + +["10.127.9.0/24"] +type = "subnet" +name = "JerryXiao-Home" +description = "For home" + +["10.127.255.53/32"] +type = "loopback" +name = "JerryXiao-Anycast" +description = "Anycast Recursive DNS" + +["fd10:127:53::/48"] +type = "subnet" +name = "JerryXiao6" +description = "JerryNet6" diff --git a/route/AS4201270007.toml b/route/AS4201270007.toml new file mode 100644 index 0000000..a950c03 --- /dev/null +++ b/route/AS4201270007.toml @@ -0,0 +1,9 @@ +["10.127.8.184/29"] +type = "subnet" +name = "StaphNet" +description = "For Staph-infected equipments around the world" + +["fd10:127:7::/48"] +type = "subnet" +name = "Staph_v6" +description = "Staph-infected IPv6 subnet - please do not disinfect" diff --git a/route/AS4201270008.toml b/route/AS4201270008.toml new file mode 100644 index 0000000..9c72457 --- /dev/null +++ b/route/AS4201270008.toml @@ -0,0 +1,14 @@ +["10.127.4.0/24"] +type = "subnet" +name = "Icecat-Explosion" +description = "For Magicneko Explosion Network Interworking address, No SLA" + +["10.127.255.117/32"] +type = "loopback" +name = "magicneko-tw" +description = "magicneko-tw/frr" + +["fd10:127:0233::/48"] +type = "subnet" +name = "icecat" +description = "Magicneko ipv6 reserved segment" diff --git a/route/AS4201270009.toml b/route/AS4201270009.toml new file mode 100644 index 0000000..7e086a7 --- /dev/null +++ b/route/AS4201270009.toml @@ -0,0 +1,4 @@ +["10.127.69.0/29"] +type = "subnet" +name = "santost12" +description = "For home" diff --git a/route/AS4201270010.toml b/route/AS4201270010.toml new file mode 100644 index 0000000..9aa7350 --- /dev/null +++ b/route/AS4201270010.toml @@ -0,0 +1,9 @@ +["10.127.10.0/24"] +type = "subnet" +name = "Lan Tian LAN" +description = "For LAN" + +["fd10:127:10::/48"] +type = "subnet" +name = "Lan Tian LAN6" +description = "For LAN IPv6" diff --git a/route/AS4201270011.toml b/route/AS4201270011.toml new file mode 100644 index 0000000..98a1f0f --- /dev/null +++ b/route/AS4201270011.toml @@ -0,0 +1,9 @@ +["10.127.22.0/29"] +type = "subnet" +name = "LINE-NZ" +description = "For home" + +["10.127.22.8/29"] +type = "subnet" +name = "LINE-NZ" +description = "For cloud" diff --git a/route/AS4201270012.toml b/route/AS4201270012.toml new file mode 100644 index 0000000..48f4f77 --- /dev/null +++ b/route/AS4201270012.toml @@ -0,0 +1,4 @@ +["10.127.5.0/28"] +type = "subnet" +name = "yhi-h" +description = "Yhi Interconnect H" diff --git a/route/AS4201270013.toml b/route/AS4201270013.toml new file mode 100644 index 0000000..c53f8de --- /dev/null +++ b/route/AS4201270013.toml @@ -0,0 +1,9 @@ +["10.127.13.0/24"] +type = "subnet" +name = "Ndoskrnls LAN" +description = "For devices which being connected locally to Ndoskrnls Master Router" + +["fd10:127:13::/48"] +type = "subnet" +name = "Ndoskrnls LAN (IPv6)" +description = "For devices which being connected locally to Ndoskrnls Master Router" diff --git a/route/AS4201270014.toml b/route/AS4201270014.toml new file mode 100644 index 0000000..a60a7ac --- /dev/null +++ b/route/AS4201270014.toml @@ -0,0 +1,9 @@ +["10.127.23.0/29"] +type = "subnet" +name = "leedagee" +description = "leedagee" + +["fd10:127:0023::/48"] +type = "subnet" +name = "leedagee" +description = "leedagee" diff --git a/route/AS4242420140.toml b/route/AS4242420140.toml new file mode 100644 index 0000000..0797d21 --- /dev/null +++ b/route/AS4242420140.toml @@ -0,0 +1,4 @@ +["10.127.12.0/24"] +type = "subnet" +name = "dfceaef NET" +description = "For Yangfl Network" diff --git a/route/AS4242421037.toml b/route/AS4242421037.toml new file mode 100644 index 0000000..2778e5d --- /dev/null +++ b/route/AS4242421037.toml @@ -0,0 +1,4 @@ +["10.127.8.0/26"] +type = "subnet" +name = "LibreHouse" +description = "For infrastratures in our network" diff --git a/route/AS4242423088.toml b/route/AS4242423088.toml new file mode 100644 index 0000000..73e2be5 --- /dev/null +++ b/route/AS4242423088.toml @@ -0,0 +1,4 @@ +["10.127.11.0/24"] +type = "subnet" +name = "SUNNET" +description = "For SUN" diff --git a/route6/fd10:127:0023::,48 b/route6/fd10:127:0023::,48 deleted file mode 100644 index d6dec21..0000000 --- a/route6/fd10:127:0023::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="leedagee" -DESC="leedagee" -ASN="4201270014" diff --git a/route6/fd10:127:0233:1c3c::,64 b/route6/fd10:127:0233:1c3c::,64 deleted file mode 100644 index a55331d..0000000 --- a/route6/fd10:127:0233:1c3c::,64 +++ /dev/null @@ -1,5 +0,0 @@ -TYPE="SUBNET" -NAME="icecat" -DESC="NextMoe Radvd IPv6 Address" -ASN="4201270005" -SUPERNET="fd10:127:0233::/48" diff --git a/route6/fd10:127:0233::,48 b/route6/fd10:127:0233::,48 deleted file mode 100644 index be361a8..0000000 --- a/route6/fd10:127:0233::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="icecat" -DESC="Magicneko ipv6 reserved segment" -ASN="4201270008" diff --git a/route6/fd10:127:10::,48 b/route6/fd10:127:10::,48 deleted file mode 100644 index 27d1e89..0000000 --- a/route6/fd10:127:10::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Lan Tian LAN6" -DESC="For LAN IPv6" -ASN="4201270010" diff --git a/route6/fd10:127:13::,48 b/route6/fd10:127:13::,48 deleted file mode 100644 index 25e7310..0000000 --- a/route6/fd10:127:13::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Ndoskrnl's LAN (IPv6)" -DESC="For devices which being connected locally to Ndoskrnl's Master Router" -ASN="4201270013" diff --git a/route6/fd10:127:41::,48 b/route6/fd10:127:41::,48 deleted file mode 100644 index 8769c80..0000000 --- a/route6/fd10:127:41::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Septs IX IPv6 Pool" -DESC="" -ASN="4201270001" diff --git a/route6/fd10:127:53::,48 b/route6/fd10:127:53::,48 deleted file mode 100644 index 2649988..0000000 --- a/route6/fd10:127:53::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="JerryXiao6" -DESC="JerryNet6" -ASN="4201270006" diff --git a/route6/fd10:127:5f37:59df::,64 b/route6/fd10:127:5f37:59df::,64 deleted file mode 100644 index 8f23768..0000000 --- a/route6/fd10:127:5f37:59df::,64 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE=SUBNET -NAME="NeoNetwork Origin" -DESC="Neo_Chen's Network" -ASN="4201270000" diff --git a/route6/fd10:127:6969::,48 b/route6/fd10:127:6969::,48 deleted file mode 100644 index da74626..0000000 --- a/route6/fd10:127:6969::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="santost12" -DESC="For home" -ASN="4201270009" diff --git a/route6/fd10:127:7::,48 b/route6/fd10:127:7::,48 deleted file mode 100644 index a80b01c..0000000 --- a/route6/fd10:127:7::,48 +++ /dev/null @@ -1,4 +0,0 @@ -TYPE="SUBNET" -NAME="Staph_v6" -DESC="Staph-infected IPv6 subnet - please do not disinfect" -ASN="4201270007" diff --git a/scripts/dns-reverse-generator.py b/scripts/dns-reverse-generator.py new file mode 100755 index 0000000..c84e827 --- /dev/null +++ b/scripts/dns-reverse-generator.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +import sys +from ipaddress import IPv4Address, ip_network +from pathlib import Path + +import toml + +RESOLVE_FILE = Path("dns", "db.10.127") +ROUTE_FILE = Path("route") + + +def iter_route(route_type: str): + items = [] + for f in ROUTE_FILE.iterdir(): + routes = toml.loads(f.read_text()) + items.extend( + (entity["name"], ip_network(route).network_address) + for route, entity in routes.items() + if entity["type"] == route_type + ) + return sorted(items, key=lambda item: item[1]) + + +def main(): + orignal = RESOLVE_FILE.read_text() + orignal = orignal[: orignal.find("\n; AUTOGENERATED")] + records = [orignal, "; AUTOGENERATED", "", "; Loopback Addresses"] + for name, address in iter_route("loopback"): + if isinstance(address, IPv4Address): + pointer = address.reverse_pointer.replace(".127.10.in-addr.arpa", "") + records.append("%s\tIN\tPTR\t%s.neo" % (pointer, name)) + RESOLVE_FILE.write_text("\n".join(records)) + + +if __name__ == "__main__": + main() diff --git a/scripts/dns-reverse-generator.sh b/scripts/dns-reverse-generator.sh deleted file mode 100755 index 9338540..0000000 --- a/scripts/dns-reverse-generator.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -set -e - -FILE="dns/db.10.127" -LO_TEMP="$(mktemp)" - -if [[ "$(uname)" = *BSD ]]; then - TAC=gtac -else - TAC=tac -fi - -print_record() -{ - printf "%s\tIN\tPTR\t%s\n" "$1" "$2" -} - -ipcalc() -{ - local subnet="$1" - local add="$2" - - REV="$(echo -n "${subnet%,*}." | "$TAC" -s .)" - REV="${REV%.*.*.}" - - echo "$[ ${REV%.*} + $add ].${REV#*.}" -} - -# PROGRAM BEGIN - -sed -i '/AUTOGENERATED/,$d' "$FILE" -echo '; AUTOGENERATED' >> "$FILE" - -( -cd route -for i in *; do - source "$i" - if [ "$TYPE" = "LO" ]; then - ip="${i/,32/}" - - print_record "$(ipcalc "$ip" 0)" "$NAME.neo." >> "$LO_TEMP" - fi -done -) - -{ - echo -e "\n; Loopback Addresses" - sort -n < "$LO_TEMP" -} >> "$FILE" - -rm -f "$LO_TEMP" diff --git a/scripts/roa-ng.py b/scripts/roa-ng.py new file mode 100755 index 0000000..43ead4e --- /dev/null +++ b/scripts/roa-ng.py @@ -0,0 +1,316 @@ +#!/usr/bin/env python3 +import argparse +import json +import time +from collections import defaultdict +from contextlib import redirect_stdout +from io import StringIO +from ipaddress import IPv4Network, IPv6Network, ip_network +from itertools import combinations +from pathlib import Path + +import toml + +NEO_NETWORK_POOL = [ip_network("10.127.0.0/16"), ip_network("fd10:127::/32")] + + +def pick(entity: dict, fields: [str], **kwargs: dict): + new_entity = {} + for field in fields: + new_entity[field] = entity.get(field) + for old_field, new_field in kwargs.items(): + new_entity[new_field] = entity.get(old_field) + return new_entity + + +def is_neo_network(address): + return any( + address.version == neo.version and address.subnet_of(neo) + for neo in NEO_NETWORK_POOL + ) + + +def is_neo_network_asn(asn: int): + return 4201270000 <= asn <= 4201279999 + + +def is_dn42_asn(asn: int): + return 4242420000 <= asn <= 4242429999 + + +def iter_toml_file(path: str): + for item in Path(path).iterdir(): + if not item.is_file() or item.suffix != ".toml": + continue + yield item, toml.loads(item.read_text()) + + +def load_entities(): + return {item.stem: entity for item, entity in iter_toml_file("entity")} + + +def load_asn(entities: dict): + def assert_entity(entity, asn): + owner = entity.get("owner") + source = entity.get("source") + if is_neo_network_asn(asn): + source = "NeoNetwork" + elif is_dn42_asn(asn): + source = "DN42" + entity["source"] = source + assert owner in entities + assert source in ["NeoNetwork", "DN42", "Internet"] + return entity + + mapping = { + int(item.stem.lstrip("AS")): entity for item, entity in iter_toml_file("asn") + } + return {asn: assert_entity(entity, asn) for asn, entity in mapping.items()} + + +def node_to_asn(orignal_asn_set: set): + node_table = dict() + for _, entities in iter_toml_file("node"): + mapping = {name: entity["asn"] for (name, entity) in entities.items()} + asn_set = set(mapping.values()) + assert orignal_asn_set & asn_set == asn_set + node_table.update(mapping) + return node_table + + +def assert_peer(nodes: set): + for item, entities in iter_toml_file("peer"): + peers = set(entities["to-peer"]) + assert item.stem in nodes + assert nodes & peers == peers + + +def route_to_roa(asn_table: dict): + def make_route(): + for item, entity in iter_toml_file("route"): + asn = int(item.stem.lstrip("AS")) + for prefix, fields in entity.items(): + if fields["type"] not in ("loopback", "subnet"): + continue + fields["asn"] = asn + fields["prefix"] = ip_network(prefix, strict=True) + supernet = fields.get("supernet") + fields["supernet"] = ( + ip_network(supernet, strict=True) if supernet else None + ) + assert fields["name"] + assert is_neo_network(fields["prefix"]) + assert not fields["supernet"] or is_neo_network(fields["supernet"]) + yield fields + + entities = ( + pick(route, ["asn", "name", "prefix", "supernet"]) for route in make_route() + ) + entities = sorted(entities, key=lambda item: item["asn"]) + prefixes = [item["prefix"] for item in entities] + for net1, net2 in combinations( + sorted(entities, key=lambda net: net["prefix"].prefixlen), 2 + ): + if not net1["prefix"].overlaps(net2["prefix"]): + continue + assert net1["prefix"] != net2["prefix"] + assert net1["prefix"].supernet_of(net2["prefix"]) + s1net, s2net = (net1["supernet"], net2["supernet"]) + assert s2net # please include supernet = in your route + # if net1(the bigger net) has a supernet s1net, then s1net and net1 + # will be checked or must have been checked, same for net2 + assert not s1net or s1net in prefixes # net1.supernet is garbage + assert s2net == net1["prefix"] or s2net in prefixes # net2.supernet is garbage + return entities + + +def prehandle_roa(asn_table: dict, args): + roa = route_to_roa(asn_table) + max_prefixlen = IPv4Network(0).max_prefixlen + roa4 = filter(lambda item: isinstance(item["prefix"], IPv4Network), roa) + roa6 = filter(lambda item: isinstance(item["prefix"], IPv6Network), roa) + if args.ipv4: + roa6 = [] + elif args.ipv6: + roa4 = [] + roa4 = [ + r + for r in roa4 + if r["prefix"].prefixlen <= args.max or r["prefix"].prefixlen == max_prefixlen + ] + roa6 = [r for r in roa6 if r["prefix"].prefixlen <= args.max6] + for r in roa4: + r["maxLength"] = args.max + if r["prefix"].prefixlen == max_prefixlen: + r["maxLength"] = max_prefixlen + for r in roa6: + r["maxLength"] = args.max6 + for r in (*roa4, *roa6): + r["prefix"] = r["prefix"].with_prefixlen + return roa4, roa6 + + +def make_export(roa4, roa6): + entities = load_entities() + asn_table = load_asn(entities) + current = int(time.time()) + output = { + "metadata": {"generated": current, "valid": current + 14 * 86400}, + "people": { + owner: {"info": entity, "asns": []} for owner, entity in entities.items() + }, + } + for asn, asn_info in asn_table.items(): + owner = asn_info["owner"] + asn_item = { + "asn": asn, + "name": asn_info["name"], + "source": asn_info["source"], + "routes": { + "ipv4": [ + pick(roa, ["prefix", "maxLength"]) + for roa in roa4 + if roa["asn"] == asn + ], + "ipv6": [ + pick(roa, ["prefix", "maxLength"]) + for roa in roa6 + if roa["asn"] == asn + ], + }, + } + output["people"][owner]["asns"].append(asn_item) + return json.dumps(output, indent=2) + + +def make_json(roa4, roa6): + current = int(time.time()) + output = { + "metadata": { + "counts": len(roa4) + len(roa6), + "generated": current, + "valid": current + 14 * 86400, + }, + "roas": [ + {"asn": "AS%d" % roa["asn"], **pick(roa, ["prefix", "maxLength"])} + for roa in (*roa4, *roa6) + ], + } + return json.dumps(output, indent=2) + + +def make_rfc8416(roa4, roa6): + output = { + "slurmVersion": 1, + "validationOutputFilters": {"prefixFilters": [], "bgpsecFilters": []}, + "locallyAddedAssertions": { + "bgpsecAssertions": [], + "prefixAssertions": [ + pick( + roa, ["asn", "prefix"], maxLength="maxPrefixLength", name="comment", + ) + for roa in (*roa4, *roa6) + ], + }, + } + return json.dumps(output, indent=2) + + +def make_roa_records(roa4, roa6): + records = [ + "route {asn} max {prefix} as {maxLength};".format_map(roa) + for roa in (*roa4, *roa6) + ] + return "\n".join(["# NeoNetwork ROA tool", "", *records]) + + +def make_summary(): + entities = load_entities() + asn_table = load_asn(entities) + node_table = node_to_asn(set(asn_table.keys())) + stream = StringIO() + with redirect_stdout(stream): + print("Entities:") + print("{:20}{:20}{}".format("Name", "Telegram", "Email")) + for entity in sorted( + entities.values(), key=lambda entity: entity["name"].lower(), + ): + contact = entity.get("contact", {}) + email = contact.get("email", "") + telegram = contact.get("telegram", "") + print("{:20}{:20}{}".format(entity["name"], telegram, email)) + print() + print("AS List:") + print("{:15}{:<17}{:20}{}".format("Source", "ASN", "Owner", "Name")) + for asn, entity in sorted(asn_table.items(), key=lambda item: item[0]): + print( + "{:15}AS{:<15}{:20}{}".format( + entity["source"], asn, entity["owner"], entity["name"] + ) + ) + print() + print("Node List:") + print("{:<17}{}".format("ASN", "Name")) + for name, asn in sorted(node_table.items(), key=lambda item: item[1]): + print("AS{:<15}{}".format(asn, name)) + print() + print("Peer List:") + peers = list(iter_toml_file("peer")) + maxUpstreamLength = max(map(lambda item: len(item[0].stem), peers)) + print("{:>{}} ~ {}".format("Upstream", maxUpstreamLength, "Downstream")) + for item, entities in peers: + upstream = item.stem + for downstream in sorted(entities["to-peer"], key=str.lower): + print("{:>{}} ~ {}".format(upstream, maxUpstreamLength, downstream)) + return stream.getvalue() + + +def main(args): + entities = load_entities() + asn_table = load_asn(entities) + node_table = node_to_asn(set(asn_table.keys())) + assert_peer(set(node_table.keys())) + roa4, roa6 = prehandle_roa(asn_table, args) + if args.export: + return make_export(roa4, roa6) + elif args.json: + return make_json(roa4, roa6) + elif args.rfc8416: + return make_rfc8416(roa4, roa6) + elif args.summary: + return make_summary() + else: + return make_roa_records(roa4, roa6) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="NeoNetwork ROA tool") + parser.add_argument( + "-m", "--max", type=int, default=29, help="set ipv4 max prefix length" + ) + parser.add_argument( + "-M", "--max6", type=int, default=64, help="set ipv6 max prefix length" + ) + parser.add_argument("-j", "--json", action="store_true", help="output json") + parser.add_argument("-r", "--rfc8416", action="store_true", help="output rfc8416") + parser.add_argument("-s", "--summary", action="store_true", help="output summary") + parser.add_argument("-o", "--output", default="", help="write output to file") + parser.add_argument("-4", "--ipv4", action="store_true", help="print ipv4 only") + parser.add_argument("-6", "--ipv6", action="store_true", help="print ipv6 only") + parser.add_argument( + "-e", "--export", action="store_true", help="export registry to json" + ) + args = parser.parse_args() + if ( + args.max < 0 + or args.max6 < 0 + or args.max > IPv4Network(0).max_prefixlen + or args.max6 > IPv6Network(0).max_prefixlen + ): + parser.error("check your max prefix length") + output = main(args) + if not args.output or args.output == "-": + print(output) + elif output: + Path(args.output).write_text(output) + print("written to", args.output) diff --git a/scripts/roa.sh b/scripts/roa.sh deleted file mode 100755 index 5e4997b..0000000 --- a/scripts/roa.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -e - -INET4PFXLEN="29" -INET6PFXLEN="64" - -print_record() -{ - printf "route %s max %d as %u;\n" "$1" "$2" "$3" -} - - -# PROGRAM BEGIN - -echo "# NeoNetwork ROA Tool" -( -for i in route*/* ; do - source "$i" - if [ "$TYPE" != PTP ]; then - prefix="${i#route*/}" - prefix="${prefix/,/\/}" - pfxlen="${i#*,}" - - if [ "$TYPE" = "SUBNET" ]; then - if [ "$pfxlen" -le "$INET4PFXLEN" ]||[ "$pfxlen" -ge 32 ]&&[ "$pfxlen" -le "$INET6PFXLEN" ]; then - print_record "$prefix" "$INET4PFXLEN" "$ASN" - fi - elif [ "$TYPE" = "LO" ]; then - print_record "$prefix" 32 "$ASN" - fi - fi -done -) From 2a65e8ba71e5924edfb3608212e8dad9c568713b Mon Sep 17 00:00:00 2001 From: Septs Date: Sat, 23 May 2020 19:13:09 +0800 Subject: [PATCH 16/23] expose route-table to readme --- scripts/roa-ng.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/roa-ng.py b/scripts/roa-ng.py index 43ead4e..5c1b12b 100755 --- a/scripts/roa-ng.py +++ b/scripts/roa-ng.py @@ -230,7 +230,7 @@ def make_summary(): node_table = node_to_asn(set(asn_table.keys())) stream = StringIO() with redirect_stdout(stream): - print("Entities:") + print("Entity table:") print("{:20}{:20}{}".format("Name", "Telegram", "Email")) for entity in sorted( entities.values(), key=lambda entity: entity["name"].lower(), @@ -240,7 +240,7 @@ def make_summary(): telegram = contact.get("telegram", "") print("{:20}{:20}{}".format(entity["name"], telegram, email)) print() - print("AS List:") + print("AS table:") print("{:15}{:<17}{:20}{}".format("Source", "ASN", "Owner", "Name")) for asn, entity in sorted(asn_table.items(), key=lambda item: item[0]): print( @@ -249,12 +249,12 @@ def make_summary(): ) ) print() - print("Node List:") + print("Node table:") print("{:<17}{}".format("ASN", "Name")) for name, asn in sorted(node_table.items(), key=lambda item: item[1]): print("AS{:<15}{}".format(asn, name)) print() - print("Peer List:") + print("Peer table:") peers = list(iter_toml_file("peer")) maxUpstreamLength = max(map(lambda item: len(item[0].stem), peers)) print("{:>{}} ~ {}".format("Upstream", maxUpstreamLength, "Downstream")) @@ -262,6 +262,13 @@ def make_summary(): upstream = item.stem for downstream in sorted(entities["to-peer"], key=str.lower): print("{:>{}} ~ {}".format(upstream, maxUpstreamLength, downstream)) + print() + print("Route table:") + print("{:17}{:30}{:30}{}".format("ASN", "Name", "Prefix", "Supernet")) + for entity in route_to_roa(asn_table): + entity["prefix"] = str(entity["prefix"]) + entity["supernet"] = str(entity["supernet"]) if entity["supernet"] else "" + print("AS{asn:<15}{name:30}{prefix:30}{supernet}".format_map(entity)) return stream.getvalue() From 6448b401df2643228cc9043cf4f5cb81b5da32e8 Mon Sep 17 00:00:00 2001 From: Septs Date: Sat, 23 May 2020 19:32:58 +0800 Subject: [PATCH 17/23] update peer-table to readme --- scripts/roa-ng.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/roa-ng.py b/scripts/roa-ng.py index 5c1b12b..95a4e9b 100755 --- a/scripts/roa-ng.py +++ b/scripts/roa-ng.py @@ -255,13 +255,17 @@ def make_summary(): print("AS{:<15}{}".format(asn, name)) print() print("Peer table:") - peers = list(iter_toml_file("peer")) - maxUpstreamLength = max(map(lambda item: len(item[0].stem), peers)) - print("{:>{}} ~ {}".format("Upstream", maxUpstreamLength, "Downstream")) - for item, entities in peers: - upstream = item.stem - for downstream in sorted(entities["to-peer"], key=str.lower): - print("{:>{}} ~ {}".format(upstream, maxUpstreamLength, downstream)) + peers = { + item.stem: entity["to-peer"] for item, entity in iter_toml_file("peer") + } + peers = [ + (upstream, downstream) + for upstream, downstream_list in peers.items() + for downstream in downstream_list + ] + print("{:>20} ~ {}".format("Upstream", "Downstream")) + for upstream, downstream in peers: + print("{:>20} ~ {}".format(upstream, downstream)) print() print("Route table:") print("{:17}{:30}{:30}{}".format("ASN", "Name", "Prefix", "Supernet")) From c78a7565a7a2dc1d2199c9aa0d7cdf79a13d59dc Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 23 May 2020 19:42:52 +0800 Subject: [PATCH 18/23] remove legacy scripts --- .github/workflows/roa.yml | 14 +- .github/workflows/test-your-pr.yml | 13 +- scripts/roa-ng.py | 327 ---------------- scripts/roa.py | 586 +++++++++++++++-------------- 4 files changed, 320 insertions(+), 620 deletions(-) delete mode 100755 scripts/roa-ng.py diff --git a/.github/workflows/roa.yml b/.github/workflows/roa.yml index f1a1e6c..0ff61b9 100644 --- a/.github/workflows/roa.yml +++ b/.github/workflows/roa.yml @@ -41,13 +41,13 @@ jobs: maxlen4=29 maxlen6=64 mkdir -p roa_dir - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json - pyenv exec python3 scripts/roa-ng.py --summary --output roa_dir/README.txt + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json + pyenv exec python3 scripts/roa.py --summary --output roa_dir/README.txt - name: Upload files env: diff --git a/.github/workflows/test-your-pr.yml b/.github/workflows/test-your-pr.yml index de6fa4c..4cd0ce7 100644 --- a/.github/workflows/test-your-pr.yml +++ b/.github/workflows/test-your-pr.yml @@ -41,9 +41,10 @@ jobs: maxlen4=29 maxlen6=64 mkdir -p roa_dir - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json - pyenv exec python3 scripts/roa-ng.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -o roa_dir/roa46_bird2.conf + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -4 -o roa_dir/roa4_bird2.conf + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -6 -o roa_dir/roa6_bird2.conf + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -j -o roa_dir/roa46.json + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -e -o roa_dir/neonetwork.json + pyenv exec python3 scripts/roa.py -m ${maxlen4} -M ${maxlen6} -r -o roa_dir/rfc8416.json + pyenv exec python3 scripts/roa.py --summary --output roa_dir/README.txt diff --git a/scripts/roa-ng.py b/scripts/roa-ng.py deleted file mode 100755 index 95a4e9b..0000000 --- a/scripts/roa-ng.py +++ /dev/null @@ -1,327 +0,0 @@ -#!/usr/bin/env python3 -import argparse -import json -import time -from collections import defaultdict -from contextlib import redirect_stdout -from io import StringIO -from ipaddress import IPv4Network, IPv6Network, ip_network -from itertools import combinations -from pathlib import Path - -import toml - -NEO_NETWORK_POOL = [ip_network("10.127.0.0/16"), ip_network("fd10:127::/32")] - - -def pick(entity: dict, fields: [str], **kwargs: dict): - new_entity = {} - for field in fields: - new_entity[field] = entity.get(field) - for old_field, new_field in kwargs.items(): - new_entity[new_field] = entity.get(old_field) - return new_entity - - -def is_neo_network(address): - return any( - address.version == neo.version and address.subnet_of(neo) - for neo in NEO_NETWORK_POOL - ) - - -def is_neo_network_asn(asn: int): - return 4201270000 <= asn <= 4201279999 - - -def is_dn42_asn(asn: int): - return 4242420000 <= asn <= 4242429999 - - -def iter_toml_file(path: str): - for item in Path(path).iterdir(): - if not item.is_file() or item.suffix != ".toml": - continue - yield item, toml.loads(item.read_text()) - - -def load_entities(): - return {item.stem: entity for item, entity in iter_toml_file("entity")} - - -def load_asn(entities: dict): - def assert_entity(entity, asn): - owner = entity.get("owner") - source = entity.get("source") - if is_neo_network_asn(asn): - source = "NeoNetwork" - elif is_dn42_asn(asn): - source = "DN42" - entity["source"] = source - assert owner in entities - assert source in ["NeoNetwork", "DN42", "Internet"] - return entity - - mapping = { - int(item.stem.lstrip("AS")): entity for item, entity in iter_toml_file("asn") - } - return {asn: assert_entity(entity, asn) for asn, entity in mapping.items()} - - -def node_to_asn(orignal_asn_set: set): - node_table = dict() - for _, entities in iter_toml_file("node"): - mapping = {name: entity["asn"] for (name, entity) in entities.items()} - asn_set = set(mapping.values()) - assert orignal_asn_set & asn_set == asn_set - node_table.update(mapping) - return node_table - - -def assert_peer(nodes: set): - for item, entities in iter_toml_file("peer"): - peers = set(entities["to-peer"]) - assert item.stem in nodes - assert nodes & peers == peers - - -def route_to_roa(asn_table: dict): - def make_route(): - for item, entity in iter_toml_file("route"): - asn = int(item.stem.lstrip("AS")) - for prefix, fields in entity.items(): - if fields["type"] not in ("loopback", "subnet"): - continue - fields["asn"] = asn - fields["prefix"] = ip_network(prefix, strict=True) - supernet = fields.get("supernet") - fields["supernet"] = ( - ip_network(supernet, strict=True) if supernet else None - ) - assert fields["name"] - assert is_neo_network(fields["prefix"]) - assert not fields["supernet"] or is_neo_network(fields["supernet"]) - yield fields - - entities = ( - pick(route, ["asn", "name", "prefix", "supernet"]) for route in make_route() - ) - entities = sorted(entities, key=lambda item: item["asn"]) - prefixes = [item["prefix"] for item in entities] - for net1, net2 in combinations( - sorted(entities, key=lambda net: net["prefix"].prefixlen), 2 - ): - if not net1["prefix"].overlaps(net2["prefix"]): - continue - assert net1["prefix"] != net2["prefix"] - assert net1["prefix"].supernet_of(net2["prefix"]) - s1net, s2net = (net1["supernet"], net2["supernet"]) - assert s2net # please include supernet = in your route - # if net1(the bigger net) has a supernet s1net, then s1net and net1 - # will be checked or must have been checked, same for net2 - assert not s1net or s1net in prefixes # net1.supernet is garbage - assert s2net == net1["prefix"] or s2net in prefixes # net2.supernet is garbage - return entities - - -def prehandle_roa(asn_table: dict, args): - roa = route_to_roa(asn_table) - max_prefixlen = IPv4Network(0).max_prefixlen - roa4 = filter(lambda item: isinstance(item["prefix"], IPv4Network), roa) - roa6 = filter(lambda item: isinstance(item["prefix"], IPv6Network), roa) - if args.ipv4: - roa6 = [] - elif args.ipv6: - roa4 = [] - roa4 = [ - r - for r in roa4 - if r["prefix"].prefixlen <= args.max or r["prefix"].prefixlen == max_prefixlen - ] - roa6 = [r for r in roa6 if r["prefix"].prefixlen <= args.max6] - for r in roa4: - r["maxLength"] = args.max - if r["prefix"].prefixlen == max_prefixlen: - r["maxLength"] = max_prefixlen - for r in roa6: - r["maxLength"] = args.max6 - for r in (*roa4, *roa6): - r["prefix"] = r["prefix"].with_prefixlen - return roa4, roa6 - - -def make_export(roa4, roa6): - entities = load_entities() - asn_table = load_asn(entities) - current = int(time.time()) - output = { - "metadata": {"generated": current, "valid": current + 14 * 86400}, - "people": { - owner: {"info": entity, "asns": []} for owner, entity in entities.items() - }, - } - for asn, asn_info in asn_table.items(): - owner = asn_info["owner"] - asn_item = { - "asn": asn, - "name": asn_info["name"], - "source": asn_info["source"], - "routes": { - "ipv4": [ - pick(roa, ["prefix", "maxLength"]) - for roa in roa4 - if roa["asn"] == asn - ], - "ipv6": [ - pick(roa, ["prefix", "maxLength"]) - for roa in roa6 - if roa["asn"] == asn - ], - }, - } - output["people"][owner]["asns"].append(asn_item) - return json.dumps(output, indent=2) - - -def make_json(roa4, roa6): - current = int(time.time()) - output = { - "metadata": { - "counts": len(roa4) + len(roa6), - "generated": current, - "valid": current + 14 * 86400, - }, - "roas": [ - {"asn": "AS%d" % roa["asn"], **pick(roa, ["prefix", "maxLength"])} - for roa in (*roa4, *roa6) - ], - } - return json.dumps(output, indent=2) - - -def make_rfc8416(roa4, roa6): - output = { - "slurmVersion": 1, - "validationOutputFilters": {"prefixFilters": [], "bgpsecFilters": []}, - "locallyAddedAssertions": { - "bgpsecAssertions": [], - "prefixAssertions": [ - pick( - roa, ["asn", "prefix"], maxLength="maxPrefixLength", name="comment", - ) - for roa in (*roa4, *roa6) - ], - }, - } - return json.dumps(output, indent=2) - - -def make_roa_records(roa4, roa6): - records = [ - "route {asn} max {prefix} as {maxLength};".format_map(roa) - for roa in (*roa4, *roa6) - ] - return "\n".join(["# NeoNetwork ROA tool", "", *records]) - - -def make_summary(): - entities = load_entities() - asn_table = load_asn(entities) - node_table = node_to_asn(set(asn_table.keys())) - stream = StringIO() - with redirect_stdout(stream): - print("Entity table:") - print("{:20}{:20}{}".format("Name", "Telegram", "Email")) - for entity in sorted( - entities.values(), key=lambda entity: entity["name"].lower(), - ): - contact = entity.get("contact", {}) - email = contact.get("email", "") - telegram = contact.get("telegram", "") - print("{:20}{:20}{}".format(entity["name"], telegram, email)) - print() - print("AS table:") - print("{:15}{:<17}{:20}{}".format("Source", "ASN", "Owner", "Name")) - for asn, entity in sorted(asn_table.items(), key=lambda item: item[0]): - print( - "{:15}AS{:<15}{:20}{}".format( - entity["source"], asn, entity["owner"], entity["name"] - ) - ) - print() - print("Node table:") - print("{:<17}{}".format("ASN", "Name")) - for name, asn in sorted(node_table.items(), key=lambda item: item[1]): - print("AS{:<15}{}".format(asn, name)) - print() - print("Peer table:") - peers = { - item.stem: entity["to-peer"] for item, entity in iter_toml_file("peer") - } - peers = [ - (upstream, downstream) - for upstream, downstream_list in peers.items() - for downstream in downstream_list - ] - print("{:>20} ~ {}".format("Upstream", "Downstream")) - for upstream, downstream in peers: - print("{:>20} ~ {}".format(upstream, downstream)) - print() - print("Route table:") - print("{:17}{:30}{:30}{}".format("ASN", "Name", "Prefix", "Supernet")) - for entity in route_to_roa(asn_table): - entity["prefix"] = str(entity["prefix"]) - entity["supernet"] = str(entity["supernet"]) if entity["supernet"] else "" - print("AS{asn:<15}{name:30}{prefix:30}{supernet}".format_map(entity)) - return stream.getvalue() - - -def main(args): - entities = load_entities() - asn_table = load_asn(entities) - node_table = node_to_asn(set(asn_table.keys())) - assert_peer(set(node_table.keys())) - roa4, roa6 = prehandle_roa(asn_table, args) - if args.export: - return make_export(roa4, roa6) - elif args.json: - return make_json(roa4, roa6) - elif args.rfc8416: - return make_rfc8416(roa4, roa6) - elif args.summary: - return make_summary() - else: - return make_roa_records(roa4, roa6) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="NeoNetwork ROA tool") - parser.add_argument( - "-m", "--max", type=int, default=29, help="set ipv4 max prefix length" - ) - parser.add_argument( - "-M", "--max6", type=int, default=64, help="set ipv6 max prefix length" - ) - parser.add_argument("-j", "--json", action="store_true", help="output json") - parser.add_argument("-r", "--rfc8416", action="store_true", help="output rfc8416") - parser.add_argument("-s", "--summary", action="store_true", help="output summary") - parser.add_argument("-o", "--output", default="", help="write output to file") - parser.add_argument("-4", "--ipv4", action="store_true", help="print ipv4 only") - parser.add_argument("-6", "--ipv6", action="store_true", help="print ipv6 only") - parser.add_argument( - "-e", "--export", action="store_true", help="export registry to json" - ) - args = parser.parse_args() - if ( - args.max < 0 - or args.max6 < 0 - or args.max > IPv4Network(0).max_prefixlen - or args.max6 > IPv6Network(0).max_prefixlen - ): - parser.error("check your max prefix length") - output = main(args) - if not args.output or args.output == "-": - print(output) - elif output: - Path(args.output).write_text(output) - print("written to", args.output) diff --git a/scripts/roa.py b/scripts/roa.py index 2454c23..95a4e9b 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -1,301 +1,327 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from pathlib import Path +import argparse +import json +import time +from collections import defaultdict +from contextlib import redirect_stdout +from io import StringIO from ipaddress import IPv4Network, IPv6Network, ip_network from itertools import combinations -import re +from pathlib import Path -NEONET_ADDR_POOL = ('10.127.0.0/16', 'fd10:127::/32') -NEONET_ADDR_POOL = [ip_network(neo) for neo in NEONET_ADDR_POOL] -IS_NEONET = lambda net: bool([True for neo in NEONET_ADDR_POOL if net.version == neo.version and net.subnet_of(neo)]) -AS_IS_NEONET = lambda asn: 4201270000 <= asn <= 4201279999 -assert hasattr(IPv4Network, 'subnet_of') # needs at least python 3.7 +import toml -class BashParser: - def __init__(self): - self.__pa = None # are we parsing bash array? - def end(self): - assert not self.__pa # check if array ends properly - def parseline(self, line): - repl_quotes = lambda t: t.replace('"', '').replace('\'', '') - line = line.strip() - if '=(' in line: - self.__pa = (repl_quotes(line).split('=(')[0], list()) - return None - if self.__pa: - if line: - if line.endswith(')'): - if line[:-1]: - self.__pa[1].append(repl_quotes(line[:-1])) - ret = self.__pa - self.__pa = None - return ret - else: - self.__pa[1].append(repl_quotes(line)) - return None - else: - if not line or line.startswith('#'): - return None - l = line.split('=') - assert len(l) >= 2 # is this line key=value syntax? - return [l[0], '='.join([repl_quotes(i) for i in l[1:]])] -bp = BashParser() +NEO_NETWORK_POOL = [ip_network("10.127.0.0/16"), ip_network("fd10:127::/32")] -def shell2dict(shellscript): - fc = dict() - for line in shellscript.split('\n'): - r = bp.parseline(line) - if r: - key, val = r - fc[key.lower()] = val - bp.end() - return fc -cwd = Path() -assert not [d for d in ("asn", "route", "route6", "node", "entity") if not (cwd / d).is_dir()] +def pick(entity: dict, fields: [str], **kwargs: dict): + new_entity = {} + for field in fields: + new_entity[field] = entity.get(field) + for old_field, new_field in kwargs.items(): + new_entity[new_field] = entity.get(old_field) + return new_entity -def str2asn(s_asn, strict=None): - """ strict: 1 with prefix AS, other bool(x)==True without prefix AS """ - s_asn = s_asn.strip().lower() - if strict == 1: - assert s_asn.startswith('as') - elif strict: - assert int(s_asn) - if s_asn.startswith('as'): - s_asn = s_asn[2:] - return int(s_asn) -def name2nichdl(name): - r, num = re.subn(r'[^0-9A-Z]', '-', name.upper()) - _r = len(r.replace('-', '')) - assert _r >= 3 # has at least 3 effective chars - assert r[0] != '-' # starts with [0-9A-Z] - assert num < _r # not too many subs - return r +def is_neo_network(address): + return any( + address.version == neo.version and address.subnet_of(neo) + for neo in NEO_NETWORK_POOL + ) -def neoneo_get_people(): - nic_hdl_names = set() - people = dict() - for f in (cwd / "entity").iterdir(): - try: - if not f.is_file(): - continue - fc = shell2dict(f.read_text()) - present_keys = ('name', 'desc', 'contact', 'babel', 'auth') - assert f.name - people[f.name] = {k: fc.get(k) for k in present_keys} - nic_hdl = name2nichdl(f.name) - assert nic_hdl not in nic_hdl_names # nic_hdl collision - nic_hdl_names.add(nic_hdl) - people[f.name]['nic_hdl'] = nic_hdl - for v in people[f.name].values(): - assert v is not None - auth = people[f.name]['auth'] - if auth: - method, data = auth.split(':') - assert method in ('PGP', 'SSH') - if method == 'PGP': - assert len(data) == 40 # invaild pgp fingerprint - elif method == 'SSH': - assert data.startswith('ssh-') # invalid ssh pubkey - people[f.name]['auth'] = f"{'pgp-fingerprint ' if method == 'PGP' else ''}{data.strip()}" - except Exception: - print("[!] Error while processing file", f) - raise - return people -PEOPLE = neoneo_get_people() -def neonet_get_asns(): - asns = dict() - for f in (cwd / "asn").iterdir(): - try: - if not f.is_file(): - continue - fc = shell2dict(f.read_text()) - present_keys = ('name', 'owner', 'desc', 'source') - required_keys = ('name', 'owner', 'source') - asn = str2asn(f.name, 1) - asns[asn] = {k: fc.get(k) for k in present_keys} - assert fc.get('owner') in PEOPLE - for k in required_keys: - assert asns[asn].get(k) # required fields missing - as_src = asns[asn].get('source') - assert as_src in ('NeoNetwork', 'DN42', 'INET') - assert AS_IS_NEONET(asn) or as_src != 'NeoNetwork' - except Exception: - print("[!] Error while processing file", f) - raise - return asns -ASNS = neonet_get_asns() +def is_neo_network_asn(asn: int): + return 4201270000 <= asn <= 4201279999 -def node2asn(): + +def is_dn42_asn(asn: int): + return 4242420000 <= asn <= 4242429999 + + +def iter_toml_file(path: str): + for item in Path(path).iterdir(): + if not item.is_file() or item.suffix != ".toml": + continue + yield item, toml.loads(item.read_text()) + + +def load_entities(): + return {item.stem: entity for item, entity in iter_toml_file("entity")} + + +def load_asn(entities: dict): + def assert_entity(entity, asn): + owner = entity.get("owner") + source = entity.get("source") + if is_neo_network_asn(asn): + source = "NeoNetwork" + elif is_dn42_asn(asn): + source = "DN42" + entity["source"] = source + assert owner in entities + assert source in ["NeoNetwork", "DN42", "Internet"] + return entity + + mapping = { + int(item.stem.lstrip("AS")): entity for item, entity in iter_toml_file("asn") + } + return {asn: assert_entity(entity, asn) for asn, entity in mapping.items()} + + +def node_to_asn(orignal_asn_set: set): node_table = dict() - for f in (cwd / "node").iterdir(): - try: - if not f.is_file(): - continue - fc = shell2dict(f.read_text()) - asn = str2asn(fc.get('asn'), 2) - assert asn in ASNS - node_table[f.name] = asn - except Exception: - print("[!] Error while processing file", f) - raise + for _, entities in iter_toml_file("node"): + mapping = {name: entity["asn"] for (name, entity) in entities.items()} + asn_set = set(mapping.values()) + assert orignal_asn_set & asn_set == asn_set + node_table.update(mapping) return node_table -NODE_TABLE = node2asn() -def neonet_peercheck(): - for f in (cwd / "peer").iterdir(): - try: - if not f.is_file(): - continue - fc = shell2dict(f.read_text()) - desc = fc.get('desc') - assert desc is not None - upstream, downstream = f.name.split('~') - assert upstream in NODE_TABLE - assert downstream in NODE_TABLE - except Exception: - print("[!] Error while processing file", f) - raise -neonet_peercheck() -def neonet_route2roa(dirname, is_ipv6=False): - roa_entries = list() - for f in (cwd / dirname).iterdir(): - try: - if not f.is_file(): - continue - fc = shell2dict(f.read_text()) - nettype = IPv6Network if is_ipv6 else IPv4Network - get_supernet = lambda s_net: None if not s_net else nettype(s_net, strict=True) - roa_entries_key = ("asn", "prefix", "supernet", "netname") - if fc.get('type').lower() in ('lo', 'subnet'): - asn = str2asn(fc.get('asn'), 2) - assert asn in ASNS # asn not in as-dir - route = f.name.replace(',', '/') - net = nettype(route, strict=True) - assert IS_NEONET(net) - supernet = get_supernet(fc.get('supernet')) - assert not supernet or IS_NEONET(supernet) - netname = fc.get('name') - assert netname - roa_entries.append(dict(zip(roa_entries_key, [asn, net, supernet, netname]))) - else: - raise AssertionError # unknown type - except Exception: - print("[!] Error while processing file", f) - raise - roa_entries.sort(key=lambda l: l['asn']) - l_prefix = [_roa['prefix'] for _roa in roa_entries] - for _net1, _net2 in combinations(roa_entries, 2): - net1, net2 = sorted([_net1, _net2], key=lambda net: net['prefix'].prefixlen) - if net1['prefix'].overlaps(net2['prefix']): - try: - assert net1['prefix'] != net2['prefix'] - assert net1['prefix'].supernet_of(net2['prefix']) - s1net, s2net= (net1['supernet'], net2['supernet']) - assert s2net # please include SUPERNET= in your route - # if net1(the bigger net) has a supernet s1net, then s1net and net1 - # will be checked or must have been checked, same for net2 - assert not s1net or s1net in l_prefix # net1.supernet is garbage - assert s2net == net1['prefix'] or s2net in l_prefix # net2.supernet is garbage - except AssertionError: - print("[!] Error: found", net1, "overlaps", net2) - raise - return roa_entries +def assert_peer(nodes: set): + for item, entities in iter_toml_file("peer"): + peers = set(entities["to-peer"]) + assert item.stem in nodes + assert nodes & peers == peers + + +def route_to_roa(asn_table: dict): + def make_route(): + for item, entity in iter_toml_file("route"): + asn = int(item.stem.lstrip("AS")) + for prefix, fields in entity.items(): + if fields["type"] not in ("loopback", "subnet"): + continue + fields["asn"] = asn + fields["prefix"] = ip_network(prefix, strict=True) + supernet = fields.get("supernet") + fields["supernet"] = ( + ip_network(supernet, strict=True) if supernet else None + ) + assert fields["name"] + assert is_neo_network(fields["prefix"]) + assert not fields["supernet"] or is_neo_network(fields["supernet"]) + yield fields + + entities = ( + pick(route, ["asn", "name", "prefix", "supernet"]) for route in make_route() + ) + entities = sorted(entities, key=lambda item: item["asn"]) + prefixes = [item["prefix"] for item in entities] + for net1, net2 in combinations( + sorted(entities, key=lambda net: net["prefix"].prefixlen), 2 + ): + if not net1["prefix"].overlaps(net2["prefix"]): + continue + assert net1["prefix"] != net2["prefix"] + assert net1["prefix"].supernet_of(net2["prefix"]) + s1net, s2net = (net1["supernet"], net2["supernet"]) + assert s2net # please include supernet = in your route + # if net1(the bigger net) has a supernet s1net, then s1net and net1 + # will be checked or must have been checked, same for net2 + assert not s1net or s1net in prefixes # net1.supernet is garbage + assert s2net == net1["prefix"] or s2net in prefixes # net2.supernet is garbage + return entities + + +def prehandle_roa(asn_table: dict, args): + roa = route_to_roa(asn_table) + max_prefixlen = IPv4Network(0).max_prefixlen + roa4 = filter(lambda item: isinstance(item["prefix"], IPv4Network), roa) + roa6 = filter(lambda item: isinstance(item["prefix"], IPv6Network), roa) + if args.ipv4: + roa6 = [] + elif args.ipv6: + roa4 = [] + roa4 = [ + r + for r in roa4 + if r["prefix"].prefixlen <= args.max or r["prefix"].prefixlen == max_prefixlen + ] + roa6 = [r for r in roa6 if r["prefix"].prefixlen <= args.max6] + for r in roa4: + r["maxLength"] = args.max + if r["prefix"].prefixlen == max_prefixlen: + r["maxLength"] = max_prefixlen + for r in roa6: + r["maxLength"] = args.max6 + for r in (*roa4, *roa6): + r["prefix"] = r["prefix"].with_prefixlen + return roa4, roa6 + + +def make_export(roa4, roa6): + entities = load_entities() + asn_table = load_asn(entities) + current = int(time.time()) + output = { + "metadata": {"generated": current, "valid": current + 14 * 86400}, + "people": { + owner: {"info": entity, "asns": []} for owner, entity in entities.items() + }, + } + for asn, asn_info in asn_table.items(): + owner = asn_info["owner"] + asn_item = { + "asn": asn, + "name": asn_info["name"], + "source": asn_info["source"], + "routes": { + "ipv4": [ + pick(roa, ["prefix", "maxLength"]) + for roa in roa4 + if roa["asn"] == asn + ], + "ipv6": [ + pick(roa, ["prefix", "maxLength"]) + for roa in roa6 + if roa["asn"] == asn + ], + }, + } + output["people"][owner]["asns"].append(asn_item) + return json.dumps(output, indent=2) + + +def make_json(roa4, roa6): + current = int(time.time()) + output = { + "metadata": { + "counts": len(roa4) + len(roa6), + "generated": current, + "valid": current + 14 * 86400, + }, + "roas": [ + {"asn": "AS%d" % roa["asn"], **pick(roa, ["prefix", "maxLength"])} + for roa in (*roa4, *roa6) + ], + } + return json.dumps(output, indent=2) + + +def make_rfc8416(roa4, roa6): + output = { + "slurmVersion": 1, + "validationOutputFilters": {"prefixFilters": [], "bgpsecFilters": []}, + "locallyAddedAssertions": { + "bgpsecAssertions": [], + "prefixAssertions": [ + pick( + roa, ["asn", "prefix"], maxLength="maxPrefixLength", name="comment", + ) + for roa in (*roa4, *roa6) + ], + }, + } + return json.dumps(output, indent=2) + + +def make_roa_records(roa4, roa6): + records = [ + "route {asn} max {prefix} as {maxLength};".format_map(roa) + for roa in (*roa4, *roa6) + ] + return "\n".join(["# NeoNetwork ROA tool", "", *records]) + + +def make_summary(): + entities = load_entities() + asn_table = load_asn(entities) + node_table = node_to_asn(set(asn_table.keys())) + stream = StringIO() + with redirect_stdout(stream): + print("Entity table:") + print("{:20}{:20}{}".format("Name", "Telegram", "Email")) + for entity in sorted( + entities.values(), key=lambda entity: entity["name"].lower(), + ): + contact = entity.get("contact", {}) + email = contact.get("email", "") + telegram = contact.get("telegram", "") + print("{:20}{:20}{}".format(entity["name"], telegram, email)) + print() + print("AS table:") + print("{:15}{:<17}{:20}{}".format("Source", "ASN", "Owner", "Name")) + for asn, entity in sorted(asn_table.items(), key=lambda item: item[0]): + print( + "{:15}AS{:<15}{:20}{}".format( + entity["source"], asn, entity["owner"], entity["name"] + ) + ) + print() + print("Node table:") + print("{:<17}{}".format("ASN", "Name")) + for name, asn in sorted(node_table.items(), key=lambda item: item[1]): + print("AS{:<15}{}".format(asn, name)) + print() + print("Peer table:") + peers = { + item.stem: entity["to-peer"] for item, entity in iter_toml_file("peer") + } + peers = [ + (upstream, downstream) + for upstream, downstream_list in peers.items() + for downstream in downstream_list + ] + print("{:>20} ~ {}".format("Upstream", "Downstream")) + for upstream, downstream in peers: + print("{:>20} ~ {}".format(upstream, downstream)) + print() + print("Route table:") + print("{:17}{:30}{:30}{}".format("ASN", "Name", "Prefix", "Supernet")) + for entity in route_to_roa(asn_table): + entity["prefix"] = str(entity["prefix"]) + entity["supernet"] = str(entity["supernet"]) if entity["supernet"] else "" + print("AS{asn:<15}{name:30}{prefix:30}{supernet}".format_map(entity)) + return stream.getvalue() + + +def main(args): + entities = load_entities() + asn_table = load_asn(entities) + node_table = node_to_asn(set(asn_table.keys())) + assert_peer(set(node_table.keys())) + roa4, roa6 = prehandle_roa(asn_table, args) + if args.export: + return make_export(roa4, roa6) + elif args.json: + return make_json(roa4, roa6) + elif args.rfc8416: + return make_rfc8416(roa4, roa6) + elif args.summary: + return make_summary() + else: + return make_roa_records(roa4, roa6) + if __name__ == "__main__": - import argparse - parser = argparse.ArgumentParser(description='NeoNetwork ROA tool') - parser.add_argument('-m', '--max', type=int, default=29, help='set ipv4 max prefix length') - parser.add_argument('-M', '--max6', type=int, default=64, help='set ipv6 max prefix length') - parser.add_argument('-j', '--json', action='store_true', help='output json') - parser.add_argument('-r', '--rfc8416', action='store_true', help='output rfc8416') - parser.add_argument('-o', '--output', default='', help='write output to file') - parser.add_argument('-4', '--ipv4', action='store_true', help='print ipv4 only') - parser.add_argument('-6', '--ipv6', action='store_true', help='print ipv6 only') - parser.add_argument('-e', '--export', action='store_true', help='export registry to json') + parser = argparse.ArgumentParser(description="NeoNetwork ROA tool") + parser.add_argument( + "-m", "--max", type=int, default=29, help="set ipv4 max prefix length" + ) + parser.add_argument( + "-M", "--max6", type=int, default=64, help="set ipv6 max prefix length" + ) + parser.add_argument("-j", "--json", action="store_true", help="output json") + parser.add_argument("-r", "--rfc8416", action="store_true", help="output rfc8416") + parser.add_argument("-s", "--summary", action="store_true", help="output summary") + parser.add_argument("-o", "--output", default="", help="write output to file") + parser.add_argument("-4", "--ipv4", action="store_true", help="print ipv4 only") + parser.add_argument("-6", "--ipv6", action="store_true", help="print ipv6 only") + parser.add_argument( + "-e", "--export", action="store_true", help="export registry to json" + ) args = parser.parse_args() - if args.max < 0 or args.max6 < 0 or args.max > IPv4Network(0).max_prefixlen or args.max6 > IPv6Network(0).max_prefixlen: - parser.error('check your max prefix length') - - roa4 = roa6 = list() - if args.ipv4: - roa4 = neonet_route2roa('route') - elif args.ipv6: - roa6 = neonet_route2roa('route6', True) - else: - roa4 = neonet_route2roa('route') - roa6 = neonet_route2roa('route6', True) - - roa4 = [r for r in roa4 if r['prefix'].prefixlen <= args.max or r['prefix'].prefixlen == IPv4Network(0).max_prefixlen] - roa6 = [r for r in roa6 if r['prefix'].prefixlen <= args.max6] - - for r in roa4: - if r['prefix'].prefixlen == IPv4Network(0).max_prefixlen: - r['maxLength'] = IPv4Network(0).max_prefixlen - else: - r['maxLength'] = args.max - for r in roa6: - r['maxLength'] = args.max6 - for r in (*roa4, *roa6): - r['prefix'] = r['prefix'].with_prefixlen - - - output = "" - VALID_KEYS = ('asn', 'prefix', 'maxLength') - if args.export: - import json, time - current = int(time.time()) - # people has [asns], asn has [route] - d_output = {"metadata": {"generated": current, "valid": current+14*86400}, "people": dict()} - for asn, asi in ASNS.items(): - as_route4 = list() - as_route6 = list() - vkeys = [k for k in VALID_KEYS if k != 'asn'] - vkeys.append('netname') - for roa, as_route in ((roa4, as_route4), (roa6, as_route6)): - for r in roa: - if r['asn'] == asn: - as_route.append({k:v for k, v in r.items() if k in vkeys}) - owner = asi['owner'] - peopledict = d_output['people'].setdefault(owner, {"info": PEOPLE[owner], "asns": list()}) - peopledict['asns'].append({"asn": asn, **{k:v for k, v in ASNS[asn].items() if k != 'owner'}, - "routes": {'ipv4': as_route4, 'ipv6': as_route6}}) - output = json.dumps(d_output, indent=2) - elif args.json: - import json, time - current = int(time.time()) - d_output = {"metadata": {"counts": len(roa4)+len(roa6), "generated": current, "valid": current+14*86400}, "roas": list()} - for r in (*roa4, *roa6): - # some preprocessing - r['asn'] = "AS%d" % r['asn'] - for r in (*roa4, *roa6): - d_output['roas'].append({k:v for k, v in r.items() if k in VALID_KEYS}) - output = json.dumps(d_output, indent=2) - elif args.rfc8416: - import json - l_prefix = list() - d_output = {'slurmVersion': 1, 'validationOutputFilters': {'prefixFilters': list(), - 'bgpsecFilters': list()}, 'locallyAddedAssertions': {'bgpsecAssertions': list(), - 'prefixAssertions': l_prefix}} - for r in (*roa4, *roa6): - vkeys = ["netname", "maxLength", *VALID_KEYS] - substk = lambda k: "maxPrefixLength" if k == 'maxLength' else ("comment" if k == "netname" else k) - l_prefix.append({substk(k):v for k, v in r.items() if k in vkeys}) - output = json.dumps(d_output, indent=2) - else: - output += "# NeoNetwork ROA tool\n" - pattern = 'route %s max %d as %d;' - l_output = list() - rdict2list = lambda d: [d[k] for k in VALID_KEYS] - for (asn, prefix, maxlen) in [rdict2list(r) for r in (*roa4, *roa6)]: - l_output.append(pattern % (prefix, maxlen, asn)) - output += '\n'.join(l_output) - if not args.output or args.output == '-': + if ( + args.max < 0 + or args.max6 < 0 + or args.max > IPv4Network(0).max_prefixlen + or args.max6 > IPv6Network(0).max_prefixlen + ): + parser.error("check your max prefix length") + output = main(args) + if not args.output or args.output == "-": print(output) - else: + elif output: Path(args.output).write_text(output) - print('written to', args.output) + print("written to", args.output) From 476ddad70dd44c5bd093938b3f9af5cc0eb9c72a Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Sun, 24 May 2020 18:08:25 +0800 Subject: [PATCH 19/23] vpn: Updated WireGuard config --- vpn/wireguard.conf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vpn/wireguard.conf b/vpn/wireguard.conf index 2edcc00..20bfba3 100644 --- a/vpn/wireguard.conf +++ b/vpn/wireguard.conf @@ -1,8 +1,6 @@ [Interface] -Address = 10.127.x.x/32, fd80::/32 -PostUp = /path/to/wg-postup.sh 10.127.x.x/32 fd80::/32 -# Custom DNS -#DNS = 127.0.0.1 +Address = , +PostUp = /path/to/wg-postup.sh # Set MTU to 1412 if using PPP #MTU = 1412 Table = off @@ -10,7 +8,7 @@ ListenPort = PrivateKey = [Peer] -AllowedIPs = 0.0.0.0/0 +AllowedIPs = 0.0.0.0/0, ::0/0 PersistentKeepalive = 25 PublicKey = Endpoint = From 89662c7b7cd50a3b3fb8f322dba83abfe2ae9f31 Mon Sep 17 00:00:00 2001 From: Septs Date: Sun, 24 May 2020 22:04:25 +0800 Subject: [PATCH 20/23] update summary output --- .github/workflows/roa.yml | 2 +- .github/workflows/test-your-pr.yml | 2 +- scripts/roa.py | 92 +++++++++++++++++++----------- 3 files changed, 60 insertions(+), 36 deletions(-) diff --git a/.github/workflows/roa.yml b/.github/workflows/roa.yml index 0ff61b9..7fc88b5 100644 --- a/.github/workflows/roa.yml +++ b/.github/workflows/roa.yml @@ -29,7 +29,7 @@ jobs: eval "$(pyenv virtualenv-init -)" pyenv install 3.8.2 pyenv shell 3.8.2 - pip install toml + pip install toml tabulate - name: Run roa script shell: bash diff --git a/.github/workflows/test-your-pr.yml b/.github/workflows/test-your-pr.yml index 4cd0ce7..7466294 100644 --- a/.github/workflows/test-your-pr.yml +++ b/.github/workflows/test-your-pr.yml @@ -29,7 +29,7 @@ jobs: eval "$(pyenv virtualenv-init -)" pyenv install 3.8.2 pyenv shell 3.8.2 - pip install toml + pip install toml tabulate - name: Run roa script shell: bash diff --git a/scripts/roa.py b/scripts/roa.py index 95a4e9b..2e95e35 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -225,54 +225,78 @@ def make_roa_records(roa4, roa6): def make_summary(): + from tabulate import tabulate + entities = load_entities() asn_table = load_asn(entities) node_table = node_to_asn(set(asn_table.keys())) stream = StringIO() with redirect_stdout(stream): print("Entity table:") - print("{:20}{:20}{}".format("Name", "Telegram", "Email")) - for entity in sorted( - entities.values(), key=lambda entity: entity["name"].lower(), - ): - contact = entity.get("contact", {}) - email = contact.get("email", "") - telegram = contact.get("telegram", "") - print("{:20}{:20}{}".format(entity["name"], telegram, email)) + entity_table = tabulate( + ( + ( + entity["name"], + entity.get("contact", {}).get("email"), + entity.get("contact", {}).get("telegram"), + ) + for entity in entities.values() + ), + headers=["Name", "Email", "Telegram"], + tablefmt="presto", + ) + print(entity_table) print() print("AS table:") - print("{:15}{:<17}{:20}{}".format("Source", "ASN", "Owner", "Name")) - for asn, entity in sorted(asn_table.items(), key=lambda item: item[0]): - print( - "{:15}AS{:<15}{:20}{}".format( - entity["source"], asn, entity["owner"], entity["name"] - ) - ) + as_table = tabulate( + ( + (entity["source"], "AS{}".format(asn), entity["owner"], entity["name"]) + for asn, entity in sorted(asn_table.items(), key=lambda item: item[0]) + ), + headers=["Source", "ASN", "Owner", "Name"], + tablefmt="presto", + ) + print(as_table) print() print("Node table:") - print("{:<17}{}".format("ASN", "Name")) - for name, asn in sorted(node_table.items(), key=lambda item: item[1]): - print("AS{:<15}{}".format(asn, name)) + node_table = tabulate( + ( + ("AS{}".format(asn), name) + for name, asn in sorted(node_table.items(), key=lambda item: item[1]) + ), + headers=["ASN", "Name"], + tablefmt="presto", + ) + print(node_table) print() print("Peer table:") - peers = { - item.stem: entity["to-peer"] for item, entity in iter_toml_file("peer") - } - peers = [ - (upstream, downstream) - for upstream, downstream_list in peers.items() - for downstream in downstream_list - ] - print("{:>20} ~ {}".format("Upstream", "Downstream")) - for upstream, downstream in peers: - print("{:>20} ~ {}".format(upstream, downstream)) + peer_table = tabulate( + ( + (item.stem, downstream) + for item, entity in iter_toml_file("peer") + for downstream in entity["to-peer"] + ), + headers=["Upstream", "Downstream"], + tablefmt="presto", + colalign=("right",), + ) + print(peer_table) print() print("Route table:") - print("{:17}{:30}{:30}{}".format("ASN", "Name", "Prefix", "Supernet")) - for entity in route_to_roa(asn_table): - entity["prefix"] = str(entity["prefix"]) - entity["supernet"] = str(entity["supernet"]) if entity["supernet"] else "" - print("AS{asn:<15}{name:30}{prefix:30}{supernet}".format_map(entity)) + route_table = tabulate( + ( + ( + "AS{asn}".format_map(entity), + entity["name"], + entity["prefix"] or "", + entity["supernet"] or "", + ) + for entity in route_to_roa(asn_table) + ), + headers=["ASN", "Name", "Prefix", "Supernet"], + tablefmt="presto", + ) + print(route_table) return stream.getvalue() From 6f38dacaa78fd9a57939d0917f0f8bf7716d4a62 Mon Sep 17 00:00:00 2001 From: Henry Chen Date: Sun, 24 May 2020 03:38:07 -0700 Subject: [PATCH 21/23] route: add AS4201270003 --- route/AS4201270003.toml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 route/AS4201270003.toml diff --git a/route/AS4201270003.toml b/route/AS4201270003.toml new file mode 100644 index 0000000..663fcae --- /dev/null +++ b/route/AS4201270003.toml @@ -0,0 +1,9 @@ +["fd10:127:1919:810::/64"] +type = "subnet" +name = "chenx97" +description = "chenx97 but the subnet smells" + +["10.127.89.3/32"] +type = "loopback" +name = "chenx97-conoha" +description = "Debian 10/frr" From 7292a96c81797ab4ca56f3bcabf35fbc8f7cae92 Mon Sep 17 00:00:00 2001 From: Henry Chen Date: Sun, 24 May 2020 03:44:46 -0700 Subject: [PATCH 22/23] nodes.dot, nodes.svg: update --- nodes.dot | 2 +- nodes.svg | 528 +++++++++++++++++++++++++++--------------------------- 2 files changed, 267 insertions(+), 263 deletions(-) diff --git a/nodes.dot b/nodes.dot index b8e070b..81bb371 100644 --- a/nodes.dot +++ b/nodes.dot @@ -22,7 +22,7 @@ digraph "NeoNetwork Nodes" magicneko_CN01 [label="M-CN1\n(10.127.4.101,\nfd10:127:0233:7170:2021::10.127.4.101)"] staph [label="s.aureus.ga\n(10.127.8.185\nfd10:127:7::1)\n(AS4201270007)"] staph_CN [label="cnhome.aureus.ga\n(10.127.8.187\nfd10:127:7::3)\n(AS4201270007)"] - chenx97 [label="chenx97.neocloud.tw\n(AS4201270003)"] + chenx97 [label="chenx97.neocloud.tw\n(10.127.89.3)\n(fd10:127:1919:810::893)\n(AS4201270003)"] JerryXiao [label="jpn.neo.jerryxiao.cc\n(10.127.8.193)"] JerryXiao_SH01 [label="jerryxiao-sh01\n(10.127.8.195)"] JerryXiao_HK01 [label="jerryxiao-hk01\n(10.127.8.194)"] diff --git a/nodes.svg b/nodes.svg index 4261ed2..a165937 100644 --- a/nodes.svg +++ b/nodes.svg @@ -1,623 +1,627 @@ - - - + + NeoNetwork Nodes - -NeoNetwork Nodes + +NeoNetwork Nodes cluster_AS4201270000 - -NeoNetwork (AS4201270000) + +NeoNetwork (AS4201270000) cluster_4201270008 - -MagicNeko Network Internet exchange (AS4201270008) + +MagicNeko Network Internet exchange (AS4201270008) cluster_4201270006 - -Jerry Network (4201270006) + +Jerry Network (4201270006) c - -caasih.neocloud.tw -(10.127.0.1) + +caasih.neocloud.tw +(10.127.0.1) staph - -s.aureus.ga -(10.127.8.185) -(AS4201270007) + +s.aureus.ga +(10.127.8.185 +fd10:127:7::1) +(AS4201270007) c->staph - - - + + + ucbvax - -router.neocloud.tw -(10.127.255.2) + +router.neocloud.tw +(10.127.255.2) ucbvax->c - - - + + + chenx97 - -chenx97.neocloud.tw -(AS4201270003) + +chenx97.neocloud.tw +(10.127.89.3) +(fd10:127:1919:810::893) +(AS4201270003) ucbvax->chenx97 - - - + + + septs - -bgp.septs.me -(AS4201270001) + +bgp.septs.me +(AS4201270001) ucbvax->septs - - - + + + np11 - -NeoPDP-11 -(10.127.255.1, -10.127.1.1) + +NeoPDP-11 +(10.127.255.1, +10.127.1.1) np11->c - - + + np11->ucbvax - - + + pan - -r2.neocloud.tw -(10.127.3.1) + +r2.neocloud.tw +(10.127.3.1) np11->pan - - + + ns - -NeoSystem -(10.127.255.80) + +NeoSystem +(10.127.255.80) ns->ucbvax - - + + ns->pan - - + + megumiLHS - -megumi.yukipedia.cf -(AS4242421037) + +megumi.yukipedia.cf +(AS4242421037) megumiLHS->ucbvax - - - + + + megumiLHS->septs - - - + + + pan->ucbvax - - - + + + magicneko_JP03 - -M-JP3 -(10.127.4.15, -fd10:127:0233:7170:2021::10.127.4.15) + +M-JP3 +(10.127.4.15, +fd10:127:0233:7170:2021::10.127.4.15) pan->magicneko_JP03 - - - + + + icecat_Explosion - -MagicNeko P2P network interconnection + +MagicNeko P2P network interconnection icecat_Notebook - -NextMoe Group Access Network -(4201270005) -(10.127.233.1, -fd10:127:0233:1c3c::1) + +NextMoe Group Access Network +(4201270005) +(10.127.233.1, +fd10:127:0233:1c3c::1) magicneko_HK01 - -M-HK1 -(10.127.4.1, -fd10:127:0233:7170:2021::10.127.4.1) + +M-HK1 +(10.127.4.1, +fd10:127:0233:7170:2021::10.127.4.1) icecat_Notebook->magicneko_HK01 - - + + magicneko_JP02 - -M-JP2 -(10.127.4.13, -fd10:127:0233:7170:2021::10.127.4.13) + +M-JP2 +(10.127.4.13, +fd10:127:0233:7170:2021::10.127.4.13) icecat_Notebook->magicneko_JP02 - - + + magicneko_RU01 - -M-RU1 -(10.127.4.14, -fd10:127:0233:7170:2021::10.127.4.14) + +M-RU1 +(10.127.4.14, +fd10:127:0233:7170:2021::10.127.4.14) icecat_Notebook->magicneko_RU01 - - + + icecat_Notebook->magicneko_JP03 - - + + magicneko_CN01 - -M-CN1 -(10.127.4.101, -fd10:127:0233:7170:2021::10.127.4.101) + +M-CN1 +(10.127.4.101, +fd10:127:0233:7170:2021::10.127.4.101) icecat_Notebook->magicneko_CN01 - - + + magicneko_HK01->icecat_Explosion - - + + magicneko_HK02 - -M-HK2 -(10.127.4.10, -fd10:127:0233:7170:2021::10.127.4.10) + +M-HK2 +(10.127.4.10, +fd10:127:0233:7170:2021::10.127.4.10) magicneko_HK02->ucbvax - - - + + + magicneko_HK02->icecat_Explosion - - + + SUNNET - -SUNNET -(10.127.11.0/24) -(AS4242423088) + +SUNNET +(10.127.11.0/24) +(AS4242423088) magicneko_HK02->SUNNET - - - + + + magicneko_JP01 - -M-JP1 -(10.127.4.11, -fd10:127:0233:7170:2021::10.127.4.11) + +M-JP1 +(10.127.4.11, +fd10:127:0233:7170:2021::10.127.4.11) magicneko_JP01->icecat_Explosion - - + + magicneko_HK03 - -M-HK3 -(10.127.4.12, -fd10:127:0233:7170:2021::10.127.4.12) + +M-HK3 +(10.127.4.12, +fd10:127:0233:7170:2021::10.127.4.12) magicneko_HK03->icecat_Explosion - - + + magicneko_JP02->icecat_Explosion - - + + magicneko_RU01->icecat_Explosion - - + + magicneko_RU01->staph - - - + + + magicneko_RU01->septs - - - + + + magicneko_JP03->megumiLHS - - - + + + magicneko_JP03->icecat_Explosion - - + + magicneko_JP03->chenx97 - - - + + + JerryXiao - -jpn.neo.jerryxiao.cc -(10.127.8.193) + +jpn.neo.jerryxiao.cc +(10.127.8.193) magicneko_JP03->JerryXiao - - - + + + magicneko_JP03->septs - - - + + + frank_hsinchu - -Frank_Hsinchu -(10.127.255.56) -(AS4201270004) + +Frank_Hsinchu +(10.127.255.56) +(AS4201270004) magicneko_JP03->frank_hsinchu - - - + + + magicneko_CN01->icecat_Explosion - - + + staph_CN - -cnhome.aureus.ga -(10.127.8.187) -(AS4201270007) + +cnhome.aureus.ga +(10.127.8.187 +fd10:127:7::3) +(AS4201270007) staph->staph_CN - - + + staph->septs - - - + + + santost12 - -Santost12 -(10.127.69.1) -(AS4201270009) + +Santost12 +(10.127.69.1) +(AS4201270009) staph->santost12 - - - + + + JerryXiao->ucbvax - - - + + + JerryXiao_SH01 - -jerryxiao-sh01 -(10.127.8.195) + +jerryxiao-sh01 +(10.127.8.195) JerryXiao->JerryXiao_SH01 - - - + + + JerryXiao_HK01 - -jerryxiao-hk01 -(10.127.8.194) + +jerryxiao-hk01 +(10.127.8.194) JerryXiao->JerryXiao_HK01 - - - + + + JerryXiao->septs - - - + + + JerryXiao_SH01->JerryXiao_HK01 - - - + + + dfceaef - -dfceaef -(10.127.8.64/26) -(AS4242420140) + +dfceaef +(10.127.8.64/26) +(AS4242420140) JerryXiao_SH01->dfceaef - - - + + + JerryXiao_HK02 - -jerryxiao-hk02 -(10.127.8.196) + +jerryxiao-hk02 +(10.127.8.196) JerryXiao_HK01->JerryXiao_HK02 - - - + + + septs->frank_hsinchu - - - + + + lantian - -lantian -(AS4201270010) + +lantian +(AS4201270010) lantian->JerryXiao - - - + + + lantian->septs - - - + + + santost12->magicneko_JP03 - - + + NNPCC - -NNPCC + +NNPCC NNPCC->np11 - - - + + + NeoBOX - -NeoBOX + +NeoBOX NeoBOX->np11 - - - + + + cklvax - -cklvax + +cklvax cklvax->np11 - - - + + + NeoStorage - -NeoStorage + +NeoStorage NeoStorage->np11 - - - + + + From 4fc4de3e910d4d572c1092976161851ad429a88e Mon Sep 17 00:00:00 2001 From: Septs Date: Sun, 24 May 2020 22:57:20 +0800 Subject: [PATCH 23/23] expose route type --- scripts/roa.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/roa.py b/scripts/roa.py index 2e95e35..6a023ca 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -101,12 +101,9 @@ def route_to_roa(asn_table: dict): assert fields["name"] assert is_neo_network(fields["prefix"]) assert not fields["supernet"] or is_neo_network(fields["supernet"]) - yield fields + yield pick(fields, ["asn", "name", "type", "prefix", "supernet"]) - entities = ( - pick(route, ["asn", "name", "prefix", "supernet"]) for route in make_route() - ) - entities = sorted(entities, key=lambda item: item["asn"]) + entities = sorted(make_route(), key=lambda item: item["asn"]) prefixes = [item["prefix"] for item in entities] for net1, net2 in combinations( sorted(entities, key=lambda net: net["prefix"].prefixlen), 2 @@ -288,12 +285,13 @@ def make_summary(): ( "AS{asn}".format_map(entity), entity["name"], + entity["type"], entity["prefix"] or "", entity["supernet"] or "", ) for entity in route_to_roa(asn_table) ), - headers=["ASN", "Name", "Prefix", "Supernet"], + headers=["ASN", "Name", "Type", "Prefix", "Supernet"], tablefmt="presto", ) print(route_table)