+
    niy                         R t ^ RIt^ RIHtHt ^ RIt^ RIt]P                  t]P                  t	R R lt
R R ltR R ltR	 R
 ltR R ltRR R lltR tR R ltR# )z*Generic Internet address helper functions.N)AnyTuplec                <    V ^8  d   QhR\         R\        R\        /# )   familytextreturn)intstrbytes)formats   "bC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO\maestro-backend\venv\Lib\site-packages\dns/inet.py__annotate__r   !   s!     " "c " " "    c                    V \         8X  d    \        P                  P                  V4      # V \        8X  d!   \        P
                  P                  VR4      # \        h)a  Convert the textual form of a network address into its binary form.

*family* is an ``int``, the address family.

*text* is a ``str``, the textual address.

Raises ``NotImplementedError`` if the address family specified is not
implemented.

Returns a ``bytes``.
T)AF_INETdnsipv4	inet_atonAF_INET6ipv6NotImplementedError)r   r   s   &&r   	inet_ptonr   !   sF     xx!!$''	8	xx!!$--!!r   c                <    V ^8  d   QhR\         R\        R\        /# )r   r   addressr   )r	   r   r
   )r   s   "r   r   r   6   s!     " "c "E "c "r   c                    V \         8X  d    \        P                  P                  V4      # V \        8X  d    \        P
                  P                  V4      # \        h)a  Convert the binary form of a network address into its textual form.

*family* is an ``int``, the address family.

*address* is a ``bytes``, the network address in binary form.

Raises ``NotImplementedError`` if the address family specified is not
implemented.

Returns a ``str``.
)r   r   r   	inet_ntoar   r   r   )r   r   s   &&r   	inet_ntopr   6   sD     xx!!'**	8	xx!!'**!!r   c                0    V ^8  d   QhR\         R\        /# r   r   r   )r
   r	   )r   s   "r   r   r   K   s        r   c                     \         P                  P                  V 4       \        #   \         d@     \         P
                  P                  T R4       \        u #   \         d    \        hi ; ii ; i)zDetermine the address family of a textual-form network address.

*text*, a ``str``, the textual address.

Raises ``ValueError`` if the address family cannot be determined
from the input.

Returns an ``int``.
T)r   r   r   r   	Exceptionr   r   
ValueErrorr   s   &r   af_for_addressr$   K   s`    4  	HHtT*O 			s    $' A1%AA1A--A1c                0    V ^8  d   QhR\         R\        /# r   r
   bool)r   s   "r   r   r   a   s      s t r   c                    \         P                  P                  V 4      ^ ,          pV^8  ;'       d    V^8*  #   \         dF     \         P                  P                  T R4      ^ ,          pT^8H  u #   \         d    \
        hi ; ii ; i)zIs the textual-form network address a multicast address?

*text*, a ``str``, the textual address.

Raises ``ValueError`` if the address family cannot be determined
from the input.

Returns a ``bool``.
T)r   r   r   r!   r   r"   )r   firsts   & r   is_multicastr*   a   s    ""4(+|,,, 	HH&&tT215EC< 			s%   1: : B
+A41B
4BB
c                0    V ^8  d   QhR\         R\        /# r   r&   )r   s   "r   r   r   w   s      S T r   c                     \         P                  P                  V 4       R#   \         d9     \         P                  P                  T R4        R#   \         d      R# i ; ii ; i)zoIs the specified string an IPv4 or IPv6 address?

*text*, a ``str``, the textual address.

Returns a ``bool``.
TF)r   r   r   r!   r   r#   s   &r   
is_addressr-   w   sY    4  	HHtT* 			s&   # A& AA"A&!A""A&c                l    V ^8  d   QhR\         \        \        3,          R\        R,          R\        /# )r   
high_tupleafNr   )r   r
   r	   r   )r   s   "r   r   r      s3     B Bc3h BS4Z BSV Br   c                   V w  r#Vf   \        V4      pV\        8X  d   W#3# V\        8X  dl   VP                  R4      pV^ 8  d   W#^ ^ 3# VRV pW$^,           R pVP	                  4       '       d   WS^ \        V4      3#  WS^ \        P                  ! V4      3# \        RV 24      h  \         d2    \        P                  p\        P                  ! Y#TR7      vEv rpT	u # i ; i)a@  Given a "high-level" address tuple, i.e.
an (address, port) return the appropriate "low-level" address tuple
suitable for use in socket calls.

If an *af* other than ``None`` is provided, it is assumed the
address in the high-level tuple is valid and has that af.  If af
is ``None``, then af_for_address will be called.
N%)flagsunknown address family )r$   r   r   findisdigitr	   socketif_nametoindexAttributeErrorAI_NUMERICHOSTgetaddrinfor   )
r/   r0   r   portiaddrpartscopeai_flags_tups
   &&        r   low_level_address_tuplerC      s     MG	zG$	W}	xLLq51a((2A;A ==??As5z22	Av'<'<U'CDD "$;B4"@AA  	,,H$00hOOYqJ	s   ?B& &9C"!C"c                z    V \         P                  8X  d   R# V \         P                  8X  d   R# \        RV  24      h)z:Return the 'any' address for the specified address family.z0.0.0.0z::r4   )r7   r   r   r   )r0   s   &r   
any_for_afrE      s3    	V^^	v	
 7t<
==r   c                0    V ^8  d   QhR\         R\         /# r   )r
   )r   s   "r   r   r      s      s s r   c                     \         P                  P                  V 4      #   \         d9     \         P                  P                  T 4      u #   \         d    \
        hi ; ii ; i)zVerify that *address* is a valid text form IPv4 or IPv6 address and return its
canonical text form.  IPv6 addresses with scopes are rejected.

*text*, a ``str``, the address in textual form.

Raises ``ValueError`` if the text is not valid.
)r   r   canonicalizer!   r   r"   r#   s   &r   rH   rH      sZ    xx$$T** 	88((.. 		s    ! A$AA$A  A$)N)__doc__r7   typingr   r   dns.ipv4r   dns.ipv6r   r   r   r   r$   r*   r-   rC   rE   rH    r   r   <module>rN      sT   $ 1    
 ..??"*"*,,&BD>r   