
    h
                     h   d Z ddlmZ ddlZddlZ G d dej                  j                        Z G d dej                  j                        Zded	efd
Zded	efdZded	efdZded	efdZded	efdZej(                  Zej*                  Zej,                  Zej.                  Zej0                  Zy)zDNS Opcodes.    )TypeNc                   L    e Zd ZdZdZdZdZdZed        Z	ede
e   fd       Zy	)
Opcoder               c                      y)N    clss    H/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/dns/opcode.py_maximumzOpcode._maximum&   s        returnc                     t         S )N)UnknownOpcoder   s    r   _unknown_exception_classzOpcode._unknown_exception_class*   s    r   N)__name__
__module____qualname__QUERYIQUERYSTATUSNOTIFYUPDATEclassmethodr   r   	Exceptionr   r   r   r   r   r      sL    EFFFF  i  r   r   c                       e Zd ZdZy)r   zAn DNS opcode is unknown.N)r   r   r   __doc__r   r   r   r   r   /   s    #r   r   textr   c                 ,    t         j                  |       S )zConvert text into an opcode.

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

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

    Returns an ``int``.
    )r   	from_text)r"   s    r   r$   r$   3   s     D!!r   flagsc                 $    t        | dz  dz	        S )zpExtract an opcode from DNS message flags.

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

    Returns an ``int``.
     x     )r   r%   s    r   
from_flagsr*   @   s     56>b())r   valuec                     | dz  dz  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.   K   s     RK6!!r   c                 ,    t         j                  |       S )zConvert an opcode to text.

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

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

    Returns a ``str``.
    )r   to_textr-   s    r   r0   r0   W   s     >>%  r   c                 :    t        |       t        j                  k(  S )zmIs the opcode in flags UPDATE?

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

    Returns a ``bool``.
    )r*   r   r   r)   s    r   	is_updater2   d   s     e--r   )r!   typingr   dns.enumdnsdns.exceptionenumIntEnumr   	exceptionDNSExceptionr   strr$   intr*   r.   r0   boolr2   r   r   r   r   r   r   r   r   <module>r>      s   $    SXX *$CMM.. $
"C 
"F 
"*c *f *	"F 	"s 	"
!6 
!c 
!.S .T . 					r   