Ë
    R/jr  ã                  ó   — d Z ddlmZ ddlZddlZddlZddlZddlZddlm	Z	 ddl
mZ ddlmZ ddlmZmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8 ddl9m:Z: ddl;m<Z<m=Z=m>Z>m?Z?m@Z@mAZA ddlBmCZCmDZD ddlEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZT dZUdZVdZWdZX	 d#	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d$d „ZY G d!„ d"e«      ZZy)%a‡  Multicast DNS Service Discovery for Python, v0.14-wmcbrine
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine

This module provides a framework for the use of DNS Service Discovery
using IP multicast.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
é    )ÚannotationsN)Ú	Awaitable)ÚTracebackTypeé   )ÚDNSCache)ÚDNSQuestionÚDNSQuestionType)ÚAsyncEngine)ÚNonUniqueNameExceptionÚNotRunningException)ÚMulticastOutgoingQueue)ÚQueryHandler)ÚRecordManager)ÚQuestionHistory)ÚQuietLoggerÚlog)ÚDNSOutgoing)ÚServiceListener)ÚServiceBrowser)ÚAsyncServiceInfoÚServiceInfoÚinstance_name_from_service_info)ÚServiceRegistry)Ú_WrappedTransport)ÚRecordUpdateListener)Ú_resolve_all_futures_to_noneÚawait_awaitableÚget_running_loopÚrun_coro_with_timeoutÚshutdown_loopÚwait_for_future_set_or_timeoutÚwait_future_or_timeout)Úservice_type_name)ÚInterfaceChoiceÚInterfacesTypeÚ	IPVersionÚautodetect_ip_versionÚcan_send_toÚcreate_sockets)Úcurrent_time_millisÚmillis_to_seconds)Ú_CHECK_TIMEÚ	_CLASS_INÚ_CLASS_UNIQUEÚ	_FLAGS_AAÚ_FLAGS_QR_QUERYÚ_FLAGS_QR_RESPONSEÚ_MAX_MSG_ABSOLUTEÚ
_MDNS_ADDRÚ_MDNS_ADDR6Ú
_MDNS_PORTÚ_ONE_SECONDÚ_REGISTER_TIMEÚ_STARTUP_TIMEOUTÚ	_TYPE_PTRÚ_UNREGISTER_TIMEiô  éÈ   é   )é–   éú   c                ón  — |j                   }|€|rt        nt        }	n|}	t        ||	«      sy | rEt	        j
                  d|	|xs t        |j                  |j                  t        |«      |dz   ||«	       |r|s|j                  \  }
}
}}||f}|j                  j                  ||	|xs t        g|¢­«       y )NzCSending to (%s, %d) via [socket %s (%s)] (%d bytes #%d) %r as %r...r   )Úis_ipv6r4   r3   r(   r   Údebugr5   ÚfilenoÚ	sock_nameÚlenÚ	transportÚsendto)Ú	log_debugrE   ÚpacketÚ
packet_numÚoutÚaddrÚportÚv6_flow_scopeÚipv6_socketÚ	real_addrÚ_Úsock_flowinfoÚsock_scopeids                ú@/home/josh/.local/lib/python3.12/site-packages/zeroconf/_core.pyÚasync_send_with_transportrT   s   s¼   € ð ×#Ñ#€KØ€|Ù#.•K´J‰	àˆ	Ü˜;¨	Ô2ØÙÜ�	‰	ØQØØÒ”JØ×ÑØ×ÑÜ�‹KØ˜‰NØØô
	
ñ ™=Ø,5×,?Ñ,?Ñ)ˆˆ1ˆm˜\Ø&¨Ð5ˆØ×Ñ×Ñ˜v¨	°4Ò3E¼:Ð'VÈÑ'VÕWó    c                  óÌ  — e Zd ZdZej
                  ddddf	 	 	 	 	 	 	 	 	 	 	 d-d„Zed.d„«       Zd/d„Z	d/d„Z
