ADAPT-Chase commited on
Commit
bdd4475
·
verified ·
1 Parent(s): 506a552

Add files using upload-large-folder tool

Browse files
Files changed (20) hide show
  1. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/OPT.py +77 -0
  2. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/PTR.py +24 -0
  3. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RESINFO.py +24 -0
  4. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RP.py +58 -0
  5. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RRSIG.py +157 -0
  6. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RT.py +24 -0
  7. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SMIMEA.py +9 -0
  8. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SOA.py +86 -0
  9. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SPF.py +26 -0
  10. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SSHFP.py +68 -0
  11. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TKEY.py +142 -0
  12. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TLSA.py +9 -0
  13. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TSIG.py +160 -0
  14. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TXT.py +24 -0
  15. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/URI.py +79 -0
  16. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/WALLET.py +9 -0
  17. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/X25.py +57 -0
  18. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/ZONEMD.py +66 -0
  19. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/__init__.py +70 -0
  20. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/CH/A.py +59 -0
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/OPT.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ # Copyright (C) 2001-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 struct
19
+
20
+ import dns.edns
21
+ import dns.exception
22
+ import dns.immutable
23
+ import dns.rdata
24
+
25
+ # We don't implement from_text, and that's ok.
26
+ # pylint: disable=abstract-method
27
+
28
+
29
+ @dns.immutable.immutable
30
+ class OPT(dns.rdata.Rdata):
31
+ """OPT record"""
32
+
33
+ __slots__ = ["options"]
34
+
35
+ def __init__(self, rdclass, rdtype, options):
36
+ """Initialize an OPT rdata.
37
+
38
+ *rdclass*, an ``int`` is the rdataclass of the Rdata,
39
+ which is also the payload size.
40
+
41
+ *rdtype*, an ``int`` is the rdatatype of the Rdata.
42
+
43
+ *options*, a tuple of ``bytes``
44
+ """
45
+
46
+ super().__init__(rdclass, rdtype)
47
+
48
+ def as_option(option):
49
+ if not isinstance(option, dns.edns.Option):
50
+ raise ValueError("option is not a dns.edns.option")
51
+ return option
52
+
53
+ self.options = self._as_tuple(options, as_option)
54
+
55
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
56
+ for opt in self.options:
57
+ owire = opt.to_wire()
58
+ file.write(struct.pack("!HH", opt.otype, len(owire)))
59
+ file.write(owire)
60
+
61
+ def to_text(self, origin=None, relativize=True, **kw):
62
+ return " ".join(opt.to_text() for opt in self.options)
63
+
64
+ @classmethod
65
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
66
+ options = []
67
+ while parser.remaining() > 0:
68
+ (otype, olen) = parser.get_struct("!HH")
69
+ with parser.restrict_to(olen):
70
+ opt = dns.edns.option_from_wire_parser(otype, parser)
71
+ options.append(opt)
72
+ return cls(rdclass, rdtype, options)
73
+
74
+ @property
75
+ def payload(self):
76
+ "payload size"
77
+ return self.rdclass
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/PTR.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 PTR(dns.rdtypes.nsbase.NSBase):
24
+ """PTR record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RESINFO.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.txtbase
20
+
21
+
22
+ @dns.immutable.immutable
23
+ class RESINFO(dns.rdtypes.txtbase.TXTBase):
24
+ """RESINFO record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RP.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.exception
19
+ import dns.immutable
20
+ import dns.name
21
+ import dns.rdata
22
+
23
+
24
+ @dns.immutable.immutable
25
+ class RP(dns.rdata.Rdata):
26
+ """RP record"""
27
+
28
+ # see: RFC 1183
29
+
30
+ __slots__ = ["mbox", "txt"]
31
+
32
+ def __init__(self, rdclass, rdtype, mbox, txt):
33
+ super().__init__(rdclass, rdtype)
34
+ self.mbox = self._as_name(mbox)
35
+ self.txt = self._as_name(txt)
36
+
37
+ def to_text(self, origin=None, relativize=True, **kw):
38
+ mbox = self.mbox.choose_relativity(origin, relativize)
39
+ txt = self.txt.choose_relativity(origin, relativize)
40
+ return f"{str(mbox)} {str(txt)}"
41
+
42
+ @classmethod
43
+ def from_text(
44
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
45
+ ):
46
+ mbox = tok.get_name(origin, relativize, relativize_to)
47
+ txt = tok.get_name(origin, relativize, relativize_to)
48
+ return cls(rdclass, rdtype, mbox, txt)
49
+
50
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
51
+ self.mbox.to_wire(file, None, origin, canonicalize)
52
+ self.txt.to_wire(file, None, origin, canonicalize)
53
+
54
+ @classmethod
55
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
56
+ mbox = parser.get_name(origin)
57
+ txt = parser.get_name(origin)
58
+ return cls(rdclass, rdtype, mbox, txt)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RRSIG.py ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 base64
19
+ import calendar
20
+ import struct
21
+ import time
22
+
23
+ import dns.dnssectypes
24
+ import dns.exception
25
+ import dns.immutable
26
+ import dns.rdata
27
+ import dns.rdatatype
28
+
29
+
30
+ class BadSigTime(dns.exception.DNSException):
31
+ """Time in DNS SIG or RRSIG resource record cannot be parsed."""
32
+
33
+
34
+ def sigtime_to_posixtime(what):
35
+ if len(what) <= 10 and what.isdigit():
36
+ return int(what)
37
+ if len(what) != 14:
38
+ raise BadSigTime
39
+ year = int(what[0:4])
40
+ month = int(what[4:6])
41
+ day = int(what[6:8])
42
+ hour = int(what[8:10])
43
+ minute = int(what[10:12])
44
+ second = int(what[12:14])
45
+ return calendar.timegm((year, month, day, hour, minute, second, 0, 0, 0))
46
+
47
+
48
+ def posixtime_to_sigtime(what):
49
+ return time.strftime("%Y%m%d%H%M%S", time.gmtime(what))
50
+
51
+
52
+ @dns.immutable.immutable
53
+ class RRSIG(dns.rdata.Rdata):
54
+ """RRSIG record"""
55
+
56
+ __slots__ = [
57
+ "type_covered",
58
+ "algorithm",
59
+ "labels",
60
+ "original_ttl",
61
+ "expiration",
62
+ "inception",
63
+ "key_tag",
64
+ "signer",
65
+ "signature",
66
+ ]
67
+
68
+ def __init__(
69
+ self,
70
+ rdclass,
71
+ rdtype,
72
+ type_covered,
73
+ algorithm,
74
+ labels,
75
+ original_ttl,
76
+ expiration,
77
+ inception,
78
+ key_tag,
79
+ signer,
80
+ signature,
81
+ ):
82
+ super().__init__(rdclass, rdtype)
83
+ self.type_covered = self._as_rdatatype(type_covered)
84
+ self.algorithm = dns.dnssectypes.Algorithm.make(algorithm)
85
+ self.labels = self._as_uint8(labels)
86
+ self.original_ttl = self._as_ttl(original_ttl)
87
+ self.expiration = self._as_uint32(expiration)
88
+ self.inception = self._as_uint32(inception)
89
+ self.key_tag = self._as_uint16(key_tag)
90
+ self.signer = self._as_name(signer)
91
+ self.signature = self._as_bytes(signature)
92
+
93
+ def covers(self):
94
+ return self.type_covered
95
+
96
+ def to_text(self, origin=None, relativize=True, **kw):
97
+ return "%s %d %d %d %s %s %d %s %s" % (
98
+ dns.rdatatype.to_text(self.type_covered),
99
+ self.algorithm,
100
+ self.labels,
101
+ self.original_ttl,
102
+ posixtime_to_sigtime(self.expiration),
103
+ posixtime_to_sigtime(self.inception),
104
+ self.key_tag,
105
+ self.signer.choose_relativity(origin, relativize),
106
+ dns.rdata._base64ify(self.signature, **kw),
107
+ )
108
+
109
+ @classmethod
110
+ def from_text(
111
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
112
+ ):
113
+ type_covered = dns.rdatatype.from_text(tok.get_string())
114
+ algorithm = dns.dnssectypes.Algorithm.from_text(tok.get_string())
115
+ labels = tok.get_int()
116
+ original_ttl = tok.get_ttl()
117
+ expiration = sigtime_to_posixtime(tok.get_string())
118
+ inception = sigtime_to_posixtime(tok.get_string())
119
+ key_tag = tok.get_int()
120
+ signer = tok.get_name(origin, relativize, relativize_to)
121
+ b64 = tok.concatenate_remaining_identifiers().encode()
122
+ signature = base64.b64decode(b64)
123
+ return cls(
124
+ rdclass,
125
+ rdtype,
126
+ type_covered,
127
+ algorithm,
128
+ labels,
129
+ original_ttl,
130
+ expiration,
131
+ inception,
132
+ key_tag,
133
+ signer,
134
+ signature,
135
+ )
136
+
137
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
138
+ header = struct.pack(
139
+ "!HBBIIIH",
140
+ self.type_covered,
141
+ self.algorithm,
142
+ self.labels,
143
+ self.original_ttl,
144
+ self.expiration,
145
+ self.inception,
146
+ self.key_tag,
147
+ )
148
+ file.write(header)
149
+ self.signer.to_wire(file, None, origin, canonicalize)
150
+ file.write(self.signature)
151
+
152
+ @classmethod
153
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
154
+ header = parser.get_struct("!HBBIIIH")
155
+ signer = parser.get_name(origin)
156
+ signature = parser.get_remaining()
157
+ return cls(rdclass, rdtype, *header, signer, signature)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/RT.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 RT(dns.rdtypes.mxbase.UncompressedDowncasingMX):
24
+ """RT record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SMIMEA.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ import dns.immutable
4
+ import dns.rdtypes.tlsabase
5
+
6
+
7
+ @dns.immutable.immutable
8
+ class SMIMEA(dns.rdtypes.tlsabase.TLSABase):
9
+ """SMIMEA record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SOA.py ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.name
23
+ import dns.rdata
24
+
25
+
26
+ @dns.immutable.immutable
27
+ class SOA(dns.rdata.Rdata):
28
+ """SOA record"""
29
+
30
+ # see: RFC 1035
31
+
32
+ __slots__ = ["mname", "rname", "serial", "refresh", "retry", "expire", "minimum"]
33
+
34
+ def __init__(
35
+ self, rdclass, rdtype, mname, rname, serial, refresh, retry, expire, minimum
36
+ ):
37
+ super().__init__(rdclass, rdtype)
38
+ self.mname = self._as_name(mname)
39
+ self.rname = self._as_name(rname)
40
+ self.serial = self._as_uint32(serial)
41
+ self.refresh = self._as_ttl(refresh)
42
+ self.retry = self._as_ttl(retry)
43
+ self.expire = self._as_ttl(expire)
44
+ self.minimum = self._as_ttl(minimum)
45
+
46
+ def to_text(self, origin=None, relativize=True, **kw):
47
+ mname = self.mname.choose_relativity(origin, relativize)
48
+ rname = self.rname.choose_relativity(origin, relativize)
49
+ return "%s %s %d %d %d %d %d" % (
50
+ mname,
51
+ rname,
52
+ self.serial,
53
+ self.refresh,
54
+ self.retry,
55
+ self.expire,
56
+ self.minimum,
57
+ )
58
+
59
+ @classmethod
60
+ def from_text(
61
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
62
+ ):
63
+ mname = tok.get_name(origin, relativize, relativize_to)
64
+ rname = tok.get_name(origin, relativize, relativize_to)
65
+ serial = tok.get_uint32()
66
+ refresh = tok.get_ttl()
67
+ retry = tok.get_ttl()
68
+ expire = tok.get_ttl()
69
+ minimum = tok.get_ttl()
70
+ return cls(
71
+ rdclass, rdtype, mname, rname, serial, refresh, retry, expire, minimum
72
+ )
73
+
74
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
75
+ self.mname.to_wire(file, compress, origin, canonicalize)
76
+ self.rname.to_wire(file, compress, origin, canonicalize)
77
+ five_ints = struct.pack(
78
+ "!IIIII", self.serial, self.refresh, self.retry, self.expire, self.minimum
79
+ )
80
+ file.write(five_ints)
81
+
82
+ @classmethod
83
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
84
+ mname = parser.get_name(origin)
85
+ rname = parser.get_name(origin)
86
+ return cls(rdclass, rdtype, mname, rname, *parser.get_struct("!IIIII"))
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SPF.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 SPF(dns.rdtypes.txtbase.TXTBase):
24
+ """SPF record"""
25
+
26
+ # see: RFC 4408
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/SSHFP.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ # Copyright (C) 2005-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.immutable
22
+ import dns.rdata
23
+ import dns.rdatatype
24
+
25
+
26
+ @dns.immutable.immutable
27
+ class SSHFP(dns.rdata.Rdata):
28
+ """SSHFP record"""
29
+
30
+ # See RFC 4255
31
+
32
+ __slots__ = ["algorithm", "fp_type", "fingerprint"]
33
+
34
+ def __init__(self, rdclass, rdtype, algorithm, fp_type, fingerprint):
35
+ super().__init__(rdclass, rdtype)
36
+ self.algorithm = self._as_uint8(algorithm)
37
+ self.fp_type = self._as_uint8(fp_type)
38
+ self.fingerprint = self._as_bytes(fingerprint, True)
39
+
40
+ def to_text(self, origin=None, relativize=True, **kw):
41
+ kw = kw.copy()
42
+ chunksize = kw.pop("chunksize", 128)
43
+ return "%d %d %s" % (
44
+ self.algorithm,
45
+ self.fp_type,
46
+ dns.rdata._hexify(self.fingerprint, chunksize=chunksize, **kw),
47
+ )
48
+
49
+ @classmethod
50
+ def from_text(
51
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
52
+ ):
53
+ algorithm = tok.get_uint8()
54
+ fp_type = tok.get_uint8()
55
+ fingerprint = tok.concatenate_remaining_identifiers().encode()
56
+ fingerprint = binascii.unhexlify(fingerprint)
57
+ return cls(rdclass, rdtype, algorithm, fp_type, fingerprint)
58
+
59
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
60
+ header = struct.pack("!BB", self.algorithm, self.fp_type)
61
+ file.write(header)
62
+ file.write(self.fingerprint)
63
+
64
+ @classmethod
65
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
66
+ header = parser.get_struct("BB")
67
+ fingerprint = parser.get_remaining()
68
+ return cls(rdclass, rdtype, header[0], header[1], fingerprint)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TKEY.py ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 base64
19
+ import struct
20
+
21
+ import dns.exception
22
+ import dns.immutable
23
+ import dns.rdata
24
+
25
+
26
+ @dns.immutable.immutable
27
+ class TKEY(dns.rdata.Rdata):
28
+ """TKEY Record"""
29
+
30
+ __slots__ = [
31
+ "algorithm",
32
+ "inception",
33
+ "expiration",
34
+ "mode",
35
+ "error",
36
+ "key",
37
+ "other",
38
+ ]
39
+
40
+ def __init__(
41
+ self,
42
+ rdclass,
43
+ rdtype,
44
+ algorithm,
45
+ inception,
46
+ expiration,
47
+ mode,
48
+ error,
49
+ key,
50
+ other=b"",
51
+ ):
52
+ super().__init__(rdclass, rdtype)
53
+ self.algorithm = self._as_name(algorithm)
54
+ self.inception = self._as_uint32(inception)
55
+ self.expiration = self._as_uint32(expiration)
56
+ self.mode = self._as_uint16(mode)
57
+ self.error = self._as_uint16(error)
58
+ self.key = self._as_bytes(key)
59
+ self.other = self._as_bytes(other)
60
+
61
+ def to_text(self, origin=None, relativize=True, **kw):
62
+ _algorithm = self.algorithm.choose_relativity(origin, relativize)
63
+ text = "%s %u %u %u %u %s" % (
64
+ str(_algorithm),
65
+ self.inception,
66
+ self.expiration,
67
+ self.mode,
68
+ self.error,
69
+ dns.rdata._base64ify(self.key, 0),
70
+ )
71
+ if len(self.other) > 0:
72
+ text += f" {dns.rdata._base64ify(self.other, 0)}"
73
+
74
+ return text
75
+
76
+ @classmethod
77
+ def from_text(
78
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
79
+ ):
80
+ algorithm = tok.get_name(relativize=False)
81
+ inception = tok.get_uint32()
82
+ expiration = tok.get_uint32()
83
+ mode = tok.get_uint16()
84
+ error = tok.get_uint16()
85
+ key_b64 = tok.get_string().encode()
86
+ key = base64.b64decode(key_b64)
87
+ other_b64 = tok.concatenate_remaining_identifiers(True).encode()
88
+ other = base64.b64decode(other_b64)
89
+
90
+ return cls(
91
+ rdclass, rdtype, algorithm, inception, expiration, mode, error, key, other
92
+ )
93
+
94
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
95
+ self.algorithm.to_wire(file, compress, origin)
96
+ file.write(
97
+ struct.pack("!IIHH", self.inception, self.expiration, self.mode, self.error)
98
+ )
99
+ file.write(struct.pack("!H", len(self.key)))
100
+ file.write(self.key)
101
+ file.write(struct.pack("!H", len(self.other)))
102
+ if len(self.other) > 0:
103
+ file.write(self.other)
104
+
105
+ @classmethod
106
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
107
+ algorithm = parser.get_name(origin)
108
+ inception, expiration, mode, error = parser.get_struct("!IIHH")
109
+ key = parser.get_counted_bytes(2)
110
+ other = parser.get_counted_bytes(2)
111
+
112
+ return cls(
113
+ rdclass, rdtype, algorithm, inception, expiration, mode, error, key, other
114
+ )
115
+
116
+ # Constants for the mode field - from RFC 2930:
117
+ # 2.5 The Mode Field
118
+ #
119
+ # The mode field specifies the general scheme for key agreement or
120
+ # the purpose of the TKEY DNS message. Servers and resolvers
121
+ # supporting this specification MUST implement the Diffie-Hellman key
122
+ # agreement mode and the key deletion mode for queries. All other
123
+ # modes are OPTIONAL. A server supporting TKEY that receives a TKEY
124
+ # request with a mode it does not support returns the BADMODE error.
125
+ # The following values of the Mode octet are defined, available, or
126
+ # reserved:
127
+ #
128
+ # Value Description
129
+ # ----- -----------
130
+ # 0 - reserved, see section 7
131
+ # 1 server assignment
132
+ # 2 Diffie-Hellman exchange
133
+ # 3 GSS-API negotiation
134
+ # 4 resolver assignment
135
+ # 5 key deletion
136
+ # 6-65534 - available, see section 7
137
+ # 65535 - reserved, see section 7
138
+ SERVER_ASSIGNMENT = 1
139
+ DIFFIE_HELLMAN_EXCHANGE = 2
140
+ GSSAPI_NEGOTIATION = 3
141
+ RESOLVER_ASSIGNMENT = 4
142
+ KEY_DELETION = 5
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TLSA.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ import dns.immutable
4
+ import dns.rdtypes.tlsabase
5
+
6
+
7
+ @dns.immutable.immutable
8
+ class TLSA(dns.rdtypes.tlsabase.TLSABase):
9
+ """TLSA record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TSIG.py ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ # Copyright (C) 2001-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 struct
20
+
21
+ import dns.exception
22
+ import dns.immutable
23
+ import dns.rcode
24
+ import dns.rdata
25
+
26
+
27
+ @dns.immutable.immutable
28
+ class TSIG(dns.rdata.Rdata):
29
+ """TSIG record"""
30
+
31
+ __slots__ = [
32
+ "algorithm",
33
+ "time_signed",
34
+ "fudge",
35
+ "mac",
36
+ "original_id",
37
+ "error",
38
+ "other",
39
+ ]
40
+
41
+ def __init__(
42
+ self,
43
+ rdclass,
44
+ rdtype,
45
+ algorithm,
46
+ time_signed,
47
+ fudge,
48
+ mac,
49
+ original_id,
50
+ error,
51
+ other,
52
+ ):
53
+ """Initialize a TSIG rdata.
54
+
55
+ *rdclass*, an ``int`` is the rdataclass of the Rdata.
56
+
57
+ *rdtype*, an ``int`` is the rdatatype of the Rdata.
58
+
59
+ *algorithm*, a ``dns.name.Name``.
60
+
61
+ *time_signed*, an ``int``.
62
+
63
+ *fudge*, an ``int`.
64
+
65
+ *mac*, a ``bytes``
66
+
67
+ *original_id*, an ``int``
68
+
69
+ *error*, an ``int``
70
+
71
+ *other*, a ``bytes``
72
+ """
73
+
74
+ super().__init__(rdclass, rdtype)
75
+ self.algorithm = self._as_name(algorithm)
76
+ self.time_signed = self._as_uint48(time_signed)
77
+ self.fudge = self._as_uint16(fudge)
78
+ self.mac = self._as_bytes(mac)
79
+ self.original_id = self._as_uint16(original_id)
80
+ self.error = dns.rcode.Rcode.make(error)
81
+ self.other = self._as_bytes(other)
82
+
83
+ def to_text(self, origin=None, relativize=True, **kw):
84
+ algorithm = self.algorithm.choose_relativity(origin, relativize)
85
+ error = dns.rcode.to_text(self.error, True)
86
+ text = (
87
+ f"{algorithm} {self.time_signed} {self.fudge} "
88
+ + f"{len(self.mac)} {dns.rdata._base64ify(self.mac, 0)} "
89
+ + f"{self.original_id} {error} {len(self.other)}"
90
+ )
91
+ if self.other:
92
+ text += f" {dns.rdata._base64ify(self.other, 0)}"
93
+ return text
94
+
95
+ @classmethod
96
+ def from_text(
97
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
98
+ ):
99
+ algorithm = tok.get_name(relativize=False)
100
+ time_signed = tok.get_uint48()
101
+ fudge = tok.get_uint16()
102
+ mac_len = tok.get_uint16()
103
+ mac = base64.b64decode(tok.get_string())
104
+ if len(mac) != mac_len:
105
+ raise SyntaxError("invalid MAC")
106
+ original_id = tok.get_uint16()
107
+ error = dns.rcode.from_text(tok.get_string())
108
+ other_len = tok.get_uint16()
109
+ if other_len > 0:
110
+ other = base64.b64decode(tok.get_string())
111
+ if len(other) != other_len:
112
+ raise SyntaxError("invalid other data")
113
+ else:
114
+ other = b""
115
+ return cls(
116
+ rdclass,
117
+ rdtype,
118
+ algorithm,
119
+ time_signed,
120
+ fudge,
121
+ mac,
122
+ original_id,
123
+ error,
124
+ other,
125
+ )
126
+
127
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
128
+ self.algorithm.to_wire(file, None, origin, False)
129
+ file.write(
130
+ struct.pack(
131
+ "!HIHH",
132
+ (self.time_signed >> 32) & 0xFFFF,
133
+ self.time_signed & 0xFFFFFFFF,
134
+ self.fudge,
135
+ len(self.mac),
136
+ )
137
+ )
138
+ file.write(self.mac)
139
+ file.write(struct.pack("!HHH", self.original_id, self.error, len(self.other)))
140
+ file.write(self.other)
141
+
142
+ @classmethod
143
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
144
+ algorithm = parser.get_name()
145
+ time_signed = parser.get_uint48()
146
+ fudge = parser.get_uint16()
147
+ mac = parser.get_counted_bytes(2)
148
+ (original_id, error) = parser.get_struct("!HH")
149
+ other = parser.get_counted_bytes(2)
150
+ return cls(
151
+ rdclass,
152
+ rdtype,
153
+ algorithm,
154
+ time_signed,
155
+ fudge,
156
+ mac,
157
+ original_id,
158
+ error,
159
+ other,
160
+ )
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/TXT.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.txtbase
20
+
21
+
22
+ @dns.immutable.immutable
23
+ class TXT(dns.rdtypes.txtbase.TXTBase):
24
+ """TXT record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/URI.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
4
+ # Copyright (C) 2015 Red Hat, Inc.
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 NOMINUM 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 struct
20
+
21
+ import dns.exception
22
+ import dns.immutable
23
+ import dns.name
24
+ import dns.rdata
25
+ import dns.rdtypes.util
26
+
27
+
28
+ @dns.immutable.immutable
29
+ class URI(dns.rdata.Rdata):
30
+ """URI record"""
31
+
32
+ # see RFC 7553
33
+
34
+ __slots__ = ["priority", "weight", "target"]
35
+
36
+ def __init__(self, rdclass, rdtype, priority, weight, target):
37
+ super().__init__(rdclass, rdtype)
38
+ self.priority = self._as_uint16(priority)
39
+ self.weight = self._as_uint16(weight)
40
+ self.target = self._as_bytes(target, True)
41
+ if len(self.target) == 0:
42
+ raise dns.exception.SyntaxError("URI target cannot be empty")
43
+
44
+ def to_text(self, origin=None, relativize=True, **kw):
45
+ return '%d %d "%s"' % (self.priority, self.weight, self.target.decode())
46
+
47
+ @classmethod
48
+ def from_text(
49
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
50
+ ):
51
+ priority = tok.get_uint16()
52
+ weight = tok.get_uint16()
53
+ target = tok.get().unescape()
54
+ if not (target.is_quoted_string() or target.is_identifier()):
55
+ raise dns.exception.SyntaxError("URI target must be a string")
56
+ return cls(rdclass, rdtype, priority, weight, target.value)
57
+
58
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
59
+ two_ints = struct.pack("!HH", self.priority, self.weight)
60
+ file.write(two_ints)
61
+ file.write(self.target)
62
+
63
+ @classmethod
64
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
65
+ (priority, weight) = parser.get_struct("!HH")
66
+ target = parser.get_remaining()
67
+ if len(target) == 0:
68
+ raise dns.exception.FormError("URI target may not be empty")
69
+ return cls(rdclass, rdtype, priority, weight, target)
70
+
71
+ def _processing_priority(self):
72
+ return self.priority
73
+
74
+ def _processing_weight(self):
75
+ return self.weight
76
+
77
+ @classmethod
78
+ def _processing_order(cls, iterable):
79
+ return dns.rdtypes.util.weighted_processing_order(iterable)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/WALLET.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ import dns.immutable
4
+ import dns.rdtypes.txtbase
5
+
6
+
7
+ @dns.immutable.immutable
8
+ class WALLET(dns.rdtypes.txtbase.TXTBase):
9
+ """WALLET record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/X25.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 X25(dns.rdata.Rdata):
28
+ """X25 record"""
29
+
30
+ # see RFC 1183
31
+
32
+ __slots__ = ["address"]
33
+
34
+ def __init__(self, rdclass, rdtype, address):
35
+ super().__init__(rdclass, rdtype)
36
+ self.address = self._as_bytes(address, True, 255)
37
+
38
+ def to_text(self, origin=None, relativize=True, **kw):
39
+ return f'"{dns.rdata._escapify(self.address)}"'
40
+
41
+ @classmethod
42
+ def from_text(
43
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
44
+ ):
45
+ address = tok.get_string()
46
+ return cls(rdclass, rdtype, address)
47
+
48
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
49
+ l = len(self.address)
50
+ assert l < 256
51
+ file.write(struct.pack("!B", l))
52
+ file.write(self.address)
53
+
54
+ @classmethod
55
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
56
+ address = parser.get_counted_bytes()
57
+ return cls(rdclass, rdtype, address)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/ZONEMD.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ import binascii
4
+ import struct
5
+
6
+ import dns.immutable
7
+ import dns.rdata
8
+ import dns.rdatatype
9
+ import dns.zonetypes
10
+
11
+
12
+ @dns.immutable.immutable
13
+ class ZONEMD(dns.rdata.Rdata):
14
+ """ZONEMD record"""
15
+
16
+ # See RFC 8976
17
+
18
+ __slots__ = ["serial", "scheme", "hash_algorithm", "digest"]
19
+
20
+ def __init__(self, rdclass, rdtype, serial, scheme, hash_algorithm, digest):
21
+ super().__init__(rdclass, rdtype)
22
+ self.serial = self._as_uint32(serial)
23
+ self.scheme = dns.zonetypes.DigestScheme.make(scheme)
24
+ self.hash_algorithm = dns.zonetypes.DigestHashAlgorithm.make(hash_algorithm)
25
+ self.digest = self._as_bytes(digest)
26
+
27
+ if self.scheme == 0: # reserved, RFC 8976 Sec. 5.2
28
+ raise ValueError("scheme 0 is reserved")
29
+ if self.hash_algorithm == 0: # reserved, RFC 8976 Sec. 5.3
30
+ raise ValueError("hash_algorithm 0 is reserved")
31
+
32
+ hasher = dns.zonetypes._digest_hashers.get(self.hash_algorithm)
33
+ if hasher and hasher().digest_size != len(self.digest):
34
+ raise ValueError("digest length inconsistent with hash algorithm")
35
+
36
+ def to_text(self, origin=None, relativize=True, **kw):
37
+ kw = kw.copy()
38
+ chunksize = kw.pop("chunksize", 128)
39
+ return "%d %d %d %s" % (
40
+ self.serial,
41
+ self.scheme,
42
+ self.hash_algorithm,
43
+ dns.rdata._hexify(self.digest, chunksize=chunksize, **kw),
44
+ )
45
+
46
+ @classmethod
47
+ def from_text(
48
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
49
+ ):
50
+ serial = tok.get_uint32()
51
+ scheme = tok.get_uint8()
52
+ hash_algorithm = tok.get_uint8()
53
+ digest = tok.concatenate_remaining_identifiers().encode()
54
+ digest = binascii.unhexlify(digest)
55
+ return cls(rdclass, rdtype, serial, scheme, hash_algorithm, digest)
56
+
57
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
58
+ header = struct.pack("!IBB", self.serial, self.scheme, self.hash_algorithm)
59
+ file.write(header)
60
+ file.write(self.digest)
61
+
62
+ @classmethod
63
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
64
+ header = parser.get_struct("!IBB")
65
+ digest = parser.get_remaining()
66
+ return cls(rdclass, rdtype, header[0], header[1], header[2], digest)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/ANY/__init__.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Class ANY (generic) rdata type classes."""
19
+
20
+ __all__ = [
21
+ "AFSDB",
22
+ "AMTRELAY",
23
+ "AVC",
24
+ "CAA",
25
+ "CDNSKEY",
26
+ "CDS",
27
+ "CERT",
28
+ "CNAME",
29
+ "CSYNC",
30
+ "DLV",
31
+ "DNAME",
32
+ "DNSKEY",
33
+ "DS",
34
+ "EUI48",
35
+ "EUI64",
36
+ "GPOS",
37
+ "HINFO",
38
+ "HIP",
39
+ "ISDN",
40
+ "L32",
41
+ "L64",
42
+ "LOC",
43
+ "LP",
44
+ "MX",
45
+ "NID",
46
+ "NINFO",
47
+ "NS",
48
+ "NSEC",
49
+ "NSEC3",
50
+ "NSEC3PARAM",
51
+ "OPENPGPKEY",
52
+ "OPT",
53
+ "PTR",
54
+ "RESINFO",
55
+ "RP",
56
+ "RRSIG",
57
+ "RT",
58
+ "SMIMEA",
59
+ "SOA",
60
+ "SPF",
61
+ "SSHFP",
62
+ "TKEY",
63
+ "TLSA",
64
+ "TSIG",
65
+ "TXT",
66
+ "URI",
67
+ "WALLET",
68
+ "X25",
69
+ "ZONEMD",
70
+ ]
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/CH/A.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.immutable
21
+ import dns.rdtypes.mxbase
22
+
23
+
24
+ @dns.immutable.immutable
25
+ class A(dns.rdata.Rdata):
26
+ """A record for Chaosnet"""
27
+
28
+ # domain: the domain of the address
29
+ # address: the 16-bit address
30
+
31
+ __slots__ = ["domain", "address"]
32
+
33
+ def __init__(self, rdclass, rdtype, domain, address):
34
+ super().__init__(rdclass, rdtype)
35
+ self.domain = self._as_name(domain)
36
+ self.address = self._as_uint16(address)
37
+
38
+ def to_text(self, origin=None, relativize=True, **kw):
39
+ domain = self.domain.choose_relativity(origin, relativize)
40
+ return f"{domain} {self.address:o}"
41
+
42
+ @classmethod
43
+ def from_text(
44
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
45
+ ):
46
+ domain = tok.get_name(origin, relativize, relativize_to)
47
+ address = tok.get_uint16(base=8)
48
+ return cls(rdclass, rdtype, domain, address)
49
+
50
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
51
+ self.domain.to_wire(file, compress, origin, canonicalize)
52
+ pref = struct.pack("!H", self.address)
53
+ file.write(pref)
54
+
55
+ @classmethod
56
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
57
+ domain = parser.get_name(origin)
58
+ address = parser.get_uint16()
59
+ return cls(rdclass, rdtype, domain, address)