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

�

5��e�3���ddlmZmZmZmZmZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlZddlZGd�dej"j$�ZGd�dej"j(�ZGd�dej"j$�ZGd	�d
�Zddddddddej0j2f	dej4j6deed
eeeefdeedeedeedeeej<j>dedeej@jBdeej@jBe"fdeejFjHeeffd�Z%dejFjLdeefd�Z'y)�)�Any�List�Optional�Tuple�UnionNc�"��eZdZdZ�fd�Z�xZS)�
TransferErrorz.A zone transfer response got a non-zero rcode.c�v��dtjj|�z}t�|�|�||_y)NzZone transfer error: %s)�dns�rcode�to_text�super�__init__)�selfr�message�	__class__s   ��)/usr/lib/python3/dist-packages/dns/xfr.pyrzTransferError.__init__#s0���+�c�i�i�.?�.?��.F�F��
����!���
�)�__name__�
__module__�__qualname__�__doc__r�
__classcell__)rs@rr	r	 s���8��rr	c��eZdZdZy)�SerialWentBackwardsz:The current serial number is less than the serial we know.N�rrrr�rrrr)s��Drrc��eZdZdZy)�UseTCPz'This IXFR cannot be completed with UDP.Nrrrrrr-s��1rrc	���eZdZdZej
jddfdejjdej
jde
edefd�Z
d	ejjd
efd�Zd�Zd
�Zy)�Inboundz+
    State machine for zone transfers.
    NF�txn_manager�rdtype�serial�is_udpc�"�||_d|_||_|tjj
k(r
|�t
d��|rt
d��||_||_|j�\}}|_
d|_d|_d|_
d|_y)aqInitialize an inbound zone transfer.

        *txn_manager* is a :py:class:`dns.transaction.TransactionManager`.

        *rdtype* can be `dns.rdatatype.AXFR` or `dns.rdatatype.IXFR`

        *serial* is the base serial number for IXFRs, and is required in
        that case.

        *is_udp*, a ``bool`` indidicates if UDP is being used for this
        XFR.
        Nz,a starting serial must be supplied for IXFRszis_udp specified for AXFRF)r"�txnr#r�	rdatatype�IXFR�
ValueErrorr$r%�origin_information�origin�soa_rdataset�done�
expecting_SOA�delete_mode)rr"r#r$r%�_s      rrzInbound.__init__6s���&'���:>�������S�]�]�'�'�'��~� �!O�P�P�
��8�9�9�������)�<�<�>���A�t�{�=A�����	�"��� ��rr�returnc�6
�|j�G|jtjjk(}|j
j
|�|_|j�}|tjjk7rt|��t|j�dkDr�|jdj|jk7rtjjd��|jdj|jk7rtjjd��d}|j ���|j"r&|j"dj|jk7rtjjd��|j"d}|}|jtjj$k7rtjjd��d}|j'�|_|jtjj(k(r�|j dj*|j*k(rd|_n}tj*j/|j dj*�|j*krt0�|j2r!t|j"|d�dk(rt4�d|_|j"|dD�]w}|j}|}|j,rtjjd	��|j�J�|jtjj$k(�rL||jk(�r<|jtjj(k(r|j8|_||j k(�r,|jtjjk(s3|jtjj(k(r�|j8r�|j6rtjjd
��|jtjj(k(r;|j*|dj*k7rtjjd��|jj;||�|jj=�d|_d|_n�d|_|jtjj(k(rx|j8r;|dj*|j*k7rotjjd
��|dj*|_|jj;||�ntjjd�����|j6rgtjj|_d|_d|_|jj?�|j
j
d�|_|j8r|jjA||���\|jjC||���z|j2r+|j,stjjd��|j,S)aZProcess one message in the transfer.

        The message should have the same relativization as was specified when
        the `dns.xfr.Inbound` was created.  The message should also have been
        created with `one_rr_per_rrset=True` because order matters.

        Returns `True` if the transfer is complete, and `False` otherwise.
        Nrzwrong question namezwrong question rdatatypez&No answer or RRset not for zone originzfirst RRset is not an SOA�Tzanswers after final SOAzempty IXFR sequencezunexpected end of IXFR sequenceFzIXFR base serial mismatchzunexpected origin SOA in AXFRzunexpected end of UDP IXFR)"r'r#rr(�AXFRr"�writerr�NOERRORr	�len�question�namer,�	exception�	FormErrorr-�answer�SOA�copyr)r$r.�Serialrr%rr/r0�replace�commit�rollback�delete_exact�add)rr�replacementr�answer_index�rrset�rdatasetr:s        r�process_messagezInbound.process_messageYs����8�8���+�+����);�);�;�K��'�'�.�.�{�;�D�H��
�
����C�I�I�%�%�%���&�&�
�w��� �1�$�����"�'�'�4�;�;�6��m�m�-�-�.C�D�D�����"�)�)�T�[�[�8��m�m�-�-�.H�I�I������$�
�>�>�W�^�^�A�%6�%;�%;�t�{�{�%J��m�m�-�-�.V�W�W��N�N�1�%�E��H����#�-�-�"3�"3�3��m�m�-�-�.I�J�J��L� (�
�
��D���{�{�c�m�m�0�0�0��$�$�Q�'�.�.�$�+�+�=�!%�D�I��Z�Z�&�&�t�'8�'8��';�'B�'B�C�d�k�k�Q�-�-��{�{�s�7�>�>�,�-�+H�'I�Q�'N�
%��
*.�D�&�
�^�^�L�M�2�L	-�E��:�:�D��H��y�y��m�m�-�-�.G�H�H��8�8�'�'�'����#�-�-�"3�"3�3�����8K��;�;�#�-�-�"4�"4�4�+/�+;�+;�';�D�$��t�0�0�0��K�K�3�=�=�#5�#5�5����s�}�}�'9�'9�9�d�>N�>N�
�)�)�!�m�m�5�5�6K�L�L����s�}�}�'9�'9�9� �K�K�8�A�;�+=�+=�=�!�m�m�5�5�6W�X�X��H�H�$�$�T�8�4��H�H�O�O�%�#�D�H� $�D�I�
*/�D�&��{�{�c�m�m�&8�&8�8��+�+�'��{�1�1�T�[�[�@�&)�m�m�&=�&=�$?�'"�!"�
+3�1�+�*<�*<�D�K� �H�H�,�,�T�8�<�"�m�m�5�5�6U�V�V���!�!�"�m�m�0�0���%*��"�#(�� ����!�!�#��+�+�2�2�4�8���������%�%�d�H�5������T�8�,�YL	-�Z�;�;�t�y�y�
�-�-�)�)�*F�G�G��y�y�rc��|S)Nr)rs r�	__enter__zInbound.__enter__�s���rc�P�|jr|jj�y)NF)r'rC)r�exc_type�exc_val�exc_tbs    r�__exit__zInbound.__exit__�s���8�8��H�H����r)rrrrrr(r5�transaction�TransactionManager�	RdataTyper�int�boolrr�MessagerJrLrQrrrr!r!1s����+.�-�-�*<�*<� $��!!��_�_�7�7�!!��
�
�'�'�!!���
�	!!�
�!!�FR�s�{�{�':�':�R�t�R�p�rr!r"r$�use_edns�	ednsflags�payload�request_payload�options�keyring�keyname�keyalgorithmr2c
��|j�\}
}}|
�td��|�tjj}
n�t|t�std��|dk(rt|j�5}|j|d�}|r*|dj}tjj}
nd}tjj}
ddd�n0|dkDr |dkrtjj}
ntd��|j�}tjj|

