AlkantarClanX12

Your IP : 18.221.183.34


Current Path : /proc/self/root/usr/lib/python3.6/site-packages/dns/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3.6/site-packages/dns/__pycache__/edns.cpython-36.pyc

3

�b�W �@s@dZdZGdd�de�ZGdd�de�ZiZdd�Zdd	�Zd
S)zEDNS Options�c@sdeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�ZdS)�Optionz*Base class for all EDNS option types.
    cCs
||_dS)z\Initialize an option.
        @param otype: The rdata type
        @type otype: int
        N)�otype)�selfr�r�/usr/lib/python3.6/edns.py�__init__szOption.__init__cCst�dS)z*Convert an option to wire format.
        N)�NotImplementedError)r�filerrr�to_wire!szOption.to_wirecCst�dS)a�Build an EDNS option object from wire format

        @param otype: The option type
        @type otype: int
        @param wire: The wire-format message
        @type wire: string
        @param current: The offset in wire of the beginning of the rdata.
        @type current: int
        @param olen: The length of the wire-format option data
        @type olen: int
        @rtype: dns.edns.Option instanceN)r)�clsr�wire�current�olenrrr�	from_wire&s
zOption.from_wirecCst�dS)z�Compare an EDNS option with another option of the same type.
        Return < 0 if self < other, 0 if self == other,
        and > 0 if self > other.
        N)r)r�otherrrr�_cmp5szOption._cmpcCs,t|t�sdS|j|jkrdS|j|�dkS)NF�)�
isinstancerrr)rrrrr�__eq__<s

z
Option.__eq__cCs,t|t�sdS|j|jkrdS|j|�dkS)NFr)rrrr)rrrrr�__ne__Cs

z
Option.__ne__cCs*t|t�s|j|jkrtS|j|�dkS)Nr)rrr�NotImplementedr)rrrrr�__lt__Jsz
Option.__lt__cCs*t|t�s|j|jkrtS|j|�dkS)Nr)rrrrr)rrrrr�__le__Psz
Option.__le__cCs*t|t�s|j|jkrtS|j|�dkS)Nr)rrrrr)rrrrr�__ge__Vsz
Option.__ge__cCs*t|t�s|j|jkrtS|j|�dkS)Nr)rrrrr)rrrrr�__gt__\sz
Option.__gt__N)�__name__�
__module__�__qualname__�__doc__rr
�classmethodrrrrrrrrrrrrrsrcs<eZdZdZ�fdd�Zdd�Zedd��Zdd	�Z�Z	S)
�
GenericOptionzwGenerate Rdata Class

    This class is used for EDNS option types for which we have no better
    implementation.
    cstt|�j|�||_dS)N)�superr r�data)rrr")�	__class__rrrkszGenericOption.__init__cCs|j|j�dS)N)�writer")rr	rrrr
oszGenericOption.to_wirecCs||||||��S)Nr)rrrr
rrrrrrszGenericOption.from_wirecCs$|j|jkrdS|j|jkr dSdS)Nr����)r")rrrrrrvs
zGenericOption._cmp)
rrrrrr
rrr�
__classcell__rr)r#rr cs
r cCstj|�}|dkrt}|S)N)�_type_to_class�getr )rrrrr�get_option_class�s
r*cCst|�}|j||||�S)auBuild an EDNS option object from wire format

    @param otype: The option type
    @type otype: int
    @param wire: The wire-format message
    @type wire: string
    @param current: The offset in wire of the beginning of the rdata.
    @type current: int
    @param olen: The length of the wire-format option data
    @type olen: int
    @rtype: dns.edns.Option instance)r*r)rrr
rrrrr�option_from_wire�s
r+N)rZNSID�objectrr r(r*r+rrrr�<module>sN