
    i                        S r SSKJr  SSKJrJr  SSKJrJrJ	r	J
r
  SSKJr  SSKJr  SSKJr  \r\r " S	 S
\5      r " S S\	5      r\" SS9    SS j5       r\r\r    SS jr      SS jrSS jrSrg)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                  v   ^  \ rS rSrSrSU 4S jjrS	S jr\S
S j5       r\S
S j5       r	\S
S j5       r
SrU =r$ )ZeroconfIPv4Address$   __hash___is_link_local_is_loopback_is_unspecified_str
zc_integerc                   >^  [         TT ]  " U0 UD6  [         TT ]	  5       T l        [         TT ]  T l        [         TT ]  T l        [         TT ]   T l	        [        U 4S j5      T l        [        T 5      T l        g)zInitialize a new IPv4 address.c                 0   > [         R                  " T 5      $ N)r   r   selfs   P/home/sebas/venvs/catt/lib/python3.13/site-packages/zeroconf/_utils/ipaddress.py<lambda>.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$   ZeroconfIPv4Address.__init__'   b    $)&)GO%	#g3$w5!G/@Ad)r!   c                    U R                   $ )z5Return the string representation of the IPv4 address.r   r   s    r   r%   ZeroconfIPv4Address.__str__1       yyr!   c                    U R                   $ z,Return True if this is a link-local address.r   r   s    r   r&   !ZeroconfIPv4Address.is_link_local5        """r!   c                    U R                   $ z.Return True if this is an unspecified address.r   r   s    r   r'   "ZeroconfIPv4Address.is_unspecified:        ###r!   c                    U R                   $ z#Return True if this is a loop back.r   r   s    r   r(   ZeroconfIPv4Address.is_loopback?           r!   r+   r
   r,   r
   returnNonerD   strrD   bool__name__
__module____qualname____firstlineno__	__slots__r$   r%   propertyr&   r'   r(   __static_attributes____classcell__r-   s   @r   r   r   $   N    gI$ # # $ $ ! !r!   r   c                  v   ^  \ rS rSrSrSU 4S jjrS	S jr\S
S j5       r\S
S j5       r	\S
S j5       r
SrU =r$ )ZeroconfIPv6AddressE   r   c                   >^  [         TT ]  " U0 UD6  [         TT ]	  5       T l        [         TT ]  T l        [         TT ]  T l        [         TT ]   T l	        [        U 4S j5      T l        [        T 5      T l        g)zInitialize a new IPv6 address.c                 0   > [         R                  " T 5      $ r   )r   r   r   s   r   r   .ZeroconfIPv6Address.__init__.<locals>.<lambda>O   r    r!   Nr"   r*   s   `  r   r$   ZeroconfIPv6Address.__init__H   r/   r!   c                    U R                   $ )z5Return the string representation of the IPv6 address.r1   r   s    r   r%   ZeroconfIPv6Address.__str__R   r3   r!   c                    U R                   $ r5   r6   r   s    r   r&   !ZeroconfIPv6Address.is_link_localV   r8   r!   c                    U R                   $ r:   r;   r   s    r   r'   "ZeroconfIPv6Address.is_unspecified[   r=   r!   c                    U R                   $ r?   r@   r   s    r   r(   ZeroconfIPv6Address.is_loopback`   rB   r!   rC   rF   rH   rJ   rS   s   @r   rV   rV   E   rT   r!   rV   i   )maxsizec                     [        U 5      $ ! [        [        4 a     Of = f [        U 5      $ ! [        [        4 a     gf = f)zCache IP addresses.N)r   r   r	   rV   )addresss    r   _cached_ip_addressesrg   f   sR    
"7++01 "7++01 s   
   
/ AAc                    U R                   [        :X  a1  U R                  (       a   [        U R                  U R                  5      $ [        U R                  5      $ )z*Get the IP address object from the record.)typer   scope_idip_bytes_and_scope_to_addressrf   cached_ip_addresses_wrapper)records    r   !get_ip_address_object_from_recordrn   z   s:     {{j V__,V^^V__MM&v~~66r!   c           	         [        U 5      nUb@  UR                  (       a/  [        SR                  [        U5      S[        U5      45      5      $ U$ )z4Convert the bytes and scope to an IP address object. %)rl   r&   joinrG   )rf   scopebase_addresss      r   rk   rk      sG     /w7LL$>$>*277C4EsCPUJ3W+XYYr!   c                v    U R                   S:X  a  [        U 5      nUR                  S5      S   $ [        U 5      $ )zEReturn the string representation of the address without the scope id.   rq   r   )versionrG   	partition)addraddress_strs     r   str_without_scope_idr{      s7    ||q$i$$S)!,,t9r!   )cached_ip_addressesrn   rk   r{   N)rf   zstr | bytes | intrD   0ZeroconfIPv4Address | ZeroconfIPv6Address | None)rm   r   rD   r}   )rf   bytes_rs   int_rD   r}   )ry   z)ZeroconfIPv4Address | ZeroconfIPv6AddressrD   rG   )__doc__
__future__r   	functoolsr   r   	ipaddressr   r   r   r	   typingr
   _dnsr   constr   bytesr~   r)   r   r   rV   rg   rl   r|   rn   rk   r{   __all__ r!   r   <module>r      s   , # & T T   	
!+ !B!+ !B 35  3 1 7757 5r!   