diff --git a/README.md b/README.md index 44359c55b..b25a8ccc4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -*This repo is https://git.dn42.dev/dn42/registry +*This repo is https://git.dn42.dev/dn42/registry If you are using a different url, please update as soon as possible* # Guide for creating a Pull Request @@ -12,9 +12,9 @@ git clone git@git.dn42.dev:dn42/registry.git 2. **Create a branch for your changes** The name of the branch ***must*** follow a specific format: -`-YYYYMMDD/` - - `` is your gitea username. - - `YYYYMMDD` is the current date. +`-YYYYMMDD/` + - `` is your gitea username. + - `YYYYMMDD` is the current date. - `` is a descriptive name for your change. The branch must be created in the registry on the date described in the branch name, so create the branch and push it to the registry immediately. @@ -50,7 +50,7 @@ git commit 4. **Push your changes back to the registry** -Remember to squash your commits and sign them using your MNTNER [authentication method](https://dn42.dev/howto/Registry-Authentication). +Remember to squash your commits and sign them using your MNTNER [authentication method](https://dn42.dev/howto/Registry-Authentication). It is also good practice to rebase your work on top of any other changes that may have happened on the master branch. ```sh @@ -60,7 +60,7 @@ git fetch origin master # ensure you are using your new branch -git checkout burble-20200704/mychange +git checkout burble-20200704/mychange # rebase your branch on top of the master # @@ -84,17 +84,17 @@ In the gitea GUI, select your branch, check your changes again for a final time If you are using SSH authentication, please post the full commit hash that you signed and SSH signature in to the PR comments. -Your changes will now go through automatic checking and then manual review by the registry maintainers. +Your changes will now go through automatic checking and then manual review by the registry maintainers. 6. **Making updates** -If you need to change your PR to fix review issues simply make the updates to your branch and follow the process in (4) to rebase, squash and sign your changes again. -Please remember to do this for every update. +If you need to change your PR to fix review issues simply make the updates to your branch and follow the process in (4) to rebase, squash and sign your changes again. +Please remember to do this for every update. # Gitea Usage -The DN42 registry is a community resource for *your* benefit. +The DN42 registry is a community resource for *your* benefit. Whilst registered users are free to create and use their own repositories, please be considerate in your usage. - Repositories should be related to DN42 @@ -103,9 +103,9 @@ Whilst registered users are free to create and use their own repositories, pleas # Data Privacy -Gitea and the DN42 registry contains personal information for users who are registered in DN42; this information is stored in Canada and viewable by any registered member. In addition, anyone with access to the repository is able to make their own copies of the registry, which they may then process or transfer in arbitrary ways. You must assume that all data entered in to the registry cannot be kept private and will be made publically available. +Gitea and the DN42 registry contains personal information for users who are registered in DN42; this information is stored in Canada and viewable by any registered member. In addition, anyone with access to the repository is able to make their own copies of the registry, which they may then process or transfer in arbitrary ways. You must assume that all data entered in to the registry cannot be kept private and will be made publically available. -Any personal information stored in the registry is optional and voluntarily provided by you. Whilst the registry maintainers will make best efforts to update or delete personal data, you must accept that the technical restrictions of git may make this impossible and that your information will likely have been distributed beyond the control of the registry maintainers. +Any personal information stored in the registry is optional and voluntarily provided by you. Whilst the registry maintainers will make best efforts to update or delete personal data, you must accept that the technical restrictions of git may make this impossible and that your information will likely have been distributed beyond the control of the registry maintainers. If this is not acceptable for you, you must not upload your personal details to the registry. diff --git a/data/as-set/AS4242421050:AS-TRANSIT b/data/as-set/AS4242421050:AS-TRANSIT index e5fac5ad8..38e00fff7 100644 --- a/data/as-set/AS4242421050:AS-TRANSIT +++ b/data/as-set/AS4242421050:AS-TRANSIT @@ -23,12 +23,14 @@ remarks: GATUNO-MNT members: AS4242420180 remarks: MARROPAX-MNT members: AS4242420880 -remarks: OWENSRESEARCH-MNT +remarks: OWENSRESEARCH-MNT members: AS4242421099 remarks: ANDROW-MNT members: AS4242422575 remarks: MOE-MNT members: AS4242422464 +remarks: JLU5-MNT +members: AS4242421080 admin-c: NAPSTERBATER-DN42 tech-c: NAPSTERBATER-DN42 mnt-by: NAPSTERBATER-MNT diff --git a/data/aut-num/AS4242422660 b/data/aut-num/AS135395 similarity index 51% rename from data/aut-num/AS4242422660 rename to data/aut-num/AS135395 index e075439bd..2abb4dbfe 100644 --- a/data/aut-num/AS4242422660 +++ b/data/aut-num/AS135395 @@ -1,6 +1,6 @@ -aut-num: AS4242422660 -as-name: HERTZ NET +aut-num: AS135395 +as-name: HERTZ-AS admin-c: HERTZ-DN42 tech-c: HERTZ-DN42 mnt-by: HERTZ-MNT -source: DN42 +source: APNIC diff --git a/data/aut-num/AS4201270017 b/data/aut-num/AS4201270017 new file mode 100644 index 000000000..24ec72307 --- /dev/null +++ b/data/aut-num/AS4201270017 @@ -0,0 +1,8 @@ +aut-num: AS4201270017 +as-name: Cain's Home Network +descr: NextMoe GUser +admin-c: CAINSAKURA-NEONETWORK +tech-c: CAINSAKURA-NEONETWORK +remarks: Imported from neonetwork, do not edit! +mnt-by: DN42-MNT +source: NEONETWORK diff --git a/data/aut-num/AS4242420977 b/data/aut-num/AS4242420977 new file mode 100644 index 000000000..cfc41963e --- /dev/null +++ b/data/aut-num/AS4242420977 @@ -0,0 +1,16 @@ +aut-num: AS4242420977 +as-name: Moerail Network +remarks: +--------------------------------------+ + | New peers welcome! | + +--------------------------------------+ + | Peering requests: | + | arnie97@gmail.com | + | | + | Preferred protocols: | + | WireGuard, ZeroTier or GRE | + +--------------------------------------+ ++ +admin-c: ARNIE97-DN42 +tech-c: ARNIE97-DN42 +mnt-by: ARNIE97-MNT +source: DN42 diff --git a/data/aut-num/AS4242421050 b/data/aut-num/AS4242421050 index cabc3c3dd..24c2edadb 100644 --- a/data/aut-num/AS4242421050 +++ b/data/aut-num/AS4242421050 @@ -13,13 +13,13 @@ remarks: -------------------------------------------------------- remarks: Contact for peering : bjackson@napshome.net | IRC : Napsterbater remarks: -------------------------------------------------------- remarks: Peering Info : -remarks: - Primarily Wireguard, OpenVPN if necessary, maybe others? Just ask! +remarks: - Primarily Wireguard, OpenVPN if necessary, maybe others? Just ask! remarks: - Support Multi-Protocol over BGPv6 remarks: - Transit, Peering, or Downstream available. remarks: -------------------------------------------------------- remarks: Looking glass available: lg.napshome.dn42 lg.dn42.napshome.net remarks: -------------------------------------------------------- remarks: Peering Location : Atlanta, GA, US: atl1-us.dn42.napshome.net -remarks: Frankfurt, DE : ffm1-de.dn42.napshome.net -remarks: Manchester. UK : mcr1-uk.dn42.napshome.net +remarks: Frankfurt, DE : ffm1-de.dn42.napshome.net +remarks: Manchester. UK : mcr1-uk.dn42.napshome.net remarks: -------------------------------------------------------- diff --git a/data/aut-num/AS4242421907 b/data/aut-num/AS4242421907 new file mode 100644 index 000000000..da900fd0c --- /dev/null +++ b/data/aut-num/AS4242421907 @@ -0,0 +1,7 @@ +aut-num: AS4242421907 +as-name: MrGhosh Network +descr: MrGhosh AS +admin-c: MRGHOSH-DN42 +tech-c: MRGHOSH-DN42 +mnt-by: MRGHOSH-MNT +source: DN42 diff --git a/data/aut-num/AS4242423747 b/data/aut-num/AS4242423747 index 1051ee297..e39bd3b07 100644 --- a/data/aut-num/AS4242423747 +++ b/data/aut-num/AS4242423747 @@ -1,6 +1,6 @@ aut-num: AS4242423747 as-name: ZHYZ-AS -descr: Our email is zhihuiyuze.qq.com abd welcome to send us a message +descr: Our email is zhihuiyuze@gmail abd welcome to send us a message admin-c: ZHYZ-DN42 tech-c: ZHYZ-DN42 mnt-by: ZHYZ-MNT diff --git a/data/dns/as4242422777.dn42 b/data/dns/as4242422777.dn42 index 4b5c22970..4a4adbc36 100644 --- a/data/dns/as4242422777.dn42 +++ b/data/dns/as4242422777.dn42 @@ -3,5 +3,5 @@ admin-c: SOMNET-DN42 tech-c: SOMNET-DN42 mnt-by: SOMNET-MNT nserver: ns1.somnet.dn42 172.20.33.5 -nserver: ns1.somnet.dn42 fde7:32ae:ee77::5 +nserver: ns1.somnet.dn42 fde7:32ae:ee77:f001:e770::52 source: DN42 diff --git a/data/dns/fox.dn42 b/data/dns/fox.dn42 new file mode 100644 index 000000000..1d617d553 --- /dev/null +++ b/data/dns/fox.dn42 @@ -0,0 +1,10 @@ +domain: fox.dn42 +admin-c: KOALA-DN42 +tech-c: KOALA-DN42 +descr: Foxes +mnt-by: KOALA-MNT +mnt-by: HEXANET-MNT +nserver: h.delegation-servers.dn42 +ds-rdata: 28104 15 2 d58969c6a8371cb5a37e04071833319175669f4092e5f276482186489ee0a3c9 +ds-rdata: 28104 15 4 69fbf6cef10b4cb3df71d9e38865e6264502e94fb635f9f69aa5baf5f109360233a40aaa076836200d087368542956f1 +source: DN42 diff --git a/data/dns/hertz.dn42 b/data/dns/hertz.dn42 index e786195db..a37dca6fb 100644 --- a/data/dns/hertz.dn42 +++ b/data/dns/hertz.dn42 @@ -2,6 +2,5 @@ domain: hertz.dn42 admin-c: HERTZ-DN42 tech-c: HERTZ-DN42 mnt-by: HERTZ-MNT -nserver: ns-935.awsdns-52.net -nserver: ns-1255.awsdns-28.org +nserver: ns.hertz.dn42 172.20.29.78 source: DN42 diff --git a/data/dns/hosting.dn42 b/data/dns/hosting.dn42 new file mode 100644 index 000000000..d471d6309 --- /dev/null +++ b/data/dns/hosting.dn42 @@ -0,0 +1,7 @@ +domain: hosting.dn42 +admin-c: MEBUS-DN42 +tech-c: MEBUS-DN42 +descr: hosting.dn42 Domain +mnt-by: MEBUS-MNT +nserver: ns1.mebus.dn42 fd88:c7e:c7b7::1 +source: DN42 diff --git a/data/dns/koala.dn42 b/data/dns/koala.dn42 new file mode 100644 index 000000000..f597fe48c --- /dev/null +++ b/data/dns/koala.dn42 @@ -0,0 +1,10 @@ +domain: koala.dn42 +admin-c: KOALA-DN42 +tech-c: KOALA-DN42 +descr: Rawr IMMA Drop Bear +mnt-by: KOALA-MNT +mnt-by: HEXANET-MNT +nserver: h.delegation-servers.dn42 +ds-rdata: 63771 15 2 6741668fcd31dcd9015d53edac53a50d77a509d986c876424db883895749a108 +ds-rdata: 63771 15 4 254572571e1f213a9df9d87f33564f7c10e7c138774398f3a7880d30134ae855d0a536a6c8ecfb1180e3afa7590917ee +source: DN42 diff --git a/data/dns/matrix.dn42 b/data/dns/matrix.dn42 new file mode 100644 index 000000000..6596507ec --- /dev/null +++ b/data/dns/matrix.dn42 @@ -0,0 +1,7 @@ +domain: matrix.dn42 +admin-c: SOMNET-DN42 +tech-c: SOMNET-DN42 +mnt-by: SOMNET-MNT +nserver: ns1.matrix.dn42 172.20.33.5 +nserver: ns1.matrix.dn42 fde7:32ae:ee77:f001:e770::52 +source: DN42 diff --git a/data/dns/moerail.dn42 b/data/dns/moerail.dn42 new file mode 100644 index 000000000..13d42acd6 --- /dev/null +++ b/data/dns/moerail.dn42 @@ -0,0 +1,9 @@ +domain: moerail.dn42 +admin-c: ARNIE97-DN42 +tech-c: ARNIE97-DN42 +mnt-by: ARNIE97-MNT +nserver: ns1.moerail.dn42 172.20.128.197 +nserver: ns1.moerail.dn42 fdec:c6a:4002::7 +nserver: ns2.moerail.dn42 172.20.128.193 +nserver: ns2.moerail.dn42 fdcc:c6a:4002::3 +source: DN42 diff --git a/data/dns/mrghosh.dn42 b/data/dns/mrghosh.dn42 new file mode 100644 index 000000000..ad00e615c --- /dev/null +++ b/data/dns/mrghosh.dn42 @@ -0,0 +1,8 @@ +domain: mrghosh.dn42 +descr: MrGhosh Network DN42 Website +admin-c: MRGHOSH-DN42 +tech-c: MRGHOSH-DN42 +mnt-by: MRGHOSH-MNT +nserver: ns1.mrghosh.dn42 172.23.222.53 +nserver: ns1.mrghosh.dn42 fd42:4242:1907:53::1 +source: DN42 diff --git a/data/dns/somnet.dn42 b/data/dns/somnet.dn42 index e81f1a8d2..bc432c0a1 100644 --- a/data/dns/somnet.dn42 +++ b/data/dns/somnet.dn42 @@ -3,5 +3,5 @@ admin-c: SOMNET-DN42 tech-c: SOMNET-DN42 mnt-by: SOMNET-MNT nserver: ns1.somnet.dn42 172.20.33.5 -nserver: ns1.somnet.dn42 fde7:32ae:ee77::5 +nserver: ns1.somnet.dn42 fde7:32ae:ee77:f001:e770::52 source: DN42 diff --git a/data/dns/zhyz.dn42 b/data/dns/zhyz.dn42 new file mode 100644 index 000000000..32bf53473 --- /dev/null +++ b/data/dns/zhyz.dn42 @@ -0,0 +1,10 @@ +domain: zhyz.dn42 +descr: https://zhyz.ru email:zhihuiyuze@gmail.com +nserver: ns1.zhyz.dn42 172.21.75.65 +nserver: ns1.zhyz.dn42 d37:03b3:cae6::65 +nserver: ns2.zhyz.dn42 172.21.75.66 +nserver: ns2.zhyz.dn42 d37:03b3:cae6::66 +admin-c: ZHYZ-DN42 +tech-c: ZHYZ-DN42 +mnt-by: ZHYZ-MNT +source: DN42 diff --git a/data/inet6num/fd10:127:234::_48 b/data/inet6num/fd10:127:234::_48 new file mode 100644 index 000000000..a2bc60dda --- /dev/null +++ b/data/inet6num/fd10:127:234::_48 @@ -0,0 +1,8 @@ +inet6num: fd10:0127:0234:0000:0000:0000:0000:0000 - fd10:0127:0234:ffff:ffff:ffff:ffff:ffff +cidr: fd10:127:234::/48 +netname: CainSakura-home-devices +admin-c: CAINSAKURA-NEONETWORK +tech-c: CAINSAKURA-NEONETWORK +remarks: Imported from neonetwork, do not edit! +mnt-by: DN42-MNT +source: NEONETWORK diff --git a/data/inet6num/fd42:4242:1907::_48 b/data/inet6num/fd42:4242:1907::_48 new file mode 100644 index 000000000..5558844ca --- /dev/null +++ b/data/inet6num/fd42:4242:1907::_48 @@ -0,0 +1,11 @@ +inet6num: fd42:4242:1907:0000:0000:0000:0000:0000 - fd42:4242:1907:ffff:ffff:ffff:ffff:ffff +cidr: fd42:4242:1907::/48 +netname: MRGHOSH-V6-NET +descr: Network of MrGhosh +country: IN +admin-c: MRGHOSH-DN42 +tech-c: MRGHOSH-DN42 +mnt-by: MRGHOSH-MNT +nserver: ns1.mrghosh.dn42 +status: ASSIGNED +source: DN42 diff --git a/data/inet6num/fd42:4242:2660::_48 b/data/inet6num/fd42:4242:2660::_48 deleted file mode 100644 index cae9f1a44..000000000 --- a/data/inet6num/fd42:4242:2660::_48 +++ /dev/null @@ -1,11 +0,0 @@ -inet6num: fd42:4242:2660:0000:0000:0000:0000:0000 - fd42:4242:2660:ffff:ffff:ffff:ffff:ffff -netname: HERTZ_IPV6_01 -country: CN -admin-c: HERTZ-DN42 -tech-c: HERTZ-DN42 -mnt-by: HERTZ-MNT -nserver: ns-766.awsdns-31.net -nserver: ns-1474.awsdns-56.org -status: ASSIGNED -cidr: fd42:4242:2660::/48 -source: DN42 diff --git a/data/inet6num/fd5a:2663:7b48::_48 b/data/inet6num/fd5a:2663:7b48::_48 new file mode 100644 index 000000000..09363be18 --- /dev/null +++ b/data/inet6num/fd5a:2663:7b48::_48 @@ -0,0 +1,10 @@ +inet6num: fd5a:2663:7b48:0000:0000:0000:0000:0000 - fd5a:2663:7b48:ffff:ffff:ffff:ffff:ffff +netname: HERTZ_IPV6_01 +country: CN +admin-c: HERTZ-DN42 +tech-c: HERTZ-DN42 +mnt-by: HERTZ-MNT +nserver: ns.hertz.dn42 +status: ASSIGNED +cidr: fd5a:2663:7b48::/48 +source: DN42 diff --git a/data/inet6num/fdec:c6a:4002::_48 b/data/inet6num/fdec:c6a:4002::_48 new file mode 100644 index 000000000..802396c5d --- /dev/null +++ b/data/inet6num/fdec:c6a:4002::_48 @@ -0,0 +1,11 @@ +inet6num: fdec:0c6a:4002:0000:0000:0000:0000:0000 - fdec:0c6a:4002:ffff:ffff:ffff:ffff:ffff +cidr: fdec:c6a:4002::/48 +netname: MOERAIL-NG +descr: Moerail Network NG +admin-c: ARNIE97-DN42 +tech-c: ARNIE97-DN42 +mnt-by: ARNIE97-MNT +status: ASSIGNED +nserver: ns1.moerail.dn42 +nserver: ns2.moerail.dn42 +source: DN42 diff --git a/data/inetnum/10.127.234.0_24 b/data/inetnum/10.127.234.0_24 new file mode 100644 index 000000000..1d4e17470 --- /dev/null +++ b/data/inetnum/10.127.234.0_24 @@ -0,0 +1,8 @@ +inetnum: 10.127.234.0 - 10.127.234.255 +cidr: 10.127.234.0/24 +netname: CainSakura-home-devices +admin-c: CAINSAKURA-NEONETWORK +tech-c: CAINSAKURA-NEONETWORK +remarks: Imported from neonetwork, do not edit! +mnt-by: DN42-MNT +source: NEONETWORK diff --git a/data/inetnum/10.127.69.0_29 b/data/inetnum/10.127.69.0_27 similarity index 73% rename from data/inetnum/10.127.69.0_29 rename to data/inetnum/10.127.69.0_27 index 8e6f22b44..6ff401320 100644 --- a/data/inetnum/10.127.69.0_29 +++ b/data/inetnum/10.127.69.0_27 @@ -1,5 +1,5 @@ -inetnum: 10.127.69.0 - 10.127.69.7 -cidr: 10.127.69.0/29 +inetnum: 10.127.69.0 - 10.127.69.31 +cidr: 10.127.69.0/27 netname: santost12 admin-c: TYLER-NEONETWORK tech-c: TYLER-NEONETWORK diff --git a/data/inetnum/10.127.8.184_29 b/data/inetnum/10.127.8.160_27 similarity index 72% rename from data/inetnum/10.127.8.184_29 rename to data/inetnum/10.127.8.160_27 index ddf215a07..eb54dc114 100644 --- a/data/inetnum/10.127.8.184_29 +++ b/data/inetnum/10.127.8.160_27 @@ -1,5 +1,5 @@ -inetnum: 10.127.8.184 - 10.127.8.191 -cidr: 10.127.8.184/29 +inetnum: 10.127.8.160 - 10.127.8.191 +cidr: 10.127.8.160/27 netname: StaphNet admin-c: STAPH-NEONETWORK tech-c: STAPH-NEONETWORK diff --git a/data/inetnum/172.20.128.192_26 b/data/inetnum/172.20.128.192_26 new file mode 100644 index 000000000..9bef8e69f --- /dev/null +++ b/data/inetnum/172.20.128.192_26 @@ -0,0 +1,12 @@ +inetnum: 172.20.128.192 - 172.20.128.255 +cidr: 172.20.128.192/26 +netname: MOERAIL +descr: Moerail Network +country: CN +admin-c: ARNIE97-DN42 +tech-c: ARNIE97-DN42 +mnt-by: ARNIE97-MNT +status: ASSIGNED +nserver: ns1.moerail.dn42 +nserver: ns2.moerail.dn42 +source: DN42 diff --git a/data/inetnum/172.20.165.128_26 b/data/inetnum/172.20.165.128_26 new file mode 100644 index 000000000..8ce0b4887 --- /dev/null +++ b/data/inetnum/172.20.165.128_26 @@ -0,0 +1,6 @@ +inetnum: 172.20.165.128 - 172.20.165.191 +cidr: 172.20.165.128/26 +netname: MEBUS-LEGACY +status: ASSIGNED +mnt-by: MEBUS-MNT +source: DN42 diff --git a/data/inetnum/172.20.29.64_28 b/data/inetnum/172.20.29.64_28 index 236e49157..d96a4675e 100644 --- a/data/inetnum/172.20.29.64_28 +++ b/data/inetnum/172.20.29.64_28 @@ -4,8 +4,7 @@ country: CN admin-c: HERTZ-DN42 tech-c: HERTZ-DN42 mnt-by: HERTZ-MNT -nserver: ns-1162.awsdns-17.org -nserver: ns-1990.awsdns-56.co.uk +nserver: ns.hertz.dn42 status: ASSIGNED cidr: 172.20.29.64/28 source: DN42 diff --git a/data/inetnum/172.23.222.32_27 b/data/inetnum/172.23.222.32_27 new file mode 100644 index 000000000..db258f335 --- /dev/null +++ b/data/inetnum/172.23.222.32_27 @@ -0,0 +1,10 @@ +inetnum: 172.23.222.32 - 172.23.222.63 +cidr: 172.23.222.32/27 +netname: MRGHOSH-V4-NET +country: IN +admin-c: MRGHOSH-DN42 +tech-c: MRGHOSH-DN42 +mnt-by: MRGHOSH-MNT +nserver: ns1.mrghosh.dn42 +status: ASSIGNED +source: DN42 diff --git a/data/mntner/ARNIE97-MNT b/data/mntner/ARNIE97-MNT new file mode 100644 index 000000000..151aebddb --- /dev/null +++ b/data/mntner/ARNIE97-MNT @@ -0,0 +1,7 @@ +mntner: ARNIE97-MNT +admin-c: ARNIE97-DN42 +tech-c: ARNIE97-DN42 +mnt-by: ARNIE97-MNT +auth: pgp-fingerprint 945C949DA1AE31D8B4CBD6D7514233F0DFC5BA92 +auth: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBMzbeDlI3Ulo9VcrYiOoAUhbxLHhKJsJ+yskVWjvnI8 +source: DN42 diff --git a/data/mntner/FEUERROT-MNT b/data/mntner/FEUERROT-MNT index ed3c8f861..9f195c614 100644 --- a/data/mntner/FEUERROT-MNT +++ b/data/mntner/FEUERROT-MNT @@ -2,4 +2,6 @@ mntner: FEUERROT-MNT admin-c: FEUERROT-DN42 tech-c: FEUERROT-DN42 mnt-by: FEUERROT-MNT +auth: pgp-fingerprint CA9470EA89B2F6D6E09BEE261E7523CA911AC822 +auth: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMONNzx0+MKzDfjy9YDBWQyZ94ZjOCPw+T/VHnNqa7hk source: DN42 diff --git a/data/mntner/FF02-MNT b/data/mntner/FF02-MNT index 9befd087b..e37783923 100644 --- a/data/mntner/FF02-MNT +++ b/data/mntner/FF02-MNT @@ -4,3 +4,5 @@ admin-c: ELCH-DN42 tech-c: ELCH-DN42 mnt-by: FF02-MNT source: DN42 +auth: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC87aXr06N9N8rHFicJfQv9zkHW1saxY1yxXFgkNGeMiGSz2Vtgad9BBoQl3XU557cZhfMCabwRSU20YiCrAzcB9/8K8AQm/UTqHp7Ug1via2GDf7H/M7HXNrpLTAjiEV62KbmvlFGfNJ5lPsA3tk/y+41U79u4YleSaTfmtdjWuP7C7HcRJfVzTL4djrvGY82D2xj0HN8uioBVaJVmm0+YTzCzh2t07TxG1mYQNkjej0ICErMlpWkDiPG0qoSuqM0+9ARpMXVZh7AkkQSb8wgr7rYYwbeiUfqzUAfjIJDziQZREJ/sdh7ORBDFXdWexi4u6RHCia0U9vzS51YR6xb/SGGJljWtbcUR1pMDwzxUPWkeXNnzs3fSLktPKybf8PWUBy3OtV/Xg7kcSkZ8ALNmoYi8kq+xR07GHFbUB/tW7J4+mmo0+R18vBNyxfQPAO4ekZa/p52U1mRkHO8sjY16uvlFY/soykGtFjhEhFLHZpQkdhXrsRykFCbFGwMsXbtNmLYtbM5/lfXijEpREisMa3SLkbG7dYcBI1rL5h1AwGtjwYD54ftTTW82fW1kfbdnD/LBPNB2YL8qj6E05Y4ydIt2V8SwoyFe/jPvCyvMRm6vKHfiG/Gq8LYwsT7YyQ3ZhgAH5NBppCHdWig+bkoBNAsjGdeJyJiB9Kf3NSthow== +auth: pgp-fingerprint D3D2A0E31A9E5BE6AEA6C25CFD1E3799E3FC77A6 diff --git a/data/mntner/MRGHOSH-MNT b/data/mntner/MRGHOSH-MNT new file mode 100644 index 000000000..50fe33b0e --- /dev/null +++ b/data/mntner/MRGHOSH-MNT @@ -0,0 +1,7 @@ +mntner: MRGHOSH-MNT +descr: Sourav Ghosh - mrghosh maintainer +admin-c: MRGHOSH-DN42 +tech-c: MRGHOSH-DN42 +mnt-by: MRGHOSH-MNT +auth: pgp-fingerprint 70628E65BAE5158FA3493C26F590B26221E7BE39 +source: DN42 diff --git a/data/mntner/SOMNET-MNT b/data/mntner/SOMNET-MNT index 49e1f6668..4e53cca8f 100644 --- a/data/mntner/SOMNET-MNT +++ b/data/mntner/SOMNET-MNT @@ -2,5 +2,6 @@ mntner: SOMNET-MNT admin-c: SOMNET-DN42 tech-c: SOMNET-DN42 mnt-by: SOMNET-MNT +remarks: pin-sha256:OG9f6XD9Ztlzelwzu/hdStoOk2EQPiPhxHi5JFWI4eg= auth: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjPxYYseIDs2PoJoaLr9FYhlT95CZtdVyLCRnMgtpg+0rrH+m3E6Q7721aseX5sL4PozhZA/kf+btipIRdqlZruXJprR9eTazQghSmASX8SZOssUy3+k6pdQ2ObJu4AmKPDukBeihem16fUTztO/NGL7SjFu/BTzXwaySJDirIp8OubPaS7F199eXlfgQpU1xJuleY8ip/1+3dmECtXbr0F0GMbLVf6guzh7+ExEaL+JwQbKUQ4lQIJhatnUIxk7gLGWDCEsdYLJxNujuaVDHVjApEmTvEFAcZH0np7cjTtcLGGN0hZgPE3ghxOgyrgOLGWzSnHMVqF+CzqbgcBorl source: DN42 diff --git a/data/mntner/WALLE256-MNT b/data/mntner/WALLE256-MNT index 0661b1164..d411d98b0 100644 --- a/data/mntner/WALLE256-MNT +++ b/data/mntner/WALLE256-MNT @@ -1,4 +1,5 @@ mntner: WALLE256-MNT +auth: pgp-fingerprint AD085CF1EB9F7EA6C70CDBBEA533CB9C885B5E5B admin-c: WALLE256-DN42 tech-c: WALLE256-DN42 mnt-by: WALLE256-MNT diff --git a/data/mntner/ZHYZ-MNT b/data/mntner/ZHYZ-MNT index a2f591db1..7753b31a2 100644 --- a/data/mntner/ZHYZ-MNT +++ b/data/mntner/ZHYZ-MNT @@ -5,4 +5,4 @@ mnt-by: ZHYZ-MNT source: DN42 auth: pgp-fingerprint 3063182DC8DDC8295327D968F81C854AA3BF45F7 auth: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCkJnS/PblMLT3pzFwD+otLnP5WuD62YBsASTdKIspQZc41RCyVw8EBJzJH6OeJ/PmsFm6bdI8YakzK0K1EPkmybiorbznbu4w8gpUJdK5WundTzZS2xGCmPLJRoh1n4UlyF3j2+oEbQTamYKls9KX133vlzr86l0KdQrTNMHpJdWyRUJqRQrocrqSbMl3qWsvxJJuIca4vRN76Xkgrj1es6FZ763AWSLWXVKNXF+2n8RfjPH0NJRebxiee0HHjmExgc8najhbHmEp0fX+3mGrNCZERNkRptQwaQPNwsdvtvIW0NPEjIGJdEBkDO/QRdatXXQVLFTn7+/scrPuyi/Itdb62/wbbEyF06he99Kle4c9RBh1Y1k+IoEXkpI+lp0RY3yhBzZ3NQXDffnLnNeKhPIOpyGOSMCtbd8mZjvwPH7hfaAVlzvUhsMKBu/chtOyaj9oqJ4SuYK2PNIYrR36zksL1wVK+kzpOI9y/i62WzVMwNWxVrgfHqu2ySQKQ7ss= -remarks: The maintainer's QQ and telegram are 1722649517 zhihuiyuze +remarks: The maintainer's telegram are zhihuiyuze diff --git a/data/person/ARNIE97-DN42 b/data/person/ARNIE97-DN42 new file mode 100644 index 000000000..70579902d --- /dev/null +++ b/data/person/ARNIE97-DN42 @@ -0,0 +1,5 @@ +person: Arnie +contact: arnie97@gmail.com +nic-hdl: ARNIE97-DN42 +mnt-by: ARNIE97-MNT +source: DN42 diff --git a/data/person/CAINSAKURA-NEONETWORK b/data/person/CAINSAKURA-NEONETWORK new file mode 100644 index 000000000..3146477f1 --- /dev/null +++ b/data/person/CAINSAKURA-NEONETWORK @@ -0,0 +1,8 @@ +person: CainSakura +nic-hdl: CAINSAKURA-NEONETWORK +contact: github: CainSakura +contact: telegram: CainSakura +e-mail: cain@iloli.cc +remarks: Imported from neonetwork, do not edit! +mnt-by: DN42-MNT +source: NEONETWORK diff --git a/data/person/ELCH-DN42 b/data/person/ELCH-DN42 index 26f8b4dd7..ca749b2e0 100644 --- a/data/person/ELCH-DN42 +++ b/data/person/ELCH-DN42 @@ -1,5 +1,6 @@ person: elch -contact: xmpp:elch@ein-elch.de +contact: elch@ff02.net +pgp-fingerprint: 9F23651633635B68EC10122232920E2ACC4B075D nic-hdl: ELCH-DN42 mnt-by: FF02-MNT source: DN42 diff --git a/data/person/FEUERROT-DN42 b/data/person/FEUERROT-DN42 index 05957fd9b..3a46288a0 100644 --- a/data/person/FEUERROT-DN42 +++ b/data/person/FEUERROT-DN42 @@ -1,8 +1,6 @@ person: feuerrot e-mail: feuerrot@feuerrot.org contact: irc:feuerrot@hackint -contact: xmpp:feuerrot@jabber.ccc.de nic-hdl: FEUERROT-DN42 -pgp-fingerprint: CA9470EA89B2F6D6E09BEE261E7523CA911AC822 mnt-by: FEUERROT-MNT source: DN42 diff --git a/data/person/MOECAST-DN42 b/data/person/MOECAST-DN42 index 646e96d90..139d0472e 100644 --- a/data/person/MOECAST-DN42 +++ b/data/person/MOECAST-DN42 @@ -1,5 +1,6 @@ person: Liang Jingwen contact: liangjw@etlgr.com +contact: dn42@cas7.moe contact: telegram: @liangjw pgp-fingerprint: A04C56688622E1D51DB4ED5D263BDBB7ECAB32E4 nic-hdl: MOECAST-DN42 diff --git a/data/person/MRGHOSH-DN42 b/data/person/MRGHOSH-DN42 new file mode 100644 index 000000000..c91c5baf0 --- /dev/null +++ b/data/person/MRGHOSH-DN42 @@ -0,0 +1,9 @@ +person: Sourav Ghosh +e-mail: souravndp@yandex.com +pgp-fingerprint: 70628E65BAE5158FA3493C26F590B26221E7BE39 +contact: twitter:souravWB +www: https://sourav.eu.org +nic-hdl: MRGHOSH-DN42 +mnt-by: MRGHOSH-MNT +remarks: ... +source: DN42 diff --git a/data/person/TYLER-NEONETWORK b/data/person/TYLER-NEONETWORK index f6345d004..7801d3c82 100644 --- a/data/person/TYLER-NEONETWORK +++ b/data/person/TYLER-NEONETWORK @@ -1,7 +1,7 @@ person: Tyler nic-hdl: TYLER-NEONETWORK contact: github: santost12 -contact: telegram: xyz431 +contact: telegram: santost12 remarks: Imported from neonetwork, do not edit! mnt-by: DN42-MNT source: NEONETWORK diff --git a/data/person/WALLE256-DN42 b/data/person/WALLE256-DN42 index ef41e6df5..6389a133a 100644 --- a/data/person/WALLE256-DN42 +++ b/data/person/WALLE256-DN42 @@ -1,5 +1,6 @@ person: WallE256 - Radu Pogonariu -contact: dn42@xera.ro - https://keybase.io/walle256 +contact: dn42@radu.space - https://keybase.io/walle256 +pgp-fingerprint: AD085CF1EB9F7EA6C70CDBBEA533CB9C885B5E5B nic-hdl: WALLE256-DN42 mnt-by: WALLE256-MNT source: DN42 diff --git a/data/person/ZHYZ-DN42 b/data/person/ZHYZ-DN42 index 6429d87af..c13ab67de 100644 --- a/data/person/ZHYZ-DN42 +++ b/data/person/ZHYZ-DN42 @@ -1,5 +1,6 @@ person: zhihuiyuze -contact: zhihuiyuze@qq.com +contact: zhihuiyuze@gmail.com +contact: zhyz@zhyz.ru nic-hdl: ZHYZ-DN42 mnt-by: ZHYZ-MNT source: DN42 diff --git a/data/route/10.127.234.0_24 b/data/route/10.127.234.0_24 new file mode 100644 index 000000000..2310cb22c --- /dev/null +++ b/data/route/10.127.234.0_24 @@ -0,0 +1,8 @@ +route: 10.127.234.0/24 +origin: AS4201270017 +max-length: 29 +admin-c: CAINSAKURA-NEONETWORK +tech-c: CAINSAKURA-NEONETWORK +remarks: Imported from neonetwork, do not edit! +mnt-by: DN42-MNT +source: NEONETWORK diff --git a/data/route/10.127.69.0_29 b/data/route/10.127.69.0_27 similarity index 87% rename from data/route/10.127.69.0_29 rename to data/route/10.127.69.0_27 index bd6e703d5..4de6a93e5 100644 --- a/data/route/10.127.69.0_29 +++ b/data/route/10.127.69.0_27 @@ -1,4 +1,4 @@ -route: 10.127.69.0/29 +route: 10.127.69.0/27 origin: AS4201270009 max-length: 29 admin-c: TYLER-NEONETWORK diff --git a/data/route/10.127.8.184_29 b/data/route/10.127.8.160_27 similarity index 87% rename from data/route/10.127.8.184_29 rename to data/route/10.127.8.160_27 index 3dc5e1559..ce4762416 100644 --- a/data/route/10.127.8.184_29 +++ b/data/route/10.127.8.160_27 @@ -1,4 +1,4 @@ -route: 10.127.8.184/29 +route: 10.127.8.160/27 origin: AS4201270007 max-length: 29 admin-c: STAPH-NEONETWORK diff --git a/data/route/172.20.128.192_26 b/data/route/172.20.128.192_26 new file mode 100644 index 000000000..1453dc025 --- /dev/null +++ b/data/route/172.20.128.192_26 @@ -0,0 +1,5 @@ +route: 172.20.128.192/26 +descr: Moerail Network +origin: AS4242420977 +mnt-by: ARNIE97-MNT +source: DN42 diff --git a/data/route/172.20.165.128_26 b/data/route/172.20.165.128_26 new file mode 100644 index 000000000..e53257a5e --- /dev/null +++ b/data/route/172.20.165.128_26 @@ -0,0 +1,4 @@ +route: 172.20.165.128/26 +origin: AS4242420112 +mnt-by: MEBUS-MNT +source: DN42 diff --git a/data/route/172.20.29.64_28 b/data/route/172.20.29.64_28 index b8e2a0782..d16a9dfd3 100644 --- a/data/route/172.20.29.64_28 +++ b/data/route/172.20.29.64_28 @@ -1,4 +1,4 @@ route: 172.20.29.64/28 -origin: AS4242422660 +origin: AS135395 mnt-by: HERTZ-MNT source: DN42 diff --git a/data/route/172.21.75.64_26 b/data/route/172.21.75.64_26 index 61136f8fc..9245d6fd9 100644 --- a/data/route/172.21.75.64_26 +++ b/data/route/172.21.75.64_26 @@ -1,5 +1,5 @@ route: 172.21.75.64/26 -descr: Peer with me at zhihuiyuze@qq.com +descr: Peer with me at zhihuiyuze@gmail.com or zhyz@zhyz.ru origin: AS4242423747 mnt-by: ZHYZ-MNT source: DN42 diff --git a/data/route/172.23.222.32_27 b/data/route/172.23.222.32_27 new file mode 100644 index 000000000..f26b414c4 --- /dev/null +++ b/data/route/172.23.222.32_27 @@ -0,0 +1,4 @@ +route: 172.23.222.32/27 +origin: AS4242421907 +mnt-by: MRGHOSH-MNT +source: DN42 diff --git a/data/route6/fd10:127:234::_48 b/data/route6/fd10:127:234::_48 new file mode 100644 index 000000000..a2f04f6aa --- /dev/null +++ b/data/route6/fd10:127:234::_48 @@ -0,0 +1,8 @@ +route6: fd10:127:234::/48 +origin: AS4201270017 +max-length: 64 +admin-c: CAINSAKURA-NEONETWORK +tech-c: CAINSAKURA-NEONETWORK +remarks: Imported from neonetwork, do not edit! +mnt-by: DN42-MNT +source: NEONETWORK diff --git a/data/route6/fd37:3b3:cae6::_48 b/data/route6/fd37:3b3:cae6::_48 index 47a2859f7..84a33babf 100644 --- a/data/route6/fd37:3b3:cae6::_48 +++ b/data/route6/fd37:3b3:cae6::_48 @@ -1,5 +1,5 @@ route6: fd37:3b3:cae6::/48 -descr: Peer with me at zhihuiyuze@qq.com And telegram is zhihuiyuze +descr: Peer with me at zhihuiyuze@gmail.com And twitter is zhihuiyuze origin: AS4242423747 mnt-by: ZHYZ-MNT source: DN42 diff --git a/data/route6/fd42:4242:1907::_48 b/data/route6/fd42:4242:1907::_48 new file mode 100644 index 000000000..b1c33f03f --- /dev/null +++ b/data/route6/fd42:4242:1907::_48 @@ -0,0 +1,5 @@ +route6: fd42:4242:1907::/48 +origin: AS4242421907 +max-length: 48 +mnt-by: MRGHOSH-MNT +source: DN42 diff --git a/data/route6/fd42:4242:2660::_48 b/data/route6/fd42:4242:2660::_48 deleted file mode 100644 index 66d1b2281..000000000 --- a/data/route6/fd42:4242:2660::_48 +++ /dev/null @@ -1,4 +0,0 @@ -route6: fd42:4242:2660::/48 -origin: AS4242422660 -mnt-by: HERTZ-MNT -source: DN42 diff --git a/data/route6/fd5a:2663:7b48::_48 b/data/route6/fd5a:2663:7b48::_48 new file mode 100644 index 000000000..5700ef7da --- /dev/null +++ b/data/route6/fd5a:2663:7b48::_48 @@ -0,0 +1,4 @@ +route6: fd5a:2663:7b48::/48 +origin: AS135395 +mnt-by: HERTZ-MNT +source: DN42 diff --git a/data/route6/fdec:c6a:4002::_48 b/data/route6/fdec:c6a:4002::_48 new file mode 100644 index 000000000..449675d6d --- /dev/null +++ b/data/route6/fdec:c6a:4002::_48 @@ -0,0 +1,6 @@ +route6: fdec:c6a:4002::/48 +descr: Moerail Network NG +origin: AS4242420977 +max-length: 48 +mnt-by: ARNIE97-MNT +source: DN42 diff --git a/utils/registry/dn42/rpsl/__init__.py b/utils/registry/dn42/rpsl/__init__.py index d855f10c9..6a27b6f25 100644 --- a/utils/registry/dn42/rpsl/__init__.py +++ b/utils/registry/dn42/rpsl/__init__.py @@ -2,18 +2,18 @@ __version__ = "0.3.0" -from .filedom import FileDOM, Row, Value, index_files +from .file import FileDOM, Row, Value, index_files from .schema import SchemaDOM, Level, State from .transact import TransactDOM from .config import Config -from .nettree import NetTree, NetRecord, NetList -from .rspldom import RPSL +from .nettree import NetTree, NetRecord, NetList, as_net6 +from .rspl import RPSL __all__ = [ "FileDOM", "Row", "Value", "index_files", "SchemaDOM", "Level", "State", "TransactDOM", "Config", - "NetTree", "NetRecord", "NetList", + "NetTree", "NetRecord", "NetList", "as_net6", "RPSL", ] diff --git a/utils/registry/dn42/rpsl/config.py b/utils/registry/dn42/rpsl/config.py index f964aeec7..fe2d49e05 100644 --- a/utils/registry/dn42/rpsl/config.py +++ b/utils/registry/dn42/rpsl/config.py @@ -6,7 +6,7 @@ import os.path from dataclasses import dataclass from typing import Dict, Set, Tuple, Optional, TypeVar -from .filedom import FileDOM +from .file import FileDOM C = TypeVar('C', bound='Config') @@ -66,6 +66,11 @@ class Config: "return network parents" return set(self.network_owners.values()) + @property + def network_children(self) -> Set[str]: + "return network children" + return set(self.network_owners.keys()) - self.network_parents + @property def schema_dir(self) -> str: "get schema directory" diff --git a/utils/registry/dn42/rpsl/filedom.py b/utils/registry/dn42/rpsl/file.py similarity index 95% rename from utils/registry/dn42/rpsl/filedom.py rename to utils/registry/dn42/rpsl/file.py index 329bb0104..e5b39ae9a 100644 --- a/utils/registry/dn42/rpsl/filedom.py +++ b/utils/registry/dn42/rpsl/file.py @@ -55,6 +55,15 @@ class Value: """Format as key name""" return self.value.replace("/", "_").replace(" ", "") + @property + def as_spec(self) -> List[str]: + "get the spec definition" + fields = self.fields + i = fields.index(">") + if i is None: + return [] + return fields[i:] + class Row(NamedTuple): """DOM Row""" @@ -183,11 +192,10 @@ class FileDOM: return f"{self.namespace}.{self.schema}" @property - def index(self) -> Tuple[Tuple[str, str], Tuple[str, str]]: + def index(self) -> Tuple[str, str]: """generate index key/value pair""" name = self.src.split("/")[-1].replace("_", "/") - return ((f"{self.namespace}.{self.schema}", name), - (self.src, ",".join(self.mntner))) + return f"{self.namespace}.{self.schema}", name def __str__(self): length = 19 diff --git a/utils/registry/dn42/rpsl/metafile.py b/utils/registry/dn42/rpsl/metafile.py new file mode 100644 index 000000000..ce8afe83e --- /dev/null +++ b/utils/registry/dn42/rpsl/metafile.py @@ -0,0 +1,23 @@ +"Metafile" +from dataclasses import dataclass +from typing import Sequence, Generator + +from .rspl import RPSL +from .file import Value + + +@dataclass +class MetaFile: + "file" + obj_type: str + obj_name: str + + +class MetaDOM: + "metafile dom" + def __init__(self, lis: Sequence[MetaFile], rpsl: RPSL): + self.lis = lis + self.rpsl = rpsl + + def get(self, name: str) -> Generator[Value, None, None]: + "get values" diff --git a/utils/registry/dn42/rpsl/nettree.py b/utils/registry/dn42/rpsl/nettree.py index ab6b0b221..b85e28733 100644 --- a/utils/registry/dn42/rpsl/nettree.py +++ b/utils/registry/dn42/rpsl/nettree.py @@ -1,7 +1,7 @@ "Net Tree" from ipaddress import ip_network, IPv6Network -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Dict, List, Tuple, Optional, Generator, TypeVar NET = IPv6Network @@ -10,16 +10,33 @@ V4_NET = ip_network("::ffff:0.0.0.0/96") NT = TypeVar("NT", bound="NetTree") +def as_net6(value: str) -> IPv6Network: + """return value as an ip network""" + net = ip_network(value) + + if isinstance(net, IPv6Network): + return net + + n = net + return ip_network( + f"::FFFF:{n.network_address}/{n.prefixlen + 96}") + + @dataclass class NetRecord: "Network Record" network: NET policy: str status: str + is_leaf: bool = False @property def object_type(self) -> str: """object type""" + if self.is_leaf: + return "route" if V4_NET.supernet_of(self.network) \ + else "route6" + return "inetnum" if V4_NET.supernet_of(self.network) \ else "inet6num" @@ -35,6 +52,9 @@ class NetRecord: return self.network.with_prefixlen.replace("/", "_") + def __str__(self) -> str: + return f"{self.object_type}/{self.object_name}" + @dataclass class NetList: @@ -44,6 +64,7 @@ class NetList: level: int net: Optional[NetRecord] nets: List[NET] + routes: List[NetRecord] = field(default_factory=list) def in_net(self, i: NET) -> Tuple[bool, NET]: "find a network within a list of networks" @@ -57,39 +78,55 @@ class NetList: return found, net + def in_routes(self, i: NET) -> Tuple[bool, NET]: + "find a network within a list of networks" + found = False + net = None + for n in self.routes: + if n.network.supernet_of(i): + found = True + net = n + break + + return found, net + class NetTree: "Network Tree" - def __init__(self, nets: Optional[List[NET]] = None): + def __init__(self, + nets: Optional[List[NetRecord]] = None, + routes: Optional[List[NetRecord]] = None): self.tree = {} # type: Dict[NET, NetList] + if routes is None: + routes = [] if nets is not None: - self.make_tree(nets) + self.make_tree(nets, routes) def __getitem__(self, key): return self.tree[key] - def find_tree(self, ip: NET) -> Tuple[bool, int]: + def find_tree(self, ip: str) -> Generator[NetList, None, None]: """Find net in tree""" net = V6_NET current = self.tree[net] + needle = as_net6(ip) + yield current while True: - found, net = current.in_net(ip) - if not found: - return True, current.level + 1 + found, net = current.in_net(needle) + if found: + current = self.tree[net] + yield current + continue + break - if ip == net: - return True, current.level + 2 - - current = self.tree[net] - continue - - return False, 0 - - def make_tree(self, nets: List[NetRecord]): + def make_tree(self, + nets: List[NetRecord], + routes: List[NetRecord]): """build a network tree index""" root = V6_NET self.tree = {root: NetList(0, None, -1, None, [])} + index = 0 for index, net in enumerate(sorted( sorted(nets, key=lambda x: x.network), key=lambda x: x.network.prefixlen)): @@ -110,6 +147,23 @@ class NetTree: index, current.index, current.level + 1, net, []) break + for index, net in enumerate(sorted( + sorted(routes, key=lambda x: x.network), + key=lambda x: x.network.prefixlen), index): + + current = self.tree[root] + + while True: + found, n = current.in_net(net.network) + if found: + current = self.tree[n] + continue + + rec = NetRecord(net.network, "-", "-", True) + current.routes.append(rec) + + break + def write_csv(self, fn: str = ".netindex"): "write tree to csv" with open(fn, "w") as f: @@ -135,6 +189,19 @@ class NetTree: v.net.object_type, v.net.object_name, )]) + "\n") + for route in v.routes: + net_addr = route.network.network_address.exploded + net_pfx = route.network.prefixlen + yield ( + "|".join([str(i) for i in ( + f"{0:04d}|{v.index:04d}|{v.level+1:04d}", + net_addr, + net_pfx, + route.policy, + route.status, + route.object_type, + route.object_name, + )]) + "\n") @classmethod def read_csv(cls, fn) -> NT: @@ -146,15 +213,20 @@ class NetTree: if len(sp) != 9: continue net = ip_network(f"{sp[3]}/{sp[4]}") - rec = NetRecord(net, sp[5], sp[6]) - lis = NetList(sp[0], sp[1], sp[2], rec, []) - inttree[sp[0]] = lis - if sp[0] != sp[1]: - inttree[sp[1]].nets.append(net) + is_leaf = sp[7] in ("route", "route6") + rec = NetRecord(net, sp[5], sp[6], is_leaf) + if is_leaf: + inttree[sp[1]].routes.append(rec) + else: + lis = NetList(sp[0], sp[1], sp[2], rec, []) + inttree[sp[0]] = lis + + if sp[0] != sp[1]: + inttree[sp[1]].nets.append(net) nettree = {} for v in inttree.values(): nettree[v.net.network] = v c = cls() - c.tree = NetTree + c.tree = nettree return c diff --git a/utils/registry/dn42/rpsl/rspldom.py b/utils/registry/dn42/rpsl/rspl.py similarity index 70% rename from utils/registry/dn42/rpsl/rspldom.py rename to utils/registry/dn42/rpsl/rspl.py index 8af635cc5..98ea4ef52 100644 --- a/utils/registry/dn42/rpsl/rspldom.py +++ b/utils/registry/dn42/rpsl/rspl.py @@ -1,10 +1,10 @@ "RPSL" import os.path -from typing import Dict, List, Tuple, TypeVar, Optional, Generator +from typing import Dict, List, Tuple, TypeVar, Optional, Sequence -from .filedom import FileDOM -from .nettree import NetTree +from .file import FileDOM +from .nettree import NetTree, NetList from .schema import SchemaDOM, State from .transact import TransactDOM from .config import Config @@ -49,7 +49,7 @@ class RPSL: def append_index(self, dom: FileDOM): "append files to index" - key, value = dom.index + key, value = dom.index, (dom.src, ",".join(dom.mntner)) self._lookup[key] = value def scan_files(self, files: List[FileDOM]) -> State: @@ -67,24 +67,35 @@ class RPSL: def find(self, text: str, - schema: Optional[str] = None) -> Generator[FileDOM, None, None]: + schema: Optional[str] = None) -> Sequence[str]: "Find files that match text and schema" keys = [(schema, text)] if schema is None: keys = self._lookup.get(text, []) + return [self._files[i] for i in keys] + + def related( + self, + key: Tuple[str, str]) -> Sequence[str]: + "Get files related to file" related = set() + for link in self.links(key): + key = (link[1], link[2]) + related.add(key) - for i in keys: - yield self.load_file(self._files[i]) - for link in self.links(i): - key = (link[1], link[2]) - related.add(key) + return [self._files[i] for i in related] - for i in related: - if i in keys: - continue - yield self.load_file(self._files[i]) + def find_network(self, ip: str) -> Sequence[NetList]: + """Find Network in index + + Args: + ip (str): ip address + + Returns: + Generator[NetList, None, None]: generator of netlists + """ + return self._nettree.find_tree(ip) def load_file(self, fn: str) -> FileDOM: "load file" @@ -95,6 +106,14 @@ class RPSL: return fo + def load_files(self, fns: Sequence[str]) -> Sequence[NetList]: + for fn in fns: + yield self.load_file(fn) + def links(self, key: Tuple[str, str]) -> List[Tuple[str, str]]: "get links" return self._links.get(key, []) + + def schema(self, name: str) -> SchemaDOM: + "get schema" + return self._schema.get(name) diff --git a/utils/registry/dn42/rpsl/schema.py b/utils/registry/dn42/rpsl/schema.py index 8b90a39d3..5f219b936 100644 --- a/utils/registry/dn42/rpsl/schema.py +++ b/utils/registry/dn42/rpsl/schema.py @@ -6,7 +6,7 @@ from typing import Optional, List, Tuple, Dict, Set, TypeVar import log -from .filedom import FileDOM, Row +from .file import FileDOM, Row DOM = TypeVar("DOM", bound="FileDOM") STATE = TypeVar("STATE", bound="State") diff --git a/utils/registry/dn42/rpsl/spec.py b/utils/registry/dn42/rpsl/spec.py new file mode 100644 index 000000000..1e3858dab --- /dev/null +++ b/utils/registry/dn42/rpsl/spec.py @@ -0,0 +1,21 @@ +"spec" +from dataclasses import dataclass +from typing import Dict, List, Enum + +class Rule: + pass + + +@dataclass +class LabelRule(Rule): + name: str + + def parse(self, fields: Sequence[str]) -> Optional[Tuple[str, str]]: + +@dataclass +class Spec: + keys: Dict[str, SpecRule] + + @classmethod + def from_dom(cls, dom: file.FileDOM): + for key in diff --git a/utils/registry/dn42/rpsl/test_file.py b/utils/registry/dn42/rpsl/test_file.py new file mode 100644 index 000000000..4fb888538 --- /dev/null +++ b/utils/registry/dn42/rpsl/test_file.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python3 +"""Test FileDOM""" +import unittest +import inspect +from pprint import pprint + +from .filedom import FileDOM + + +class TestFileDOM(unittest.TestCase): + """Test FileDOM""" + + def test_parse(self): + """Test Parsing""" + s = """ + person: Xuu + remarks: test + + + Multi-Line + contact: xmpp:xuu@xmpp.dn42 + contact: mail:xuu@dn42.us + pgp-fingerprint: 20AE2F310A74EA7CEC3AE69F8B3B0604F164E04F + nic-hdl: XUU-DN42 + mnt-by: XUU-MNT + source: DN42 + """ + s = inspect.cleandoc(s)+"\n" + + dom = FileDOM() + dom.parse(s.splitlines()) + + self.assertTrue(dom.valid) + self.assertEqual(dom.schema, "person") + self.assertEqual(dom.get("person"), "Xuu") + self.assertEqual(dom.get("contact"), "xmpp:xuu@xmpp.dn42") + self.assertEqual(dom.get("contact", index=1), "mail:xuu@dn42.us") + self.assertIsNone(dom.get("xxx")) + self.assertEqual(dom.get("xxx", default="default"), "default") + self.assertEqual(str(dom), s) + + def test_put_values(self): + """Test putting values""" + s = """ + person: Xuu + remarks: test + contact: xmpp:xuu@xmpp.dn42 + contact: mail:xuu@dn42.us + pgp-fingerprint: 20AE2F310A74EA7CEC3AE69F8B3B0604F164E04F + nic-hdl: XUU-DN42 + mnt-by: XUU-MNT + source: DN42 + """ + s = inspect.cleandoc(s)+"\n" + + dom = FileDOM() + dom.parse(s.splitlines()) + + dom.put("source", "SOURIS") + self.assertEqual(dom.get("source"), "SOURIS") + + dom.put("contact", "mail:me@sour.is", append=True) + self.assertEqual(str(dom.get("contact")), "xmpp:xuu@xmpp.dn42") + self.assertEqual(dom.get("contact", index=1), "mail:xuu@dn42.us") + self.assertEqual(dom.get("contact", index=2), "mail:me@sour.is") + + def test_parse_ip6address(self): + """Test network ip address parsing""" + s = """ + inet6num: fd00:0000:0000:0000:0000:0000:0000:0000 - fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + cidr: fd00::/8 + netname: ROOT-DN42-ULA + descr: DN42 ULA Address Space + status: ALLOCATED + policy: open + org: ORG-DN42 + mnt-by: DN42-MNT + source: DN42 + """ # noqa: E501 + + s = inspect.cleandoc(s)+"\n" + + dom = FileDOM(text=s.splitlines()) + + cidr = dom.get("cidr").as_net + self.assertEqual(cidr.compressed, "fd00::/8") + self.assertEqual( + cidr.exploded, "fd00:0000:0000:0000:0000:0000:0000:0000/8") + + end = cidr.broadcast_address.exploded + start = cidr.network_address.exploded + + self.assertEqual(dom.get("inet6num"), f"{start} - {end}") + + def test_parse_ip4address(self): + """Test network ip address parsing""" + s = """ + inetnum: 172.20.0.0 - 172.23.255.255 + cidr: 172.20.0.0/14 + netname: ROOT-DN42 + """ + + s = inspect.cleandoc(s)+"\n" + + dom = FileDOM(text=s.splitlines()) + + cidr = dom.get("cidr").as_net + self.assertEqual(cidr.compressed, "172.20.0.0/14") + self.assertEqual( + cidr.exploded, "172.20.0.0/14") + + end = cidr.broadcast_address.exploded + start = cidr.network_address.exploded + + self.assertEqual(dom.get("inetnum"), f"{start} - {end}") + + @unittest.skip + def test_bad_parse(self): + """bad parse stuff""" + s = """ + person: Xuu + EXTRA + : + source: DN42 + """ + s = inspect.cleandoc(s)+"\n" + + dom = FileDOM() + dom.parse(s.splitlines()) + pprint(dom.dom) + self.assertEqual(str(dom), s) + + +if __name__ == '__main__': + unittest.main() diff --git a/utils/registry/dn42/rpsl/transact.py b/utils/registry/dn42/rpsl/transact.py index 94048d87c..66fff27ac 100644 --- a/utils/registry/dn42/rpsl/transact.py +++ b/utils/registry/dn42/rpsl/transact.py @@ -2,7 +2,7 @@ from typing import Sequence, List, Optional, Tuple, TypeVar -from .filedom import FileDOM +from .file import FileDOM from .schema import SchemaDOM DOM = TypeVar("DOM", bound="TransactDOM") diff --git a/utils/registry/rpsl_index/__init__.py b/utils/registry/rpsl_index/__init__.py index bd3eb352f..bafa94b1b 100644 --- a/utils/registry/rpsl_index/__init__.py +++ b/utils/registry/rpsl_index/__init__.py @@ -40,12 +40,13 @@ def run(args: List[str], env: Dict[str, str]) -> int: idx = index_files(path, namespace=config.namespace, primary_keys=config.primary_keys) - lookup, schemas, files, nets = build_index(idx, rspl=config) + lookup, schemas, files, nets, routes = build_index(idx, rspl=config) print( f"Reading Files: done! files: {len(files)}" + f" schemas: {len(schemas)}" + f" networks: {len(nets)}", + f" routes: {len(routes)}", file=sys.stderr) print("Writing .rpsl/index", file=sys.stderr) @@ -71,7 +72,7 @@ def run(args: List[str], env: Dict[str, str]) -> int: file=link_out) print("Generate .rpsl/nettree", file=sys.stderr) - tree = NetTree(nets) + tree = NetTree(nets, routes) print("Writing .rpsl/nettree", file=sys.stderr) tree.write_csv(".rpsl/nettree") @@ -105,17 +106,19 @@ def build_index( schemas = {} # type: Dict[str, SchemaDOM] files = [] # type: List[FileDOM] nets = [] # type: List[NetRecord] + routes = [] # type: List[NetRecord] print(r"Reading Files...", end="\r", flush=True, file=sys.stderr) net_types = rspl.network_parents + net_leafs = rspl.network_children for (i, dom) in enumerate(idx): if not dom.valid: print("E", end="", flush=True) continue - key, _ = dom.index + key = dom.index lookup.add(key) files.append(dom) @@ -130,14 +133,23 @@ def build_index( dom.get("status", default="ASSIGNED"), )) + if dom.schema in net_leafs: + routes.append(NetRecord( + dom.get(dom.primary_key).as_net6, + dom.get("policy", default="none"), + dom.get("status", default="none"), + True, + )) + if i % 120 == 0: print( f"Reading Files: files: {len(files)}" + f" schemas: {len(schemas)} " + f" networks: {len(nets)}", + f" routes: {len(routes)}", end="\r", flush=True, file=sys.stderr) - return (lookup, schemas, files, nets) + return (lookup, schemas, files, nets, routes) def generate_links( @@ -147,15 +159,12 @@ def generate_links( ) -> Generator[Tuple[str, str, str], None, None]: "print file links out to file" for (link, refs) in links.items(): - d = dom.get(link) - if d is None: - continue + for d in dom.get_all(link): + found = False + for ref in refs: + if (ref, d.value) in lookup: + found = True + yield (link, ref, d) - found = False - for ref in refs: - if (ref, d.value) in lookup: - found = True - yield (link, ref, d) - - if not found: - print(f"{dom.name} missing link {link} {d.value}") + if not found: + print(f"{dom.name} missing link {link} {d.value}") diff --git a/utils/registry/rpsl_init/__init__.py b/utils/registry/rpsl_init/__init__.py index 70e61f733..587ee917d 100644 --- a/utils/registry/rpsl_init/__init__.py +++ b/utils/registry/rpsl_init/__init__.py @@ -63,6 +63,7 @@ def run(args: List[str], env: Dict[str, str]) -> int: print(rpsl, file=f) print(f"Created: {rpsl.config_file}", file=sys.stderr) + env["RPSL_DIR"] = rpsl_dir rpsl_index.run(args, env) return 0 diff --git a/utils/registry/rpsl_whois/__init__.py b/utils/registry/rpsl_whois/__init__.py index c0cce9e1a..b67afcb22 100644 --- a/utils/registry/rpsl_whois/__init__.py +++ b/utils/registry/rpsl_whois/__init__.py @@ -6,10 +6,10 @@ Usage: rpsl whois [text] """ import sys -from ipaddress import ip_network -from typing import List, Dict, Optional +from itertools import chain +from typing import List, Dict, Optional, Set, Tuple -from dn42.rpsl import RPSL, Config +from dn42.rpsl import RPSL, Config, FileDOM, as_net6 from dn42.utils import shift, exists @@ -41,15 +41,46 @@ def run(args: List[str], env: Dict[str, str]) -> int: ip = None try: - ip = ip_network(text) + ip = as_net6(text) except ValueError: pass - if ip is not None: - print(f"Searching network {text}...") - return 0 + principle = [] # type: List[FileDOM] + related_nets = [] # type: List[FileDOM] + related_idx = set() # type: Set[Tuple[str, str]] - for dom in rpsl.find(text, schema): + if ip is not None: + print(f"# Searching network {text}...") + nets = list(rpsl.find_network(text)) + last_net = nets[-1] + dom = rpsl.load_file(str(last_net.net)) + principle.append(dom) + related_idx.add(dom.index) + ok, route = last_net.in_routes(ip) + if ok: + dom = rpsl.load_file(str(route)) + principle.append(dom) + related_idx.add(dom.index) + + for net in nets[:-1]: + dom = rpsl.load_file(str(net.net)) + related_nets.append(dom) + else: + for dom in rpsl.find(text, schema): + principle.append(dom) + related_idx.add(dom.index) + + print("# Found objects") + for dom in principle: print(dom) + if len(related_nets) > 0: + print("# Related Networks") + for dom in related_nets: + print(dom) + + print("# Related objects") + lis = set(chain.from_iterable(rpsl.related(i) for i in related_idx)) + for dom in rpsl.load_files(sorted(lis)): + print(dom) return 0 diff --git a/utils/registry/scan-registry.py b/utils/registry/scan-registry.py deleted file mode 100755 index 52c34d198..000000000 --- a/utils/registry/scan-registry.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python3 -"""Scans Registry at given path for issues""" - -import os -import sys -from typing import Dict - -from dom.filedom import FileDOM -from dom.schema import SchemaDOM - - -def index_files(path: str): - """generate list of dom files""" - for root, _, files in os.walk(path): - if root == path: - continue - - for f in files: - if f[0] == ".": - continue - - dom = FileDOM.from_file(os.path.join(root, f)) - - yield dom - - -def run(path: str = "."): - """run main script""" - idx = index_files(path) - - lookups = {} # type: Dict[str, FileDOM] - schemas = {} # type: Dict[str, SchemaDOM] - files = [] - - print(r"Reading Files...", end="\r", flush=True, file=sys.stderr) - - for (i, dom) in enumerate(idx): - if not dom.valid: - print("E", end="", flush=True) - continue - - key, value = dom.index - lookups[key] = value - files.append(dom) - - if dom.schema == "schema": - schema = SchemaDOM(dom) - schemas[schema.ref] = schema - - if i % 120 == 0: - print( - f"Reading Files: files: {len(files)} schemas: {len(schemas)}", - end="\r", flush=True, file=sys.stderr) - - print( - f"Reading Files: done! files: {len(files)}, schemas: {len(schemas)}", - file=sys.stderr) - - for dom in files: - s = schemas.get(dom.rel) - if s is None: - print(f"{dom.src} schema not found for {dom.rel}") - continue - - status = s.check_file(dom, lookups) - status.print() - - -if __name__ == "__main__": - run(sys.argv[1] if len(sys.argv) > 1 else os.getcwd())