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

Class Node

object --+
         |
        Node


A DNS node.
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, deleting)
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, question)
Return a string containing the node in DNS compressed wire format.

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, deleting=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)
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)
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, question=0)

Return a string containing the node in DNS compressed wire format.
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.
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:
string

Generated by Epydoc 1.1 on Thu Jun 5 22:37:32 2003 http://epydoc.sf.net