%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/dns/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/dns/__pycache__/zone.cpython-312.pyc

�

5��ev�����dZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!m"Z"m#Z#m$Z$Gd�dejJjL�Z'Gd�de'�Z(Gd	�d
e'�Z)Gd�de'�Z*Gd
�dejJjL�Z+Gd�dejJjL�Z,Gd�dejJjL�Z-Gd�dejJjL�Z.dej^j`deej^j`de1dej^j`fd�Z2Gd�dejfjh�Z5Gd�dejljn�Z8ejrjrGd�de8��Z:Gd �d!�Z;Gd"�d#e;�Z<ejrjrGd$�d%e;��Z=Gd&�d'ejfj|�Z>dej~j�d(e5dd)d(dd(f	d*edeeej^j`eAfd+ej~j�de1d,ed-eeAd.e1d/e1d0eej^j�d1ee1eeAfde5fd2�ZDdej~j�d(e5dd)d(dd(f	d*eAdeeej^j`eAfd+ej~j�de1d,ed-eeAd.e1d/e1d0eej^j�d1ee1eeAfde5fd3�ZEdej~j�d(e5dd(d(dd(f	d4edeeej^j`eAfd+ej~j�de1d,ed-eeAd.e1d/e1d0eej^j�d1ee1eeAfde5fd5�ZFe5d(d(fd6ed,ede1d/e1de5f
d7�ZGy)8z
DNS Zones.�N)
�Any�Callable�Iterable�Iterator�List�MutableMapping�Optional�Set�Tuple�Union)�DigestHashAlgorithm�DigestScheme�_digest_hashersc��eZdZdZy)�BadZonezThe DNS zone is malformed.N��__name__�
__module__�__qualname__�__doc__���*/usr/lib/python3/dist-packages/dns/zone.pyrr8s��$rrc��eZdZdZy)�NoSOAz)The DNS zone has no SOA RR at its origin.Nrrrrrr<s��3rrc��eZdZdZy)�NoNSz+The DNS zone has no NS RRset at its origin.Nrrrrrr@s��5rrc��eZdZdZy)�
UnknownOriginz!The DNS zone's origin is unknown.NrrrrrrDs��+rrc��eZdZdZy)�UnsupportedDigestSchemez(The zone digest's scheme is unsupported.Nrrrrr!r!H���2rr!c��eZdZdZy)�UnsupportedDigestHashAlgorithmz(The zone digest's origin is unsupported.Nrrrrr$r$Lr"rr$c��eZdZdZy)�NoDigestz/The DNS zone has no ZONEMD RRset at its origin.Nrrrrr&r&Ps��9rr&c��eZdZdZy)�DigestVerificationFailurez#The ZONEMD digest failed to verify.Nrrrrr(r(Ts��-rr(�name�origin�
relativize�returnc�&�|�td��|j�r1|j|�std��|r|j|�}|S	|j	|�}|s|}|S#t
jj$rtd��wxYw)Nzno zone origin is definedz5name parameter must be a subdomain of the zone originzrelative name too long for zone)�KeyError�is_absolute�is_subdomainr+�derelativize�dnsr)�NameTooLong)r)r*r+�abs_names    r�_validate_namer5Xs����~��2�3�3������ � ��(��R�S�S���?�?�6�*�D��K�	>��(�(��0�H�
��D��K���x�x�#�#�	>��<�=�=�	>�s�A'�')Bc�0�eZdZUdZej
jZegej
jfe	d<e
Zegeejjej
jffe	d<dZeegdfe	d<dZeegdfe	d<gd	�Zej&j(d
fdeeejjefdej&j.d
efd�Zd�Zd�Zdeejjefdejjfd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%	dFdeejjefdedej
jfd�Z&	dFdeejjefdedeej
jfd �Z'deejjefddfd!�Z(ejRjTdfdeejjefd"eejRjVefd#eejRjVefdedejXjZf
d$�Z.ejRjTdfdeejjefd"eejRjVefd#eejRjVefdedeejXjZf
d%�Z/ejRjTfdeejjefd"eejRjVefd#eejRjVefddfd&�Z0deejjefd'ejXjZddfd(�Z1ejRjTfdeejjefd"eejRjVefd#eejRjVefdejdjffd)�Z4ejRjTfdeejjefd"eejRjVefd#eejRjVefdeejdjffd*�Z5ejRjlejRjTfd"eejRjVefd#eejRjVefde7e8ejjejXjZffd+�Z9ejRjlejRjTfd"eejRjVefd#eejRjVefde7e8ejje:ejvjxffd,�Z=					dGd-e>d.ed
ed/eed0ed1eddfd2�Z?					dGd.ed
ed/eed0ed1edefd3�Z@dHd4�ZA	dId5eej�j�dej�jlj�j�fd6�ZFeGj�fd7eId8eGdeJfd9�ZKeGj�fd7eId8eGdej�jlj�j�fd:�ZM	dId;eej�jlj�j�ddfd<�ZNdJd>�ZOdFd'edd=fd?�ZPde8eejjeeejjffd@�ZQdA�ZRdB�ZSdC�ZTdD�ZUdE�ZVy)K�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+Tr*r>r+c�P�|�zt|t�r tjj	|�}n/t|tjj
�st
d��|j�st
d��||_||_	|j�|_||_y)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�strr2r)�	from_text�Name�
ValueErrorr/r*r>r9r?r+)�selfr*r>r+s    r�__init__z
Zone.__init__�s���$���&�#�&����+�+�F�3�������
�
�6� �!U�V�V��%�%�'� �!L�M�M�������CG�CS�CS�CU��
�$��rc��t|t�sy|j|jk7s2|j|jk7s|j|jk7ryy)zqTwo zones are equal if they have the same origin, class, and
        nodes.

        Returns a ``bool``.
        FT)rAr7r>r*r?�rF�others  r�__eq__zZone.__eq__�sG���%��&���L�L�E�M�M�)��{�{�e�l�l�*��z�z�U�[�[�(��rc�&�|j|�S)z>Are two zones not equal?

        Returns a ``bool``.
        )rKrIs  r�__ne__zZone.__ne__�s���;�;�u�%�%�%rr)r,c��t|t�r!tjj	|d�}n/t|tjj
�st
d��t||j|j�S)Nz0name parameter must be convertible to a DNS name)
rArBr2r)rCrDr.r5r*r+�rFr)s  rr5zZone._validate_name�sY���d�C� ��8�8�%�%�d�D�1�D��D�#�(�(�-�-�0��M�N�N��d�D�K�K����A�Arc�B�|j|�}|j|S�N�r5r?�rF�keys  r�__getitem__zZone.__getitem__�s ���!�!�#�&���z�z�#��rc�D�|j|�}||j|<yrQrR)rFrT�values   r�__setitem__zZone.__setitem__�s���!�!�#�&����
�
�3�rc�@�|j|�}|j|=yrQrRrSs  r�__delitem__zZone.__delitem__�s���!�!�#�&���J�J�s�Orc�6�|jj�SrQ)r?�__iter__�rFs rr\z
Zone.__iter__�s���z�z�"�"�$�$rc�6�|jj�SrQ�r?�keysr]s rr`z	Zone.keys�����z�z��� � rc�6�|jj�SrQ)r?�valuesr]s rrczZone.values�s���z�z� � �"�"rc�6�|jj�SrQ�r?�itemsr]s rrfz
Zone.items�����z�z���!�!rc�Z�|j|�}|jj|�SrQ�r5r?�getrSs  rrjzZone.get�s%���!�!�#�&���z�z�~�~�c�"�"rc�@�|j|�}||jvSrQrRrSs  r�__contains__zZone.__contains__�s!���!�!�#�&���d�j�j� � rF�createc��|j|�}|jj|�}|�'|st�|j	�}||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``.
        )r5r?rjr.r8�rFr)rm�nodes    r�	find_nodezZone.find_node�sT��&�"�"�4�(���z�z�~�~�d�#���<�����$�$�&�D�#�D�J�J�t���rc�P�	|j||�}|S#t$rd}Y|SwxYw)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.ros    r�get_nodez
Zone.get_nodes9��(	��>�>�$��/�D�����	��D���	�s��%�%c�^�|j|�}||jvr|j|=yy)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.
        NrRrOs  r�delete_nodezZone.delete_node s1���"�"�4�(���4�:�:���
�
�4� �r�rdtype�coversc�(�|j|�}tjjj	|�}tjjj	|�}|j||�}|j
|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``.
        )r5r2�	rdatatype�	RdataType�makerq�
find_rdatasetr>)rFr)rvrwrmrps      rr|zZone.find_rdataset/st��R�"�"�4�(�����(�(�-�-�f�5�����(�(�-�-�f�5���~�~�d�F�+���!�!�$�,�,����G�Grc�T�	|j||||�}|S#t$rd}Y|SwxYw)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)r|r.)rFr)rvrwrm�rdatasets      r�get_rdatasetzZone.get_rdataset^s@��T	��)�)�$����G�H�����	��H���	�s��'�'c�l�|j|�}tjjj	|�}tjjj	|�}|j|�}|�>|j
|j||�t|�dk(r|j|�yyy)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)
r5r2ryrzr{rs�delete_rdatasetr>�lenru�rFr)rvrwrps     rr�zZone.delete_rdataset�s���:�"�"�4�(�����(�(�-�-�f�5�����(�(�-�-�f�5���}�}�T�"����� � ����v�v�>��4�y�A�~�� � ��&��r�replacementc��|j|jk7rtd��|j|d�}|j|�y)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>rErq�replace_rdataset)rFr)r�rps    rr�zZone.replace_rdataset�s@��*���$�,�,�.��B�C�C��~�~�d�D�)�����k�*rc��|j|�}tjjj	|�}tjjj	|�}|j
|j
|j||�}tjj||j||�}|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``.
        )r5r2ryrzr{r?r|r>�rrset�RRset�update)rFr)rvrw�vnamer~r�s       r�
find_rrsetzZone.find_rrset�s���X�#�#�D�)�����(�(�-�-�f�5�����(�(�-�-�f�5���:�:�e�$�2�2�4�<�<���P���	�	����t�|�|�V�V�D��
���X���rc�R�	|j|||�}|S#t$rd}Y|SwxYw)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)r�r.)rFr)rvrwr�s     r�	get_rrsetzZone.get_rrsets<��P	��O�O�D�&�&�9�E�����	��E���	�s��&�&c#�tK�tjjj|�}tjjj|�}|j	�D]O\}}|D]E}|tjj
k(s |j|k(s�0|j|k(s�@||f���G�Qy�w)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)r2ryrzr{rf�ANYrvrw)rFrvrwr)rp�rdss      r�iterate_rdatasetszZone.iterate_rdatasets0s�����.���(�(�-�-�f�5�����(�(�-�-�f�5���*�*�,�	&�J�D�$��
&���S�]�]�.�.�.��J�J�&�(�S�Z�Z�6�-A���+�%�	
&�	&�s�BB8�B8�-B8c#�K�tjjj|�}tjjj|�}|j	�D]a\}}|D]W}|tjj
k(s |j|k(s�0|j|k(s�@|D]}||j|f����Y�cy�w)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)	r2ryrzr{rfr�rvrw�ttl)rFrvrwr)rpr��rdatas       r�iterate_rdataszZone.iterate_rdatasPs�����.���(�(�-�-�f�5�����(�(�-�-�f�5���*�*�,�	5�J�D�$��
5���S�]�]�.�.�.��J�J�&�(�S�Z�Z�6�-A�!$�5��#�S�W�W�e�4�4�5�	
5�	5�s�BC
�C
�-C
�f�sorted�nl�
want_comments�want_originc�"�t|t�r
t|d�}ntj|�}|5}t|dd�}|�d}|�"tjj|�}	d}n4t|t�r|j|�}	n|}	|j�}|r_|j�J�d|jj�z}
|
j|�}	|j|�|j|	�|r*t|j��}|j!�n|j�}|D]X}
||
j|
|j||��}
|
j|�}	|j|�|j|	��Z	ddd�y#t$r%|j|
�|j|�Y��wxYw#t$r%|j|
�|j|�Y��wxYw#1swYyxYw)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 )r*r+r�)rArB�open�
contextlib�nullcontext�getattr�os�linesep�encode�decoder*�to_text�write�	TypeError�listr`�sort)rFr�r�r+r�r�r��cm�file_enc�nl_b�l�l_b�names�ns              r�to_filezZone.to_fileqs���H�a���48��D�M�B��'�'��*�B�
�/	 �1��q�*�d�3�H���"���z��z�z�(�(��2�����B��$��y�y��*�����Y�Y�[����{�{�.�.�.�����!4�!4�!6�6���h�h�x�(�� ��G�G�C�L��G�G�D�M�
��T�Y�Y�[�)���
�
���	�	����
 ����G�O�O���;�;�)�"/�	$����h�h�x�(�� ��G�G�C�L��G�G�D�M�
 �C/	 �/	 ��0!� ��G�G�A�J��G�G�B�K� ��*!� ��G�G�A�J��G�G�B�K� ��[/	 �/	 �sU�B(H�"F#�A4H�5"G�H�#+G�H�G�H�+H�?H�H�H�Hc��tj�}|j||||||�|j�}|j	�|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)rFr�r+r�r�r��temp_buffer�return_values        rr�zZone.to_text�sF��B�k�k�m�����[�&�*�b�-��U�"�+�+�-�������rc�F�|jrtjj}n|j�J�|j}|j|tjj��t�|j|tjj��t�y)z�Do some simple checking of the zone's origin.

        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.
        N)r+r2r)�emptyr*rry�SOAr�NSrrOs  r�check_originzZone.check_origin�sz���?�?��8�8�>�>�D��;�;�*�*�*��;�;�D����T�3�=�=�#4�#4�5�=��K����T�3�=�=�#3�#3�4�<��J�=r�txnc�T�|jrtjj}n|j�t
