/usr/lib/python3.9/site-packages/dns/__pycache__
NameSizeModeActions
asyncbackend.cpython-39.opt-1.pyc26160644editdlrm
asyncbackend.cpython-39.pyc26160644editdlrm
asyncquery.cpython-39.opt-1.pyc178050644editdlrm
asyncquery.cpython-39.pyc178170644editdlrm
asyncresolver.cpython-39.opt-1.pyc129580644editdlrm
asyncresolver.cpython-39.pyc130020644editdlrm
dnssec.cpython-39.opt-1.pyc321600644editdlrm
dnssec.cpython-39.pyc321880644editdlrm
dnssectypes.cpython-39.opt-1.pyc16160644editdlrm
dnssectypes.cpython-39.pyc16160644editdlrm
e164.cpython-39.opt-1.pyc34520644editdlrm
e164.cpython-39.pyc34520644editdlrm
edns.cpython-39.opt-1.pyc147200644editdlrm
edns.cpython-39.pyc147340644editdlrm
entropy.cpython-39.opt-1.pyc33480644editdlrm
entropy.cpython-39.pyc33480644editdlrm
enum.cpython-39.opt-1.pyc32490644editdlrm
enum.cpython-39.pyc32490644editdlrm
exception.cpython-39.opt-1.pyc55180644editdlrm
exception.cpython-39.pyc57140644editdlrm
flags.cpython-39.opt-1.pyc22080644editdlrm
flags.cpython-39.pyc22080644editdlrm
grange.cpython-39.opt-1.pyc10890644editdlrm
grange.cpython-39.pyc11330644editdlrm
immutable.cpython-39.opt-1.pyc24280644editdlrm
immutable.cpython-39.pyc24280644editdlrm
inet.cpython-39.opt-1.pyc46030644editdlrm
inet.cpython-39.pyc46030644editdlrm
ipv4.cpython-39.opt-1.pyc18440644editdlrm
ipv4.cpython-39.pyc18440644editdlrm
ipv6.cpython-39.opt-1.pyc39380644editdlrm
ipv6.cpython-39.pyc39380644editdlrm
message.cpython-39.opt-1.pyc506310644editdlrm
message.cpython-39.pyc506720644editdlrm
name.cpython-39.opt-1.pyc350740644editdlrm
name.cpython-39.pyc350890644editdlrm
namedict.cpython-39.opt-1.pyc29860644editdlrm
namedict.cpython-39.pyc29860644editdlrm
nameserver.cpython-39.opt-1.pyc89080644editdlrm
nameserver.cpython-39.pyc89080644editdlrm
node.cpython-39.opt-1.pyc116050644editdlrm
node.cpython-39.pyc116050644editdlrm
opcode.cpython-39.opt-1.pyc24750644editdlrm
opcode.cpython-39.pyc24750644editdlrm
query.cpython-39.opt-1.pyc402980644editdlrm
query.cpython-39.pyc403430644editdlrm
rcode.cpython-39.opt-1.pyc32530644editdlrm
rcode.cpython-39.pyc32530644editdlrm
rdata.cpython-39.opt-1.pyc236090644editdlrm
rdata.cpython-39.pyc236090644editdlrm
rdataclass.cpython-39.opt-1.pyc27920644editdlrm
rdataclass.cpython-39.pyc27920644editdlrm
rdataset.cpython-39.opt-1.pyc154370644editdlrm
rdataset.cpython-39.pyc154510644editdlrm
rdatatype.cpython-39.opt-1.pyc66730644editdlrm
rdatatype.cpython-39.pyc66730644editdlrm
renderer.cpython-39.opt-1.pyc98220644editdlrm
renderer.cpython-39.pyc98410644editdlrm
resolver.cpython-39.opt-1.pyc524720644editdlrm
resolver.cpython-39.pyc526250644editdlrm
reversename.cpython-39.opt-1.pyc30550644editdlrm
reversename.cpython-39.pyc30550644editdlrm
rrset.cpython-39.opt-1.pyc78850644editdlrm
rrset.cpython-39.pyc78990644editdlrm
serial.cpython-39.opt-1.pyc29330644editdlrm
serial.cpython-39.pyc29330644editdlrm
set.cpython-39.opt-1.pyc87990644editdlrm
set.cpython-39.pyc87990644editdlrm
tokenizer.cpython-39.opt-1.pyc172420644editdlrm
tokenizer.cpython-39.pyc172560644editdlrm
transaction.cpython-39.opt-1.pyc202610644editdlrm
transaction.cpython-39.pyc202610644editdlrm
tsig.cpython-39.opt-1.pyc103810644editdlrm
tsig.cpython-39.pyc103810644editdlrm
tsigkeyring.cpython-39.opt-1.pyc18350644editdlrm
tsigkeyring.cpython-39.pyc18350644editdlrm
ttl.cpython-39.opt-1.pyc16800644editdlrm
ttl.cpython-39.pyc16800644editdlrm
update.cpython-39.opt-1.pyc88860644editdlrm
update.cpython-39.pyc88860644editdlrm
version.cpython-39.opt-1.pyc5630644editdlrm
version.cpython-39.pyc5630644editdlrm
versioned.cpython-39.opt-1.pyc87230644editdlrm
versioned.cpython-39.pyc87750644editdlrm
win32util.cpython-39.opt-1.pyc56530644editdlrm
win32util.cpython-39.pyc56530644editdlrm
wire.cpython-39.opt-1.pyc33270644editdlrm
wire.cpython-39.pyc33550644editdlrm
xfr.cpython-39.opt-1.pyc77710644editdlrm
xfr.cpython-39.pyc77890644editdlrm
zone.cpython-39.opt-1.pyc452680644editdlrm
zone.cpython-39.pyc454120644editdlrm
zonefile.cpython-39.opt-1.pyc176630644editdlrm
zonefile.cpython-39.pyc176870644editdlrm
zonetypes.cpython-39.opt-1.pyc10230644editdlrm
zonetypes.cpython-39.pyc10230644editdlrm
_asyncbackend.cpython-39.opt-1.pyc42080644editdlrm
_asyncbackend.cpython-39.pyc42080644editdlrm
_asyncio_backend.cpython-39.opt-1.pyc89840644editdlrm
_asyncio_backend.cpython-39.pyc90020644editdlrm
_ddr.cpython-39.opt-1.pyc40710644editdlrm
_ddr.cpython-39.pyc40710644editdlrm
_features.cpython-39.opt-1.pyc23670644editdlrm
_features.cpython-39.pyc23670644editdlrm
_immutable_ctx.cpython-39.opt-1.pyc21590644editdlrm
_immutable_ctx.cpython-39.pyc21590644editdlrm
__init__.cpython-39.opt-1.pyc6670644editdlrm
__init__.cpython-39.pyc6670644editdlrm
Edit: /usr/lib/python3.9/site-packages/dns/__pycache__/zone.cpython-39.pyc (45412B)
a àMÒevËã@s~dZddlZddlZddlZddlZddlmZmZmZm Z m Z m Z m Z m Z mZmZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!m"Z"m#Z#m$Z$Gdd„dej%j&ƒZ'Gdd„de'ƒZ(Gd d „d e'ƒZ)Gd d „d e'ƒZ*Gd d„dej%j&ƒZ+Gdd„dej%j&ƒZ,Gdd„dej%j&ƒZ-Gdd„dej%j&ƒZ.ej/j0e ej/j0e1ej/j0dœdd„Z2Gdd„dej3j4ƒZ5Gdd„dej6j7ƒZ8ej9j9Gdd„de8ƒƒZ:Gdd„dƒZ;Gd d!„d!e;ƒZƒZ>dej?j@d&e5dd'd&dd&f ee eej/j0eAfej?jBe1ee eAe1e1e ej/jCee1eeAfe5d(œ d)d*„ZDdej?j@d&e5dd'd&dd&f eAe eej/j0eAfej?jBe1ee eAe1e1e ej/jCee1eeAfe5d(œ d+d,„ZEdej?j@d&e5dd&d&dd&f ee eej/j0eAfej?jBe1ee eAe1e1e ej/jCee1eeAfe5d-œ d.d/„ZFe5d&d&feee1e1e5d0œd1d2„ZGdS)3z DNS Zones.éN) ÚAnyÚCallableÚIterableÚIteratorÚListÚMutableMappingÚOptionalÚSetÚTupleÚUnion)ÚDigestHashAlgorithmÚ DigestSchemeÚ_digest_hashersc@seZdZdZdS)ÚBadZonezThe DNS zone is malformed.N©Ú__name__Ú __module__Ú __qualname__Ú__doc__©rrú,/usr/lib/python3.9/site-packages/dns/zone.pyr8src@seZdZdZdS)ÚNoSOAz)The DNS zone has no SOA RR at its origin.Nrrrrrr<src@seZdZdZdS)ÚNoNSz+The DNS zone has no NS RRset at its origin.Nrrrrrr@src@seZdZdZdS)Ú UnknownOriginz!The DNS zone's origin is unknown.NrrrrrrDsrc@seZdZdZdS)ÚUnsupportedDigestSchemez(The zone digest's scheme is unsupported.NrrrrrrHsrc@seZdZdZdS)ÚUnsupportedDigestHashAlgorithmz(The zone digest's origin is unsupported.NrrrrrrLsrc@seZdZdZdS)ÚNoDigestz/The DNS zone has no ZONEMD RRset at its origin.NrrrrrrPsrc@seZdZdZdS)ÚDigestVerificationFailurez#The ZONEMD digest failed to verify.NrrrrrrTsr)ÚnameÚoriginÚ relativizeÚreturncCst|durtdƒ‚| ¡r:| |¡s*tdƒ‚|rp| |¡}n6z| |¡}Wntjjyftdƒ‚Yn0|sp|}|S)Nzno zone origin is definedz5name parameter must be a subdomain of the zone originzrelative name too long for zone)ÚKeyErrorÚ is_absoluteZ is_subdomainr Z derelativizeÚdnsrZ NameTooLong)rrr Zabs_namerrrÚ_validate_nameXs  r%c @sêeZdZUdZejjZegejjfe d<e Z ege ej jejjffe d<dZeegdfe d<dZeegdfe d<gd ¢Zejjd feeej jefejjed œd d „Zdd„Zdd„Zeej jefej jdœdd„Zdd„Zdd„Zdd„Zdd„Z dd„Z!dd „Z"d!d"„Z#d#d$„Z$d%d&„Z%dieej jefeejjd(œd)d*„Z&djeej jefeeejjd(œd+d,„Z'eej jefddœd-d.„Z(ej)j*d'feej jefeej)j+efeej)j+efeej,j-d/œd0d1„Z.ej)j*d'feej jefeej)j+efeej)j+efeeej,j-d/œd2d3„Z/ej)j*feej jefeej)j+efeej)j+efdd4œd5d6„Z0eej jefej,j-dd7œd8d9„Z1ej)j*feej jefeej)j+efeej)j+efej2j3d4œd:d;„Z4ej)j*feej jefeej)j+efeej)j+efeej2j3d4œdœd?d@„Z9ej)j6ej)j*feej)j+efeej)j+efe7e8ej je:ej;jœdAdB„Z=dke>eeeeeeddCœdDdE„Z?dleeeeeeedFœdGdH„Z@ddIœdJdK„ZAdmeejBjCejDj6jEjEdLœdMdN„ZFeGjHfeIeGeJdOœdPdQ„ZKeGjHfeIeGejDj6jLjLdOœdRdS„ZMdneejDj6jLjLddTœdUdV„ZNdWdIœdXdY„ZOdoedWdZœd[d\„ZPe8eej jeeej jfdIœd]d^„ZQd_d`„ZRdadb„ZSdcdd„ZTdedf„ZUdgdh„ZVdS)pÚZoneazA DNS zone. A ``Zone`` is a mapping from names to nodes. The zone object may be treated like a Python dictionary, e.g. ``zone[name]`` will retrieve the node associated with that name. The *name* may be a ``dns.name.Name object``, or it may be a string. In either case, if the name is relative it is treated as relative to the origin of the zone. Ú node_factoryÚ map_factoryNÚWritableVersionÚwritable_version_factoryÚImmutableVersionÚimmutable_version_factory)ÚrdclassrÚnodesr T)rr-r cCsf|durFt|tƒr tj |¡}nt|tjjƒs6tdƒ‚| ¡sFtdƒ‚||_||_ |  ¡|_ ||_ dS)aÓInitialize a zone object. *origin* is the origin of the zone. It may be a ``dns.name.Name``, a ``str``, or ``None``. If ``None``, then the zone's origin will be set by the first ``$ORIGIN`` line in a zone file. *rdclass*, an ``int``, the zone's rdata class; the default is class IN. *relativize*, a ``bool``, determine's whether domain names are relativized to the zone's origin. The default is ``True``. Nz2origin parameter must be convertible to a DNS namez)origin parameter must be an absolute name) Ú isinstanceÚstrr$rÚ from_textÚNameÚ ValueErrorr#rr-r(r.r )Úselfrr-r rrrÚ__init__Šs  z Zone.__init__cCs:t|tƒsdS|j|jks2|j|jks2|j|jkr6dSdS)zqTwo zones are equal if they have the same origin, class, and nodes. Returns a ``bool``. FT)r/r&r-rr.©r4ÚotherrrrÚ__eq__¨s  ÿ þ ýz Zone.__eq__cCs | |¡ S)z>Are two zones not equal? Returns a ``bool``. )r8r6rrrÚ__ne__¹sz Zone.__ne__©rr!cCs@t|tƒrtj |d¡}nt|tjjƒs0tdƒ‚t||j|j ƒS)Nz0name parameter must be convertible to a DNS name) r/r0r$rr1r2r"r%rr ©r4rrrrr%Ás  zZone._validate_namecCs| |¡}|j|S©N©r%r.©r4ÚkeyrrrÚ __getitem__Ês zZone.__getitem__cCs| |¡}||j|<dSr<r=)r4r?ÚvaluerrrÚ __setitem__Îs zZone.__setitem__cCs| |¡}|j|=dSr<r=r>rrrÚ __delitem__Òs zZone.__delitem__cCs |j ¡Sr<)r.Ú__iter__©r4rrrrDÖsz Zone.__iter__cCs |j ¡Sr<©r.ÚkeysrErrrrGÙsz Zone.keyscCs |j ¡Sr<)r.ÚvaluesrErrrrHÜsz Zone.valuescCs |j ¡Sr<©r.ÚitemsrErrrrJßsz Zone.itemscCs| |¡}|j |¡Sr<©r%r.Úgetr>rrrrLâs zZone.getcCs| |¡}||jvSr<r=r>rrrÚ __contains__æs zZone.__contains__F)rÚcreater!cCs<| |¡}|j |¡}|dur8|s&t‚| ¡}||j|<|S)aNFind a node in the zone, possibly creating it. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *create*, a ``bool``. If true, the node will be created if it does not exist. Raises ``KeyError`` if the name is not known and create was not specified, or if the name was not a subdomain of the origin. Returns a ``dns.node.Node``. N)r%r.rLr"r'©r4rrNÚnoderrrÚ find_nodeês   zZone.find_nodecCs,z| ||¡}Wnty&d}Yn0|S)a€Get a node in the zone, possibly creating it. This method is like ``find_node()``, except it returns None instead of raising an exception if the node does not exist and creation has not been requested. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *create*, a ``bool``. If true, the node will be created if it does not exist. Returns a ``dns.node.Node`` or ``None``. N)rQr"rOrrrÚget_nodes   z Zone.get_nodecCs | |¡}||jvr|j|=dS)akDelete the specified node if it exists. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. It is not an error if the node does not exist. Nr=r;rrrÚ delete_node s  zZone.delete_node)rÚrdtypeÚcoversrNr!cCsD| |¡}tjj |¡}tjj |¡}| ||¡}| |j|||¡S)aËLook for an rdataset with the specified name and type in the zone, and return an rdataset encapsulating it. The rdataset returned is not a copy; changes to it will change the zone. KeyError is raised if the name or type are not found. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *rdtype*, a ``dns.rdatatype.RdataType`` or ``str``, the rdata type desired. *covers*, a ``dns.rdatatype.RdataType`` or ``str`` the covered type. Usually this value is ``dns.rdatatype.NONE``, but if the rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset. *create*, a ``bool``. If true, the node will be created if it does not exist. Raises ``KeyError`` if the name is not known and create was not specified, or if the name was not a subdomain of the origin. Returns a ``dns.rdataset.Rdataset``. )r%r$Ú rdatatypeÚ RdataTypeÚmakerQÚ find_rdatasetr-)r4rrTrUrNrPrrrrY/s )  zZone.find_rdatasetcCs0z| ||||¡}Wnty*d}Yn0|S)a%Look for an rdataset with the specified name and type in the zone. This method is like ``find_rdataset()``, except it returns None instead of raising an exception if the rdataset does not exist and creation has not been requested. The rdataset returned is not a copy; changes to it will change the zone. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *rdtype*, a ``dns.rdatatype.RdataType`` or ``str``, the rdata type desired. *covers*, a ``dns.rdatatype.RdataType`` or ``str``, the covered type. Usually this value is ``dns.rdatatype.NONE``, but if the rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset. *create*, a ``bool``. If true, the node will be created if it does not exist. Raises ``KeyError`` if the name is not known and create was not specified, or if the name was not a subdomain of the origin. Returns a ``dns.rdataset.Rdataset`` or ``None``. N)rYr")r4rrTrUrNÚrdatasetrrrÚ get_rdataset^s *  zZone.get_rdataset©rrTrUr!cCsb| |¡}tjj |¡}tjj |¡}| |¡}|dur^| |j||¡t|ƒdkr^|  |¡dS)aÇDelete the rdataset matching *rdtype* and *covers*, if it exists at the node specified by *name*. It is not an error if the node does not exist, or if there is no matching rdataset at the node. If the node has no rdatasets after the deletion, it will itself be deleted. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *rdtype*, a ``dns.rdatatype.RdataType`` or ``str``, the rdata type desired. *covers*, a ``dns.rdatatype.RdataType`` or ``str`` or ``None``, the covered type. Usually this value is ``dns.rdatatype.NONE``, but if the rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset. Nr) r%r$rVrWrXrRÚdelete_rdatasetr-ÚlenrS©r4rrTrUrPrrrr]Žs   zZone.delete_rdataset)rÚ replacementr!cCs.|j|jkrtdƒ‚| |d¡}| |¡dS)aÃReplace an rdataset at name. It is not an error if there is no rdataset matching I{replacement}. Ownership of the *replacement* object is transferred to the zone; in other words, this method does not store a copy of *replacement* at the node, it stores *replacement* itself. If the node does not exist, it is created. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *replacement*, a ``dns.rdataset.Rdataset``, the replacement rdataset. z#replacement.rdclass != zone.rdclassTN)r-r3rQÚreplace_rdataset)r4rr`rPrrrra´s  zZone.replace_rdatasetcCs^| |¡}tjj |¡}tjj |¡}|j| |j||¡}tj  ||j||¡}|  |¡|S)aÈLook for an rdataset with the specified name and type in the zone, and return an RRset encapsulating it. This method is less efficient than the similar ``find_rdataset()`` because it creates an RRset instead of returning the matching rdataset. It may be more convenient for some uses since it returns an object which binds the owner name to the rdataset. This method may not be used to create new nodes or rdatasets; use ``find_rdataset`` instead. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *rdtype*, a ``dns.rdatatype.RdataType`` or ``str``, the rdata type desired. *covers*, a ``dns.rdatatype.RdataType`` or ``str``, the covered type. Usually this value is ``dns.rdatatype.NONE``, but if the rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset. *create*, a ``bool``. If true, the node will be created if it does not exist. Raises ``KeyError`` if the name is not known and create was not specified, or if the name was not a subdomain of the origin. Returns a ``dns.rrset.RRset`` or ``None``. ) r%r$rVrWrXr.rYr-ÚrrsetÚRRsetÚupdate)r4rrTrUZvnamerZrbrrrÚ find_rrsetÎs,  zZone.find_rrsetcCs.z| |||¡}Wnty(d}Yn0|S)a.Look for an rdataset with the specified name and type in the zone, and return an RRset encapsulating it. This method is less efficient than the similar ``get_rdataset()`` because it creates an RRset instead of returning the matching rdataset. It may be more convenient for some uses since it returns an object which binds the owner name to the rdataset. This method may not be used to create new nodes or rdatasets; use ``get_rdataset()`` instead. *name*: the name of the node to find. The value may be a ``dns.name.Name`` or a ``str``. If absolute, the name must be a subdomain of the zone's origin. If ``zone.relativize`` is ``True``, then the name will be relativized. *rdtype*, a ``dns.rdataset.Rdataset`` or ``str``, the rdata type desired. *covers*, a ``dns.rdataset.Rdataset`` or ``str``, the covered type. Usually this value is ``dns.rdatatype.NONE``, but if the rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset. *create*, a ``bool``. If true, the node will be created if it does not exist. Returns a ``dns.rrset.RRset`` or ``None``. N)rer")r4rrTrUrbrrrÚ get_rrsets (  zZone.get_rrset)rTrUr!ccsftjj |¡}tjj |¡}| ¡D]<\}}|D].}|tjjksT|j|kr0|j|kr0||fVq0q$dS)a’Return a generator which yields (name, rdataset) tuples for all rdatasets in the zone which have the specified *rdtype* and *covers*. If *rdtype* is ``dns.rdatatype.ANY``, the default, then all rdatasets will be matched. *rdtype*, a ``dns.rdataset.Rdataset`` or ``str``, the rdata type desired. *covers*, a ``dns.rdataset.Rdataset`` or ``str``, the covered type. Usually this value is ``dns.rdatatype.NONE``, but if the rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset. N)r$rVrWrXrJÚANYrTrU)r4rTrUrrPÚrdsrrrÚiterate_rdatasets0s ÿÿzZone.iterate_rdatasetsccsttjj |¡}tjj |¡}| ¡D]J\}}|D]<}|tjjksT|j|kr0|j|kr0|D]}||j|fVqXq0q$dS)aŽReturn a generator which yields (name, ttl, rdata) tuples for all rdatas in the zone which have the specified *rdtype* and *covers*. If *rdtype* is ``dns.rdatatype.ANY``, the default, then all rdatas will be matched. *rdtype*, a ``dns.rdataset.Rdataset`` or ``str``, the rdata type desired. *covers*, a ``dns.rdataset.Rdataset`` or ``str``, the covered type. Usually this value is ``dns.rdatatype.NONE``, but if the rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``, then the covers value will be the rdata type the SIG/RRSIG covers. The library treats the SIG and RRSIG types as if they were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA). This makes RRSIGs much easier to work with than if RRSIGs covering different rdata types were aggregated into a single RRSIG rdataset. N) r$rVrWrXrJrgrTrUÚttl)r4rTrUrrPrhÚrdatarrrÚiterate_rdatasPs ÿÿzZone.iterate_rdatas)ÚfÚsortedr ÚnlÚ want_commentsÚ want_originr!c Csžt|tƒrt|dƒ}n t |¡}|��b}t|ddƒ}|dur@d}|durZtj |¡} d}n"t|tƒrp| |¡} n |} |  ¡}|ræ|j dusŽJ‚d|j   ¡} |  |¡} z|  | ¡|  | ¡Wn&t yä|  | ¡|  |¡Yn0|�rt| ¡ƒ} |  ¡n| ¡} | D]j} || j | |j ||d�} |  |¡} z|  | ¡|  | ¡Wn(t �yt|  | ¡|  |¡Yn0�qWdƒn1�s�0YdS)a=Write a zone to a file. *f*, a file or `str`. If *f* is a string, it is treated as the name of a file to open. *sorted*, a ``bool``. If True, the default, then the file will be written with the names sorted in DNSSEC order from least to greatest. Otherwise the names will be written in whatever order they happen to have in the zone's dictionary. *relativize*, a ``bool``. If True, the default, then domain names in the output will be relativized to the zone's origin if possible. *nl*, a ``str`` or None. The end of line string. If not ``None``, the output will use the platform's native end-of-line marker (i.e. LF on POSIX, CRLF on Windows). *want_comments*, a ``bool``. If ``True``, emit end-of-line comments as part of writing the file. If ``False``, the default, do not emit them. *want_origin*, a ``bool``. If ``True``, emit a $ORIGIN line at the start of the file. If ``False``, the default, do not emit one. ÚwbÚencodingNzutf-8Ú z$ORIGIN )rr rp)r/r0ÚopenÚ contextlibÚ nullcontextÚgetattrÚosÚlinesepÚencodeÚdecoderÚto_textÚwriteÚ TypeErrorÚlistrGÚsort)r4rmrnr rorprqÚcmZfile_encZnl_bÚlZl_bÚnamesÚnrrrÚto_fileqsT$             ü   z Zone.to_file)rnr rorprqr!cCs0t ¡}| ||||||¡| ¡}| ¡|S)aReturn a zone's text as though it were written to a file. *sorted*, a ``bool``. If True, the default, then the file will be written with the names sorted in DNSSEC order from least to greatest. Otherwise the names will be written in whatever order they happen to have in the zone's dictionary. *relativize*, a ``bool``. If True, the default, then domain names in the output will be relativized to the zone's origin if possible. *nl*, a ``str`` or None. The end of line string. If not ``None``, the output will use the platform's native end-of-line marker (i.e. LF on POSIX, CRLF on Windows). *want_comments*, a ``bool``. If ``True``, emit end-of-line comments as part of writing the file. If ``False``, the default, do not emit them. *want_origin*, a ``bool``. If ``True``, emit a $ORIGIN line at the start of the output. If ``False``, the default, do not emit one. Returns a ``str``. )ÚioÚStringIOr†ÚgetvalueÚclose)r4rnr rorprqZ temp_bufferZ return_valuerrrr}Ês !z Zone.to_text©r!cCsX|jrtjj}n|jdusJ‚|j}| |tjj¡durJ‚ˆj }|ƒ}t ˆ  ¡ƒD]¤\}}|  ˆj ¡}t |dd„d�D]~} ||krœtjj| j| jfvrœqzt d| j| j| j¡} ‡fdd„| Dƒ} t | ƒD]*} t dt| ƒ¡} | || | | ¡qÌqzqV| ¡S)NcSs |j|jfSr<)rTrU)rhrrrÚ1óz&Zone._compute_digest..)r?z!HHIcsg|]}| ˆj¡‘qSr)Ú to_digestabler)Ú.0rkrErrÚ :r•z(Zone._compute_digest..z!H)rrLrr ÚSIMPLErr r$rrŒrrnrJr–rVÚZONEMDrTrUÚstructÚpackr-rjr^rdÚdigest)r4r’r“Zhashinfor�ZhasherrrPZ rrnamebufrZZrrfixedZrdatasrkZrrlenrrErÚ_compute_digests4    þÿ zZone._compute_digestcCs6| ¡j}| ||¡}tjjj |jtjj||||¡Sr<) r‘Úserialržr$Úrdtypesrgršr-rV)r4r’r“rŸr�rrrÚcompute_digest@s    ÿzZone.compute_digest)Úzonemdr!c Csˆ|r |g}n0|jdusJ‚| |jtjj¡}|dur8t‚|}|D]>}z&| |j|j¡}||j krhWdSWq@t y|Yq@0q@t ‚dSr<) rr[r$rVršrržr’r“r�Ú Exceptionr)r4r¢Zdigestsrhr�ZcomputedrrrÚ verify_digestKs   zZone.verify_digestÚ TransactioncCst|dt|d|j|jƒƒS)NFé)r¥ÚVersionr.rrErrrÚreaderbsz Zone.reader©r`r!cCst||ƒ}| ¡|Sr<)r¥Ú_setup_version)r4r`r�rrrÚwriteres z Zone.writercCs$|jrtjj}n|j}|j|j|fSr<)r r$rrŒr)r4Ú effectiverrrÚorigin_informationjs zZone.origin_informationcCs|jSr<)r-rErrrÚ get_classtszZone.get_classcCsdSr<r©r4r�rrrÚ _end_readyszZone._end_readcCsdSr<rr¯rrrÚ _end_write|szZone._end_writecCs|j|_|jdur||_dSr<)r.r)r4Ú_ÚversionrrrrÚ_commit_versions zZone._commit_versioncCsdS)Nr¦rrErrrÚ_get_next_version_id„szZone._get_next_version_id)F)F)TTNFF)TTNFF)N)N)F)Wrrrrr$rPÚNoder'rÚ__annotations__Údictr(rrr2r*rr,Ú __slots__Ú rdataclassÚINr r0Ú RdataClassÚboolr5r8r9r%r@rBrCrDrGrHrJrLrMrQrRrSrVÚNONErWrZÚRdatasetrYr[r]rarbrcrerfrgrr riÚintrkZRdatarlrr†r}rŽÚ transactionr¥r r�r‘r r™r Úbytesržršr¡r¤r¨r«r­r®r°r±r´rµrrrrr&xs.  $üü  ÿþ ÿ þ ûú 3û ú 4üû 'þ üû 8ü û 0ýü "ýü $ùø [úù 'ÿ  þ ýü %ý ü ÿþ þ r&cs"eZdZdgZ‡fdd„Z‡ZS)Ú VersionedNodeÚidcstƒ ¡d|_dS©Nr)Úsuperr5rÄrE©Ú __class__rrr5”s zVersionedNode.__init__)rrrr¹r5Ú __classcell__rrrÇrrÑsrÃcsÒeZdZ‡fdd„Zejjdfejjejj ejj e ej j dœ‡fdd„ Z ejjdfejjejj ejj e eej j dœ‡fdd„ Zejjfejjejj ejj d d œd d „Zej j d d œdd„Ze dœdd„Z‡ZS)ÚImmutableVersionedNodecs,tƒ ¡|j|_tdd„|jDƒƒ|_dS)NcSsg|]}tj |¡‘qSr)r$rZZImmutableRdataset)r—rhrrrr˜ r•z3ImmutableVersionedNode.__init__..)rÆr5rÄÚtupleÚ rdatasets)r4rPrÇrrr5œs  ÿzImmutableVersionedNode.__init__F)r-rTrUrNr!cs|r tdƒ‚tƒ |||d¡S©NÚ immutableF)rrÆrY©r4r-rTrUrNrÇrrrY£sz$ImmutableVersionedNode.find_rdatasetcs|r tdƒ‚tƒ |||d¡SrÍ)rrÆr[rÏrÇrrr[®sz#ImmutableVersionedNode.get_rdatasetN)r-rTrUr!cCs tdƒ‚dS©NrΩr)r4r-rTrUrrrr]¹sz&ImmutableVersionedNode.delete_rdatasetr©cCs tdƒ‚dSrÐrÑ)r4r`rrrraÁsz'ImmutableVersionedNode.replace_rdatasetr‹cCsdS©NTrrErrrÚ is_immutableÄsz#ImmutableVersionedNode.is_immutable)rrrr5r$rVr¾rºr¼rWr½rZr¿rYrr[r]rarÓrÉrrrÇrrÊšs8 ûúû úüû rÊc@sªeZdZdeeeeejj ej j feejj dœdd„Z ejj ejj dœdd„Z ejj eej j dœdd „Zejj ejjejjeejjd œd d „Zd d„Zdd„ZdS)r§N)ÚzonerÄr.rcCs0||_||_|dur||_n | ¡|_||_dSr<)rÔrÄr.r(r)r4rÔrÄr.rrrrr5És  zVersion.__init__r:cCst||j|jjƒSr<)r%rrÔr r;rrrr%ØszVersion._validate_namecCs| |¡}|j |¡Sr<rKr;rrrrRÛs zVersion.get_noder\cCs(| |¡}|durdS| |jj||¡Sr<)rRr[rÔr-r_rrrr[ßs zVersion.get_rdatasetcCs |j ¡Sr<rFrErrrrGêsz Version.keyscCs |j ¡Sr<rIrErrrrJísz Version.items)NN)rrrr&rÀrrr$rr2rPr¶r5r%rRrVrWrZr¿r[rGrJrrrrr§Ès"û û  û r§csŒeZdZdeedœ‡fdd„ Zejjej j dœdd„Z ejjddœd d „Z ejjej jdd œd d „Zejjejjejjddœdd„Z‡ZS)r)F)rÔr`cs<| ¡}tƒ ||¡|s(|j |j¡|j|_tƒ|_dSr<)rµrÆr5r.rdrÚsetÚchanged)r4rÔr`rÄrÇrrr5òs zWritableVersion.__init__r:cCs|| |¡}|j |¡}|dus(||jvrt|j ¡}t|dƒrD|j|_|durZ|j  |j¡||j|<|j  |¡|S|SdS)NrÄ) r%r.rLrÖrÔr'ÚhasattrrÄrÌÚextendÚadd)r4rrPZnew_noderrrÚ _maybe_cows      zWritableVersion._maybe_cowNcCs,| |¡}||jvr(|j|=|j |¡dSr<)r%r.rÖrÙr;rrrrSs  zWritableVersion.delete_node)rrZr!cCs| |¡}| |¡dSr<)rÚra)r4rrZrPrrrÚ put_rdatasets zWritableVersion.put_rdatasetr\cCs4| |¡}| |jj||¡t|ƒdkr0|j|=dSrÅ)rÚr]rÔr-r^r.r_rrrr]$s  zWritableVersion.delete_rdataset)F)rrrr&r½r5r$rr2rPr¶rÚrSrZr¿rÛrVrWr]rÉrrrÇrr)ñs þ ûr)cs"eZdZedœ‡fdd„ Z‡ZS)r+)r³csftƒ |jd¡|j|_|j|_|jD]"}|j |¡}|r&t|ƒ|j|<q&t j   |jd|jj ¡|_dSrÒ) rÆr5rÔrÄrrÖr.rLrÊr$rÎÚDictr()r4r³rrPrÇrrr52s   ÿzImmutableVersion.__init__)rrrr)r5rÉrrrÇrr+0sr+cs’eZdZd!‡fdd„ Zedd„ƒZdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Z‡ZS)"r¥NFcs(|du}tƒ |||¡||_||_dSr<)rÆr5r³Úmake_immutable)r4rÔr`r³rÝÚ read_onlyrÇrrr5IszTransaction.__init__cCs|jSr<)ÚmanagerrErrrrÔOszTransaction.zonecCs6|jdusJ‚|jj}|dur"t}||j|jƒ|_dSr<)r³rßr*r)rÔr`)r4ÚfactoryrrrrªSs zTransaction._setup_versioncCs|j |||¡Sr<)r³r[©r4rrTrUrrrÚ _get_rdatasetZszTransaction._get_rdatasetcCs|jr J‚|j ||¡dSr<)rÞr³rÛ)r4rrZrrrÚ _put_rdataset]s zTransaction._put_rdatasetcCs|jr J‚|j |¡dSr<)rÞr³rSr;rrrÚ _delete_nameas zTransaction._delete_namecCs|jr J‚|j |||¡dSr<)rÞr³r]rárrrÚ_delete_rdatasetes zTransaction._delete_rdatasetcCs|j |¡duSr<©r³rRr;rrrÚ _name_existsiszTransaction._name_existscCs|jr dSt|jjƒdkSdS)NFr)rÞr^r³rÖrErrrÚ_changedlszTransaction._changedcCsz|jr|j |¡nb|rjt|jjƒdkrj|jrN|jj}|durBt }||jƒ}n|j}|j  |||jj ¡n |j  |¡dSrÅ) rÞrÔr°r^r³rÖrÝrßr,r+r´rr±)r4Zcommitràr³rrrÚ_end_transactionrs zTransaction._end_transactioncCs|jjdur||j_dSr<)r³r)r4rrrrÚ _set_origin‚s zTransaction._set_originccs,|j ¡D]\}}|D]}||fVqq dSr<)r³rJ)r4rrPrZrrrÚ_iterate_rdatasets†szTransaction._iterate_rdatasetscCs |j ¡Sr<)r³rGrErrrÚ_iterate_names‹szTransaction._iterate_namescCs |j |¡Sr<rær;rrrÚ _get_nodeŽszTransaction._get_nodecCsH|j ¡\}}}|dur>|jjdur>|jj}|r:tjj}n|}|||fSr<)rßr­r³rr$rrŒ)r4Úabsoluter r¬rrrÚ_origin_information‘s zTransaction._origin_information)NF)rrrr5ÚpropertyrÔrªrârãrärårçrèrérêrërìrírïrÉrrrÇrr¥Hs  r¥TF) Útextrr-r Ú zone_factoryÚfilenameÚ allow_includerŽÚ idna_codecÚallow_directivesr!c  Cs¨|dur d}||||d�} |  d¡�d} tjj|||d�} tjj| || || d�} z |  ¡Wntjjyxtjj‚Yn0Wdƒn1sŽ0Y|r¤|   ¡| S)Nz©r T)rõ)rôrö) r«r$Z tokenizerÚ TokenizerZzonefileÚReaderÚreadrrÔrŽ)rñrr-r ròrórôrŽrõrörÔr�Útokr¨rrrÚ _from_textžs& û ,rüc Cst|||||||||| ƒ S)aBuild a zone object from a zone file format string. *text*, a ``str``, the zone file format input. *origin*, a ``dns.name.Name``, a ``str``, or ``None``. The origin of the zone; if not specified, the first ``$ORIGIN`` statement in the zone file will determine the origin of the zone. *rdclass*, a ``dns.rdataclass.RdataClass``, the zone's rdata class; the default is class IN. *relativize*, a ``bool``, determine's whether domain names are relativized to the zone's origin. The default is ``True``. *zone_factory*, the zone factory to use or ``None``. If ``None``, then ``dns.zone.Zone`` will be used. The value may be any class or callable that returns a subclass of ``dns.zone.Zone``. *filename*, a ``str`` or ``None``, the filename to emit when describing where an error occurred; the default is ``''``. *allow_include*, a ``bool``. If ``True``, the default, then ``$INCLUDE`` directives are permitted. If ``False``, then encoutering a ``$INCLUDE`` will raise a ``SyntaxError`` exception. *check_origin*, a ``bool``. If ``True``, the default, then sanity checks of the origin node will be made by calling the zone's ``check_origin()`` method. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder. If ``None``, the default IDNA 2003 encoder/decoder is used. *allow_directives*, a ``bool`` or an iterable of `str`. If ``True``, the default, then directives are permitted, and the *allow_include* parameter controls whether ``$INCLUDE`` is permitted. If ``False`` or an empty iterable, then no directive processing is done and any directive-like text will be treated as a regular owner name. If a non-empty iterable, then only the listed directives (including the ``$``) are allowed. Raises ``dns.zone.NoSOA`` if there is no SOA RRset. Raises ``dns.zone.NoNS`` if there is no NS RRset. Raises ``KeyError`` if there is no origin node. Returns a subclass of ``dns.zone.Zone``. )rü) rñrr-r ròrórôrŽrõrörrrr1Ès<ör1) rmrr-r ròrórôrŽrõrör!c Cstt|tƒr |dur|}t|ƒ} n t |¡} | �*}t|||||||||| ƒ WdƒS1s^0YdspJ‚dS)aRead a zone file and build a zone object. *f*, a file or ``str``. If *f* is a string, it is treated as the name of a file to open. *origin*, a ``dns.name.Name``, a ``str``, or ``None``. The origin of the zone; if not specified, the first ``$ORIGIN`` statement in the zone file will determine the origin of the zone. *rdclass*, an ``int``, the zone's rdata class; the default is class IN. *relativize*, a ``bool``, determine's whether domain names are relativized to the zone's origin. The default is ``True``. *zone_factory*, the zone factory to use or ``None``. If ``None``, then ``dns.zone.Zone`` will be used. The value may be any class or callable that returns a subclass of ``dns.zone.Zone``. *filename*, a ``str`` or ``None``, the filename to emit when describing where an error occurred; the default is ``''``. *allow_include*, a ``bool``. If ``True``, the default, then ``$INCLUDE`` directives are permitted. If ``False``, then encoutering a ``$INCLUDE`` will raise a ``SyntaxError`` exception. *check_origin*, a ``bool``. If ``True``, the default, then sanity checks of the origin node will be made by calling the zone's ``check_origin()`` method. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder. If ``None``, the default IDNA 2003 encoder/decoder is used. *allow_directives*, a ``bool`` or an iterable of `str`. If ``True``, the default, then directives are permitted, and the *allow_include* parameter controls whether ``$INCLUDE`` is permitted. If ``False`` or an empty iterable, then no directive processing is done and any directive-like text will be treated as a regular owner name. If a non-empty iterable, then only the listed directives (including the ``$``) are allowed. Raises ``dns.zone.NoSOA`` if there is no SOA RRset. Raises ``dns.zone.NoNS`` if there is no NS RRset. Raises ``KeyError`` if there is no origin node. Returns a subclass of ``dns.zone.Zone``. NF)r/r0rurvrwrü) rmrr-r ròrórôrŽrõrör‚rrrÚ from_files&=   ö" rý)Úxfrròr rŽr!c CsÐd}|D]¦}|durF|r |j}n |jdj}|jdj}||||d�}|jD]`}|j |j¡} | sv| ¡} | |j|j<|  |j|j|j d¡} |   |j ¡|D]} |   | ¡qœqLq|durÀt dƒ‚|rÌ| ¡|S)aNConvert the output of a zone transfer generator into a zone object. *xfr*, a generator of ``dns.message.Message`` objects, typically ``dns.query.xfr()``. *relativize*, a ``bool``, determine's whether domain names are relativized to the zone's origin. The default is ``True``. It is essential that the relativize setting matches the one specified to the generator. *check_origin*, a ``bool``. If ``True``, the default, then sanity checks of the origin node will be made by calling the zone's ``check_origin()`` method. Raises ``dns.zone.NoSOA`` if there is no SOA RRset. Raises ``dns.zone.NoNS`` if there is no NS RRset. Raises ``KeyError`` if there is no origin node. Raises ``ValueError`` if no messages are yielded by the generator. Returns a subclass of ``dns.zone.Zone``. Nrr÷Tzempty transfer)rZanswerrr-r.rLr'rYrTrUZ update_ttlrjrÙr3rŽ) rþròr rŽÚzÚrrr-rbZznodeZzrdsZrdrrrÚfrom_xfres,     r)Hrrvr‡ryr›Útypingrrrrrrrr r r Z dns.exceptionr$Z dns.grangeZ dns.immutableZdns.nameZdns.nodeZ dns.rdataZdns.rdataclassZ dns.rdatasetZ dns.rdatatypeZdns.rdtypes.ANY.SOAZdns.rdtypes.ANY.ZONEMDZ dns.rrsetZ dns.tokenizerZdns.transactionZdns.ttlZ dns.zonefileZ dns.zonetypesr r rÚ exceptionZ DNSExceptionrrrrrrrrrr2r½r%rÁZTransactionManagerr&rPr¶rÃrÎrÊr§r)r+r¥rºr»r0r¼Z IDNACodecrür1rýrrrrrÚsü0  ü  -)?Xö õ ,ö õ Lö õ Uüû