efd0d„Zed1d	„«       Zd0d
„Zd/d„Zd/d„Z	 	 d2	 	 	 	 	 	 	 	 	 d3d„Zd4d„Zd5d„Zd/d„Z	 	 	 	 d6	 	 	 	 	 	 	 	 	 	 	 d7d„Z	 	 	 	 d6	 	 	 	 	 	 	 	 	 	 	 d8d„Zd9d„Zd:d„Z	 	 d2	 	 	 	 	 	 	 	 	 d;d„Z	 d<	 	 	 	 	 	 	 	 	 d=d„Z	 d<	 	 	 	 	 	 	 d>d„Zd?d„Z	 d<	 	 	 	 	 	 	 	 	 d@d„Zd9d„Zd:d„ZdAd„Z d/d„Z!d/d„Z"	 	 dB	 	 	 	 	 	 	 	 	 dCd„Z#	 	 	 	 	 	 dDd „Z$dEd!„Z%	 	 	 	 	 	 dDd"„Z&dEd#„Z'de(d$df	 	 	 	 	 	 	 	 	 	 	 dFd%„Z)de(d$df	 	 	 	 	 	 	 	 	 	 	 dFd&„Z*d/d'„Z+d/d(„Z,d/d)„Z-d/d*„Z.dGd+„Z/	 	 	 	 	 	 	 	 dHd,„Z0y)IÚZeroconfz�Implementation of Zeroconf Multicast DNS Service Discovery

    Supports registration, unregistration, queries and browsing.
    FNc                ó’  — |€t        |«      }d| _        |rt        j                  dk7  rt	        d«      ‚|du rt        «       €t	        d«      ‚|| _        || _        t        ||||¬«      \  }}t        j                  d||«       t        | ||«      | _        i | _        t        «       | _        t!        «       | _        t%        «       | _        t)        | d	t*        «      | _        t)        | t.        t0        «      | _        t5        | «      | _        t9        | «      | _        t=        «       | _        d| _         d| _!        | jE                  «        y)
a`  Creates an instance of the Zeroconf class, establishing
        multicast communications, listening and reaping threads.

        :param interfaces: :class:`InterfaceChoice` or a list of IP addresses
            (IPv4 and IPv6) and interface indexes (IPv6 only).

            IPv6 notes for non-POSIX systems:
            * `InterfaceChoice.All` is an alias for `InterfaceChoice.Default`
              on Python versions before 3.8.

            Also listening on loopback (``::1``) doesn't work, use a real address.
        :param ip_version: IP versions to support. If `choice` is a list, the default is detected
            from it. Otherwise defaults to V4 only for backward compatibility.
        :param apple_p2p: use AWDL interface (only macOS)
        :param use_asyncio: explicitly control whether to attach to the running
            asyncio event loop (``True``) or run an internal thread with its
            own loop (``False``). ``None`` (default) keeps the historic
            behavior: attach if an event loop is running, otherwise start a
            thread. Set to ``False`` when running inside an environment that
            already has an event loop (e.g. Jupyter) but you want blocking
            semantics. ``True`` raises :class:`RuntimeError` immediately if no
            running event loop is found, instead of falling back to the thread.
        NFÚdarwinz;Option `apple_p2p` is not supported on non-Apple platforms.Tz6use_asyncio=True requires a running asyncio event loop)Ú	apple_p2pz$Listen socket %s, respond sockets %sr   )#r'   ÚdoneÚsysÚplatformÚRuntimeErrorr   ÚunicastÚ_use_asyncior)   r   rA   r
   ÚengineÚbrowsersr   Úregistryr   Úcacher   Úquestion_historyr   Ú_AGGREGATION_DELAYÚ	out_queuer6   Ú_PROTECTED_AGGREGATION_DELAYÚout_delay_queuer   Úquery_handlerr   Úrecord_managerÚsetÚ_notify_futuresÚloopÚ_loop_threadÚstart)ÚselfÚ
interfacesr_   Ú
ip_versionrZ   Úuse_asyncioÚlisten_socketÚrespond_socketss           rS   Ú__init__zZeroconf.__init__ž   s  € ð> ÐÜ.¨zÓ:ˆJàˆŒ	áœŸ™¨Ò1ÜÐ\Ó]Ð]à˜$ÑÔ#3Ó#5Ð#=ÜÐWÓXÐXàˆŒØ'ˆÔÜ)7¸
ÀGÈZÐclÔ)mÑ&ˆ�Ü�	‰	Ð8¸-ÈÔYä! $¨°ÓGˆŒà?AˆŒÜ'Ó)ˆŒÜ“ZˆŒ
Ü /Ó 1ˆÔä/°°aÔ9KÓLˆŒÜ5°d¼KÔIeÓfˆÔä)¨$Ó/ˆÔÜ+¨DÓ1ˆÔä47³EˆÔØ6:ˆŒ	Ø59ˆÔà�
‰
�rU   c                óö   — | j                   j                  }t        | j                   xrL |xrH |j                  «       xr6 |j	                  «        xr# |j                  «        xr |j                  «       «      S )z"Check if the instance has started.)ra   Úrunning_futureÚboolr[   Ú	cancelledÚ	exceptionÚresult)rq   ry   s     rS   ÚstartedzZeroconf.startedà   s�   € ð Ÿ™×3Ñ3ˆÜØ—	‘	ˆMò (Øò(à×#Ñ#Ó%ò(ð #×,Ñ,Ó.Ð.ò(ð #×,Ñ,Ó.Ð.ò	(ð
 ×%Ñ%Ó'ó
ð 	
rU   c                óÈ   — | j                   du rdn	t        «       | _        | j                  r'| j                  j	                  | j                  d«       y| j                  «        y)zStart Zeroconf.FN)r`   r   rn   ra   ÚsetupÚ_start_thread©rq   s    rS   rp   zZeroconf.startí   sJ   € à ×-Ñ-°Ñ6‘DÔ<LÓ<NˆŒ	Ø�9Š9Ø�K‰K×Ñ˜dŸi™i¨Ô.ØØ×ÑÕrU   c                óÊ   ‡ ‡— t        j                  «       Šdˆˆ fd„}t        j                  |d¬«      ‰ _        ‰ j                  j	                  «        ‰j                  «        y)z)Start a thread with a running event loop.c                 óö   •— t        j                  «       ‰_        t        j                  ‰j                  «       ‰j                  j                  ‰j                  ‰ «       ‰j                  j                  «        y ©N)ÚasyncioÚnew_event_looprn   Úset_event_loopra   r€   Úrun_forever)Úloop_thread_readyrq   s   €€rS   Ú	_run_loopz)Zeroconf._start_thread.<locals>._run_loopù   sN   ø€ Ü×.Ñ.Ó0ˆDŒIÜ×"Ñ" 4§9¡9Ô-Ø�K‰K×Ñ˜dŸi™iÐ):Ô;Ø�I‰I×!Ñ!Õ#rU   T)ÚtargetÚdaemonN©ÚreturnÚNone)Ú	threadingÚEventÚThreadro   rp   Úwait)rq   r‹   rŠ   s   ` @rS   r�   zZeroconf._start_threadõ   sJ   ù€ ä%ŸO™OÓ-Ðö	$ô &×,Ñ,°IÀdÔKˆÔØ×Ñ×ÑÔ!Ø×ÑÕ rU   c              ƒ  óÚ   K  — | j                   rt        ‚| j                  j                  €J ‚t	        | j                  j                  |¬«      ƒ d{  –—†  | j
                  st        ‚y7 Œ­w)z´Wait for start up for actions that require a running Zeroconf instance.

        Throws NotRunningException if the instance is not running or could
        not be started.
        N)Útimeout)r[   r   ra   ry   r"   r~   )rq   r–   s     rS   Úasync_wait_for_startzZeroconf.async_wait_for_start  s]   è ø€ ð �9Š9Ü%Ð%Ø�{‰{×)Ñ)Ð5Ð5Ð5Ü$ T§[¡[×%?Ñ%?ÈÔQ×QÐQØ�|Š|Ü%Ð%ð ð 	Rús   ‚AA+ÁA)ÁA+c                ó.   — | j                   j                  S r…   )rk   Ú	listenersr‚   s    rS   r™   zZeroconf.listeners  s   € à×"Ñ"×,Ñ,Ð,rU   c              ƒ  ón   K  — | j                   }|€J ‚t        || j                  |«      ƒ d{  –—†  y7 Œ­w)zHCalling task waits for a given number of milliseconds or until notified.N)rn   r!   rm   )rq   r–   rn   s      rS   Ú
async_waitzZeroconf.async_wait  s3   è ø€ à�y‰yˆØÐÐÐÜ,¨T°4×3GÑ3GÈÓQ×QÒQús   ‚+5­3®5c                ój   — | j                   €J ‚| j                   j                  | j                  «       y)z2Notifies all waiting threads and notify listeners.N)rn   Úcall_soon_threadsafeÚasync_notify_allr‚   s    rS   Ú
notify_allzZeroconf.notify_all  s*   € à�y‰yÐ$Ð$Ð$Ø�	‰	×&Ñ& t×'<Ñ'<Õ=rU   c                ó8   — | j                   }|rt        |«       yy)zSchedule an async_notify_all.N)rm   r   )rq   Únotify_futuress     rS   rž   zZeroconf.async_notify_all  s   € à×-Ñ-ˆÙÜ(¨Õ8ð rU   c                óF   — t        ||«      }|j                  | ||«      r|S y©a±  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.

        :param type_: fully qualified service type name
        :param name: the name of the service
        :param timeout: milliseconds to wait for a response
        :param question_type: The type of questions to ask (DNSQuestionType.QM or DNSQuestionType.QU)
        N)r   Úrequest©rq   Útype_Únamer–   Úquestion_typeÚinfos         rS   Úget_service_infozZeroconf.get_service_info%  s(   € ô  ˜5 $Ó'ˆØ�<‰<˜˜g }Ô5ØˆKØrU   c                óZ   — | j                  |«       t        | ||«      | j                  |<   y)zÉAdds a listener for a particular service type.  This object
        will then have its add_service and remove_service methods called when
        services of that type become available and unavailable.N)Úremove_service_listenerr   rb   )rq   r¦   Úlisteners      rS   Úadd_service_listenerzZeroconf.add_service_listener:  s)   € ð 	×$Ñ$ XÔ.Ü"0°°u¸hÓ"Gˆ�‰�hÒrU   c                óv   — || j                   v r+| j                   |   j                  «        | j                   |= yy©z<Removes a listener from the set that is currently listening.N)rb   Úcancel©rq   r­   s     rS   r¬   z Zeroconf.remove_service_listenerA  s4   € à�t—}‘}Ñ$Ø�M‰M˜(Ñ#×*Ñ*Ô,Ø—‘˜hÑ'ð %rU   c                óZ   — t        | j                  «      D ]  }| j                  |«       Œ yr°   )Úlistrb   r¬   r²   s     rS   Úremove_all_service_listenersz%Zeroconf.remove_all_service_listenersG  s(   € ä˜TŸ]™]Ó+ò 	3ˆHØ×(Ñ(¨Õ2ñ	3rU   c                óœ   — | j                   €J ‚t        t        | j                  |||||«      «      | j                   t        t
        z  «       y)aq  Registers service information to the network with a default TTL.
        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. Additionally multiple cooperating responders
        can register the same service on the network for resilience
        (if you want this behavior set `cooperating_responders` to `True`).

        While it is not expected during normal operation,
        this function may raise EventLoopBlocked if the underlying
        call to `register_service` cannot be completed.
        N)rn   r   r   Úasync_register_servicer7   Ú_REGISTER_BROADCASTS©rq   r©   ÚttlÚallow_name_changeÚcooperating_respondersÚstricts         rS   Úregister_servicezZeroconf.register_serviceL  sO   € ð& �y‰yÐ$Ð$Ð$ÜÜØ×+Ñ+¨D°#Ð7HÐJ`ÐbhÓióð �I‰IÜÔ1Ñ1õ	
rU   c              ƒ  óD  K  — |�||_         ||_        |j                  «        | j                  «       ƒ d{  –—†  | j	                  ||||«      ƒ d{  –—†  | j
                  j                  |«       t        j                  | j                  |t        d«      «      S 7 Œe7 ŒK­w)a²  Registers service information to the network with a default TTL.
        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. Additionally multiple cooperating responders
        can register the same service on the network for resilience
        (if you want this behavior set `cooperating_responders` to `True`).N)Úhost_ttlÚ	other_ttlÚset_server_if_missingr—   Úasync_check_servicerc   Ú	async_addr†   Úensure_futureÚ_async_broadcast_servicer7   r¹   s         rS   r·   zZeroconf.async_register_serviceh  s”   è ø€ ð ˆ?ð  ˆDŒMØ ˆDŒNà×"Ñ"Ô$Ø×'Ñ'Ó)×)Ð)Ø×&Ñ& tÐ->Ð@VÐX^Ó_×_Ð_Ø�‰×Ñ Ô%Ü×$Ñ$ T×%BÑ%BÀ4ÌÐY]Ó%^Ó_Ð_ð 	*øØ_ús"   ‚4B ¶B·B ÁBÁA
B ÂB c                ó”   — | j                   €J ‚t        t        | j                  |«      «      | j                   t        t
        z  «       y)a\  Registers service information to the network with a default TTL.
        Zeroconf will then respond to requests for information for that
        service.

        While it is not expected during normal operation,
        this function may raise EventLoopBlocked if the underlying
        call to `async_update_service` cannot be completed.
        N)rn   r   r   Úasync_update_servicer7   r¸   ©rq   r©   s     rS   Úupdate_servicezZeroconf.update_service‚  s?   € ð �y‰yÐ$Ð$Ð$ÜÜ˜D×5Ñ5°dÓ;Ó<Ø�I‰IÜÔ1Ñ1õ	
rU   c              ƒ  ó”   K  — | j                   j                  |«       t        j                  | j	                  |t
        d«      «      S ­w)z™Registers service information to the network with a default TTL.
        Zeroconf will then respond to requests for information for that
        service.N)rc   Úasync_updater†   rÅ   rÆ   r7   rÉ   s     rS   rÈ   zZeroconf.async_update_service’  s;   è ø€ ð 	�‰×"Ñ" 4Ô(Ü×$Ñ$ T×%BÑ%BÀ4ÌÐY]Ó%^Ó_Ð_ùs   ‚AAc              ƒ  ób   K  — t        ||«      }|j                  | ||«      ƒ d{  –—† r|S y7 Œ­wr£   )r   Úasync_requestr¥   s         rS   Úasync_get_service_infozZeroconf.async_get_service_info™  s:   è ø€ ô     tÓ,ˆØ×#Ñ# D¨'°=ÓA×AÐAØˆKØð Bús   ‚#/¥-¦/c              ƒ  óÒ   K  — t        t        «      D ]O  }|dk7  r&t        j                  t	        |«      «      ƒ d{  –—†  | j                  | j                  |||«      «       ŒQ y7 Œ)­w)z5Send a broadcasts to announce a service at intervals.r   N)Úranger¸   r†   Úsleepr+   Ú
async_sendÚgenerate_service_broadcast)rq   r©   Úintervalrº   Úbroadcast_addressesÚis         rS   rÆ   z!Zeroconf._async_broadcast_service®  s]   è ø€ ô Ô+Ó,ò 	]ˆAØ�AŠvÜ—m‘mÔ$5°hÓ$?Ó@×@Ð@Ø�O‰O˜D×;Ñ;¸DÀ#ÐGZÓ[Õ\ñ	]à@ús   ‚9A'»A%¼*A'c                óZ   — t        t        t        z  «      }| j                  ||||«       |S )z+Generate a broadcast to announce a service.)r   r1   r/   Ú_add_broadcast_answer)rq   r©   rº   rÖ   rJ   s        rS   rÔ   z#Zeroconf.generate_service_broadcast»  s.   € ô Ô,¬yÑ8Ó9ˆØ×"Ñ" 3¨¨cÐ3FÔGØˆ
rU   c                óÚ   — t        t        t        z  «      }|j                  t	        |j
                  t        t        t        z  «      «       |j                  |j                  «       «       |S )z%Generate a query to lookup a service.)r   r0   r/   Úadd_questionr   Útyper9   r-   r.   Úadd_authorative_answerÚdns_pointer)rq   r©   rJ   s      rS   Úgenerate_service_queryzZeroconf.generate_service_queryÆ  sO   € äœ/¬IÑ5Ó6ˆð 	×Ñœ T§Y¡Y´	¼9Ä}Ñ;TÓUÔVØ×"Ñ" 4×#3Ñ#3Ó#5Ô6Øˆ
rU   c                óT  — t        «        |€dn|}|€dn|}|j                  |j                  |¬«      d«       |j                  |j                  |¬«      d«       |j                  |j	                  |¬«      d«       |r*|j                  |¬«      D ]  }|j                  |d«       Œ yy)z#Add answers to broadcast a service.N)Úoverride_ttlr   )r*   Úadd_answer_at_timerÞ   Údns_serviceÚdns_textÚget_address_and_nsec_records)rq   rJ   r©   rá   rÖ   rÁ   rÀ   Úrecords           rS   rÙ   zZeroconf._add_broadcast_answerÕ  s®   € ô 	ÔØ(Ð0‘D°lˆ	Ø'Ð/‘4°\ˆØ×Ñ˜t×/Ñ/¸YÐ/ÓGÈÔKØ×Ñ˜t×/Ñ/¸XÐ/ÓFÈÔJØ×Ñ˜tŸ}™}¸)˜}ÓDÀaÔHÙØ×;Ñ;ÈÐ;ÓRò 2�Ø×&Ñ& v¨qÕ1ñ2ð rU   c                ó‚   — | j                   €J ‚t        | j                  |«      | j                   t        t        z  «       y)zÜUnregister a service.

        While it is not expected during normal operation,
        this function may raise EventLoopBlocked if the underlying
        call to `async_unregister_service` cannot be completed.
        N)rn   r   Úasync_unregister_servicer:   r¸   rÉ   s     rS   Úunregister_servicezZeroconf.unregister_serviceç  s:   € ð �y‰yÐ$Ð$Ð$ÜØ×)Ñ)¨$Ó/Ø�I‰IÜÔ3Ñ3õ	
