Package dns :: Module edns :: Class ECSOption
[hide private]
[frames] | no frames]

Class ECSOption

source code

object --+    
         |    
    Option --+
             |
            ECSOption

EDNS Client Subnet (ECS, RFC7871)

Instance Methods [hide private]
 
__init__(self, address, srclen=None, scopelen=0)
*address*, a ``text``, is the client address information.
source code
 
to_text(self) source code
 
to_wire(self, file)
Convert an option to wire format.
source code
 
_cmp(self, other)
Compare an EDNS option with another option of the same type.
source code

Inherited from Option: __eq__, __ge__, __gt__, __le__, __lt__, __ne__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
from_wire(cls, otype, wire, cur, olen)
Build an EDNS option object from wire format.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, address, srclen=None, scopelen=0)
(Constructor)

source code 

*address*, a ``text``, is the client address information.

*srclen*, an ``int``, the source prefix length, which is the leftmost number of bits of the address to be used for the lookup. The default is 24 for IPv4 and 56 for IPv6.

*scopelen*, an ``int``, the scope prefix length. This value must be 0 in queries, and should be set in responses.

Overrides: object.__init__

to_wire(self, file)

source code 

Convert an option to wire format.

Overrides: Option.to_wire
(inherited documentation)

from_wire(cls, otype, wire, cur, olen)
Class Method

source code 

Build an EDNS option object from wire format.

*otype*, an ``int``, is the option type.

*wire*, a ``binary``, is the wire-format message.

*current*, an ``int``, is the offset in *wire* of the beginning of the rdata.

*olen*, an ``int``, is the length of the wire-format option data

Returns a ``dns.edns.Option``.

Overrides: Option.from_wire
(inherited documentation)

_cmp(self, other)

source code 

Compare an EDNS option with another option of the same type.

Returns < 0 if < *other*, 0 if == *other*, and > 0 if > *other*.

Overrides: Option._cmp
(inherited documentation)