�|j}|r+|j
|tjj�}n*|j|tjj�}|�t
�|dS)z�Get the zone SOA rdata.

        Raises ``dns.zone.NoSOA`` if there is no SOA RRset.

        Returns a ``dns.rdtypes.ANY.SOA.SOA`` Rdata.
        r)
r+r2r)r�r*rrjryr�r)rFr��origin_name�soas    r�get_soazZone.get_soas~���?�?��(�(�.�.�K��{�{�"����+�+�K���'�'�+�s�}�}�'8�'8�9�C��#�#�K����1B�1B�C�C��;��K��1�v�
r�hash_algorithm�schemec	��tj|�}|st�|tjk7rt
�|jrtjj}n|j�J�|j}|�}t|j��D�]\}}|j|j�}t|d���D]�}	||k(r3tjj|	j |	j"fvr�;t%j&d|	j |	j(|	j*�}
|	D�cgc]}|j|j���}}t|�D];}t%j&dt-|��}
|j/||
z|
z|z��=����|j1�Scc}w)Nc�2�|j|jfSrQ)rvrw)r�s r�<lambda>z&Zone._compute_digest.<locals>.<lambda>1s��#�*�*�c�j�j�9Q�r)rTz!HHIz!H)rrjr$r�SIMPLEr!r+r2r)r�r*r�rf�
to_digestablery�ZONEMDrvrw�struct�packr>r�r�r��digest)rFr�r��hashinfor��hasherr)rp�	rrnamebufr~�rrfixedr��rdatas�rrlens              r�_compute_digestzZone._compute_digests���
#�&�&�~�6���0�0��\�(�(�(�)�)��?�?��(�(�.�.�K��;�;�*�*�*��+�+�K���� �����.�	G�J�D�$��*�*�4�;�;�7�I�"�4�-Q�R�
G���;�&�3�=�=�+?�+?��O�O��O�O�D�,�� �+�+��H�O�O�X�-=�-=�x�|�|���IQ�Q�u�%�-�-�d�k�k�:�Q��Q�#�F�^�G�E�"�K�K��c�%�j�9�E��M�M�)�g�"5��"=��"E�F�G�
G�	G��}�}����	Rs�="F?c��|j�j}|j||�}tjj
jj
|jtjj||||�SrQ)	r��serialr�r2�rdtypesr�r�r>ry)rFr�r�r�r�s     r�compute_digestzZone.compute_digest@sd��
����&�&���%�%�n�f�=���{�{���%�%�,�,��L�L�#�-�-�.�.����PV�
�	
r�zonemdc�N�|r|g}nL|j�J�|j|jtjj�}|�t
�|}|D]:}	|j
|j|j�}||jk(ry�<t�#t$rY�NwxYwrQ)r*rr2ryr�r&r�r�r�r��	Exceptionr()rFr��digestsr�r��computeds      r�
verify_digestzZone.verify_digestKs�����h�G��;�;�*�*�*��#�#�D�K�K����1E�1E�F�C��{����G��	�F�
��/�/��0E�0E�v�}�}�U���v�}�}�,��-�	�(�'���
��
�s�5B�	B$�#B$�Transactionc
�\�t|dt|d|j|j��S)NF�)r��Versionr?r*r]s r�readerzZone.readerbs$���4����a����T�[�[�(Q�R�Rrc�>�t||�}|j�|SrQ)r��_setup_version)rFr�r�s   r�writerzZone.writeres���$��,�������
rc��|jrtjj}n|j}|j|j|fSrQ)r+r2r)r�r*)rF�	effectives  r�origin_informationzZone.origin_informationjs6���?�?������I����I����T�_�_�i�8�8rc��|jSrQ)r>r]s r�	get_classzZone.get_classts���|�|�rc��yrQr�rFr�s  r�	_end_readzZone._end_ready���rc��yrQrr�s  r�
_end_writezZone._end_write|r�rc�N�|j|_|j�||_yyrQ)r?r*)rF�_�versionr*s    r�_commit_versionzZone._commit_versions#���]�]��
��;�;�� �D�K�rc��y)Nr�rr]s r�_get_next_version_idzZone._get_next_version_id�s��r�F)TTNFF)r,NrQ)r,r�)Wrrrrr2rp�Noder8r�__annotations__�dictr9rr)rDr;r	r=�	__slots__�
rdataclass�INrrB�
RdataClass�boolrGrKrMr5rUrXrZr\r`rcrfrjrlrqrsrury�NONErzr~�Rdatasetr|rr�r�r�r�r�r�r�rrr��intr��Rdatar�rr�r�r��transactionr�r�r�r�rr�r
�bytesr�r�r�r�r�r�r�r�r�r�r�r�rrrr7r7xs����14���
�
�L�(�2�s�x�x�}�}�,�-�=�NR�K��"�n�S�X�X�]�]�C�H�H�M�M�-I�J�J�K�R�JN��h�x��4E�0E�'F�G�N�LP��x���5G�1G�(H�I�P�<�I�
.1�^�^�->�->��	%���s�x�x�}�}�c�1�2�3�%����*�*�%��	%�<�"&�B�5�������);�#<�B������B�� ��%�!�#�"�#�!�
?D���#�(�(�-�-��,�-��7;��	������:?D���#�(�(�-�-��,�-��7;��	�#�(�(�-�-�	 ��4
!��c�h�h�m�m�S�&8� 9�
!�d�
!�&7:�m�m�6H�6H��-H��C�H�H�M�M�3�&�'�-H��c�m�m�-�-�s�2�3�-H��c�m�m�-�-�s�2�3�	-H�
�-H�

���	�	�
-H�f7:�m�m�6H�6H��.��C�H�H�M�M�3�&�'�.��c�m�m�-�-�s�2�3�.��c�m�m�-�-�s�2�3�	.�
�.�
�#�,�,�'�'�	(�
.�h7:�m�m�6H�6H�	$'��C�H�H�M�M�3�&�'�$'��c�m�m�-�-�s�2�3�$'��c�m�m�-�-�s�2�3�	$'�

�$'�L+��#�(�(�-�-��,�-�+�<?�L�L�<Q�<Q�+�	
�+�<7:�m�m�6H�6H�	2��C�H�H�M�M�3�&�'�2��c�m�m�-�-�s�2�3�2��c�m�m�-�-�s�2�3�	2�


�����2�p7:�m�m�6H�6H�	,��C�H�H�M�M�3�&�'�,��c�m�m�-�-�s�2�3�,��c�m�m�-�-�s�2�3�	,�

�#�)�)�/�/�	"�,�`7:�m�m�6G�6G�69�m�m�6H�6H�&��c�m�m�-�-�s�2�3�&��c�m�m�-�-�s�2�3�&�
�%����
�
�s�|�|�'<�'<�<�=�	>�	&�D7:�m�m�6G�6G�69�m�m�6H�6H�5��c�m�m�-�-�s�2�3�5��c�m�m�-�-�s�2�3�5�
�%����
�
�s�C�I�I�O�O�;�<�	=�	5�H�� �#�!�W ��W ��W ��	W �

