%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__/update.cpython-312.pyc

�

5��e�/��@�dZddlmZmZmZmZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZGd�dejj �ZGd�dej$j&�ZeZej,Zej.Zej0Zej2Zy)zDNS Dynamic Update Support�)�Any�List�Optional�UnionNc�0�eZdZdZdZdZdZdZed��Z	y)�
UpdateSectionzUpdate sectionsr���c��y)Nr�)�clss �,/usr/lib/python3/dist-packages/dns/update.py�_maximumzUpdateSection._maximum(s���N)
�__name__�
__module__�__qualname__�__doc__�ZONE�PREREQ�UPDATE�
ADDITIONAL�classmethodrr
rrrr s+����D�
�F�
�F��J����rrc�R��eZdZeZdejjddejjdfde
eejjefdejjde
ede
ejjdeejjefde
ef�fd�
Zed	eej*j,fd
��Zej0d��Zed	eej*j,fd��Zej0d
��Zed	eej*j,fd��Zej0d��Zdd�Zd�Zdeejjefded	dfd�Zdeejjefded	dfd�Zdeejjefded	dfd�Zdeejjefded	dfd�Z 	ddeejjefde
eejBjDefd	dfd�Z#d�Z$d�Z%�xZ&S)�
UpdateMessageN�zone�rdclass�keyring�keyname�keyalgorithm�idc�R��t�|�|��|xjtjjtjj�zc_t|t�rtjj|�}||_tjjj|�}||_|jrC|j!|j"|j|tj$j&dd��|�|j)|||��yy)axInitialize a new DNS Update object.

        See the documentation of the Message class for a complete
        description of the keyring dictionary.

        *zone*, a ``dns.name.Name``, ``str``, or ``None``, the zone
        which is being updated.  ``None`` should only be used by dnspython's
        message constructors, as a zone is required for the convenience
        methods like ``add()``, ``replace()``, etc.

        *rdclass*, an ``int`` or ``str``, the class of the zone.

        The *keyring*, *keyname*, and *keyalgorithm* parameters are passed to
        ``use_tsig()``; see its documentation for details.
        )r"T)�create�force_uniqueN)�	algorithm)�super�__init__�flags�dns�opcode�to_flagsr�
isinstance�str�name�	from_text�origin�
rdataclass�
RdataClass�make�zone_rdclass�
find_rrsetr�	rdatatype�SOA�use_tsig)�selfrrrr r!r"�	__class__s       �rr(zUpdateMessage.__init__1s����0	���B����
�
�c�j�j�)�)�#�*�*�*;�*;�<�<�
��d�C� ��8�8�%�%�d�+�D�����.�.�+�+�0�0��9��#����;�;��O�O��	�	������
�
�!�!��!�

�
����M�M�'�7�l�M�C�r�returnc� �|jdS)zThe zone section.r��sections�r:s rrzUpdateMessage.zone\����}�}�Q��rc�"�||jd<y)Nrr>�r:�vs  rrzUpdateMessage.zonea�����
�
�a�rc� �|jdS)zThe prerequisite section.r	r>r@s r�prerequisitezUpdateMessage.prerequisiteerArc�"�||jd<y)Nr	r>rCs  rrGzUpdateMessage.prerequisitejrErc� �|jdS)zThe update section.r
r>r@s r�updatezUpdateMessage.updatenrArc�"�||jd<y)Nr
r>rCs  rrJzUpdateMessage.updatesrErc
��|�|j}|j�}|j|||j|j||dd�}|j||�y)z&Add a single RR to the update section.NT)rJ�coversr6r5�rdtype�add)r:r/�ttl�rd�deleting�sectionrM�rrsets        r�_add_rrzUpdateMessage._add_rrwsW���?��k�k�G����������T�4�,�,�b�i�i���4�QU�
��	�	�	�"�c�rc��t|t�r tjj	|d�}t|dtj
j�rL|D]F}|r|j||j�|D]!}|j||j||���#�Hyt|�}t|jd��}t|dtjj�r>|r|j||dj�|D]}|j||||���ytj j"j%|jd��}|r|j||�|D]M}	tjj	|j&||	|j(�}|j||||���Oy)a�Add records.

        *replace* is the replacement mode.  If ``False``,
        RRs are added to an existing RRset; if ``True``, the RRset
        is replaced with the specified contents.  The second
        argument is the section to add to.  The third argument
        is always a name.  The other arguments can be:

                - rdataset...

                - ttl, rdata...

                - ttl, rdtype, string...
        Nr)rS)r-r.r*r/r0�rdataset�Rdataset�deleterNrUrP�list�int�pop�rdata�Rdatar7�	RdataTyper4r5r1)
r:�replacerSr/�args�rdsrQrPrN�ss
          r�_addzUpdateMessage._add�sz�� �d�C� ��8�8�%�%�d�D�1�D��d�1�g�s�|�|�4�4�5��
E����K�K��c�j�j�1��E�B��L�L��s�w�w��G�L�D�E�
E���:�D��d�h�h�q�k�"�C��$�q�'�3�9�9�?�?�3���K�K��d�1�g�n�n�5��A�B��L�L��s�B��L�@�A����0�0�5�5�d�h�h�q�k�B����K�K��f�-��A�A����,�,�T�->�->���4�;�;�W�B��L�L��s�B��L�@�Arr/rac�B�|jd|j|g|���y)z�Add records.

        The first argument is always a name.  The other
        arguments can be:

                - rdataset...

                - ttl, rdata...

                - ttl, rdtype, string...
        FN�rdrJ�r:r/ras   rrOzUpdateMessage.add�s��	��	�	�%����d�2�T�2rc
�.�t|t�r tjj	|d�}t|�dk(r�|j
|j|tjjtjjtjjtjjdd�yt|dtjj�r;|D]5}|D].}|j|d|tjj��0�7yt|�}t|dtj j"�r4|D].}|j|d|tjj��0ytjj$j'|j)d��}t|�dk(r]|j
|j||j*|tjjtjjdd�y|D]d}tj j	|j*|||j,�}|j|d|tjj��fy)z�Delete records.

        The first argument is always a name.  The other
        arguments can be:

                - *empty*

                - rdataset...

                - rdata...

                - rdtype, [string...]
        NrT)r-r.r*r/r0�lenr6rJr2�ANYr7�NONErWrXrUrZr]r^r_r4r\r5r1)r:r/rarbrQ�largsrNrcs        rrYzUpdateMessage.delete�s����d�C� ��8�8�%�%�d�D�1�D��t�9��>��O�O��������"�"��
�
�!�!��
�
�"�"����"�"���	
���Q�����!6�!6�
7��
C���C�B��L�L��q�"�c�n�n�.A�.A�B�C�
C���J�E��%��(�C�I�I�O�O�4��C�B��L�L��q�"�c�n�n�.A�.A�B�C����0�0�5�5�e�i�i��l�C���u�:��?��O�O������)�)���
�
�*�*����*�*���	�#�G�� �Y�Y�0�0� �-�-�"�� �K�K�	�����T�1�b�#�.�.�2E�2E�F�Grc�B�|jd|j|g|���y)abReplace records.

        The first argument is always a name.  The other
        arguments can be:

                - rdataset...

                - ttl, rdata...

                - ttl, rdtype, string...

        Note that if you want to replace the entire node, you should do
        a delete of the name followed by one or more calls to add.
        TNrfrgs   rr`zUpdateMessage.replace�s�� 	��	�	�$����T�1�D�1rc
��t|t�r tjj	|d�}t|�dk(rk|j
|j|tjjtjjtjjddd�yt|dtjj�s5t|dtjj�st|�dkDr�t|dtjj�s=t!|�}|j#dd�|j$d|j|g|���y|j$d|j|g|���ytjj&j)|d�}|j
|j|tjj|tjjddd�y)aSRequire that an owner name (and optionally an rdata type,
        or specific rdataset) exists as a prerequisite to the
        execution of the update.

        The first argument is always a name.
        The other arguments can be:

                - rdataset...

                - rdata...

                - rdtype, string...
        NrTr	F)r-r.r*r/r0rir6rGr2rjr7rkrWrXr]r^rZ�insertrdr_r4)r:r/rarlrNs     r�presentzUpdateMessage.presentsw���d�C� ��8�8�%�%�d�D�1�D��t�9��>��O�O��!�!�����"�"��
�
�!�!��
�
�"�"����	
�
�t�A�w���� 5� 5�6��$�q�'�3�9�9�?�?�3��4�y�1�}��d�1�g�s�|�|�'<�'<�=��T�
�����Q��"���	�	�%��!2�!2�D�A�5�A���	�	�%��!2�!2�D�@�4�@��]�]�,�,�1�1�$�q�'�:�F��O�O��!�!�����"�"���
�
�"�"����	
rrNc
�4�t|t�r tjj	|d�}|�k|j|j|tjjtjjtjjddd�ytjjj|�}|j|j|tjj|tjjddd�y)z�Require that an owner name (and optionally an rdata type) does
        not exist as a prerequisite to the execution of the update.NT)
r-r.r*r/r0r6rGr2rkr7rjr_r4)r:r/rNs   r�absentzUpdateMessage.absent<s����d�C� ��8�8�%�%�d�D�1�D��>��O�O��!�!�����#�#��
�
�!�!��
�
�"�"����	
��]�]�,�,�1�1�&�9�F��O�O��!�!�����#�#���
�
�"�"����	
rc��y)NTr
)r:�values  r�_get_one_rr_per_rrsetz#UpdateMessage._get_one_rr_per_rrset^s��rc�R�d}d}|tjk(rbtjj	|�s)|tj
jk7s|jr�tjj�|jstjj�|tjjtjjfvrM|}|jdj}|tjjk(xs|tjk(}||||fS)NFr)rrr*r2�is_metaclassr7r8r�	exception�	FormErrorrjrkrr)r:rSr/rrNrR�emptys       r�_parse_rr_headerzUpdateMessage._parse_rr_headerbs��������m�(�(�(����+�+�G�4��S�]�]�.�.�.��9�9��m�m�-�-�-��9�9��m�m�-�-�-��3�>�>�-�-�s�~�~�/B�/B�C�C�"���)�)�A�,�.�.������ 2� 2�2�U�g��AU�AU�6U�����5�1�1r)NN)N)'rrrr�
_section_enumr*r2�IN�tsig�default_algorithmrrr/�Namer.r3rr[r(�propertyrrT�RRsetr�setterrGrJrUrdrOrYr`rpr7r_rrrur{�
__classcell__)r;s@rrr-s����!�M�59�-0�^�^�->�->�!%�+/�25�(�(�2L�2L� �)D��u�S�X�X�]�]�C�/�0�1�)D����*�*�)D��#��	)D�
�#�(�(�-�-�(�)D��C�H�H�M�M�3�.�/�
)D�
�S�M�)D�V� �d�3�9�9�?�?�+� �� �
�[�[����� �d�3�9�9�?�?�3� �� �������� ��S�Y�Y�_�_�-� �� ��]�]����	�&A�P
3��c�h�h�m�m�S�0�1�
3�#�
3�$�
3�:G�5�������!3�4�:G�S�:G�T�:G�x2�E�#�(�(�-�-��"4�5�2�c�2�d�2�$3�E�#�(�(�-�-��"4�5�3�c�3�d�3�pAE� ��C�H�H�M�M�3�&�'� ���s�}�}�6�6��;�<�=� �
�	 �D�2rr)r�typingrrrr�dns.messager*�dns.name�
dns.opcode�	dns.rdata�dns.rdataclass�dns.rdataset�
dns.rdatatype�dns.tsig�enum�IntEnumr�message�Messager�Updaterrrrr
rr�<module>r�s���$!�-�-���������
�C�H�H�$�$�
�H2�C�K�K�'�'�H2�X

������	�	�	��	�	�	��
�
%�
%�
r

Zerion Mini Shell 1.0