MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/3/root/proc/self/root/usr/lib/python2.4/site-packages/dns/message.pyc
m
ڈOc@sdZdkZdkZdkZdkZdkZdkZdkZdk	Zdk
ZdkZdkZdk
ZdkZdkZdkZdkZdkZdkZdkZdeiifdYZdeiifdYZdeiifdYZdeiifd	YZd
eiifdYZdeiifd
YZdefdYZdefdYZ e!de"e!e!e"e#e"e"e"d
Z$defdYZ%dZ&dZ'ei(i)e!e"dde!e!dZ*e"ddZ+dS(sDNS MessagesNtShortHeadercBstZdZRS(s<Raised if the DNS packet passed to from_wire() is too short.(t__name__t
__module__t__doc__(((t//usr/lib/python2.4/site-packages/dns/message.pyR'stTrailingJunkcBstZdZRS(sSRaised if the DNS packet passed to from_wire() has extra junk
    at the end of it.(RRR(((RR+stUnknownHeaderFieldcBstZdZRS(s]Raised if a header field name is not recognized when converting from
    text into a message.(RRR(((RR0stBadEDNScBstZdZRS(saRaised if an OPT record occurs somewhere other than the start of
    the additional data section.(RRR(((RR5stBadTSIGcBstZdZRS(s_Raised if a TSIG record occurs somewhere other than the end of
    the additional data section.(RRR(((RR:stUnknownTSIGKeycBstZdZRS(s/Raised if we got a TSIG but don't know the key.(RRR(((RR	?stMessagecBs
tZdZedZdZdZeedZdZ	dZ
dZdZe
iieeed	Ze
iieeed
ZeddZed
edde
iidZdddeedZedZdZdZdZdZRS(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
    cCs#|djotii|_n
||_d|_g|_g|_g|_	g|_
d|_d|_d|_
g|_d|_d|_d|_tii|_d|_d|_d|_d|_|i|_d|_t|_d|_d|_t|_t|_ t!|_"h|_#dS(Niiti,($tidtNonetdnstentropyt	random_16tselftflagstquestiontanswert	authorityt
additionaltednst	ednsflagstpayloadtoptionstrequest_payloadtkeyringtkeynamettsigtdefault_algorithmtkeyalgorithmtrequest_mact
other_datat
tsig_errortfudgetoriginal_idtmactFalsetxfrtoriginttsig_ctxthad_tsigtmultitTruetfirsttindex(RR((Rt__init__s:
																								cCsd|i
dS(Ns<DNS message, ID t>(RR(R((Rt__repr__scCs
|iS(N(Rtto_text(R((Rt__str__scKs?ti}|d|iIJ|dtiitii|i	IJti
i|i	|i}|dti
i|IJ|dti	i|i	IJ|i
djoY|d|i
IJ|idjo!|dti	i|iIJn|dI|iIJntii|i	}|o|d	IJn|d
IJx*|iD]}||i|||IJq?W|o|dIJn|dIJx*|iD]}||i|||IJqW|o|d
IJn|dIJx*|iD]}||i|||IJqW|dIJx*|iD]}||i|||IJqW|id S(sConvert the message to text.

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

        @rtype: string
        sid %ds	opcode %ssrcode %ssflags %sisedns %ss	eflags %sRs;ZONEs	;QUESTIONs;PREREQs;ANSWERs;UPDATEs
;AUTHORITYs;ADDITIONALiN(t	cStringIOtStringIOtsRRRtopcodeR3t
from_flagsRtrcodeRtrcRtedns_to_textRt	is_updateRtrrsetR)t
relativizetkwRRRtgetvalue(RR)R?R@R=R7R;R>((RR3sH)!







cCsZt|tptSn|i|ijotSn|i|ijotSnx)|iD]}||ijotSqXqXWx)|iD]}||ijotSqqWx)|i	D]}||i	jotSqqWx)|i	D]}||i	jotSqqWx)|i
D]}||i
jotSqqWx)|i
D]}||i
jotSq4q4WtS(sTwo messages are equal if they have the same content in the
        header, question, answer, and authority sections.
        @rtype: boolN(t
isinstancetotherR
R'RRRRtnRRR-(RRCRD((Rt__eq__s@





cCs|i|S(s0Are two messages not equal?
        @rtype: boolN(RRERC(RRC((Rt__ne__scCs
|itii@djp>|i|ijp+tii|itii|ijotSnti	i|i|i
ti	ijotSntii
|iotSnx)|iD]}||ijotSqqWx)|iD]}||ijotSqqWtS(s1Is other a response to self?
        @rtype: booliN(RCRRtQRRRR8R9R'R:RtNOERRORR-R=RRD(RRCRD((Rtis_responses X(

cCsp||ijodSnU||ijodSn=||ijodSn%||ijodSn
tddS(Niiiisunknown section(tsectionRRRRRt
ValueError(RRJ((Rtsection_number sc	Cs|i||||||f}	|pt|i
dj	o+|i
i|	}
|
dj	o|
Sqqx6|D]*}
|
i|||||o|
SqjqjWn|p
tnti
i|||||}
|i|
|i
dj	o|
|i
|	<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(RRLRJtnametrdclasstrdtypetcoverstdeletingtkeytforce_uniqueR/R
tgetR>tmatchtcreatetKeyErrorRtRRsettappend(RRJRMRNRORPRQRVRSRRR>((Rt
find_rrset,s$!


c	
	CsHy(|i||||||||}	Wntj
o
d}	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(
RRZRJRMRNRORPRQRVRSR>RWR
(
RRJRMRNRORPRQRVRSR>((Rt	get_rrsetZsic	Ks|djo'|idjo
|i}q4d}n|djo
d}n|djo
d}ntii|i|i||}x-|i
D]"}|i|i
|i|iqWx*|iD]}|itii||qWx*|iD]}|itii||qW|idjo&|i|i|i|i|inx*|iD]}|itii||qMW|i|idj	oQ|i |i|i!|i|i"|i#|i$|i%|i&|i'|i(|_(n|i)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
        iiiN(*tmax_sizeRRRtrenderertRendererRRR)trRR>tadd_questionRMRORNRt	add_rrsettANSWERR@Rt	AUTHORITYRtadd_ednsRRRRt
ADDITIONALtwrite_headerRR
tadd_tsigRR$R%R#R"R!R R&tget_wire(RR)R\R@R_R>((Rtto_wire}s@






!
 

&


i,RcCs||_|djo|iid|_n6t|ttfoti	i
|}n||_||_||_
|djo|i|_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(RRRR
tkeysRBtstrtunicodeRRMt	from_textt	algorithmR R$R%RR#R"(RRRR$R%R#R"Rn((Rtuse_tsigs	
			
		icCs|djp
|tjo
d}n|tjo
d}n|djo
|}n|djod}d}d}g}n0|dM}||d>O}|djo
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
        iil~iN(	RR
R'R-RRRRR(RRRRRR((Rtuse_ednss*









				cCsl|o7|idjo|in|itiiO_n+|idjo|itiiM_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(twantedRRRpRRRtDO(RRq((Rtwant_dnssecscCstii|i|iS(s.Return the rcode.
        @rtype: int
        N(RR:R9RRR(R((RR:scCstii|\}}|idM_|i|O_|idM_|i|O_|idjo|idjo
d|_ndS(sPSet the rcode.
        @param rcode: the rcode
        @type rcode: int
        iliN(	RR:tto_flagstvaluetevalueRRRR(RR:RvRu((Rt	set_rcodes cCstii|iS(s/Return the opcode.
        @rtype: int
        N(RR8R9RR(R((RR8!scCs.|idM_|itii|O_dS(sTSet the opcode.
        @param opcode: the opcode
        @type opcode: int
        iN(RRRR8Rt(RR8((Rt
set_opcode's(RRRR
R0R2R4R-R3RERFRIRLRt	rdatatypetNONER'RZR[RiRRRoRpRsR:RwR8Rx(((RR
Cs&J 		3				.#.!+*		
	t_WireReadercBs;tZdZeeedZdZdZdZRS(sWire 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
    cCs^tii||_||_d|_t|_ti	i
|_||_||_
||_dS(Ni(Rtwiredatat
maybe_wraptwireRtmessagetcurrentR'tupdatingt
rdataclasstINtzone_rdclasst
question_onlytone_rr_per_rrsettignore_trailing(RR~RRRR((RR0Es					c
Cs |io|djotiinxtd|D]}tii	|i
|i\}}|iidj	o|i|ii}n|i||_tid|i
|i|id!\}}|id|_|ii|ii|||dtdt|io
||_q7q7WdS(sRead 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!HHiRVRSN(RRtqcountRt	exceptiont	FormErrortxrangetiRMt	from_wireR~RtqnametusedRR)R
R?tstructtunpackRORNRZRR-R(RRRRORNRR((Rt
_get_questionPs"!	#

c
Cs|ip
|io
t}nt}t}xOtd|D]>}|i
}ti
i|i|i
\}}|}
|iidj	o|i|ii}n|i
||_
tid|i|i
|i
d!\}}}}|i
d|_
|tiijo||iij	p|o
t n||i_!||i_"|d@d?|i_#g|i_$|i
}|}x|djo}tid|i||d!\}}|d}ti#i(||i||}|ii$i*|||}|d|}qoWt}ne|tii+jo||iijo||djp
t,n|ii-djot.d	n|ii-i/|
}
|
djot.d
|nti1i2|i|
|
t3t4i4|ii5||i
||ii6|ii7|ii8|i_6t|i_9n[|djo
d}n|io9|ti:i;jp|ti:i<jo|}|i>}nd}|ti:i;jp&|ti:i<jo)||ii?jotii<}d}	n:tiBi|||i|i
||ii}	|	i@}|iiCo|tiiDjo
t}n|iiE||||||t|}|	dj	o|iG|	|n|i
||_
q:WdS(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
iis!HHiis"got signed message without keyringskey '%s' unknownN(HRRRR-RSR'tseen_optRtcountRRtrr_startRRMRR~Rt
absolute_nameRR)R
R?RRRORNtttltrdlenRytOPTRJRRRRRRtoptslentotypetolentoption_from_wiretoptRYtTSIGRRR	RTtsecretRtvalidatetintttimeR!R*R,R.R+RtANYRzRQRRRPtrdtrdataR(tSOARZR>tadd(RRJRRRRRPRR>RRRORRRRRSRRMRNRRRRQ((Rt_get_sectionhs
	!	)
	
	


$

			

0
9
	 
	
cCsXt|i}|djo
tntid|id \|i_|i_	}}}}d|_tii|ii	o
t|_n|i||iodSn|i|ii||i|ii||i|ii||io|i|jo
tn|iio5|iio(|iio|iii|indS(sNRead a wire format DNS message and build a dns.message.Message
        object.is!HHHHHHN( tlenRR~tlRRRRRRRtancounttaucounttadcountRRR8R=R-RRRRRRRRRR,R*R+tupdate(RRRRRR((Rtreads$

7	



((RRRR'R0RRR(((RR{/s
		^Rc
Csttdd}||_||_||_||_||_||_||_t	||||	|
}|i|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 objectRiN(R
tmRR!R(R)R*R,R.R{R~RRRtreaderR(
R~RR!R(R)R*R,R.RRRRR((RRs&								
t_TextReadercBs;tZdZdZdZdZdZdZRS(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
    cCsC||_tii||_d|_ti	i
|_t|_
dS(N(RRRt	tokenizert	TokenizerttextttokR
t	last_nameRRRR'R(RRR((RR0(s
		cCs|ii}|i}|djo|ii|i_nU|djoxbt	oZ|ii}|i
p|ii|Pn|iit
ii|iB|i_qNWt
ii|iio
t	|_qn|djo9|ii|i_|ii|iid>B|i_ns|djo|iidjod|i_nx?t	oZ|ii}|i
p|ii|Pn|iit
ii|iB|i_qSWn|djo<|ii|i_|iidjod|i_qn|djoA|ii}|iit
iit
ii|B|i_nC|d	jo/|ii}|iit
ii|nt|iid
S(s5Process one line from the text format header section.RRRiteflagsiRR8R:N(RRRTttokenRutwhattget_intRRR-t
is_identifiertungetRRRmR8R=RRRtedns_from_textRt
get_stringRRtRwR:Rtget_eol(RRJRRR((Rt_header_line/sP	


*
$

.

2
 c	Cs]|iidt}|iptii|i	d|_n|i}|ii}|ipti
inyEtii|i	}|ii}|ipti
inWn7ti
ij
oti
intii}nXtii|i	}|ii|ii|||dtdt|io
||_n|iidS(s7Process one line from the text format question section.twant_leadingRVRSN(RRRTR-Rt
is_whitespaceRRMRmRuR
RRRtSyntaxErrorRRNRRyRORRZRRRR(RRJRORMRRN((Rt_question_line]s0
	




c	Cszd}|iidt}|ipti	i
|id|_n|i}|ii}|i
ptiinyBt|id}|ii}|i
ptiinWn1tiij
otiind}nXy~tii
|i}
|ii}|i
ptiin|
tiijp|
tiijo|
}|i}
nWn7tiij
otiintii}
nXtii
|i}|ii}|ip>|ii|tii
|
||id}|i}nd}tii}|ii |||
|||t|i"}	|dj	o|	i$||ndS(sfProcess one line from the text format answer, authority, or
        additional data sections.
        RiN(%R
RQRRRTR-RRRRMRmRuRRRRRRRRNRRzRRRyROt
is_eol_or_eofRRRRPRRZRJRR>R(RRJRORMRQRPRRRR>RN((Rt_rr_linezsV
	



&
	
cCse|i}d
}xO|iitt}|i	oPn|i
o|ii}|djo
|i}n|djp
|djo|i}|ii}n|djp
|djo|i}|ii}nZ|djp
|djo|i}|ii}n'|d	jo|i}|ii}n|iiqn|ii|||qWd
S(sNRead a text format DNS message and build a dns.message.Message
        object.itHEADERtQUESTIONtZONERbtPREREQRctUPDATEReN(RRtline_methodR
RJRRTR-RRt
is_commentRutuppertuRRRRRRRRR(RRRRRJ((RRs8	



			
	
(RRRR0RRRR(((RRs		.		5cCs&t}t||}|i|S(sConvert 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 objectN(R
RRRRR(RRR((RRms
	
cCstidjot}d}n
t}d}t||ot||}t	}nt}zt|}Wd|o|inX|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 objectitrUR_N(tsyst
hexversiont
basestringtstr_typetoptsRkRBtftfileR-t
want_closeR'RmRtclose(RRRRR((Rt	from_files 

iic	
	Cst|ttfotii|}nt|ttfotii|}nt|ttfoti
i|}nt}	|	i
ti
iO_
|	i|	i|||dtdt|	i||||||	i||	S(sWMake 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 choosen 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 objectRVRSN(RBRRkRlRRMRmRORyRNRR
RRtRDRZRR-RpRRRRRs(
RRORNRpRsRRRRR((Rt
make_querys"	

i cCs
|itii@otiidntii|i}tii|itii
@B|_|o|itiiO_n|i
|it|i|_|idjo|idd||in|idj	o(|i|_|i|_|i|_n|S(sMake 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
    @rtype: dns.message.Message objects&specified query message is not a queryiN(tqueryRRRGRRRR
RtresponseRtrecursion_availabletRARxR8tlistRRRptour_payloadRRR
RR&R!(RRRR((Rt
make_response2s  (,RR5trandomRRRtdns.ednsRt
dns.exceptiont	dns.flagstdns.namet
dns.opcodetdns.entropyt	dns.rcodet	dns.rdatatdns.rdataclasst
dns.rdatatypet	dns.rrsettdns.renderertdns.tsigtdns.wiredataRRRRtDNSExceptionRRRR	tobjectR
R{R
R'R-RRRmRRRRR(R5RRRRRRRRRRmRRRR{RR	RRR
((Rt?sD																			'8		$2