�S�M�W ��
W ��W �
�W �v�� �#�!�
%��%��%�
�S�M�	%�
�%��
%�

�%�N�(<@���C�O�O�7�7�8��	�����	�	�	 �	 ��: ,�2�2� �+� �� �
�	 �J ,�2�2�	
�+�	
��	
�

�����	�	�	&�	&�		
�AE�(��s�{�{���5�5�<�<�=�(�	
�(�.S��$��=��
9�	�x����
�
�&��h�s�x�x�}�}�.E�E�	F�9��

�
�!�
rr7c�$��eZdZdgZ�fd�Z�xZS)�
VersionedNode�idc�0��t�|��d|_y�Nr)�superrGr)rF�	__class__s �rrGzVersionedNode.__init__�s���
������r)rrrr�rG�
__classcell__�rs@rrr�s�����I��rrc���eZdZ�fd�Zej
jdfdejjdej
jdej
jde
dejjf
�fd�
Z
ej
jdfdejjdej
jdej
jde
deejjf
�fd	�
Zej
jfdejjdej
jdej
jdd
fd�Zdejjdd
fd
�Zde
fd�Z�xZS)�ImmutableVersionedNodec����t�|��|j|_t|jD�cgc]!}t
jj|���#c}�|_ycc}wrQ)rrGr�tuple�	rdatasetsr2r~�ImmutableRdataset)rFrpr�rs   �rrGzImmutableVersionedNode.__init__�sI���
�����'�'����<@�N�N�K�S�S�\�\�
+�
+�C�
0�K�
����Ks�&A'Fr>rvrwrmr,c�B��|rtd��t�|�	|||d�S�N�	immutableF)r�rr|�rFr>rvrwrmrs     �rr|z$ImmutableVersionedNode.find_rdataset�s)�����K�(�(��w�$�W�f�f�e�D�Drc�B��|rtd��t�|�	|||d�Sr)r�rrrs     �rrz#ImmutableVersionedNode.get_rdataset�s)�����K�(�(��w�#�G�V�V�U�C�CrNc��td���Nr�r�)rFr>rvrws    rr�z&ImmutableVersionedNode.delete_rdataset�s����$�$rr�c��td��rr )rFr�s  rr�z'ImmutableVersionedNode.replace_rdataset�s
����$�$rc��y�NTrr]s r�is_immutablez#ImmutableVersionedNode.is_immutable�s��r)rrrrGr2ryrrrrzrr~rr|r	rr�r�r$rrs@rrr�sx���
�+.�-�-�*<�*<��	E����*�*�	E��
�
�'�'�	E��
�
�'�'�		E�
�	E�

