???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................3
¢báW   ã               @   s@   d Z dZG dd„ deƒZG dd„ deƒZi Zdd„ Zdd	„ Zd
S )zEDNS Optionsé   c               @   sd   e Zd ZdZdd„ Zdd„ Zedd„ ƒZdd	„ Zd
d„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ ZdS )ÚOptionz*Base class for all EDNS option types.
    c             C   s
   || _ dS )z\Initialize an option.
        @param otype: The rdata type
        @type otype: int
        N)Úotype)Úselfr   © r   ú/usr/lib/python3.6/edns.pyÚ__init__   s    zOption.__init__c             C   s   t ‚dS )z*Convert an option to wire format.
        N)ÚNotImplementedError)r   Úfiler   r   r   Úto_wire!   s    zOption.to_wirec             C   s   t ‚dS )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Úolenr   r   r   Ú	from_wire&   s    zOption.from_wirec             C   s   t ‚dS )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   Úotherr   r   r   Ú_cmp5   s    zOption._cmpc             C   s,   t |tƒsdS | j|jkrdS | j|ƒdkS )NFé    )Ú
isinstancer   r   r   )r   r   r   r   r   Ú__eq__<   s
    
zOption.__eq__c             C   s,   t |tƒsdS | j|jkrdS | j|ƒdkS )NFr   )r   r   r   r   )r   r   r   r   r   Ú__ne__C   s
    
zOption.__ne__c             C   s*   t |tƒ s| j|jkrtS | j|ƒdk S )Nr   )r   r   r   ÚNotImplementedr   )r   r   r   r   r   Ú__lt__J   s    zOption.__lt__c             C   s*   t |tƒ s| j|jkrtS | j|ƒdkS )Nr   )r   r   r   r   r   )r   r   r   r   r   Ú__le__P   s    zOption.__le__c             C   s*   t |tƒ s| j|jkrtS | j|ƒdkS )Nr   )r   r   r   r   r   )r   r   r   r   r   Ú__ge__V   s    zOption.__ge__c             C   s*   t |tƒ s| j|jkrtS | j|ƒdkS )Nr   )r   r   r   r   r   )r   r   r   r   r   Ú__gt__\   s    zOption.__gt__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r
   Úclassmethodr   r   r   r   r   r   r   r   r   r   r   r   r      s   r   c                   s<   e Zd ZdZ‡ fdd„Zdd„ Zedd„ ƒZdd	„ Z‡  Z	S )
ÚGenericOptionzwGenerate Rdata Class

    This class is used for EDNS option types for which we have no better
    implementation.
    c                s   t t| ƒj|ƒ || _d S )N)Úsuperr    r   Údata)r   r   r"   )Ú	__class__r   r   r   k   s    zGenericOption.__init__c             C   s   |j | jƒ d S )N)Úwriter"   )r   r	   r   r   r   r
   o   s    zGenericOption.to_wirec             C   s   | ||||| … ƒS )Nr   )r   r   r   r   r   r   r   r   r   r   s    zGenericOption.from_wirec             C   s$   | j |j krdS | j |j kr dS dS )Nr   é   éÿÿÿÿ)r"   )r   r   r   r   r   r   v   s
    zGenericOption._cmp)
r   r   r   r   r   r
   r   r   r   Ú__classcell__r   r   )r#   r   r    c   s
   r    c             C   s   t j| ƒ}|d krt}|S )N)Ú_type_to_classÚgetr    )r   r   r   r   r   Úget_option_class   s    
r*   c             C   s   t | ƒ}|j| |||ƒS )au  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 instance)r*   r   )r   r   r   r   r   r   r   r   Úoption_from_wireˆ   s    r+   N)r   ZNSIDÚobjectr   r    r(   r*   r+   r   r   r   r   Ú<module>   s   N