Ë
    R/jÌ  ã                  óô   — d Z ddlmZ ddlmZmZ ddlmZmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZ eZeZ G d	„ d
e«      Z G d„ de	«      Z ed¬«      	 	 	 	 dd„«       ZeZeZ	 	 	 	 dd„Z	 	 	 	 	 	 dd„Zdd„ZdZy)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
é    )Úannotations)ÚcacheÚ	lru_cache)ÚAddressValueErrorÚIPv4AddressÚIPv6AddressÚNetmaskValueError)ÚAnyé   )Ú
DNSAddress)Ú
_TYPE_AAAAc                  ób   ‡ — e Zd ZdZdˆ fd„Zdd„Zed	d„«       Zed	d„«       Zed	d„«       Z	ˆ xZ
S )
ÚZeroconfIPv4Address©Ú__hash__Ú_is_link_localÚ_is_loopbackÚ_is_unspecifiedÚ_strÚ
zc_integerc                óì   •‡ — t        ‰‰ �  |i |¤Ž t         ‰‰ �	  «       ‰ _        t         ‰‰ �  ‰ _        t         ‰‰ �  ‰ _        t         ‰‰ �   ‰ _	        t        ˆ fd„«      ‰ _        t        ‰ «      ‰ _        y)zInitialize a new IPv4 address.c                 ó.   •— t        j                  ‰ «      S ©N)r   r   ©Úselfs   €úK/home/josh/.local/lib/python3.12/site-packages/zeroconf/_utils/ipaddress.pyú<lambda>z.ZeroconfIPv4Address.__init__.<locals>.<lambda>.   ó   ø€ ¤k×&:Ñ&:¸4Ó&@€ ó    N©ÚsuperÚ__init__Ú__str__r   Úis_link_localr   Úis_unspecifiedr   Úis_loopbackr   r   r   Úintr   ©r   ÚargsÚkwargsÚ	__class__s   `  €r   r"   zZeroconfIPv4Address.__init__'   ób   ù€ ä‰Ñ˜$Ð) &Ò)Ü‘G‘OÓ%ˆŒ	Ü#™gÑ3ˆÔÜ$™wÑ5ˆÔÜ!™GÑ/ˆÔÜÓ@ÓAˆŒÜ˜d›)ˆ�r   c                ó   — | j                   S )z5Return the string representation of the IPv4 address.©r   r   s    r   r#   zZeroconfIPv4Address.__str__1   ó   € à�y‰yÐr   c                ó   — | j                   S ©z,Return True if this is a link-local address.©r   r   s    r   r$   z!ZeroconfIPv4Address.is_link_local5   ó   € ð ×"Ñ"Ð"r   c                ó   — | j                   S ©z.Return True if this is an unspecified address.©r   r   s    r   r%   z"ZeroconfIPv4Address.is_unspecified:   ó   € ð ×#Ñ#Ð#r   c                ó   — | j                   S ©z#Return True if this is a loop back.©r   r   s    r   r&   zZeroconfIPv4Address.is_loopback?   ó   € ð × Ñ Ð r   ©r)   r
   r*   r
   ÚreturnÚNone©r=   Ústr©r=   Úbool©Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r"   r#   Úpropertyr$   r%   r&   Ú__classcell__©r+   s   @r   r   r   $   óN   ø„ Øg€Iõ$óð ò#ó ð#ð ò$ó ð$ð ò!ó ô!r   r   c                  ób   ‡ — e Zd ZdZdˆ fd„Zdd„Zed	d„«       Zed	d„«       Zed	d„«       Z	ˆ xZ
S )
ÚZeroconfIPv6Addressr   c                óì   •‡ — t        ‰‰ �  |i |¤Ž t         ‰‰ �	  «       ‰ _        t         ‰‰ �  ‰ _        t         ‰‰ �  ‰ _        t         ‰‰ �   ‰ _	        t        ˆ fd„«      ‰ _        t        ‰ «      ‰ _        y)zInitialize a new IPv6 address.c                 ó.   •— t        j                  ‰ «      S r   )r   r   r   s   €r   r   z.ZeroconfIPv6Address.__init__.<locals>.<lambda>O   r   r   Nr    r(   s   `  €r   r"   zZeroconfIPv6Address.__init__H   r,   r   c                ó   — | j                   S )z5Return the string representation of the IPv6 address.r.   r   s    r   r#   zZeroconfIPv6Address.__str__R   r/   r   c                ó   — | j                   S r1   r2   r   s    r   r$   z!ZeroconfIPv6Address.is_link_localV   r3   r   c                ó   — | j                   S r5   r6   r   s    r   r%   z"ZeroconfIPv6Address.is_unspecified[   r7   r   c                ó   — | j                   S r9   r:   r   s    r   r&   zZeroconfIPv6Address.is_loopback`   r;   r   r<   r?   rA   rC   rJ   s   @r   rM   rM   E   rK   r   rM   i   )Úmaxsizec                ó†   — 	 t        | «      S # t        t        f$ r Y nw xY w	 t        | «      S # t        t        f$ r Y yw xY w)zCache IP addresses.N)r   r   r	   rM   )Úaddresss    r   Ú_cached_ip_addressesrW   f   sR   € ð
Ü" 7Ó+Ð+øÜÔ0Ð1ò ÙðúðÜ" 7Ó+Ð+øÜÔ0Ð1ò Ùðús   ‚
 �ž£
. ®A ¿A c                óª   — | j                   t        k(  r,| j                  r t        | j                  | j                  «      S t        | j                  «      S )z*Get the IP address object from the record.)Útyper   Úscope_idÚip_bytes_and_scope_to_addressrV   Úcached_ip_addresses_wrapper)Úrecords    r   Ú!get_ip_address_object_from_recordr^   z   s:   € ð ‡{�{”jÒ  V§_¢_Ü,¨V¯^©^¸V¿_¹_ÓMÐMÜ& v§~¡~Ó6Ð6r   c           	     ó–   — t        | «      }|�;|j                  r/t        dj                  t        |«      dt        |«      f«      «      S |S )z4Convert the bytes and scope to an IP address object.Ú ú%)r\   r$   Újoinr@   )rV   ÚscopeÚbase_addresss      r   r[   r[   ƒ   sG   € ô /¨wÓ7€LØÐ L×$>Ò$>ä*¨2¯7©7´C¸Ó4EÀsÌCÐPUËJÐ3WÓ+XÓYÐYØÐr   c                ót   — | j                   dk(  rt        | «      }|j                  d«      d   S t        | «      S )zEReturn the string representation of the address without the scope id.é   ra   r   )Úversionr@   Ú	partition)ÚaddrÚaddress_strs     r   Ústr_without_scope_idrk   Ž   s7   € à‡|�|�qÒÜ˜$“iˆØ×$Ñ$ SÓ)¨!Ñ,Ð,Üˆt‹9Ðr   )Úcached_ip_addressesr^   r[   rk   N)rV   zstr | bytes | intr=   ú0ZeroconfIPv4Address | ZeroconfIPv6Address | None)r]   r   r=   rm   )rV   Úbytes_rc   Úint_r=   rm   )ri   z)ZeroconfIPv4Address | ZeroconfIPv6Addressr=   r@   )Ú__doc__Ú
__future__r   Ú	functoolsr   r   Ú	ipaddressr   r   r   r	   Útypingr
   Ú_dnsr   Úconstr   Úbytesrn   r'   ro   r   rM   rW   r\   rl   r^   r[   rk   Ú__all__© r   r   ú<module>rz      sº   ðñõ, #ç &ß TÓ TÝ å Ý à	€Ø
€ô!˜+ô !ôB!˜+ô !ñB �3ÔðØðà5òó ðð 3Ð Ø1Ð ð7Øð7à5ó7ðØðØ ðà5óóð�r   