dnspython  1.16.0
About: dnspython is a DNS toolkit (for Python 2.x) that supports almost all record types.
  Fossies Dox: dnspython-1.16.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dns.rdataset.Rdataset Class Reference
Inheritance diagram for dns.rdataset.Rdataset:
[legend]
Collaboration diagram for dns.rdataset.Rdataset:
[legend]

Public Member Functions

def __init__ (self, rdclass, rdtype, covers=dns.rdatatype.NONE, ttl=0)
 
def update_ttl (self, ttl)
 
def add (self, rd, ttl=None)
 
def union_update (self, other)
 
def intersection_update (self, other)
 
def update (self, other)
 
def __repr__ (self)
 
def __str__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def to_text (self, name=None, origin=None, relativize=True, override_rdclass=None, **kw)
 
def to_wire (self, name, file, compress=None, origin=None, override_rdclass=None, want_shuffle=True)
 
def match (self, rdclass, rdtype, covers)
 
- Public Member Functions inherited from dns.set.Set
def __init__ (self, items=None)
 
def add (self, item)
 
def remove (self, item)
 
def discard (self, item)
 
def __copy__ (self)
 
def copy (self)
 
def difference_update (self, other)
 
def union (self, other)
 
def intersection (self, other)
 
def difference (self, other)
 
def __or__ (self, other)
 
def __and__ (self, other)
 
def __add__ (self, other)
 
def __sub__ (self, other)
 
def __ior__ (self, other)
 
def __iand__ (self, other)
 
def __iadd__ (self, other)
 
def __isub__ (self, other)
 
def clear (self)
 
def __len__ (self)
 
def __iter__ (self)
 
def __getitem__ (self, i)
 
def __delitem__ (self, i)
 
def issubset (self, other)
 
def issuperset (self, other)
 

Public Attributes

 rdclass
 
 rdtype
 
 covers
 
 ttl
 
- Public Attributes inherited from dns.set.Set
 items
 

Private Member Functions

def _clone (self)
 

Static Private Attributes

list __slots__ = ['rdclass', 'rdtype', 'covers', 'ttl']
 

Detailed Description

A DNS rdataset.

Definition at line 44 of file rdataset.py.

Constructor & Destructor Documentation

◆ __init__()

def dns.rdataset.Rdataset.__init__ (   self,
  rdclass,
  rdtype,
  covers = dns.rdatatype.NONE,
  ttl = 0 
)
Create a new rdataset of the specified class and type.

*rdclass*, an ``int``, the rdataclass.

*rdtype*, an ``int``, the rdatatype.

*covers*, an ``int``, the covered rdatatype.

*ttl*, an ``int``, the TTL.

Definition at line 50 of file rdataset.py.

Member Function Documentation

◆ __eq__()

def dns.rdataset.Rdataset.__eq__ (   self,
  other 
)

◆ __ne__()

def dns.rdataset.Rdataset.__ne__ (   self,
  other 
)

◆ __repr__()

def dns.rdataset.Rdataset.__repr__ (   self)

◆ __str__()

◆ _clone()

def dns.rdataset.Rdataset._clone (   self)
private
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.

Reimplemented from dns.set.Set.

Reimplemented in dns.rrset.RRset.

Definition at line 68 of file rdataset.py.

References dns.rdataset.Rdataset.covers, dns.rdataset.Rdataset.rdclass, dns.rdata.Rdata.rdclass, dns.rdataset.Rdataset.rdtype, dns.rdata.Rdata.rdtype, and dns.rdataset.Rdataset.ttl.

Referenced by dns.set.Set.__copy__(), dns.set.Set.copy(), dns.set.Set.difference(), dns.set.Set.intersection(), and dns.set.Set.union().

◆ add()

def dns.rdataset.Rdataset.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.

*rd*, a ``dns.rdata.Rdata``, the rdata

*ttl*, an ``int``, the TTL.

Raises ``dns.rdataset.IncompatibleTypes`` if the type and class
do not match the type and class of the rdataset.

Raises ``dns.rdataset.DifferingCovers`` if the type is a signature
type and the covered type does not match that of the rdataset.

Definition at line 91 of file rdataset.py.

References dns.set.Set.clear(), dns.rdataset.Rdataset.covers, dns.rdatatype.is_singleton(), dns.rdataset.Rdataset.rdclass, dns.rdata.Rdata.rdclass, dns.rdataset.Rdataset.rdtype, dns.rdata.Rdata.rdtype, and dns.rdataset.Rdataset.update_ttl().

Referenced by dns.set.Set.union_update(), and dns.set.Set.update().

