mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-20 05:13:21 -07:00
Bump dnspython from 2.4.2 to 2.6.1 (#2264)
* Bump dnspython from 2.4.2 to 2.6.1 Bumps [dnspython](https://github.com/rthalley/dnspython) from 2.4.2 to 2.6.1. - [Release notes](https://github.com/rthalley/dnspython/releases) - [Changelog](https://github.com/rthalley/dnspython/blob/main/doc/whatsnew.rst) - [Commits](https://github.com/rthalley/dnspython/compare/v2.4.2...v2.6.1) --- updated-dependencies: - dependency-name: dnspython dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update dnspython==2.6.1 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
aca7e72715
commit
cfefa928be
101 changed files with 1052 additions and 459 deletions
|
@ -21,7 +21,6 @@ import dns.rdtypes.mxbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class AFSDB(dns.rdtypes.mxbase.UncompressedDowncasingMX):
|
||||
|
||||
"""AFSDB record"""
|
||||
|
||||
# Use the property mechanism to make "subtype" an alias for the
|
||||
|
|
|
@ -32,7 +32,6 @@ class Relay(dns.rdtypes.util.Gateway):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class AMTRELAY(dns.rdata.Rdata):
|
||||
|
||||
"""AMTRELAY record"""
|
||||
|
||||
# see: RFC 8777
|
||||
|
|
|
@ -21,7 +21,6 @@ import dns.rdtypes.txtbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class AVC(dns.rdtypes.txtbase.TXTBase):
|
||||
|
||||
"""AVC record"""
|
||||
|
||||
# See: IANA dns parameters for AVC
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class CAA(dns.rdata.Rdata):
|
||||
|
||||
"""CAA (Certification Authority Authorization) record"""
|
||||
|
||||
# see: RFC 6844
|
||||
|
|
|
@ -30,5 +30,4 @@ from dns.rdtypes.dnskeybase import ( # noqa: F401 lgtm[py/unused-import]
|
|||
|
||||
@dns.immutable.immutable
|
||||
class CDNSKEY(dns.rdtypes.dnskeybase.DNSKEYBase):
|
||||
|
||||
"""CDNSKEY record"""
|
||||
|
|
|
@ -21,7 +21,6 @@ import dns.rdtypes.dsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class CDS(dns.rdtypes.dsbase.DSBase):
|
||||
|
||||
"""CDS record"""
|
||||
|
||||
_digest_length_by_type = {
|
||||
|
|
|
@ -67,7 +67,6 @@ def _ctype_to_text(what):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class CERT(dns.rdata.Rdata):
|
||||
|
||||
"""CERT record"""
|
||||
|
||||
# see RFC 4398
|
||||
|
|
|
@ -21,7 +21,6 @@ import dns.rdtypes.nsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class CNAME(dns.rdtypes.nsbase.NSBase):
|
||||
|
||||
"""CNAME record
|
||||
|
||||
Note: although CNAME is officially a singleton type, dnspython allows
|
||||
|
|
|
@ -32,7 +32,6 @@ class Bitmap(dns.rdtypes.util.Bitmap):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class CSYNC(dns.rdata.Rdata):
|
||||
|
||||
"""CSYNC record"""
|
||||
|
||||
__slots__ = ["serial", "flags", "windows"]
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.dsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class DLV(dns.rdtypes.dsbase.DSBase):
|
||||
|
||||
"""DLV record"""
|
||||
|
|
|
@ -21,7 +21,6 @@ import dns.rdtypes.nsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class DNAME(dns.rdtypes.nsbase.UncompressedNS):
|
||||
|
||||
"""DNAME record"""
|
||||
|
||||
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
||||
|
|
|
@ -30,5 +30,4 @@ from dns.rdtypes.dnskeybase import ( # noqa: F401 lgtm[py/unused-import]
|
|||
|
||||
@dns.immutable.immutable
|
||||
class DNSKEY(dns.rdtypes.dnskeybase.DNSKEYBase):
|
||||
|
||||
"""DNSKEY record"""
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.dsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class DS(dns.rdtypes.dsbase.DSBase):
|
||||
|
||||
"""DS record"""
|
||||
|
|
|
@ -22,7 +22,6 @@ import dns.rdtypes.euibase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class EUI48(dns.rdtypes.euibase.EUIBase):
|
||||
|
||||
"""EUI48 record"""
|
||||
|
||||
# see: rfc7043.txt
|
||||
|
|
|
@ -22,7 +22,6 @@ import dns.rdtypes.euibase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class EUI64(dns.rdtypes.euibase.EUIBase):
|
||||
|
||||
"""EUI64 record"""
|
||||
|
||||
# see: rfc7043.txt
|
||||
|
|
|
@ -44,7 +44,6 @@ def _validate_float_string(what):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class GPOS(dns.rdata.Rdata):
|
||||
|
||||
"""GPOS record"""
|
||||
|
||||
# see: RFC 1712
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class HINFO(dns.rdata.Rdata):
|
||||
|
||||
"""HINFO record"""
|
||||
|
||||
# see: RFC 1035
|
||||
|
|
|
@ -27,7 +27,6 @@ import dns.rdatatype
|
|||
|
||||
@dns.immutable.immutable
|
||||
class HIP(dns.rdata.Rdata):
|
||||
|
||||
"""HIP record"""
|
||||
|
||||
# see: RFC 5205
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class ISDN(dns.rdata.Rdata):
|
||||
|
||||
"""ISDN record"""
|
||||
|
||||
# see: RFC 1183
|
||||
|
|
|
@ -8,7 +8,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class L32(dns.rdata.Rdata):
|
||||
|
||||
"""L32 record"""
|
||||
|
||||
# see: rfc6742.txt
|
||||
|
|
|
@ -8,7 +8,6 @@ import dns.rdtypes.util
|
|||
|
||||
@dns.immutable.immutable
|
||||
class L64(dns.rdata.Rdata):
|
||||
|
||||
"""L64 record"""
|
||||
|
||||
# see: rfc6742.txt
|
||||
|
|
|
@ -105,7 +105,6 @@ def _check_coordinate_list(value, low, high):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class LOC(dns.rdata.Rdata):
|
||||
|
||||
"""LOC record"""
|
||||
|
||||
# see: RFC 1876
|
||||
|
|
|
@ -8,7 +8,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class LP(dns.rdata.Rdata):
|
||||
|
||||
"""LP record"""
|
||||
|
||||
# see: rfc6742.txt
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.mxbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class MX(dns.rdtypes.mxbase.MXBase):
|
||||
|
||||
"""MX record"""
|
||||
|
|
|
@ -8,7 +8,6 @@ import dns.rdtypes.util
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NID(dns.rdata.Rdata):
|
||||
|
||||
"""NID record"""
|
||||
|
||||
# see: rfc6742.txt
|
||||
|
|
|
@ -21,7 +21,6 @@ import dns.rdtypes.txtbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NINFO(dns.rdtypes.txtbase.TXTBase):
|
||||
|
||||
"""NINFO record"""
|
||||
|
||||
# see: draft-reid-dnsext-zs-01
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.nsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NS(dns.rdtypes.nsbase.NSBase):
|
||||
|
||||
"""NS record"""
|
||||
|
|
|
@ -30,7 +30,6 @@ class Bitmap(dns.rdtypes.util.Bitmap):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NSEC(dns.rdata.Rdata):
|
||||
|
||||
"""NSEC record"""
|
||||
|
||||
__slots__ = ["next", "windows"]
|
||||
|
|
|
@ -46,7 +46,6 @@ class Bitmap(dns.rdtypes.util.Bitmap):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NSEC3(dns.rdata.Rdata):
|
||||
|
||||
"""NSEC3 record"""
|
||||
|
||||
__slots__ = ["algorithm", "flags", "iterations", "salt", "next", "windows"]
|
||||
|
@ -64,9 +63,13 @@ class NSEC3(dns.rdata.Rdata):
|
|||
windows = Bitmap(windows)
|
||||
self.windows = tuple(windows.windows)
|
||||
|
||||
def to_text(self, origin=None, relativize=True, **kw):
|
||||
def _next_text(self):
|
||||
next = base64.b32encode(self.next).translate(b32_normal_to_hex).lower().decode()
|
||||
next = next.rstrip("=")
|
||||
return next
|
||||
|
||||
def to_text(self, origin=None, relativize=True, **kw):
|
||||
next = self._next_text()
|
||||
if self.salt == b"":
|
||||
salt = "-"
|
||||
else:
|
||||
|
@ -118,3 +121,6 @@ class NSEC3(dns.rdata.Rdata):
|
|||
next = parser.get_counted_bytes()
|
||||
bitmap = Bitmap.from_wire_parser(parser)
|
||||
return cls(rdclass, rdtype, algorithm, flags, iterations, salt, next, bitmap)
|
||||
|
||||
def next_name(self, origin=None):
|
||||
return dns.name.from_text(self._next_text(), origin)
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NSEC3PARAM(dns.rdata.Rdata):
|
||||
|
||||
"""NSEC3PARAM record"""
|
||||
|
||||
__slots__ = ["algorithm", "flags", "iterations", "salt"]
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class OPENPGPKEY(dns.rdata.Rdata):
|
||||
|
||||
"""OPENPGPKEY record"""
|
||||
|
||||
# see: RFC 7929
|
||||
|
|
|
@ -28,7 +28,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class OPT(dns.rdata.Rdata):
|
||||
|
||||
"""OPT record"""
|
||||
|
||||
__slots__ = ["options"]
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.nsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class PTR(dns.rdtypes.nsbase.NSBase):
|
||||
|
||||
"""PTR record"""
|
||||
|
|
|
@ -23,7 +23,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class RP(dns.rdata.Rdata):
|
||||
|
||||
"""RP record"""
|
||||
|
||||
# see: RFC 1183
|
||||
|
|
|
@ -28,7 +28,6 @@ import dns.rdatatype
|
|||
|
||||
|
||||
class BadSigTime(dns.exception.DNSException):
|
||||
|
||||
"""Time in DNS SIG or RRSIG resource record cannot be parsed."""
|
||||
|
||||
|
||||
|
@ -52,7 +51,6 @@ def posixtime_to_sigtime(what):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class RRSIG(dns.rdata.Rdata):
|
||||
|
||||
"""RRSIG record"""
|
||||
|
||||
__slots__ = [
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.mxbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class RT(dns.rdtypes.mxbase.UncompressedDowncasingMX):
|
||||
|
||||
"""RT record"""
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class SOA(dns.rdata.Rdata):
|
||||
|
||||
"""SOA record"""
|
||||
|
||||
# see: RFC 1035
|
||||
|
|
|
@ -21,7 +21,6 @@ import dns.rdtypes.txtbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class SPF(dns.rdtypes.txtbase.TXTBase):
|
||||
|
||||
"""SPF record"""
|
||||
|
||||
# see: RFC 4408
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.rdatatype
|
|||
|
||||
@dns.immutable.immutable
|
||||
class SSHFP(dns.rdata.Rdata):
|
||||
|
||||
"""SSHFP record"""
|
||||
|
||||
# See RFC 4255
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class TKEY(dns.rdata.Rdata):
|
||||
|
||||
"""TKEY Record"""
|
||||
|
||||
__slots__ = [
|
||||
|
|
|
@ -6,5 +6,4 @@ import dns.rdtypes.tlsabase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class TLSA(dns.rdtypes.tlsabase.TLSABase):
|
||||
|
||||
"""TLSA record"""
|
||||
|
|
|
@ -26,7 +26,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class TSIG(dns.rdata.Rdata):
|
||||
|
||||
"""TSIG record"""
|
||||
|
||||
__slots__ = [
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.txtbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class TXT(dns.rdtypes.txtbase.TXTBase):
|
||||
|
||||
"""TXT record"""
|
||||
|
|
|
@ -27,7 +27,6 @@ import dns.rdtypes.util
|
|||
|
||||
@dns.immutable.immutable
|
||||
class URI(dns.rdata.Rdata):
|
||||
|
||||
"""URI record"""
|
||||
|
||||
# see RFC 7553
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class X25(dns.rdata.Rdata):
|
||||
|
||||
"""X25 record"""
|
||||
|
||||
# see RFC 1183
|
||||
|
|
|
@ -11,7 +11,6 @@ import dns.zonetypes
|
|||
|
||||
@dns.immutable.immutable
|
||||
class ZONEMD(dns.rdata.Rdata):
|
||||
|
||||
"""ZONEMD record"""
|
||||
|
||||
# See RFC 8976
|
||||
|
|
|
@ -23,7 +23,6 @@ import dns.rdtypes.mxbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class A(dns.rdata.Rdata):
|
||||
|
||||
"""A record for Chaosnet"""
|
||||
|
||||
# domain: the domain of the address
|
||||
|
|
|
@ -24,7 +24,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class A(dns.rdata.Rdata):
|
||||
|
||||
"""A record."""
|
||||
|
||||
__slots__ = ["address"]
|
||||
|
|
|
@ -24,7 +24,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class AAAA(dns.rdata.Rdata):
|
||||
|
||||
"""AAAA record."""
|
||||
|
||||
__slots__ = ["address"]
|
||||
|
|
|
@ -29,7 +29,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class APLItem:
|
||||
|
||||
"""An APL list item."""
|
||||
|
||||
__slots__ = ["family", "negation", "address", "prefix"]
|
||||
|
@ -80,7 +79,6 @@ class APLItem:
|
|||
|
||||
@dns.immutable.immutable
|
||||
class APL(dns.rdata.Rdata):
|
||||
|
||||
"""APL record."""
|
||||
|
||||
# see: RFC 3123
|
||||
|
|
|
@ -24,7 +24,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class DHCID(dns.rdata.Rdata):
|
||||
|
||||
"""DHCID record"""
|
||||
|
||||
# see: RFC 4701
|
||||
|
|
|
@ -29,7 +29,6 @@ class Gateway(dns.rdtypes.util.Gateway):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class IPSECKEY(dns.rdata.Rdata):
|
||||
|
||||
"""IPSECKEY record"""
|
||||
|
||||
# see: RFC 4025
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.mxbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class KX(dns.rdtypes.mxbase.UncompressedDowncasingMX):
|
||||
|
||||
"""KX record"""
|
||||
|
|
|
@ -33,7 +33,6 @@ def _write_string(file, s):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NAPTR(dns.rdata.Rdata):
|
||||
|
||||
"""NAPTR record"""
|
||||
|
||||
# see: RFC 3403
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.tokenizer
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NSAP(dns.rdata.Rdata):
|
||||
|
||||
"""NSAP record."""
|
||||
|
||||
# see: RFC 1706
|
||||
|
|
|
@ -21,5 +21,4 @@ import dns.rdtypes.nsbase
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NSAP_PTR(dns.rdtypes.nsbase.UncompressedNS):
|
||||
|
||||
"""NSAP-PTR record"""
|
||||
|
|
|
@ -26,7 +26,6 @@ import dns.rdtypes.util
|
|||
|
||||
@dns.immutable.immutable
|
||||
class PX(dns.rdata.Rdata):
|
||||
|
||||
"""PX record."""
|
||||
|
||||
# see: RFC 2163
|
||||
|
|
|
@ -26,7 +26,6 @@ import dns.rdtypes.util
|
|||
|
||||
@dns.immutable.immutable
|
||||
class SRV(dns.rdata.Rdata):
|
||||
|
||||
"""SRV record"""
|
||||
|
||||
# see: RFC 2782
|
||||
|
|
|
@ -33,7 +33,6 @@ except OSError:
|
|||
|
||||
@dns.immutable.immutable
|
||||
class WKS(dns.rdata.Rdata):
|
||||
|
||||
"""WKS record"""
|
||||
|
||||
# see: RFC 1035
|
||||
|
|
|
@ -36,7 +36,6 @@ class Flag(enum.IntFlag):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class DNSKEYBase(dns.rdata.Rdata):
|
||||
|
||||
"""Base class for rdata that is like a DNSKEY record"""
|
||||
|
||||
__slots__ = ["flags", "protocol", "algorithm", "key"]
|
||||
|
|
|
@ -26,7 +26,6 @@ import dns.rdatatype
|
|||
|
||||
@dns.immutable.immutable
|
||||
class DSBase(dns.rdata.Rdata):
|
||||
|
||||
"""Base class for rdata that is like a DS record"""
|
||||
|
||||
__slots__ = ["key_tag", "algorithm", "digest_type", "digest"]
|
||||
|
|
|
@ -22,7 +22,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class EUIBase(dns.rdata.Rdata):
|
||||
|
||||
"""EUIxx record"""
|
||||
|
||||
# see: rfc7043.txt
|
||||
|
|
|
@ -28,7 +28,6 @@ import dns.rdtypes.util
|
|||
|
||||
@dns.immutable.immutable
|
||||
class MXBase(dns.rdata.Rdata):
|
||||
|
||||
"""Base class for rdata that is like an MX record."""
|
||||
|
||||
__slots__ = ["preference", "exchange"]
|
||||
|
@ -71,7 +70,6 @@ class MXBase(dns.rdata.Rdata):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class UncompressedMX(MXBase):
|
||||
|
||||
"""Base class for rdata that is like an MX record, but whose name
|
||||
is not compressed when converted to DNS wire format, and whose
|
||||
digestable form is not downcased."""
|
||||
|
@ -82,7 +80,6 @@ class UncompressedMX(MXBase):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class UncompressedDowncasingMX(MXBase):
|
||||
|
||||
"""Base class for rdata that is like an MX record, but whose name
|
||||
is not compressed when convert to DNS wire format."""
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.rdata
|
|||
|
||||
@dns.immutable.immutable
|
||||
class NSBase(dns.rdata.Rdata):
|
||||
|
||||
"""Base class for rdata that is like an NS record."""
|
||||
|
||||
__slots__ = ["target"]
|
||||
|
@ -56,7 +55,6 @@ class NSBase(dns.rdata.Rdata):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class UncompressedNS(NSBase):
|
||||
|
||||
"""Base class for rdata that is like an NS record, but whose name
|
||||
is not compressed when convert to DNS wire format, and whose
|
||||
digestable form is not downcased."""
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import base64
|
||||
import enum
|
||||
import io
|
||||
import struct
|
||||
|
||||
import dns.enum
|
||||
|
@ -13,6 +12,7 @@ import dns.ipv6
|
|||
import dns.name
|
||||
import dns.rdata
|
||||
import dns.rdtypes.util
|
||||
import dns.renderer
|
||||
import dns.tokenizer
|
||||
import dns.wire
|
||||
|
||||
|
@ -427,7 +427,6 @@ def _validate_and_define(params, key, value):
|
|||
|
||||
@dns.immutable.immutable
|
||||
class SVCBBase(dns.rdata.Rdata):
|
||||
|
||||
"""Base class for SVCB-like records"""
|
||||
|
||||
# see: draft-ietf-dnsop-svcb-https-11
|
||||
|
@ -521,19 +520,10 @@ class SVCBBase(dns.rdata.Rdata):
|
|||
for key in sorted(self.params):
|
||||
file.write(struct.pack("!H", key))
|
||||
value = self.params[key]
|
||||
# placeholder for length (or actual length of empty values)
|
||||
file.write(struct.pack("!H", 0))
|
||||
if value is None:
|
||||
continue
|
||||
else:
|
||||
start = file.tell()
|
||||
value.to_wire(file, origin)
|
||||
end = file.tell()
|
||||
assert end - start < 65536
|
||||
file.seek(start - 2)
|
||||
stuff = struct.pack("!H", end - start)
|
||||
file.write(stuff)
|
||||
file.seek(0, io.SEEK_END)
|
||||
with dns.renderer.prefixed_length(file, 2):
|
||||
# Note that we're still writing a length of zero if the value is None
|
||||
if value is not None:
|
||||
value.to_wire(file, origin)
|
||||
|
||||
@classmethod
|
||||
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
||||
|
|
|
@ -25,7 +25,6 @@ import dns.rdatatype
|
|||
|
||||
@dns.immutable.immutable
|
||||
class TLSABase(dns.rdata.Rdata):
|
||||
|
||||
"""Base class for TLSA and SMIMEA records"""
|
||||
|
||||
# see: RFC 6698
|
||||
|
|
|
@ -17,18 +17,17 @@
|
|||
|
||||
"""TXT-like base class."""
|
||||
|
||||
import struct
|
||||
from typing import Any, Dict, Iterable, Optional, Tuple, Union
|
||||
|
||||
import dns.exception
|
||||
import dns.immutable
|
||||
import dns.rdata
|
||||
import dns.renderer
|
||||
import dns.tokenizer
|
||||
|
||||
|
||||
@dns.immutable.immutable
|
||||
class TXTBase(dns.rdata.Rdata):
|
||||
|
||||
"""Base class for rdata that is like a TXT record (see RFC 1035)."""
|
||||
|
||||
__slots__ = ["strings"]
|
||||
|
@ -56,7 +55,7 @@ class TXTBase(dns.rdata.Rdata):
|
|||
self,
|
||||
origin: Optional[dns.name.Name] = None,
|
||||
relativize: bool = True,
|
||||
**kw: Dict[str, Any]
|
||||
**kw: Dict[str, Any],
|
||||
) -> str:
|
||||
txt = ""
|
||||
prefix = ""
|
||||
|
@ -93,10 +92,8 @@ class TXTBase(dns.rdata.Rdata):
|
|||
|
||||
def _to_wire(self, file, compress=None, origin=None, canonicalize=False):
|
||||
for s in self.strings:
|
||||
l = len(s)
|
||||
assert l < 256
|
||||
file.write(struct.pack("!B", l))
|
||||
file.write(s)
|
||||
with dns.renderer.prefixed_length(file, 1):
|
||||
file.write(s)
|
||||
|
||||
@classmethod
|
||||
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue