%PDF- %PDF-
Mini Shell

Mini Shell

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

�

5��etA���dZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
e
j,j.ZGd�de
j2j4�ZGd�de
j2j4�ZGd�d	e
j,j.�Ze
j<j<Gd
�de��Z				dde
e
j@jBe"fd
e
e
jFjHe"fde%dee"de	e
jLjNde	e
jLjPde)de	e
jLjPdefd�Z*de
e
j@jBe"fd
e
e
jFjHe"fde%dedef
d�Z+de%dee
jXjZdefd�Z.de%dedefd�Z/y)zHDNS rdatasets (an rdataset is a set of rdatas of a given type and class)�N)�Any�
Collection�Dict�List�Optional�Union�castc��eZdZdZy)�DifferingCoversz~An attempt was made to add a DNS SIG/RRSIG whose covered type
    is not the same as that of the other rdatas in the rdataset.N��__name__�
__module__�__qualname__�__doc__���./usr/lib/python3/dist-packages/dns/rdataset.pyrr's��Drrc��eZdZdZy)�IncompatibleTypesz?An attempt was made to add DNS RR data of an incompatible type.Nrrrrrr,s��Irrc����eZdZdZgd�Zejjdfdejjdejjdejjdef�fd�
Z�fd	�Z
ded
dfd�Z	d$d
ejj deed
df�fd�
Z�fd�Z�fd�Z�fd�Zd�Zd�Zd�Z�fd�Zd�Z					d%deej6j8deej6j8dedeejjdedeee fd
efd�Z!				d&dej6j8de deej6jDdeej6j8deejjd ed
efd!�Z#dejjdejjdejjd
efd"�Z$d
e%ejj fd#�Z&�xZ'S)'�RdatasetzA DNS rdataset.)�rdclass�rdtype�covers�ttlrrrrrc�Z��t�|��||_||_||_||_y)a5Create a new rdataset of the specified class and type.

        *rdclass*, a ``dns.rdataclass.RdataClass``, the rdataclass.

        *rdtype*, an ``dns.rdatatype.RdataType``, the rdatatype.

        *covers*, an ``dns.rdatatype.RdataType``, the covered rdatatype.

        *ttl*, an ``int``, the TTL.
        N)�super�__init__rrrr)�selfrrrr�	__class__s     �rrzRdataset.__init__5s,���$	�������/5���/5�����rc���t�|��}|j|_|j|_|j|_|j
|_|S�N)r�_clonerrrr)r�objr s  �rr#zRdataset._cloneMs@����g�n����l�l����[�[��
��[�[��
��(�(����
r�returnNc��tjj|�}t|�dk(r||_y||jkr||_yy)aPerform TTL minimization.

        Set the TTL of the rdataset to be the lesser of the set's current
        TTL or the specified TTL.  If the set contains no rdatas, set the TTL
        to the specified TTL.

        *ttl*, an ``int`` or ``str``.
        rN)�dnsr�make�len�rrs  r�
update_ttlzRdataset.update_ttlUs?���g�g�l�l�3����t�9��>��D�H�
�4�8�8�^��D�H�r�rdc���|j|jk7s|j|jk7rt�|�|j|�|jtj
jk(s'|jtj
jk(rb|j�}t|�dk(r/|jtj
jk(r||_n|j|k7rt�tj
j|j�rt|�dkDr|j�t�|�=|�y)a!Add the specified rdata to the rdataset.

        If the optional *ttl* parameter is supplied, then
        ``self.update_ttl(ttl)`` will be called prior to adding the rdata.

        *rd*, a ``dns.rdata.Rdata``, the rdata

        *ttl*, an ``int``, the TTL.

        Raises ``dns.rdataset.IncompatibleTypes`` if the type and class
        do not match the type and class of the rdataset.

        Raises ``dns.rdataset.DifferingCovers`` if the type is a signature
        type and the covered type does not match that of the rdataset.
        Nr)rrrr+r'�	rdatatype�RRSIG�SIGrr)�NONEr�is_singleton�clearr�add)rr,rrr s    �rr4zRdataset.addds����2�<�<�2�:�:�%�����	�	�)A�#�#��?��O�O�C� ��;�;�#�-�-�-�-�-�����
�
�@Q�@Q�1Q��Y�Y�[�F��4�y�A�~�$�+�+����1C�1C�"C�$�������&�%�%��=�=�%�%�b�i�i�0�S��Y��]��J�J�L�
���B�rc�Z��|j|j�t�|�
|�yr")r+rr�union_update�r�otherr s  �rr6zRdataset.union_update�s �������	�	�"�
���U�#rc�Z��|j|j�t�|�
|�yr")r+rr�intersection_updater7s  �rr:zRdataset.intersection_update�s �������	�	�"�
��#�E�*rc�Z��|j|j�t�|�
|�y)z�Add all rdatas in other to self.

        *other*, a ``dns.rdataset.Rdataset``, the rdataset from which
        to update.
        N)r+rr�updater7s  �rr<zRdataset.update�s!���	
����	�	�"�
���u�rc�D��d��ddj�fd�|D��zS)Nc�2�t|�dkDr|dddzS|S)N�dz...)r))�ss r�maybe_truncatez,Rdataset._rdata_repr.<locals>.maybe_truncate�s"���1�v��|���#�w���&��Hrz[%s]z, c3�F�K�|]}d�t|��z���y�w)z<%s>N)�str)�.0�rrrAs  �r�	<genexpr>z'Rdataset._rdata_repr.<locals>.<genexpr>�s�����!R�r�&�>�#�b�'�+B�"B�!R�s�!)�join)rrAs @r�_rdata_reprzRdataset._rdata_repr�s$���	�
��	�	�!R�T�!R�R�R�Rrc�j�|jdk(rd}n/dtjj|j�zdz}dtjj|j
�zdztjj|j�z|zdz|j�zdzS)	Nr��(�)z<DNS � z rdataset: �>)rr'r.�to_text�
rdataclassrrrH)r�ctexts  r�__repr__zRdataset.__repr__�s����;�;�!���E��#�-�-�/�/����<�<�s�B�E���n�n�$�$�T�\�\�2�
3��
��m�m�#�#�D�K�K�0�
1��	
�
�
���� �

!��
�		
rc�"�|j�Sr")rO�rs r�__str__zRdataset.__str__�s���|�|�~�rc����t|t�sy|j|jk7s2|j|jk7s|j|jk7ryt
�|�|�S)NF)�
isinstancerrrrr�__eq__r7s  �rrXzRdataset.__eq__�sR����%��*���L�L�E�M�M�)��{�{�e�l�l�*��{�{�e�l�l�*���w�~�e�$�$rc�&�|j|�Sr")rX�rr8s  r�__ne__zRdataset.__ne__�s���;�;�u�%�%�%r�name�origin�
relativize�override_rdclass�
want_comments�kwc���|� |j||�}t|�}d}nd}d}tj�}	|�|}
n|j}
t|�dk(rh|	j
dj||tjj|
�tjj|j���n�|D]�}d}|r|jrd|j��}|	j
d|||jtjj|
�tjj|j�|jd
||d�|��|fz���|	j�dd	S)auConvert the rdataset into DNS zone file format.

        See ``dns.name.Name.choose_relativity`` for more information
        on how *origin* and *relativize* determine the way names
        are emitted.

        Any additional keyword arguments are passed on to the rdata
        ``to_text()`` method.

        *name*, a ``dns.name.Name``.  If name is not ``None``, emit RRs with
        *name* as the owner name.

        *origin*, a ``dns.name.Name`` or ``None``, the origin for relative
        names.

        *relativize*, a ``bool``.  If ``True``, names will be relativized
        to *origin*.

        *override_rdclass*, a ``dns.rdataclass.RdataClass`` or ``None``.
        If not ``None``, use this class instead of the Rdataset's class.

        *want_comments*, a ``bool``.  If ``True``, emit comments for rdata
        which have them.  The default is ``False``.
        NrMrJrz
{}{}{} {}
z ;z%s%s%d %s %s %s%s
)r]r^���r)�choose_relativityrC�io�StringIOrr)�write�formatr'rPrOr.r�	rdcommentr�getvalue)
rr\r]r^r_r`ra�ntext�padr@rr,�extras
             rrOzRdataset.to_text�sW��D���)�)�&�*�=�D���I�E��C��E��C��K�K�M���'�&�G��l�l�G��t�9��>�
�G�G��$�$����N�N�*�*�7�3��M�M�)�)�$�+�+�6�	�
��
���� ��|�|�"$�R�\�\�N� 3�����)���������.�.�w�7��
�
�-�-�d�k�k�:�"��
�
�N�&�Z�N�2�N���	��
�(�z�z�|�C�R� � r�file�compress�want_shufflec	�j�|�|}d}n|j}t|�dk(rF|j|||�|jt	j
d|j|dd��y|r!t|�}tj|�n|}|D]�}	|j|||�|jt	j
d|j||j��tjj|d�5|	j|||�ddd���t|�S#1swY��xYw)atConvert the rdataset to wire format.

        *name*, a ``dns.name.Name`` is the owner name to use.

        *file* is the file where the name is emitted (typically a
        BytesIO file).

        *compress*, a ``dict``, is the compression table to use.  If
        ``None`` (the default), names will not be compressed.

        *origin* is a ``dns.name.Name`` or ``None``.  If the name is
        relative and origin is not ``None``, then *origin* will be appended
        to it.

        *override_rdclass*, an ``int``, is used as the class instead of the
        class of the rdataset.  This is useful when rendering rdatasets
        associated with dynamic updates.

        *want_shuffle*, a ``bool``.  If ``True``, then the order of the
        Rdatas within the Rdataset will be shuffled before rendering.

        Returns an ``int``, the number of records emitted.
        NFrz!HHIH�z!HHI�)rr)�to_wirerg�struct�packr�list�random�shufflerr'�renderer�prefixed_length)
rr\rnror]r_rpr�lr,s
          rrtzRdataset.to_wires��B�'�&�G� �L��l�l�G��t�9��>��L�L��x��0��J�J�v�{�{�7�D�K�K��!�Q�G�H�����J�����q�!����
7�����T�8�V�4��
�
�6�;�;�v�t�{�{�G�T�X�X�N�O��\�\�1�1�$��:�7��J�J�t�X�v�6�7�7�
7�
�t�9��7�7�s�D)�)D2	c�`�|j|k(r|j|k(r|j|k(ryy)zaReturns ``True`` if this rdataset matches the specified class,
        type, and covers.
        TF)rrr)rrrrs    r�matchzRdataset.matchQs-���<�<�7�"�t�{�{�f�'<����PV�AV��rc�\�t|�dk(rgS|djt|��S)aTReturn rdatas in a valid processing order according to the type's
        specification.  For example, MX records are in preference order from
        lowest to highest preferences, with items of the same preference
        shuffled.

        For types that do not define a processing order, the rdatas are
        simply shuffled.
        r)r)�_processing_order�iterrTs r�processing_orderzRdataset.processing_order^s-���t�9��>��I���7�,�,�T�$�Z�8�8rr")NNTNF)NNNT)(r
rrr�	__slots__r'r.r1rP�
RdataClass�	RdataType�intrr#r+�rdata�Rdatarr4r6r:r<rHrRrUrXr[r\�Name�boolrrCrrO�CompressTypertr~rr��
__classcell__�r s@rrr0sW����6�I�+.�-�-�*<�*<������*�*���
�
�'�'���
�
�'�'�	�
��0�
�c�
�d�
� 9=�%��)�)�/�/�%�(0��
�%�	
�%�N$�+��S�
� �	%�&�
)-�*.��@D�#�
Q!��s�x�x�}�}�%�Q!�������'�Q!��	Q!�
#�3�>�>�#<�#<�=�Q!��
Q!��3��8�n�Q!�

�Q!�n59�*.�@D�!�6��h�h�m�m�6��6��3�8�8�0�0�1�	6�
������'�6�#�3�>�>�#<�#<�=�
6��6�

�6�p����*�*���
�
�'�'���
�
�'�'�	�

��9�$�s�y�y���"7�9rrc���eZdZdZeZdef�fd�Zd�Zdd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Z�fd�Z�fd�Z�fd�Z�fd�Z�fd�Z�fd�Z�xZS)�ImmutableRdatasetzAn immutable DNS rdataset.�rdatasetc����t�|�|j|j|j|j
�tjj|j�|_	y)z9Create an immutable rdataset from the specified rdataset.N)
rrrrrrr'�	immutabler�items)rr�r s  �rrzImmutableRdataset.__init__ssI���	������h�o�o�x������	
��]�]�'�'����7��
rc��td���Nr���	TypeErrorr*s  rr+zImmutableRdataset.update_ttl{�
����$�$rc��td��r�r�)rr,rs   rr4zImmutableRdataset.add~r�rc��td��r�r�rZs  rr6zImmutableRdataset.union_update�r�rc��td��r�r�rZs  rr:z%ImmutableRdataset.intersection_update�r�rc��td��r�r�rZs  rr<zImmutableRdataset.update�r�rc��td��r�r�)r�is  r�__delitem__zImmutableRdataset.__delitem__�r�rc��td��r�r�rZs  r�__ior__zImmutableRdataset.__ior__�r�rc��td��r�r�rZs  r�__iand__zImmutableRdataset.__iand__�r�rc��td��r�r�rZs  r�__iadd__zImmutableRdataset.__iadd__�r�rc��td��r�r�rZs  r�__isub__zImmutableRdataset.__isub__�r�rc��td��r�r�rTs rr3zImmutableRdataset.clear�r�rc�2��tt�|�	��Sr"�r�r�copy�rr s �r�__copy__zImmutableRdataset.__copy__����� �����0�0rc�2��tt�|�	��Sr"r�r�s �rr�zImmutableRdataset.copy�r�rc�4��tt�|�	|��Sr")r�r�unionr7s  �rr�zImmutableRdataset.union�s��� ����u�!5�6�6rc�4��tt�|�	|��Sr")r�r�intersectionr7s  �rr�zImmutableRdataset.intersection�s��� ���!5�e�!<�=�=rc�4��tt�|�	|��Sr")r�r�
differencer7s  �rr�zImmutableRdataset.difference�s��� ���!3�E�!:�;�;rc�4��tt�|�	|��Sr")r�r�symmetric_differencer7s  �rr�z&ImmutableRdataset.symmetric_difference�s��� ���!=�e�!D�E�Err")r
rrrr�_clone_classrr+r4r6r:r<r�r�r�r�r�r3r�r�r�r�r�r�r�r�s@rr�r�mss���$��L�8��8�%�%�%�%�%�%�%�%�%�%�%�1�1�7�>�<�F�Frr�rrr�text_rdatas�
idna_codecr]r^�
relativize_tor%c
��tjjj|�}tjj
j|�}t
||�}|j|�|D]L}	tjj|j|j|	||||�}
|j|
��N|S)a|Create an rdataset with the specified class, type, and TTL, and with
    the specified list of rdatas in text format.

    *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA
    encoder/decoder to use; if ``None``, the default IDNA 2003
    encoder/decoder is used.

    *origin*, a ``dns.name.Name`` (or ``None``), the
    origin to use for relative names.

    *relativize*, a ``bool``.  If true, name will be relativized.

    *relativize_to*, a ``dns.name.Name`` (or ``None``), the origin to use
    when relativizing names.  If not set, the *origin* value will be used.

    Returns a ``dns.rdataset.Rdataset`` object.
    )
