%PDF- %PDF-
Mini Shell

Mini Shell

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

�
�ac@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z
ddlZ
ddlZ
ddl
Z
ddlZ
ddlZ
ddlZ
ddlmZmZmZer�eZn	ejZejZde
jjfd��YZde
jjfd	��YZd
e
jjfd��YZd�Zd
�Z d�Z!d�Z"d�Z#e$ed�r�e a%ne!a%d�Z&d�Z'd�Z(d�Z)dd�Z+de,e,dde,d�Z-ddddde,e,e,d�Z.d�Z/d�Z0dd�Z1de,dde,d�Z2d �Z3ddddde,e,d!�Z4e
j5j6e
j7j8dddde9ddddde,e
j:j;d"�Z<dS(#sTalk to a DNS server.i����(t
generatorsNi(tlongtstring_typestPY3tUnexpectedSourcecBseZdZRS(s=A DNS query response came from an unexpected address or port.(t__name__t
__module__t__doc__(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyR/stBadResponsecBseZdZRS(s<A DNS query response does not respond to the question asked.(RRR(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyR3st
TransferErrorcBseZdZd�ZRS(s.A zone transfer response got a non-zero rcode.cCs9dtjj|�}tt|�j|�||_dS(NsZone transfer error: %s(tdnstrcodetto_texttsuperR	t__init__(tselfRtmessage((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyR:s(RRRR(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyR	7scCs"|dkrdStj�|SdS(N(tNonettime(ttimeout((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_compute_expiration@scCs�d}|r|tjO}n|r2|tjO}n|rH|tjO}ntj�}|j||�|r�|jt|d��}n|j�}t|�S(sPoll polling backend.ii�(tselecttPOLLINtPOLLOUTtPOLLERRtpolltregisterRtbool(tfdtreadabletwritableterrorRt
event_masktpollablet
event_list((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt	_poll_forKscCs�ggg}}}|r&|g}n|r8|g}n|rJ|g}n|dkrwtj|||�\}}	}
n!tj||||�\}}	}
t|p�|	p�|
�S(sSelect polling backend.N(RRR(RRRRRtrsettwsettxsettrcounttwcounttxcount((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_select_foras!!cCs�t}x�|s�|dkr$d}n+|tj�}|dkrOtjj�ny+t|||||�sytjj�nWn2tk
r�}|jdt	j
kr�|�q�nXt}q	WdS(Ngi(tFalseRRR
t	exceptiontTimeoutt_polling_backendtselect_errortargsterrnotEINTRtTrue(RRRRt
expirationtdoneRte((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt	_wait_forus		
cCs
|adS(N(R.(tfn((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_set_polling_backend�sRcCst|ttt|�dS(N(R7R3R+(tsR4((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_wait_for_readable�scCst|ttt|�dS(N(R7R+R3(R:R4((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_wait_for_writable�scCsoy6tjj||d�}tjj||d�}Wntjjk
rPtSX||kon|d|dkS(Nii(R
tinett	inet_ptonR,tSyntaxErrorR+(tafta1ta2tn1tn2((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_addresses_equal�scCs|dkrEytjj|�}WqEtk
rAtjj}qEXn|tjjkr�||f}|dk	s{|dkr|dkr�d}n||f}qni|tjjkr||ddf}|dk	s�|dkr|dkr�d}n||ddf}qn|||fS(Nis0.0.0.0s::(RR
R=taf_for_addresst	ExceptiontAF_INETtAF_INET6(R@twheretporttsourcetsource_porttdestination((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_destination_and_source�s$
		cCsYt|tjj�r$|j�}nt||�tj�}|j||�}||fS(s�Send a DNS message to the specified UDP socket.

    *sock*, a ``socket``.

    *what*, a ``binary`` or ``dns.message.Message``, the message to send.

    *destination*, a destination tuple appropriate for the address family
    of the socket, specifying where to send the query.

    *expiration*, a ``float`` or ``None``, the absolute time at which
    a timeout exception should be raised.  If ``None``, no timeout will
    occur.

    Returns an ``(int, float)`` tuple of bytes sent and the sent time.
    (t
isinstanceR
RtMessagetto_wireR<Rtsendto(tsocktwhatRNR4t	sent_timetn((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pytsend_udp�s
tc
Cs�d}x�t||�|jd�\}}	t|j|	|�sjtjj|d�rn|	d|dkrnPn|s	td|	|f��q	q	Wtj�}
tj	j
|d|d|d|d	|�}||
fS(
s�Read a DNS message from a UDP socket.

    *sock*, a ``socket``.

    *destination*, a destination tuple appropriate for the address family
    of the socket, specifying where the associated query was sent.

    *expiration*, a ``float`` or ``None``, the absolute time at which
    a timeout exception should be raised.  If ``None``, no timeout will
    occur.

    *ignore_unexpected*, a ``bool``.  If ``True``, ignore responses from
    unexpected sources.

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

    *keyring*, a ``dict``, the keyring to use for TSIG.

    *request_mac*, a ``binary``, the MAC of the request (for TSIG).

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

    Raises if the message is malformed, if network errors occur, of if
    there is a timeout.

    Returns a ``dns.message.Message`` object.
    RYi��iis$got a response from %s instead of %stkeyringtrequest_mactone_rr_per_rrsettignore_trailing(R;trecvfromREtfamilyR
R=tis_multicastRRRt	from_wire(RTRNR4tignore_unexpectedR\RZR[R]twiretfrom_addresst
received_timetr((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pytreceive_udp�s"!
	i5ic
	Cs-|j�}
t|||||�\}}}t|tjd�}d}
d}z�t|�}|jd�|dk	r�|j|�nt	||
||�\}}t
||||||j|j|	�\}}
Wd|dks�|
dkr�d}n
|
|}|j
�X||_|j|�s)t�n|S(s�Return the response obtained after sending a query via UDP.

    *q*, a ``dns.message.Message``, the query to send

    *where*, a ``text`` containing an IPv4 or IPv6 address,  where
    to send the message.

    *timeout*, a ``float`` or ``None``, the number of seconds to wait before the
    query times out.  If ``None``, the default, wait forever.

    *port*, an ``int``, the port send the message to.  The default is 53.

    *af*, an ``int``, the address family to use.  The default is ``None``,
    which causes the address family to use to be inferred from the form of
    *where*.  If the inference attempt fails, AF_INET is used.  This
    parameter is historical; you need never set it.

    *source*, a ``text`` containing an IPv4 or IPv6 address, specifying
    the source address.  The default is the wildcard address.

    *source_port*, an ``int``, the port from which to send the message.
    The default is 0.

    *ignore_unexpected*, a ``bool``.  If ``True``, ignore responses from
    unexpected sources.

    *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 received message.

    Returns a ``dns.message.Message``.
    iN(RRROtsocket_factorytsockett
SOCK_DGRAMRRtsetblockingtbindRXRgRZtmactcloseRtis_responseR(tqRJRRKR@RLRMRbR\R]RcRNR:ReRVR4t_Rft
response_time((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pytudps.%
	
		cCshd}x[|dkrct||�|j|�}|dkrFt�n|t|�}||}q	W|S(s�Read the specified number of bytes from sock.  Keep trying until we
    either get the desired amount, or we hit EOF.
    A Timeout exception will be raised if the operation is not completed
    by the expiration time.
    RYi(R;trecvtEOFErrortlen(RTtcountR4R:RW((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt	_net_readRs
	cCsMd}t|�}x4||krHt||�||j||�7}qWdS(s�Write the specified data to the socket.
    A Timeout exception will be raised if the operation is not completed
    by the expiration time.
    iN(RvR<tsend(RTtdataR4tcurrenttl((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt
_net_writecs

cCst|tjj�r$|j�}nt|�}tjd|�|}t||�t	j	�}t
|||�t|�|fS(s|Send a DNS message to the specified TCP socket.

    *sock*, a ``socket``.

    *what*, a ``binary`` or ``dns.message.Message``, the message to send.

    *expiration*, a ``float`` or ``None``, the absolute time at which
    a timeout exception should be raised.  If ``None``, no timeout will
    occur.

    Returns an ``(int, float)`` tuple of bytes sent and the sent time.
    s!H(RPR
RRQRRRvtstructtpackR<RR}(RTRUR4R|ttcpmsgRV((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pytsend_tcpos
c
Csyt|d|�}tjd|�\}t|||�}tj�}	tjj|d|d|d|d|�}
|
|	fS(s�Read a DNS message from a TCP socket.

    *sock*, a ``socket``.

    *expiration*, a ``float`` or ``None``, the absolute time at which
    a timeout exception should be raised.  If ``None``, no timeout will
    occur.

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

    *keyring*, a ``dict``, the keyring to use for TSIG.

    *request_mac*, a ``binary``, the MAC of the request (for TSIG).

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

    Raises if the message is malformed, if network errors occur, of if
    there is a timeout.

    Returns a ``dns.message.Message`` object.
    is!HRZR[R\R](RxR~tunpackRR
RRa(RTR4R\RZR[R]tldataR|RcReRf((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pytreceive_tcp�s	cCs�y|j|�Wnvtjk
r�tj�d \}}t|d�rU|j}n
|d}|tjtjtj	gkr�|�q�nXdS(NiR1i(
tconnectRiRtsystexc_infothasattrR1tEINPROGRESStEWOULDBLOCKtEALREADY(R:taddressttytvtv_err((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt_connect�s
c	Cs5|j�}	t|||||�\}}
}t|tjd�}d}d}
z�t|�}|jd�tj�}|dk	r�|j	|�nt
||
�t||	|�t||||j
|j|�\}}
Wd|dks�|
dkr�d}n
|
|}|j�X||_|j|�s1t�n|S(s�Return the response obtained after sending a query via TCP.

    *q*, a ``dns.message.Message``, the query to send

    *where*, a ``text`` containing an IPv4 or IPv6 address,  where
    to send the message.

    *timeout*, a ``float`` or ``None``, the number of seconds to wait before the
    query times out.  If ``None``, the default, wait forever.

    *port*, an ``int``, the port send the message to.  The default is 53.

    *af*, an ``int``, the address family to use.  The default is ``None``,
    which causes the address family to use to be inferred from the form of
    *where*.  If the inference attempt fails, AF_INET is used.  This
    parameter is historical; you need never set it.

    *source*, a ``text`` containing an IPv4 or IPv6 address, specifying
    the source address.  The default is the wildcard address.

    *source_port*, an ``int``, the port from which to send the message.
    The default is 0.

    *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 received message.

    Returns a ``dns.message.Message``.
    iN(RRRORhRitSOCK_STREAMRRRkRRlR�R�R�RZRmRnRoR(RpRJRRKR@RLRMR\R]RcRNR:t
begin_timeReR4RfRr((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyttcp�s0"

	
		c'csut|t�r$tjj|�}nt|t�rHtjj|�}ntjj|||�}|tjjkr�tj	j|dddd|
�}|j
j|�n|dk	r�|j
||d|�n|j�}t|	||||�\}	}}|r8|tjjkr td��nt|	tjd�}nt|	tjd�}|jd�|dk	rv|j|�nt|
�}t||�t|�}|r�t||�|j|�n&tjd|�|}t|||�t}t }t}d}|r|}tjj!}nd}|}d}t }x5|sft|�} | dks\| |kre|} n|r�t"||�|j#d�\}}!n9t$|d	| �}"tj%d|"�\}t$||| �}|tjjk}#tjj&|d
|j'd|j(dt d
|d|dt d|d|#�}$|$j)�}%|%tj)j*krPt+|%��n|$j,}t}d}&|dkr)|$j-s�|$j-dj|kr�tj.j/d��n|$j-d}|j0tjj1kr�tj.j/d��nd}&|j2�}|tjjkr)|dj3|
krt }q&t }q)nx|$j-|&D]�}|rXtj.j/d��n|j0tjj1kr|j|kr|r�|dj3|
kr�tj.j/d��nt}n|tjjkr�|}n||kr,|tjj4ks|tjjkr,|r,t }q,q7|r7tjj4}t}q7q7W|r^|j'r^|$j5r^tj.j/d��n|$Vq2W|j6�dS(s�Return a generator for the responses to a zone transfer.

    *where*.  If the inference attempt fails, AF_INET is used.  This
    parameter is historical; you need never set it.

    *zone*, a ``dns.name.Name`` or ``text``, the name of the zone to transfer.

    *rdtype*, an ``int`` or ``text``, the type of zone transfer.  The
    default is ``dns.rdatatype.AXFR``.  ``dns.rdatatype.IXFR`` can be
    used to do an incremental transfer instead.

    *rdclass*, an ``int`` or ``text``, the class of the zone transfer.
    The default is ``dns.rdataclass.IN``.

    *timeout*, a ``float``, the number of seconds to wait for each
    response message.  If None, the default, wait forever.

    *port*, an ``int``, the port send the message to.  The default is 53.

    *keyring*, a ``dict``, the keyring to use for TSIG.

    *keyname*, a ``dns.name.Name`` or ``text``, the name of the TSIG
    key to use.

    *relativize*, a ``bool``.  If ``True``, all names in the zone will be
    relativized to the zone origin.  It is essential that the
    relativize setting matches the one specified to
    ``dns.zone.from_xfr()`` if using this generator to make a zone.

    *af*, an ``int``, the address family to use.  The default is ``None``,
    which causes the address family to use to be inferred from the form of
    *where*.  If the inference attempt fails, AF_INET is used.  This
    parameter is historical; you need never set it.

    *lifetime*, a ``float``, the total number of seconds to spend
    doing the transfer.  If ``None``, the default, then there is no
    limit on the time the transfer may take.

    *source*, a ``text`` containing an IPv4 or IPv6 address, specifying
    the source address.  The default is the wildcard address.

    *source_port*, an ``int``, the port from which to send the message.
    The default is 0.

    *serial*, an ``int``, the SOA serial number to use as the base for
    an IXFR diff sequence (only meaningful if *rdtype* is
    ``dns.rdatatype.IXFR``).

    *use_udp*, a ``bool``.  If ``True``, use UDP (only meaningful for IXFR).

    *keyalgorithm*, a ``dns.name.Name`` or ``text``, the TSIG algorithm to use.

    Raises on errors, and so does the generator.

    Returns a generator of ``dns.message.Message`` objects.
    itINtSOAs. . %u 0 0 0 0t	algorithmscannot do a UDP AXFRs!Hi��iRZR[txfrtoriginttsig_ctxtmultitfirstR\s No answer or RRset not for qnamesfirst RRset is not an SOAisanswers after final SOAsIXFR base serial mismatchsmissing TSIGN(7RPRR
tnamet	from_textt	rdatatypeRt
make_querytIXFRtrrsett	authoritytappendRtuse_tsigRRROt
ValueErrorRhRiRjR�RkRlRR�RvR<RyR~RR}R+R3temptyR;R^RxR�RaRZRmRtNOERRORR	R�tanswerR,t	FormErrortrdtypeR�tcopytserialtAXFRthad_tsigRn('RJtzoneR�trdclassRRKRZtkeynamet
relativizeR@tlifetimeRLRMR�tuse_udptkeyalgorithmRpR�RcRNR:R4R|R�R5tdelete_modet
expecting_SOAt	soa_rrsetR�tonameR�R�tmexpirationRdR�tis_ixfrRfRtanswer_index((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyR��s�=



		
!		 	
	$		

	(=Rt
__future__RR1RRiR~R�Rt
dns.exceptionR
tdns.inettdns.nametdns.messaget	dns.rcodetdns.rdataclasst
dns.rdatatypet_compatRRRtOSErrorR/RRhR,tDNSExceptionRR�RR	RR#R*R7R9R�R.R;R<RERORRXR+RgRsRxR}R�R�R�R�R�R�t
rdataclassR�R3ttsigtdefault_algorithmR�(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/query.pyt<module>sh														1?		"	=

Zerion Mini Shell 1.0