a
    sd_>
  ã                   @   sr   d Z ddlZddlZG dd„ dejjƒZeƒ  ej	¡ ej
ejhZG dd„ dejjƒZdd„ Zd	d
„ Zdd„ ZdS )zDNS Rdata Classes.é    Nc                   @   sd   e Zd ZdZdZdZeZdZeZdZ	e	Z
dZdZedd	„ ƒZed
d„ ƒZedd„ ƒZedd„ ƒZdS )Ú
RdataClasszDNS Rdata Classr   é   é   é   éþ   éÿ   c                 C   s   dS )Niÿÿ  © ©Úclsr   r   ú0/usr/lib/python3/dist-packages/dns/rdataclass.pyÚ_maximum#   s    zRdataClass._maximumc                 C   s   dS )NÚclassr   r	   r   r   r   Ú_short_name'   s    zRdataClass._short_namec                 C   s   dS )NZCLASSr   r	   r   r   r   Ú_prefix+   s    zRdataClass._prefixc                 C   s   t S )N)ÚUnknownRdataclassr	   r   r   r   Ú_unknown_exception_class/   s    z#RdataClass._unknown_exception_classN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Z	RESERVED0ÚINZINTERNETZCHZCHAOSZHSZHESIODÚNONEÚANYÚclassmethodr   r   r   r   r   r   r   r   r      s$   


r   c                   @   s   e Zd ZdZdS )r   zA DNS class is unknown.N)r   r   r   r   r   r   r   r   r   8   s   r   c                 C   s
   t  | ¡S )a‘  Convert text into a DNS rdata class value.

    The input text can be a defined DNS RR class mnemonic or
    instance of the DNS generic class syntax.

    For example, "IN" and "CLASS1" will both result in a value of 1.

    Raises ``dns.rdatatype.UnknownRdataclass`` if the class is unknown.

    Raises ``ValueError`` if the rdata class value is not >= 0 and <= 65535.

    Returns an ``int``.
    )r   Ú	from_text)Útextr   r   r   r   <   s    r   c                 C   s
   t  | ¡S )a  Convert a DNS rdata class value to text.

    If the value has a known mnemonic, it will be used, otherwise the
    DNS generic class syntax will be used.

    Raises ``ValueError`` if the rdata class value is not >= 0 and <= 65535.

    Returns a ``str``.
    )r   Úto_text)Úvaluer   r   r   r   N   s    r   c                 C   s   | t v rdS dS )z‡True if the specified class is a metaclass.

    The currently defined metaclasses are ANY and NONE.

    *rdclass* is an ``int``.
    TF)Ú_metaclasses)Zrdclassr   r   r   Úis_metaclass\   s    r   )r   Zdns.enumZdnsZdns.exceptionÚenumÚIntEnumr   ÚglobalsÚupdateÚ__members__r   r   r   Z	exceptionZDNSExceptionr   r   r   r   r   r   r   r   Ú<module>   s   