���	�	�
	E�+.�-�-�*<�*<��	D����*�*�	D��
�
�'�'�	D��
�
�'�'�		D�
�	D�
�#�,�,�'�'�	(�
	D�+.�-�-�*<�*<�	%����*�*�%��
�
�'�'�%��
�
�'�'�	%�

�%�%�C�L�L�,A�,A�%�d�%��d�rrc
�H�eZdZ		ddededeeejjejjfdeejjfd�Zdejjdejjfd	�Z
dejjdeejjfd
�Zdejjdejj dejj deej"j$fd
�Zd�Zd�Zy)r�N�zonerr?r*c�z�||_||_|�||_||_y|j�|_||_yrQ)r&rr?r9r*)rFr&rr?r*s     rrGzVersion.__init__�sA����	�������D�J�����)�)�+�D�J���rr)r,c�X�t||j|jj�SrQ)r5r*r&r+rOs  rr5zVersion._validate_name�s���d�D�K�K����1E�1E�F�Frc�Z�|j|�}|jj|�SrQrirOs  rrszVersion.get_node�s%���"�"�4�(���z�z�~�~�d�#�#rrvrwc�x�|j|�}|�y|j|jj||�SrQ)rsrr&r>r�s     rrzVersion.get_rdataset�s9���}�}�T�"���<��� � ����!2�!2�F�F�C�Crc�6�|jj�SrQr_r]s rr`zVersion.keys�rarc�6�|jj�SrQrer]s rrfz
Version.items�rgr)NN)rrrr7rr	rr2r)rDrpr�rGr5rsryrzr~rrr`rfrrrr�r��s��
IM�*.�
��
�
�
���s�x�x�}�}�c�h�h�m�m�'C�D�E�	
�
������'�
�G�3�8�8�=�=�G�S�X�X�]�]�G�$�S�X�X�]�]�$�x����
�
�/F�$�	D��h�h�m�m�	D��
�
�'�'�	D��
�
�'�'�		D�

�#�,�,�'�'�	(�	D�!�"rr�c���eZdZddedef�fd�
Zdejjdejjfd�Zdejjddfd�Zdejjd	ejjddfd
�Zdejjdej j"dej j"ddfd
�Z�xZS)r:r&r�c����|j�}t�|�	||�|s%|jj	|j�|j
|_t
�|_yrQ)r�rrGr?r�r*�set�changed)rFr&r�rrs    �rrGzWritableVersion.__init__�sS����
&�
&�
(��
����r�"��

�J�J���d�j�j�)��k�k���+.�5��rr)r,c��|j|�}|jj|�}|�||jvr�|jj�}t
|d�r|j|_|�%|jj|j�||j|<|jj|�|S|S)Nr)r5r?rjr0r&r8�hasattrrr�extend�add)rFr)rp�new_nodes    r�
_maybe_cowzWritableVersion._maybe_cows����"�"�4�(���z�z�~�~�d�#���<�4�t�|�|�3��y�y�-�-�/�H��x��&�#�g�g������"�"�)�)�$�.�.�9�'�D�J�J�t���L�L���T�"��O��KrNc��|j|�}||jvr)|j|=|jj|�yyrQ)r5r?r0r4rOs  rruzWritableVersion.delete_nodesA���"�"�4�(���4�:�:���
�
�4� ��L�L���T�"�rr~c�H�|j|�}|j|�yrQ)r6r�)rFr)r~rps    r�put_rdatasetzWritableVersion.put_rdatasets �����t�$�����h�'rrvrwc��|j|�}|j|jj||�t	|�dk(r|j
|=yyr)r6r�r&r>r�r?r�s     rr�zWritableVersion.delete_rdataset$sJ�����t�$�����T�Y�Y�.�.���?��t�9��>��
�
�4� �rr�)rrrr7rrGr2r)rDrpr�r6rur~rr9ryrzr�rrs@rr:r:�s����1�T�1��1� �s�x�x�}�}��������,#����
�
�#�$�#�(��H�H�M�M�(�-0�\�\�-B�-B�(�	
�(�	!��h�h�m�m�	!��
�
�'�'�	!��
�
�'�'�		!�

�	!rr:c�$��eZdZdef�fd�Z�xZS)r<r�c���t�|�|jd�|j|_|j|_|j
D]8}|jj|�}|s�!t|�|j|<�:tjj|jd|jj�|_yr#)
rrGr&rr*r0r?rjrr2r�Dictr9)rFr�r)rprs    �rrGzImmutableVersion.__init__2s����	������t�,��*�*����n�n����O�O�	C�D��=�=�$�$�T�*�D��&<�T�&B��
�
�d�#�		C��]�]�'�'��M�M�4����!6�!6�
��
r)rrrr:rGrrs@rr<r<0s���
��
�
rr<c�~��eZdZd�fd�	Zed��Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Z�xZS)r�c�L��|du}t�|�|||�||_||_yrQ)rrGr��make_immutable)rFr&r�r�r@�	read_onlyrs      �rrGzTransaction.__init__Is-����4�'�	�
����{�I�6����,��rc��|jSrQ)�managerr]s rr&zTransaction.zoneOs���|�|�rc��|j�J�|jj}|�t}||j|j
�|_yrQ)r�rCr;r:r&r�)rF�factorys  rr�zTransaction._setup_versionSsC���|�|�#�#�#��,�,�7�7���?�%�G��t�y�y�$�*:�*:�;��rc�<�|jj|||�SrQ)r�r�rFr)rvrws    r�
_get_rdatasetzTransaction._get_rdatasetZs���|�|�(�(��v�v�>�>rc�X�|jrJ�|jj||�yrQ)rAr�r9)rFr)r~s   r�
_put_rdatasetzTransaction._put_rdataset]s#���>�>�!�!����!�!�$��1rc�V�|jrJ�|jj|�yrQ)rAr�rurOs  r�_delete_namezTransaction._delete_nameas!���>�>�!�!���� � ��&rc�Z�|jrJ�|jj|||�yrQ)rAr�r�rGs    r�_delete_rdatasetzTransaction._delete_rdatasetes%���>�>�!�!����$�$�T�6�6�:rc�<�|jj|�duSrQ�r�rsrOs  r�_name_existszTransaction._name_existsis���|�|�$�$�T�*�$�6�6rc�`�|jryt|jj�dkDS)NFr)rAr�r�r0r]s r�_changedzTransaction._changedls&���>�>���t�|�|�+�+�,�q�0�0rc���|jr|jj|�y|r�t|jj
�dkDr{|jr1|jj}|�t}||j�}n|j}|jj|||jj�y|jj|�yr)
rAr&r�r�r�r0r@rCr=r<r�r*r�)rF�commitrEr�s    r�_end_transactionzTransaction._end_transactionrs����>�>��I�I����%�
��D�L�L�0�0�1�A�5��"�"��,�,�@�@���?�.�G�!�$�,�,�/���,�,���I�I�%�%�d�G�T�\�\�5H�5H�I�
�I�I� � ��&rc�T�|jj�||j_yyrQ)r�r*)rFr*s  r�_set_originzTransaction._set_origin�s#���<�<���&�"(�D�L�L��'rc#�jK�|jj�D]\}}|D]}||f���
�y�wrQ)r�rf)rFr)rpr~s    r�_iterate_rdatasetszTransaction._iterate_rdatasets�s@�����,�,�,�,�.�	'�J�D�$� �
'���X�&�&�
'�	'�s�13c�6�|jj�SrQ)r�r`r]s r�_iterate_nameszTransaction._iterate_names�s���|�|� � �"�"rc�8�|jj|�SrQrPrOs  r�	_get_nodezTransaction._get_node�s���|�|�$�$�T�*�*rc���|jj�\}}}|�K|jj�5|jj}|rtj
j}n|}|||fSrQ)rCr�r�r*r2r)r�)rF�absoluter+r�s    r�_origin_informationzTransaction._origin_information�sc��,0�L�L�,K�,K�,M�)��:�y������ 3� 3� ?��|�|�*�*�H���H�H�N�N�	�$�	��*�i�0�0r)NF)rrrrG�propertyr&r�rHrJrLrNrQrSrVrXrZr\r^rarrs@rr�r�Hs]���-�����<�?�2�'�;�7�1�'� )�'�
#�+�
1rr�TF�textr>�zone_factory�filename�
allow_includer��
idna_codec�allow_directivesc
��|�d}||||��}
|
jd�5}tjj|||��}tjj|||||	��}
	|
j
�	ddd�|r|
j�|
S#tjj$rtjj�wxYw#1swY�XxYw)Nz<string>�r+T)rg)rfrh)
r�r2�	tokenizer�	Tokenizer�zonefile�Reader�readrr&r�)rcr*r>r+rdrerfr�rgrhr&r��tokr�s              r�
_from_textrq�s���&�������J�?�D�	
���T�	�
)�c��m�m�%�%�d�H��%�L�����$�$����'�-�%�
��	)��K�K�M�
)�������K��
�|�|�)�)�	)��(�(�(�(�(�	)��
)�
)�s�AC�)B�8C�C�Cc
�*�t||||||||||	�
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 ``'<string>'``.

    *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``.
    )rq)
rcr*r>r+rdrerfr�rgrhs
          rrCrC�s0��x������������rr�c

���t|t�r|�|}t|�}
ntj|�}
|
5}t||||||||||	�
cddd�S#1swYnxYwJ�)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 ``'<string>'``.

    *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``.
    N)rArBr�r�r�rq)r�r*r>r+rdrerfr�rgrhr�s           r�	from_filertsz��z�!�S�����H�04�Q���
�
#�
#�A�
&��	�
�q��
����������
�
�
�
���5s�A�A�xfrc��d}|D�]}|�L|r
|j}n|jdj}|jdj}||||��}|jD]�}|jj|j�}	|	s)|j
�}	|	|j|j<|	j|j|j|jd�}
|
j|j�|D]}|
j|������|�td��|r|j�|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``.
    NrrjTzempty transfer)r*�answerr)r>r?rjr8r|rvrw�
update_ttlr�r4rEr�)rurdr+r��z�rr*r>r��znode�zrds�rds            r�from_xfrr~es��>	
�A�
����9���������!��)�)���h�h�q�k�)�)�G��V�W��D�A��X�X�	�E��G�G�K�K��
�
�+�E�����(��&+�����
�
�#��&�&�u�}�}�e�l�l�E�L�L�RV�W�D��O�O�E�I�I�&��
�������
�	��"	�y��)�*�*��	�����Hr)Hrr�r�r�r��typingrrrrrrr	r
rr�
dns.exceptionr2�
dns.grange�
dns.immutable�dns.name�dns.node�	dns.rdata�dns.rdataclass�dns.rdataset�
dns.rdatatype�dns.rdtypes.ANY.SOA�dns.rdtypes.ANY.ZONEMD�	dns.rrset�
dns.tokenizer�dns.transaction�dns.ttl�dns.zonefile�
dns.zonetypesr
rr�	exception�DNSExceptionrrrrr!r$r&r(r)rDrr5r�TransactionManagerr7rpr�rrrr�r:r<r�rrrBr�	IDNACodecrqrCrtr~rrr�<module>r�s���$��	�	�
��������������������L�L�%�c�m�m�(�(�%�4�G�4�6�7�6�,�G�,�3�c�m�m�8�8�3�3�S�]�]�%?�%?�3�:�s�}�}�)�)�:�.��
�
� :� :�.��

�(�(�-�-���S�X�X�]�]�#����	�X�X�]�]�	�@N�3�?�?�-�-�N�r�C�H�H�M�M�������*�]�*��*�Z&"�&"�R<!�g�<!�~�����
�w�
��
�.S1�#�/�/�-�-�S1�p37�),���):�):���"���/3�37�'�

�'��U�3�8�8�=�=�#�-�.�/�'��^�^�
&�
&�'��	'�
�'��s�m�
'��'��'�����+�+�,�'��D�(�3�-�/�0�'�
�'�X37�),���):�):���"���/3�37�G�

�G��U�3�8�8�=�=�#�-�.�/�G��^�^�
&�
&�G��	G�
�G��s�m�
G��G��G�����+�+�,�G��D�(�3�-�/�0�G�
�G�X37�),���):�):���"���/3�37�P�
�P��U�3�8�8�=�=�#�-�.�/�P��^�^�
&�
&�P��	P�
�P��s�m�
P��P��P�����+�+�,�P��D�(�3�-�/�0�P�
�P�j���	5
�	�5
��5
��5
��	5
�

�5
r

Zerion Mini Shell 1.0