%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/
Upload File :
Create Path :
Current File : //opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyc

�
�ac@@swdZddlmZddlmZddlZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlZddlZddlZddlZddlZddlZddlZddlmZmZmZdejjfd��YZd	ejjfd
��YZdejjfd��YZd
ejjfd��YZ dejjfd��YZ!dejjfd��YZ"dZ#dZ$dZ%dZ&de'fd��YZ(de'fd��YZ)e*de+e*e*e+e,e+e+e+d�
Z-de'fd��YZ.d�Z/d�Z0ej1j2e*e+e*e*e*e*d�Z3e+d d!d"�Z4dS(#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__(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR,stTrailingJunkcB@seZdZRS(sEThe DNS packet passed to from_wire() has extra junk at the end of it.(RRR(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR	0stUnknownHeaderFieldcB@seZdZRS(sVThe header field name was not recognized when converting from text
    into a message.(RRR(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR
4stBadEDNScB@seZdZRS(sYAn OPT record occurred somewhere other than the start of
    the additional data section.(RRR(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR9stBadTSIGcB@seZdZRS(sWA TSIG record occurred somewhere other than the end of
    the additional data section.(RRR(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR>stUnknownTSIGKeycB@seZdZRS(s(A TSIG with an unknown key was received.(RRR(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR
CsiitMessagecB@seZdZdd�Zd�Zd�Zded�Zd�Z	d�Z
d�Zd�Zd	�Z
ejjdeed
�Zejjdeed�Zddd
�Zdddddejjd�Zdddddd�Zed�Zd�Zd�Zd�Zd�ZRS(sA DNS message.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((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt__init__Vs:																								cC@sdt|j�dS(Ns<DNS message, ID t>(treprR(R3((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt__repr__vscC@s
|j�S(N(tto_text(R3((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt__str__ysc	K@s�t�}|jd|j�|jdtjjtjj|j���tjj|j|j	�}|jdtjj|��|jdtjj|j��|j
dkr
|jd|j
�|j	dkr�|jdtjj|j	��n|jd|j�nx(|j
D]}|jd	|j��qWtjj|j�}|rc|jd
�n
|jd�x:|jD]/}|j|j|||��|jd�qzW|r�|jd
�n
|jd�x:|jD]/}|j|j|||��|jd�q�W|r#|jd�n
|jd�x:|jD]/}|j|j|||��|jd�q:W|jd�x:|jD]/}|j|j|||��|jd�q�W|j�d S(s�Convert the message to text.

        The *origin*, *relativize*, and any other keyword
        arguments are passed to the RRset ``to_wire()`` method.

        Returns a ``text``.
        uid %d
u
opcode %s
u	rcode %s
u	flags %s
iuedns %s
u
eflags %s
upayload %d
u
option %s
u;ZONE
u
;QUESTION
u
u;PREREQ
u;ANSWER
u;UPDATE
u;AUTHORITY
u;ADDITIONAL
i����(RtwriteRRtopcodeR8t
from_flagsRtrcodeRRtedns_to_textRRt	is_updateRRRRtgetvalue(	R3R,t
relativizetkwtstrctoptR?trrset((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR8|sN			# 	



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.

        Returns a ``bool``.
        (	t
isinstanceRR*RRRRRR0(R3tothertn((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt__eq__�s2cC@s|j|�S(N(RJ(R3RH((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/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(sLIs this message a response to *other*?

        Returns a ``bool``.
        i(
RRtQRRR;R<R*R=RtNOERRORR0R?R(R3RHRI((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pytis_response�s"cC@s\||jkrtS||jkr&tS||jkr9tS||jkrLtStd��dS(sqReturn the "section number" of the specified section for use
        in indexing.  The question section is 0, the answer section is 1,
        the authority section is 2, and the additional section is 3.

        *section* is one of the section attributes of this message.

        Raises ``ValueError`` if the section isn't known.

        Returns an ``int``.
        sunknown sectionN(	RtQUESTIONRtANSWERRt	AUTHORITYRt
ADDITIONALt
ValueError(R3tsection((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pytsection_number�scC@s\|tkr|jS|tkr&|jS|tkr9|jS|tkrL|jStd��dS(sqReturn the "section number" of the specified section for use
        in indexing.  The question section is 0, the answer section is 1,
        the authority section is 2, and the additional section is 3.

        *section* is one of the section attributes of this message.

        Raises ``ValueError`` if the section isn't known.

        Returns an ``int``.
        sunknown sectionN(	RORRPRRQRRRRRS(R3tnumber((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pytsection_from_numbersc	C@st|t�r'|}	|j|	�}n|j|�}	|	|||||f}
|s�|jdk	r�|jj|
�}|dk	r�|Sq�x0|D]%}|j|||||�r�|Sq�Wn|s�t�nt	j
j|||||�}|j|�|jdk	r||j|
<n|S(sPFind the RRset with the given attributes in the specified section.

        *section*, an ``int`` section number, or one of the section
        attributes of this message.  This specifies the
        the section of the message to search.  For example::

            my_message.find_rrset(my_message.answer, name, rdclass, rdtype)
            my_message.find_rrset(dns.message.ANSWER, name, rdclass, rdtype)

        *name*, a ``dns.name.Name``, the name of the RRset.

        *rdclass*, an ``int``, the class of the RRset.

        *rdtype*, an ``int``, the type of the RRset.

        *covers*, an ``int`` or ``None``, the covers value of the RRset.
        The default is ``None``.

        *deleting*, an ``int`` or ``None``, the deleting value of the RRset.
        The default is ``None``.

        *create*, a ``bool``.  If ``True``, create the RRset if it is not found.
        The created RRset is appended to *section*.

        *force_unique*, a ``bool``.  If ``True`` and *create* is also ``True``,
        create a new RRset regardless of whether a matching RRset exists
        already.  The default is ``False``.  This is useful when creating
        DDNS Update messages, as order matters for them.

        Raises ``KeyError`` if the RRset was not found and create was
        ``False``.

        Returns a ``dns.rrset.RRset object``.
        N(
RGtintRWRUR2RtgettmatchtKeyErrorRRFtRRsettappend(R3RTtnametrdclasstrdtypetcoverstdeletingtcreatetforce_uniqueRUtkeyRF((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt
find_rrsets(&
	
c	
	C@sFy(|j||||||||�}	Wntk
rAd}	nX|	S(s5Get the RRset with the given attributes in the specified section.

        If the RRset is not found, None is returned.

        *section*, an ``int`` section number, or one of the section
        attributes of this message.  This specifies the
        the section of the message to search.  For example::

            my_message.get_rrset(my_message.answer, name, rdclass, rdtype)
            my_message.get_rrset(dns.message.ANSWER, name, rdclass, rdtype)

        *name*, a ``dns.name.Name``, the name of the RRset.

        *rdclass*, an ``int``, the class of the RRset.

        *rdtype*, an ``int``, the type of the RRset.

        *covers*, an ``int`` or ``None``, the covers value of the RRset.
        The default is ``None``.

        *deleting*, an ``int`` or ``None``, the deleting value of the RRset.
        The default is ``None``.

        *create*, a ``bool``.  If ``True``, create the RRset if it is not found.
        The created RRset is appended to *section*.

        *force_unique*, a ``bool``.  If ``True`` and *create* is also ``True``,
        create a new RRset regardless of whether a matching RRset exists
        already.  The default is ``False``.  This is useful when creating
        DDNS Update messages, as order matters for them.

        Returns a ``dns.rrset.RRset object`` or ``None``.
        N(RfR[R(
R3RTR^R_R`RaRbRcRdRF((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt	get_rrset\s%

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(s1Return a string containing the message in DNS compressed wire
        format.

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

        *origin*, a ``dns.name.Name`` or ``None``, the origin to be appended
        to any relative names.

        *max_size*, an ``int``, the maximum size of the wire format
        output; default is 0, which means "the message's request
        payload, if nonzero, or 65535".

        Raises ``dns.exception.TooBig`` if *max_size* was exceeded.

        Returns a ``binary``.
        ii��iN($RRtrenderertRendererRRRtadd_questionR^R`R_Rt	add_rrsetRPRRQRtadd_ednsRRRRRRtwrite_headerR Rtadd_tsigRR'R(R&R%R$R#R)tget_wire(R3R,tmax_sizeRBtrRF((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pytto_wire�s6			! %

i,RcC@s�||_|dkr4t|jj��d|_n-t|t�rXtjj	|�}n||_||_
||_|dkr�|j|_
n	||_
||_||_dS(sLWhen sending, a TSIG signature using the specified keyring
        and keyname should be added.

        See the documentation of the Message class for a complete
        description of the keyring dictionary.

        *keyring*, a ``dict``, the TSIG keyring to use.  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.

        *keyname*, a ``dns.name.Name`` or ``None``, the name of the TSIG key
        to use; defaults to ``None``. The key must be defined in the keyring.

        *fudge*, an ``int``, the TSIG time fudge.

        *original_id*, an ``int``, the TSIG original id.  If ``None``,
        the message's id is used.

        *tsig_error*, an ``int``, the TSIG error code.

        *other_data*, a ``binary``, the TSIG other data.

        *algorithm*, a ``dns.name.Name``, the TSIG algorithm to use.
        iN(RRtlisttkeysR RGRRR^t	from_textR#R'RR(R&R%(R3RR R'R(R&R%t	algorithm((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/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(s6Configure EDNS behavior.

        *edns*, an ``int``, is 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".

        *ednsflags*, an ``int``, the EDNS flag values.

        *payload*, an ``int``, is the EDNS sender's payload field, which is the
        maximum size of UDP datagram the sender can handle.  I.e. how big
        a response to this message can be.

        *request_payload*, an ``int``, is the EDNS payload size to use when
        sending this message.  If not specified, defaults to the value of
        *payload*.

        *options*, a list of ``dns.edns.Option`` objects or ``None``, the EDNS
        options.
        i����iI���iN(	RR*R0RRRRRR(R3RRRRR((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/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.

        *wanted*, a ``bool``.  If ``True``, then DNSSEC data is
        desired in the response, EDNS is enabled if required, and then
        the DO bit is set.  If ``False``, the DO bit is cleared if
        EDNS is enabled.
        iN(RRxRRRtDO(R3twanted((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pytwant_dnssecs	
cC@stjj|j|j�S(s7Return the rcode.

        Returns an ``int``.
        (RR=R<RR(R3((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR=%scC@s�tjj|�\}}|jdM_|j|O_|jtd�M_|j|O_|jdkr�|jdkr�d|_ndS(sJSet the rcode.

        *rcode*, an ``int``, is the rcode to set.
        i�i���iN(RR=tto_flagsRRRR(R3R=tvaluetevalue((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt	set_rcode,scC@stjj|j�S(s8Return the opcode.

        Returns an ``int``.
        (RR;R<R(R3((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR;9scC@s.|jdM_|jtjj|�O_dS(sMSet the opcode.

        *opcode*, an ``int``, is the opcode to set.
        i��N(RRR;R|(R3R;((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt
set_opcode@sN(RRRRR4R7R9R0R8RJRKRNRURWRt	rdatatypetNONER*RfRgRrR!R"RwRxR{R=RR;R�(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyRSs2 		9	!				<*0	--		
	t_WireReadercB@s;eZdZeeed�Zd�Zd�Zd�ZRS(sWire format reader.

    wire: a binary, is the wire-format message.
    message: The message object being built
    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.
    updating: Is the message a dynamic update?
    one_rr_per_rrset: Put each RR into its own RRset?
    ignore_trailing: Ignore trailing junk at end of request?
    zone_rdclass: The class of the zone in messages which are
    DNS dynamic updates.
    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�((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR4Ys					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(shRead the next *qcount* records from the wire data and add them to
        the question section.
        iis!HHiRcRdN(R�Rt	exceptiont	FormErrorRR^t	from_wireR�R�R�R,RRAtstructtunpackRfRR0R�(R3tqcounttitqnametusedR`R_((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt
_get_questionds!	#	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.

        section: the section of the message to which to add records
        count: the number of records to read
        is!HHIHi
i�is!HHiis"got signed message without keyringskey '%s' unknownN(7R�R�R0R*RR�RR^R�R�R�R,RRAR�R�R�tOPTRRRRRRtoption_from_wireR]tTSIGRRR
RYR R!tget_algorithm_and_macR#R)tvalidateRXttimeR$R-R/R1R.R�tANYR�R�RtrdataRaR+tSOARftadd(R3RTtcountRdtseen_optR�trr_startR^R�t
absolute_nameR`R_tttltrdlenR�toptslentotypetolenREtsecretRbRatrdRF((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt_get_section{s�		!	)			
	
											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((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pytread�s$	7	
		
(RRRR*R4R�R�R�(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR�Is
		cRc
C@sttdd�}||_||_||_||_||_||_||_t||||	|
�}|j	�|S(s�Convert a DNS wire format message into a message
    object.

    *keyring*, a ``dict``, the keyring to use if the message is signed.

    *request_mac*, a ``binary``.  If the message is a response to a
    TSIG-signed request, *request_mac* should be set to the MAC of
    that request.

    *xfr*, a ``bool``, should be set to ``True`` if this message is part of
    a zone transfer.

    *origin*, a ``dns.name.Name`` or ``None``.  If the message is part
    of a zone transfer, *origin* should be the origin name of the
    zone.

    *tsig_ctx*, a ``hmac.HMAC`` objext, the ongoing TSIG context, used
    when validating zone transfers.

    *multi*, a ``bool``, should be set to ``True`` if this message
    part of a multiple message sequence.

    *first*, a ``bool``, should be set to ``True`` if this message is
    stand-alone, or the first message in a multi-message sequence.

    *question_only*, a ``bool``.  If ``True``, read only up to
    the end of the question section.

    *one_rr_per_rrset*, a ``bool``.  If ``True``, put each RR into its
    own RRset.

    *ignore_trailing*, a ``bool``.  If ``True``, ignore trailing
    junk at end of the message.

    Raises ``dns.message.ShortHeader`` if the message is less than 12 octets
    long.

    Raises ``dns.messaage.TrailingJunk`` if there were octets in the message
    past the end of the proper DNS message, and *ignore_trailing* is ``False``.

    Raises ``dns.message.BadEDNS`` if an OPT record was in the
    wrong section, or occurred more than once.

    Raises ``dns.message.BadTSIG`` if a TSIG record was not the last
    record of the additional data section.

    Returns a ``dns.message.Message``.
    Ri(
RRR$R+R,R-R/R1R�R�(
R�RR$R+R,R-R/R1R�R�R�tmtreader((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR��s5								
t_TextReadercB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(s/Text format reader.

    tok: the tokenizer.
    message: The message object being built.
    updating: Is the message a dynamic update?
    zone_rdclass: The class of the zone in messages which are
    DNS dynamic updates.
    last_name: The most recently read name when building a message object.
    cC@sC||_tjj|�|_d|_tjj|_	t
|_dS(N(R�Rt	tokenizert	TokenizerttokRt	last_nameR�R�R�R*R�(R3ttextR�((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR4Hs
		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�RYR}tget_intR�RR0t
is_identifiertungetRRRuR;R?R�RRtedns_from_textRt
get_stringR|RR=R
tget_eol(R3RTttokentwhatR�((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt_header_lineOsR			 			#	(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_leadingRcRdN(R�RYR0t
is_whitespaceRR^RuR}RR�R�R�tSyntaxErrorR�t	ExceptionR�R�R�RfRR�R�R�(R3RTR�R^R_R`((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt_question_line}s.	
	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�RYR0R�RR^RuR}R�R�R�R�RXR�R�R�R�R�R�R�t
is_eol_or_eofR�R�RaR�RfR�R�(R3RTRbR�R^R�R_R`R�RaRF((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/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.tHEADERROtZONERPtPREREQRQtUPDATERRN(R�RR�RYR0R�t
is_commentR}tupperR�R�RR�RRRR�R�(R3tline_methodRTR�tu((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR��s4					
(RRRR4R�R�R�R�(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyR�<s
		.		5cC@s&t�}t||�}|j�|S(s)Convert the text format message into a message object.

    *text*, a ``text``, the text format message.

    Raises ``dns.message.UnknownHeaderField`` if a header is unknown.

    Raises ``dns.exception.SyntaxError`` if the text is badly formed.

    Returns a ``dns.message.Message object``
    (RR�R�(R�R�R�((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyRu�s	
cC@sdt}d}t||�r3t||�}t}nt}zt|�}Wd|r_|j�nX|S(scRead the next text format message from the specified file.

    *f*, a ``file`` or ``text``.  If *f* is text, it is treated as the
    pathname of a file to open.

    Raises ``dns.message.UnknownHeaderField`` if a header is unknown.

    Raises ``dns.exception.SyntaxError`` if the text is badly formed.

    Returns a ``dns.message.Message object``
    trUN(RRGtopenR0R*Rutclose(tftstr_typetoptst
want_closeR�((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt	from_files
	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(
sMake 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.

    qname, a ``dns.name.Name`` or ``text``, the query name.

    *rdtype*, an ``int`` or ``text``, the desired rdata type.

    *rdclass*, an ``int`` or ``text``,  the desired rdata class; the default
    is class IN.

    *use_edns*, an ``int``, ``bool`` or ``None``.  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.

    *want_dnssec*, a ``bool``.  If ``True``, DNSSEC data is desired.

    *ednsflags*, an ``int``, the EDNS flag values.

    *payload*, an ``int``, is the EDNS sender's payload field, which is the
    maximum size of UDP datagram the sender can handle.  I.e. how big
    a response to this message can be.

    *request_payload*, an ``int``, is the EDNS payload size to use when
    sending this message.  If not specified, defaults to the value of
    *payload*.

    *options*, a list of ``dns.edns.Option`` objects or ``None``, the EDNS
    options.

    Returns a ``dns.message.Message``
    RcRdRiRRRRN(RGRRR^RuR�R�RRtRDRfRR0RRxR{(R�R`R_RxR{RRRRR�tkwargs((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt
make_query%s>)	






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.

    *query*, a ``dns.message.Message``, the query to respond to.

    *recursion_available*, a ``bool``, should RA be set in the response?

    *our_payload*, an ``int``, the payload size to advertise in EDNS
    responses.

    *fudge*, an ``int``, the TSIG time fudge.

    Returns a ``dns.message.Message`` object.
    s&specified query message is not a queryiRN(RRRLR�R�R�RRR�tRAR�R;RsRRRxRR.RwRR RR#R)R$(tquerytrecursion_availabletour_payloadR'tresponse((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt
make_responsers 	
(5Rt
__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
RORPRQRRtobjectRR�RR*R0R�R�RuR�R�R�R�R�(((s@/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/message.pyt<module>sX���	B�			K

Zerion Mini Shell 1.0