/
usr
/
lib
/
python3.9
/
site-packages
/
dns
/
/usr/lib/python3.9/site-packages/dns
mkdir
upload
Name
Size
Mode
Actions
dnssecalgs/
-
0755
rm
quic/
-
0755
rm
rdtypes/
-
0755
rm
__pycache__/
-
0755
rm
asyncbackend.py
2796
0644
edit
dl
rm
asyncquery.py
26850
0644
edit
dl
rm
asyncresolver.py
17852
0644
edit
dl
rm
dnssec.py
40693
0644
edit
dl
rm
dnssectypes.py
1799
0644
edit
dl
rm
e164.py
3978
0644
edit
dl
rm
edns.py
15263
0644
edit
dl
rm
entropy.py
4242
0644
edit
dl
rm
enum.py
3691
0644
edit
dl
rm
exception.py
5957
0644
edit
dl
rm
flags.py
2750
0644
edit
dl
rm
grange.py
2148
0644
edit
dl
rm
immutable.py
2017
0644
edit
dl
rm
inet.py
5772
0644
edit
dl
rm
ipv4.py
2552
0644
edit
dl
rm
ipv6.py
6600
0644
edit
dl
rm
message.py
65993
0644
edit
dl
rm
name.py
42672
0644
edit
dl
rm
namedict.py
4000
0644
edit
dl
rm
nameserver.py
9909
0644
edit
dl
rm
node.py
12663
0644
edit
dl
rm
opcode.py
2730
0644
edit
dl
rm
query.py
54832
0644
edit
dl
rm
rcode.py
4156
0644
edit
dl
rm
rdata.py
29456
0644
edit
dl
rm
rdataclass.py
2984
0644
edit
dl
rm
rdataset.py
16756
0644
edit
dl
rm
rdatatype.py
7339
0644
edit
dl
rm
renderer.py
11254
0644
edit
dl
rm
resolver.py
73552
0644
edit
dl
rm
reversename.py
3828
0644
edit
dl
rm
rrset.py
9170
0644
edit
dl
rm
serial.py
3606
0644
edit
dl
rm
set.py
9088
0644
edit
dl
rm
tokenizer.py
23583
0644
edit
dl
rm
transaction.py
22636
0644
edit
dl
rm
tsig.py
11413
0644
edit
dl
rm
tsigkeyring.py
2633
0644
edit
dl
rm
ttl.py
2979
0644
edit
dl
rm
update.py
12243
0644
edit
dl
rm
version.py
1926
0644
edit
dl
rm
versioned.py
11765
0644
edit
dl
rm
win32util.py
9107
0644
edit
dl
rm
wire.py
2830
0644
edit
dl
rm
xfr.py
13273
0644
edit
dl
rm
zone.py
52086
0644
edit
dl
rm
zonefile.py
27929
0644
edit
dl
rm
zonetypes.py
690
0644
edit
dl
rm
_asyncbackend.py
2360
0644
edit
dl
rm
_asyncio_backend.py
8971
0644
edit
dl
rm
_ddr.py
5247
0644
edit
dl
rm
_features.py
2384
0644
edit
dl
rm
_immutable_ctx.py
2459
0644
edit
dl
rm
__init__.py
1663
0644
edit
dl
rm
Edit:
/usr/lib/python3.9/site-packages/dns/rdatatype.py
(7339B)
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2001-2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """DNS Rdata Types.""" from typing import Dict import dns.enum import dns.exception class RdataType(dns.enum.IntEnum): """DNS Rdata Type""" TYPE0 = 0 NONE = 0 A = 1 NS = 2 MD = 3 MF = 4 CNAME = 5 SOA = 6 MB = 7 MG = 8 MR = 9 NULL = 10 WKS = 11 PTR = 12 HINFO = 13 MINFO = 14 MX = 15 TXT = 16 RP = 17 AFSDB = 18 X25 = 19 ISDN = 20 RT = 21 NSAP = 22 NSAP_PTR = 23 SIG = 24 KEY = 25 PX = 26 GPOS = 27 AAAA = 28 LOC = 29 NXT = 30 SRV = 33 NAPTR = 35 KX = 36 CERT = 37 A6 = 38 DNAME = 39 OPT = 41 APL = 42 DS = 43 SSHFP = 44 IPSECKEY = 45 RRSIG = 46 NSEC = 47 DNSKEY = 48 DHCID = 49 NSEC3 = 50 NSEC3PARAM = 51 TLSA = 52 SMIMEA = 53 HIP = 55 NINFO = 56 CDS = 59 CDNSKEY = 60 OPENPGPKEY = 61 CSYNC = 62 ZONEMD = 63 SVCB = 64 HTTPS = 65 SPF = 99 UNSPEC = 103 NID = 104 L32 = 105 L64 = 106 LP = 107 EUI48 = 108 EUI64 = 109 TKEY = 249 TSIG = 250 IXFR = 251 AXFR = 252 MAILB = 253 MAILA = 254 ANY = 255 URI = 256 CAA = 257 AVC = 258 AMTRELAY = 260 TA = 32768 DLV = 32769 @classmethod def _maximum(cls): return 65535 @classmethod def _short_name(cls): return "type" @classmethod def _prefix(cls): return "TYPE" @classmethod def _extra_from_text(cls, text): if text.find("-") >= 0: try: return cls[text.replace("-", "_")] except KeyError: pass return _registered_by_text.get(text) @classmethod def _extra_to_text(cls, value, current_text): if current_text is None: return _registered_by_value.get(value) if current_text.find("_") >= 0: return current_text.replace("_", "-") return current_text @classmethod def _unknown_exception_class(cls): return UnknownRdatatype _registered_by_text: Dict[str, RdataType] = {} _registered_by_value: Dict[RdataType, str] = {} _metatypes = {RdataType.OPT} _singletons = { RdataType.SOA, RdataType.NXT, RdataType.DNAME, RdataType.NSEC, RdataType.CNAME, } class UnknownRdatatype(dns.exception.DNSException): """DNS resource record type is unknown.""" def from_text(text: str) -> RdataType: """Convert text into a DNS rdata type value. The input text can be a defined DNS RR type mnemonic or instance of the DNS generic type syntax. For example, "NS" and "TYPE2" will both result in a value of 2. Raises ``dns.rdatatype.UnknownRdatatype`` if the type is unknown. Raises ``ValueError`` if the rdata type value is not >= 0 and <= 65535. Returns a ``dns.rdatatype.RdataType``. """ return RdataType.from_text(text) def to_text(value: RdataType) -> str: """Convert a DNS rdata type value to text. If the value has a known mnemonic, it will be used, otherwise the DNS generic type syntax will be used. Raises ``ValueError`` if the rdata type value is not >= 0 and <= 65535. Returns a ``str``. """ return RdataType.to_text(value) def is_metatype(rdtype: RdataType) -> bool: """True if the specified type is a metatype. *rdtype* is a ``dns.rdatatype.RdataType``. The currently defined metatypes are TKEY, TSIG, IXFR, AXFR, MAILA, MAILB, ANY, and OPT. Returns a ``bool``. """ return (256 > rdtype >= 128) or rdtype in _metatypes def is_singleton(rdtype: RdataType) -> bool: """Is the specified type a singleton type? Singleton types can only have a single rdata in an rdataset, or a single RR in an RRset. The currently defined singleton types are CNAME, DNAME, NSEC, NXT, and SOA. *rdtype* is an ``int``. Returns a ``bool``. """ if rdtype in _singletons: return True return False # pylint: disable=redefined-outer-name def register_type( rdtype: RdataType, rdtype_text: str, is_singleton: bool = False ) -> None: """Dynamically register an rdatatype. *rdtype*, a ``dns.rdatatype.RdataType``, the rdatatype to register. *rdtype_text*, a ``str``, the textual form of the rdatatype. *is_singleton*, a ``bool``, indicating if the type is a singleton (i.e. RRsets of the type can have only one member.) """ _registered_by_text[rdtype_text] = rdtype _registered_by_value[rdtype] = rdtype_text if is_singleton: _singletons.add(rdtype) ### BEGIN generated RdataType constants TYPE0 = RdataType.TYPE0 NONE = RdataType.NONE A = RdataType.A NS = RdataType.NS MD = RdataType.MD MF = RdataType.MF CNAME = RdataType.CNAME SOA = RdataType.SOA MB = RdataType.MB MG = RdataType.MG MR = RdataType.MR NULL = RdataType.NULL WKS = RdataType.WKS PTR = RdataType.PTR HINFO = RdataType.HINFO MINFO = RdataType.MINFO MX = RdataType.MX TXT = RdataType.TXT RP = RdataType.RP AFSDB = RdataType.AFSDB X25 = RdataType.X25 ISDN = RdataType.ISDN RT = RdataType.RT NSAP = RdataType.NSAP NSAP_PTR = RdataType.NSAP_PTR SIG = RdataType.SIG KEY = RdataType.KEY PX = RdataType.PX GPOS = RdataType.GPOS AAAA = RdataType.AAAA LOC = RdataType.LOC NXT = RdataType.NXT SRV = RdataType.SRV NAPTR = RdataType.NAPTR KX = RdataType.KX CERT = RdataType.CERT A6 = RdataType.A6 DNAME = RdataType.DNAME OPT = RdataType.OPT APL = RdataType.APL DS = RdataType.DS SSHFP = RdataType.SSHFP IPSECKEY = RdataType.IPSECKEY RRSIG = RdataType.RRSIG NSEC = RdataType.NSEC DNSKEY = RdataType.DNSKEY DHCID = RdataType.DHCID NSEC3 = RdataType.NSEC3 NSEC3PARAM = RdataType.NSEC3PARAM TLSA = RdataType.TLSA SMIMEA = RdataType.SMIMEA HIP = RdataType.HIP NINFO = RdataType.NINFO CDS = RdataType.CDS CDNSKEY = RdataType.CDNSKEY OPENPGPKEY = RdataType.OPENPGPKEY CSYNC = RdataType.CSYNC ZONEMD = RdataType.ZONEMD SVCB = RdataType.SVCB HTTPS = RdataType.HTTPS SPF = RdataType.SPF UNSPEC = RdataType.UNSPEC NID = RdataType.NID L32 = RdataType.L32 L64 = RdataType.L64 LP = RdataType.LP EUI48 = RdataType.EUI48 EUI64 = RdataType.EUI64 TKEY = RdataType.TKEY TSIG = RdataType.TSIG IXFR = RdataType.IXFR AXFR = RdataType.AXFR MAILB = RdataType.MAILB MAILA = RdataType.MAILA ANY = RdataType.ANY URI = RdataType.URI CAA = RdataType.CAA AVC = RdataType.AVC AMTRELAY = RdataType.AMTRELAY TA = RdataType.TA DLV = RdataType.DLV ### END generated RdataType constants
Save
cmd:
run