Your IP : 216.73.216.209
3
�b�W� �@s�dZddlZdZdZdZdZdZeeeeed�Ze dd �ej
�D��ZGd
d�dejj
�Zdd
�Zdd�Zdd�Zdd�Zdd�ZdS)zDNS 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%cCst|�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 exceptionZDNSExceptionrrr!r"r%r&rrrr�<module>s$
?>