ó Ò¥€Oc@sîdZddlZddlZddlZddlZddlZddlZddlZddl Zej j Z dej jfd„ƒYZdej jfd„ƒYZdej j fd„ƒYZd „Zd „Zd „Zd „ZdS( sHDNS rdatasets (an rdataset is a set of rdatas of a given type and class)iÿÿÿÿNtDifferingCoverscBseZdZRS(sƒRaised if an attempt is made to add a SIG/RRSIG whose covered type is not the same as that of the other rdatas in the rdataset.(t__name__t __module__t__doc__(((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyRstIncompatibleTypescBseZdZRS(sBRaised if an attempt is made to add rdata of an incompatible type.(RRR(((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR$stRdatasetcBsÂeZdZddddgZejjd„Zd„Zd„Z dd„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zddedd„Zddded„Zd„ZRS(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 trdclasstrdtypetcoverstttlcCs;tt|ƒjƒ||_||_||_d|_dS(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}iN(tsuperRt__init__RRRR (tselfRRR((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR >s    cCsItt|ƒjƒ}|j|_|j|_|j|_|j|_|S(N(R Rt_cloneRRRR (R tobj((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR Js     cCs=t|ƒdkr||_n||jkr9||_ndS(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: intiN(tlenR (R R ((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyt update_ttlRs cCs|j|jks$|j|jkr-t‚n|dk rI|j|ƒn|jtjjkss|jtjjkrÍ|j ƒ}t |ƒdkr²|j tjj kr²||_ qÍ|j |krÍt ‚qÍntjj |jƒrt |ƒdkr|jƒntt|ƒj|ƒdS(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: intiN(RRRtNoneRtdnst rdatatypetRRSIGtSIGRRtNONERt is_singletontclearR Rtadd(R trdR R((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR^s$   '  ' cCs*|j|jƒtt|ƒj|ƒdS(N(RR R Rt union_update(R tother((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR~scCs*|j|jƒtt|ƒj|ƒdS(N(RR R Rtintersection_update(R R((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR‚scCs*|j|jƒtt|ƒj|ƒdS(s‹Add all rdatas in other to self. @param other: The rdataset from which to update @type other: dns.rdataset.Rdataset objectN(RR R Rtupdate(R R((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR†scCsk|jdkrd}ndtjj|jƒd}dtjj|jƒdtjj|jƒ|dS(Nitt(t)s(RRRtto_textt rdataclassRR(R tctext((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyt__repr__s cCs |jƒS(N(R#(R ((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyt__str__—scCsct|tƒstS|j|jksI|j|jksI|j|jkrMtStt|ƒj|ƒS(sTwo rdatasets are equal if they have the same class, type, and covers, and contain the same rdata. @rtype: bool(t isinstanceRtFalseRRRR t__eq__(R R((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR*šscCs|j|ƒ S(N(R*(R R((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyt__ne__§sc Ks%|d k r3|j||ƒ}t|ƒ}d}n d}d}tjƒ}|d k r`|} n |j} t|ƒdkr³|d||tjj| ƒtj j|j ƒfIJndxa|D]Y} |d|||j tjj| ƒtj j|j ƒ| jd|d||fIJqº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"Ris %s%s%s %ss%s%s%d %s %s %storigint relativizeiÿÿÿÿN( Rtchoose_relativitytstrtStringIORRRR$R#RRR tgetvalue( R tnameR,R-toverride_rdclasstkwtntexttpadtsRR((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR#ªs(         #c Cs•|dk r|}t}n |j}|jddƒt|ƒdkrˆ|j|||ƒtjd|j|ddƒ}|j |ƒdS|rªt |ƒ} t j | ƒn|} xÔ| D]Ì} |j|||ƒtjd|j||j dƒ}|j |ƒ|jƒ} | j|||ƒ|jƒ} | | dks?t‚|j| dƒtjd| | ƒ}|j |ƒ|jddƒq·Wt|ƒSdS(s,Convert the rdataset to wire format. @param name: The owner name of the RRset that will be emitted @type name: dns.name.Name object @param file: The file to which the wire format data will be appended @type file: file @param compress: The compression table to use; the default is None. @type compress: dict @param origin: The origin to be appended to any relative names when they are emitted. The default is None. @returns: the number of records emitted @rtype: int iis!HHIHiis!HN(RR)RtseekRtto_wiretstructtpackRtwritetlisttrandomtshuffleR ttelltAssertionError( R R2tfiletcompressR,R3t want_shuffleRtstufftlRtstarttend((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR9Üs8          cCs5|j|kr1|j|kr1|j|kr1tStS(sSReturns True if this rdataset matches the specified class, type, and covers(RRRtTrueR)(R RRR((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pytmatch s N(RRRt __slots__RRRR R RRRRRRR&R'R*R+RIR#R9RJ(((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyR(s$        1/cCs°t|ttfƒr*tjj|ƒ}nt|ttfƒrTtjj|ƒ}nt||ƒ}|j|ƒx9|D]1}tj j|j |j |ƒ}|j |ƒqwW|S(s¤Create an rdataset with the specified class, type, and TTL, and with the specified list of rdatas in text format. @rtype: dns.rdataset.Rdataset object ( R(R/tunicodeRR$t from_textRRRtrdataRRR(RRR t text_rdatastrttR((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pytfrom_text_lists  cGst||||ƒS(sœCreate an rdataset with the specified class, type, and TTL, and with the specified rdatas in text format. @rtype: dns.rdataset.Rdataset object (RR(RRR RO((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyRM'scCs€t|ƒdkr!tdƒ‚nd}xR|D]J}|dkrkt|j|jƒ}|j|ƒt}n|j|ƒq.W|S(s‹Create an rdataset with the specified TTL, and with the specified list of rdata objects. @rtype: dns.rdataset.Rdataset object isrdata list must not be emptyN( Rt ValueErrorRRRRRR)R(R trdatasRPRt first_time((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pytfrom_rdata_list0s    cGs t||ƒS(sƒCreate an rdataset with the specified TTL, and with the specified rdata objects. @rtype: dns.rdataset.Rdataset object (RV(R RT((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyt from_rdataBs(RR>R0R:t dns.exceptionRt dns.rdatatypetdns.rdataclasst dns.rdatatdns.settsettSett SimpleSett exceptiont DNSExceptionRRRRRRMRVRW(((s2/usr/lib64/python2.7/site-packages/dns/rdataset.pyts          í