Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
idna / lib / python2.7 / site-packages / eventlet / support / dns / message.pyc
Size: Mime:
ó
 ‹EYc@@s_dZddlmZddlmZddlZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlZddlZddlZddlZddlZddlZddlZddlmZmZmZdejjfd„ƒYZd	ejjfd
„ƒYZdejjfd„ƒYZd
ejjfd„ƒYZ dejjfd„ƒYZ!dejjfd„ƒYZ"de#fd„ƒYZ$de#fd„ƒYZ%e&de'e&e&e'e(e'e'e'd„
Z)de#fd„ƒYZ*d„Z+d„Z,ej-j.e&e'e&e&e&e&d„Z/e'ddd „Z0dS(!sDNS Messagesi(tabsolute_import(tStringIONi(tlongtxrangetstring_typestShortHeadercB@seZdZRS(s2The DNS packet passed to from_wire() is too short.(t__name__t
__module__t__doc__(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR*stTrailingJunkcB@seZdZRS(sEThe DNS packet passed to from_wire() has extra junk at the end of it.(RRR(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR	/stUnknownHeaderFieldcB@seZdZRS(sVThe header field name was not recognized when converting from text
    into a message.(RRR(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR
4stBadEDNScB@seZdZRS(sVOPT record occurred somewhere other than the start of
    the additional data section.(RRR(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR:stBadTSIGcB@seZdZRS(sWA TSIG record occurred somewhere other than the end of
    the additional data section.(RRR(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR@stUnknownTSIGKeycB@seZdZRS(s(A TSIG with an unknown key was received.(RRR(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR
FstMessagecB@s
eZdZdd„Zd„Zd„Zded„Zd„Z	d„Z
d„Zd„Ze
jjdeed	„Ze
jjdeed
„Zddd„Zdd
ddde
jjd„Zdddddd„Zed„Zd„Zd„Zd„Zd„ZRS(s,
A DNS message.

    @ivar id: The query id; the default is a randomly chosen id.
    @type id: int
    @ivar flags: The DNS flags of the message.  @see: RFC 1035 for an
    explanation of these flags.
    @type flags: int
    @ivar question: The question section.
    @type question: list of dns.rrset.RRset objects
    @ivar answer: The answer section.
    @type answer: list of dns.rrset.RRset objects
    @ivar authority: The authority section.
    @type authority: list of dns.rrset.RRset objects
    @ivar additional: The additional data section.
    @type additional: list of dns.rrset.RRset objects
    @ivar edns: The EDNS level to use.  The default is -1, no Edns.
    @type edns: int
    @ivar ednsflags: The EDNS flags
    @type ednsflags: long
    @ivar payload: The EDNS payload size.  The default is 0.
    @type payload: int
    @ivar options: The EDNS options
    @type options: list of dns.edns.Option objects
    @ivar request_payload: The associated request's EDNS payload size.
    @type request_payload: int
    @ivar keyring: The TSIG keyring to use.  The default is None.
    @type keyring: dict
    @ivar keyname: The TSIG keyname to use.  The default is None.
    @type keyname: dns.name.Name object
    @ivar keyalgorithm: The TSIG algorithm to use; defaults to
    dns.tsig.default_algorithm.  Constants for TSIG algorithms are defined
    in dns.tsig, and the currently implemented algorithms are
    HMAC_MD5, HMAC_SHA1, HMAC_SHA224, HMAC_SHA256, HMAC_SHA384, and
    HMAC_SHA512.
    @type keyalgorithm: string
    @ivar request_mac: The TSIG MAC of the request message associated with
    this message; used when validating TSIG signatures.   @see: RFC 2845 for
    more information on TSIG fields.
    @type request_mac: string
    @ivar fudge: TSIG time fudge; default is 300 seconds.
    @type fudge: int
    @ivar original_id: TSIG original id; defaults to the message's id
    @type original_id: int
    @ivar tsig_error: TSIG error code; default is 0.
    @type tsig_error: int
    @ivar other_data: TSIG other data.
    @type other_data: string
    @ivar mac: The TSIG MAC for this message.
    @type mac: string
    @ivar xfr: Is the message being used to contain the results of a DNS
    zone transfer?  The default is False.
    @type xfr: bool
    @ivar origin: The origin of the zone in messages which are used for
    zone transfers or for DNS dynamic updates.  The default is None.
    @type origin: dns.name.Name object
    @ivar tsig_ctx: The TSIG signature context associated with this
    message.  The default is None.
    @type tsig_ctx: hmac.HMAC object
    @ivar had_tsig: Did the message decoded from wire format have a TSIG
    signature?
    @type had_tsig: bool
    @ivar multi: Is this message part of a multi-message sequence?  The
    default is false.  This variable is used when validating TSIG signatures
    on messages which are part of a zone transfer.
    @type multi: bool
    @ivar first: Is this message standalone, or the first of a multi
    message sequence?  This variable is used when validating TSIG signatures
    on messages which are part of a zone transfer.
    @type first: bool
    @ivar index: An index of rrsets in the message.  The index key is
    (section, name, rdclass, rdtype, covers, deleting).  Indexing can be
    disabled by setting the index to None.
    @type index: dict
    cC@s!|dkr!tjjƒ|_n	||_d|_g|_g|_g|_g|_	d|_
d|_d|_g|_
d|_d|_d|_tjj|_d|_d|_d|_d|_|j|_d|_t|_d|_d|_t|_t|_t |_!i|_"dS(Niiÿÿÿÿti,(#tNonetdnstentropyt	random_16tidtflagstquestiontanswert	authorityt
additionaltednst	ednsflagstpayloadtoptionstrequest_payloadtkeyringtkeynamettsigtdefault_algorithmtkeyalgorithmtrequest_mact
other_datat
tsig_errortfudgetoriginal_idtmactFalsetxfrtoriginttsig_ctxthad_tsigtmultitTruetfirsttindex(tselfR((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt__init__˜s:																								cC@sdt|jƒdS(Ns<DNS message, ID t>(treprR(R3((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt__repr__¸scC@s
|jƒS(N(tto_text(R3((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt__str__»scK@sštƒ}|jd|jƒ|jdtjjtjj|jƒƒƒtjj|j|j	ƒ}|jdtjj|ƒƒ|jdtjj|jƒƒ|j
dkr
|jd|j
ƒ|j	dkrö|jdtjj|j	ƒƒn|jd|jƒntjj
|jƒ}|r8|jd	ƒn
|jd
ƒx:|jD]/}|j|j|||ƒ|jdƒqOW|r˜|jdƒn
|jd
ƒx:|jD]/}|j|j|||ƒ|jdƒq¯W|rø|jdƒn
|jdƒx:|jD]/}|j|j|||ƒ|jdƒqW|jdƒx:|jD]/}|j|j|||ƒ|jdƒqYW|jƒd S(s¶Convert the message to text.

        The I{origin}, I{relativize}, and any other keyword
        arguments are passed to the rrset to_wire() method.

        @rtype: string
        uid %d
u
opcode %s
u	rcode %s
u	flags %s
iuedns %s
u
eflags %s
upayload %d
u;ZONE
u
;QUESTION
u
u;PREREQ
u;ANSWER
u;UPDATE
u;AUTHORITY
u;ADDITIONAL
iÿÿÿÿ(RtwriteRRtopcodeR8t
from_flagsRtrcodeRRtedns_to_textRt	is_updateRRRRtgetvalue(R3R,t
relativizetkwtstrcR?trrset((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR8¾sJ			# 	



cC@s-t|tƒstS|j|jkr)tS|j|jkr?tSx$|jD]}||jkrItSqIWx$|jD]}||jkrptSqpWx$|jD]}||jkr—tSq—Wx$|jD]}||jkr¾tSq¾Wx$|jD]}||jkråtSqåWx$|jD]}||jkrtSqWtS(sŠTwo messages are equal if they have the same content in the
        header, question, answer, and authority sections.
        @rtype: bool(	t
isinstanceRR*RRRRRR0(R3tothertn((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt__eq__õs2cC@s|j|ƒS(s0Are two messages not equal?
        @rtype: bool(RI(R3RG((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt__ne__scC@sï|jtjj@dksU|j|jksUtjj|jƒtjj|jƒkrYtStjj|j|jƒtjj	kr„t
Stjj|jƒrt
Sx$|jD]}||jkr§tSq§Wx$|jD]}||jkrÎtSqÎWt
S(s1Is other a response to self?
        @rtype: booli(
RRtQRRR;R<R*R=RtNOERRORR0R?R(R3RGRH((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pytis_responses"cC@s\||jkrdS||jkr&dS||jkr9dS||jkrLdStdƒ‚dS(Niiiisunknown section(RRRRt
ValueError(R3tsection((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pytsection_number-sc	C@së|j|ƒ|||||f}	|sŽ|jdk	r[|jj|	ƒ}
|
dk	r‹|
SqŽx0|D]%}
|
j|||||ƒrb|
SqbWn|st‚ntjj|||||ƒ}
|j	|
ƒ|jdk	rç|
|j|	<n|
S(sFind the RRset with the given attributes in the specified section.

        @param section: the section of the message to look in, e.g.
        self.answer.
        @type section: list of dns.rrset.RRset objects
        @param name: the name of the RRset
        @type name: dns.name.Name object
        @param rdclass: the class of the RRset
        @type rdclass: int
        @param rdtype: the type of the RRset
        @type rdtype: int
        @param covers: the covers value of the RRset
        @type covers: int
        @param deleting: the deleting value of the RRset
        @type deleting: int
        @param create: If True, create the RRset if it is not found.
        The created RRset is appended to I{section}.
        @type create: bool
        @param force_unique: If True and create is also True, create a
        new RRset regardless of whether a matching RRset exists already.
        @type force_unique: bool
        @raises KeyError: the RRset was not found and create was False
        @rtype: dns.rrset.RRset objectN(
RPR2RtgettmatchtKeyErrorRREtRRsettappend(R3ROtnametrdclasstrdtypetcoverstdeletingtcreatetforce_uniquetkeyRE((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt
find_rrset9s"
	
c	
	C@sFy(|j||||||||ƒ}	Wntk
rAd}	nX|	S(sGet the RRset with the given attributes in the specified section.

        If the RRset is not found, None is returned.

        @param section: the section of the message to look in, e.g.
        self.answer.
        @type section: list of dns.rrset.RRset objects
        @param name: the name of the RRset
        @type name: dns.name.Name object
        @param rdclass: the class of the RRset
        @type rdclass: int
        @param rdtype: the type of the RRset
        @type rdtype: int
        @param covers: the covers value of the RRset
        @type covers: int
        @param deleting: the deleting value of the RRset
        @type deleting: int
        @param create: If True, create the RRset if it is not found.
        The created RRset is appended to I{section}.
        @type create: bool
        @param force_unique: If True and create is also True, create a
        new RRset regardless of whether a matching RRset exists already.
        @type force_unique: bool
        @rtype: dns.rrset.RRset object or NoneN(R^RSR(
R3RORVRWRXRYRZR[R\RE((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt	get_rrsetgs

ic	K@sÙ|dkr0|jdkr'|j}q0d}n|dkrEd}n|dkrZd}ntjj|j|j||ƒ}x-|jD]"}|j|j|j	|j
ƒq…Wx*|jD]}|jtjj
||qµWx*|jD]}|jtjj||qâW|jdkr9|j|j|j|j|jƒnx*|jD]}|jtjj||qCW|jƒ|jdk	rÏ|j|j|j|j|j|j|j|j|j |j!ƒ|j"|_"n|j#ƒS(s7Return a string containing the message in DNS compressed wire
        format.

        Additional keyword arguments are passed to the rrset to_wire()
        method.

        @param origin: The origin to be appended to any relative names.
        @type origin: dns.name.Name object
        @param max_size: The maximum size of the wire format output; default
        is 0, which means 'the message's request payload, if nonzero, or
        65536'.
        @type max_size: int
        @raises dns.exception.TooBig: max_size was exceeded
        @rtype: string
        iiÿÿiN($RRtrenderertRendererRRRtadd_questionRVRXRWRt	add_rrsettANSWERRt	AUTHORITYRtadd_ednsRRRRt
ADDITIONALtwrite_headerR Rtadd_tsigRR'R(R&R%R$R#R)tget_wire(R3R,tmax_sizeRBtrRE((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pytto_wireŠs6			! %

i,RcC@s­||_|dkr4t|jjƒƒd|_n-t|tƒrXtjj	|ƒ}n||_||_
||_|dkrŽ|j|_
n	||_
||_||_dS(swWhen sending, a TSIG signature using the specified keyring
        and keyname should be added.

        @param keyring: The TSIG keyring to use; defaults to None.
        @type keyring: dict
        @param keyname: The name of the TSIG key to use; defaults to None.
        The key must be defined in the keyring.  If a keyring is specified
        but a keyname is not, then the key used will be the first key in the
        keyring.  Note that the order of keys in a dictionary is not defined,
        so applications should supply a keyname when a keyring is used, unless
        they know the keyring contains only one key.
        @type keyname: dns.name.Name or string
        @param fudge: TSIG time fudge; default is 300 seconds.
        @type fudge: int
        @param original_id: TSIG original id; defaults to the message's id
        @type original_id: int
        @param tsig_error: TSIG error code; default is 0.
        @type tsig_error: int
        @param other_data: TSIG other data.
        @type other_data: string
        @param algorithm: The TSIG algorithm to use; defaults to
        dns.tsig.default_algorithm
        iN(RRtlisttkeysR RFRRRVt	from_textR#R'RR(R&R%(R3RR R'R(R&R%t	algorithm((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pytuse_tsig¸s						icC@sÖ|dks|tkr!d}n|tkr6d}n|dkrK|}n|dkrrd}d}d}g}n3|tdƒM}||d>O}|dkr¥g}n||_||_||_||_||_dS(s_Configure EDNS behavior.
        @param edns: The EDNS level to use.  Specifying None, False, or -1
        means 'do not use EDNS', and in this case the other parameters are
        ignored.  Specifying True is equivalent to specifying 0, i.e. 'use
        EDNS0'.
        @type edns: int or bool or None
        @param ednsflags: EDNS flag values.
        @type ednsflags: int
        @param payload: The EDNS sender's payload field, which is the maximum
        size of UDP datagram the sender can handle.
        @type payload: int
        @param request_payload: The EDNS payload size to use when sending
        this message.  If not specified, defaults to the value of payload.
        @type request_payload: int or None
        @param options: The EDNS options
        @type options: None or list of dns.edns.Option objects
        @see: RFC 2671
        iÿÿÿÿiIÿÿÿiN(	RR*R0RRRRRR(R3RRRRR((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pytuse_ednsãs(									cC@sf|r:|jdkr"|jƒn|jtjjO_n(|jdkrb|jtjjM_ndS(s
Enable or disable 'DNSSEC desired' flag in requests.
        @param wanted: Is DNSSEC desired?  If True, EDNS is enabled if
        required, and then the DO bit is set.  If False, the DO bit is
        cleared if EDNS is enabled.
        @type wanted: bool
        iN(RRsRRRtDO(R3twanted((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pytwant_dnssecs
cC@stjj|j|jƒS(s.Return the rcode.
        @rtype: int
        (RR=R<RR(R3((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR=scC@sˆtjj|ƒ\}}|jdM_|j|O_|jtdƒM_|j|O_|jdkr„|jdkr„d|_ndS(sPSet the rcode.
        @param rcode: the rcode
        @type rcode: int
        iðÿiÿÿÿiN(RR=tto_flagsRRRR(R3R=tvaluetevalue((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt	set_rcode"scC@stjj|jƒS(s/Return the opcode.
        @rtype: int
        (RR;R<R(R3((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR;/scC@s.|jdM_|jtjj|ƒO_dS(sTSet the opcode.
        @param opcode: the opcode
        @type opcode: int
        iÿ‡N(RRR;Rw(R3R;((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt
set_opcode5sN(RRRRR4R7R9R0R8RIRJRMRPRt	rdatatypetNONER*R^R_RmR!R"RrRsRvR=RzR;R{(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyRKs0K 		7				
-!.	)*		
	t_WireReadercB@s;eZdZeeed„Zd„Zd„Zd„ZRS(sþWire format reader.

    @ivar wire: the wire-format message.
    @type wire: string
    @ivar message: The message object being built
    @type message: dns.message.Message object
    @ivar current: When building a message object from wire format, this
    variable contains the offset from the beginning of wire of the next octet
    to be read.
    @type current: int
    @ivar updating: Is the message a dynamic update?
    @type updating: bool
    @ivar one_rr_per_rrset: Put each RR into its own RRset?
    @type one_rr_per_rrset: bool
    @ivar ignore_trailing: Ignore trailing junk at end of request?
    @type ignore_trailing: bool
    @ivar zone_rdclass: The class of the zone in messages which are
    DNS dynamic updates.
    @type zone_rdclass: int
    cC@s^tjj|ƒ|_||_d|_t|_tjj	|_
||_||_||_
dS(Ni(Rtwiredatat
maybe_wraptwiretmessagetcurrentR*tupdatingt
rdataclasstINtzone_rdclasst
question_onlytone_rr_per_rrsettignore_trailing(R3RR‚RˆR‰RŠ((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR4Us					c
C@s|jr$|dkr$tjj‚nxîtd|ƒD]Ý}tjj|j|jƒ\}}|j	j
dk	r…|j|j	j
ƒ}n|j||_t
jd|j|j|jd!ƒ\}}|jd|_|j	j|j	j|||dtdtƒ|jr4||_q4q4WdS(s¸Read the next I{qcount} records from the wire data and add them to
        the question section.
        @param qcount: the number of questions in the message
        @type qcount: intiis!HHiR[R\N(R„Rt	exceptiont	FormErrorRRVt	from_wireRRƒR‚R,RRAtstructtunpackR^RR0R‡(R3tqcounttitqnametusedRXRW((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt
_get_question`s!	#	c
C@s˜|js|jrt}nt}t}xjtd|ƒD]Y}|j}tjj|j	|jƒ\}}|}	|j
jdk	r—|j
|j
jƒ}n|j||_tjd|j	|j|jd!ƒ\}
}}}
|jd|_|
tjjkrø||j
jk	s|rt‚n||j
_||j
_|d@d?|j
_g|j
_|j}|
}x‰|dkrîtjd|j	||d!ƒ\}}|d}tjj||j	||ƒ}|j
jj|ƒ||}|d|}qfWt}nˆ|
tjjkr5||j
jko)||dks5t‚n|j
jdkrVtd	ƒ‚n|j
jj|	ƒ}|dkrŠtd
|ƒ‚n|	|j
_tj j!|j	|j|
ƒ\|j
_"|j
_#tj j$|j	|	|t%t&j&ƒƒ|j
j'||j|
|j
j(|j
j)|j
j*ƒ|j
_(t|j
_+nK|dkrJd}n|jr‰|tj,j-ksw|tj,j.kr‰|}|j/}nd}|tj,j-ksÅ|tj,j.krÚ||j
j0krÚtjj.}d}n9tj1j||
|j	|j|
|j
jƒ}|j2ƒ}|j
j3r:|
tjj4kr:t}n|j
j5||||
||t|ƒ}|dk	r€|j6||ƒn|j|
|_q7WdS(s/Read the next I{count} records from the wire data and add them to
        the specified section.
        @param section: the section of the message to which to add records
        @type section: list of dns.rrset.RRset objects
        @param count: the number of records to read
        @type count: intis!HHIHi
iÿis!HHiis"got signed message without keyringskey '%s' unknownN(7R„R‰R0R*RRƒRRVRRR‚R,RRARŽRR|tOPTRRRRRRtoption_from_wireRUtTSIGRRR
RQR R!tget_algorithm_and_macR#R)tvalidatetintttimeR$R-R/R1R.R…tANYR}R‡RtrdataRYR+tSOAR^tadd(R3ROtcountR\tseen_optR‘trr_startRVR“t
absolute_nameRXRWtttltrdlenRƒtoptslentotypetolentopttsecretRZRYtrdRE((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt_get_sectionxs¤		!	)			
	
											cC@sHt|jƒ}|dkr$t‚ntjd|jd ƒ\|j_|j_}}}}d|_t	j
j|jjƒrˆt|_
n|j|ƒ|jr¢dS|j|jj|ƒ|j|jj|ƒ|j|jj|ƒ|jr|j|krt‚n|jjrD|jjrD|jjrD|jjj|jƒndS(sNRead a wire format DNS message and build a dns.message.Message
        object.is!HHHHHHN(tlenRRRŽRR‚RRRƒRR;R?R0R„R”RˆR¬RRRRŠR	R/R-R.tupdate(R3tlRtancounttaucounttadcount((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pytreadÛs$	7	
		
(RRRR*R4R”R¬R³(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR~>s
		cRc
C@sttddƒ}||_||_||_||_||_||_||_t||||	|
ƒ}|j	ƒ|S(s)Convert a DNS wire format message into a message
    object.

    @param keyring: The keyring to use if the message is signed.
    @type keyring: dict
    @param request_mac: If the message is a response to a TSIG-signed request,
    I{request_mac} should be set to the MAC of that request.
    @type request_mac: string
    @param xfr: Is this message part of a zone transfer?
    @type xfr: bool
    @param origin: If the message is part of a zone transfer, I{origin}
    should be the origin name of the zone.
    @type origin: dns.name.Name object
    @param tsig_ctx: The ongoing TSIG context, used when validating zone
    transfers.
    @type tsig_ctx: hmac.HMAC object
    @param multi: Is this message part of a multiple message sequence?
    @type multi: bool
    @param first: Is this message standalone, or the first of a multi
    message sequence?
    @type first: bool
    @param question_only: Read only up to the end of the question section?
    @type question_only: bool
    @param one_rr_per_rrset: Put each RR into its own RRset
    @type one_rr_per_rrset: bool
    @param ignore_trailing: Ignore trailing junk at end of request?
    @type ignore_trailing: bool
    @raises ShortHeader: The message is less than 12 octets long.
    @raises TrailingJunk: There were octets in the message past the end
    of the proper DNS message.
    @raises BadEDNS: An OPT record was in the wrong section, or occurred more
    than once.
    @raises BadTSIG: A TSIG record was not the last record of the additional
    data section.
    @rtype: dns.message.Message objectRi(
RRR$R+R,R-R/R1R~R³(
RRR$R+R,R-R/R1RˆR‰RŠtmtreader((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyRôs(								
t_TextReadercB@s;eZdZd„Zd„Zd„Zd„Zd„ZRS(sText format reader.

    @ivar tok: the tokenizer
    @type tok: dns.tokenizer.Tokenizer object
    @ivar message: The message object being built
    @type message: dns.message.Message object
    @ivar updating: Is the message a dynamic update?
    @type updating: bool
    @ivar zone_rdclass: The class of the zone in messages which are
    DNS dynamic updates.
    @type zone_rdclass: int
    @ivar last_name: The most recently read name when building a message object
    from text format.
    @type last_name: dns.name.Name object
    cC@sC||_tjj|ƒ|_d|_tjj|_	t
|_dS(N(R‚Rt	tokenizert	TokenizerttokRt	last_nameR…R†R‡R*R„(R3ttextR‚((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR4>s
		cC@s‡|jjƒ}|j}|dkr<|jjƒ|j_n:|dkrÐx^tr¨|jjƒ}|jƒs€|jj|ƒPn|jj	t
j	j|jƒB|j_	qKWt
jj
|jj	ƒrvt|_qvn¦|dkr|jjƒ|j_|jj|jjd>B|j_nb|dkr¥|jjdkrAd|j_nx2tr¡|jjƒ}|jƒsy|jj|ƒPn|jjt
j	j|jƒB|j_qDWnÑ|dkrê|jjƒ|j_|jjdkrvd|j_qvnŒ|dkr6|jjƒ}|jj	t
jjt
jj|ƒƒB|j_	n@|d	krp|jjƒ}|jjt
jj|ƒƒnt‚|jjƒd
S(s5Process one line from the text format header section.RRRiteflagsiRR;R=N(R¹RQRxtget_intR‚RR0t
is_identifiertungetRRRpR;R?R„RRtedns_from_textRt
get_stringRwRzR=R
tget_eol(R3ROttokentwhatR»((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt_header_lineEsR			 			#	(c	C@s]|jjdtƒ}|jƒs?tjj|jdƒ|_	n|j	}|jjƒ}|j
ƒsrtjj‚nyCtj
j|jƒ}|jjƒ}|j
ƒs´tjj‚nWn?tjjk
rÚtjj‚ntk
rötj
j}nXtjj|jƒ}|jj|jj|||dtdtƒ|jrL||_n|jjƒdS(s7Process one line from the text format question section.twant_leadingR[R\N(R¹RQR0t
is_whitespaceRRVRpRxRRºR¾R‹tSyntaxErrorR…t	ExceptionR†R|R‚R^RR„R‡RÂ(R3RORÃRVRWRX((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt_question_liness.	
	c	C@s{d}|jjdtƒ}|jƒsEtjj|jdƒ|_	n|j	}|jjƒ}|j
ƒsxtjj‚ny@t
|jdƒ}|jjƒ}|j
ƒs·tjj‚nWn9tjjk
rÝtjj‚ntk
ród}nXyytjj|jƒ}|jjƒ}|j
ƒs6tjj‚n|tjjksZ|tjjkrl|}|j}nWn?tjjk
r’tjj‚ntk
r®tjj}nXtjj|jƒ}|jjƒ}|jƒs|jj|ƒtjj|||jdƒ}|jƒ}	nd}tjj}	|jj|||||	|t|jƒ}
|dk	rw|
j||ƒndS(sfProcess one line from the text format answer, authority, or
        additional data sections.
        RÆiN(RR¹RQR0RÇRRVRpRxRºR¾R‹RÈRšRÉR…RœR}R‡R†R|t
is_eol_or_eofR¿RRYR‚R^R„RŸ(R3RORZRÃRVR¤RWRXR«RYRE((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt_rr_linesT	

$
	cC@sS|j}d	}x=|jjttƒ}|jƒr7Pn|jƒr1|jjƒ}|dkrj|j}n´|dks‚|dkrš|j	}|j
j}n„|dks²|dkrÊ|j}|j
j
}nT|dksâ|dkrú|j}|j
j}n$|dkr|j}|j
j}n|jjƒqn|jj|ƒ||ƒqWd	S(
sNRead a text format DNS message and build a dns.message.Message
        object.tHEADERtQUESTIONtZONERdtPREREQRetUPDATERgN(RÅRR¹RQR0RËt
is_commentRxtupperRÊR‚RRÌRRRRÂR¿(R3tline_methodRORÃtu((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR³Ås4					
(RRRR4RÅRÊRÌR³(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyR¶,s		.		5cC@s&tƒ}t||ƒ}|jƒ|S(sæConvert the text format message into a message object.

    @param text: The text format message.
    @type text: string
    @raises UnknownHeaderField:
    @raises dns.exception.SyntaxError:
    @rtype: dns.message.Message object(RR¶R³(R»R´Rµ((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyRpås
	
cC@sdt}d}t||ƒr3t||ƒ}t}nt}zt|ƒ}Wd|r_|jƒnX|S(sRead the next text format message from the specified file.

    @param f: file or string.  If I{f} is a string, it is treated
    as the name of a file to open.
    @raises UnknownHeaderField:
    @raises dns.exception.SyntaxError:
    @rtype: dns.message.Message objecttrUN(RRFtopenR0R*Rptclose(tftstr_typetoptst
want_closeR´((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt	from_fileús		c		C@s•t|tƒr$tjj|ƒ}nt|tƒrHtjj|ƒ}nt|tƒrltjj|ƒ}ntƒ}	|	jtjj	O_|	j
|	j|||dtdtƒi}
|d	k	rã||
d<|d	krãd}qãn|d	k	r||
d<|d	krd}qn|d	k	r?||
d<|d	kr?d}q?n|d	k	rm||
d<|d	krmd}qmn||
d<|	j|
|	j|ƒ|	S(
sVMake a query message.

    The query name, type, and class may all be specified either
    as objects of the appropriate type, or as strings.

    The query will have a randomly chosen query id, and its DNS flags
    will be set to dns.flags.RD.

    @param qname: The query name.
    @type qname: dns.name.Name object or string
    @param rdtype: The desired rdata type.
    @type rdtype: int
    @param rdclass: The desired rdata class; the default is class IN.
    @type rdclass: int
    @param use_edns: The EDNS level to use; the default is None (no EDNS).
    See the description of dns.message.Message.use_edns() for the possible
    values for use_edns and their meanings.
    @type use_edns: int or bool or None
    @param want_dnssec: Should the query indicate that DNSSEC is desired?
    @type want_dnssec: bool
    @param ednsflags: EDNS flag values.
    @type ednsflags: int
    @param payload: The EDNS sender's payload field, which is the maximum
    size of UDP datagram the sender can handle.
    @type payload: int
    @param request_payload: The EDNS payload size to use when sending
    this message.  If not specified, defaults to the value of payload.
    @type request_payload: int or None
    @param options: The EDNS options
    @type options: None or list of dns.edns.Option objects
    @see: RFC 2671
    @rtype: dns.message.Message objectR[R\RiRRRRN(RFRRRVRpR|R…RRtRDR^RR0RRsRv(R’RXRWRsRvRRRRR´tkwargs((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt
make_querys>$	






i i,cC@s|jtjj@r(tjjdƒ‚ntjj|jƒ}tjj|jtjj@B|_|r{|jtjj	O_n|j
|jƒƒt|j
ƒ|_
|jdkrË|jdd||jƒn|jr|j|j|j|ddd|jƒ|j|_n|S(sMake a message which is a response for the specified query.
    The message returned is really a response skeleton; it has all
    of the infrastructure required of a response, but none of the
    content.

    The response's question section is a shallow copy of the query's
    question section, so the query's question RRsets should not be
    changed.

    @param query: the query to respond to
    @type query: dns.message.Message object
    @param recursion_available: should RA be set in the response?
    @type recursion_available: bool
    @param our_payload: payload size to advertise in EDNS responses; default
    is 8192.
    @type our_payload: int
    @param fudge: TSIG time fudge; default is 300 seconds.
    @type fudge: int
    @rtype: dns.message.Message objects&specified query message is not a queryiRN(RRRKR‹RŒR‚RRRÞtRAR{R;RnRRRsRR.RrRR RR#R)R$(tquerytrecursion_availabletour_payloadR'tresponse((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt
make_response\s 	
(1Rt
__future__RtioRRŽR›tdns.ednsRt
dns.exceptiont	dns.flagstdns.namet
dns.opcodetdns.entropyt	dns.rcodet	dns.rdatatdns.rdataclasst
dns.rdatatypet	dns.rrsettdns.renderertdns.tsigtdns.wiredatat_compatRRRR‹RŒRR	tDNSExceptionR
RRR
tobjectRR~RR*R0RR¶RpRÝR…R†RàRæ(((sQ/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/message.pyt<module>sPÿô¶	5¹			F