Repository URL to install this package:
|
Version:
2.5 ▾
|
ó
EYc @ s d Z d d l Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l
Z d d l m Z e j
j Z d e j j f d YZ d e j j f d YZ d
e j
j f d YZ d Z d
Z d Z d Z d S( sH DNS rdatasets (an rdataset is a set of rdatas of a given type and class)iÿÿÿÿN( t StringIOi ( t string_typest DifferingCoversc B s e Z d Z RS( s~ An attempt was made to add a DNS SIG/RRSIG whose covered type
is not the same as that of the other rdatas in the rdataset.( t __name__t
__module__t __doc__( ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR ! s t IncompatibleTypesc B s e Z d Z RS( s? An attempt was made to add DNS RR data of an incompatible type.( R R R ( ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR ' s t Rdatasetc B s e Z d Z d d d d g Z e j j d Z d Z d Z d d Z d Z d
Z
d Z d Z d
Z d Z d Z d d e d d Z d d d e d Z d Z RS( sÝ A DNS rdataset.
@ivar rdclass: The class of the rdataset
@type rdclass: int
@ivar rdtype: The type of the rdataset
@type rdtype: int
@ivar 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 covers: int
@ivar ttl: The DNS TTL (Time To Live) value
@type ttl: int
t rdclasst rdtypet coverst ttlc C s; t t | j | | _ | | _ | | _ d | _ d S( s© Create a new rdataset of the specified class and type.
@see: the description of the class instance variables for the
meaning of I{rdclass} and I{rdtype}i N( t superR t __init__R R R
R ( t selfR R R
( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR
C s
c C sI t t | j } | j | _ | j | _ | j | _ | j | _ | S( N( R R t _cloneR R R
R ( R t obj( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR O s c C s= t | d k r | | _ n | | j k r9 | | _ n d S( sà 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.
@param ttl: The TTL
@type ttl: inti N( t lenR ( R R ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyt
update_ttlW s c C s | j | j k s$ | j | j k r- t n | d k rI | j | n | j t j j k ss | j t j j k rÍ | j } t
| d k r² | j t j j k r² | | _ qÍ | j | k rÍ t qÍ n t j j
| j rt
| d k r| j n t t | j | d S( s% Add the specified rdata to the rdataset.
If the optional I{ttl} parameter is supplied, then
self.update_ttl(ttl) will be called prior to adding the rdata.
@param rd: The rdata
@type rd: dns.rdata.Rdata object
@param ttl: The TTL
@type ttl: inti N( R R R t NoneR t dnst rdatatypet RRSIGt SIGR
R t NONER t is_singletont clearR R t add( R t rdR R
( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR c s $ ''
c C s* | j | j t t | j | d S( N( R R R R t union_update( R t other( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR s c C s* | j | j t t | j | d S( N( R R R R t intersection_update( R R ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR s c C s* | j | j t t | j | d S( s Add all rdatas in other to self.
@param other: The rdataset from which to update
@type other: dns.rdataset.Rdataset objectN( R R R R t update( R R ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR s c C sk | j d k r d } n d t j j | j d } d t j j | j d t j j | j | d S( Ni t t (t )s <DNS t s
rdataset>( R
R R t to_textt
rdataclassR R ( R t ctext( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyt __repr__ s c C s
| j S( N( R% ( R ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyt __str__ s c C sc t | t s t S| j | j k sI | j | j k sI | j | j k rM t St t | j | S( s Two rdatasets are equal if they have the same class, type, and
covers, and contain the same rdata.
@rtype: bool( t
isinstanceR t FalseR R R
R t __eq__( R R ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyR, s c C s | j | S( N( R, ( R R ( ( sR /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/rdataset.pyt __ne__¬ s c K s( | d k r3 | j | | } t | } d } n d } d } t } | d k r] | } n | j } t | d k r³ | j d | | t j j | t j
j | j f ng xd | D]\ }
| j d | | | j t j j | t j
j | j |
j d | d | | f qº W| j
d S(
s Convert the rdataset into DNS master file format.
@see: L{dns.name.Name.choose_relativity} for more information
on how I{origin} and I{relativize} determine the way names
are emitted.
Any additional keyword arguments are passed on to the rdata
to_text() method.
@param name: If name is not None, emit a RRs with I{name} as
the owner name.
@type name: dns.name.Name object
@param origin: The origin for relative names, or None.
@type origin: dns.name.Name object
@param relativize: True if names should names be relativized
@type relativize: boolR$ R! i u
%s%s%s %s
u %s%s%d %s %s %s
t origint
relativizeiÿÿÿÿN( R t choose_relativityt strR R R t writeR R&