mirror of
https://git.dn42.dev/dn42/registry.git
synced 2025-09-08 18:03:52 +08:00
Merge branch 'master' of git.dn42.dev:dn42/registry
This commit is contained in:
commit
b3aeaa400c
74 changed files with 690 additions and 196 deletions
24
README.md
24
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:
|
||||
`<username>-YYYYMMDD/<name>`
|
||||
- `<username>` is your gitea username.
|
||||
- `YYYYMMDD` is the current date.
|
||||
`<username>-YYYYMMDD/<name>`
|
||||
- `<username>` is your gitea username.
|
||||
- `YYYYMMDD` is the current date.
|
||||
- `<name>` 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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
8
data/aut-num/AS4201270017
Normal file
8
data/aut-num/AS4201270017
Normal file
|
@ -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
|
16
data/aut-num/AS4242420977
Normal file
16
data/aut-num/AS4242420977
Normal file
|
@ -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
|
|
@ -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: --------------------------------------------------------
|
||||
|
|
7
data/aut-num/AS4242421907
Normal file
7
data/aut-num/AS4242421907
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
10
data/dns/fox.dn42
Normal file
10
data/dns/fox.dn42
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
7
data/dns/hosting.dn42
Normal file
7
data/dns/hosting.dn42
Normal file
|
@ -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
|
10
data/dns/koala.dn42
Normal file
10
data/dns/koala.dn42
Normal file
|
@ -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
|
7
data/dns/matrix.dn42
Normal file
7
data/dns/matrix.dn42
Normal file
|
@ -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
|
9
data/dns/moerail.dn42
Normal file
9
data/dns/moerail.dn42
Normal file
|
@ -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
|
8
data/dns/mrghosh.dn42
Normal file
8
data/dns/mrghosh.dn42
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
10
data/dns/zhyz.dn42
Normal file
10
data/dns/zhyz.dn42
Normal file
|
@ -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
|
8
data/inet6num/fd10:127:234::_48
Normal file
8
data/inet6num/fd10:127:234::_48
Normal file
|
@ -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
|
11
data/inet6num/fd42:4242:1907::_48
Normal file
11
data/inet6num/fd42:4242:1907::_48
Normal file
|
@ -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
|
|
@ -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
|
10
data/inet6num/fd5a:2663:7b48::_48
Normal file
10
data/inet6num/fd5a:2663:7b48::_48
Normal file
|
@ -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
|
11
data/inet6num/fdec:c6a:4002::_48
Normal file
11
data/inet6num/fdec:c6a:4002::_48
Normal file
|
@ -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
|
8
data/inetnum/10.127.234.0_24
Normal file
8
data/inetnum/10.127.234.0_24
Normal file
|
@ -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
|
|
@ -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
|
|
@ -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
|
12
data/inetnum/172.20.128.192_26
Normal file
12
data/inetnum/172.20.128.192_26
Normal file
|
@ -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
|
6
data/inetnum/172.20.165.128_26
Normal file
6
data/inetnum/172.20.165.128_26
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
10
data/inetnum/172.23.222.32_27
Normal file
10
data/inetnum/172.23.222.32_27
Normal file
|
@ -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
|
7
data/mntner/ARNIE97-MNT
Normal file
7
data/mntner/ARNIE97-MNT
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
7
data/mntner/MRGHOSH-MNT
Normal file
7
data/mntner/MRGHOSH-MNT
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
mntner: WALLE256-MNT
|
||||
auth: pgp-fingerprint AD085CF1EB9F7EA6C70CDBBEA533CB9C885B5E5B
|
||||
admin-c: WALLE256-DN42
|
||||
tech-c: WALLE256-DN42
|
||||
mnt-by: WALLE256-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
|
||||
|
|
5
data/person/ARNIE97-DN42
Normal file
5
data/person/ARNIE97-DN42
Normal file
|
@ -0,0 +1,5 @@
|
|||
person: Arnie
|
||||
contact: arnie97@gmail.com
|
||||
nic-hdl: ARNIE97-DN42
|
||||
mnt-by: ARNIE97-MNT
|
||||
source: DN42
|
8
data/person/CAINSAKURA-NEONETWORK
Normal file
8
data/person/CAINSAKURA-NEONETWORK
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
9
data/person/MRGHOSH-DN42
Normal file
9
data/person/MRGHOSH-DN42
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
8
data/route/10.127.234.0_24
Normal file
8
data/route/10.127.234.0_24
Normal file
|
@ -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
|
|
@ -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
|
|
@ -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
|
5
data/route/172.20.128.192_26
Normal file
5
data/route/172.20.128.192_26
Normal file
|
@ -0,0 +1,5 @@
|
|||
route: 172.20.128.192/26
|
||||
descr: Moerail Network
|
||||
origin: AS4242420977
|
||||
mnt-by: ARNIE97-MNT
|
||||
source: DN42
|
4
data/route/172.20.165.128_26
Normal file
4
data/route/172.20.165.128_26
Normal file
|
@ -0,0 +1,4 @@
|
|||
route: 172.20.165.128/26
|
||||
origin: AS4242420112
|
||||
mnt-by: MEBUS-MNT
|
||||
source: DN42
|
|
@ -1,4 +1,4 @@
|
|||
route: 172.20.29.64/28
|
||||
origin: AS4242422660
|
||||
origin: AS135395
|
||||
mnt-by: HERTZ-MNT
|
||||
source: DN42
|
||||
|
|
|
@ -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
|
||||
|
|
4
data/route/172.23.222.32_27
Normal file
4
data/route/172.23.222.32_27
Normal file
|
@ -0,0 +1,4 @@
|
|||
route: 172.23.222.32/27
|
||||
origin: AS4242421907
|
||||
mnt-by: MRGHOSH-MNT
|
||||
source: DN42
|
8
data/route6/fd10:127:234::_48
Normal file
8
data/route6/fd10:127:234::_48
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
5
data/route6/fd42:4242:1907::_48
Normal file
5
data/route6/fd42:4242:1907::_48
Normal file
|
@ -0,0 +1,5 @@
|
|||
route6: fd42:4242:1907::/48
|
||||
origin: AS4242421907
|
||||
max-length: 48
|
||||
mnt-by: MRGHOSH-MNT
|
||||
source: DN42
|
|
@ -1,4 +0,0 @@
|
|||
route6: fd42:4242:2660::/48
|
||||
origin: AS4242422660
|
||||
mnt-by: HERTZ-MNT
|
||||
source: DN42
|
4
data/route6/fd5a:2663:7b48::_48
Normal file
4
data/route6/fd5a:2663:7b48::_48
Normal file
|
@ -0,0 +1,4 @@
|
|||
route6: fd5a:2663:7b48::/48
|
||||
origin: AS135395
|
||||
mnt-by: HERTZ-MNT
|
||||
source: DN42
|
6
data/route6/fdec:c6a:4002::_48
Normal file
6
data/route6/fdec:c6a:4002::_48
Normal file
|
@ -0,0 +1,6 @@
|
|||
route6: fdec:c6a:4002::/48
|
||||
descr: Moerail Network NG
|
||||
origin: AS4242420977
|
||||
max-length: 48
|
||||
mnt-by: ARNIE97-MNT
|
||||
source: DN42
|
|
@ -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",
|
||||
]
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
23
utils/registry/dn42/rpsl/metafile.py
Normal file
23
utils/registry/dn42/rpsl/metafile.py
Normal file
|
@ -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"
|
|
@ -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
|
||||
|
|
|
@ -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)
|
|
@ -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")
|
||||
|
|
21
utils/registry/dn42/rpsl/spec.py
Normal file
21
utils/registry/dn42/rpsl/spec.py
Normal file
|
@ -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
|
134
utils/registry/dn42/rpsl/test_file.py
Normal file
134
utils/registry/dn42/rpsl/test_file.py
Normal file
|
@ -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()
|
|
@ -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")
|
||||
|
|
|
@ -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}")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
Loading…
Add table
Add a link
Reference in a new issue