mirror of
https://git.dn42.dev/dn42/registry.git
synced 2025-07-19 17:07:00 +08:00
Adding v6
This commit is contained in:
parent
066bcdd099
commit
ff000b89fc
4 changed files with 64 additions and 0 deletions
8
data/inet6num/fdaa:243c:4101::_48
Normal file
8
data/inet6num/fdaa:243c:4101::_48
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
inet6num: fdaa:243c:4101:0000:0000:0000:0000:0000 - fdaa:243c:4101:ffff:ffff:ffff:ffff:ffff
|
||||||
|
cidr: fdaa:243c:4101::/48
|
||||||
|
netname: RMLHUK-NET-1
|
||||||
|
admin-c: RMLHUK-DN42
|
||||||
|
tech-c: RMLHUK-DN42
|
||||||
|
mnt-by: RMLHUK-MNT
|
||||||
|
status: ASSIGNED
|
||||||
|
source: DN42
|
4
data/route/172.21.120.0_24
Normal file
4
data/route/172.21.120.0_24
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
route: 172.21.120.0/24
|
||||||
|
origin: AS4242422058
|
||||||
|
mnt-by: RMLHUK-MNT
|
||||||
|
source: DN42
|
5
data/route6/fdaa:243c:4101::_48
Normal file
5
data/route6/fdaa:243c:4101::_48
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
route6: fdaa:243c:4101::/48
|
||||||
|
origin: AS4242422058
|
||||||
|
max-length: 48
|
||||||
|
mnt-by: RMLHUK-MNT
|
||||||
|
source: DN42
|
47
ulagen.py
Executable file
47
ulagen.py
Executable file
|
@ -0,0 +1,47 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
# Attribution: This script is copied and modified from one published by github user andrewlkho.
|
||||||
|
# Repository: https://github.com/andrewlkho/ulagen
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import time
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
def get_eui64():
|
||||||
|
mac = uuid.getnode()
|
||||||
|
eui64 = mac >> 24 << 48 | 0xfffe000000 | mac & 0xffffff
|
||||||
|
eui64_canon = "-".join([format(eui64, "02X")[i:i+2] for i in range(0, 18, 2)])
|
||||||
|
return eui64_canon
|
||||||
|
|
||||||
|
def time_ntpformat():
|
||||||
|
# Seconds relative to 1900-01-01 00:00
|
||||||
|
return time.time() - time.mktime((1900, 1, 1, 0, 0, 0, 0, 1, -1))
|
||||||
|
|
||||||
|
def main():
|
||||||
|
h = hashlib.sha1()
|
||||||
|
h.update(get_eui64() + str(time_ntpformat()))
|
||||||
|
globalid = h.hexdigest()[0:10]
|
||||||
|
|
||||||
|
prefix = ":".join(("fd" + globalid[0:2], globalid[2:6], globalid[6:10]))
|
||||||
|
print "# /path/to/dn42/registry/" + " - " + "data/inet6num/" + prefix + "::_48" + "\n"
|
||||||
|
print "inet6num: " + prefix + ":0000:0000:0000:0000:0000" + " - " + prefix + ":ffff:ffff:ffff:ffff:ffff"
|
||||||
|
print "cidr: " + prefix + "::/48"
|
||||||
|
print "netname: " + "EXAMPLE-NET-1"
|
||||||
|
print "admin-c: " + "EXAMPLE-DN42"
|
||||||
|
print "tech-c: " + "EXAMPLE-DN42"
|
||||||
|
print "mnt-by: " + "EXAMPLE-MNT"
|
||||||
|
print "status: " + "ASSIGNED"
|
||||||
|
print "source: " + "DN42"
|
||||||
|
print "\n# /path/to/dn42/registry/" + " - " + "data/route6/" + prefix + "::_48" + "\n"
|
||||||
|
print "route6: " + prefix + "::/48"
|
||||||
|
print "origin: " + "AS<INSERT_NUMERIC_AUT_NUM_VALUE>"
|
||||||
|
print "max-length: " + "48"
|
||||||
|
print "mnt-by: " + "EXAMPLE-MNT"
|
||||||
|
print "source: " + "DN42"
|
||||||
|
print "\n" + "# Replace EXAMPLE with something else. E.g. OCEAN-{NET-1,DN42,MNT}"
|
||||||
|
print "#"
|
||||||
|
print "# Please remember this an examle object. It can be used as is if you replace EXAMPLE in the above lines."
|
||||||
|
print "# To find out more about required and optional keys for the inet6num object. Please see data/schema/{INET6NUM,ROUTE6}-SCHEMA"
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Add table
Add a link
Reference in a new issue