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

Type Rdata

object --+
         |
        Rdata

Known Subclasses:
A, AAAA, APL, CERT, DHCID, DS, GenericRdata, GPOS, HINFO, ISDN, KEYBase, LOC, MXBase, NAPTR, NSAP, NSBase, NSEC, NXT, PX, RP, SIGBase, SOA, SRV, SSHFP, WKS, X25

Base class for all DNS rdata types.
Method Summary
  __init__(self, rdclass, rdtype)
Initialize an rdata.
  __eq__(self, other)
  __ge__(self, other)
  __gt__(self, other)
  __le__(self, other)
  __lt__(self, other)
  __ne__(self, other)
  __repr__(self)
  __str__(self)
  choose_relativity(self, origin, relativize)
Convert any domain names in the rdata to the specified relativization.
int covers(self)
DNS SIG/RRSIG rdatas apply to a specific type; this type is returned by the covers() function.
int 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.
dns.rdata.Rdata instance from_text(cls, rdclass, rdtype, tok, origin, relativize)
Build an rdata object from text format. (Class method)
dns.rdata.Rdata instance from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin)
Build an rdata object from wire format (Class method)
string to_text(self, origin, relativize, **kw)
Convert an rdata to text format.
string to_wire(self, file, compress, origin)
Convert an rdata to wire format.
  validate(self)
Check that the current contents of the rdata's fields are valid.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Class Variable Summary
list __slots__ = ['rdclass', 'rdtype']
member_descriptor rdclass = <member 'rdclass' of 'Rdata' objects>
member_descriptor rdtype = <member 'rdtype' of 'Rdata' objects>

Instance Method Details

__init__(self, rdclass, rdtype)
(Constructor)

Initialize an rdata.
Parameters:
rdclass - The rdata class
           (type=int)
rdtype - The rdata type
           (type=int)
Overrides:
__builtin__.object.__init__

choose_relativity(self, origin=None, relativize=True)

Convert any domain names in the rdata to the specified relativization.

covers(self)

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:
int

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:
int

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

Convert an rdata to text format.
Returns:
string

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

Convert an rdata to wire format.
Returns:
string

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.

Class Method Details

from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True)

Build an rdata object from text format.
Parameters:
rdclass - The rdata class
           (type=int)
rdtype - The rdata type
           (type=int)
tok - The tokenizer
           (type=dns.tokenizer.Tokenizer)
origin - The origin to use for relative names
           (type=dns.name.Name)
relativize - should names be relativized?
           (type=bool)
Returns:
dns.rdata.Rdata instance

from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None)

Build an rdata object from wire format
Parameters:
rdclass - The rdata class
           (type=int)
rdtype - The rdata type
           (type=int)
wire - The wire-format message
           (type=string)
current - The offet in wire of the beginning of the rdata.
           (type=int)
rdlen - The length of the wire-format rdata
           (type=int)
origin - The origin to use for relative names
           (type=dns.name.Name)
Returns:
dns.rdata.Rdata instance

Class Variable Details

__slots__

Type:
list
Value:
['rdclass', 'rdtype']                                                  

rdclass

Type:
member_descriptor
Value:
<member 'rdclass' of 'Rdata' objects>                                  

rdtype

Type:
member_descriptor
Value:
<member 'rdtype' of 'Rdata' objects>                                   

Generated by Epydoc 2.1 on Sun Dec 10 12:46:08 2006 http://epydoc.sf.net