dns :: rdata :: Rdata :: Class Rdata
[hide private]
[frames] | no frames]

Class Rdata

source code

object --+
         |
        Rdata
Known Subclasses:

Base class for all DNS rdata types.

Instance Methods [hide private]
 
__eq__(self, other) source code
 
__ge__(self, other) source code
 
__gt__(self, other) source code
 
__hash__(self)
hash(x)
source code
 
__init__(self, rdclass, rdtype)
Initialize an rdata.
source code
 
__le__(self, other) source code
 
__lt__(self, other) source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
_cmp(self, other)
Compare an rdata with another rdata of the same rdtype and rdclass.
source code
 
choose_relativity(self, origin=None, relativize=True)
Convert any domain names in the rdata to the specified relativization.
source code
 
covers(self)
Return the type a Rdata covers.
source code
 
extended_rdatatype(self)
Return a 32-bit type value, the least significant 16 bits of which are the ordinary DNS type, and the upper 16 bits of which are the "covered" type, if any.
source code
 
to_digestable(self, origin=None)
Convert rdata to a format suitable for digesting in hashes.
source code
 
to_text(self, origin=None, relativize=True, **kw)
Convert an rdata to text format.
source code
 
to_wire(self, file, compress=None, origin=None)
Convert an rdata to wire format.
source code
 
validate(self)
Check that the current contents of the rdata's fields are valid.
source code

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

Class Methods [hide private]
 
from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True) source code
 
from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None) source code
Properties [hide private]
  rdclass
  rdtype

Inherited from object: __class__

Method Details [hide private]

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__init__(self, rdclass, rdtype)
(Constructor)

source code 

Initialize an rdata.

*rdclass*, an ``int`` is the rdataclass of the Rdata. *rdtype*, an ``int`` is the rdatatype of the Rdata.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

_cmp(self, other)

source code 

Compare an rdata with another rdata of the same rdtype and rdclass.

Return < 0 if self < other in the DNSSEC ordering, 0 if self == other, and > 0 if self > other.

covers(self)

source code 

Return the type a Rdata covers.

DNS SIG/RRSIG rdatas apply to a specific type; this type is returned by the covers() function. If the rdata type is not SIG or RRSIG, dns.rdatatype.NONE is returned. This is useful when creating rdatasets, allowing the rdataset to contain only RRSIGs of a particular type, e.g. RRSIG(NS).

Returns an ``int``.

extended_rdatatype(self)

source code 

Return a 32-bit type value, the least significant 16 bits of which are the ordinary DNS type, and the upper 16 bits of which are the "covered" type, if any.

Returns an ``int``.

to_digestable(self, origin=None)

source code 

Convert rdata to a format suitable for digesting in hashes. This is also the DNSSEC canonical form.

Returns a ``binary``.

to_text(self, origin=None, relativize=True, **kw)

source code 

Convert an rdata to text format.

Returns a ``text``.

to_wire(self, file, compress=None, origin=None)

source code 

Convert an rdata to wire format.

Returns a ``binary``.

validate(self)

source code 

Check that the current contents of the rdata's fields are valid.

If you change an rdata by assigning to its fields, it is a good idea to call validate() when you are done making changes.

Raises various exceptions if there are problems.

Returns ``None``.