Add files using upload-large-folder tool
Browse files- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/DNSKEY.py +33 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/DS.py +24 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/EUI48.py +30 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/EUI64.py +30 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/GPOS.py +126 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/HINFO.py +64 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/HIP.py +85 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/ISDN.py +78 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/L32.py +41 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/L64.py +47 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/LOC.py +353 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/LP.py +42 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/MX.py +24 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NID.py +47 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NINFO.py +26 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NS.py +24 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NSEC.py +67 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NSEC3.py +126 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NSEC3PARAM.py +69 -0
- tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/OPENPGPKEY.py +53 -0
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/DNSKEY.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import dns.immutable
|
| 19 |
+
import dns.rdtypes.dnskeybase # lgtm[py/import-and-import-from]
|
| 20 |
+
|
| 21 |
+
# pylint: disable=unused-import
|
| 22 |
+
from dns.rdtypes.dnskeybase import ( # noqa: F401 lgtm[py/unused-import]
|
| 23 |
+
REVOKE,
|
| 24 |
+
SEP,
|
| 25 |
+
ZONE,
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
# pylint: enable=unused-import
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
@dns.immutable.immutable
|
| 32 |
+
class DNSKEY(dns.rdtypes.dnskeybase.DNSKEYBase):
|
| 33 |
+
"""DNSKEY record"""
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/DS.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import dns.immutable
|
| 19 |
+
import dns.rdtypes.dsbase
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@dns.immutable.immutable
|
| 23 |
+
class DS(dns.rdtypes.dsbase.DSBase):
|
| 24 |
+
"""DS record"""
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/EUI48.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2015 Red Hat, Inc.
|
| 4 |
+
# Author: Petr Spacek <pspacek@redhat.com>
|
| 5 |
+
#
|
| 6 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 7 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 8 |
+
# provided that the above copyright notice and this permission notice
|
| 9 |
+
# appear in all copies.
|
| 10 |
+
#
|
| 11 |
+
# THE SOFTWARE IS PROVIDED 'AS IS' AND RED HAT DISCLAIMS ALL WARRANTIES
|
| 12 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 13 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 14 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 15 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 16 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 17 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 18 |
+
|
| 19 |
+
import dns.immutable
|
| 20 |
+
import dns.rdtypes.euibase
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
@dns.immutable.immutable
|
| 24 |
+
class EUI48(dns.rdtypes.euibase.EUIBase):
|
| 25 |
+
"""EUI48 record"""
|
| 26 |
+
|
| 27 |
+
# see: rfc7043.txt
|
| 28 |
+
|
| 29 |
+
byte_len = 6 # 0123456789ab (in hex)
|
| 30 |
+
text_len = byte_len * 3 - 1 # 01-23-45-67-89-ab
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/EUI64.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2015 Red Hat, Inc.
|
| 4 |
+
# Author: Petr Spacek <pspacek@redhat.com>
|
| 5 |
+
#
|
| 6 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 7 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 8 |
+
# provided that the above copyright notice and this permission notice
|
| 9 |
+
# appear in all copies.
|
| 10 |
+
#
|
| 11 |
+
# THE SOFTWARE IS PROVIDED 'AS IS' AND RED HAT DISCLAIMS ALL WARRANTIES
|
| 12 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 13 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 14 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 15 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 16 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 17 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 18 |
+
|
| 19 |
+
import dns.immutable
|
| 20 |
+
import dns.rdtypes.euibase
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
@dns.immutable.immutable
|
| 24 |
+
class EUI64(dns.rdtypes.euibase.EUIBase):
|
| 25 |
+
"""EUI64 record"""
|
| 26 |
+
|
| 27 |
+
# see: rfc7043.txt
|
| 28 |
+
|
| 29 |
+
byte_len = 8 # 0123456789abcdef (in hex)
|
| 30 |
+
text_len = byte_len * 3 - 1 # 01-23-45-67-89-ab-cd-ef
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/GPOS.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import struct
|
| 19 |
+
|
| 20 |
+
import dns.exception
|
| 21 |
+
import dns.immutable
|
| 22 |
+
import dns.rdata
|
| 23 |
+
import dns.tokenizer
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def _validate_float_string(what):
|
| 27 |
+
if len(what) == 0:
|
| 28 |
+
raise dns.exception.FormError
|
| 29 |
+
if what[0] == b"-"[0] or what[0] == b"+"[0]:
|
| 30 |
+
what = what[1:]
|
| 31 |
+
if what.isdigit():
|
| 32 |
+
return
|
| 33 |
+
try:
|
| 34 |
+
(left, right) = what.split(b".")
|
| 35 |
+
except ValueError:
|
| 36 |
+
raise dns.exception.FormError
|
| 37 |
+
if left == b"" and right == b"":
|
| 38 |
+
raise dns.exception.FormError
|
| 39 |
+
if not left == b"" and not left.decode().isdigit():
|
| 40 |
+
raise dns.exception.FormError
|
| 41 |
+
if not right == b"" and not right.decode().isdigit():
|
| 42 |
+
raise dns.exception.FormError
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
@dns.immutable.immutable
|
| 46 |
+
class GPOS(dns.rdata.Rdata):
|
| 47 |
+
"""GPOS record"""
|
| 48 |
+
|
| 49 |
+
# see: RFC 1712
|
| 50 |
+
|
| 51 |
+
__slots__ = ["latitude", "longitude", "altitude"]
|
| 52 |
+
|
| 53 |
+
def __init__(self, rdclass, rdtype, latitude, longitude, altitude):
|
| 54 |
+
super().__init__(rdclass, rdtype)
|
| 55 |
+
if isinstance(latitude, float) or isinstance(latitude, int):
|
| 56 |
+
latitude = str(latitude)
|
| 57 |
+
if isinstance(longitude, float) or isinstance(longitude, int):
|
| 58 |
+
longitude = str(longitude)
|
| 59 |
+
if isinstance(altitude, float) or isinstance(altitude, int):
|
| 60 |
+
altitude = str(altitude)
|
| 61 |
+
latitude = self._as_bytes(latitude, True, 255)
|
| 62 |
+
longitude = self._as_bytes(longitude, True, 255)
|
| 63 |
+
altitude = self._as_bytes(altitude, True, 255)
|
| 64 |
+
_validate_float_string(latitude)
|
| 65 |
+
_validate_float_string(longitude)
|
| 66 |
+
_validate_float_string(altitude)
|
| 67 |
+
self.latitude = latitude
|
| 68 |
+
self.longitude = longitude
|
| 69 |
+
self.altitude = altitude
|
| 70 |
+
flat = self.float_latitude
|
| 71 |
+
if flat < -90.0 or flat > 90.0:
|
| 72 |
+
raise dns.exception.FormError("bad latitude")
|
| 73 |
+
flong = self.float_longitude
|
| 74 |
+
if flong < -180.0 or flong > 180.0:
|
| 75 |
+
raise dns.exception.FormError("bad longitude")
|
| 76 |
+
|
| 77 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 78 |
+
return (
|
| 79 |
+
f"{self.latitude.decode()} {self.longitude.decode()} "
|
| 80 |
+
f"{self.altitude.decode()}"
|
| 81 |
+
)
|
| 82 |
+
|
| 83 |
+
@classmethod
|
| 84 |
+
def from_text(
|
| 85 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 86 |
+
):
|
| 87 |
+
latitude = tok.get_string()
|
| 88 |
+
longitude = tok.get_string()
|
| 89 |
+
altitude = tok.get_string()
|
| 90 |
+
return cls(rdclass, rdtype, latitude, longitude, altitude)
|
| 91 |
+
|
| 92 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 93 |
+
l = len(self.latitude)
|
| 94 |
+
assert l < 256
|
| 95 |
+
file.write(struct.pack("!B", l))
|
| 96 |
+
file.write(self.latitude)
|
| 97 |
+
l = len(self.longitude)
|
| 98 |
+
assert l < 256
|
| 99 |
+
file.write(struct.pack("!B", l))
|
| 100 |
+
file.write(self.longitude)
|
| 101 |
+
l = len(self.altitude)
|
| 102 |
+
assert l < 256
|
| 103 |
+
file.write(struct.pack("!B", l))
|
| 104 |
+
file.write(self.altitude)
|
| 105 |
+
|
| 106 |
+
@classmethod
|
| 107 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 108 |
+
latitude = parser.get_counted_bytes()
|
| 109 |
+
longitude = parser.get_counted_bytes()
|
| 110 |
+
altitude = parser.get_counted_bytes()
|
| 111 |
+
return cls(rdclass, rdtype, latitude, longitude, altitude)
|
| 112 |
+
|
| 113 |
+
@property
|
| 114 |
+
def float_latitude(self):
|
| 115 |
+
"latitude as a floating point value"
|
| 116 |
+
return float(self.latitude)
|
| 117 |
+
|
| 118 |
+
@property
|
| 119 |
+
def float_longitude(self):
|
| 120 |
+
"longitude as a floating point value"
|
| 121 |
+
return float(self.longitude)
|
| 122 |
+
|
| 123 |
+
@property
|
| 124 |
+
def float_altitude(self):
|
| 125 |
+
"altitude as a floating point value"
|
| 126 |
+
return float(self.altitude)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/HINFO.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import struct
|
| 19 |
+
|
| 20 |
+
import dns.exception
|
| 21 |
+
import dns.immutable
|
| 22 |
+
import dns.rdata
|
| 23 |
+
import dns.tokenizer
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@dns.immutable.immutable
|
| 27 |
+
class HINFO(dns.rdata.Rdata):
|
| 28 |
+
"""HINFO record"""
|
| 29 |
+
|
| 30 |
+
# see: RFC 1035
|
| 31 |
+
|
| 32 |
+
__slots__ = ["cpu", "os"]
|
| 33 |
+
|
| 34 |
+
def __init__(self, rdclass, rdtype, cpu, os):
|
| 35 |
+
super().__init__(rdclass, rdtype)
|
| 36 |
+
self.cpu = self._as_bytes(cpu, True, 255)
|
| 37 |
+
self.os = self._as_bytes(os, True, 255)
|
| 38 |
+
|
| 39 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 40 |
+
return f'"{dns.rdata._escapify(self.cpu)}" "{dns.rdata._escapify(self.os)}"'
|
| 41 |
+
|
| 42 |
+
@classmethod
|
| 43 |
+
def from_text(
|
| 44 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 45 |
+
):
|
| 46 |
+
cpu = tok.get_string(max_length=255)
|
| 47 |
+
os = tok.get_string(max_length=255)
|
| 48 |
+
return cls(rdclass, rdtype, cpu, os)
|
| 49 |
+
|
| 50 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 51 |
+
l = len(self.cpu)
|
| 52 |
+
assert l < 256
|
| 53 |
+
file.write(struct.pack("!B", l))
|
| 54 |
+
file.write(self.cpu)
|
| 55 |
+
l = len(self.os)
|
| 56 |
+
assert l < 256
|
| 57 |
+
file.write(struct.pack("!B", l))
|
| 58 |
+
file.write(self.os)
|
| 59 |
+
|
| 60 |
+
@classmethod
|
| 61 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 62 |
+
cpu = parser.get_counted_bytes()
|
| 63 |
+
os = parser.get_counted_bytes()
|
| 64 |
+
return cls(rdclass, rdtype, cpu, os)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/HIP.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2010, 2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import base64
|
| 19 |
+
import binascii
|
| 20 |
+
import struct
|
| 21 |
+
|
| 22 |
+
import dns.exception
|
| 23 |
+
import dns.immutable
|
| 24 |
+
import dns.rdata
|
| 25 |
+
import dns.rdatatype
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
@dns.immutable.immutable
|
| 29 |
+
class HIP(dns.rdata.Rdata):
|
| 30 |
+
"""HIP record"""
|
| 31 |
+
|
| 32 |
+
# see: RFC 5205
|
| 33 |
+
|
| 34 |
+
__slots__ = ["hit", "algorithm", "key", "servers"]
|
| 35 |
+
|
| 36 |
+
def __init__(self, rdclass, rdtype, hit, algorithm, key, servers):
|
| 37 |
+
super().__init__(rdclass, rdtype)
|
| 38 |
+
self.hit = self._as_bytes(hit, True, 255)
|
| 39 |
+
self.algorithm = self._as_uint8(algorithm)
|
| 40 |
+
self.key = self._as_bytes(key, True)
|
| 41 |
+
self.servers = self._as_tuple(servers, self._as_name)
|
| 42 |
+
|
| 43 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 44 |
+
hit = binascii.hexlify(self.hit).decode()
|
| 45 |
+
key = base64.b64encode(self.key).replace(b"\n", b"").decode()
|
| 46 |
+
text = ""
|
| 47 |
+
servers = []
|
| 48 |
+
for server in self.servers:
|
| 49 |
+
servers.append(server.choose_relativity(origin, relativize))
|
| 50 |
+
if len(servers) > 0:
|
| 51 |
+
text += " " + " ".join(x.to_unicode() for x in servers)
|
| 52 |
+
return "%u %s %s%s" % (self.algorithm, hit, key, text)
|
| 53 |
+
|
| 54 |
+
@classmethod
|
| 55 |
+
def from_text(
|
| 56 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 57 |
+
):
|
| 58 |
+
algorithm = tok.get_uint8()
|
| 59 |
+
hit = binascii.unhexlify(tok.get_string().encode())
|
| 60 |
+
key = base64.b64decode(tok.get_string().encode())
|
| 61 |
+
servers = []
|
| 62 |
+
for token in tok.get_remaining():
|
| 63 |
+
server = tok.as_name(token, origin, relativize, relativize_to)
|
| 64 |
+
servers.append(server)
|
| 65 |
+
return cls(rdclass, rdtype, hit, algorithm, key, servers)
|
| 66 |
+
|
| 67 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 68 |
+
lh = len(self.hit)
|
| 69 |
+
lk = len(self.key)
|
| 70 |
+
file.write(struct.pack("!BBH", lh, self.algorithm, lk))
|
| 71 |
+
file.write(self.hit)
|
| 72 |
+
file.write(self.key)
|
| 73 |
+
for server in self.servers:
|
| 74 |
+
server.to_wire(file, None, origin, False)
|
| 75 |
+
|
| 76 |
+
@classmethod
|
| 77 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 78 |
+
(lh, algorithm, lk) = parser.get_struct("!BBH")
|
| 79 |
+
hit = parser.get_bytes(lh)
|
| 80 |
+
key = parser.get_bytes(lk)
|
| 81 |
+
servers = []
|
| 82 |
+
while parser.remaining() > 0:
|
| 83 |
+
server = parser.get_name(origin)
|
| 84 |
+
servers.append(server)
|
| 85 |
+
return cls(rdclass, rdtype, hit, algorithm, key, servers)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/ISDN.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import struct
|
| 19 |
+
|
| 20 |
+
import dns.exception
|
| 21 |
+
import dns.immutable
|
| 22 |
+
import dns.rdata
|
| 23 |
+
import dns.tokenizer
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@dns.immutable.immutable
|
| 27 |
+
class ISDN(dns.rdata.Rdata):
|
| 28 |
+
"""ISDN record"""
|
| 29 |
+
|
| 30 |
+
# see: RFC 1183
|
| 31 |
+
|
| 32 |
+
__slots__ = ["address", "subaddress"]
|
| 33 |
+
|
| 34 |
+
def __init__(self, rdclass, rdtype, address, subaddress):
|
| 35 |
+
super().__init__(rdclass, rdtype)
|
| 36 |
+
self.address = self._as_bytes(address, True, 255)
|
| 37 |
+
self.subaddress = self._as_bytes(subaddress, True, 255)
|
| 38 |
+
|
| 39 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 40 |
+
if self.subaddress:
|
| 41 |
+
return (
|
| 42 |
+
f'"{dns.rdata._escapify(self.address)}" '
|
| 43 |
+
f'"{dns.rdata._escapify(self.subaddress)}"'
|
| 44 |
+
)
|
| 45 |
+
else:
|
| 46 |
+
return f'"{dns.rdata._escapify(self.address)}"'
|
| 47 |
+
|
| 48 |
+
@classmethod
|
| 49 |
+
def from_text(
|
| 50 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 51 |
+
):
|
| 52 |
+
address = tok.get_string()
|
| 53 |
+
tokens = tok.get_remaining(max_tokens=1)
|
| 54 |
+
if len(tokens) >= 1:
|
| 55 |
+
subaddress = tokens[0].unescape().value
|
| 56 |
+
else:
|
| 57 |
+
subaddress = ""
|
| 58 |
+
return cls(rdclass, rdtype, address, subaddress)
|
| 59 |
+
|
| 60 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 61 |
+
l = len(self.address)
|
| 62 |
+
assert l < 256
|
| 63 |
+
file.write(struct.pack("!B", l))
|
| 64 |
+
file.write(self.address)
|
| 65 |
+
l = len(self.subaddress)
|
| 66 |
+
if l > 0:
|
| 67 |
+
assert l < 256
|
| 68 |
+
file.write(struct.pack("!B", l))
|
| 69 |
+
file.write(self.subaddress)
|
| 70 |
+
|
| 71 |
+
@classmethod
|
| 72 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 73 |
+
address = parser.get_counted_bytes()
|
| 74 |
+
if parser.remaining() > 0:
|
| 75 |
+
subaddress = parser.get_counted_bytes()
|
| 76 |
+
else:
|
| 77 |
+
subaddress = b""
|
| 78 |
+
return cls(rdclass, rdtype, address, subaddress)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/L32.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
import struct
|
| 4 |
+
|
| 5 |
+
import dns.immutable
|
| 6 |
+
import dns.rdata
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@dns.immutable.immutable
|
| 10 |
+
class L32(dns.rdata.Rdata):
|
| 11 |
+
"""L32 record"""
|
| 12 |
+
|
| 13 |
+
# see: rfc6742.txt
|
| 14 |
+
|
| 15 |
+
__slots__ = ["preference", "locator32"]
|
| 16 |
+
|
| 17 |
+
def __init__(self, rdclass, rdtype, preference, locator32):
|
| 18 |
+
super().__init__(rdclass, rdtype)
|
| 19 |
+
self.preference = self._as_uint16(preference)
|
| 20 |
+
self.locator32 = self._as_ipv4_address(locator32)
|
| 21 |
+
|
| 22 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 23 |
+
return f"{self.preference} {self.locator32}"
|
| 24 |
+
|
| 25 |
+
@classmethod
|
| 26 |
+
def from_text(
|
| 27 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 28 |
+
):
|
| 29 |
+
preference = tok.get_uint16()
|
| 30 |
+
nodeid = tok.get_identifier()
|
| 31 |
+
return cls(rdclass, rdtype, preference, nodeid)
|
| 32 |
+
|
| 33 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 34 |
+
file.write(struct.pack("!H", self.preference))
|
| 35 |
+
file.write(dns.ipv4.inet_aton(self.locator32))
|
| 36 |
+
|
| 37 |
+
@classmethod
|
| 38 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 39 |
+
preference = parser.get_uint16()
|
| 40 |
+
locator32 = parser.get_remaining()
|
| 41 |
+
return cls(rdclass, rdtype, preference, locator32)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/L64.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
import struct
|
| 4 |
+
|
| 5 |
+
import dns.immutable
|
| 6 |
+
import dns.rdtypes.util
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@dns.immutable.immutable
|
| 10 |
+
class L64(dns.rdata.Rdata):
|
| 11 |
+
"""L64 record"""
|
| 12 |
+
|
| 13 |
+
# see: rfc6742.txt
|
| 14 |
+
|
| 15 |
+
__slots__ = ["preference", "locator64"]
|
| 16 |
+
|
| 17 |
+
def __init__(self, rdclass, rdtype, preference, locator64):
|
| 18 |
+
super().__init__(rdclass, rdtype)
|
| 19 |
+
self.preference = self._as_uint16(preference)
|
| 20 |
+
if isinstance(locator64, bytes):
|
| 21 |
+
if len(locator64) != 8:
|
| 22 |
+
raise ValueError("invalid locator64")
|
| 23 |
+
self.locator64 = dns.rdata._hexify(locator64, 4, b":")
|
| 24 |
+
else:
|
| 25 |
+
dns.rdtypes.util.parse_formatted_hex(locator64, 4, 4, ":")
|
| 26 |
+
self.locator64 = locator64
|
| 27 |
+
|
| 28 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 29 |
+
return f"{self.preference} {self.locator64}"
|
| 30 |
+
|
| 31 |
+
@classmethod
|
| 32 |
+
def from_text(
|
| 33 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 34 |
+
):
|
| 35 |
+
preference = tok.get_uint16()
|
| 36 |
+
locator64 = tok.get_identifier()
|
| 37 |
+
return cls(rdclass, rdtype, preference, locator64)
|
| 38 |
+
|
| 39 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 40 |
+
file.write(struct.pack("!H", self.preference))
|
| 41 |
+
file.write(dns.rdtypes.util.parse_formatted_hex(self.locator64, 4, 4, ":"))
|
| 42 |
+
|
| 43 |
+
@classmethod
|
| 44 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 45 |
+
preference = parser.get_uint16()
|
| 46 |
+
locator64 = parser.get_remaining()
|
| 47 |
+
return cls(rdclass, rdtype, preference, locator64)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/LOC.py
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import struct
|
| 19 |
+
|
| 20 |
+
import dns.exception
|
| 21 |
+
import dns.immutable
|
| 22 |
+
import dns.rdata
|
| 23 |
+
|
| 24 |
+
_pows = tuple(10**i for i in range(0, 11))
|
| 25 |
+
|
| 26 |
+
# default values are in centimeters
|
| 27 |
+
_default_size = 100.0
|
| 28 |
+
_default_hprec = 1000000.0
|
| 29 |
+
_default_vprec = 1000.0
|
| 30 |
+
|
| 31 |
+
# for use by from_wire()
|
| 32 |
+
_MAX_LATITUDE = 0x80000000 + 90 * 3600000
|
| 33 |
+
_MIN_LATITUDE = 0x80000000 - 90 * 3600000
|
| 34 |
+
_MAX_LONGITUDE = 0x80000000 + 180 * 3600000
|
| 35 |
+
_MIN_LONGITUDE = 0x80000000 - 180 * 3600000
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def _exponent_of(what, desc):
|
| 39 |
+
if what == 0:
|
| 40 |
+
return 0
|
| 41 |
+
exp = None
|
| 42 |
+
for i, pow in enumerate(_pows):
|
| 43 |
+
if what < pow:
|
| 44 |
+
exp = i - 1
|
| 45 |
+
break
|
| 46 |
+
if exp is None or exp < 0:
|
| 47 |
+
raise dns.exception.SyntaxError(f"{desc} value out of bounds")
|
| 48 |
+
return exp
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def _float_to_tuple(what):
|
| 52 |
+
if what < 0:
|
| 53 |
+
sign = -1
|
| 54 |
+
what *= -1
|
| 55 |
+
else:
|
| 56 |
+
sign = 1
|
| 57 |
+
what = round(what * 3600000)
|
| 58 |
+
degrees = int(what // 3600000)
|
| 59 |
+
what -= degrees * 3600000
|
| 60 |
+
minutes = int(what // 60000)
|
| 61 |
+
what -= minutes * 60000
|
| 62 |
+
seconds = int(what // 1000)
|
| 63 |
+
what -= int(seconds * 1000)
|
| 64 |
+
what = int(what)
|
| 65 |
+
return (degrees, minutes, seconds, what, sign)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def _tuple_to_float(what):
|
| 69 |
+
value = float(what[0])
|
| 70 |
+
value += float(what[1]) / 60.0
|
| 71 |
+
value += float(what[2]) / 3600.0
|
| 72 |
+
value += float(what[3]) / 3600000.0
|
| 73 |
+
return float(what[4]) * value
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def _encode_size(what, desc):
|
| 77 |
+
what = int(what)
|
| 78 |
+
exponent = _exponent_of(what, desc) & 0xF
|
| 79 |
+
base = what // pow(10, exponent) & 0xF
|
| 80 |
+
return base * 16 + exponent
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def _decode_size(what, desc):
|
| 84 |
+
exponent = what & 0x0F
|
| 85 |
+
if exponent > 9:
|
| 86 |
+
raise dns.exception.FormError(f"bad {desc} exponent")
|
| 87 |
+
base = (what & 0xF0) >> 4
|
| 88 |
+
if base > 9:
|
| 89 |
+
raise dns.exception.FormError(f"bad {desc} base")
|
| 90 |
+
return base * pow(10, exponent)
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def _check_coordinate_list(value, low, high):
|
| 94 |
+
if value[0] < low or value[0] > high:
|
| 95 |
+
raise ValueError(f"not in range [{low}, {high}]")
|
| 96 |
+
if value[1] < 0 or value[1] > 59:
|
| 97 |
+
raise ValueError("bad minutes value")
|
| 98 |
+
if value[2] < 0 or value[2] > 59:
|
| 99 |
+
raise ValueError("bad seconds value")
|
| 100 |
+
if value[3] < 0 or value[3] > 999:
|
| 101 |
+
raise ValueError("bad milliseconds value")
|
| 102 |
+
if value[4] != 1 and value[4] != -1:
|
| 103 |
+
raise ValueError("bad hemisphere value")
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
@dns.immutable.immutable
|
| 107 |
+
class LOC(dns.rdata.Rdata):
|
| 108 |
+
"""LOC record"""
|
| 109 |
+
|
| 110 |
+
# see: RFC 1876
|
| 111 |
+
|
| 112 |
+
__slots__ = [
|
| 113 |
+
"latitude",
|
| 114 |
+
"longitude",
|
| 115 |
+
"altitude",
|
| 116 |
+
"size",
|
| 117 |
+
"horizontal_precision",
|
| 118 |
+
"vertical_precision",
|
| 119 |
+
]
|
| 120 |
+
|
| 121 |
+
def __init__(
|
| 122 |
+
self,
|
| 123 |
+
rdclass,
|
| 124 |
+
rdtype,
|
| 125 |
+
latitude,
|
| 126 |
+
longitude,
|
| 127 |
+
altitude,
|
| 128 |
+
size=_default_size,
|
| 129 |
+
hprec=_default_hprec,
|
| 130 |
+
vprec=_default_vprec,
|
| 131 |
+
):
|
| 132 |
+
"""Initialize a LOC record instance.
|
| 133 |
+
|
| 134 |
+
The parameters I{latitude} and I{longitude} may be either a 4-tuple
|
| 135 |
+
of integers specifying (degrees, minutes, seconds, milliseconds),
|
| 136 |
+
or they may be floating point values specifying the number of
|
| 137 |
+
degrees. The other parameters are floats. Size, horizontal precision,
|
| 138 |
+
and vertical precision are specified in centimeters."""
|
| 139 |
+
|
| 140 |
+
super().__init__(rdclass, rdtype)
|
| 141 |
+
if isinstance(latitude, int):
|
| 142 |
+
latitude = float(latitude)
|
| 143 |
+
if isinstance(latitude, float):
|
| 144 |
+
latitude = _float_to_tuple(latitude)
|
| 145 |
+
_check_coordinate_list(latitude, -90, 90)
|
| 146 |
+
self.latitude = tuple(latitude)
|
| 147 |
+
if isinstance(longitude, int):
|
| 148 |
+
longitude = float(longitude)
|
| 149 |
+
if isinstance(longitude, float):
|
| 150 |
+
longitude = _float_to_tuple(longitude)
|
| 151 |
+
_check_coordinate_list(longitude, -180, 180)
|
| 152 |
+
self.longitude = tuple(longitude)
|
| 153 |
+
self.altitude = float(altitude)
|
| 154 |
+
self.size = float(size)
|
| 155 |
+
self.horizontal_precision = float(hprec)
|
| 156 |
+
self.vertical_precision = float(vprec)
|
| 157 |
+
|
| 158 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 159 |
+
if self.latitude[4] > 0:
|
| 160 |
+
lat_hemisphere = "N"
|
| 161 |
+
else:
|
| 162 |
+
lat_hemisphere = "S"
|
| 163 |
+
if self.longitude[4] > 0:
|
| 164 |
+
long_hemisphere = "E"
|
| 165 |
+
else:
|
| 166 |
+
long_hemisphere = "W"
|
| 167 |
+
text = "%d %d %d.%03d %s %d %d %d.%03d %s %0.2fm" % (
|
| 168 |
+
self.latitude[0],
|
| 169 |
+
self.latitude[1],
|
| 170 |
+
self.latitude[2],
|
| 171 |
+
self.latitude[3],
|
| 172 |
+
lat_hemisphere,
|
| 173 |
+
self.longitude[0],
|
| 174 |
+
self.longitude[1],
|
| 175 |
+
self.longitude[2],
|
| 176 |
+
self.longitude[3],
|
| 177 |
+
long_hemisphere,
|
| 178 |
+
self.altitude / 100.0,
|
| 179 |
+
)
|
| 180 |
+
|
| 181 |
+
# do not print default values
|
| 182 |
+
if (
|
| 183 |
+
self.size != _default_size
|
| 184 |
+
or self.horizontal_precision != _default_hprec
|
| 185 |
+
or self.vertical_precision != _default_vprec
|
| 186 |
+
):
|
| 187 |
+
text += (
|
| 188 |
+
f" {self.size / 100.0:0.2f}m {self.horizontal_precision / 100.0:0.2f}m"
|
| 189 |
+
f" {self.vertical_precision / 100.0:0.2f}m"
|
| 190 |
+
)
|
| 191 |
+
return text
|
| 192 |
+
|
| 193 |
+
@classmethod
|
| 194 |
+
def from_text(
|
| 195 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 196 |
+
):
|
| 197 |
+
latitude = [0, 0, 0, 0, 1]
|
| 198 |
+
longitude = [0, 0, 0, 0, 1]
|
| 199 |
+
size = _default_size
|
| 200 |
+
hprec = _default_hprec
|
| 201 |
+
vprec = _default_vprec
|
| 202 |
+
|
| 203 |
+
latitude[0] = tok.get_int()
|
| 204 |
+
t = tok.get_string()
|
| 205 |
+
if t.isdigit():
|
| 206 |
+
latitude[1] = int(t)
|
| 207 |
+
t = tok.get_string()
|
| 208 |
+
if "." in t:
|
| 209 |
+
(seconds, milliseconds) = t.split(".")
|
| 210 |
+
if not seconds.isdigit():
|
| 211 |
+
raise dns.exception.SyntaxError("bad latitude seconds value")
|
| 212 |
+
latitude[2] = int(seconds)
|
| 213 |
+
l = len(milliseconds)
|
| 214 |
+
if l == 0 or l > 3 or not milliseconds.isdigit():
|
| 215 |
+
raise dns.exception.SyntaxError("bad latitude milliseconds value")
|
| 216 |
+
if l == 1:
|
| 217 |
+
m = 100
|
| 218 |
+
elif l == 2:
|
| 219 |
+
m = 10
|
| 220 |
+
else:
|
| 221 |
+
m = 1
|
| 222 |
+
latitude[3] = m * int(milliseconds)
|
| 223 |
+
t = tok.get_string()
|
| 224 |
+
elif t.isdigit():
|
| 225 |
+
latitude[2] = int(t)
|
| 226 |
+
t = tok.get_string()
|
| 227 |
+
if t == "S":
|
| 228 |
+
latitude[4] = -1
|
| 229 |
+
elif t != "N":
|
| 230 |
+
raise dns.exception.SyntaxError("bad latitude hemisphere value")
|
| 231 |
+
|
| 232 |
+
longitude[0] = tok.get_int()
|
| 233 |
+
t = tok.get_string()
|
| 234 |
+
if t.isdigit():
|
| 235 |
+
longitude[1] = int(t)
|
| 236 |
+
t = tok.get_string()
|
| 237 |
+
if "." in t:
|
| 238 |
+
(seconds, milliseconds) = t.split(".")
|
| 239 |
+
if not seconds.isdigit():
|
| 240 |
+
raise dns.exception.SyntaxError("bad longitude seconds value")
|
| 241 |
+
longitude[2] = int(seconds)
|
| 242 |
+
l = len(milliseconds)
|
| 243 |
+
if l == 0 or l > 3 or not milliseconds.isdigit():
|
| 244 |
+
raise dns.exception.SyntaxError("bad longitude milliseconds value")
|
| 245 |
+
if l == 1:
|
| 246 |
+
m = 100
|
| 247 |
+
elif l == 2:
|
| 248 |
+
m = 10
|
| 249 |
+
else:
|
| 250 |
+
m = 1
|
| 251 |
+
longitude[3] = m * int(milliseconds)
|
| 252 |
+
t = tok.get_string()
|
| 253 |
+
elif t.isdigit():
|
| 254 |
+
longitude[2] = int(t)
|
| 255 |
+
t = tok.get_string()
|
| 256 |
+
if t == "W":
|
| 257 |
+
longitude[4] = -1
|
| 258 |
+
elif t != "E":
|
| 259 |
+
raise dns.exception.SyntaxError("bad longitude hemisphere value")
|
| 260 |
+
|
| 261 |
+
t = tok.get_string()
|
| 262 |
+
if t[-1] == "m":
|
| 263 |
+
t = t[0:-1]
|
| 264 |
+
altitude = float(t) * 100.0 # m -> cm
|
| 265 |
+
|
| 266 |
+
tokens = tok.get_remaining(max_tokens=3)
|
| 267 |
+
if len(tokens) >= 1:
|
| 268 |
+
value = tokens[0].unescape().value
|
| 269 |
+
if value[-1] == "m":
|
| 270 |
+
value = value[0:-1]
|
| 271 |
+
size = float(value) * 100.0 # m -> cm
|
| 272 |
+
if len(tokens) >= 2:
|
| 273 |
+
value = tokens[1].unescape().value
|
| 274 |
+
if value[-1] == "m":
|
| 275 |
+
value = value[0:-1]
|
| 276 |
+
hprec = float(value) * 100.0 # m -> cm
|
| 277 |
+
if len(tokens) >= 3:
|
| 278 |
+
value = tokens[2].unescape().value
|
| 279 |
+
if value[-1] == "m":
|
| 280 |
+
value = value[0:-1]
|
| 281 |
+
vprec = float(value) * 100.0 # m -> cm
|
| 282 |
+
|
| 283 |
+
# Try encoding these now so we raise if they are bad
|
| 284 |
+
_encode_size(size, "size")
|
| 285 |
+
_encode_size(hprec, "horizontal precision")
|
| 286 |
+
_encode_size(vprec, "vertical precision")
|
| 287 |
+
|
| 288 |
+
return cls(rdclass, rdtype, latitude, longitude, altitude, size, hprec, vprec)
|
| 289 |
+
|
| 290 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 291 |
+
milliseconds = (
|
| 292 |
+
self.latitude[0] * 3600000
|
| 293 |
+
+ self.latitude[1] * 60000
|
| 294 |
+
+ self.latitude[2] * 1000
|
| 295 |
+
+ self.latitude[3]
|
| 296 |
+
) * self.latitude[4]
|
| 297 |
+
latitude = 0x80000000 + milliseconds
|
| 298 |
+
milliseconds = (
|
| 299 |
+
self.longitude[0] * 3600000
|
| 300 |
+
+ self.longitude[1] * 60000
|
| 301 |
+
+ self.longitude[2] * 1000
|
| 302 |
+
+ self.longitude[3]
|
| 303 |
+
) * self.longitude[4]
|
| 304 |
+
longitude = 0x80000000 + milliseconds
|
| 305 |
+
altitude = int(self.altitude) + 10000000
|
| 306 |
+
size = _encode_size(self.size, "size")
|
| 307 |
+
hprec = _encode_size(self.horizontal_precision, "horizontal precision")
|
| 308 |
+
vprec = _encode_size(self.vertical_precision, "vertical precision")
|
| 309 |
+
wire = struct.pack(
|
| 310 |
+
"!BBBBIII", 0, size, hprec, vprec, latitude, longitude, altitude
|
| 311 |
+
)
|
| 312 |
+
file.write(wire)
|
| 313 |
+
|
| 314 |
+
@classmethod
|
| 315 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 316 |
+
(
|
| 317 |
+
version,
|
| 318 |
+
size,
|
| 319 |
+
hprec,
|
| 320 |
+
vprec,
|
| 321 |
+
latitude,
|
| 322 |
+
longitude,
|
| 323 |
+
altitude,
|
| 324 |
+
) = parser.get_struct("!BBBBIII")
|
| 325 |
+
if version != 0:
|
| 326 |
+
raise dns.exception.FormError("LOC version not zero")
|
| 327 |
+
if latitude < _MIN_LATITUDE or latitude > _MAX_LATITUDE:
|
| 328 |
+
raise dns.exception.FormError("bad latitude")
|
| 329 |
+
if latitude > 0x80000000:
|
| 330 |
+
latitude = (latitude - 0x80000000) / 3600000
|
| 331 |
+
else:
|
| 332 |
+
latitude = -1 * (0x80000000 - latitude) / 3600000
|
| 333 |
+
if longitude < _MIN_LONGITUDE or longitude > _MAX_LONGITUDE:
|
| 334 |
+
raise dns.exception.FormError("bad longitude")
|
| 335 |
+
if longitude > 0x80000000:
|
| 336 |
+
longitude = (longitude - 0x80000000) / 3600000
|
| 337 |
+
else:
|
| 338 |
+
longitude = -1 * (0x80000000 - longitude) / 3600000
|
| 339 |
+
altitude = float(altitude) - 10000000.0
|
| 340 |
+
size = _decode_size(size, "size")
|
| 341 |
+
hprec = _decode_size(hprec, "horizontal precision")
|
| 342 |
+
vprec = _decode_size(vprec, "vertical precision")
|
| 343 |
+
return cls(rdclass, rdtype, latitude, longitude, altitude, size, hprec, vprec)
|
| 344 |
+
|
| 345 |
+
@property
|
| 346 |
+
def float_latitude(self):
|
| 347 |
+
"latitude as a floating point value"
|
| 348 |
+
return _tuple_to_float(self.latitude)
|
| 349 |
+
|
| 350 |
+
@property
|
| 351 |
+
def float_longitude(self):
|
| 352 |
+
"longitude as a floating point value"
|
| 353 |
+
return _tuple_to_float(self.longitude)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/LP.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
import struct
|
| 4 |
+
|
| 5 |
+
import dns.immutable
|
| 6 |
+
import dns.rdata
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@dns.immutable.immutable
|
| 10 |
+
class LP(dns.rdata.Rdata):
|
| 11 |
+
"""LP record"""
|
| 12 |
+
|
| 13 |
+
# see: rfc6742.txt
|
| 14 |
+
|
| 15 |
+
__slots__ = ["preference", "fqdn"]
|
| 16 |
+
|
| 17 |
+
def __init__(self, rdclass, rdtype, preference, fqdn):
|
| 18 |
+
super().__init__(rdclass, rdtype)
|
| 19 |
+
self.preference = self._as_uint16(preference)
|
| 20 |
+
self.fqdn = self._as_name(fqdn)
|
| 21 |
+
|
| 22 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 23 |
+
fqdn = self.fqdn.choose_relativity(origin, relativize)
|
| 24 |
+
return "%d %s" % (self.preference, fqdn)
|
| 25 |
+
|
| 26 |
+
@classmethod
|
| 27 |
+
def from_text(
|
| 28 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 29 |
+
):
|
| 30 |
+
preference = tok.get_uint16()
|
| 31 |
+
fqdn = tok.get_name(origin, relativize, relativize_to)
|
| 32 |
+
return cls(rdclass, rdtype, preference, fqdn)
|
| 33 |
+
|
| 34 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 35 |
+
file.write(struct.pack("!H", self.preference))
|
| 36 |
+
self.fqdn.to_wire(file, compress, origin, canonicalize)
|
| 37 |
+
|
| 38 |
+
@classmethod
|
| 39 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 40 |
+
preference = parser.get_uint16()
|
| 41 |
+
fqdn = parser.get_name(origin)
|
| 42 |
+
return cls(rdclass, rdtype, preference, fqdn)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/MX.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import dns.immutable
|
| 19 |
+
import dns.rdtypes.mxbase
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@dns.immutable.immutable
|
| 23 |
+
class MX(dns.rdtypes.mxbase.MXBase):
|
| 24 |
+
"""MX record"""
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NID.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
import struct
|
| 4 |
+
|
| 5 |
+
import dns.immutable
|
| 6 |
+
import dns.rdtypes.util
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@dns.immutable.immutable
|
| 10 |
+
class NID(dns.rdata.Rdata):
|
| 11 |
+
"""NID record"""
|
| 12 |
+
|
| 13 |
+
# see: rfc6742.txt
|
| 14 |
+
|
| 15 |
+
__slots__ = ["preference", "nodeid"]
|
| 16 |
+
|
| 17 |
+
def __init__(self, rdclass, rdtype, preference, nodeid):
|
| 18 |
+
super().__init__(rdclass, rdtype)
|
| 19 |
+
self.preference = self._as_uint16(preference)
|
| 20 |
+
if isinstance(nodeid, bytes):
|
| 21 |
+
if len(nodeid) != 8:
|
| 22 |
+
raise ValueError("invalid nodeid")
|
| 23 |
+
self.nodeid = dns.rdata._hexify(nodeid, 4, b":")
|
| 24 |
+
else:
|
| 25 |
+
dns.rdtypes.util.parse_formatted_hex(nodeid, 4, 4, ":")
|
| 26 |
+
self.nodeid = nodeid
|
| 27 |
+
|
| 28 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 29 |
+
return f"{self.preference} {self.nodeid}"
|
| 30 |
+
|
| 31 |
+
@classmethod
|
| 32 |
+
def from_text(
|
| 33 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 34 |
+
):
|
| 35 |
+
preference = tok.get_uint16()
|
| 36 |
+
nodeid = tok.get_identifier()
|
| 37 |
+
return cls(rdclass, rdtype, preference, nodeid)
|
| 38 |
+
|
| 39 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 40 |
+
file.write(struct.pack("!H", self.preference))
|
| 41 |
+
file.write(dns.rdtypes.util.parse_formatted_hex(self.nodeid, 4, 4, ":"))
|
| 42 |
+
|
| 43 |
+
@classmethod
|
| 44 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 45 |
+
preference = parser.get_uint16()
|
| 46 |
+
nodeid = parser.get_remaining()
|
| 47 |
+
return cls(rdclass, rdtype, preference, nodeid)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NINFO.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import dns.immutable
|
| 19 |
+
import dns.rdtypes.txtbase
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@dns.immutable.immutable
|
| 23 |
+
class NINFO(dns.rdtypes.txtbase.TXTBase):
|
| 24 |
+
"""NINFO record"""
|
| 25 |
+
|
| 26 |
+
# see: draft-reid-dnsext-zs-01
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NS.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import dns.immutable
|
| 19 |
+
import dns.rdtypes.nsbase
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@dns.immutable.immutable
|
| 23 |
+
class NS(dns.rdtypes.nsbase.NSBase):
|
| 24 |
+
"""NS record"""
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NSEC.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import dns.exception
|
| 19 |
+
import dns.immutable
|
| 20 |
+
import dns.name
|
| 21 |
+
import dns.rdata
|
| 22 |
+
import dns.rdatatype
|
| 23 |
+
import dns.rdtypes.util
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@dns.immutable.immutable
|
| 27 |
+
class Bitmap(dns.rdtypes.util.Bitmap):
|
| 28 |
+
type_name = "NSEC"
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
@dns.immutable.immutable
|
| 32 |
+
class NSEC(dns.rdata.Rdata):
|
| 33 |
+
"""NSEC record"""
|
| 34 |
+
|
| 35 |
+
__slots__ = ["next", "windows"]
|
| 36 |
+
|
| 37 |
+
def __init__(self, rdclass, rdtype, next, windows):
|
| 38 |
+
super().__init__(rdclass, rdtype)
|
| 39 |
+
self.next = self._as_name(next)
|
| 40 |
+
if not isinstance(windows, Bitmap):
|
| 41 |
+
windows = Bitmap(windows)
|
| 42 |
+
self.windows = tuple(windows.windows)
|
| 43 |
+
|
| 44 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 45 |
+
next = self.next.choose_relativity(origin, relativize)
|
| 46 |
+
text = Bitmap(self.windows).to_text()
|
| 47 |
+
return f"{next}{text}"
|
| 48 |
+
|
| 49 |
+
@classmethod
|
| 50 |
+
def from_text(
|
| 51 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 52 |
+
):
|
| 53 |
+
next = tok.get_name(origin, relativize, relativize_to)
|
| 54 |
+
windows = Bitmap.from_text(tok)
|
| 55 |
+
return cls(rdclass, rdtype, next, windows)
|
| 56 |
+
|
| 57 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 58 |
+
# Note that NSEC downcasing, originally mandated by RFC 4034
|
| 59 |
+
# section 6.2 was removed by RFC 6840 section 5.1.
|
| 60 |
+
self.next.to_wire(file, None, origin, False)
|
| 61 |
+
Bitmap(self.windows).to_wire(file)
|
| 62 |
+
|
| 63 |
+
@classmethod
|
| 64 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 65 |
+
next = parser.get_name(origin)
|
| 66 |
+
bitmap = Bitmap.from_wire_parser(parser)
|
| 67 |
+
return cls(rdclass, rdtype, next, bitmap)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NSEC3.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2004-2017 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import base64
|
| 19 |
+
import binascii
|
| 20 |
+
import struct
|
| 21 |
+
|
| 22 |
+
import dns.exception
|
| 23 |
+
import dns.immutable
|
| 24 |
+
import dns.rdata
|
| 25 |
+
import dns.rdatatype
|
| 26 |
+
import dns.rdtypes.util
|
| 27 |
+
|
| 28 |
+
b32_hex_to_normal = bytes.maketrans(
|
| 29 |
+
b"0123456789ABCDEFGHIJKLMNOPQRSTUV", b"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"
|
| 30 |
+
)
|
| 31 |
+
b32_normal_to_hex = bytes.maketrans(
|
| 32 |
+
b"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", b"0123456789ABCDEFGHIJKLMNOPQRSTUV"
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
# hash algorithm constants
|
| 36 |
+
SHA1 = 1
|
| 37 |
+
|
| 38 |
+
# flag constants
|
| 39 |
+
OPTOUT = 1
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
@dns.immutable.immutable
|
| 43 |
+
class Bitmap(dns.rdtypes.util.Bitmap):
|
| 44 |
+
type_name = "NSEC3"
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
@dns.immutable.immutable
|
| 48 |
+
class NSEC3(dns.rdata.Rdata):
|
| 49 |
+
"""NSEC3 record"""
|
| 50 |
+
|
| 51 |
+
__slots__ = ["algorithm", "flags", "iterations", "salt", "next", "windows"]
|
| 52 |
+
|
| 53 |
+
def __init__(
|
| 54 |
+
self, rdclass, rdtype, algorithm, flags, iterations, salt, next, windows
|
| 55 |
+
):
|
| 56 |
+
super().__init__(rdclass, rdtype)
|
| 57 |
+
self.algorithm = self._as_uint8(algorithm)
|
| 58 |
+
self.flags = self._as_uint8(flags)
|
| 59 |
+
self.iterations = self._as_uint16(iterations)
|
| 60 |
+
self.salt = self._as_bytes(salt, True, 255)
|
| 61 |
+
self.next = self._as_bytes(next, True, 255)
|
| 62 |
+
if not isinstance(windows, Bitmap):
|
| 63 |
+
windows = Bitmap(windows)
|
| 64 |
+
self.windows = tuple(windows.windows)
|
| 65 |
+
|
| 66 |
+
def _next_text(self):
|
| 67 |
+
next = base64.b32encode(self.next).translate(b32_normal_to_hex).lower().decode()
|
| 68 |
+
next = next.rstrip("=")
|
| 69 |
+
return next
|
| 70 |
+
|
| 71 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 72 |
+
next = self._next_text()
|
| 73 |
+
if self.salt == b"":
|
| 74 |
+
salt = "-"
|
| 75 |
+
else:
|
| 76 |
+
salt = binascii.hexlify(self.salt).decode()
|
| 77 |
+
text = Bitmap(self.windows).to_text()
|
| 78 |
+
return "%u %u %u %s %s%s" % (
|
| 79 |
+
self.algorithm,
|
| 80 |
+
self.flags,
|
| 81 |
+
self.iterations,
|
| 82 |
+
salt,
|
| 83 |
+
next,
|
| 84 |
+
text,
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
@classmethod
|
| 88 |
+
def from_text(
|
| 89 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 90 |
+
):
|
| 91 |
+
algorithm = tok.get_uint8()
|
| 92 |
+
flags = tok.get_uint8()
|
| 93 |
+
iterations = tok.get_uint16()
|
| 94 |
+
salt = tok.get_string()
|
| 95 |
+
if salt == "-":
|
| 96 |
+
salt = b""
|
| 97 |
+
else:
|
| 98 |
+
salt = binascii.unhexlify(salt.encode("ascii"))
|
| 99 |
+
next = tok.get_string().encode("ascii").upper().translate(b32_hex_to_normal)
|
| 100 |
+
if next.endswith(b"="):
|
| 101 |
+
raise binascii.Error("Incorrect padding")
|
| 102 |
+
if len(next) % 8 != 0:
|
| 103 |
+
next += b"=" * (8 - len(next) % 8)
|
| 104 |
+
next = base64.b32decode(next)
|
| 105 |
+
bitmap = Bitmap.from_text(tok)
|
| 106 |
+
return cls(rdclass, rdtype, algorithm, flags, iterations, salt, next, bitmap)
|
| 107 |
+
|
| 108 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 109 |
+
l = len(self.salt)
|
| 110 |
+
file.write(struct.pack("!BBHB", self.algorithm, self.flags, self.iterations, l))
|
| 111 |
+
file.write(self.salt)
|
| 112 |
+
l = len(self.next)
|
| 113 |
+
file.write(struct.pack("!B", l))
|
| 114 |
+
file.write(self.next)
|
| 115 |
+
Bitmap(self.windows).to_wire(file)
|
| 116 |
+
|
| 117 |
+
@classmethod
|
| 118 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 119 |
+
(algorithm, flags, iterations) = parser.get_struct("!BBH")
|
| 120 |
+
salt = parser.get_counted_bytes()
|
| 121 |
+
next = parser.get_counted_bytes()
|
| 122 |
+
bitmap = Bitmap.from_wire_parser(parser)
|
| 123 |
+
return cls(rdclass, rdtype, algorithm, flags, iterations, salt, next, bitmap)
|
| 124 |
+
|
| 125 |
+
def next_name(self, origin=None):
|
| 126 |
+
return dns.name.from_text(self._next_text(), origin)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/NSEC3PARAM.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import binascii
|
| 19 |
+
import struct
|
| 20 |
+
|
| 21 |
+
import dns.exception
|
| 22 |
+
import dns.immutable
|
| 23 |
+
import dns.rdata
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@dns.immutable.immutable
|
| 27 |
+
class NSEC3PARAM(dns.rdata.Rdata):
|
| 28 |
+
"""NSEC3PARAM record"""
|
| 29 |
+
|
| 30 |
+
__slots__ = ["algorithm", "flags", "iterations", "salt"]
|
| 31 |
+
|
| 32 |
+
def __init__(self, rdclass, rdtype, algorithm, flags, iterations, salt):
|
| 33 |
+
super().__init__(rdclass, rdtype)
|
| 34 |
+
self.algorithm = self._as_uint8(algorithm)
|
| 35 |
+
self.flags = self._as_uint8(flags)
|
| 36 |
+
self.iterations = self._as_uint16(iterations)
|
| 37 |
+
self.salt = self._as_bytes(salt, True, 255)
|
| 38 |
+
|
| 39 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 40 |
+
if self.salt == b"":
|
| 41 |
+
salt = "-"
|
| 42 |
+
else:
|
| 43 |
+
salt = binascii.hexlify(self.salt).decode()
|
| 44 |
+
return "%u %u %u %s" % (self.algorithm, self.flags, self.iterations, salt)
|
| 45 |
+
|
| 46 |
+
@classmethod
|
| 47 |
+
def from_text(
|
| 48 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 49 |
+
):
|
| 50 |
+
algorithm = tok.get_uint8()
|
| 51 |
+
flags = tok.get_uint8()
|
| 52 |
+
iterations = tok.get_uint16()
|
| 53 |
+
salt = tok.get_string()
|
| 54 |
+
if salt == "-":
|
| 55 |
+
salt = ""
|
| 56 |
+
else:
|
| 57 |
+
salt = binascii.unhexlify(salt.encode())
|
| 58 |
+
return cls(rdclass, rdtype, algorithm, flags, iterations, salt)
|
| 59 |
+
|
| 60 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 61 |
+
l = len(self.salt)
|
| 62 |
+
file.write(struct.pack("!BBHB", self.algorithm, self.flags, self.iterations, l))
|
| 63 |
+
file.write(self.salt)
|
| 64 |
+
|
| 65 |
+
@classmethod
|
| 66 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 67 |
+
(algorithm, flags, iterations) = parser.get_struct("!BBH")
|
| 68 |
+
salt = parser.get_counted_bytes()
|
| 69 |
+
return cls(rdclass, rdtype, algorithm, flags, iterations, salt)
|
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/OPENPGPKEY.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
| 2 |
+
|
| 3 |
+
# Copyright (C) 2016 Nominum, Inc.
|
| 4 |
+
#
|
| 5 |
+
# Permission to use, copy, modify, and distribute this software and its
|
| 6 |
+
# documentation for any purpose with or without fee is hereby granted,
|
| 7 |
+
# provided that the above copyright notice and this permission notice
|
| 8 |
+
# appear in all copies.
|
| 9 |
+
#
|
| 10 |
+
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
|
| 11 |
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 12 |
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
|
| 13 |
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 14 |
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 15 |
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
| 16 |
+
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 17 |
+
|
| 18 |
+
import base64
|
| 19 |
+
|
| 20 |
+
import dns.exception
|
| 21 |
+
import dns.immutable
|
| 22 |
+
import dns.rdata
|
| 23 |
+
import dns.tokenizer
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@dns.immutable.immutable
|
| 27 |
+
class OPENPGPKEY(dns.rdata.Rdata):
|
| 28 |
+
"""OPENPGPKEY record"""
|
| 29 |
+
|
| 30 |
+
# see: RFC 7929
|
| 31 |
+
|
| 32 |
+
def __init__(self, rdclass, rdtype, key):
|
| 33 |
+
super().__init__(rdclass, rdtype)
|
| 34 |
+
self.key = self._as_bytes(key)
|
| 35 |
+
|
| 36 |
+
def to_text(self, origin=None, relativize=True, **kw):
|
| 37 |
+
return dns.rdata._base64ify(self.key, chunksize=None, **kw)
|
| 38 |
+
|
| 39 |
+
@classmethod
|
| 40 |
+
def from_text(
|
| 41 |
+
cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
|
| 42 |
+
):
|
| 43 |
+
b64 = tok.concatenate_remaining_identifiers().encode()
|
| 44 |
+
key = base64.b64decode(b64)
|
| 45 |
+
return cls(rdclass, rdtype, key)
|
| 46 |
+
|
| 47 |
+
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
| 48 |
+
file.write(self.key)
|
| 49 |
+
|
| 50 |
+
@classmethod
|
| 51 |
+
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
| 52 |
+
key = parser.get_remaining()
|
| 53 |
+
return cls(rdclass, rdtype, key)
|