r'rPr�r(r.r�rr+r��	from_textrrr4)rrrr�r�r]r^r��r�tr,s           r�from_text_listr��s���8�n�n�'�'�,�,�W�5�G�
�]�]�
$�
$�
)�
)�&�
1�F���&�!�A��L�L���
���
�Y�Y�
 �
 �
�I�I�q�x�x��F�J�
�z�
��	
���b�	�	�

�Hrc	�H�t|||ttt|��S)z�Create an rdataset with the specified class, type, and TTL, and with
    the specified rdatas in text format.

    Returns a ``dns.rdataset.Rdataset`` object.
    )r�r	rrC)rrrr�s    rr�r��s ���'�6�3��Z��_�k�0R�S�Sr�rdatasc���t|�dk(rtd��d}|D]F}|�1t|j|j�}|j|�|j
|��H|�J�|S)z�Create an rdataset with the specified TTL, and with
    the specified list of rdata objects.

    Returns a ``dns.rdataset.Rdataset`` object.
    rzrdata list must not be emptyN)r)�
ValueErrorrrrr+r4)rr�r�r,s    r�from_rdata_listr��sq���6�{�a���7�8�8��A�����9�����R�Y�Y�/�A�
�L�L���	���b�	�	�

�=��=��Hrc�l�t|tttjj
|��S)z�Create an rdataset with the specified TTL, and with
    the specified rdata objects.

    Returns a ``dns.rdataset.Rdataset`` object.
    )r�r	rr'r�r�)rr�s  r�
from_rdatar��s%���3��Z��	�	���%@�&� I�J�Jr)NNTN)0rrerxru�typingrrrrrrr	�
dns.exceptionr'�
dns.immutable�dns.name�	dns.rdata�dns.rdataclass�
dns.rdatatype�dns.renderer�dns.set�dns.ttl�set�Set�	SimpleSet�	exception�DNSExceptionrrrr�r�rPr�rCr.r�r�r\�	IDNACodecr�r�r�r�r�r�r�r�rrr�<module>r�s��$O�	�
�
�E�E�E����������
�G�G�K�K�	�D�c�m�m�0�0�D�
J��
�
�2�2�J�z9�s�w�w�{�{�z9�z	�����BF��BF��BF�T04�&*��-1�%
�
�3�>�>�,�,�c�1�
2�%
��#�-�-�)�)�3�.�/�%
�

�%
��C��	%
�
����+�+�,�%
�
�S�X�X�]�]�#�
%
��%
��C�H�H�M�M�*�%
��%
�PT�
�3�>�>�,�,�c�1�
2�T��#�-�-�)�)�3�.�/�T�

�T��	T�
�T�
��
�j������&A�
�h�
�&K�C�K�#�K�(�Kr

Zerion Mini Shell 1.0