dnspython  1.16.0
About: dnspython is a DNS toolkit (for Python 2.x) that supports almost all record types.
  Fossies Dox: dnspython-1.16.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dns.rdata.Rdata Class Reference
Inheritance diagram for dns.rdata.Rdata:
[legend]
Collaboration diagram for dns.rdata.Rdata:
[legend]

Public Member Functions

def __init__ (self, rdclass, rdtype)
 
def covers (self)
 
def extended_rdatatype (self)
 
def to_text (self, origin=None, relativize=True, **kw)
 
def to_wire (self, file, compress=None, origin=None)
 
def to_digestable (self, origin=None)
 
def validate (self)
 
def __repr__ (self)
 
def __str__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def __lt__ (self, other)
 
def __le__ (self, other)
 
def __ge__ (self, other)
 
def __gt__ (self, other)
 
def __hash__ (self)
 
def from_text (cls, rdclass, rdtype, tok, origin=None, relativize=True)
 
def from_wire (cls, rdclass, rdtype, wire, current, rdlen, origin=None)
 
def choose_relativity (self, origin=None, relativize=True)
 

Public Attributes

 rdclass
 
 rdtype
 

Private Member Functions

def _cmp (self, other)
 

Static Private Attributes

list __slots__ = ['rdclass', 'rdtype']
 

Detailed Description

Base class for all DNS rdata types.

Definition at line 95 of file rdata.py.

Constructor & Destructor Documentation

◆ __init__()

def dns.rdata.Rdata.__init__ (   self,
  rdclass,
  rdtype 
)
Initialize an rdata.

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

Definition at line 100 of file rdata.py.

Member Function Documentation

◆ __eq__()

◆ __ge__()

def dns.rdata.Rdata.__ge__ (   self,
  other 
)

◆ __gt__()

def dns.rdata.Rdata.__gt__ (   self,
  other 
)

◆ __hash__()

def dns.rdata.Rdata.__hash__ (   self)

Definition at line 245 of file rdata.py.

References dns.rdata.Rdata.to_digestable(), and dns.name.Name.to_digestable().

◆ __le__()

def dns.rdata.Rdata.__le__ (   self,
  other 
)

◆ __lt__()

def dns.rdata.Rdata.__lt__ (   self,
  other 
)

◆ __ne__()

def dns.rdata.Rdata.__ne__ (   self,
  other 
)

◆ __repr__()

◆ __str__()

◆ _cmp()

def dns.rdata.Rdata._cmp (   self,
  other 
)
private
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.

Definition at line 189 of file rdata.py.

References dns.rdata.Rdata.to_digestable(), and dns.name.Name.to_digestable().

Referenced by dns.rdata.Rdata.__eq__(), dns.rdata.Rdata.__ge__(), dns.rdata.Rdata.__gt__(), dns.rdata.Rdata.__le__(), dns.rdata.Rdata.__lt__(), and dns.rdata.Rdata.__ne__().

◆ choose_relativity()

def dns.rdata.Rdata.choose_relativity (   self,
  origin = None,
  relativize = True 
)

◆ covers()

def dns.rdata.Rdata.covers (   self)
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``.

Reimplemented in dns.rdtypes.ANY.RRSIG.RRSIG.

Definition at line 110 of file rdata.py.

Referenced by dns.rdata.Rdata.__repr__(), and dns.rdata.Rdata.extended_rdatatype().

◆ extended_rdatatype()

def dns.rdata.Rdata.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.

Returns an ``int``.

Definition at line 124 of file rdata.py.

References dns.rrset.RRset.covers, dns.rdataset.Rdataset.covers, dns.rdata.Rdata.covers(), and dns.rdata.Rdata.rdtype.

◆ from_text()

◆ from_wire()

◆ to_digestable()

def dns.rdata.Rdata.to_digestable (   self,
  origin = None 
)

◆ to_text()

◆ to_wire()

◆ validate()

def dns.rdata.Rdata.validate (   self)
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``.

Definition at line 161 of file rdata.py.

References dns.rdata.from_text(), dns.rdata.Rdata.rdclass, dns.rdata.Rdata.rdtype, dns.node.Node.to_text(), dns.message.Message.to_text(), dns.rdata.Rdata.to_text(), dns.edns.GenericOption.to_text(), dns.edns.ECSOption.to_text(), and dns.name.Name.to_text().

Member Data Documentation

◆ __slots__

list dns.rdata.Rdata.__slots__ = ['rdclass', 'rdtype']
staticprivate

Definition at line 98 of file rdata.py.

◆ rdclass

◆ rdtype


The documentation for this class was generated from the following file: