HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/proc/self/root/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyc
�
1�3\c@@s�ddlmZmZdZdZdZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZdddgZde�d	<d
ZdZdZd
ZdZdZdZdZddZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)d Z*d!Z+d"Z,dZ-dZ.dZ/dZ0dZ1d#Z2d$Z3d%Z4d&Z5d'Z6d(Z7d)Z8d*Z9d+Z:d,Z;d-Z<dZ=d.Z>d/Z?d!Z@id0e&6d1e'6d2e(6d3e)6d4e*6d5e+6ZAid6e.6d7e/6d8e06d9e16d:e26d;e36d<e46d=e56d>e66d?e76d@e86dAe96dBe:6dCe;6dDe<6dEe=6dFe>6dGe?6d5e@6ZBdH�ZCdIeDfdJ��YZEdKeDfdL��YZFdMeDfdN��YZGdOeDfdP��YZHdQeDfdR��YZIdSeDfdT��YZJdUeJfdV��YZKdWeLfdX��YZMdYeMfdZ��YZNd[eMfd\��YZOd]eOfd^��YZPd_eOfd`��YZQdaeOfdb��YZRdceOfdd��YZSdeeOfdf��YZTdgeLfdh��YZUdieLfdj��YZVdkeLfdl��YZWdmejXfdn��YZYdoeLfdp��YZZdqejXfdr��YZ[dejXfds��YZ\deLfdt��YZ]deLfdu��YZ^e_dvkr�e`dwe�e^�Zae`dx�idydz6d{d66d|d}6Zbe]d~de	jcd��d�ddeb�Zde`d��eajeed�e`d��e`d��e`d�efeajgd~d����e`d��e`d��e`d�efeajgd~d���e`d��e`d��eajhed�e`d��eaji�ndS(�i(tabsolute_importtprint_functionsPaul Scott-Murphys!paul at scott dash murphy dot coms0.12NtZeroconftServiceInfotServiceBrowsert_GLOBAL_DONEi}i�i�i�i�s224.0.0.251i�i5i<i�i#i�iiii@i iiiiii�i�i�iiiii	i
iii
iiii!tintcstchthstnonetanytatnstmdtmftcnametsoatmbtmgtmrtnulltwkstptrthinfotminfotmxttxttquadatsrvcC@stj�dS(s#Current system time in millisecondsi�(ttime(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytcurrentTimeMillis�stNonLocalNameExceptioncB@seZRS((t__name__t
__module__(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR �stNonUniqueNameExceptioncB@seZRS((R!R"(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR#�stNamePartTooLongExceptioncB@seZRS((R!R"(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR$�stAbstractMethodExceptioncB@seZRS((R!R"(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR%�stBadTypeInNameExceptioncB@seZRS((R!R"(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR&�st
BadDomainNamecB@seZd�ZRS(cC@stj|d|�dS(Nsat position %s(t	Exceptiont__init__(tselftpos((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s(R!R"R)(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR'�stBadDomainNameCircularcB@seZRS((R!R"(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR,�stDNSEntrycB@sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(sA DNS entrycC@sHtj|�|_||_||_|t@|_|t@dk|_dS(Ni(	tstringtlowertkeytnamettypet_CLASS_MASKtclazzt
_CLASS_UNIQUEtunique(R*R1R2R4((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s
		
cC@sGt|t�rC|j|jkoB|j|jkoB|j|jkSdS(s&Equality test on name, type, and classi(t
isinstanceR-R1R2R4(R*tother((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt__eq__�s$cC@s|j|�S(sNon-equality test(R9(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt__ne__�scC@s)yt|SWntk
r$d|SXdS(sClass accessors?(%s)N(t_CLASSEStKeyError(R*R4((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetClazz�s
cC@s)yt|SWntk
r$d|SXdS(s
Type accessors?(%s)N(t_TYPESR<(R*R2((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetType�s
cC@s�d||j|j�|j|j�f}|jrA|d7}n
|d7}||j7}|dk	ru|d|7}n
|d7}|S(s1String representation with additional informations%s[%s,%ss-unique,t,s,%s]t]N(R?R2R=R4R6R1tNone(R*thdrR8tresult((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyttoString�s(	



(	R!R"t__doc__R)R9R:R=R?RE(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR-�s					tDNSQuestioncB@s)eZdZd�Zd�Zd�ZRS(sA DNS question entrycC@s8|jd�st|��ntj||||�dS(Ns.local.(tendswithR R-R)(R*R1R2R4((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)scC@sC|j|jkoB|j|jks3|jtkoB|j|jkS(s6Returns true if the question is answered by the record(R4R2t	_TYPE_ANYR1(R*trec((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt
answeredBys!cC@stj|dd�S(sString representationtquestionN(R-RERB(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt__repr__s(R!R"RFR)RKRM(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRGs		t	DNSRecordcB@sqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(s.A DNS record - like a DNS entry, but has a TTLcC@s/tj||||�||_t�|_dS(N(R-R)tttlRtcreated(R*R1R2R4RO((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)$s	cC@s#t|t�rtj||�SdS(sTests equality as per DNSRecordi(R7RNR-R9(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR9)scC@s+x$|jD]}|j|�r
dSq
WdS(sdReturns true if any answer in a message can suffice for the
        information held in this record.ii(tanswerstsuppressedByAnswer(R*tmsgtrecord((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytsuppressedBy/scC@s*||kr&|j|jdkr&dSdS(swReturns true if another record has same name, type and class,
        and if its TTL is at least half of this record's.iii(RO(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRR7s"cC@s|j||jdS(sXReturns the time at which this record will have expired
        by a certain percentage.i
(RPRO(R*tpercent((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetExpirationTime>scC@std|jd�|d�S(s%Returns the remaining TTL in seconds.iidi�(tmaxRW(R*tnow((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetRemainingTTLCscC@s|jd�|kS(s(Returns true if this record has expired.id(RW(R*RY((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt	isExpiredGscC@s|jd�|kS(s9Returns true if this record is at least half way expired.i2(RW(R*RY((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytisStaleKscC@s|j|_|j|_dS(sJSets this record's TTL and created time to that of
        another record.N(RPRO(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytresetTTLOscC@s
t�dS(sAbstract methodN(R%(R*tout((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytwriteUscC@s5d|j|jt��|f}tj|d|�S(s1String representation with additional informations%s/%s,%sRT(RORZRR-RE(R*R8targ((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyREYs(R!R"RFR)R9RURRRWRZR[R\R]R_RE(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRN!s										t
DNSAddresscB@s2eZdZd�Zd�Zd�Zd�ZRS(sA DNS address recordcC@s&tj|||||�||_dS(N(RNR)taddress(R*R1R2R4RORb((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)bscC@s |j|jt|j��dS(s'Used in constructing an outgoing packetN(twriteStringRbtlen(R*R^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR_fscC@s#t|t�r|j|jkSdS(sTests equality on addressi(R7RaRb(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR9jscC@s0ytj|j�SWntk
r+|jSXdS(sString representationN(tsockett	inet_ntoaRbR((R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRMps
(R!R"RFR)R_R9RM(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRa_s
			tDNSHinfocB@s2eZdZd�Zd�Zd�Zd�ZRS(sA DNS host information recordcC@s/tj|||||�||_||_dS(N(RNR)tcputos(R*R1R2R4RORhRi((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)zs	cC@s<|j|jt|j��|j|jt|j��dS(s'Used in constructing an outgoing packetN(RcRhRdRi(R*R^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR_scC@s5t|t�r1|j|jko0|j|jkSdS(sTests equality on cpu and osi(R7RgRhRi(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR9�s"cC@s|jd|jS(sString representationt (RhRi(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRM�s(R!R"RFR)R_R9RM(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRgws
			t
DNSPointercB@s2eZdZd�Zd�Zd�Zd�ZRS(sA DNS pointer recordcC@s&tj|||||�||_dS(N(RNR)talias(R*R1R2R4RORl((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�scC@s|j|j�dS(s'Used in constructing an outgoing packetN(t	writeNameRl(R*R^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR_�scC@s#t|t�r|j|jkSdS(sTests equality on aliasi(R7RkRl(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR9�scC@s|j|j�S(sString representation(RERl(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRM�s(R!R"RFR)R_R9RM(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRk�s
			tDNSTextcB@s2eZdZd�Zd�Zd�Zd�ZRS(sA DNS text recordcC@s&tj|||||�||_dS(N(RNR)ttext(R*R1R2R4RORo((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�scC@s |j|jt|j��dS(s'Used in constructing an outgoing packetN(RcRoRd(R*R^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR_�scC@s#t|t�r|j|jkSdS(sTests equality on texti(R7RnRo(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR9�scC@sAt|j�dkr-|j|jd d�S|j|j�SdS(sString representationi
is...N(RdRoRE(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRM�s(R!R"RFR)R_R9RM(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRn�s
			t
DNSServicecB@s2eZdZd�Zd�Zd�Zd�ZRS(sA DNS service recordc		C@sAtj|||||�||_||_||_||_dS(N(RNR)tprioritytweighttporttserver(	R*R1R2R4RORqRrRsRt((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s
			cC@sD|j|j�|j|j�|j|j�|j|j�dS(s'Used in constructing an outgoing packetN(t
writeShortRqRrRsRmRt(R*R^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR_�scC@sYt|t�rU|j|jkoT|j|jkoT|j|jkoT|j|jkSdS(s3Tests equality on priority, weight, port and serveri(R7RpRqRrRsRt(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR9�scC@s|jd|j|jf�S(sString representations%s:%s(RERtRs(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRM�s(R!R"RFR)R_R9RM(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRp�s
				tDNSIncomingcB@szeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
s/Object representation of an incoming DNS packetcC@sjd|_||_g|_g|_d|_d|_d|_d|_|j�|j	�|j
�dS(s/Constructor from string holding bytes of packetiN(toffsettdatat	questionsRQtnumquestionst
numanswerstnumauthoritiestnumadditionalst
readHeadert
readQuestionst
readOthers(R*Rx((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s								

cC@s�d}tj|�}tj||j|j|j|!�}|j|7_|d|_|d|_|d|_|d|_|d|_	|d|_
dS(	sReads header portion of packets!HHHHHHiiiiiiN(tstructtcalcsizetunpackRxRwtidtflagsRzR{R|R}(R*tformattlengthtinfo((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR~�s	




cC@s�d}tj|�}x�td|j�D]�}|j�}tj||j|j|j|!�}|j|7_y.t||d|d�}|j	j
|�Wq(tk
r�q(Xq(WdS(s!Reads questions section of packets!HHiiN(R�R�trangeRztreadNameR�RxRwRGRytappendR (R*R�R�tiR1R�RL((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�s	
cC@sRd}tj|�}tj||j|j|j|!�}|j|7_|dS(s Reads an integer from the packets!Ii(R�R�R�RxRw(R*R�R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytreadInt
s	cC@s2t|j|j�}|jd7_|j|�S(s(Reads a character string from the packeti(tordRxRwt
readString(R*R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytreadCharacterStringscC@s`dt|�d}tj|�}tj||j|j|j|!�}|j|7_|dS(s0Reads a string of a given length from the packett!tsi(tstrR�R�R�RxRw(R*RdR�R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�s	cC@sRd}tj|�}tj||j|j|j|!�}|j|7_|dS(s'Reads an unsigned short from the packets!Hi(R�R�R�RxRw(R*R�R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytreadUnsignedShort"s	c
C@srd}tj|�}|j|j|j}x?td|�D].}|j�}tj||j|j	|j	|!�}|j	|7_	d}|dtkr�t||d|d|d|j
d��}n�|dtks�|dtkrt||d|d|d|j��}n5|dtkrZt||d|d|d|j
|d��}n�|dtkr�t||d|d|d|j�|j�|j�|j��}n�|dtkr�t||d|d|d|j�|j��}nS|dtkr8t||d|d|d|j
d��}n|j	|d7_	|dk	r<|jj|�q<q<WdS(	s@Reads answers, authorities and additionals section of the packets!HHiHiiiiiiN(R�R�R{R|R}R�R�R�RxRwRBt_TYPE_ARaR�t_TYPE_CNAMEt	_TYPE_PTRRkt	_TYPE_TXTRnt	_TYPE_SRVRpR�t_TYPE_HINFORgR�t
_TYPE_AAAARQR�(R*R�R�tnR�tdomainR�RJ((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�+sD	 				
cC@s|jt@tkS(sReturns true if this is a query(R�t_FLAGS_QR_MASKt_FLAGS_QR_QUERY(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytisQuery[scC@s|jt@tkS(s"Returns true if this is a response(R�R�t_FLAGS_QR_RESPONSE(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt
isResponse_scC@s|j|||!jd�S(s6Reads a UTF-8 string of a given length from the packetsutf-8(Rxtdecode(R*RwRd((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytreadUTFcscC@s6d}|j}d}|}x�trt|j|�}|d7}|dkrQPn|d@}|dkr�dj||j||�df�}||7}q|dkr|dkr�|d}n|d@d>t|j|�B}||kr�t|��n|}qt|��qW|dkr)||_n	||_|S(	s#Reads a domain name from the packetti����iii�t.i?i(RwtTrueR�RxtjoinR�R,R'(R*RDtofftnexttfirstRdtt((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�gs2		

%

		(R!R"RFR)R~RR�R�R�R�R�R�R�R�R�(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRv�s											0			tDNSOutgoingcB@s�eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�ZRS(s+Object representation of an outgoing packeticC@sgd|_d|_||_||_i|_g|_d|_g|_g|_g|_	g|_
dS(Nii(tfinishedR�t	multicastR�tnamesRxtsizeRyRQtauthoritiestadditionals(R*R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s										cC@s|jj|�dS(sAdds a questionN(RyR�(R*RT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytaddQuestion�scC@s&|j|�s"|j|d�ndS(sAdds an answeriN(RUtaddAnswerAtTime(R*tinpRT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt	addAnswer�scC@sH|dk	rD|dks(|j|�rD|jj||f�qDndS(s6Adds an answer if if does not expire by a certain timeiN(RBR[RQR�(R*RTRY((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR��scC@s|jj|�dS(sAdds an authoritative answerN(R�R�(R*RT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytaddAuthoritativeAnswer�scC@s|jj|�dS(sAdds an additional answerN(R�R�(R*RT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytaddAdditionalAnswer�scC@s;d}|jjtj|t|���|jd7_dS(s"Writes a single byte to the packets!ciN(RxR�R�tpacktchrR�(R*tvalueR�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt	writeByte�s"cC@s8d}|jj|tj||��|jd7_dS(s=Inserts an unsigned short in a certain position in the packets!HiN(RxtinsertR�R�R�(R*tindexR�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytinsertShort�scC@s5d}|jjtj||��|jd7_dS(s&Writes an unsigned short to the packets!HiN(RxR�R�R�R�(R*R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRu�scC@s;d}|jjtj|t|���|jd7_dS(s(Writes an unsigned integer to the packets!IiN(RxR�R�R�tintR�(R*R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytwriteInt�s"cC@sCdt|�d}|jjtj||��|j|7_dS(sWrites a string to the packetR�R�N(R�RxR�R�R�R�(R*R�R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRc�scC@sQ|jd�}t|�}|dkr0t�n|j|�|j||�dS(s5Writes a UTF-8 string of a given length to the packetsutf-8i@N(tencodeRdR$R�Rc(R*R�tutfstrR�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytwriteUTF�s	
cC@s�y|j|}Wnytk
r�|j|j|<|jd�}|ddkr]|d }nx|D]}|j|�qdW|jd�dSX|j|d?dB�|j|�dS(s"Writes a domain name to the packetR�i����R�iNii�(R�R<R�tsplitR�R�(R*R1R�tpartstpart((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRm�s



cC@s4|j|j�|j|j�|j|j�dS(sWrites a question to the packetN(RmR1RuR2R4(R*RL((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt
writeQuestion�scC@s�|j|j�|j|j�|jrI|jrI|j|jtB�n|j|j�|dkrx|j|j	�n|j|j
|��t|j�}|j
d7_
|j|�|j
d8_
tdj|j|��}|j||�dS(sPWrites a record (answer, authoritative answer, additional) to
        the packetiiR�N(RmR1RuR2R6R�R4R5R�RORZRdRxR�R_R�R�(R*RTRYR�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytwriteRecord�s
cC@s^|jsNd|_x|jD]}|j|�qWx'|jD]\}}|j||�q=Wx!|jD]}|j|d�qgWx!|jD]}|j|d�q�W|jdt|j��|jdt|j��|jdt|j��|jdt|j��|jd|j	�|j
r8|jdd�qN|jd|j�ndj|j
�S(s�Returns a string containing the packet's bytes

        No further parts should be added to the packet once this
        is done.iiR�(R�RyR�RQR�R�R�R�RdR�R�R�R�Rx(R*RLtanswerttime_t	authorityt
additional((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytpackets&			(R!R"RFR)R�R�R�R�R�R�R�RuR�RcR�RmR�R�R�(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR��s"															tDNSCachecB@sMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(sA cache of DNS entriescC@s
i|_dS(N(tcache(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR).scC@sMy|j|j}Wn%tk
r;g}|j|j<nX|j|�dS(s
Adds an entryN(R�R0R<R�(R*tentrytlist((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytadd1s

cC@s9y!|j|j}|j|�Wntk
r4nXdS(sRemoves an entryN(R�R0tremoveR<(R*R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�9s

cC@sDy%|j|j}||j|�SWnttfk
r?dSXdS(sNGets an entry by key.  Will return None if there is no
        matching entry.N(R�R0R�R<t
ValueErrorRB(R*R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetAs
cC@st|||�}|j|�S(sRGets an entry by details.  Will return None if there is
        no matching entry.(R-R�(R*R1R2R4R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetByDetailsJscC@s(y|j|SWntk
r#gSXdS(s5Returns a list of entries whose key matches the name.N(R�R<(R*R1((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytentriesWithNamePs
cC@s<y#ttjj|jj���SWntk
r7gSXdS(sReturns a list of all entriesN(R�t	itertoolstchaint
from_iterableR�tvaluesR((R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytentriesWs#
(
R!R"RFR)R�R�R�R�R�R�(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�+s							tEnginecB@sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(scAn engine wraps read access to sockets, allowing objects that
    need to receive data from sockets to be called back when the
    sockets are ready.

    A reader needs a handle_read() method, which is called when the socket
    it is interested in is ready for reading.

    Writers are not implemented here, because we only send short
    packets.
    cC@sHtjj|�||_i|_d|_tj�|_|j�dS(Ni(	t	threadingtThreadR)tzeroconftreadersttimeoutt	Conditiont	conditiontstart(R*R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)ks			cC@s�x�t�ds�|j�}t|�dkr^|jj�|jj|j�|jj�qy|tj|gg|j�\}}}xQ|D]I}y|j	|j
�Wq�tk
r�t�ds�tj
�q�q�Xq�WWqtk
r�qXqWdS(NRi(tglobalst
getReadersRdR�tacquiretwaitR�treleasetselectR�thandle_readR(t	tracebackt	print_exc(R*trstrrtwrtertsock((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytrunss 
$



cC@s-|jj�|jj�}|jj�|S(N(R�R�R�tkeysR�(R*RD((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR��s

cC@s8|jj�||j|<|jj�|jj�dS(N(R�R�R�tnotifyR�(R*treaderRe((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt	addReader�s


cC@s5|jj�|j|=|jj�|jj�dS(N(R�R�R�R�R�(R*Re((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt	delReader�s


cC@s+|jj�|jj�|jj�dS(N(R�R�R�R�(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR��s

(	R!R"RFR)R�R�R�R�R�(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�_s
					tListenercB@s eZdZd�Zd�ZRS(s4A Listener is used by this module to listen on the multicast
    group to which DNS messages are sent, allowing the implementation
    to cache information as it arrives.

    It requires registration with an Engine object in order to have
    the read() method called when a socket is available for reading.cC@s)||_|jjj||jj�dS(N(R�tengineR�Re(R*R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s	cC@sd}}}|jj}y|jt�\}\}}Wn/tjk
rj}|jtjkrddS�nX||_t	|�}|j
�r�|tkr�|jj|t
t�q�|tkr�|jj|||�|jj|t
t�q�n|jj|�dS(N(RBR�Retrecvfromt_MAX_MSG_ABSOLUTEterrorterrnotEBADFRxRvR�t
_MDNS_PORTthandleQueryt
_MDNS_ADDRt	_DNS_PORTthandleResponse(R*RxtaddrRsR�teRS((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR��s"	(R!R"RFR)R�(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR��s	tReapercB@s eZdZd�Zd�ZRS(sNA Reaper is used by this module to remove cache entries that
    have expired.cC@s'tjj|�||_|j�dS(N(R�R�R)R�R�(R*R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s	cC@s�x�tr�|jjd�t�dr*dSt�}xR|jjj�D]>}|j|�rF|jj||�|jjj	|�qFqFWqWdS(Ni
i�Ri'(
R�R�R�R�RR�R�R[tupdateRecordR�(R*RYRT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR��s	
	(R!R"RFR)R�(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR
�s	cB@s2eZdZd�Zd�Zd�Zd�ZRS(s�Used to browse for a service of a specific type.

    The listener object will have its addService() and
    removeService() methods called when this browser
    discovers changes in the services availability.cC@s�tjj|�||_||_||_i|_t�|_t	|_
g|_d|_|jj
|t|jtt��|j�dS(s%Creates a browser for a specific typeiN(R�R�R)R�R2tlistenertservicesRtnexttimet
_BROWSER_TIMEtdelayR�tdonetaddListenerRGR�t	_CLASS_INR�(R*R�R2R((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)�s							
c@s�jtkr�j�jkr�j|�}yi�j�jj�}|s_|j��n9�j�jj�=��fd�}�jj	|�dSWnRt
k
r�|s���j�jj�<��fd�}�jj	|�q�nX�jd�}|�jkr|�_qndS(s�Callback invoked by Zeroconf when new information arrives.

        Updates information required by browser in the Zeroconf cache.c@s�jj|�j�j�S(N(Rt
removeServiceR2Rl(tx(RTR*(s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt<lambda>sNc@s�jj|�j�j�S(N(Rt
addServiceR2Rl(R(RTR*(s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRsiK(
R2R�R1R[R
RlR/R]R�R�R(RWR(R*R�RYRTtexpiredt	oldrecordtcallbacktexpires((RTR*s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�s$!
cC@sd|_|jj�dS(Ni(RR�t	notifyAll(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytcancels	cC@svxotrqd}t�}t|j�dkrV|j|krV|jj|j|�nt�dsl|j	rpdSt�}|j|kr(t
t�}|jt
|jtt��x9|jj�D](}|j|�s�|j||�q�q�W|jj|�||j|_td|jd�|_nt|j�dkrR|jjd�}n|dk	r||j�qqWdS(NiRii�ii N(R�RBRRdR�RR�R�R�RR�R�R�RGR2R�RR
R�R[R�tsendRtmintpop(R*teventRYR^RT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�s*		$	(R!R"RFR)RRR�(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�s
			cB@s�eZdZddddddd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�ZRS(sService informationic		C@sz|j|�st�n||_||_||_||_||_||_|r`||_n	||_|j	|�dS(s�Create a service description.

        type: fully qualified service type name
        name: fully qualified service name
        address: IP address as unsigned short, network byte order
        port: port that the service runs on
        weight: weight of the service
        priority: priority of the service
        properties: dictionary of properties (or a string holding the bytes for
                    the text field)
        server: fully qualified name for service host (defaults to name)N(
RHR&R2R1RbRsRrRqRtt
setProperties(	R*R2R1RbRsRrRqt
propertiesRt((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)2s								cC@st|t�r||_g}d}x�|D]�}||}|dkrPd}nEt|t�rh|}n-t|t�r�|r�d}q�d}nd}|jdj||f��q+Wx>|D]6}dj|tj	dt
t|���|f�}q�W||_n	||_dS(s7Sets properties and text of this info from a dictionaryR�ttruetfalset=s!cN(
R7tdictR#RBR�R�R�R�R�R�R�RdRo(R*R#R�RDR0R�tsuffixtitem((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR"Ns*	

				 
$cC@sZ||_y&i}t|�}d}g}xL||krxt||�}|d7}|j||||!�||7}q-Wx�|D]�}|jd�}|dkr�|}	d}
nI|| }	||d}
|
dkr�d}
n|
dks�|
r�d}
n|	r�|j|	�dkr�|
||	<q�q�W||_Wn$tk
rUt	j
�d|_nXdS(s+Sets properties and text given a text fieldiiR&i����R$R%N(RoRdR�R�tfindR�RBR#R(R�R�(R*RoRDtendR�tstrsR�R�teindexR0R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytsetTextis8	

	
		


cC@s|jS(s
Type accessor(R2(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR?�scC@sT|jdk	rM|jjd|j�rM|jt|j�t|j�d S|jS(s
Name accessorR�iN(R2RBR1RHRd(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetName�s(%cC@s|jS(sAddress accessor(Rb(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt
getAddress�scC@s|jS(s
Port accessor(Rs(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetPort�scC@s|jS(sPriority accessor(Rq(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetPriority�scC@s|jS(sWeight accessor(Rr(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt	getWeight�scC@s|jS(sProperties accessor(R#(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt
getProperties�scC@s|jS(s
Text accessor(Ro(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetText�scC@s|jS(sServer accessor(Rt(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt	getServer�scC@s|dk	r|j|�r|jtkrO|j|jkr|j|_qq|jtkr�|j|jkr|j|_|j|_|j	|_	|j
|_
|j|||jj
|jtt��qq|jtkr|j|jkr|j|j�qqndS(s-Updates service information from a DNS recordN(RBR[R2R�R1RtRbR�RsRrRqRR�R�RR�R.Ro(R*R�RYRT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�s c	C@s�t�}t}||}||}d}z�|j|t|jtt��xu|jdks{|j	dks{|j
dkr�||kr�dS||kr�tt�}|j
t|jtt��|j|jj|jtt�|�|j
t|jtt��|j|jj|jtt�|�|jdk	rx|j
t|jtt��|j|jj|jtt�|�n|j|�||}|d}n|jt||�|�t�}qNWd}Wd|j|�X|S(s�Returns true if the service could be discovered on the
        network, and updates this object with details discovered.
        iiiN(Rt_LISTENER_TIMERRGR1RIRRtRBRbRoR�R�R�R�R�R�R�R�R�RR�RtremoveListener(	R*R�R�RYRR�tlastRDR^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytrequest�sT	


!







cC@s#t|t�r|j|jkSdS(sTests equality of service namei(R7RR1(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR9�scC@s|j|�S(sNon-equality test(R9(R*R8((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR:scC@s�d|jtj|j��|jf}|jdkrD|d7}n:t|j�dkri||j7}n||jd d7}|d7}|S(sString representationsservice[%s,%s:%s,RBiis...RAN(R1ReRfR0RsRoRBRd(R*RD((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRMs%

N(R!R"RFRBR)R"R.R?R/R0R1R2R3R4R5R6RR:R9R:RM(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR/s&			%											2		cB@s�eZdZdd�Zd�Zd�Zd�Zd�Zdd�Z	d�Z
d	�Zed
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zeed�Zd�ZRS(s�Implementation of Zeroconf Multicast DNS Service Discovery

    Supports registration, unregistration, queries and browsing.
    cC@s�dt�d<|dkr4tjtj��|_n	||_dtf|_tjtjtj	�|_y<|jj
tjtjd�|jj
tjtj
d�Wntk
r�nX|jj
tjtjd�|jj
tjtjd�y|jj|j�Wntk
rnX|jj
tjtjtjt�tjd��g|_g|_i|_i|_t�|_tj�|_t|�|_ t!|�|_"t#|�|_$dS(	sxCreates an instance of the Zeroconf class, establishing
        multicast communications, listening and reaping threads.iRR�is�ss0.0.0.0N(%R�RBRet
gethostbynametgethostnametintfRtgrouptAF_INETt
SOCK_DGRAMt
setsockoptt
SOL_SOCKETtSO_REUSEADDRtSO_REUSEPORTR(tSOL_IPtIP_MULTICAST_TTLtIP_MULTICAST_LOOPtbindtIP_ADD_MEMBERSHIPt	inet_atonRt	listenerstbrowsersR
tservicetypesR�R�R�R�R�R�R�R�RR
treaper(R*tbindaddress((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR)s8
	 

				cC@s|jjd�S(Ns	127.0.0.1(R=t
startswith(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt
isLoopbackIscC@s|jjd�S(Ns169.254.(R=RP(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytisLinklocalLscC@s2|jj�|jj|d�|jj�dS(sRCalling thread waits for a given number of milliseconds or
        until notified.i�N(R�R�R�R�(R*R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�Os
cC@s+|jj�|jj�|jj�dS(sNotifies all waiting threadsN(R�R�RR�(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRVs

i�cC@s)t||�}|j||�r%|SdS(s�Returns network's service information for a particular
        name and type, or None if no service matches by the timeout,
        which defaults to 3 seconds.N(RR:RB(R*R2R1R�R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytgetServiceInfo\scC@s-|j|�|jjt|||��dS(s�Adds a listener for a particular service type.  This object
        will then have its updateRecord method called when information
        arrives for that type.N(tremoveServiceListenerRLR�R(R*R2R((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytaddServiceListeneres
cC@s7x0|jD]%}|j|kr
|j�~q
q
WdS(s<Removes a listener from the set that is currently listening.N(RLRR(R*Rtbrowser((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRTls
c
C@s�|j|�||j|jj�<|j|jkrN|j|jcd7<nd|j|j<t�}|}d}x+|dkr�||kr�|j||�t�}qvntt	t
B�}|jt|jt
t||j�d�|jt|jtt||j|j|j|j�d�|jt|jtt||j�d�|jr||jt|jtt||j�d�n|j|�|d7}|t7}qvWdS(sRegisters service information to the network with a default TTL
        of 60 seconds.  Zeroconf will then respond to requests for
        information for that service.  The name of the service may be
        changed if needed to make it unique on the network.iiiN(tcheckServiceR
R1R/R2RMRR�R�R�t	_FLAGS_AAR�RkR�RRpR�RqRrRsRtRnR�RoRbRaR�Rt_REGISTER_TIME(R*R�RORYRR�R^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytregisterServicess>
					

c
C@s�yS|j|jj�=|j|jdkrE|j|jcd8<n
|j|j=Wntk
rfnXt�}|}d}x+|dkr�||kr�|j||�t�}qntt	t
B�}|jt|jt
td|j�d�|jt|jttd|j|j|j|j�d�|jt|jttd|j�d�|jr�|jt|jttd|j�d�n|j|�|d7}|t7}qWdS(sUnregister a service.iiiN(R
R1R/RMR2R<RR�R�R�RXR�RkR�RRpR�RqRrRsRnR�RoRbRaRtR�Rt_UNREGISTER_TIME(R*R�RYRR�R^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytunregisterService�s>
		"		

cC@syt|j�dkrut�}|}d}xH|dkrq||kre|j||�t�}q-ntttB�}x�|jj�D]�}|jt	|j
ttd|j
�d�|jt|j
ttd|j|j|j|j�d�|jt|j
ttd|j�d�|jr�|jt|jttd|j�d�q�q�W|j|�|d7}|t7}q-WndS(s#Unregister all registered services.iiiN(RdR
RR�R�R�RXR�R�RkR2R�RR1RpR�RqRrRsRtRnR�RoRbRaR�RR[(R*RYRR�R^R�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pytunregisterAllServices�s4			

cC@s{t�}|}d}x_|dkrvx�|jj|j�D]�}|jtkr:|j|�r:|j|jkr:|jjd�dkr�d|j|j	|j
|jf|_|j|�dSt�q:q:W||kr�|j
||�t�}qntttB�}||_|jt|jtt��|jt|jttt|j��|j|�|d7}|t7}qWdS(snChecks the network for a unique service name, modifying the
        ServiceInfo passed in if it is not unique.iiR�s
%w.[%s:%d].%sNi(RR�R�R2R�R[RlR1R*RbRsRWR#R�R�R�RXtdebugR�RGRR�Rkt_DNS_TTLRt_CHECK_TIME(R*R�RYRR�RTR^((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRW�s2	"

		

cC@s�t�}|jj|�|dk	r}xU|jj|j�D];}|j|�r;|j|�r;|j	|||�q;q;Wn|j
�dS(s�Adds a listener for a given question.  The listener will have
        its updateRecord method called when information is available to
        answer the question.N(RRKR�RBR�R�R1RKR[RR(R*RRLRYRT((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR�s	cC@s6y|jj|�|j�Wntk
r1nXdS(sRemoves a listener.N(RKR�RR((R*R((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR8s

cC@s5x$|jD]}|j|||�q
W|j�dS(sNUsed to notify listeners of new information that has updated
        a record.N(RKRR(R*RYRJR((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR
scC@s�t�}x�|jD]�}|j|�}||jj�kr�|rV|jj|�q�|jj|�}|dk	r�|j|�|}q�n|jj	|�|j
||�qWdS(slDeal with incoming response packets.  All answers
        are held in the cache, and listeners are notified.N(RRQR[R�R�R�R�RBR]R�R(R*RSRYRTRR�((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRs	
cC@sad}|tkrItttBd�}x!|jD]}|j|�q/Wnx�|jD]�}|jtkrN|j	dkr�x[|j
j�D]G}|dkr�tttB�}n|j|t
dttt|��q�WnxJ|jj�D]b}|j	|jkr�|dkrtttB�}n|j|t
|jttt|j	��q�q�WqSy�|dkrptttB�}n|jtks�|jtkr�xa|jj�D]M}|j|j	j�kr�|j|t|j	tttBt|j��q�q�Wn|jj|j	j�d�}|swSn|jtks:|jtkr{|j|t|j	tttBt|j|j|j|j��n|jtks�|jtkr�|j|t |j	tttBt|j!��n|jtkr|j"t|jtttBt|j��nWqSt#k
r!t$j%�qSXqSW|dk	r]|j&r]|j'|_'|j(|||�ndS(sKDeal with incoming query packets.  Provides a response if
        possible.is_services._dns-sd._udp.local.N()RBRR�R�RXRyR�R2R�R1RMR�R�RkRR_R
R�R�RIRtR/RaR5RbR�R�RpRqRrRsR�RnRoR�R(R�R�RQR�R(R*RSRRsR^RLtstypetservice((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyR$sr				
cC@s>y&|jj|j�d||f�Wntk
r9nXdS(sSends an outgoing packet.iN(RetsendtoR�R((R*R^RRs((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRks&
cC@s�t�ddkr�dt�d<|j�|jj�|j�|jjtjtjtj	t
�tj	d��|jj�ndS(s^Ends the background threads, and prevent this instance from
        servicing further queries.Riis0.0.0.0N(R�RR�R�R]ReRAREtIP_DROP_MEMBERSHIPRJRtclose(R*((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyReus



N(R!R"RFRBR)RQRRR�RRSRURTR_RZR\R]RWRR8RRRRRRRe(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyRs(0							&	#							G
t__main__s3Multicast DNS Service Discovery for Python, versions'1. Testing registration of a service...s0.10tversions
test values
another valuetbs_http._tcp.local.s!My Service Name._http._tcp.local.s	127.0.0.1i�s   Registering service...s   Registration done.s*2. Testing query of service information...s   Getting ZOE service:sZOE._http._tcp.local.s   Query done.s"3. Testing query of own service...s   Getting self:s/4. Testing unregister of service information...s   Unregister done.(jt
__future__RRt
__author__t	__email__t__version__RR�R�ReR.R�R�RR�t__all__R�R[R`RYR7RRRRR_t_MAX_MSG_TYPICALR�R�R�R�RXt	_FLAGS_TCt	_FLAGS_RDt	_FLAGS_RAt_FLAGS_Zt	_FLAGS_ADt	_FLAGS_CDRt	_CLASS_CSt	_CLASS_CHt	_CLASS_HSt_CLASS_NONEt
_CLASS_ANYR3R5R�t_TYPE_NSt_TYPE_MDt_TYPE_MFR�t	_TYPE_SOAt_TYPE_MBt_TYPE_MGt_TYPE_MRt
_TYPE_NULLt	_TYPE_WKSR�R�t_TYPE_MINFOt_TYPE_MXR�R�R�RIR;R>RR(R R#R$R%R&R'R,tobjectR-RGRNRaRgRkRnRpRvR�R�R�R�R�R
RRRR!tprinttrtdescRJR�RZR�RSR\Re(((s=/usr/lib64/python2.7/site-packages/hgext/zeroconf/Zeroconf.pyt<module>sN





	2>��4A(R��q