Package dns :: Module node :: Class Node
[show private | hide private]
[frames | no frames]

Class Node

object --+
         |
        Node


A DNS node.

A node is a named set of rdatasets
Method Summary
  __init__(self, name)
Initialize a DNS node.
bool __eq__(self, other)
Two nodes are equal if they have the same name and have the same rdatasets.
  __iter__(self)
  __len__(self)
  __ne__(self, other)
a new object with type S, a subtype of T __new__(S, ...)
  __repr__(self)
  __str__(self)
dns.rdataset.Rdataset object find_rdataset(self, rdclass, rdtype, covers, create, force_unique)
Find an rdataset matching the specified properties in the current node.
string to_text(self, **kw)
Convert a node to text format.
string to_wire(self, file, compress, origin, **kw)
Return a string containing the node in DNS compressed wire format.

Instance Variable Summary
dns.name.Name object name - the node's name
list of dns.rdataset.Rdataset objects rdatasets - the node's rdatasets

Method Details

__init__(self, name)
(Constructor)

Initialize a DNS node.
Parameters:
name - The node's name
           (type=dns.name.Name object.)

__eq__(self, other)
(Equality operator)

Two nodes are equal if they have the same name and have the same rdatasets.
Returns:
bool

__new__(S, ...)

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

find_rdataset(self, rdclass, rdtype, covers=0, create=0, force_unique=0)

Find an rdataset matching the specified properties in the current node.
Parameters:
rdclass - The class of the rdataset
           (type=int)
rdtype - The type of the rdataset
           (type=int)
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)
create - If True, create the rdataset if it is not found, unless force_unique is also True, in which case always create a new rdataset. The created rdataset is appended to self.rdatasets.
           (type=bool)
force_unique - If create is True, always create the rdataset, even if it already exists.
           (type=bool)
Returns:
dns.rdataset.Rdataset object

to_text(self, **kw)

Convert a node to text format.

Each rdataset at the node is printed. Any keyword arguments to this method are passed on to the rdataset's to_text() method.
Returns:
string

to_wire(self, file, compress=None, origin=None, **kw)

Return a string containing the node in DNS compressed wire format.

Additional keyword arguments are passed to the rdataset to_wire() method.
Parameters:
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:
string

Instance Variable Details

name

the node's name
Type:
dns.name.Name object

rdatasets

the node's rdatasets
Type:
list of dns.rdataset.Rdataset objects

Generated by Epydoc 1.1 on Sat Jul 19 02:54:28 2003 http://epydoc.sf.net