◆ intersection_update()

def dns.rdataset.Rdataset.intersection_update (   self,
  other 
)
Update the set, removing any elements from other which are not
in both sets.

Reimplemented from dns.set.Set.

Definition at line 133 of file rdataset.py.

References dns.rdataset.Rdataset.update_ttl().

Referenced by dns.set.Set.__iand__().

◆ match()

def dns.rdataset.Rdataset.match (   self,
  rdclass,
  rdtype,
  covers 
)
Returns ``True`` if this rdataset matches the specified class,
type, and covers.

Definition at line 282 of file rdataset.py.

References dns.rdataset.Rdataset.covers, dns.rdataset.Rdataset.rdclass, dns.rdata.Rdata.rdclass, dns.rdataset.Rdataset.rdtype, and dns.rdata.Rdata.rdtype.

◆ to_text()

def dns.rdataset.Rdataset.to_text (   self,
  name = None,
  origin = None,
  relativize = True,
  override_rdclass = None,
**  kw 
)
Convert the rdataset into DNS master file format.

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

*name*, a ``dns.name.Name``.  If name is not ``None``, emit RRs with
*name* as the owner name.

*origin*, a ``dns.name.Name`` or ``None``, the origin for relative
names.

*relativize*, a ``bool``.  If ``True``, names will be relativized
to *origin*.

Definition at line 170 of file rdataset.py.

References dns.rdataset.Rdataset.rdclass, dns.rdata.Rdata.rdclass, dns.rdataset.Rdataset.rdtype, dns.rdata.Rdata.rdtype, dns.rdataclass.to_text(), dns.rdatatype.to_text(), and dns.rdataset.Rdataset.ttl.

Referenced by dns.rrset.RRset.__str__(), and dns.rdataset.Rdataset.__str__().

◆ to_wire()

def dns.rdataset.Rdataset.to_wire (   self,
  name,
  file,
  compress = None,
  origin = None,
  override_rdclass = None,
  want_shuffle = True 
)
Convert the rdataset to wire format.

*name*, a ``dns.name.Name`` is the owner name to use.

*file* is the file where the name is emitted (typically a
BytesIO file).

*compress*, a ``dict``, is the compression table to use.  If
``None`` (the default), names will not be compressed.

*origin* is a ``dns.name.Name`` or ``None``.  If the name is
relative and origin is not ``None``, then *origin* will be appended
to it.

*override_rdclass*, an ``int``, is used as the class instead of the
class of the rdataset.  This is useful when rendering rdatasets
associated with dynamic updates.

*want_shuffle*, a ``bool``.  If ``True``, then the order of the
Rdatas within the Rdataset will be shuffled before rendering.

Returns an ``int``, the number of records emitted.

Definition at line 224 of file rdataset.py.

References dns.rdataset.Rdataset.rdclass, dns.rdata.Rdata.rdclass, dns.rdataset.Rdataset.rdtype, dns.rdata.Rdata.rdtype, and dns.rdataset.Rdataset.ttl.

◆ union_update()

def dns.rdataset.Rdataset.union_update (   self,
  other 
)
Update the set, adding any elements from other which are not
already in the set.

Reimplemented from dns.set.Set.

Definition at line 129 of file rdataset.py.

References dns.rdataset.Rdataset.update_ttl().

Referenced by dns.set.Set.__iadd__(), and dns.set.Set.__ior__().

◆ update()

def dns.rdataset.Rdataset.update (   self,
  other 
)
Add all rdatas in other to self.

*other*, a ``dns.rdataset.Rdataset``, the rdataset from which
to update.

Reimplemented from dns.set.Set.

Definition at line 137 of file rdataset.py.

References dns.rdataset.Rdataset.update_ttl().

◆ update_ttl()

def dns.rdataset.Rdataset.update_ttl (   self,
  ttl 
)
Perform TTL minimization.

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.

*ttl*, an ``int``.

Definition at line 76 of file rdataset.py.

References dns.rdataset.Rdataset.ttl.

Referenced by dns.rdataset.Rdataset.add(), dns.rdataset.Rdataset.intersection_update(), dns.rdataset.Rdataset.union_update(), and dns.rdataset.Rdataset.update().

Member Data Documentation

◆ __slots__

list dns.rdataset.Rdataset.__slots__ = ['rdclass', 'rdtype', 'covers', 'ttl']
staticprivate

Definition at line 48 of file rdataset.py.

◆ covers

◆ rdclass

◆ rdtype

◆ ttl


The documentation for this class was generated from the following file: