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

Type Rdataset

object --+    
         |    
       Set --+
             |
            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.
  __ne__(self, other)
  __repr__(self)
  __str__(self)
  add(self, rd, ttl)
Add the specified rdata to the rdataset.
  intersection_update(self, other)
Update the set, removing any elements from other which are not in both sets.
  match(self, rdclass, rdtype, covers)
Returns True if this rdataset matches the specified class, type, and covers
  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.
  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.
  _clone(self)
Make a (shallow) copy of the set.
    Inherited from Set
  __add__(self, other)
  __and__(self, other)
  __copy__(self)
Make a (shallow) copy of the set.
  __iadd__(self, other)
  __iand__(self, other)
  __ior__(self, other)
  __isub__(self, other)
  __iter__(self)
  __len__(self)
  __or__(self, other)
  __sub__(self, other)
  clear(self)
Make the set empty.
  copy(self)
Make a (shallow) copy of the set.
the same type as self difference(self, other)
Return a new set which self - other, i.e.
  difference_update(self, other)
Update the set, removing any elements from other which are in the set.
  discard(self, item)
Remove an item from the set if present.
the same type as self intersection(self, other)
Return a new set which is the intersection of self and other.
bool issubset(self, other)
Is self a subset of other?
bool issuperset(self, other)
Is self a superset of other?
  remove(self, item)
Remove an item from the set.
the same type as self union(self, other)
Return a new set which is the union of self and other.
    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

Instance Variable Summary
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
list items: A list of the items which are in the set

Class Variable Summary
list __slots__ = ['rdclass', 'rdtype', 'covers', 'ttl']

Method Details

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

Create a new rdataset of the specified class and type.
Overrides:
dns.set.Set.__init__

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
Overrides:
dns.set.Set.__eq__

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)
Overrides:
dns.set.Set.add

intersection_update(self, other)

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
           (type=Set object)
Overrides:
dns.set.Set.intersection_update (inherited documentation)

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

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)

union_update(self, other)

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
           (type=Set object)
Overrides:
dns.set.Set.union_update (inherited documentation)

update(self, other)

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

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)

_clone(self)

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:
dns.set.Set._clone (inherited documentation)

Instance Variable Details

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.
Type:
int
Value:
<member 'covers' of 'Rdataset' objects>                                

rdclass

The class of the rdataset
Type:
int
Value:
<member 'rdclass' of 'Rdataset' objects>                               

rdtype

The type of the rdataset
Type:
int
Value:
<member 'rdtype' of 'Rdataset' objects>                                

ttl

The DNS TTL (Time To Live) value
Type:
int
Value:
<member 'ttl' of 'Rdataset' objects>                                   

Class Variable Details

__slots__

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

Generated by Epydoc 2.1 on Sun Jan 30 10:41:35 2005 http://epydoc.sf.net