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

Class Rdataset

source code

object --+    
         |    
   set.Set --+
             |
            Rdataset
Known Subclasses:

A DNS rdataset.

Instance Methods [hide private]
bool
__eq__(self, other)
Two rdatasets are equal if they have the same class, type, and covers, and contain the same rdata.
source code
 
__init__(self, rdclass, rdtype, covers=0)
Create a new rdataset of the specified class and type.
source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
_clone(self)
Make a (shallow) copy of the set.
source code
 
add(self, rd, ttl=None)
Add the specified rdata to the rdataset.
source code
 
intersection_update(self, other)
Update the set, removing any elements from other which are not in both sets.
source code
 
match(self, rdclass, rdtype, covers)
Returns True if this rdataset matches the specified class, type, and covers
source code
 
to_text(self, name=None, origin=None, relativize=True, override_rdclass=None, **kw)
Convert the rdataset into DNS master file format.
source code
int
to_wire(self, name, file, compress=None, origin=None, override_rdclass=None, want_shuffle=True)
Convert the rdataset to wire format.
source code
 
union_update(self, other)
Update the set, adding any elements from other which are not already in the set.
source code
 
update(self, other)
Add all rdatas in other to self.
source code
 
update_ttl(self, ttl)
Set the TTL of the rdataset to be the lesser of the set's current TTL or the specified TTL.
source code

Inherited from set.Set: __add__, __and__, __copy__, __delitem__, __getitem__, __iadd__, __iand__, __ior__, __isub__, __iter__, __len__, __or__, __sub__, clear, copy, difference, difference_update, discard, intersection, issubset, issuperset, remove, union

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Instance Variables [hide private]
int covers
The covered type.
int rdclass
The class of the rdataset
int rdtype
The type of the rdataset
int ttl
The DNS TTL (Time To Live) value

Inherited from set.Set: items

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__eq__(self, other)
(Equality operator)

source code 

Two rdatasets are equal if they have the same class, type, and covers, and contain the same rdata.

Returns: bool
Overrides: set.Set.__eq__

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

source code 

Create a new rdataset of the specified class and type.

Parameters:
  • items - the initial set of items
Overrides: object.__init__

See Also: the description of the class instance variables for the meaning of rdclass and rdtype

__ne__(self, other)

source code 
Overrides: set.Set.__ne__

__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)

_clone(self)

source code 

Make a (shallow) copy of the set.

There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes defined in the subclass.

This protocol allows us to write the set algorithms that return new instances (e.g. union) once, and keep using them in subclasses.

Overrides: set.Set._clone
(inherited documentation)

add(self, rd, ttl=None)

source code 

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 (dns.rdata.Rdata object) - The rdata
  • ttl (int) - The TTL
Overrides: set.Set.add

intersection_update(self, other)

source code 

Update the set, removing any elements from other which are not in both sets.

Parameters:
  • other - the collection of items with which to update the set
Overrides: set.Set.intersection_update
(inherited documentation)

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

source code 

Convert the rdataset into DNS master file format.

Parameters:
  • name (dns.name.Name object) - If name is not None, emit a RRs with name as the owner name.
  • origin (dns.name.Name object) - The origin for relative names, or None.
  • relativize (bool) - True if names should names be relativized

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=True)

source code 

Convert the rdataset to wire format.

Parameters:
  • name (dns.name.Name object) - The owner name of the RRset that will be emitted
  • file (file) - The file to which the wire format data will be appended
  • compress (dict) - The compression table to use; the default is None.
  • origin - The origin to be appended to any relative names when they are emitted. The default is None.
Returns: int
the number of records emitted

union_update(self, other)

source code 

Update the set, adding any elements from other which are not already in the set.

Parameters:
  • other - the collection of items with which to update the set
Overrides: set.Set.union_update
(inherited documentation)

update(self, other)

source code 

Add all rdatas in other to self.

Parameters:
  • other (dns.rdataset.Rdataset object) - The rdataset from which to update
Overrides: set.Set.update

update_ttl(self, ttl)

source code 

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 (int) - The TTL

Instance Variable Details [hide private]

covers

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