rU   c              ƒ  ó4  K  — |j                  «        | j                  j                  |«       |j                  €J ‚| j                  j	                  |j                  «      }t        |«       }t        j                  | j                  |t        d|«      «      S ­w)zUnregister a service.r   )
rÂ   rc   Úasync_removeÚ
server_keyÚasync_get_infos_serverrz   r†   rÅ   rÆ   r:   )rq   r©   ÚentriesrÖ   s       rS   rè   z!Zeroconf.async_unregister_serviceõ  s„   è ø€ à×"Ñ"Ô$Ø�‰×"Ñ" 4Ô(ð �‰Ð*Ð*Ð*Ø—-‘-×6Ñ6°t·±ÓGˆÜ"& w£-Ð/ÐÜ×$Ñ$Ø×)Ñ)¨$Ô0@À!ÐEXÓYó
ð 	
ùs   ‚BBc                óÖ   — | j                   j                  «       }|syt        t        t        z  «      }|D ]  }| j                  ||d«       Œ | j                   j                  |«       |S )zRGenerate a DNSOutgoing goodbye for all services and remove them from the registry.Nr   )rc   Úasync_get_service_infosr   r1   r/   rÙ   rë   )rq   Úservice_infosrJ   r©   s       rS   Ú generate_unregister_all_servicesz)Zeroconf.generate_unregister_all_services  sb   € àŸ™×=Ñ=Ó?ˆÙØÜÔ,¬yÑ8Ó9ˆØ!ò 	5ˆDØ×&Ñ& s¨D°!Õ4ð	5à�‰×"Ñ" =Ô1Øˆ
rU   c              ƒ  óÞ   K  — | j                  «       }|syt        t        «      D ]B  }|dk7  r*t        j                  t        t        «      «      ƒ d{  –—†  | j                  |«       ŒD y7 Œ­w)zîUnregister all registered services.

        Unlike async_register_service and async_unregister_service, this
        method does not return a future and is always expected to be
        awaited since its only called at shutdown.
        Nr   )rò   rÑ   r¸   r†   rÒ   r+   r:   rÓ   )rq   rJ   r×   s      rS   Úasync_unregister_all_servicesz&Zeroconf.async_unregister_all_services  s`   è ø€ ð ×3Ñ3Ó5ˆÙØÜÔ+Ó,ò 	!ˆAØ�AŠvÜ—m‘mÔ$5Ô6FÓ$GÓH×HÐHØ�O‰O˜CÕ ñ	!àHús   ‚AA-ÁA+ÁA-c                ó€   — | j                   €J ‚t        | j                  «       | j                   t        t        z  «       y)zïUnregister all registered services.

        While it is not expected during normal operation,
        this function may raise EventLoopBlocked if the underlying
        call to `async_unregister_all_services` cannot be completed.
        N)rn   r   rô   r:   r¸   r‚   s    rS   Úunregister_all_servicesz Zeroconf.unregister_all_services  s8   € ð �y‰yÐ$Ð$Ð$ÜØ×.Ñ.Ó0Ø�I‰IÜÔ3Ñ3õ	
rU   c              ƒ  óÔ  K  — t        ||¬«      }|ry| j                  t        j                  t        Ž «      ƒ d{  –—†  d}t        «       x}}d}	|	t        k  �r| j                  j                  |j                  |j                  «      rr|st        ‚|› d|› d|j                  › �|_
        |dz  }t        |j                  |¬«       |}d}	| j                  j                  |j                  |j                  «      rŒr||k  r'| j                  ||z
  «      ƒ d{  –—†  t        «       }ŒØ| j                  | j                  |«      «       |	dz  }	|t        z  }|	t        k  r�Œyy7 �Œ(7 ŒM­w)znChecks the network for a unique service name, modifying the
        ServiceInfo passed in if it is not unique.)r½   Né   r   ú-ú.r   )r   r›   ÚrandomÚrandintÚ_PROBE_RANDOM_DELAY_INTERVALr*   r¸   rd   Ú!current_entry_with_name_and_aliasrÜ   r§   r   r#   rÓ   rß   r,   )
rq   r©   r»   r¼   r½   Úinstance_nameÚnext_instance_numberÚ	next_timeÚnowr×   s
             rS   rÃ   zZeroconf.async_check_service,  sJ  è ø€ ô 8¸ÀVÔLˆÙ!Øð �o‰oœfŸn™nÔ.JÐKÓL×LÐLà ÐÜ-Ó/Ð/ˆ	�CØˆØÔ&Ó&à—*‘*×>Ñ>¸t¿y¹yÈ$Ï)É)ÔTÙ(Ü0Ð0ð  -˜o¨QÐ/CÐ.DÀAÀdÇiÁiÀ[ÐQ�”	Ø$¨Ñ)Ð$Ü! $§)¡)°FÕ;Ø�	Ø�ð —*‘*×>Ñ>¸t¿y¹yÈ$Ï)É)ÕTð �YŠØ—o‘o i°#¡oÓ6×6Ð6Ü)Ó+�Øà�O‰O˜D×7Ñ7¸Ó=Ô>Ø�‰FˆAØœÑ$ˆIð) Ô&Ö&ð 	Mùð& 7ús/   ‚9E(»E#¼B?E(Ã<E(ÄE&ÄAE(Å!E(Å&E(c                ó‚   — | j                   €J ‚| j                   j                  | j                  j                  ||«       y)zÔAdds a listener for a given question.  The listener will have
        its update_record method called when information is available to
        answer the question(s).

        This function is threadsafe
        N)rn   r�   rk   Úasync_add_listener©rq   r­   Úquestions      rS   Úadd_listenerzZeroconf.add_listenerV  s7   € ð �y‰yÐ$Ð$Ð$Ø�	‰	×&Ñ& t×':Ñ':×'MÑ'MÈxÐYaÕbrU   c                ó€   — | j                   €J ‚| j                   j                  | j                  j                  |«       y)zARemoves a listener.

        This function is threadsafe
        N)rn   r�   rk   Úasync_remove_listenerr²   s     rS   Úremove_listenerzZeroconf.remove_listenerd  s5   € ð
 �y‰yÐ$Ð$Ð$Ø�	‰	×&Ñ& t×':Ñ':×'PÑ'PÐRZÕ[rU   c                ó<   — | j                   j                  ||«       y)zýAdds a listener for a given question.  The listener will have
        its update_record method called when information is available to
        answer the question(s).

        This function is not threadsafe and must be called in the eventloop.
        N)rk   r  r  s      rS   r  zZeroconf.async_add_listenerl  s   € ð 	×Ñ×.Ñ.¨x¸ÕBrU   c                ó:   — | j                   j                  |«       y)zjRemoves a listener.

        This function is not threadsafe and must be called in the eventloop.
        N)rk   r	  r²   s     rS   r	  zZeroconf.async_remove_listenery  s   € ð
 	×Ñ×1Ñ1°(Õ;rU   © c                ót   — | j                   €J ‚| j                   j                  | j                  |||||«       y)z$Sends an outgoing packet threadsafe.N)rn   r�   rÓ   )rq   rJ   rK   rL   rM   rE   s         rS   ÚsendzZeroconf.send€  s5   € ð �y‰yÐ$Ð$Ð$Ø�	‰	×&Ñ& t§¡¸¸TÀ4ÈÐXaÕbrU   c                óp  — | j                   ry|r|gn| j                  j                  }t        j                  t
        j                  «      }t        |j                  «       «      D ]O  \  }}	t        |	«      t        kD  r| j                  d|t        |	«      |	«        y|D ]  }
t        ||
|	|||||«       Œ ŒQ y)zSends an outgoing packet.Nz+Dropping %r over-sized packet (%d bytes) %r)r[   ra   Úsendersr   ÚisEnabledForÚloggingÚDEBUGÚ	enumerateÚpacketsrD   r2   Úlog_warning_oncerT   )rq   rJ   rK   rL   rM   rE   Ú
transportsrG   rI   rH   Úsend_transports              rS   rÓ   zZeroconf.async_sendŒ  s·   € ð �9Š9Øñ %.�i‘[°4·;±;×3FÑ3Fˆ
Ü×$Ñ$¤W§]¡]Ó3ˆ	ä"+¨C¯K©K«MÓ":ò 	ÑˆJ˜Ü�6‹{Ô.Ò.Ø×%Ñ%ØAØÜ˜“KØô	ñ Ø",ò 
�Ü)ØØ"ØØØØØØ!õ	ñ
ñ	rU   c                óL   — | j                   ry| j                  «        d| _         y)z1Set global done and remove all service listeners.NT)r[   rµ   r‚   s    rS   Ú_closezZeroconf._close²  s   € à�9Š9ØØ×)Ñ)Ô+Øˆ�	rU   c                ó0  — | j                   €J ‚| j                   j                  «       ry| j                  «        | j                  syt	        | j                   «       | j                  j                  «        d| _        | j                   j                  «        y)zShutdown any threads.N)rn   Ú	is_closedrŸ   ro   r    ÚjoinÚcloser‚   s    rS   Ú_shutdown_threadszZeroconf._shutdown_threads¹  ss   € à�y‰yÐ$Ð$Ð$Ø�9‰9×ÑÔ ð Ø�‰ÔØ× Ò ØÜ�d—i‘iÔ Ø×Ñ×ÑÔ Ø ˆÔð
 	�	‰	�‰ÕrU   c                óB  — | j                   €J ‚| j                   j                  «       r=| j                   t        «       k(  rt        j                  d«       n| j                  «        | j                  «        | j                  j                  «        | j                  «        y)zœEnds the background threads, and prevent this instance from
        servicing further queries.

        This method is idempotent and irreversible.
        NzWunregister_all_services skipped as it does blocking i/o; use AsyncZeroconf with asyncio)
rn   Ú
is_runningr   r   Úwarningrö   r  ra   r  r   r‚   s    rS   r  zZeroconf.closeÌ  sv   € ð �y‰yÐ$Ð$Ð$Ø�9‰9×ÑÔ!Ø�y‰yÔ,Ó.Ò.Ü—‘Ømõð ×,Ñ,Ô.Ø�‰ŒØ�‰×ÑÔØ×ÑÕ rU   c              ƒ  ó”   K  — | j                  «        | j                  j                  «       ƒ d{  –—†  | j                  «        y7 Œ­w)a>  Ends the background threads, and prevent this instance from
        servicing further queries.

        This method is idempotent and irreversible.

        This call only intended to be used by AsyncZeroconf

        Callers are responsible for unregistering all services
        before calling this function
        N)r  ra   Ú_async_closer   r‚   s    rS   r%  zZeroconf._async_closeÞ  s8   è ø€ ð 	�‰ŒØ�k‰k×&Ñ&Ó(×(Ð(Ø×ÑÕ ð 	)ús   ‚.A°A±Ac                ó   — | S r…   r  r‚   s    rS   Ú	__enter__zZeroconf.__enter__í  s   € ØˆrU   c                ó$   — | j                  «        y r…   )r  )rq   Úexc_typeÚexc_valÚexc_tbs       rS   Ú__exit__zZeroconf.__exit__ð  s   € ð 	�
‰
ŒØrU   )rr   r%   r_   rz   rs   zIPVersion | NonerZ   rz   rt   úbool | Noner�   r�   )r�   rz   rŽ   )r–   Úfloatr�   r�   )r�   zset[RecordUpdateListener])i¸  N)
r¦   Ústrr§   r/  r–   Úintr¨   úDNSQuestionType | Noner�   zServiceInfo | None)r¦   r/  r­   r   r�   r�   )r­   r   r�   r�   )NFFT)r©   r   rº   ú
int | Noner»   rz   r¼   rz   r½   rz   r�   r�   )r©   r   rº   r2  r»   rz   r¼   rz   r½   rz   r�   r   )r©   r   r�   r�   )r©   r   r�   r   )
r¦   r/  r§   r/  r–   r0  r¨   r1  r�   zAsyncServiceInfo | None)T)
r©   r   rÕ   r0  rº   r2  rÖ   rz   r�   r�   )r©   r   rº   r2  rÖ   rz   r�   r   )r©   r   r�   r   )
rJ   r   r©   r   rá   r2  rÖ   rz   r�   r�   )r�   zDNSOutgoing | None)FT)
r©   r   r»   rz   r¼   rz   r½   rz   r�   r�   )r­   r   r  z&DNSQuestion | list[DNSQuestion] | Noner�   r�   )r­   r   r�   r�   )rJ   r   rK   ú
str | NonerL   r0  rM   útuple[()] | tuple[int, int]rE   z_WrappedTransport | Noner�   r�   )r�   rW   )r)  ztype[BaseException] | Noner*  zBaseException | Noner+  zTracebackType | Noner�   r-  )1Ú__name__Ú
__module__Ú__qualname__Ú__doc__r$   ÚAllrw   Úpropertyr~   rp   r�   r8   r—   r™   r›   rŸ   rž   rª   r®   r¬   rµ   r¾   r·   rÊ   rÈ   rÏ   rÆ   rÔ   rß   rÙ   ré   rè   rò   rô   rö   rÃ   r  r
  r  r	  r5   r  rÓ   r  r   r  r%  r'  r,  r  rU   rS   rW   rW   ˜   s)  „ ñð &5×%8Ñ%8ØØ'+ØØ#'ð@à"ð@ð ð@ð %ð	@ð
 ð@ð !ð@ð 
ó@ðD ò

ó ð

óó!ð ;Kô &ð ò-ó ð-óRó>ó
9ð Ø04ðàðð ðð ð	ð
 .ðð 
óó*Hó(ó3ð Ø"'Ø',Øð
àð
ð ð
ð  ð	
ð
 !%ð
ð ð
ð 
ó
ð> Ø"'Ø',Øð`àð`ð ð`ð  ð	`ð
 !%ð`ð ð`ð 
ó`ó4
ó `ð Ø04ðàðð ðð ð	ð
 .ðð 
!óð4 %)ð]àð]ð ð]ð ð	]ð
 "ð]ð 
ó]ð" %)ð		àð	ð ð	ð "ð		ð
 
ó	óð( %)ð2àð2ð ð2ð !ð	2ð
 "ð2ð 
ó2ó$
ó
ó	ó!ó 
ð$ (-Øð(%àð(%ð  ð(%ð !%ð	(%ð
 ð(%ð 
ó(%ðTcà&ðcð 9ðcð 
ó	có\ðCà&ðCð 9ðCð 
ó	Có<ð  ØØ57Ø.2ð
càð
cð ð
cð ð	
cð
 3ð
cð ,ð
cð 
ó
cð  ØØ57Ø.2ð$àð$ð ð$ð ð	$ð
 3ð$ð ,ð$ð 
ó$óLóó&!ó$!óðà,ðð &ðð %ð	ð
 
ôrU   rW   )r  )rG   rz   rE   r   rH   ÚbytesrI   r0  rJ   r   rK   r3  rL   r0  rM   r4  r�   r�   )[r8  Ú
__future__r   r†   r  rû   r\   r‘   Úcollections.abcr   Útypesr   Ú_cacher   Ú_dnsr   r	   Ú_enginer
   Ú_exceptionsr   r   Ú"_handlers.multicast_outgoing_queuer   Ú_handlers.query_handlerr   Ú_handlers.record_managerr   Ú_historyr   Ú_loggerr   r   Ú_protocol.outgoingr   Ú	_servicesr   Ú_services.browserr   Ú_services.infor   r   r   Ú_services.registryr   Ú
_transportr   Ú_updatesr   Ú_utils.asyncior   r   r   r   r    r!   r"   Ú_utils.namer#   Ú
_utils.netr$   r%   r&   r'   r(   r)   Ú_utils.timer*   r+   Úconstr,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   rf   rh   r¸   rý   rT   rW   r  rU   rS   ú<module>rT     s1  ðñõ, #ã Û Û Û 
Û Ý %Ý å ß .Ý  ß DÝ FÝ 1Ý 3Ý %ß %Ý +Ý &Ý -÷ñ õ
 0Ý )Ý *÷÷ ñ õ +÷÷ ÷ @÷÷ ÷ ÷ ñ ð( Ð ð  #Ð àÐ ð  *Ð ð 24ð"XØð"Xà ð"Xð ð"Xð ð	"Xð
 
ð"Xð ð"Xð ð"Xð /ð"Xð 
ó"XôJ_	ˆ{õ _	rU   