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

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/CH/__init__.py +22 -0
  2. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/A.py +51 -0
  3. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/AAAA.py +51 -0
  4. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/APL.py +150 -0
  5. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/DHCID.py +54 -0
  6. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/HTTPS.py +9 -0
  7. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/IPSECKEY.py +91 -0
  8. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/KX.py +24 -0
  9. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/NAPTR.py +110 -0
  10. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/NSAP.py +60 -0
  11. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/NSAP_PTR.py +24 -0
  12. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/PX.py +73 -0
  13. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/SRV.py +75 -0
  14. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/SVCB.py +9 -0
  15. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/WKS.py +100 -0
  16. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/__init__.py +35 -0
  17. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/__init__.cpython-312.pyc +0 -0
  18. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/dnskeybase.cpython-312.pyc +0 -0
  19. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/dsbase.cpython-312.pyc +0 -0
  20. tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/euibase.cpython-312.pyc +0 -0
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/CH/__init__.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 CH rdata type classes."""
19
+
20
+ __all__ = [
21
+ "A",
22
+ ]
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/A.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.ipv4
21
+ import dns.rdata
22
+ import dns.tokenizer
23
+
24
+
25
+ @dns.immutable.immutable
26
+ class A(dns.rdata.Rdata):
27
+ """A record."""
28
+
29
+ __slots__ = ["address"]
30
+
31
+ def __init__(self, rdclass, rdtype, address):
32
+ super().__init__(rdclass, rdtype)
33
+ self.address = self._as_ipv4_address(address)
34
+
35
+ def to_text(self, origin=None, relativize=True, **kw):
36
+ return self.address
37
+
38
+ @classmethod
39
+ def from_text(
40
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
41
+ ):
42
+ address = tok.get_identifier()
43
+ return cls(rdclass, rdtype, address)
44
+
45
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
46
+ file.write(dns.ipv4.inet_aton(self.address))
47
+
48
+ @classmethod
49
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
50
+ address = parser.get_remaining()
51
+ return cls(rdclass, rdtype, address)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/AAAA.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.ipv6
21
+ import dns.rdata
22
+ import dns.tokenizer
23
+
24
+
25
+ @dns.immutable.immutable
26
+ class AAAA(dns.rdata.Rdata):
27
+ """AAAA record."""
28
+
29
+ __slots__ = ["address"]
30
+
31
+ def __init__(self, rdclass, rdtype, address):
32
+ super().__init__(rdclass, rdtype)
33
+ self.address = self._as_ipv6_address(address)
34
+
35
+ def to_text(self, origin=None, relativize=True, **kw):
36
+ return self.address
37
+
38
+ @classmethod
39
+ def from_text(
40
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
41
+ ):
42
+ address = tok.get_identifier()
43
+ return cls(rdclass, rdtype, address)
44
+
45
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
46
+ file.write(dns.ipv6.inet_aton(self.address))
47
+
48
+ @classmethod
49
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
50
+ address = parser.get_remaining()
51
+ return cls(rdclass, rdtype, address)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/APL.py ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
+
3
+ # Copyright (C) 2003-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 binascii
19
+ import codecs
20
+ import struct
21
+
22
+ import dns.exception
23
+ import dns.immutable
24
+ import dns.ipv4
25
+ import dns.ipv6
26
+ import dns.rdata
27
+ import dns.tokenizer
28
+
29
+
30
+ @dns.immutable.immutable
31
+ class APLItem:
32
+ """An APL list item."""
33
+
34
+ __slots__ = ["family", "negation", "address", "prefix"]
35
+
36
+ def __init__(self, family, negation, address, prefix):
37
+ self.family = dns.rdata.Rdata._as_uint16(family)
38
+ self.negation = dns.rdata.Rdata._as_bool(negation)
39
+ if self.family == 1:
40
+ self.address = dns.rdata.Rdata._as_ipv4_address(address)
41
+ self.prefix = dns.rdata.Rdata._as_int(prefix, 0, 32)
42
+ elif self.family == 2:
43
+ self.address = dns.rdata.Rdata._as_ipv6_address(address)
44
+ self.prefix = dns.rdata.Rdata._as_int(prefix, 0, 128)
45
+ else:
46
+ self.address = dns.rdata.Rdata._as_bytes(address, max_length=127)
47
+ self.prefix = dns.rdata.Rdata._as_uint8(prefix)
48
+
49
+ def __str__(self):
50
+ if self.negation:
51
+ return "!%d:%s/%s" % (self.family, self.address, self.prefix)
52
+ else:
53
+ return "%d:%s/%s" % (self.family, self.address, self.prefix)
54
+
55
+ def to_wire(self, file):
56
+ if self.family == 1:
57
+ address = dns.ipv4.inet_aton(self.address)
58
+ elif self.family == 2:
59
+ address = dns.ipv6.inet_aton(self.address)
60
+ else:
61
+ address = binascii.unhexlify(self.address)
62
+ #
63
+ # Truncate least significant zero bytes.
64
+ #
65
+ last = 0
66
+ for i in range(len(address) - 1, -1, -1):
67
+ if address[i] != 0:
68
+ last = i + 1
69
+ break
70
+ address = address[0:last]
71
+ l = len(address)
72
+ assert l < 128
73
+ if self.negation:
74
+ l |= 0x80
75
+ header = struct.pack("!HBB", self.family, self.prefix, l)
76
+ file.write(header)
77
+ file.write(address)
78
+
79
+
80
+ @dns.immutable.immutable
81
+ class APL(dns.rdata.Rdata):
82
+ """APL record."""
83
+
84
+ # see: RFC 3123
85
+
86
+ __slots__ = ["items"]
87
+
88
+ def __init__(self, rdclass, rdtype, items):
89
+ super().__init__(rdclass, rdtype)
90
+ for item in items:
91
+ if not isinstance(item, APLItem):
92
+ raise ValueError("item not an APLItem")
93
+ self.items = tuple(items)
94
+
95
+ def to_text(self, origin=None, relativize=True, **kw):
96
+ return " ".join(map(str, self.items))
97
+
98
+ @classmethod
99
+ def from_text(
100
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
101
+ ):
102
+ items = []
103
+ for token in tok.get_remaining():
104
+ item = token.unescape().value
105
+ if item[0] == "!":
106
+ negation = True
107
+ item = item[1:]
108
+ else:
109
+ negation = False
110
+ (family, rest) = item.split(":", 1)
111
+ family = int(family)
112
+ (address, prefix) = rest.split("/", 1)
113
+ prefix = int(prefix)
114
+ item = APLItem(family, negation, address, prefix)
115
+ items.append(item)
116
+
117
+ return cls(rdclass, rdtype, items)
118
+
119
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
120
+ for item in self.items:
121
+ item.to_wire(file)
122
+
123
+ @classmethod
124
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
125
+ items = []
126
+ while parser.remaining() > 0:
127
+ header = parser.get_struct("!HBB")
128
+ afdlen = header[2]
129
+ if afdlen > 127:
130
+ negation = True
131
+ afdlen -= 128
132
+ else:
133
+ negation = False
134
+ address = parser.get_bytes(afdlen)
135
+ l = len(address)
136
+ if header[0] == 1:
137
+ if l < 4:
138
+ address += b"\x00" * (4 - l)
139
+ elif header[0] == 2:
140
+ if l < 16:
141
+ address += b"\x00" * (16 - l)
142
+ else:
143
+ #
144
+ # This isn't really right according to the RFC, but it
145
+ # seems better than throwing an exception
146
+ #
147
+ address = codecs.encode(address, "hex_codec")
148
+ item = APLItem(header[0], negation, address, header[1])
149
+ items.append(item)
150
+ return cls(rdclass, rdtype, items)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/DHCID.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 base64
19
+
20
+ import dns.exception
21
+ import dns.immutable
22
+ import dns.rdata
23
+
24
+
25
+ @dns.immutable.immutable
26
+ class DHCID(dns.rdata.Rdata):
27
+ """DHCID record"""
28
+
29
+ # see: RFC 4701
30
+
31
+ __slots__ = ["data"]
32
+
33
+ def __init__(self, rdclass, rdtype, data):
34
+ super().__init__(rdclass, rdtype)
35
+ self.data = self._as_bytes(data)
36
+
37
+ def to_text(self, origin=None, relativize=True, **kw):
38
+ return dns.rdata._base64ify(self.data, **kw)
39
+
40
+ @classmethod
41
+ def from_text(
42
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
43
+ ):
44
+ b64 = tok.concatenate_remaining_identifiers().encode()
45
+ data = base64.b64decode(b64)
46
+ return cls(rdclass, rdtype, data)
47
+
48
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
49
+ file.write(self.data)
50
+
51
+ @classmethod
52
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
53
+ data = parser.get_remaining()
54
+ return cls(rdclass, rdtype, data)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/HTTPS.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.svcbbase
5
+
6
+
7
+ @dns.immutable.immutable
8
+ class HTTPS(dns.rdtypes.svcbbase.SVCBBase):
9
+ """HTTPS record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/IPSECKEY.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 base64
19
+ import struct
20
+
21
+ import dns.exception
22
+ import dns.immutable
23
+ import dns.rdtypes.util
24
+
25
+
26
+ class Gateway(dns.rdtypes.util.Gateway):
27
+ name = "IPSECKEY gateway"
28
+
29
+
30
+ @dns.immutable.immutable
31
+ class IPSECKEY(dns.rdata.Rdata):
32
+ """IPSECKEY record"""
33
+
34
+ # see: RFC 4025
35
+
36
+ __slots__ = ["precedence", "gateway_type", "algorithm", "gateway", "key"]
37
+
38
+ def __init__(
39
+ self, rdclass, rdtype, precedence, gateway_type, algorithm, gateway, key
40
+ ):
41
+ super().__init__(rdclass, rdtype)
42
+ gateway = Gateway(gateway_type, gateway)
43
+ self.precedence = self._as_uint8(precedence)
44
+ self.gateway_type = gateway.type
45
+ self.algorithm = self._as_uint8(algorithm)
46
+ self.gateway = gateway.gateway
47
+ self.key = self._as_bytes(key)
48
+
49
+ def to_text(self, origin=None, relativize=True, **kw):
50
+ gateway = Gateway(self.gateway_type, self.gateway).to_text(origin, relativize)
51
+ return "%d %d %d %s %s" % (
52
+ self.precedence,
53
+ self.gateway_type,
54
+ self.algorithm,
55
+ gateway,
56
+ dns.rdata._base64ify(self.key, **kw),
57
+ )
58
+
59
+ @classmethod
60
+ def from_text(
61
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
62
+ ):
63
+ precedence = tok.get_uint8()
64
+ gateway_type = tok.get_uint8()
65
+ algorithm = tok.get_uint8()
66
+ gateway = Gateway.from_text(
67
+ gateway_type, tok, origin, relativize, relativize_to
68
+ )
69
+ b64 = tok.concatenate_remaining_identifiers().encode()
70
+ key = base64.b64decode(b64)
71
+ return cls(
72
+ rdclass, rdtype, precedence, gateway_type, algorithm, gateway.gateway, key
73
+ )
74
+
75
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
76
+ header = struct.pack("!BBB", self.precedence, self.gateway_type, self.algorithm)
77
+ file.write(header)
78
+ Gateway(self.gateway_type, self.gateway).to_wire(
79
+ file, compress, origin, canonicalize
80
+ )
81
+ file.write(self.key)
82
+
83
+ @classmethod
84
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
85
+ header = parser.get_struct("!BBB")
86
+ gateway_type = header[1]
87
+ gateway = Gateway.from_wire_parser(gateway_type, parser, origin)
88
+ key = parser.get_remaining()
89
+ return cls(
90
+ rdclass, rdtype, header[0], gateway_type, header[2], gateway.gateway, key
91
+ )
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/KX.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 KX(dns.rdtypes.mxbase.UncompressedDowncasingMX):
24
+ """KX record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/NAPTR.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ import dns.rdtypes.util
25
+
26
+
27
+ def _write_string(file, s):
28
+ l = len(s)
29
+ assert l < 256
30
+ file.write(struct.pack("!B", l))
31
+ file.write(s)
32
+
33
+
34
+ @dns.immutable.immutable
35
+ class NAPTR(dns.rdata.Rdata):
36
+ """NAPTR record"""
37
+
38
+ # see: RFC 3403
39
+
40
+ __slots__ = ["order", "preference", "flags", "service", "regexp", "replacement"]
41
+
42
+ def __init__(
43
+ self, rdclass, rdtype, order, preference, flags, service, regexp, replacement
44
+ ):
45
+ super().__init__(rdclass, rdtype)
46
+ self.flags = self._as_bytes(flags, True, 255)
47
+ self.service = self._as_bytes(service, True, 255)
48
+ self.regexp = self._as_bytes(regexp, True, 255)
49
+ self.order = self._as_uint16(order)
50
+ self.preference = self._as_uint16(preference)
51
+ self.replacement = self._as_name(replacement)
52
+
53
+ def to_text(self, origin=None, relativize=True, **kw):
54
+ replacement = self.replacement.choose_relativity(origin, relativize)
55
+ return '%d %d "%s" "%s" "%s" %s' % (
56
+ self.order,
57
+ self.preference,
58
+ dns.rdata._escapify(self.flags),
59
+ dns.rdata._escapify(self.service),
60
+ dns.rdata._escapify(self.regexp),
61
+ replacement,
62
+ )
63
+
64
+ @classmethod
65
+ def from_text(
66
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
67
+ ):
68
+ order = tok.get_uint16()
69
+ preference = tok.get_uint16()
70
+ flags = tok.get_string()
71
+ service = tok.get_string()
72
+ regexp = tok.get_string()
73
+ replacement = tok.get_name(origin, relativize, relativize_to)
74
+ return cls(
75
+ rdclass, rdtype, order, preference, flags, service, regexp, replacement
76
+ )
77
+
78
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
79
+ two_ints = struct.pack("!HH", self.order, self.preference)
80
+ file.write(two_ints)
81
+ _write_string(file, self.flags)
82
+ _write_string(file, self.service)
83
+ _write_string(file, self.regexp)
84
+ self.replacement.to_wire(file, compress, origin, canonicalize)
85
+
86
+ @classmethod
87
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
88
+ (order, preference) = parser.get_struct("!HH")
89
+ strings = []
90
+ for _ in range(3):
91
+ s = parser.get_counted_bytes()
92
+ strings.append(s)
93
+ replacement = parser.get_name(origin)
94
+ return cls(
95
+ rdclass,
96
+ rdtype,
97
+ order,
98
+ preference,
99
+ strings[0],
100
+ strings[1],
101
+ strings[2],
102
+ replacement,
103
+ )
104
+
105
+ def _processing_priority(self):
106
+ return (self.order, self.preference)
107
+
108
+ @classmethod
109
+ def _processing_order(cls, iterable):
110
+ return dns.rdtypes.util.priority_processing_order(iterable)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/NSAP.py ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 binascii
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 NSAP(dns.rdata.Rdata):
28
+ """NSAP record."""
29
+
30
+ # see: RFC 1706
31
+
32
+ __slots__ = ["address"]
33
+
34
+ def __init__(self, rdclass, rdtype, address):
35
+ super().__init__(rdclass, rdtype)
36
+ self.address = self._as_bytes(address)
37
+
38
+ def to_text(self, origin=None, relativize=True, **kw):
39
+ return f"0x{binascii.hexlify(self.address).decode()}"
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
+ if address[0:2] != "0x":
47
+ raise dns.exception.SyntaxError("string does not start with 0x")
48
+ address = address[2:].replace(".", "")
49
+ if len(address) % 2 != 0:
50
+ raise dns.exception.SyntaxError("hexstring has odd length")
51
+ address = binascii.unhexlify(address.encode())
52
+ return cls(rdclass, rdtype, address)
53
+
54
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
55
+ file.write(self.address)
56
+
57
+ @classmethod
58
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
59
+ address = parser.get_remaining()
60
+ return cls(rdclass, rdtype, address)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/NSAP_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 NSAP_PTR(dns.rdtypes.nsbase.UncompressedNS):
24
+ """NSAP-PTR record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/PX.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ import dns.rdtypes.util
25
+
26
+
27
+ @dns.immutable.immutable
28
+ class PX(dns.rdata.Rdata):
29
+ """PX record."""
30
+
31
+ # see: RFC 2163
32
+
33
+ __slots__ = ["preference", "map822", "mapx400"]
34
+
35
+ def __init__(self, rdclass, rdtype, preference, map822, mapx400):
36
+ super().__init__(rdclass, rdtype)
37
+ self.preference = self._as_uint16(preference)
38
+ self.map822 = self._as_name(map822)
39
+ self.mapx400 = self._as_name(mapx400)
40
+
41
+ def to_text(self, origin=None, relativize=True, **kw):
42
+ map822 = self.map822.choose_relativity(origin, relativize)
43
+ mapx400 = self.mapx400.choose_relativity(origin, relativize)
44
+ return "%d %s %s" % (self.preference, map822, mapx400)
45
+
46
+ @classmethod
47
+ def from_text(
48
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
49
+ ):
50
+ preference = tok.get_uint16()
51
+ map822 = tok.get_name(origin, relativize, relativize_to)
52
+ mapx400 = tok.get_name(origin, relativize, relativize_to)
53
+ return cls(rdclass, rdtype, preference, map822, mapx400)
54
+
55
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
56
+ pref = struct.pack("!H", self.preference)
57
+ file.write(pref)
58
+ self.map822.to_wire(file, None, origin, canonicalize)
59
+ self.mapx400.to_wire(file, None, origin, canonicalize)
60
+
61
+ @classmethod
62
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
63
+ preference = parser.get_uint16()
64
+ map822 = parser.get_name(origin)
65
+ mapx400 = parser.get_name(origin)
66
+ return cls(rdclass, rdtype, preference, map822, mapx400)
67
+
68
+ def _processing_priority(self):
69
+ return self.preference
70
+
71
+ @classmethod
72
+ def _processing_order(cls, iterable):
73
+ return dns.rdtypes.util.priority_processing_order(iterable)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/SRV.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ import dns.rdtypes.util
25
+
26
+
27
+ @dns.immutable.immutable
28
+ class SRV(dns.rdata.Rdata):
29
+ """SRV record"""
30
+
31
+ # see: RFC 2782
32
+
33
+ __slots__ = ["priority", "weight", "port", "target"]
34
+
35
+ def __init__(self, rdclass, rdtype, priority, weight, port, target):
36
+ super().__init__(rdclass, rdtype)
37
+ self.priority = self._as_uint16(priority)
38
+ self.weight = self._as_uint16(weight)
39
+ self.port = self._as_uint16(port)
40
+ self.target = self._as_name(target)
41
+
42
+ def to_text(self, origin=None, relativize=True, **kw):
43
+ target = self.target.choose_relativity(origin, relativize)
44
+ return "%d %d %d %s" % (self.priority, self.weight, self.port, target)
45
+
46
+ @classmethod
47
+ def from_text(
48
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
49
+ ):
50
+ priority = tok.get_uint16()
51
+ weight = tok.get_uint16()
52
+ port = tok.get_uint16()
53
+ target = tok.get_name(origin, relativize, relativize_to)
54
+ return cls(rdclass, rdtype, priority, weight, port, target)
55
+
56
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
57
+ three_ints = struct.pack("!HHH", self.priority, self.weight, self.port)
58
+ file.write(three_ints)
59
+ self.target.to_wire(file, compress, origin, canonicalize)
60
+
61
+ @classmethod
62
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
63
+ (priority, weight, port) = parser.get_struct("!HHH")
64
+ target = parser.get_name(origin)
65
+ return cls(rdclass, rdtype, priority, weight, port, target)
66
+
67
+ def _processing_priority(self):
68
+ return self.priority
69
+
70
+ def _processing_weight(self):
71
+ return self.weight
72
+
73
+ @classmethod
74
+ def _processing_order(cls, iterable):
75
+ return dns.rdtypes.util.weighted_processing_order(iterable)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/SVCB.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.svcbbase
5
+
6
+
7
+ @dns.immutable.immutable
8
+ class SVCB(dns.rdtypes.svcbbase.SVCBBase):
9
+ """SVCB record"""
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/WKS.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 socket
19
+ import struct
20
+
21
+ import dns.immutable
22
+ import dns.ipv4
23
+ import dns.rdata
24
+
25
+ try:
26
+ _proto_tcp = socket.getprotobyname("tcp")
27
+ _proto_udp = socket.getprotobyname("udp")
28
+ except OSError:
29
+ # Fall back to defaults in case /etc/protocols is unavailable.
30
+ _proto_tcp = 6
31
+ _proto_udp = 17
32
+
33
+
34
+ @dns.immutable.immutable
35
+ class WKS(dns.rdata.Rdata):
36
+ """WKS record"""
37
+
38
+ # see: RFC 1035
39
+
40
+ __slots__ = ["address", "protocol", "bitmap"]
41
+
42
+ def __init__(self, rdclass, rdtype, address, protocol, bitmap):
43
+ super().__init__(rdclass, rdtype)
44
+ self.address = self._as_ipv4_address(address)
45
+ self.protocol = self._as_uint8(protocol)
46
+ self.bitmap = self._as_bytes(bitmap)
47
+
48
+ def to_text(self, origin=None, relativize=True, **kw):
49
+ bits = []
50
+ for i, byte in enumerate(self.bitmap):
51
+ for j in range(0, 8):
52
+ if byte & (0x80 >> j):
53
+ bits.append(str(i * 8 + j))
54
+ text = " ".join(bits)
55
+ return "%s %d %s" % (self.address, self.protocol, text)
56
+
57
+ @classmethod
58
+ def from_text(
59
+ cls, rdclass, rdtype, tok, origin=None, relativize=True, relativize_to=None
60
+ ):
61
+ address = tok.get_string()
62
+ protocol = tok.get_string()
63
+ if protocol.isdigit():
64
+ protocol = int(protocol)
65
+ else:
66
+ protocol = socket.getprotobyname(protocol)
67
+ bitmap = bytearray()
68
+ for token in tok.get_remaining():
69
+ value = token.unescape().value
70
+ if value.isdigit():
71
+ serv = int(value)
72
+ else:
73
+ if protocol != _proto_udp and protocol != _proto_tcp:
74
+ raise NotImplementedError("protocol must be TCP or UDP")
75
+ if protocol == _proto_udp:
76
+ protocol_text = "udp"
77
+ else:
78
+ protocol_text = "tcp"
79
+ serv = socket.getservbyname(value, protocol_text)
80
+ i = serv // 8
81
+ l = len(bitmap)
82
+ if l < i + 1:
83
+ for _ in range(l, i + 1):
84
+ bitmap.append(0)
85
+ bitmap[i] = bitmap[i] | (0x80 >> (serv % 8))
86
+ bitmap = dns.rdata._truncate_bitmap(bitmap)
87
+ return cls(rdclass, rdtype, address, protocol, bitmap)
88
+
89
+ def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
90
+ file.write(dns.ipv4.inet_aton(self.address))
91
+ protocol = struct.pack("!B", self.protocol)
92
+ file.write(protocol)
93
+ file.write(self.bitmap)
94
+
95
+ @classmethod
96
+ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
97
+ address = parser.get_bytes(4)
98
+ protocol = parser.get_uint8()
99
+ bitmap = parser.get_remaining()
100
+ return cls(rdclass, rdtype, address, protocol, bitmap)
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/IN/__init__.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 IN rdata type classes."""
19
+
20
+ __all__ = [
21
+ "A",
22
+ "AAAA",
23
+ "APL",
24
+ "DHCID",
25
+ "HTTPS",
26
+ "IPSECKEY",
27
+ "KX",
28
+ "NAPTR",
29
+ "NSAP",
30
+ "NSAP_PTR",
31
+ "PX",
32
+ "SRV",
33
+ "SVCB",
34
+ "WKS",
35
+ ]
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/__init__.cpython-312.pyc ADDED
Binary file (339 Bytes). View file
 
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/dnskeybase.cpython-312.pyc ADDED
Binary file (3.86 kB). View file
 
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/dsbase.cpython-312.pyc ADDED
Binary file (4.16 kB). View file
 
tool_server/.venv/lib/python3.12/site-packages/dns/rdtypes/__pycache__/euibase.cpython-312.pyc ADDED
Binary file (3.54 kB). View file