Compare commits
1 Commits
xuu-202007
...
tilda-2020
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc4c49d382 |
@@ -1,6 +0,0 @@
|
|||||||
aut-num: AS140936
|
|
||||||
as-name: SUNNET
|
|
||||||
admin-c: SUNNET-DN42
|
|
||||||
tech-c: SUNNET-DN42
|
|
||||||
mnt-by: SUNNET-MNT
|
|
||||||
source: APNIC
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
aut-num: AS4201270002
|
aut-num: AS4201270002
|
||||||
as-name: [transferable]
|
as-name: Septs HomeLabs
|
||||||
admin-c: SEPTS-NEONETWORK
|
admin-c: SEPTS-NEONETWORK
|
||||||
tech-c: SEPTS-NEONETWORK
|
tech-c: SEPTS-NEONETWORK
|
||||||
remarks: Imported from neonetwork, do not edit!
|
remarks: Imported from neonetwork, do not edit!
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
aut-num: AS4242421130
|
|
||||||
as-name: BONJOU2333-AS
|
|
||||||
descr: Peer with me at bonjou2333@gmail.com
|
|
||||||
admin-c: BONJOU2333-DN42
|
|
||||||
tech-c: BONJOU2333-DN42
|
|
||||||
mnt-by: BONJOU2333-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
aut-num: AS4242422131
|
|
||||||
as-name: AS for Julia's network
|
|
||||||
admin-c: JULIA-DN42
|
|
||||||
tech-c: JULIA-DN42
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
aut-num: AS4242422761
|
|
||||||
as-name: Arg Network
|
|
||||||
admin-c: ARG-DN42
|
|
||||||
tech-c: ARG-DN42
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
source: DN42
|
|
||||||
6
data/aut-num/AS4242422839
Normal file
6
data/aut-num/AS4242422839
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
aut-num: AS4242422839
|
||||||
|
as-name: tilda's network
|
||||||
|
admin-c: TILDA-DN42
|
||||||
|
tech-c: TILDA-DN42
|
||||||
|
mnt-by: TILDA-MNT
|
||||||
|
source: DN42
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
aut-num: AS4242423266
|
|
||||||
as-name: AS for DANN Network
|
|
||||||
admin-c: DANN-DN42
|
|
||||||
tech-c: DANN-DN42
|
|
||||||
mnt-by: DANN-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
aut-num: AS4242423267
|
|
||||||
as-name: AS for CHILLONETWORK
|
|
||||||
admin-c: CHILLONETWORK-DN42
|
|
||||||
tech-c: CHILLONETWORK-DN42
|
|
||||||
mnt-by: CHILLONETWORK-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
domain: arg.dn42
|
|
||||||
admin-c: ARG-DN42
|
|
||||||
tech-c: ARG-DN42
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
nserver: ns.nia.dn42
|
|
||||||
source: DN42
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
domain: chillo.dn42
|
|
||||||
admin-c: CHILLONETWORK-DN42
|
|
||||||
tech-c: CHILLONETWORK-DN42
|
|
||||||
mnt-by: CHILLONETWORK-MNT
|
|
||||||
nserver: ns1.chillo.dn42 172.23.178.93
|
|
||||||
nserver: ns2.chillo.dn42 172.23.178.94
|
|
||||||
source: DN42
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
domain: julia.dn42
|
|
||||||
admin-c: JULIA-DN42
|
|
||||||
tech-c: JULIA-DN42
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
nserver: ns1.julia.dn42 fdb4:acab:1312::2
|
|
||||||
nserver: ns1.julia.dn42 172.20.15.40
|
|
||||||
source: DN42
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
inet6num: fd00:1953:0615:0000:0000:0000:0000:0000 - fd00:1953:0615:ffff:ffff:ffff:ffff:ffff
|
|
||||||
cidr: fd00:1953:615::/48
|
|
||||||
netname: ARG-IPV6
|
|
||||||
descr: Core IPv6 Network of Arg Network
|
|
||||||
country: CN
|
|
||||||
admin-c: ARG-DN42
|
|
||||||
tech-c: ARG-DN42
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
nserver: ns.nia.dn42
|
|
||||||
status: ASSIGNED
|
|
||||||
source: DN42
|
|
||||||
10
data/inet6num/fd2c:1fb:88c::_48
Normal file
10
data/inet6num/fd2c:1fb:88c::_48
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
inet6num: fd2c:01fb:088c:0000:0000:0000:0000:0000 - fd2c:01fb:088c:ffff:ffff:ffff:ffff:ffff
|
||||||
|
cidr: fd2c:1fb:88c::/48
|
||||||
|
netname: TDA-NETWORK
|
||||||
|
descr: tilda's network
|
||||||
|
country: US
|
||||||
|
admin-c: TILDA-DN42
|
||||||
|
tech-c: TILDA-DN42
|
||||||
|
mnt-by: TILDA-MNT
|
||||||
|
status: ASSIGNED
|
||||||
|
source: DN42
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
inet6num: fd42:1130:0000:0000:0000:0000:0000:0000 - fd42:1130:0000:ffff:ffff:ffff:ffff:ffff
|
|
||||||
netname: BONJOU2333-IPV6
|
|
||||||
descr: Peer with me at bonjou2333@gmail.com
|
|
||||||
country: CN
|
|
||||||
admin-c: BONJOU2333-DN42
|
|
||||||
tech-c: BONJOU2333-DN42
|
|
||||||
mnt-by: BONJOU2333-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
cidr: fd42:1130::/48
|
|
||||||
source: DN42
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
inet6num: fd8e:1889:b440:0000:0000:0000:0000:0000 - fd8e:1889:b440:ffff:ffff:ffff:ffff:ffff
|
|
||||||
cidr: fd8e:1889:b440::/48
|
|
||||||
netname: DANN-NETWORK
|
|
||||||
descr: Network of DANN
|
|
||||||
country: SG
|
|
||||||
admin-c: DANN-DN42
|
|
||||||
tech-c: DANN-DN42
|
|
||||||
mnt-by: DANN-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
source: DN42
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
inet6num: fdb4:acab:1312:0000:0000:0000:0000:0000 - fdb4:acab:1312:ffff:ffff:ffff:ffff:ffff
|
|
||||||
cidr: fdb4:acab:1312::/48
|
|
||||||
netname: JULIA-NETWORK
|
|
||||||
descr: Julia's network
|
|
||||||
admin-c: JULIA-DN42
|
|
||||||
tech-c: JULIA-DN42
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
nserver: ns1.julia.dn42
|
|
||||||
source: DN42
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
inetnum: 10.127.235.0 - 10.127.235.255
|
inetnum: 10.127.235.0 - 10.127.235.255
|
||||||
cidr: 10.127.235.0/24
|
cidr: 10.127.235.0/24
|
||||||
netname: Icecat Global Tunnel Address (OpenVPN)
|
netname: Icecat Global Tunnel Address
|
||||||
admin-c: CAINSAKURA-NEONETWORK
|
admin-c: ICECAT-NEONETWORK
|
||||||
tech-c: CAINSAKURA-NEONETWORK
|
tech-c: ICECAT-NEONETWORK
|
||||||
remarks: Imported from neonetwork, do not edit!
|
remarks: Imported from neonetwork, do not edit!
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: NEONETWORK
|
source: NEONETWORK
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
inetnum: 172.20.15.40 - 172.20.15.47
|
|
||||||
cidr: 172.20.15.40/29
|
|
||||||
netname: JULIA-NETWORK
|
|
||||||
admin-c: JULIA-DN42
|
|
||||||
tech-c: JULIA-DN42
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
nserver: ns1.julia.dn42
|
|
||||||
source: DN42
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
inetnum: 172.20.233.64 - 172.20.233.127
|
|
||||||
netname: BONJOU2333-IPV4
|
|
||||||
remarks: Peer with me at bonjou2333@gmail.com
|
|
||||||
descr: Peer with me at bonjou2333@gmail.com
|
|
||||||
country: CN
|
|
||||||
admin-c: BONJOU2333-DN42
|
|
||||||
tech-c: BONJOU2333-DN42
|
|
||||||
mnt-by: BONJOU2333-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
cidr: 172.20.233.64/26
|
|
||||||
source: DN42
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
inetnum: 172.22.128.32 - 172.22.128.47
|
|
||||||
cidr: 172.22.128.32/28
|
|
||||||
netname: DANN-NETWORK
|
|
||||||
admin-c: DANN-DN42
|
|
||||||
tech-c: DANN-DN42
|
|
||||||
mnt-by: DANN-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
source: DN42
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
inetnum: 172.23.104.64 - 172.23.104.95
|
|
||||||
cidr: 172.23.104.64/27
|
|
||||||
netname: Arg Network Core
|
|
||||||
admin-c: ARG-DN42
|
|
||||||
tech-c: ARG-DN42
|
|
||||||
nserver: ns.nia.dn42
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
source: DN42
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
inetnum: 172.23.178.64 - 172.23.178.95
|
|
||||||
cidr: 172.23.178.64/27
|
|
||||||
netname: CHILLONETWORK-NETWORK
|
|
||||||
admin-c: CHILLONETWORK-DN42
|
|
||||||
tech-c: CHILLONETWORK-DN42
|
|
||||||
mnt-by: CHILLONETWORK-MNT
|
|
||||||
status: ASSIGNED
|
|
||||||
source: DN42
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
key-cert: PGPKEY-0EBA4577
|
|
||||||
method: PGP
|
|
||||||
owner: CHILLONETWORK <chillonetwork@protonmail.com>
|
|
||||||
fingerpr: 6428 72C0 2600 A5B7 3DFA BD7D A466 006B 0EBA 4577
|
|
||||||
mnt-by: CHILLONETWORK-MNT
|
|
||||||
source: DN42
|
|
||||||
certif: -----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
||||||
certif:
|
|
||||||
certif: mQINBF8ZyQUBEADAW4e5EqwzqcRgHU8jcNhNXWd5PDLAeLoqY7oSy8d3Y3PZ4e1k
|
|
||||||
certif: GwtHzS400WSjDeQ+Uy4+cBqdujQ0FlwOxc64W1LKA+Eu2Tzj9DiswgPIW87rOR5w
|
|
||||||
certif: wN5yVSdY60k8KL8nLXEGQyNxaqJizJCcoSTimnor+ZPSUdbdVXFW3S60qYQNNgoZ
|
|
||||||
certif: opM0swhW9s1M4ZM6J3hAtPWTsTuuY/Db9hZwD1AGjDJRPKn6KNx/KVUOui89UIvE
|
|
||||||
certif: dgS0/Vj11njaAsf8Mwx+OTeofQOcFP0QMXlAwIE9bE5bPv86VS8tHZnPNEJWxQCe
|
|
||||||
certif: s+pnZI5N4cA8NPJzNJSN+B/uzMdvHs/su+danCtFRX6HjJOccVeXkF2vGW8FZAEw
|
|
||||||
certif: MqcvYGrTeVf1deS7oHMLpoO1p3BZ0ydceBXhsQoJEViFhxdLwUbeJj1xubGykiUl
|
|
||||||
certif: MEa5/+4NvzPMfk/SvYtJDDW1B4Zu6SmuE2mn1mXyL4AzKY0V8yRQnswZ5CzALK8x
|
|
||||||
certif: fPN2FVd6NsF1jA7nsA33bS79aF0625k4R5I1K9QNtaMEgVKGUd9/hy0c/mJyQKMi
|
|
||||||
certif: 4wK/rx3iyZy5Gj4xF2vAkdexoz27NmD7yWz9cpNY3D9FhnRyNucOkfqquKGl/BxD
|
|
||||||
certif: Syc4gIxdsGGUo7kR0KVjG50lBlVAEE24sVG16D3W7BY3GDs0EYMhzd+kYQARAQAB
|
|
||||||
certif: tCxDSElMTE9ORVRXT1JLIDxDSElMTE9ORVRXT1JLQFBST1RPTk1BSUwuQ09NPokC
|
|
||||||
certif: TgQTAQoAOBYhBGQocsAmAKW3Pfq9faRmAGsOukV3BQJfGckFAhsDBQsJCAcCBhUK
|
|
||||||
certif: CQgLAgQWAgMBAh4BAheAAAoJEKRmAGsOukV3Y6oQAJMSlNpREoiz3cM/ZFkz3S8p
|
|
||||||
certif: N1YjgkMIeomIuwEcJzN4aV9bwzNabosjtQZ4EPvtEYREV8ebUNcbYH0QqMhk7sFM
|
|
||||||
certif: 4TmdwYYU3Brmk07T/96ExD7eind22+kun+7CORd4OXtv7Jtz8nzUTUeJRJNURKUh
|
|
||||||
certif: LT7UUdpGVdIMahlmkDqZWQH1oQuFue4Iosdk82fn0wq826ZX8EfRQZdcFgqYfC4E
|
|
||||||
certif: Hn+oXp4bktuXJoGfygKsj/t0I0FxO20M61yo2gQFKIrNxFGkzbLPbuG7oADv7qEy
|
|
||||||
certif: Fj9H80VSYUIWvUmIN/r7dk/F7TyaiQDTtI1LdZoBuqDJz5LrahW8dGpgq9y/ZXbR
|
|
||||||
certif: T/0iBwS0Zrs9e3ul1djdmY0wLuuBIQltqSvqycV1Bp+SLEaKGkjVXtg3C1SZe7Fe
|
|
||||||
certif: YfHTaBds/VxibrQREE2AT1eGcQZyxF4mdV/znciAwF9jiS20U+QZQSHdsdO3pmvP
|
|
||||||
certif: KxfL9dLqLszSd0PC1AmVj1r7Gnx4bEig+guutOJkxTQDXJ/LhJsmAj62QgY2N9Us
|
|
||||||
certif: JkLlzr/HUWxqa9bRer0aUYNNy3o1JvIf8gQeqK8Wj4e3q87jWm5g7R6+uiwOaTIR
|
|
||||||
certif: E7COC4+h+6j/zwcwpYjX22xoYG6yTRucFTi88UMHxePa3NqIzc9i5JYzSvwa4WlI
|
|
||||||
certif: VNuMzUO29fhTe5CtLWjUuQINBF8ZyQUBEADMXAlrrsBuY9tG8TDogo4BvLtoIwFS
|
|
||||||
certif: oPpGfLITJ4XEZJCCpY9CjBZNGyIafaWMtaLy9jGXeU77cs/SXEmLqHlvk+cU7b84
|
|
||||||
certif: 8BQ7jjT0iDmw/Obo7za/SNwWxQ2P1kfrwO7emhJm+9337AKo5VBIvpEGgzxCEnLg
|
|
||||||
certif: eLY4A+y6qfHsOwlq00lKZ67uUOpbWhFwuNi20TdFgLeg19IewZ+seCKudAxbNerC
|
|
||||||
certif: 7HinNFyH+EHfJqiADZjs9bnkn+I208nG46QR3oQ8Nr+KoKMljtB0nd89cuSKnU4N
|
|
||||||
certif: 3N6k2PwHStpJHbtth+BYdow2ocnhxQ1fBNCTp9NsDyGMhs0E3phsdOOk59NN0EFB
|
|
||||||
certif: 3Bi+3pXEvMrIdWI6BbQGrzMxa9N/P/laVpfGJnUazIc3uzIBGUHxpA7V4eMfYNvK
|
|
||||||
certif: e2sN4sFsQ1ZCrCqj5tykZfaWL/wgw1yWN9veUh1Z2dQzYr1tm477hDJqiGzts+rY
|
|
||||||
certif: uBofoUr1PTw4GF3WLLndIfitDyB5ZZUP8C18CDNcq8MUU1NbtY/KZamtW1OqKUqi
|
|
||||||
certif: UYXh0alVjO2RtZwjhab5Ajja/GNJ73T10RE9ozd9HDJZCLyYe5CkTshOkhNp2LYD
|
|
||||||
certif: qUbut7T5/N7rfcwr8sTBr09Acqzkszs7zhSqaizM7P8ANeXfhqdZcQ6CQcqnjqwI
|
|
||||||
certif: 3JNosJ3eUQgxawARAQABiQI2BBgBCgAgFiEEZChywCYApbc9+r19pGYAaw66RXcF
|
|
||||||
certif: Al8ZyQUCGwwACgkQpGYAaw66RXcd+RAAqMC7UfXdcuIJz9OF8W/o4bd55KRV8C+R
|
|
||||||
certif: l8s1niUKwIWnWpge4GoAnlDvcFdQ3HFsn/BJVHr3sxcjXQOFiGkbyLXl7PrESxvK
|
|
||||||
certif: DlmU17MPE1kRoGcdBrnSbmsFxll9x/tatV9AsZPTel5oWb0HOSSpUz5A2rSz1G0Q
|
|
||||||
certif: MqUqkwoBaDis3CE6dAl/GA5iT5fpGRWnM6db6IsEQ1b2dDzu0Re/RpBhLNYHzT6d
|
|
||||||
certif: TOD4+fkmJfAiuBLFzjYGUyuvhpxppzEqKBZEkxndK3zqPCHWvwxrPCXnEWLGYROS
|
|
||||||
certif: EZMWLOpo4ZUDjsseJpW37Cyumireyjw7Guyp/DKRpOKu+uWvdwhsaZIZjBi1BLVR
|
|
||||||
certif: khHgzOVRcK2Wup+MIoaW4Fv8LQCcN1Rj19hrUjQ367P9Vx36FbcW5+Xs9Tup+0Y1
|
|
||||||
certif: /FS5n6m5eM6lVRbEzSmr14v4fz5bVKT0Ligyot1BXYunHDiBAOjGi5Ff81afLBrt
|
|
||||||
certif: 2HdM2iOJ8zGGi3YSj1Q8IAlHNzQR+9cDN6biv6TubtvWxiqNvaTGlRJgLmfifmkL
|
|
||||||
certif: gLSe15F9ypr/imzqp83cDDEiG42dsx5JaNSWwr7oC6bNpjVrVyiTUSsQE77GcJ5m
|
|
||||||
certif: QKSNkzcm2D1tZs1+Ve92yp/nBFAFfDkfs4Q48q0NUqF/oB07fvA3jXbW6F9PFUwM
|
|
||||||
certif: DbvEszN8aLk=
|
|
||||||
certif: =0/7N
|
|
||||||
certif: -----END PGP PUBLIC KEY BLOCK-----
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
mntner: ARG-MNT
|
|
||||||
descr: Arg Maintainer
|
|
||||||
admin-c: ARG-DN42
|
|
||||||
tech-c: ARG-DN42
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
source: DN42
|
|
||||||
auth: pgp-fingerprint BDF14A59875B117B6FFCD55C8DC6E09C30441D5F
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
mntner: BONJOU2333-MNT
|
|
||||||
admin-c: BONJOU2333-DN42
|
|
||||||
tech-c: BONJOU2333-DN42
|
|
||||||
mnt-by: BONJOU2333-MNT
|
|
||||||
source: DN42
|
|
||||||
auth: pgp-fingerprint BA301AFDC53780ECE36307F76D41C706AA8F2D18
|
|
||||||
auth: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC9iQEMXo4pYBCiKVA0yznXIhW+VY9sg2SPIjG5ELgniQcbM9Xx+CFPMokTX0dVCxskAK2BWKkUhSyBrPpvr9tMn/0igK+wqpqdOEbvYBD3F6JRF5u6l/915McGQ4ySVVWGiGfnjNU6OlVqxw2aRG0cn8YmspzAmv2yqHCTvXEVommvoLzeTWziRjH+cKSNQCW6V0KcBifvicBBvIaYSwOvN+0rVQ8PtC1MfO0jYeMbshmXNovPO8PO9rGNR+Ti5P7Up3VaceFfhQkoySKGmPWhWP/ozhXF5OQgmJ/0tZCfGNPWV+NKTS40XMgC5LBtjSM3Umd8jMD72K7kpIF/RKQU/Ba3FWKWPn6e4ldWR/OyUTJSyWrXnTJFxUlM96MewKt9/2a5fv3bWag74al3zjtMpb6AJycuNMC4iVpqdBjW585vqKVD2CYz96IN0h+HLQTkt3kR1hJdc2fEZfgSYuWRTxROhCccN8z4PaURizQ4Wd4rYVu1ZBf00lHkRDN+qWdvFjCsjF56fzXBWP1SXH1q23OQbRljviYkzzS/OHaDpYJ73bcFbzLW1BpfAs0C9OhibqgkFgJ1D1S4IF0nAgTm8tuAYz0n1qohdMxG5CEqs7Hwh3fTwB2Cg8batRstotI2SAB6xbLiP/6UaWA1EdPB+pdphQ/I2qdQyN9eOklClQ==
|
|
||||||
remarks: ouo
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
mntner: CHILLONETWORK-MNT
|
|
||||||
admin-c: CHILLONETWORK-DN42
|
|
||||||
tech-c: CHILLONETWORK-DN42
|
|
||||||
mnt-by: CHILLONETWORK-MNT
|
|
||||||
auth: PGPKEY-0EBA4577
|
|
||||||
source: DN42
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
mntner: DANN-MNT
|
|
||||||
descr: DANN
|
|
||||||
tech-c: DANN-DN42
|
|
||||||
admin-c: DANN-DN42
|
|
||||||
mnt-by: DANN-MNT
|
|
||||||
auth: pgp-fingerprint 40172DE4A93EAAB1F5490750983F00BC64C8382D
|
|
||||||
source: DN42
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
mntner: JULIA-MNT
|
|
||||||
admin-c: JULIA-DN42
|
|
||||||
tech-c: JULIA-DN42
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
auth: pgp-fingerprint 249171DF47AA8086D26F14339F7B6CA7B2D2899E
|
|
||||||
source: DN42
|
|
||||||
6
data/mntner/TILDA-MNT
Normal file
6
data/mntner/TILDA-MNT
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
mntner: TILDA-MNT
|
||||||
|
admin-c: TILDA-DN42
|
||||||
|
tech-c: TILDA-DN42
|
||||||
|
mnt-by: TILDA-MNT
|
||||||
|
auth: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvHiBk8KDoNeICj5funpP+6p6VeYOXLRAWFwGvDJG3lS2i/wtvEOexfPhgX4z4Tb87NpEuzQPXe1F5WeNooIG72cnAOMBMYdBGV9ScbNctsvtlpQ2kwWaODaGqEzuoeJa6KvKmw9A9V+6HJwAIiuFtvUPI9FjzxkCwHk56vpj/PSKNUsFw2ZKIRu9f2Ht/w+P3eJiaqmwvbThWgzQxmRJ0uKRGCapF48c0JfQkucAWZ2fnuwCgIs74eg1qkN2yf+Oe+yhH9sLuKhkIV+W1as4TFbjyGQvwxXtddQ/YgaSQUQQLWDK9sJ+s2G8VGh8pTK7aU4SnKWDBcObj4UJ+bDoj namei@bruh
|
||||||
|
source: DN42
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
person: Chris Becker
|
|
||||||
contact: cbecker275@protonmail.com
|
|
||||||
nic-hdl: ARG-DN42
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
person: Bonjou2333
|
|
||||||
contact: bonjou2333@gmail.com
|
|
||||||
nic-hdl: BONJOU2333-DN42
|
|
||||||
mnt-by: BONJOU2333-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
person: ALCHEMIST
|
|
||||||
contact: CHILLONETWORK@PROTONMAIL.COM
|
|
||||||
nic-hdl: CHILLONETWORK-DN42
|
|
||||||
mnt-by: CHILLONETWORK-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
person: Danni S
|
|
||||||
e-mail: mail@danni.id
|
|
||||||
nic-hdl: DANN-DN42
|
|
||||||
mnt-by: DANN-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
person: Julia Luna
|
|
||||||
e-mail: julia@julialuna.dev
|
|
||||||
nic-hdl: JULIA-DN42
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
source: DN42
|
|
||||||
5
data/person/TILDA-DN42
Normal file
5
data/person/TILDA-DN42
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
person: tilda
|
||||||
|
e-mail: tda@null.net
|
||||||
|
nic-hdl: TILDA-DN42
|
||||||
|
mnt-by: TILDA-MNT
|
||||||
|
source: DN42
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
route: 10.127.235.0/24
|
route: 10.127.235.0/24
|
||||||
origin: AS4201270017
|
origin: AS4201270008
|
||||||
max-length: 29
|
max-length: 29
|
||||||
admin-c: CAINSAKURA-NEONETWORK
|
admin-c: ICECAT-NEONETWORK
|
||||||
tech-c: CAINSAKURA-NEONETWORK
|
tech-c: ICECAT-NEONETWORK
|
||||||
remarks: Imported from neonetwork, do not edit!
|
remarks: Imported from neonetwork, do not edit!
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: NEONETWORK
|
source: NEONETWORK
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
route: 172.20.15.40/29
|
|
||||||
origin: AS4242422131
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
route: 172.20.233.64/26
|
|
||||||
descr: Peer with me at bonjou2333@gmail.com
|
|
||||||
origin: AS4242421130
|
|
||||||
mnt-by: BONJOU2333-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
route: 172.21.100.128/25
|
route: 172.21.100.128/25
|
||||||
origin: AS4242423088
|
origin: AS4242423088
|
||||||
origin: AS140936
|
|
||||||
mnt-by: SUNNET-MNT
|
mnt-by: SUNNET-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
route: 172.22.128.32/28
|
|
||||||
origin: AS4242423266
|
|
||||||
mnt-by: DANN-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
route: 172.23.104.64/27
|
|
||||||
origin: AS4242422761
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
route: 172.23.178.64/27
|
|
||||||
origin: AS4242423267
|
|
||||||
mnt-by: CHILLONETWORK-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
route6: fd00:1953:615::/48
|
|
||||||
origin: AS4242422761
|
|
||||||
mnt-by: ARG-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
route6: fd07:d34:7969::/48
|
route6: fd07:d34:7969::/48
|
||||||
origin: AS4242423618
|
origin: AS4242423618
|
||||||
max-length: 64
|
max-length: 48
|
||||||
mnt-by: JERRY-MNT
|
mnt-by: JERRY-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
5
data/route6/fd2c:01fb:088c::_48
Normal file
5
data/route6/fd2c:01fb:088c::_48
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
route6: fd2c:01fb:088c::/48
|
||||||
|
origin: AS4242422839
|
||||||
|
max-length: 48
|
||||||
|
mnt-by: TILDA-MNT
|
||||||
|
source: DN42
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
route6: fd42:1130::/48
|
|
||||||
descr: Peer with me at bonjou2333@gmail.com
|
|
||||||
origin: AS4242421130
|
|
||||||
mnt-by: BONJOU2333-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
route6: fd8e:1889:b440::/48
|
|
||||||
origin: AS4242423266
|
|
||||||
max-length: 48
|
|
||||||
mnt-by: DANN-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
route6: fdb4:acab:1312::/48
|
|
||||||
origin: AS4242422131
|
|
||||||
max-length: 48
|
|
||||||
mnt-by: JULIA-MNT
|
|
||||||
source: DN42
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
route6: fdc8:dc88:ee11::/48
|
route6: fdc8:dc88:ee11::/48
|
||||||
origin: AS4242423088
|
origin: AS4242423088
|
||||||
origin: AS140936
|
|
||||||
mnt-by: SUNNET-MNT
|
mnt-by: SUNNET-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -8,6 +8,5 @@ key: admin-c optional multiple lookup=dn42.person,dn42.role
|
|||||||
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: AS[0-9]{1,11}-AS[0-9]{1,11}
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -9,6 +9,5 @@ key: admin-c optional multiple lookup=dn42.person,dn42.role
|
|||||||
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [A-Z][0-9A-Z:-]{0,62}
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -19,6 +19,5 @@ key: mp-default optional multiple
|
|||||||
key: geo-loc optional multiple > [lat-c] [long-c] [name]
|
key: geo-loc optional multiple > [lat-c] [long-c] [name]
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: AS[0-9]{1,11}
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -12,17 +12,5 @@ key: country optional single
|
|||||||
key: ds-rdata optional multiple
|
key: ds-rdata optional multiple
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9a-z-]{1,58}.dn42
|
|
||||||
dn42
|
|
||||||
ff[0-9a-z]{0,8}
|
|
||||||
adm
|
|
||||||
fmie
|
|
||||||
hack
|
|
||||||
helgo
|
|
||||||
icvpn
|
|
||||||
mueritz
|
|
||||||
neo
|
|
||||||
rzl
|
|
||||||
020
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ key: mnt-routes optional multiple lookup=dn42.mntner
|
|||||||
key: org optional single lookup=dn42.organisation
|
key: org optional single lookup=dn42.organisation
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9a-f:\.]+/[0-9]+
|
|
||||||
network-owner: inet6num
|
network-owner: inet6num
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ key: mnt-routes optional multiple lookup=dn42.mntner
|
|||||||
key: org optional single lookup=dn42.organisation
|
key: org optional single lookup=dn42.organisation
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9\.]+/[0-9]+
|
|
||||||
network-owner: inet6num
|
network-owner: inet6num
|
||||||
network-owner: inetnum
|
network-owner: inetnum
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
|
|||||||
@@ -11,7 +11,5 @@ key: admin-c optional multiple lookup=dn42.person,dn42.rol
|
|||||||
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: mnt-by required multiple lookup=dn42.mntner
|
key: mnt-by required multiple lookup=dn42.mntner
|
||||||
key: source required single
|
key: source required single
|
||||||
primary-match: PGPKEY-[0-9A-F]{8}
|
|
||||||
primary-match: MTN-[0-9A-Z-]{1,58}
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -10,6 +10,5 @@ key: org optional multiple lookup=dn42.organisation
|
|||||||
key: abuse-mailbox optional single
|
key: abuse-mailbox optional single
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9A-Z-]+-MNT
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -18,6 +18,5 @@ key: language optional multiple
|
|||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: address optional multiple
|
key: address optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: ORG-[0-9A-Z-]+
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -15,6 +15,5 @@ key: fax-no optional multiple
|
|||||||
key: address optional multiple
|
key: address optional multiple
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9A-Z-]+-[0-9A-Z]+
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -7,6 +7,5 @@ key: mnt-by required multiple lookup=dn42.mntner
|
|||||||
key: admin-c optional multiple lookup=dn42.person,dn42.role
|
key: admin-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [A-Z0-9]+
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -11,6 +11,5 @@ key: abuse-mailbox optional multiple
|
|||||||
key: descr optional single
|
key: descr optional single
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9A-Z-]+-[0-9A-Z]+
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ key: remarks optional multiple
|
|||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
key: pingable optional multiple
|
key: pingable optional multiple
|
||||||
key: max-length optional single
|
key: max-length optional single
|
||||||
primary-match: [0-9\.]+/[0-9]+
|
|
||||||
network-owner: inetnum
|
network-owner: inetnum
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -10,6 +10,5 @@ key: admin-c optional multiple lookup=dn42.person,dn42.rol
|
|||||||
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: remarks optional multiple
|
key: remarks optional multiple
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: RS-[0-9A-Z-]+
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ key: remarks optional multiple
|
|||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
key: pingable optional multiple
|
key: pingable optional multiple
|
||||||
key: max-length optional single
|
key: max-length optional single
|
||||||
primary-match: [0-9a-f:\.]+/[0-9]+
|
|
||||||
network-owner: inet6num
|
network-owner: inet6num
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -14,12 +14,10 @@ key: mnt-by required multiple lookup=dn42.mntner > [m
|
|||||||
key: remarks optional multiple > [text]...
|
key: remarks optional multiple > [text]...
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
key: network-owner optional multiple > [parent-schema]
|
key: network-owner optional multiple > [parent-schema]
|
||||||
key: primary-match required multiple > [match]
|
|
||||||
key: key required multiple > [key-name]
|
key: key required multiple > [key-name]
|
||||||
{required|optional|recommend|deprecate}
|
{required|optional|recommend|deprecate}
|
||||||
{single|multiple} {primary|} {schema|}
|
{single|multiple} {primary|} {schema|}
|
||||||
lookup=str '>' [spec]...
|
lookup=str '>' [spec]...
|
||||||
primary-match: [0-9A-Z-]+-SCHEMA
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
remarks: # option descriptions
|
remarks: # option descriptions
|
||||||
|
|||||||
@@ -13,6 +13,5 @@ key: admin-c optional multiple lookup=dn42.person,dn42.ro
|
|||||||
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: mnt-by required multiple lookup=dn42.mntner
|
key: mnt-by required multiple lookup=dn42.mntner
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9A-Z-]+-TINC
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -8,6 +8,5 @@ key: admin-c optional multiple lookup=dn42.person,dn42.rol
|
|||||||
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
key: tech-c optional multiple lookup=dn42.person,dn42.role
|
||||||
key: mnt-by required multiple lookup=dn42.mntner
|
key: mnt-by required multiple lookup=dn42.mntner
|
||||||
key: source required single lookup=dn42.registry
|
key: source required single lookup=dn42.registry
|
||||||
primary-match: [0-9A-Z-]+-TINC-KEYSET
|
|
||||||
mnt-by: DN42-MNT
|
mnt-by: DN42-MNT
|
||||||
source: DN42
|
source: DN42
|
||||||
|
|||||||
@@ -1,25 +1,21 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"DN42 Schema Checker"
|
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
import argparse
|
import argparse
|
||||||
import glob
|
|
||||||
import urllib.parse
|
|
||||||
import http.client
|
|
||||||
import json
|
|
||||||
|
|
||||||
import log
|
import log
|
||||||
|
import glob
|
||||||
|
import random
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
|
||||||
SCHEMA_NAMESPACE = "dn42."
|
SCHEMA_NAMESPACE = "dn42."
|
||||||
|
|
||||||
|
|
||||||
class SchemaDOM:
|
class SchemaDOM:
|
||||||
"schema"
|
|
||||||
def __init__(self, fn):
|
def __init__(self, fn):
|
||||||
self.name = None
|
self.name = None
|
||||||
self.ref = None
|
self.ref = None
|
||||||
@@ -31,30 +27,30 @@ class SchemaDOM:
|
|||||||
|
|
||||||
def __parse_schema(self, f):
|
def __parse_schema(self, f):
|
||||||
schema = {}
|
schema = {}
|
||||||
for key, val, _ in f.dom:
|
for k, v, l in f.dom:
|
||||||
if key == "ref":
|
if k == 'ref':
|
||||||
self.ref = val
|
self.ref = v
|
||||||
elif key == "schema":
|
elif k == 'schema':
|
||||||
self.name = val
|
self.name = v
|
||||||
|
|
||||||
if key != "key":
|
if k != 'key':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
val = val.split()
|
v = v.split()
|
||||||
key = val.pop(0)
|
key = v.pop(0)
|
||||||
|
|
||||||
schema[key] = set()
|
schema[key] = set()
|
||||||
for i in val:
|
for i in v:
|
||||||
if i == ">":
|
if i == ">":
|
||||||
break
|
break
|
||||||
|
|
||||||
schema[key].add(i)
|
schema[key].add(i)
|
||||||
|
|
||||||
for k, v in schema.items():
|
for k, v in schema.items():
|
||||||
if "schema" in v:
|
if 'schema' in v:
|
||||||
self.type = k
|
self.type = k
|
||||||
|
|
||||||
if "primary" in v:
|
if 'primary' in v:
|
||||||
self.primary = k
|
self.primary = k
|
||||||
schema[k].add("oneline")
|
schema[k].add("oneline")
|
||||||
if "multiline" in v:
|
if "multiline" in v:
|
||||||
@@ -70,63 +66,51 @@ class SchemaDOM:
|
|||||||
if "deprecate" in v:
|
if "deprecate" in v:
|
||||||
schema[k].remove("deprecate")
|
schema[k].remove("deprecate")
|
||||||
|
|
||||||
if "oneline" not in v:
|
if 'oneline' not in v:
|
||||||
schema[k].add("multiline")
|
schema[k].add("multiline")
|
||||||
if "single" not in v:
|
if 'single' not in v:
|
||||||
schema[k].add("multiple")
|
schema[k].add("multiple")
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
|
|
||||||
def check_file(self, f, lookups=None):
|
def check_file(self, f, lookups=None):
|
||||||
"check file"
|
|
||||||
status = "PASS"
|
status = "PASS"
|
||||||
if not f.valid:
|
if not f.valid:
|
||||||
log.error("%s Line 0: File does not parse" % (f.src))
|
log.error("%s Line 0: File does not parse" % (f.src))
|
||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
|
|
||||||
for k, v in self.schema.items():
|
for k, v in self.schema.items():
|
||||||
if "required" in v and k not in f.keys:
|
if 'required' in v and k not in f.keys:
|
||||||
log.error("%s Line 0: Key [%s] not found and is required." % (f.src, k))
|
log.error(
|
||||||
|
"%s Line 0: Key [%s] not found and is required." % (f.src, k))
|
||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
elif "recommend" in v and k not in f.keys:
|
elif 'recommend' in v and k not in f.keys:
|
||||||
log.notice(
|
log.notice(
|
||||||
"%s Line 0: Key [%s] not found and is recommended." % (f.src, k)
|
"%s Line 0: Key [%s] not found and is recommended." % (f.src, k))
|
||||||
)
|
|
||||||
status = "NOTE"
|
status = "NOTE"
|
||||||
|
|
||||||
if "schema" in v and SCHEMA_NAMESPACE + f.dom[0][0] != self.ref:
|
if 'schema' in v and SCHEMA_NAMESPACE + f.dom[0][0] != self.ref:
|
||||||
log.error(
|
log.error(
|
||||||
"%s Line 1: Key [%s] not found and is required as the first line."
|
"%s Line 1: Key [%s] not found and is required as the first line." % (f.src, k))
|
||||||
% (f.src, k)
|
|
||||||
)
|
|
||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
|
|
||||||
if "single" in v and k in f.keys and len(f.keys[k]) > 1:
|
if 'single' in v and k in f.keys and len(f.keys[k]) > 1:
|
||||||
log.warning(
|
log.warning("%s Line %d: Key [%s] first defined here and has repeated keys." % (
|
||||||
"%s Line %d: Key [%s] first defined here and has repeated keys."
|
f.src, f.keys[k][0], k))
|
||||||
% (f.src, f.keys[k][0], k)
|
|
||||||
)
|
|
||||||
for l in f.keys[k][1:]:
|
for l in f.keys[k][1:]:
|
||||||
log.error(
|
log.error(
|
||||||
"%s Line %d: Key [%s] can only appear once." % (f.src, l, k)
|
"%s Line %d: Key [%s] can only appear once." % (f.src, l, k))
|
||||||
)
|
|
||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
|
|
||||||
if "oneline" in v and k in f.multi:
|
if 'oneline' in v and k in f.multi:
|
||||||
for l in f.keys[k]:
|
for l in f.keys[k]:
|
||||||
log.error(
|
log.error(
|
||||||
"%s Line %d: Key [%s] can not have multiple lines."
|
"%s Line %d: Key [%s] can not have multiple lines." % (f.src, l, k))
|
||||||
% (f.src, l, k)
|
|
||||||
)
|
|
||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
|
|
||||||
for k, v, l in f.dom:
|
for k, v, l in f.dom:
|
||||||
if k == self.primary and not f.src.endswith(
|
if k == self.primary and not f.src.endswith(v.replace("/","_").replace(" ","")):
|
||||||
v.replace("/", "_").replace(" ", "")):
|
log.error("%s Line %d: Primary [%s: %s] does not match filename." % (f.src, l, k, v))
|
||||||
log.error(
|
|
||||||
"%s Line %d: Primary [%s: %s] does not match filename."
|
|
||||||
% (f.src, l, k, v)
|
|
||||||
)
|
|
||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
|
|
||||||
if k.startswith("x-"):
|
if k.startswith("x-"):
|
||||||
@@ -137,11 +121,9 @@ class SchemaDOM:
|
|||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if "deprecate" in self.schema[k]:
|
if 'deprecate' in self.schema[k]:
|
||||||
log.info(
|
log.info(
|
||||||
"%s Line %d: Key [%s] was found and is deprecated."
|
"%s Line %d: Key [%s] was found and is deprecated." % (f.src, l, k))
|
||||||
% (f.src, l, k)
|
|
||||||
)
|
|
||||||
status = "INFO"
|
status = "INFO"
|
||||||
|
|
||||||
if lookups is not None:
|
if lookups is not None:
|
||||||
@@ -154,22 +136,20 @@ class SchemaDOM:
|
|||||||
if (ref, val) in lookups:
|
if (ref, val) in lookups:
|
||||||
found = True
|
found = True
|
||||||
if not found:
|
if not found:
|
||||||
log.error(
|
log.error("%s Line %d: Key %s references object %s in %s but does not exist." % (
|
||||||
"%s Line %d: Key %s references object %s in %s but does not exist."
|
f.src, l, k, val, refs))
|
||||||
% (f.src, l, k, val, refs)
|
|
||||||
)
|
|
||||||
status = "FAIL"
|
status = "FAIL"
|
||||||
if status != "FAIL":
|
if status != "FAIL":
|
||||||
ck = sanity_check(f)
|
ck = sanity_check(f)
|
||||||
if ck == "FAIL":
|
if ck == "FAIL":
|
||||||
status = ck
|
status = ck
|
||||||
|
|
||||||
print("CHECK\t%-54s\t%s\tMNTNERS: %s" % (f.src, status, ",".join(f.mntner)))
|
print("CHECK\t%-54s\t%s\tMNTNERS: %s" %(f.src, status, ','.join(f.mntner)))
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
class FileDOM:
|
class FileDOM:
|
||||||
"file"
|
|
||||||
def __init__(self, fn):
|
def __init__(self, fn):
|
||||||
self.valid = True
|
self.valid = True
|
||||||
self.dom = []
|
self.dom = []
|
||||||
@@ -179,7 +159,7 @@ class FileDOM:
|
|||||||
self.schema = None
|
self.schema = None
|
||||||
self.src = fn
|
self.src = fn
|
||||||
|
|
||||||
with open(fn, mode="r", encoding="utf-8") as f:
|
with open(fn, mode='r', encoding='utf-8') as f:
|
||||||
dom = []
|
dom = []
|
||||||
keys = {}
|
keys = {}
|
||||||
multi = {}
|
multi = {}
|
||||||
@@ -187,7 +167,7 @@ class FileDOM:
|
|||||||
last_multi = None
|
last_multi = None
|
||||||
|
|
||||||
for lineno, i in enumerate(f.readlines(), 1):
|
for lineno, i in enumerate(f.readlines(), 1):
|
||||||
if re.match(r"[ \t]", i):
|
if re.match(r'[ \t]', i):
|
||||||
if len(dom) == 0:
|
if len(dom) == 0:
|
||||||
log.error("File %s does not parse properly" % (fn) )
|
log.error("File %s does not parse properly" % (fn) )
|
||||||
self.valid = False
|
self.valid = False
|
||||||
@@ -207,7 +187,7 @@ class FileDOM:
|
|||||||
if len(i) < 2:
|
if len(i) < 2:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
dom.append([i[0].strip(), ":".join(i[1:]).strip(), lineno - 1])
|
dom.append([i[0].strip(), ':'.join(i[1:]).strip(), lineno - 1])
|
||||||
|
|
||||||
if i[0].strip() not in keys:
|
if i[0].strip() not in keys:
|
||||||
keys[i[0].strip()] = []
|
keys[i[0].strip()] = []
|
||||||
@@ -216,7 +196,7 @@ class FileDOM:
|
|||||||
|
|
||||||
last_multi = None
|
last_multi = None
|
||||||
|
|
||||||
if dom[-1][0] == "mnt-by":
|
if dom[-1][0] == 'mnt-by':
|
||||||
mntner.append(dom[-1][1])
|
mntner.append(dom[-1][1])
|
||||||
|
|
||||||
self.dom = dom
|
self.dom = dom
|
||||||
@@ -241,7 +221,6 @@ class FileDOM:
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def get(self, key, index=0, default=None):
|
def get(self, key, index=0, default=None):
|
||||||
"get value"
|
|
||||||
if key not in self.keys:
|
if key not in self.keys:
|
||||||
return default
|
return default
|
||||||
if index >= len(self.keys[key]) or index <= -len(self.keys[key]):
|
if index >= len(self.keys[key]) or index <= -len(self.keys[key]):
|
||||||
@@ -251,7 +230,7 @@ class FileDOM:
|
|||||||
|
|
||||||
|
|
||||||
def main(infile, schema):
|
def main(infile, schema):
|
||||||
"main command"
|
|
||||||
log.debug("Check File: %s" % (infile))
|
log.debug("Check File: %s" % (infile))
|
||||||
f = FileDOM(infile)
|
f = FileDOM(infile)
|
||||||
|
|
||||||
@@ -269,9 +248,7 @@ def main(infile, schema):
|
|||||||
s = SchemaDOM(f.schema)
|
s = SchemaDOM(f.schema)
|
||||||
return s.check_file(f)
|
return s.check_file(f)
|
||||||
|
|
||||||
|
|
||||||
def check_schemas(path):
|
def check_schemas(path):
|
||||||
"check schemas"
|
|
||||||
schemas = {}
|
schemas = {}
|
||||||
for fn in glob.glob(path+"/*"):
|
for fn in glob.glob(path+"/*"):
|
||||||
s = SchemaDOM(fn)
|
s = SchemaDOM(fn)
|
||||||
@@ -280,56 +257,45 @@ def check_schemas(path):
|
|||||||
|
|
||||||
ok = True
|
ok = True
|
||||||
c = schemas[SCHEMA_NAMESPACE + "schema"]
|
c = schemas[SCHEMA_NAMESPACE + "schema"]
|
||||||
for s in schemas:
|
for s in schemas.keys():
|
||||||
ck = c.check_file(s)
|
ck = c.check_file(s)
|
||||||
if not ck:
|
if not ck:
|
||||||
ok = False
|
ok = False
|
||||||
|
|
||||||
return ok
|
return ok
|
||||||
|
|
||||||
|
|
||||||
def scan_index(infile, mntner=None):
|
def scan_index(infile, mntner=None):
|
||||||
"scan index"
|
|
||||||
idx = {}
|
idx = {}
|
||||||
schemas = {}
|
schemas = {}
|
||||||
|
|
||||||
with open(infile, "r") as f:
|
with open(infile, 'r') as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
line = line.split()
|
line = line.split()
|
||||||
idx[(line[0], line[1])] = line[2:]
|
idx[(line[0], line[1])] = line[2:]
|
||||||
if line[0] == SCHEMA_NAMESPACE + "schema":
|
if line[0] == SCHEMA_NAMESPACE + 'schema':
|
||||||
s = SchemaDOM(line[2])
|
s = SchemaDOM(line[2])
|
||||||
log.info("read schema: %s" % (s.name))
|
log.info("read schema: %s" % (s.name))
|
||||||
schemas[s.ref] = s
|
schemas[s.ref] = s
|
||||||
|
|
||||||
return __scan_index(idx, schemas, mntner)
|
return __scan_index(idx, schemas, mntner)
|
||||||
|
|
||||||
|
|
||||||
def scan_files(path, mntner=None, use_file=None):
|
def scan_files(path, mntner=None, use_file=None):
|
||||||
"scan files"
|
|
||||||
arr = __index_files(path, use_file)
|
arr = __index_files(path, use_file)
|
||||||
|
|
||||||
idx = {}
|
idx = {}
|
||||||
schemas = {}
|
schemas = {}
|
||||||
|
|
||||||
for dom in arr:
|
for dom in arr:
|
||||||
line = (
|
line = (dom.schema, dom.src.split("/")[-1].replace("_", "/"), dom.src, ",".join(dom.mntner), dom)
|
||||||
dom.schema,
|
|
||||||
dom.src.split("/")[-1].replace("_", "/"),
|
|
||||||
dom.src,
|
|
||||||
",".join(dom.mntner),
|
|
||||||
dom,
|
|
||||||
)
|
|
||||||
|
|
||||||
idx[(line[0], line[1])] = line[2:]
|
idx[(line[0], line[1])] = line[2:]
|
||||||
if line[0] == SCHEMA_NAMESPACE + "schema":
|
if line[0] == SCHEMA_NAMESPACE + 'schema':
|
||||||
s = SchemaDOM(line[2])
|
s = SchemaDOM(line[2])
|
||||||
schemas[s.ref] = s
|
schemas[s.ref] = s
|
||||||
|
|
||||||
return __scan_index(idx, schemas, mntner, use_file)
|
return __scan_index(idx, schemas, mntner, use_file)
|
||||||
|
|
||||||
|
def __scan_index(idx, schemas, mntner, use_file):
|
||||||
def __scan_index(idx, schemas, mntner, use_file=None):
|
|
||||||
ok = True
|
ok = True
|
||||||
for k, v in idx.items():
|
for k, v in idx.items():
|
||||||
if use_file is not None and use_file != v[0]:
|
if use_file is not None and use_file != v[0]:
|
||||||
@@ -349,6 +315,7 @@ def __scan_index(idx, schemas, mntner, use_file=None):
|
|||||||
if mntner is not None and mntner not in mlist:
|
if mntner is not None and mntner not in mlist:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
c = v[2]
|
c = v[2]
|
||||||
ck = s.check_file(c, idx.keys())
|
ck = s.check_file(c, idx.keys())
|
||||||
|
|
||||||
@@ -358,8 +325,7 @@ def __scan_index(idx, schemas, mntner, use_file=None):
|
|||||||
ok = ck
|
ok = ck
|
||||||
return ok
|
return ok
|
||||||
|
|
||||||
|
def __index_files(path, use_file):
|
||||||
def __index_files(path, use_file=None):
|
|
||||||
xlat = {
|
xlat = {
|
||||||
"dns/": SCHEMA_NAMESPACE + "domain",
|
"dns/": SCHEMA_NAMESPACE + "domain",
|
||||||
"inetnum/": SCHEMA_NAMESPACE + "inetnum",
|
"inetnum/": SCHEMA_NAMESPACE + "inetnum",
|
||||||
@@ -379,9 +345,9 @@ def __index_files(path, use_file=None):
|
|||||||
"schema/": SCHEMA_NAMESPACE + "schema",
|
"schema/": SCHEMA_NAMESPACE + "schema",
|
||||||
}
|
}
|
||||||
|
|
||||||
for root, _, files in os.walk(path):
|
for root, dirs, files in os.walk(path):
|
||||||
ignore = True
|
ignore = True
|
||||||
for t in xlat:
|
for t in xlat.keys():
|
||||||
if root+"/" == os.path.join(path, t):
|
if root+"/" == os.path.join(path, t):
|
||||||
ignore = False
|
ignore = False
|
||||||
break
|
break
|
||||||
@@ -398,32 +364,32 @@ def __index_files(path, use_file=None):
|
|||||||
dom = FileDOM(use_file)
|
dom = FileDOM(use_file)
|
||||||
yield dom
|
yield dom
|
||||||
|
|
||||||
|
|
||||||
def index_files(path):
|
def index_files(path):
|
||||||
"index files"
|
|
||||||
idx = __index_files(path)
|
idx = __index_files(path)
|
||||||
for i in idx:
|
for i in idx:
|
||||||
print("%s\t%s\t%s\t%s" % i)
|
print("%s\t%s\t%s\t%s" % i)
|
||||||
|
|
||||||
|
|
||||||
def http_get(server, url, query=None, headers=None):
|
def http_get(server, url, query=None, headers=None):
|
||||||
"http get"
|
import urllib.parse
|
||||||
|
import http.client
|
||||||
|
import json
|
||||||
|
|
||||||
if headers is None:
|
if headers is None:
|
||||||
headers = {}
|
headers = {}
|
||||||
if "User-Agent" not in headers:
|
if 'User-Agent' not in headers:
|
||||||
headers["User-Agent"] = "curl"
|
headers['User-Agent'] = "curl"
|
||||||
if "Accept" not in headers:
|
if 'Accept' not in headers:
|
||||||
headers["Accept"] = "application/json"
|
headers['Accept'] = 'application/json'
|
||||||
|
|
||||||
if query is None:
|
if query is None:
|
||||||
query = {}
|
query = {}
|
||||||
|
|
||||||
http_client = http.client.HTTPSConnection(server)
|
http_client = http.client.HTTPSConnection(server)
|
||||||
|
|
||||||
full_url = url + "?" + urllib.parse.urlencode(query)
|
full_url = url + '?' + urllib.parse.urlencode(query)
|
||||||
log.debug("GET " + full_url)
|
log.debug("GET " + full_url)
|
||||||
|
|
||||||
http_client.request("GET", full_url, headers=headers)
|
http_client.request('GET', full_url, headers=headers)
|
||||||
req = http_client.getresponse()
|
req = http_client.getresponse()
|
||||||
log.debug("HTTP Response: %d %s" % (req.status, req.reason))
|
log.debug("HTTP Response: %d %s" % (req.status, req.reason))
|
||||||
|
|
||||||
@@ -440,73 +406,61 @@ def http_get(server, url, query=None, headers=None):
|
|||||||
|
|
||||||
return req.read()
|
return req.read()
|
||||||
|
|
||||||
|
def find(fields=None, filter=None):
|
||||||
def find(fields=None, filters=None):
|
|
||||||
"find"
|
|
||||||
server = "registry.dn42.us"
|
server = "registry.dn42.us"
|
||||||
url = "/v1/reg/reg.objects"
|
url = "/v1/reg/reg.objects"
|
||||||
if fields is None:
|
if fields is None:
|
||||||
fields = []
|
fields = []
|
||||||
if filters is None:
|
if filter is None:
|
||||||
filters = {}
|
filter = {}
|
||||||
query = {
|
query = {"fields": ",".join(fields), "filter": ",".join([k + "=" + v for k, v in filter.items()])}
|
||||||
"fields": ",".join(fields),
|
|
||||||
"filter": ",".join([k + "=" + v for k, v in filters.items()]),
|
|
||||||
}
|
|
||||||
return http_get(server, url, query)
|
return http_get(server, url, query)
|
||||||
|
|
||||||
|
|
||||||
def to_num(ip):
|
def to_num(ip):
|
||||||
"ip to number"
|
ip = [int(i) for i in ip.split('.')]
|
||||||
ip = [int(i) for i in ip.split(".")]
|
|
||||||
return ip[3] + ip[2] * 256 + ip[1] * 256 ** 2 + ip[0] * 256 ** 3
|
return ip[3] + ip[2] * 256 + ip[1] * 256 ** 2 + ip[0] * 256 ** 3
|
||||||
|
|
||||||
|
|
||||||
def to_ip(num):
|
def to_ip(num):
|
||||||
"number to ip"
|
return '.'.join([str(i) for i in [num >> 24, (num >> 16) & 0xFF, (num >> 8) & 0xFF, num & 0xFF]])
|
||||||
return ".".join(
|
|
||||||
[str(i) for i in [num >> 24, (num >> 16) & 0xFF, (num >> 8) & 0xFF, num & 0xFF]]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def pretty_ip(addr):
|
def pretty_ip(addr):
|
||||||
"pretty ip"
|
|
||||||
if addr.startswith("00000000000000000000ffff"):
|
if addr.startswith("00000000000000000000ffff"):
|
||||||
addr = addr[-8:]
|
addr = addr[-8:]
|
||||||
addr = int(addr, 16)
|
addr = int(addr, 16)
|
||||||
return to_ip(addr)
|
return to_ip(addr)
|
||||||
return ":".join([addr[i:i+4] for i in range(0, len(addr), 4)])
|
return ":".join([addr[i:i+4] for i in range(0, len(addr), 4)])
|
||||||
|
|
||||||
|
# addr = ["%x" % (int(addr[i:i+4],16)) for i in range(0, len(addr), 4)]
|
||||||
|
#
|
||||||
|
# last_seg = 8
|
||||||
|
# for i, seg in enumerate(addr[::-1]):
|
||||||
|
# if seg == "0": last_seg = 7 - i
|
||||||
|
# else: break
|
||||||
|
#
|
||||||
|
# return ":".join(addr[:last_seg]) + ("::" if last_seg < 8 else "")
|
||||||
|
|
||||||
def expand_ipv6(addr):
|
def expand_ipv6(addr):
|
||||||
"expand ip6"
|
|
||||||
addr = addr.lower()
|
addr = addr.lower()
|
||||||
if "::" in addr:
|
if "::" in addr:
|
||||||
if addr.count("::") > 1:
|
if addr.count('::') > 1:
|
||||||
return False
|
return False
|
||||||
addr = addr.replace("::", ":" * (9 - addr.count(":")))
|
addr = addr.replace('::', ':' * (9 - addr.count(':')))
|
||||||
if addr.count(":") != 7:
|
if addr.count(':') != 7:
|
||||||
return False
|
return False
|
||||||
return "".join((i.zfill(4) for i in addr.split(":")))
|
return ''.join((i.zfill(4) for i in addr.split(":")))
|
||||||
|
|
||||||
|
|
||||||
def ip4_to_ip6(ip):
|
def ip4_to_ip6(ip):
|
||||||
"ip4 to ip6"
|
return "::ffff:%04x:%04x" % (ip >> 16, ip & 0xffff)
|
||||||
return "::ffff:%04x:%04x" % (ip >> 16, ip & 0xFFFF)
|
|
||||||
|
|
||||||
|
|
||||||
def inetrange(inet):
|
def inetrange(inet):
|
||||||
"inet range"
|
ip, mask = inet.split('/')
|
||||||
ip, mask = inet.split("/")
|
|
||||||
mask = int(mask)
|
mask = int(mask)
|
||||||
ip = to_num(ip) & (0xFFFFFFFF << 32 - mask)
|
ip = to_num(ip) & (0xFFFFFFFF << 32 - mask)
|
||||||
ip6 = ip4_to_ip6(ip)
|
ip6 = ip4_to_ip6(ip)
|
||||||
return inet6range("%s/%d" % (ip6, mask + 96))
|
return inet6range("%s/%d" % (ip6, mask + 96))
|
||||||
|
|
||||||
|
|
||||||
def inet6range(inet):
|
def inet6range(inet):
|
||||||
"inet6 range"
|
ip, mask = inet.split('/')
|
||||||
ip, mask = inet.split("/")
|
|
||||||
mask = int(mask)
|
mask = int(mask)
|
||||||
|
|
||||||
log.debug(ip)
|
log.debug(ip)
|
||||||
@@ -516,27 +470,20 @@ def inet6range(inet):
|
|||||||
return ip, ip, mask
|
return ip, ip, mask
|
||||||
|
|
||||||
offset = int(ip[mask // 4], 16)
|
offset = int(ip[mask // 4], 16)
|
||||||
return (
|
return "%s%x%s" % (
|
||||||
"%s%x%s"
|
ip[:mask // 4],
|
||||||
% (ip[: mask // 4], offset & (0xF0 >> mask % 4), "0" * (31 - mask // 4)),
|
offset & (0xf0 >> mask % 4),
|
||||||
"%s%x%s"
|
"0" * (31 - mask // 4)
|
||||||
% (ip[: mask // 4], offset | (0xF >> mask % 4), "f" * (31 - mask // 4)),
|
), "%s%x%s" % (
|
||||||
mask,
|
ip[:mask // 4],
|
||||||
)
|
offset | (0xf >> mask % 4),
|
||||||
|
"f" * (31 - mask // 4)
|
||||||
|
), mask
|
||||||
|
|
||||||
def test_policy(obj_type, name, mntner):
|
def test_policy(obj_type, name, mntner):
|
||||||
"test policy"
|
|
||||||
log.debug([obj_type, name, mntner])
|
log.debug([obj_type, name, mntner])
|
||||||
|
|
||||||
if obj_type in ["organisation",
|
if obj_type in ["organisation", "mntner", "person", "role", "as-set", "schema", "dns"]:
|
||||||
"mntner",
|
|
||||||
"person",
|
|
||||||
"role",
|
|
||||||
"as-set",
|
|
||||||
"schema",
|
|
||||||
"dns",
|
|
||||||
]:
|
|
||||||
if obj_type == "organisation" and not name.startswith("ORG-"):
|
if obj_type == "organisation" and not name.startswith("ORG-"):
|
||||||
log.error("%s does not start with 'ORG-'" %(name))
|
log.error("%s does not start with 'ORG-'" %(name))
|
||||||
return "FAIL"
|
return "FAIL"
|
||||||
@@ -560,35 +507,35 @@ def test_policy(obj_type, name, mntner):
|
|||||||
log.notice("%s does not currently exist" %(name))
|
log.notice("%s does not currently exist" %(name))
|
||||||
return "PASS"
|
return "PASS"
|
||||||
|
|
||||||
status = "FAIL"
|
status = 'FAIL'
|
||||||
for o in lis:
|
for o in lis:
|
||||||
for n in o:
|
for n in o:
|
||||||
log.debug(n)
|
log.debug(n)
|
||||||
log.debug(mntner)
|
log.debug(mntner)
|
||||||
if n[0] == "mnt-by" and n[1] == mntner:
|
if n[0] == "mnt-by" and n[1] == mntner:
|
||||||
status = "PASS"
|
status = 'PASS'
|
||||||
return status
|
return status
|
||||||
|
|
||||||
log.error("%s does not have mnt for object" %(mntner))
|
log.error("%s does not have mnt for object" %(mntner))
|
||||||
return status
|
return status
|
||||||
|
|
||||||
elif obj_type in ["inetnum", "inet6num"]:
|
elif args["type"] in ["inetnum","inet6num"]:
|
||||||
log.info("Checking inetnum type")
|
log.info("Checking inetnum type")
|
||||||
lis = find(["mnt-by"], {"@type": "net", "cidr": name})
|
lis = find(["mnt-by"], {"@type": "net", "cidr": name})
|
||||||
log.debug(lis)
|
log.debug(lis)
|
||||||
|
|
||||||
if len(lis) > 0:
|
if len(lis) > 0:
|
||||||
status = "FAIL"
|
status = 'FAIL'
|
||||||
for o in lis:
|
for o in lis:
|
||||||
for n in o:
|
for n in o:
|
||||||
if n[0] == "mnt-by" and n[1] == mntner:
|
if n[0] == "mnt-by" and n[1] == mntner:
|
||||||
status = "PASS"
|
status = 'PASS'
|
||||||
log.notice("%s has mnt for current object" %(mntner))
|
log.notice("%s has mnt for current object" %(mntner))
|
||||||
return status
|
return status
|
||||||
log.error("%s does not have mnt for current object" %(mntner))
|
log.error("%s does not have mnt for current object" %(mntner))
|
||||||
return status
|
return status
|
||||||
|
|
||||||
if obj_type == "inetnum":
|
if args["type"] == "inetnum":
|
||||||
Lnet, Hnet, mask = inetrange(name)
|
Lnet, Hnet, mask = inetrange(name)
|
||||||
else:
|
else:
|
||||||
Lnet, Hnet, mask = inet6range(name)
|
Lnet, Hnet, mask = inet6range(name)
|
||||||
@@ -596,15 +543,8 @@ def test_policy(obj_type, name, mntner):
|
|||||||
mask = "%03d" %(mask)
|
mask = "%03d" %(mask)
|
||||||
|
|
||||||
log.info([Lnet, Hnet, mask])
|
log.info([Lnet, Hnet, mask])
|
||||||
lis = find(
|
lis = find(["inetnum","inet6num","policy","@netlevel","mnt-by","mnt-lower"],
|
||||||
["inetnum", "inet6num", "policy", "@netlevel", "mnt-by", "mnt-lower"],
|
{"@type": "net", "@netmin": "le=" + Lnet, "@netmax": "ge=" + Hnet, "@netmask": "lt=" + mask})
|
||||||
{
|
|
||||||
"@type": "net",
|
|
||||||
"@netmin": "le=" + Lnet,
|
|
||||||
"@netmax": "ge=" + Hnet,
|
|
||||||
"@netmask": "lt=" + mask,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
log.debug(lis)
|
log.debug(lis)
|
||||||
|
|
||||||
policy = {}
|
policy = {}
|
||||||
@@ -626,7 +566,7 @@ def test_policy(obj_type, name, mntner):
|
|||||||
elif select<=k:
|
elif select<=k:
|
||||||
select = k
|
select = k
|
||||||
|
|
||||||
if select is None:
|
if select == None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif policy.get(select,{}).get("policy","closed") == "open":
|
elif policy.get(select,{}).get("policy","closed") == "open":
|
||||||
@@ -638,38 +578,31 @@ def test_policy(obj_type, name, mntner):
|
|||||||
log.notice("%s has mnt in parent object" %(mntner))
|
log.notice("%s has mnt in parent object" %(mntner))
|
||||||
return "PASS"
|
return "PASS"
|
||||||
|
|
||||||
elif obj_type in ["route", "route6"]:
|
elif args["type"] in ["route","route6"]:
|
||||||
log.info("Checking route type")
|
log.info("Checking route type")
|
||||||
lis = find(["mnt-by"], {"@type": "route", obj_type: name})
|
lis = find(["mnt-by"], {"@type": "route", args["type"]: name})
|
||||||
log.debug(lis)
|
log.debug(lis)
|
||||||
|
|
||||||
if len(lis) > 0:
|
if len(lis) > 0:
|
||||||
status = "FAIL"
|
status = 'FAIL'
|
||||||
for o in lis:
|
for o in lis:
|
||||||
for n in o:
|
for n in o:
|
||||||
if n[0] == "mnt-by" and n[1] == mntner:
|
if n[0] == "mnt-by" and n[1] == mntner:
|
||||||
status = "PASS"
|
status = 'PASS'
|
||||||
log.notice("%s has mnt for current object" %(mntner))
|
log.notice("%s has mnt for current object" %(mntner))
|
||||||
return status
|
return status
|
||||||
log.error("%s does not have mnt for current object" %(mntner))
|
log.error("%s does not have mnt for current object" %(mntner))
|
||||||
return status
|
return status
|
||||||
|
|
||||||
if obj_type == "route":
|
if args["type"] == "route":
|
||||||
Lnet, Hnet, mask = inetrange(name)
|
Lnet, Hnet, mask = inetrange(name)
|
||||||
else:
|
else:
|
||||||
Lnet, Hnet, mask = inet6range(name)
|
Lnet, Hnet, mask = inet6range(name)
|
||||||
mask = "%03d" %(mask)
|
mask = "%03d" %(mask)
|
||||||
|
|
||||||
log.info([Lnet, Hnet, mask])
|
log.info([Lnet, Hnet, mask])
|
||||||
lis = find(
|
lis = find(["inetnum","inet6num","policy","@netlevel","mnt-by","mnt-lower"],
|
||||||
["inetnum", "inet6num", "policy", "@netlevel", "mnt-by", "mnt-lower"],
|
{"@type": "net", "@netmin": "le=" + Lnet, "@netmax": "ge=" + Hnet, "@netmask": "le=" + mask})
|
||||||
{
|
|
||||||
"@type": "net",
|
|
||||||
"@netmin": "le=" + Lnet,
|
|
||||||
"@netmax": "ge=" + Hnet,
|
|
||||||
"@netmask": "le=" + mask,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
log.debug(lis)
|
log.debug(lis)
|
||||||
|
|
||||||
policy = {}
|
policy = {}
|
||||||
@@ -691,7 +624,7 @@ def test_policy(obj_type, name, mntner):
|
|||||||
elif select<=k:
|
elif select<=k:
|
||||||
select = k
|
select = k
|
||||||
|
|
||||||
if select is None:
|
if select == None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif policy.get(select,{}).get("policy","closed") == "open":
|
elif policy.get(select,{}).get("policy","closed") == "open":
|
||||||
@@ -703,7 +636,7 @@ def test_policy(obj_type, name, mntner):
|
|||||||
log.notice("%s has mnt in parent object" %(mntner))
|
log.notice("%s has mnt in parent object" %(mntner))
|
||||||
return "PASS"
|
return "PASS"
|
||||||
|
|
||||||
elif obj_type == "aut-num":
|
elif args["type"] == "aut-num":
|
||||||
if not name.startswith("AS"):
|
if not name.startswith("AS"):
|
||||||
log.error("%s does not start with AS" %(name))
|
log.error("%s does not start with AS" %(name))
|
||||||
return "FAIL"
|
return "FAIL"
|
||||||
@@ -713,11 +646,11 @@ def test_policy(obj_type, name, mntner):
|
|||||||
log.debug(lis)
|
log.debug(lis)
|
||||||
|
|
||||||
if len(lis) > 0:
|
if len(lis) > 0:
|
||||||
status = "FAIL"
|
status = 'FAIL'
|
||||||
for o in lis:
|
for o in lis:
|
||||||
for n in o:
|
for n in o:
|
||||||
if n[0] == "mnt-by" and n[1] == mntner:
|
if n[0] == "mnt-by" and n[1] == mntner:
|
||||||
status = "PASS"
|
status = 'PASS'
|
||||||
log.notice("%s has mnt for current object" %(mntner))
|
log.notice("%s has mnt for current object" %(mntner))
|
||||||
return status
|
return status
|
||||||
log.error("%s does not have mnt for current object" %(mntner))
|
log.error("%s does not have mnt for current object" %(mntner))
|
||||||
@@ -725,10 +658,8 @@ def test_policy(obj_type, name, mntner):
|
|||||||
|
|
||||||
# 2. Check if the as-block has an open policy
|
# 2. Check if the as-block has an open policy
|
||||||
asn = "AS{:0>9}".format(name[2:])
|
asn = "AS{:0>9}".format(name[2:])
|
||||||
lis = find(
|
lis = find(["as-block","policy","@as-min","@as-max","mnt-by","mnt-lower"],
|
||||||
["as-block", "policy", "@as-min", "@as-max", "mnt-by", "mnt-lower"],
|
{"@type": "as-block","@as-min":"le=" + asn,"@as-max": "ge=" + asn})
|
||||||
{"@type": "as-block", "@as-min": "le=" + asn, "@as-max": "ge=" + asn},
|
|
||||||
)
|
|
||||||
log.info(lis)
|
log.info(lis)
|
||||||
|
|
||||||
policy = {}
|
policy = {}
|
||||||
@@ -759,7 +690,7 @@ def test_policy(obj_type, name, mntner):
|
|||||||
log.notice("%s has mnt in parent object" %(mntner))
|
log.notice("%s has mnt in parent object" %(mntner))
|
||||||
return "PASS"
|
return "PASS"
|
||||||
|
|
||||||
elif obj_type == "as-block":
|
elif args["type"] == "as-block":
|
||||||
Lname, Hname = name.split("-")
|
Lname, Hname = name.split("-")
|
||||||
Lname, Hname = Lname.strip(), Hname.strip()
|
Lname, Hname = Lname.strip(), Hname.strip()
|
||||||
|
|
||||||
@@ -772,11 +703,11 @@ def test_policy(obj_type, name, mntner):
|
|||||||
log.debug(lis)
|
log.debug(lis)
|
||||||
|
|
||||||
if len(lis) > 0:
|
if len(lis) > 0:
|
||||||
status = "FAIL"
|
status = 'FAIL'
|
||||||
for o in lis:
|
for o in lis:
|
||||||
for n in o:
|
for n in o:
|
||||||
if n[0] == "mnt-by" and n[1] == mntner:
|
if n[0] == "mnt-by" and n[1] == mntner:
|
||||||
status = "PASS"
|
status = 'PASS'
|
||||||
log.notice("%s has mnt for current object" %(mntner))
|
log.notice("%s has mnt for current object" %(mntner))
|
||||||
return status
|
return status
|
||||||
log.notice("%s does not have mnt for current object" %(mntner))
|
log.notice("%s does not have mnt for current object" %(mntner))
|
||||||
@@ -789,10 +720,7 @@ def test_policy(obj_type, name, mntner):
|
|||||||
if Lasn > Hasn:
|
if Lasn > Hasn:
|
||||||
log.error("%s should come before %s" %(Lname, Hname))
|
log.error("%s should come before %s" %(Lname, Hname))
|
||||||
|
|
||||||
lis = find(
|
lis = find(["as-block","policy","@as-min","@as-max","mnt-by","mnt-lower"], {"@type": "as-block","@as-min":"le=" + Lasn,"@as-max": "ge=" + Hasn})
|
||||||
["as-block", "policy", "@as-min", "@as-max", "mnt-by", "mnt-lower"],
|
|
||||||
{"@type": "as-block", "@as-min": "le=" + Lasn, "@as-max": "ge=" + Hasn},
|
|
||||||
)
|
|
||||||
log.debug(lis)
|
log.debug(lis)
|
||||||
|
|
||||||
policy = {}
|
policy = {}
|
||||||
@@ -824,147 +752,108 @@ def test_policy(obj_type, name, mntner):
|
|||||||
if mntner in mntners:
|
if mntner in mntners:
|
||||||
log.notice("%s has mnt in parent object" %(mntner))
|
log.notice("%s has mnt in parent object" %(mntner))
|
||||||
return "PASS"
|
return "PASS"
|
||||||
|
pass
|
||||||
|
|
||||||
log.error("%s does not pass checks for %s %s" %(mntner, obj_type, name))
|
log.error("%s does not pass checks for %s %s" %(mntner, obj_type, name))
|
||||||
return "FAIL"
|
return "FAIL"
|
||||||
|
|
||||||
|
|
||||||
def sanity_check(dom):
|
def sanity_check(dom):
|
||||||
"sanity check"
|
# log.info(dom.keys)
|
||||||
|
# log.info(dom.dom)
|
||||||
ck = "PASS"
|
ck = "PASS"
|
||||||
if dom.schema == "dn42.inetnum":
|
if dom.schema == "dn42.inetnum":
|
||||||
cidr = dom.get("cidr")
|
cidr = dom.get("cidr")
|
||||||
Lnet, Hnet, _ = inetrange(cidr)
|
Lnet, Hnet, mask = inetrange(cidr)
|
||||||
cidr_range = pretty_ip(Lnet) + "-" + pretty_ip(Hnet)
|
cidr_range = pretty_ip(Lnet) + "-" + pretty_ip(Hnet)
|
||||||
file_range = dom.get("inetnum")
|
file_range = dom.get("inetnum")
|
||||||
file_range = re.sub(r"\s+", "", file_range, flags=re.UNICODE)
|
file_range = re.sub(r"\s+", "", file_range, flags=re.UNICODE)
|
||||||
|
|
||||||
if cidr_range != file_range:
|
if cidr_range != file_range:
|
||||||
log.error(
|
log.error("inetnum range [%s] does not match: [%s]" %(file_range, cidr_range))
|
||||||
"inetnum range [%s] does not match: [%s]" % (file_range, cidr_range)
|
|
||||||
)
|
|
||||||
ck = "FAIL"
|
ck = "FAIL"
|
||||||
|
|
||||||
if dom.schema == "dn42.inet6num":
|
if dom.schema == "dn42.inet6num":
|
||||||
cidr = dom.get("cidr")
|
cidr = dom.get("cidr")
|
||||||
log.info(cidr)
|
log.info(cidr)
|
||||||
Lnet, Hnet, _ = inet6range(cidr)
|
Lnet, Hnet, mask = inet6range(cidr)
|
||||||
cidr_range = pretty_ip(Lnet) + "-" + pretty_ip(Hnet)
|
cidr_range = pretty_ip(Lnet) + "-" + pretty_ip(Hnet)
|
||||||
file_range = dom.get("inet6num")
|
file_range = dom.get("inet6num")
|
||||||
file_range = re.sub(r"\s+", "", file_range, flags=re.UNICODE)
|
file_range = re.sub(r"\s+", "", file_range, flags=re.UNICODE)
|
||||||
|
|
||||||
if cidr_range != file_range:
|
if cidr_range != file_range:
|
||||||
log.error(
|
log.error("inetnum range [%s] does not match: [%s]" %(file_range, cidr_range))
|
||||||
"inetnum range [%s] does not match: [%s]" % (file_range, cidr_range)
|
|
||||||
)
|
|
||||||
ck = "FAIL"
|
ck = "FAIL"
|
||||||
|
|
||||||
return ck
|
return ck
|
||||||
|
|
||||||
|
|
||||||
def get_args():
|
def get_args():
|
||||||
"""Get and parse command line arguments"""
|
"""Get and parse command line arguments"""
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Check Schema. Checks Schema of file for validity"
|
description='Check Schema. Checks Schema of file for validity')
|
||||||
)
|
parser.add_argument('--merge-output',
|
||||||
parser.add_argument(
|
help="Merge stderr into stdout (helps when reading output with pagers) [Default OFF]", action="store_true")
|
||||||
"--merge-output",
|
parser.add_argument('-v', '--verbose',
|
||||||
help="Merge stderr into stdout (helps when reading output with pagers) [Default OFF]",
|
help="Enable verbose output [Default OFF]", action="store_true")
|
||||||
action="store_true",
|
parser.add_argument('-vv', '--doubleVerbose',
|
||||||
)
|
help="Enable full verbose output [Default OFF]", action="store_true")
|
||||||
parser.add_argument(
|
|
||||||
"-v",
|
|
||||||
"--verbose",
|
|
||||||
help="Enable verbose output [Default OFF]",
|
|
||||||
action="store_true",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"-vv",
|
|
||||||
"--doubleVerbose",
|
|
||||||
help="Enable full verbose output [Default OFF]",
|
|
||||||
action="store_true",
|
|
||||||
)
|
|
||||||
|
|
||||||
subparsers = parser.add_subparsers(help="sub-command help", dest="command")
|
subparsers = parser.add_subparsers(help='sub-command help', dest="command")
|
||||||
|
|
||||||
parser_file = subparsers.add_parser("check-file", help="Process a specific file")
|
parser_file = subparsers.add_parser(
|
||||||
|
'check-file', help='Process a specific file')
|
||||||
|
parser_file.add_argument('-s', '--use-schema', nargs='?',
|
||||||
|
help="Override schema to validate [Default None]", action="store")
|
||||||
parser_file.add_argument(
|
parser_file.add_argument(
|
||||||
"-s",
|
'infile', nargs="?", help="File to check", type=str)
|
||||||
"--use-schema",
|
|
||||||
nargs="?",
|
|
||||||
help="Override schema to validate [Default None]",
|
|
||||||
action="store",
|
|
||||||
)
|
|
||||||
parser_file.add_argument("infile", nargs="?", help="File to check", type=str)
|
|
||||||
|
|
||||||
parser_schema = subparsers.add_parser("check-schemas", help="Validate all schemas")
|
parser_schema = subparsers.add_parser(
|
||||||
parser_schema.add_argument("path", nargs="?", help="Path for schemas", type=str)
|
'check-schemas', help='Validate all schemas')
|
||||||
|
parser_schema.add_argument(
|
||||||
|
'path', nargs="?", help="Path for schemas", type=str)
|
||||||
|
|
||||||
parser_index = subparsers.add_parser("index", help="Generate index")
|
parser_index = subparsers.add_parser('index', help='Generate index')
|
||||||
parser_index.add_argument("path", nargs="?", help="Path for dn42 data", type=str)
|
parser_index.add_argument(
|
||||||
|
'path', nargs="?", help="Path for dn42 data", type=str)
|
||||||
|
|
||||||
parser_scanindex = subparsers.add_parser(
|
parser_scanindex = subparsers.add_parser(
|
||||||
"scan-index", help="Validate files in index"
|
'scan-index', help='Validate files in index')
|
||||||
)
|
|
||||||
parser_scanindex.add_argument(
|
parser_scanindex.add_argument(
|
||||||
"infile", nargs="?", help="Index file to scan", type=str
|
'infile', nargs="?", help="Index file to scan", type=str)
|
||||||
)
|
parser_scanindex.add_argument('-m', '--use-mntner', nargs='?',
|
||||||
parser_scanindex.add_argument(
|
help="Only scan files that has MNT [Default None]", action="store")
|
||||||
"-m",
|
|
||||||
"--use-mntner",
|
|
||||||
nargs="?",
|
|
||||||
help="Only scan files that has MNT [Default None]",
|
|
||||||
action="store",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser_scan = subparsers.add_parser("scan", help="Validate files in index")
|
parser_scan = subparsers.add_parser('scan', help='Validate files in index')
|
||||||
parser_scan.add_argument("path", nargs="?", help="Path for dn42 data", type=str)
|
|
||||||
parser_scan.add_argument(
|
parser_scan.add_argument(
|
||||||
"-m",
|
'path', nargs="?", help="Path for dn42 data", type=str)
|
||||||
"--use-mntner",
|
parser_scan.add_argument('-m', '--use-mntner', nargs='?',
|
||||||
nargs="?",
|
help="Only scan files that has a matching MNT [Default None]", action="store")
|
||||||
help="Only scan files that has a matching MNT [Default None]",
|
parser_scan.add_argument('-f', '--use-file', nargs='?',
|
||||||
action="store",
|
help="Only scan file given [Default None]", action="store")
|
||||||
)
|
|
||||||
parser_scan.add_argument(
|
|
||||||
"-f",
|
|
||||||
"--use-file",
|
|
||||||
nargs="?",
|
|
||||||
help="Only scan file given [Default None]",
|
|
||||||
action="store",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser_fmt = subparsers.add_parser("fmt", help="Format file")
|
parser_fmt = subparsers.add_parser('fmt', help='Format file')
|
||||||
parser_fmt.add_argument(
|
parser_fmt.add_argument(
|
||||||
"infile", nargs="?", help="Path for dn42 data file", type=str
|
'infile', nargs="?", help="Path for dn42 data file", type=str)
|
||||||
)
|
parser_fmt.add_argument('-i', '--in-place',
|
||||||
parser_fmt.add_argument(
|
help="Format file in place", action="store_true")
|
||||||
"-i", "--in-place", help="Format file in place", action="store_true"
|
|
||||||
)
|
|
||||||
|
|
||||||
parser_sane = subparsers.add_parser(
|
parser_sane = subparsers.add_parser('sanity-check', help='Check the file for sane-ness')
|
||||||
"sanity-check", help="Check the file for sane-ness"
|
|
||||||
)
|
|
||||||
parser_sane.add_argument(
|
parser_sane.add_argument(
|
||||||
"infile", nargs="?", help="Path for dn42 data file", type=str
|
'infile', nargs="?", help="Path for dn42 data file", type=str)
|
||||||
)
|
|
||||||
|
|
||||||
parser_pol = subparsers.add_parser("policy", help="Format file")
|
parser_pol = subparsers.add_parser('policy', help='Format file')
|
||||||
parser_pol.add_argument("type", nargs="?", type=str, help="dn42 object type")
|
parser_pol.add_argument('type', nargs="?", type=str, help="dn42 object type")
|
||||||
parser_pol.add_argument("name", nargs="?", type=str, help="dn42 object name")
|
parser_pol.add_argument('name', nargs="?", type=str, help="dn42 object name")
|
||||||
parser_pol.add_argument("mntner", nargs="?", type=str, help="dn42 object mntner")
|
parser_pol.add_argument('mntner', nargs="?", type=str, help="dn42 object mntner")
|
||||||
|
|
||||||
parser_mroute = subparsers.add_parser(
|
parser_mroute = subparsers.add_parser('match-routes', help='Match routes to inetnums')
|
||||||
"match-routes", help="Match routes to inetnums"
|
|
||||||
)
|
|
||||||
_ = parser_mroute
|
|
||||||
|
|
||||||
return vars(parser.parse_args())
|
return vars(parser.parse_args())
|
||||||
|
|
||||||
|
|
||||||
def run(args):
|
if __name__ == '__main__':
|
||||||
"run"
|
args = get_args()
|
||||||
|
|
||||||
if args["merge_output"]:
|
if args["merge_output"]:
|
||||||
log.OUTPUT = sys.stdout
|
log.OUTPUT = sys.stdout
|
||||||
|
|
||||||
@@ -995,15 +884,10 @@ def run(args):
|
|||||||
scan_index(args["infile"], args["use_mntner"])
|
scan_index(args["infile"], args["use_mntner"])
|
||||||
|
|
||||||
elif args["command"] == "scan":
|
elif args["command"] == "scan":
|
||||||
log.notice(
|
import time
|
||||||
"## Scan Started at %s"
|
log.notice("## Scan Started at %s" %(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())))
|
||||||
% (time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime()))
|
|
||||||
)
|
|
||||||
ck = scan_files(args["path"], args["use_mntner"], args["use_file"])
|
ck = scan_files(args["path"], args["use_mntner"], args["use_file"])
|
||||||
log.notice(
|
log.notice("## Scan Completed at %s" %(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())))
|
||||||
"## Scan Completed at %s"
|
|
||||||
% (time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime()))
|
|
||||||
)
|
|
||||||
|
|
||||||
if ck == "INFO":
|
if ck == "INFO":
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
@@ -1013,7 +897,7 @@ def run(args):
|
|||||||
elif args["command"] == "fmt":
|
elif args["command"] == "fmt":
|
||||||
dom = FileDOM(args["infile"])
|
dom = FileDOM(args["infile"])
|
||||||
if args["in_place"]:
|
if args["in_place"]:
|
||||||
with open(args["infile"], "w+") as f:
|
with open(args["infile"], 'w+') as f:
|
||||||
f.write(str(dom))
|
f.write(str(dom))
|
||||||
else:
|
else:
|
||||||
print(str(dom))
|
print(str(dom))
|
||||||
@@ -1034,10 +918,7 @@ def run(args):
|
|||||||
|
|
||||||
status = test_policy(args["type"], args["name"], args["mntner"])
|
status = test_policy(args["type"], args["name"], args["mntner"])
|
||||||
|
|
||||||
print(
|
print("POLICY %-12s\t%-8s\t%20s\t%s" %(args["mntner"], args["type"], args["name"], status))
|
||||||
"POLICY %-12s\t%-8s\t%20s\t%s"
|
|
||||||
% (args["mntner"], args["type"], args["name"], status)
|
|
||||||
)
|
|
||||||
if status != "PASS":
|
if status != "PASS":
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@@ -1049,10 +930,7 @@ def run(args):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
elif args["command"] == "match-routes":
|
elif args["command"] == "match-routes":
|
||||||
lis = find(
|
lis = find(["mnt-by","cidr","route","@netlevel", "@netmin", "@netmax", "@uri"], {"@family":"ipv4"})
|
||||||
["mnt-by", "cidr", "route", "@netlevel", "@netmin", "@netmax", "@uri"],
|
|
||||||
{"@family": "ipv4"},
|
|
||||||
)
|
|
||||||
|
|
||||||
def field(x, field):
|
def field(x, field):
|
||||||
for i in x:
|
for i in x:
|
||||||
@@ -1101,43 +979,23 @@ def run(args):
|
|||||||
rlvl = int(o["@netlevel"][0])
|
rlvl = int(o["@netlevel"][0])
|
||||||
|
|
||||||
if ilvl + 1 != rlvl:
|
if ilvl + 1 != rlvl:
|
||||||
print(
|
print("\nNo Parent > ", o["route"][0], " ", rlvl, " ", ",".join(o["mnt-by"]), \
|
||||||
"\nNo Parent > ",
|
"Nearest INET ", inet["cidr"][0], " ", ilvl, " ", ",".join(inet["mnt-by"]))
|
||||||
o["route"][0],
|
|
||||||
" ",
|
|
||||||
rlvl,
|
|
||||||
" ",
|
|
||||||
",".join(o["mnt-by"]),
|
|
||||||
"Nearest INET ",
|
|
||||||
inet["cidr"][0],
|
|
||||||
" ",
|
|
||||||
ilvl,
|
|
||||||
" ",
|
|
||||||
",".join(inet["mnt-by"]),
|
|
||||||
)
|
|
||||||
|
|
||||||
first = True
|
first = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if inet["@netmin"][0] > o["@netmin"][0] or inet["@netmax"][0] < o["@netmax"][0]:
|
if inet["@netmin"][0] > o["@netmin"][0] or inet["@netmax"][0] < o["@netmax"][0]:
|
||||||
print(
|
print("\nNo Parent > ", o["route"][0], " ", rlvl, " ", ",".join(o["mnt-by"]), \
|
||||||
"\nNo Parent > ",
|
"Nearest INET ", inet["cidr"][0], " ", ilvl, " ", ",".join(inet["mnt-by"]))
|
||||||
o["route"][0],
|
|
||||||
" ",
|
|
||||||
rlvl,
|
|
||||||
" ",
|
|
||||||
",".join(o["mnt-by"]),
|
|
||||||
"Nearest INET ",
|
|
||||||
inet["cidr"][0],
|
|
||||||
" ",
|
|
||||||
ilvl,
|
|
||||||
" ",
|
|
||||||
",".join(inet["mnt-by"]),
|
|
||||||
)
|
|
||||||
|
|
||||||
first = True
|
first = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
continue
|
||||||
if __name__ == "__main__":
|
if first:
|
||||||
run(get_args())
|
first = False
|
||||||
|
print(inet["cidr"]," ", ilvl, ",".join(inet["mnt-by"]))
|
||||||
|
print(" > ", o["route"][0], " ", rlvl, " ", ",".join(o["mnt-by"]))
|
||||||
|
else:
|
||||||
|
print(" > ", o["route"][0], " ", rlvl, " ", ",".join(o["mnt-by"]))
|
||||||
|
|||||||
Reference in New Issue
Block a user