
                             S r SSKrSrSrSrSrSr\\\\\S.r\R                  5        V Vs0 s H  u  pX_M	     snn r
 " S S	\R                  R                  5      rS
 rS rS rS rS rgs  snn f )zDNS Opcodes.    N            )QUERYIQUERYSTATUSNOTIFYUPDATEc                       \ rS rSrSrSrg)UnknownOpcode0   zAn DNS opcode is unknown. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       lib/third_party/dns/opcode.pyr   r   0   s    #r   r   c                     U R                  5       (       a  [        U 5      nUS:  a  US::  a  U$ [        R                  U R	                  5       5      nUc  [
        eU$ )zConvert text into an opcode.

*text*, a ``text``, the textual opcode

Raises ``dns.opcode.UnknownOpcode`` if the opcode is unknown.

Returns an ``int``.
r      )isdigitint_by_textgetupperr   )textvalues     r   	from_textr!   4   sN     ||~~D	A:%2+LLL&E}Lr   c                     U S-  S-	  $ )zdExtract an opcode from DNS message flags.

*flags*, an ``int``, the DNS flags.

Returns an ``int``.
 x     r   flagss    r   
from_flagsr'   H   s     FNr!!r   c                     U S-  S-  $ )zConvert an opcode to a value suitable for ORing into DNS message
flags.

*value*, an ``int``, the DNS opcode value.

Returns an ``int``.
r$   r#   r   )r    s    r   to_flagsr)   S   s     RK6!!r   c                 L    [         R                  U 5      nUc  [        U 5      nU$ )zConvert an opcode to text.

*value*, an ``int`` the opcode value,

Raises ``dns.opcode.UnknownOpcode`` if the opcode is unknown.

Returns a ``text``.
)	_by_valuer   str)r    r   s     r   to_textr-   _   s%     ==D|5zKr   c                 &    [        U 5      [        :H  $ )zaIs the opcode in flags UPDATE?

*flags*, an ``int``, the DNS message flags.

Returns a ``bool``.
)r'   r   r%   s    r   	is_updater/   o   s     e&&r   )r   dns.exceptiondnsr   r   r	   r
   r   r   itemsr+   	exceptionDNSExceptionr   r!   r'   r)   r-   r/   )xys   00r   <module>r7      s   $   	
	
	
	
	
  'nn./.daQT./	$CMM.. $("	" 'E 0s   A-