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

# Class Rdata

source code

    object --+
             |
            Rdata

Known Subclasses:
  - GenericRdata
  - , rdtypes.dsbase.DSBase
  - , rdtypes.keybase.KEYBase
  - , rdtypes.mxbase.MXBase
  - , rdtypes.nsbase.NSBase
  - , rdtypes.sigbase.SIGBase
  - , rdtypes.txtbase.TXTBase
  - , rdtypes.ANY.CERT.CERT
  - , rdtypes.ANY.GPOS.GPOS
  - , rdtypes.ANY.HINFO.HINFO
  - , rdtypes.ANY.HIP.HIP
  - , rdtypes.ANY.ISDN.ISDN
  - , rdtypes.ANY.LOC.LOC
  - , rdtypes.ANY.NSEC.NSEC
  - , rdtypes.ANY.NSEC3.NSEC3
  - , rdtypes.ANY.NSEC3PARAM.NSEC3PARAM
  - , rdtypes.ANY.NXT.NXT
  - , rdtypes.ANY.RP.RP
  - , rdtypes.ANY.SOA.SOA
  - , rdtypes.ANY.SSHFP.SSHFP
  - , rdtypes.ANY.X25.X25
  - , rdtypes.IN.A.A
  - , rdtypes.IN.AAAA.AAAA
  - , rdtypes.IN.APL.APL
  - , rdtypes.IN.DHCID.DHCID
  - , rdtypes.IN.IPSECKEY.IPSECKEY
  - , rdtypes.IN.NAPTR.NAPTR
  - , rdtypes.IN.NSAP.NSAP
  - , rdtypes.IN.PX.PX
  - , rdtypes.IN.SRV.SRV
  - , rdtypes.IN.WKS.WKS

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
_wire_cmp(self, other) | source code
choose_relativity(self, origin=None, relativize=True) Convert any domain names in the rdata to the specified relativization. | source code
int |
covers(self) DNS SIG/RRSIG rdatas apply to a specific type; this type is returned by the covers() function. | source code
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. | source code
to_digestable(self, origin=None) Convert rdata to a format suitable for digesting in hashes. | source code
string |
to_text(self, origin=None, relativize=True, **kw) Convert an rdata to text format. | source code
string |
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]
dns.rdata.Rdata instance |
from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True) Build an rdata object from text format. | source code
dns.rdata.Rdata instance |
from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None) Build an rdata object from wire format | 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. Parameters: `rdclass` (int) - The rdata class `rdtype` (int) - The rdata type 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
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

### from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True) Class Method | source code
Build an rdata object from text format. Parameters: `rdclass` (int) - The rdata class `rdtype` (int) - The rdata type `tok` (dns.tokenizer.Tokenizer) - The tokenizer `origin` (dns.name.Name) - The origin to use for relative names `relativize` (bool) - should names be relativized? Returns: dns.rdata.Rdata instance

### from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None) Class Method | source code
Build an rdata object from wire format Parameters: `rdclass` (int) - The rdata class `rdtype` (int) - The rdata type `wire` (string) - The wire-format message `current` (int) - The offet in wire of the beginning of the rdata. `rdlen` (int) - The length of the wire-format rdata `origin` (dns.name.Name) - The origin to use for relative names Returns: dns.rdata.Rdata instance

### to_digestable(self, origin=None) | source code
Convert rdata to a format suitable for digesting in hashes. This is also the DNSSEC canonical form.

### 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.