||d||||�	}|�otjj|dd	|�d
��}|j!|j"|
|tjj$d��}|j'|d�|�|j)|||	�
�||fS#1swY��xYw)aMake an AXFR or IXFR query.

    *txn_manager* is a ``dns.transaction.TransactionManager``, typically a
    ``dns.zone.Zone``.

    *serial* is an ``int`` or ``None``.  If 0, then IXFR will be
    attempted using the most recent serial number from the
    *txn_manager*; it is the caller's responsibility to ensure there
    are no write transactions active that could invalidate the
    retrieved serial.  If a serial cannot be determined, AXFR will be
    forced.  Other integer values are the starting serial to use.
    ``None`` forces an AXFR.

    Please see the documentation for :py:func:`dns.message.make_query` and
    :py:func:`dns.message.Message.use_tsig` for details on the other parameters
    to this function.

    Returns a `(query, serial)` tuple.
    Nzno zone originzserial is not an integerrr>lzserial out-of-rangeFz. . z 0 0 0 0T)�create)�	algorithm)r+r*rr(r5�
isinstancerU�reader�getr$r)�	get_classr�
make_query�rdata�	from_text�
find_rrset�	authorityr>rE�use_tsig)r"r$rXrYrZr[r\r]r^r_�zone_originr1r,r#r'rI�rdclass�qrhrHs                    rrgrg�s���> +�=�=�?��[�!�V����)�*�*�
�~����#�#��
���
$��3�4�4�	�1��
�
�
�
!�	,�S��w�w�v�u�-�H��!�!��+�+�����+�+�������+�+��	,�	,�
�!����+����#�#���.�/�/��#�#�%�G����������
�����
	�A����	�	�#�#�G�U�d�6�(�(�4K�L�����
�K�K��g�s�}�}�/@�/@���
��	�	�	�%�����	�
�
�7�G�|�
�<�
�v�;��A	,�	,�s
�/AG�G�queryc���t|tjj�st	d��|j
d}|jtjjk(ry|jtjjk7rt	d��|j|j|j|jtjj�}|djS)a7Extract the SOA serial number from query if it is an IXFR and return
    it, otherwise return None.

    *query* is a dns.message.QueryMessage that is an IXFR or AXFR request.

    Raises if the query is not an IXFR or AXFR, or if an IXFR doesn't have
    an appropriate SOA RRset in the authority section.
    zquery not a QueryMessagerNzquery is not an AXFR or IXFR)rcrr�QueryMessager*r9r#r(r5r)rjrkr:rnr>r$)rpr9�soas   r�extract_serial_from_queryrtDs����e�S�[�[�5�5�6��3�4�4��~�~�a� �H����#�-�-�,�,�,��	���C�M�M�.�.�	.��7�8�8�
�
�
�
�������(8�(8�#�-�-�:K�:K��C��q�6�=�=�r)(�typingrrrrr�
dns.exceptionr�dns.message�dns.name�	dns.rcode�dns.rdataset�
dns.rdatatype�
dns.serial�dns.transaction�dns.tsig�dns.zoner;�DNSExceptionr	r<rrr!�tsig�default_algorithmrRrSrUrV�edns�Optionr:�Name�strrrrrgrWrtrrr�<module>r�s���$5�4������������C�M�M�.�.��E�#�-�-�1�1�E�2�S�]�]�
'�
'�2�F�F�V�+/�#�!�%)�/3��'+�.1�h�h�.H�.H�G����3�3�G��S�M�G��u�S�$�Y�'�(�G���}�	G�
�c�]�G��c�]�
G��d�3�8�8�?�?�+�
,�G��G��c�h�h�m�m�
$�G�����
�
�s�*�+�G��3�;�;�#�#�X�c�]�2�3�G�T�S�[�[�%8�%8��X�c�]�r

Zerion Mini Shell 1.0