Package dns :: Module rdataset :: Class Rdataset
[show private | hide private]
[frames | no frames]

Class Rdataset

object --+    
         |    
 SimpleSet --+
             |
            Rdataset


A DNS rdataset.
Method Summary
  __init__(self, rdclass, rdtype, deleting)
Create a new rdataset of the specified class and type.
bool __eq__(self, other)
Two rdatasets are equal if they have the same class, type, covers, deletion state, and contain the same rdata.
  __iter__(self)
(inherited from SimpleSet)
  __len__(self)
(inherited from SimpleSet)
  __ne__(self, other)
a new object with type S, a subtype of T __new__(S, ...)
  __repr__(self)
  __str__(self)
  add(self, rd, ttl)
Add the specified rdata to the rdataset.
  clear(self)
Make the set empty. (inherited from SimpleSet)
  match(self, rdclass, rdtype, covers, deleting)
Returns True if this rdataset matches the specified class, type, covers and optional deletion state.
  to_text(self, name, origin, relativize, **kw)
Convert the rdataset into DNS master file format.
int to_wire(self, name, file, compress, origin, question)
Convert the rdataset to wire format.
  update(self, other)
Add all rdatas in other to self.
  update_ttl(self, ttl)
Set the TTL of the rdataset to be the lesser of the set's current TTL or the specified TTL.

Instance Variable Summary
int covers - The covered type.
int deleting - If non-zero, the value of deleting should be the class to use when converting the rdataset to text or wire format.
int rdclass - The class of the rdataset
int rdtype - The type of the rdataset
int ttl - The DNS TTL (Time To Live) value

Method Details

__init__(self, rdclass, rdtype, deleting=0)
(Constructor)

Create a new rdataset of the specified class and type.

See also: the description of the class instance variables for the meaning of rdclass, rdtype, and deleting.

__eq__(self, other)
(Equality operator)

Two rdatasets are equal if they have the same class, type, covers, deletion state, and contain the same rdata.
Returns:
bool

__new__(S, ...)

Returns:
a new object with type S, a subtype of T

add(self, rd, ttl=None)

Add the specified rdata to the rdataset.

If the optional ttl parameter is supplied, then self.update_ttl(ttl) will be called prior to adding the rdata.
Parameters:
rd - The rdata
           (type=dns.rdata.Rdata object)
ttl - The TTL
           (type=int)

match(self, rdclass, rdtype, covers, deleting=0)

Returns True if this rdataset matches the specified class, type, covers and optional deletion state.

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

Convert the rdataset into DNS master file format.
Parameters:
name - If name is not None, emit a RRs with name as the owner name.
           (type=dns.name.Name object)
origin - The origin for relative names, or None.
           (type=dns.name.Name object)
relativize - True if names should names be relativized
           (type=bool)

See also:

dns.name.Name.choose_relativity for more information on how origin and relativize determine the way names are emitted.

Any additional keyword arguments are passed on to the rdata to_text() method.

to_wire(self, name, file, compress=None, origin=None, question=False)

Convert the rdataset to wire format.
Parameters:
name - The owner name of the RRset that will be emitted
           (type=dns.name.Name object)
file - The file to which the wire format data will be appended
           (type=file)
compress - The compression table to use; the default is None.
           (type=dict)
origin - The origin to be appended to any relative names when they are emitted. The default is None.
question - If True, render this rdataset in the format of the question section, i.e. emit only the owner name, rdata class, and rdata type.
           (type=bool)
Returns:
the number of records emitted
           (type=int)

update(self, other)

Add all rdatas in other to self.
Parameters:
other - The rdataset from which to update
           (type=dns.rdataset.Rdataset object)

update_ttl(self, ttl)

Set the TTL of the rdataset to be the lesser of the set's current TTL or the specified TTL. If the set contains no rdatas, set the TTL to the specified TTL.
Parameters:
ttl - The TTL
           (type=int)

Instance Variable Details

covers

The covered type. Usually this value is dns.rdatatype.NONE, but if the rdtype is dns.rdatatype.SIG, then the covers value will be the rdata type the SIG covers. The library treats the SIG type as if it were a family of types, e.g. SIG(A), SIG(NS), SIG(SOA). This makes SIGs much easier to work with than if SIGs covering different rdata types were aggregated into a single SIG rdataset.
Type:
int

deleting

If non-zero, the value of deleting should be the class to use when converting the rdataset to text or wire format. This field is used in dynamic update operations, for example in the "Delete an RR from an RRset" case, the deleting value will be dns.rdatatype.NONE.
Type:
int

rdclass

The class of the rdataset
Type:
int

rdtype

The type of the rdataset
Type:
int

ttl

The DNS TTL (Time To Live) value
Type:
int

Generated by Epydoc 1.1 on Mon Jun 30 15:54:10 2003 http://epydoc.sf.net