AlkantarClanX12

Your IP : 18.117.232.215


Current Path : /lib/python3.6/site-packages/dns/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/dns/__pycache__/opcode.cpython-36.pyc

3

�b�W�	�@s�dZddlZdZdZdZdZdZeeeeed�Ze	dd	�ej
�D��ZGd
d�dejj
�Zdd
�Zdd�Zdd�Zdd�Zdd�ZdS)zDNS Opcodes.�N����)�QUERY�IQUERY�STATUS�NOTIFY�UPDATEccs|]\}}||fVqdS)N�)�.0�x�yrr�/usr/lib/python3.6/opcode.py�	<genexpr>&src@seZdZdZdS)�
UnknownOpcodezAn DNS opcode is unknown.N)�__name__�
__module__�__qualname__�__doc__rrrrr)srcCsB|j�r$t|�}|dkr$|dkr$|Stj|j��}|dkr>t�|S)z�Convert text into an opcode.

    @param text: the textual opcode
    @type text: string
    @raises UnknownOpcode: the opcode is unknown
    @rtype: int
    r�N)�isdigit�int�_by_text�get�upperr)�text�valuerrr�	from_text.s	rcCs|d@d?S)zUExtract an opcode from DNS message flags.

    @param flags: int
    @rtype: int
    ix�r)�flagsrrr�
from_flagsAsr!cCs|d>d@S)z`Convert an opcode to a value suitable for ORing into DNS message
    flags.
    @rtype: int
    rixr)rrrr�to_flagsKsr"cCstj|�}|dkrt|�}|S)z�Convert an opcode to text.

    @param value: the opcdoe
    @type value: int
    @raises UnknownOpcode: the opcode is unknown
    @rtype: string
    N)�	_by_valuer�str)rrrrr�to_textTs	
r%cCst|�tkS)znTrue if the opcode in flags is UPDATE.

    @param flags: DNS flags
    @type flags: int
    @rtype: bool
    )r!r
)r rrr�	is_updatecsr&)rZ
dns.exceptionZdnsrrrr	r
r�dict�itemsr#Z	exceptionZDNSExceptionrrr!r"r%r&rrrr�<module>s$