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

Class Rdataset

object --+    
         |    
 SimpleSet --+
             |
            Rdataset

Known Subclasses:
RRset

A DNS rdataset.
Method Summary
  __init__(self, rdclass, rdtype, covers)
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, and covers, and contain the same rdata.
  __getstate__(...)
  __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)
  difference_update(self, other)
Update the set, removing any elements from other which are in the set. (inherited from SimpleSet)
  discard(self, item)
Remove an item from the set if present. (inherited from SimpleSet)
  intersection_update(self, other)
Update the set, removing any elements from other which are not in both sets. (inherited from SimpleSet)
  match(self, rdclass, rdtype, covers)
Returns True if this rdataset matches the specified class, type, and covers
  remove(self, item)
Remove an item from the set. (inherited from SimpleSet)
  to_text(self, name, origin, relativize, override_rdclass, **kw)
Convert the rdataset into DNS master file format.
int to_wire(self, name, file, compress, origin, override_rdclass, want_shuffle)
Convert the rdataset to wire format.
  union_update(self, other)
Update the set, adding any elements from other which are not already in the set. (inherited from SimpleSet)
  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
  covers - The covered type.
  rdclass - The class of the rdataset
  rdtype - The type of the rdataset
  ttl - The DNS TTL (Time To Live) value

Class Variable Summary
list __slots__
int covers
int rdclass
int rdtype
int ttl

Method Details

__init__(self, rdclass, rdtype, covers=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 and rdtype

__eq__(self, other)
(Equality operator)

Two rdatasets are equal if they have the same class, type, and covers, 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)

Returns True if this rdataset matches the specified class, type, and covers

to_text(self, name=None, origin=None, relativize=1, override_rdclass=None, **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, override_rdclass=None, want_shuffle=1)

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

rdclass

The class of the rdataset

rdtype

The type of the rdataset

ttl

The DNS TTL (Time To Live) value

Class Variable Details

__slots__

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

covers

Type:
int
Value:
<member 'covers' of 'Rdataset' objects>                                

rdclass

Type:
int
Value:
<member 'rdclass' of 'Rdataset' objects>                               

rdtype

Type:
int
Value:
<member 'rdtype' of 'Rdataset' objects>                                

ttl

Type:
int
Value:
<member 'ttl' of 'Rdataset' objects>                                   

Generated by Epydoc 1.1 on Sat Aug 2 15:09:34 2003 http://epydoc.sf.net