???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................3
¢báWê	  ã               @   s†   d Z ddlZdZdZdZdZdZeeeeedœZe	dd	„ ej
ƒ D ƒƒZG d
d„ dejjƒZdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )zDNS Opcodes.é    Né   é   é   é   )ÚQUERYÚIQUERYÚSTATUSÚNOTIFYÚUPDATEc             c   s   | ]\}}||fV  qd S )N© )Ú.0ÚxÚyr   r   ú/usr/lib/python3.6/opcode.pyú	<genexpr>&   s    r   c               @   s   e Zd ZdZdS )ÚUnknownOpcodezAn DNS opcode is unknown.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   )   s   r   c             C   sB   | j ƒ r$t| ƒ}|dkr$|dkr$|S tj| jƒ ƒ}|dkr>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Úvaluer   r   r   Ú	from_text.   s    	r   c             C   s   | d@ d? S )zUExtract an opcode from DNS message flags.

    @param flags: int
    @rtype: int
    i x  é   r   )Úflagsr   r   r   Ú
from_flagsA   s    r!   c             C   s   | d> d@ S )z`Convert an opcode to a value suitable for ORing into DNS message
    flags.
    @rtype: int
    r   i x  r   )r   r   r   r   Úto_flagsK   s    r"   c             C   s   t j| ƒ}|dkrt| ƒ}|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)r   r   r   r   r   Úto_textT   s    	
r%   c             C   s   t | ƒtkS )znTrue if the opcode in flags is UPDATE.

    @param flags: DNS flags
    @type flags: int
    @rtype: bool
    )r!   r
   )r    r   r   r   Ú	is_updatec   s    r&   )r   Zdns.exceptionZdnsr   r   r   r	   r
   r   ÚdictÚitemsr#   Z	exceptionZDNSExceptionr   r   r!   r"   r%   r&   r   r   r   r   Ú<module>   s$   
	