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/2/task/2/root/usr/lib/python2.4/site-packages/dns/resolver.pyc
m
EQc@s)dZdkZdkZdkZy
dkZWnej
odkZnXdkZ	dk
Z	dkZ	dkZ	dk
Z	dkZ	dkZ	dkZ	dkZ	dkZ	dkZ	eidjo
dkZnde	iifdYZde	iifdYZe	iiZde	iifdYZd	e	iifd
YZde	iifdYZd
e	iifdYZde	iifdYZde fdYZ!de fdYZ"de fdYZ#de fdYZ$de fdYZ%e&a'dZ(e	i)i*e	i+i,e-e&e.ddZ/e	i+i,e-e&dZ0hei1ei2g<ei3ei4g<Z5e&a6ei7Z8ei9Z:ei;Z<ei=Z>ei?Z@eiAZBe&e&eiCddddZDdd ZEe&d!ZFd"ZGd#ZHd$ZIe&d%ZJd&ZKdS('s{DNS stub resolver.

@var default_resolver: The default resolver object
@type default_resolver: dns.resolver.Resolver objectNtwin32tNXDOMAINcBstZdZRS(sThe query name does not exist.(t__name__t
__module__t__doc__(((t0/usr/lib/python2.4/site-packages/dns/resolver.pyR-stYXDOMAINcBstZdZRS(s4The query name is too long after DNAME substitution.(RRR(((RR1stNoAnswercBstZdZRS(s7The response did not contain an answer to the question.(RRR(((RR;st
NoNameserverscBstZdZRS(s<No non-broken nameservers are available to answer the query.(RRR(((RR?stNotAbsolutecBstZdZRS(sSRaised if an absolute domain name is required but a relative name
    was provided.(RRR(((RR	Cst	NoRootSOAcBstZdZRS(sYRaised if for some reason there is no SOA at the root name.
    This should never happen!(RRR(((RR
Hst
NoMetaqueriescBstZdZRS(sMetaqueries are not allowed.(RRR(((RRMstAnswercBsYtZdZedZdZdZdZdZdZ	dZ
dZRS(	s9DNS stub resolver answer

    Instances of this class bundle up the result of a successful DNS
    resolution.

    For convenience, the answer object implements much of the sequence
    protocol, forwarding to its rrset.  E.g. "for a in answer" is
    equivalent to "for a in answer.rrset", "answer[i]" is equivalent
    to "answer.rrset[i]", and "answer[i:j]" is equivalent to
    "answer.rrset[i:j]".

    Note that CNAMEs or DNAMEs in the response may mean that answer
    node's name might not be the query name.

    @ivar qname: The query name
    @type qname: dns.name.Name object
    @ivar rdtype: The query type
    @type rdtype: int
    @ivar rdclass: The query class
    @type rdclass: int
    @ivar response: The response message
    @type response: dns.message.Message object
    @ivar rrset: The answer
    @type rrset: dns.rrset.RRset object
    @ivar expiration: The time when the answer expires
    @type expiration: float (seconds since the epoch)
    @ivar canonical_name: The canonical name of the query name
    @type canonical_name: dns.name.Name object
    cCs~||_||_||_||_d}	d}x3tddD]"}yJ|i
|i|||}|	djp|i|	jo
|i}	nPWq@t
j
o|tiijoym|i
|i||tii}
|	djp|
i|	jo
|
i}	nx|
D]}|i}Pq	Ww@WqLt
j
o|o
tqHqLXn|o
tqbq@Xq@W|djo|o
tn||_||_|djoxyu|i
|i||tii}|	djp|i|	jo
|i}	n|di|	jo|di}	nPWqt
j
o4y|i}Wq^tiij
oPq^XqXqWnti|	|_dS(Niiii( tqnametselftrdtypetrdclasstresponsetmin_ttltNonetrrsettxrangetcountt
find_rrsettanswertttltKeyErrortdnst	rdatatypetCNAMEtcrrsettrdttargettraise_on_no_answerRtcanonical_namet	authoritytSOAtsrrsettminimumtparenttnametNoParentttimet
expiration(RR
RRRR!RR%RRRR((Rt__init__psl				

	
		

cCs|djo|iiSny|djo|iiSn^|djo|iiSnC|djo|iiSn(|djo|iiSn
t|dS(NR(RtcoversRR(	tattrRRR(RR-RRtAttributeError(RR.((Rt__getattr__s




cCs
t|iS(N(tlenRR(R((Rt__len__scCs
t|iS(N(titerRR(R((Rt__iter__scCs|i|S(N(RRti(RR5((Rt__getitem__scCs|i|=dS(N(RRR5(RR5((Rt__delitem__scCs|i||!S(N(RRR5tj(RR5R8((Rt__getslice__scCs|i||5dS(N(RRR5R8(RR5R8((Rt__delslice__s(RRRtTrueR,R0R2R4R6R7R9R:(((RRRs8						tCachecBsAtZdZddZdZdZdZedZRS(sqSimple DNS answer cache.

    @ivar data: A dictionary of cached data
    @type data: dict
    @ivar cleaning_interval: The number of seconds between cleanings.  The
    default is 300 (5 minutes).
    @type cleaning_interval: float
    @ivar next_cleaning: The time the cache should next be cleaned (in seconds
    since the epoch.)
    @type next_cleaning: float
    f300.0cCs;h|_||_ti|i|_ti|_dS(sInitialize a DNS cache.

        @param cleaning_interval: the number of seconds between periodic
        cleanings.  The default is 300.0
        @type cleaning_interval: float.
        N(Rtdatatcleaning_intervalR*t
next_cleaningt
_threadingtLocktlock(RR>((RR,s
		cCsti}|i|jog}x>|iiD]-\}}|i	|jo|i
|q2q2Wx|D]}|i|=qjWti}||i|_ndS(s&Clean the cache if it's time to do so.N(R*tnowRR?tkeys_to_deleteR=t	iteritemstktvR+tappendR>(RRGRDRCRF((Rt_maybe_cleanscCsqz\|ii|i|ii|}|djp|i	t
i
jodSn|SWd|iiXdS(s)Get the answer associated with I{key}.  Returns None if
        no answer is cached for the key.
        @param key: the key
        @type key: (dns.name.Name, int, int) tuple whose values are the
        query name, rdtype, and rdclass.
        @rtype: dns.resolver.Answer object or None
        N(RRBtacquireRIR=tgettkeyRGRR+R*trelease(RRLRG((RRKs

#cCs=z(|ii|i||i|<Wd|iiXdS(sAssociate key and value in the cache.
        @param key: the key
        @type key: (dns.name.Name, int, int) tuple whose values are the
        query name, rdtype, and rdclass.
        @param value: The answer being cached
        @type value: dns.resolver.Answer object
        N(RRBRJRItvalueR=RLRM(RRLRN((Rtputs

cCswzb|ii|dj	o%|ii|o|i|=qan h|_ti|i|_	Wd|ii
XdS(sFlush the cache.

        If I{key} is specified, only that item is flushed.  Otherwise
        the entire cache is flushed.

        @param key: the key to flush
        @type key: (dns.name.Name, int, int) tuple or None
        N(RRBRJRLRR=thas_keyR*R>R?RM(RRL((Rtflushs

	(	RRRR,RIRKRORRQ(((RR<s
			tLRUCacheNodecBs2tZdZdZdZdZdZRS(sLRUCache node.
    cCs(||_||_||_||_dS(N(RLRRNtprevtnext(RRLRN((RR,+s			cCs.|i|_||_||i_||_dS(N(tnodeRSRRT(RRU((Rtlink_before1s	cCs.||_|i|_||i_||_dS(N(RURRSRT(RRU((Rt
link_after7s	cCs"|i|i_|i|i_dS(N(RRSRT(R((Rtunlink=s(RRRR,RVRWRX(((RRR(s
			tLRUCachecBsAtZdZddZdZdZdZedZRS(sOBounded least-recently-used DNS answer cache.

    This cache is better than the simple cache (above) if you're
    running a web crawler or other process that does a lot of
    resolutions.  The LRUCache has a maximum number of nodes, and when
    it is full, the least-recently used node is removed to make space
    for a new one.

    @ivar data: A dictionary of cached data
    @type data: dict
    @ivar sentinel: sentinel node for circular doubly linked list of nodes
    @type sentinel: LRUCacheNode object
    @ivar max_size: The maximum number of nodes
    @type max_size: int
    icCs;h|_|i|tdd|_ti|_	dS(sInitialize a DNS cache.

        @param max_size: The maximum number of nodes to cache; the default is 100000.  Must be > 1.
        @type max_size: int
        N(
RR=tset_max_sizetmax_sizeRRRtsentinelR@RARB(RR[((RR,Rs
	
cCs$|djo
d}n||_dS(Ni(R[R(RR[((RRZ]s

cCsz|ii|ii|}|djodSn|i|i	i
tijo|i|i=dSn|i|i
|i	SWd|iiXdS(s)Get the answer associated with I{key}.  Returns None if
        no answer is cached for the key.
        @param key: the key
        @type key: (dns.name.Name, int, int) tuple whose values are the
        query name, rdtype, and rdclass.
        @rtype: dns.resolver.Answer object or None
        N(RRBRJR=RKRLRURRXRNR+R*RWR\RM(RRLRU((RRKbs



cCsz|ii|ii|}|dj	o|i|i|i=nxAt	|i|i
jo'|ii}|i|i|i=qMWt
||}|i|i||i|<Wd|iiXdS(sAssociate key and value in the cache.
        @param key: the key
        @type key: (dns.name.Name, int, int) tuple whose values are the
        query name, rdtype, and rdclass.
        @param value: The answer being cached
        @type value: dns.resolver.Answer object
        N(RRBRJR=RKRLRURRXR1R[R\RSRRRNRWRM(RRLRNRU((RROzs"



cCsz|ii|dj	o>|ii|}|dj	o|i|i|i=qnO|i	i
}x6||i	jo%|i
}d|_d|_
|}qjWh|_Wd|iiXdS(sFlush the cache.

        If I{key} is specified, only that item is flushed.  Otherwise
        the entire cache is flushed.

        @param key: the key to flush
        @type key: (dns.name.Name, int, int) tuple or None
        N(
RRBRJRLRR=RKRURXR\RTRSRM(RRLRURT((RRQs$



			
(	RRRR,RZRKRORRQ(((RRYAs			tResolvercBstZdZdedZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZeiieiieeed
dZeeiidZdZdZRS(s)DNS stub resolver

    @ivar domain: The domain of this host
    @type domain: dns.name.Name object
    @ivar nameservers: A list of nameservers to query.  Each nameserver is
    a string which contains the IP address of a nameserver.
    @type nameservers: list of strings
    @ivar search: The search list.  If the query name is a relative name,
    the resolver will construct an absolute query name by appending the search
    names one by one to the query name.
    @type search: list of dns.name.Name objects
    @ivar port: The port to which to send queries.  The default is 53.
    @type port: int
    @ivar timeout: The number of seconds to wait for a response from a
    server, before timing out.
    @type timeout: float
    @ivar lifetime: The total number of seconds to spend trying to get an
    answer to the question.  If the lifetime expires, a Timeout exception
    will occur.
    @type lifetime: float
    @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 key algorithm to use.  The default is
    dns.tsig.default_algorithm.
    @type keyalgorithm: string
    @ivar edns: The EDNS level to use.  The default is -1, no Edns.
    @type edns: int
    @ivar ednsflags: The EDNS flags
    @type ednsflags: int
    @ivar payload: The EDNS payload size.  The default is 0.
    @type payload: int
    @ivar flags: The message flags to use.  The default is None (i.e. not overwritten)
    @type flags: int
    @ivar cache: The cache to use.  The default is None.
    @type cache: dns.resolver.Cache object
    @ivar retry_servfail: should we retry a nameserver if it says SERVFAIL?
    The default is 'false'.
    @type retry_servfail: bool
    s/etc/resolv.confcCsO|i|o:tidjo|iqK|o|i|qKndS(sJInitialize a resolver instance.

        @param filename: The filename of a configuration file in
        standard /etc/resolv.conf format.  This parameter is meaningful
        only when I{configure} is true and the platform is POSIX.
        @type filename: string or file object
        @param configure: If True (the default), the resolver instance
        is configured in the normal fashion for the operating system
        the resolver is running on.  (I.e. a /etc/resolv.conf file on
        POSIX systems and from the registry on Windows systems.)
        @type configure: boolRN(Rtresett	configuretsystplatformt
read_registrytfilenametread_resolv_conf(RRcR_((RR,s
cCstiitiitid|_t|idjotii	|_ng|_
g|_d|_d|_
d|_d|_d|_tii|_d|_d|_d|_d|_d|_t|_dS(s1Reset all resolver configuration to the defaults.iii5f2.0f30.0iN(RR(tNamet	from_texttsockettgethostnameRtdomainR1troottnameserverstsearchtportttimeouttlifetimeRtkeyringtkeynamettsigtdefault_algorithmtkeyalgorithmtednst	ednsflagstpayloadtcachetflagstFalsetretry_servfail(R((RR^s$+												cCst|tpt|toCyt|d}Wn#tj
odg|_dSnXt}nt
}zx
|D]}t|djp"|ddjp|ddjoqsn|i
}t|djoqsn|ddjo|ii|dqs|dd	jotii|d|_qs|dd
jo5x2|dD]"}|iitii|qNWqsqsWWd|o|inXt|idjo|iidndS(sProcess f as a file in the /etc/resolv.conf format.  If f is
        a string, it is used as the name of the file to open; otherwise it
        is treated as the file itself.trs	127.0.0.1Nit#t;t
nameserveriRiRl(t
isinstancetftstrtunicodetopentIOErrorRRkR;t
want_closeRztlR1tsplitttokensRHRR(RfRitsuffixRltclose(RRRRRR((RRds< 	
5,cCsJ|iddjo
d}n'|iddjo
d}nd}|S(Nt it,(tentrytfindt
split_char(RRR((Rt_determine_split_char#s

cCsct|}|i|}|i|}x2|D]*}||ijo|ii|q1q1WdS(s&Configure a NameServer registry entry.N(	RRkRRRRtns_listtnsRH(RRkRRR((Rt_config_win32_nameservers2scCstiit||_dS(s"Configure a Domain registry entry.N(RR(RfRRiR(RRi((Rt_config_win32_domain<scCsot|}|i|}|i|}x>|D]6}||ijo |iit	i
i|q1q1WdS(s"Configure a Search registry entry.N(RRlRRRRtsearch_listtsRHRR(Rf(RRlRRR((Rt_config_win32_searchAscCsyti|d\}}Wntj
o
d}nX|o[|i|y4ti|d\}}|o|i
|nWq4tj
oq4Xnyti|d\}}Wntj
o
d}nX|o[|i|y4ti|d\}}|o|i
|nWq4tj
oq4Xnyti|d\}}Wntj
o
d}nX|o|i|ndS(s%Extract DNS info from a registry key.t
NameServertDomaintDhcpNameServert
DhcpDomaint
SearchListN(
t_winregtQueryValueExRLtserverstrtypetWindowsErrorRRRtdomRRlR(RRLRRRlR((Rt_config_win32_fromkeyKs>
	
	cCs]tidti}t}z0yti|d}t	}Wn%t
j
oti|d}nXz|i|Wd|i
X|oti|d}zd}xt	oynti||}|d7}ti||}|i|||pwnz|i|Wd|i
XWqt
j
oPqXqWWd|i
XnWd|i
XdS(s9Extract resolver configuration from the Windows registry.s2SYSTEM\CurrentControlSet\Services\Tcpip\Parameterss+SYSTEM\CurrentControlSet\Services\VxD\MSTCPNs=SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfacesii(RtConnectRegistryRtHKEY_LOCAL_MACHINEtlmRzt	want_scantOpenKeyt
tcp_paramsR;tEnvironmentErrorRRtCloset
interfacesR5tEnumKeytguidRLt_win32_is_nic_enabled(RRLR5RRRRR((RRbmsL		
			
c
Cs!yti|d|}zti|d\}	}|tijo
t	nti|d|	}z?ti|d\}}|tijo
t	n|d@SWd|i
XWd|i
XWnYtt	fj
oGy&ti|d\}}|dj	SWqtj
otSqXnXdS(Ns]SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\%s\Connectiont
PnpInstanceIDs SYSTEM\CurrentControlSet\Enum\%stConfigFlagsitNTEContextList(RRRRtconnection_keyRtpnp_idtttypetREG_SZt
ValueErrort
device_keyRyt	REG_DWORDRRt
interface_keytnteRRRz(
RRRRRRRyRRR((RRs0	



	cCsyti}||jo%||djo
tq>|}n||}||ijo
tnt|i||iS(Ni(	R*RCtstarttTimeouttdurationRRotminRn(RRRRC((Rt_compute_timeouts




icCst|ttfotii|d}nt|ttfoti	i|}nti	i
|o
tnt|ttfoti
i|}nti
i|o
tng}|io|i|nt|djo |i|itiin|io.xD|iD]}|i|i|q,Wn|i|i|it}ti}x|D]}|ioU|ii|||f}
|
dj	o)|
i djo|o
t"q|
Sqnti#i$|||}|i&dj	o#|i'|i(|i&d|i)n|i*|i+|i,|i-|i.dj	o|i.|_.nd}|i0}
d}	x|djot|
djo
t2nx|
D]}|i4|}y|o.ti7i6||||i8d|d|}n|ti7i;||||i8d|d|}|i.ti.i<@o=|i4|}ti7i6||||i8d|d|}nWnt=i>ti?i@fj
od}qnyti7iAj
od}qnXti?iBj
o|
iC|d}qn*tDj
o|
iC|d}qnX|iE}|tiEiFjo
tFn|tiEiGjp|tiEiHjoPn|tiEiIjp|iJo|
iC|nd}qW|dj	oPnt|
djo9|i4|}tK||	}|	d9}	tiM|qqW|iEtiEiHjoqntN}PqW|o
tHntO|||||}
|io |iiP|||f|
n|
S(	sQuery nameservers to find the answer to the question.

        The I{qname}, I{rdtype}, and I{rdclass} parameters may be objects
        of the appropriate type, or strings that can be converted into objects
        of the appropriate type.  E.g. For I{rdtype} the integer 2 and the
        the string 'NS' both mean to query for records with DNS rdata type NS.

        @param qname: the query name
        @type qname: dns.name.Name object or string
        @param rdtype: the query type
        @type rdtype: int or string
        @param rdclass: the query class
        @type rdclass: int or string
        @param tcp: use TCP to make the query (default is False).
        @type tcp: bool
        @param source: bind to this IP address (defaults to machine default IP).
        @type source: IP address in dotted quad notation
        @param raise_on_no_answer: raise NoAnswer if there's no answer
        (defaults is True).
        @type raise_on_no_answer: bool
        @param source_port: The port from which to send the message.
        The default is 0.
        @type source_port: int
        @rtype: dns.resolver.Answer instance
        @raises Timeout: no answers could be found in the specified lifetime
        @raises NXDOMAIN: the query name does not exist
        @raises YXDOMAIN: the query name is too long after DNAME substitution
        @raises NoAnswer: the response did not contain an answer and
        raise_on_no_answer is True.
        @raises NoNameservers: no non-broken nameservers are available to
        answer the question.it	algorithmf0.10000000000000001itsourcetsource_portiN(QRR
RRRR(RfRRRtis_metatypeRRt
rdataclasstis_metaclasst
qnames_to_trytis_absoluteRHR1tconcatenateRjRRlRRiR;tall_nxdomainR*RRxRKRRR!Rtmessaget
make_querytrequestRqtuse_tsigRpRttuse_ednsRuRvRwRyRRktbackoffRRRRnttcptqueryRmRRtudptTCRgterrort	exceptionRtUnexpectedSourcet	FormErrortremovetEOFErrortrcodeRtNOERRORRtSERVFAILR{Rt
sleep_timetsleepRzRRO(RR
RRRRR!RRRRkRRRRnRRRRRR((RRs 


 







			


&



	
 cCsF||_|djo|iid|_n
||_||_dS(sAdd a TSIG signature to the query.

        @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.
        @param algorithm: The TSIG key algorithm to use.  The default
        is dns.tsig.default_algorithm.
        @type algorithm: stringiN(RpRRqRtkeysRRt(RRpRqR((RRs	
	cCs6|djo
d}n||_||_||_dS(sConfigure Edns.

        @param edns: The EDNS level to use.  The default is -1, no Edns.
        @type edns: int
        @param ednsflags: The EDNS flags
        @type ednsflags: int
        @param payload: The EDNS payload size.  The default is 0.
        @type payload: intiN(RuRRRvRw(RRuRvRw((RRs

		cCs
||_dS(sOverrides the default flags with your own

        @param flags: The flags to overwrite the default with
        @type flags: intN(RyR(RRy((Rt	set_flagss(RRRR;R,R^RdRRRRRRbRRRRtARtINRzRRRrRsRRR(((RR]s )		#		
		
	"	-	7	'	cCstdjo
tantS(s7Get the default resolver, initializing it if necessary.N(tdefault_resolverRR](((Rtget_default_resolvers


icCs"ti|||||||S(sQuery nameservers to find the answer to the question.

    This is a convenience function that uses the default resolver
    object to make the query.
    @see: L{dns.resolver.Resolver.query} for more information on the
    parameters.N(	RRR
RRRRR!R(R
RRRRR!R((RRscCst|ttfotii|tii}n|djo
t	}n|i
pt|nxy=|i|ti
i||}|ii|jo|SnWn%tiitiifj
onXy|i}Wqotiij
o
tqoXqoWdS(sFind the name of the zone which contains the specified name.

    @param name: the query name
    @type name: absolute dns.name.Name object or string
    @param rdclass: The query class
    @type rdclass: int
    @param tcp: use TCP to make the query (default is False).
    @type tcp: bool
    @param resolver: the resolver to use
    @type resolver: dns.resolver.Resolver object or None
    @rtype: dns.name.NameiN(RR(RRRRfRjtresolverRRRR	RRR$RRRRRRR'R)R
(R(RRRR((Rt
zone_for_names&


 cCs|titiB@djo
tn|djo#|djotiti	ng}g}d}y|djoVd}|ti
@djo|id|idq(|id|idn\|id}t|djo|d}
n|}
tii|
}	|i||}Wny)tii|}	|i||}Wq|ti@djo~y4d}|tijp|tijouti|tii d	t!}|i}|ii#t$}|i%dj	o(x%|i%D]}|i|i'qWqn|ti(jp|tijouti|tii)d	t!}|i}|ii#t$}|i%dj	o(x%|i%D]}|i|i'qWqnWqti+i,j
otiti	qtiti-qXqqXnXd}y'|djo
d}n
t/|}Wn<|ti0@djo!yti1|}Wq`q`XqdnX|djotiti	ng}
|djoti4ti5g}n
|g}|ti7@djo
|}nd
}|tijp|tijofxc|D]W}	xN|D]F}x=t9|D]1}|
iti||||	|ddffq"WqWqWn|ti(jp|tijo`x]|D]Q}	xH|D]@}x7t9|D]+}|
iti(||||	|ffqWqWqWnt|
djotiti	n|
S(Nit	localhosts::s0.0.0.0s::1s	127.0.0.1t%iR!t(;RyRgt
AI_ADDRCONFIGtAI_V4MAPPEDtNotImplementedErrorthostRtservicetgaierrort
EAI_NONAMEtv6addrstv4addrsR"t
AI_PASSIVERHRtpartsR1tahostRtipv6t	inet_atontaddrtipv4tAI_NUMERICHOSTR
tfamilytAF_INET6t	AF_UNSPECt	_resolverRRtAAAARztv6tto_textR;RtrdatataddresstAF_INETRtv4RRt
EAI_SYSTEMRmtinttAI_NUMERICSERVt
getservbynamettuplestsocktypet
SOCK_DGRAMtSOCK_STREAMt	socktypestAI_CANONNAMEtcnamet_protocols_for_socktypetproto(RRRR
RRyRRRmRRR"RRRRRR
RR((Rt_getaddrinfos







 	
 	
 "



	
 ; 5c
Cs|d}|d}t|djo|d}
ti}nd}
ti	}t
|||titid}t|djotidn|ddd}|ti@o
d}	nd}	tii|}|ti@djoy/ti|d}|idiit}Wqti i!ti i"fj
oV|ti#@oti$ti%n|}|
dj	o|d	t&|
7}qqXn,|}|
dj	o|d	t&|
7}n|ti'@ot&|}nti)||	}||fS(
Niiiis'sockaddr resolved to multiple addressesRRtPTRR(*tsockaddrRRmR1tscopeRgRRRRRRtSOL_TCPRRRRytNI_DGRAMtpnameRtreversenametfrom_addressR
tNI_NUMERICHOSTRRRRR RR;thostnameRRRtNI_NAMEREQDRRRtNI_NUMERICSERVRt
getservbyport(
RRyRRRR
RRRRRRmR((Rt_getnameinfofsB



	
 
!
cCs<|djoti}ntt|ddddS(NiPii(R(RRgRhR#R(R(((Rt_getfqdns
cCst|ddS(Nii(t_gethostbyname_exR((R(((Rt_gethostbynamescCstg}g}t|dtitititi}|dd}x#|D]}|i|ddqHW|||fS(Niii(
taliasest	addressesRR(RgRRRRRt	canonicaltitemRH(R(R(R)R*RR'((RR%scCsy1tii|}
|dddf}ti}Wn|df}ti	}nXt
|ti\}}	g}g}t|d|tititi}|dd}x#|D]}|i|ddqW|||fS(NiPiii(RRRtipRRRgRRRR#R R(RmR'R(RRRRRR)R*RH(R+RR(RR)R(R*RR'RmR((Rt_gethostbyaddrs"

cCsZ|djo
t}n|att_tt_t	t_
tt_t
t_tt_dS(sOverride the system resolver routines in the socket module with
    versions which use dnspython's resolver.

    This can be useful in testing situations where you want to control
    the resolution behavior of python code without having to change
    the system's resolver settings (e.g. /etc/resolv.conf).

    The resolver to use may be specified; if it's not, the default
    resolver will be used.

    @param resolver: the resolver to use
    @type resolver: dns.resolver.Resolver object or None
    N(RRRRRRgtgetaddrinfoR#tgetnameinfoR$tgetfqdnR&t
gethostbynameR%tgethostbyname_exR,t
gethostbyaddr(R((Rtoverride_system_resolvers


					cCs@datt_tt_tt_t	t_
tt_t
t_dS(s4Undo the effects of override_system_resolver().
    N(RRt_original_getaddrinfoRgR-t_original_getnameinfoR.t_original_getfqdnR/t_original_gethostbynameR0t_original_gethostbyname_exR1t_original_gethostbyaddrR2(((Rtrestore_system_resolvers					(LRRgR`R*t	threadingR@tImportErrortdummy_threadingt
dns.exceptionRt	dns.flagstdns.ipv4tdns.ipv6tdns.messagetdns.namet	dns.queryt	dns.rcodetdns.rdataclasst
dns.rdatatypetdns.reversenameRaRRtDNSExceptionRRRRRR	R
RtobjectRR<RRRYR]RRRRRRRRzR;RRRtSOL_UDPRRRRR-R4R.R5R/R6R0R7R1R8R2R9RRR#R$R&R%R,R3R:(%RRR4R<RRRRR	RRR8R3R5R%R]R7R6RRR,RR`R$R
RRRYR:RgR@R#R&RRR*R9R((Rt?sn			
											
v`l	'%*						d'