
    i	                     V    d Z ddlZddlZdedefdZdeez  defdZdeez  defdZdS )	zIPv4 helper functions.    Naddressreturnc                     t          |           dk    rt          j        j        | d          d| d          d| d          d| d          S )zConvert an IPv4 address in binary form to text form.

    *address*, a ``bytes``, the IPv4 address in binary form.

    Returns a ``str``.
       r   .         )lendns	exceptionSyntaxError)r   s    X/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/dns/ipv4.py	inet_ntoar      sT     7||qm''ajAA71:AA
AAWQZAAA    textc                    t          | t                    s|                                 }n| }|                    d          }t	          |          dk    rt
          j        j        |D ]d}|                                st
          j        j        t	          |          dk    r*|d         t          d          k    rt
          j        j        e	 d |D             }t          j        dg|R  S # t          $ r t
          j        j        w xY w)zConvert an IPv4 address in text form to binary form.

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

    Returns a ``bytes``.
       .r   r   r   0c                 ,    g | ]}t          |          S  )int).0parts     r   
<listcomp>zinet_aton.<locals>.<listcomp><   s    )))4SYY)))r   BBBB)
isinstancebytesencodesplitr   r   r   r   isdigitordstructpack	Exception)r   btextpartsr   bs        r   	inet_atonr)   &   s    dE"" KKE
5zzQm'' , ,||~~ 	,-++t99q==T!WC00-++())5))){6&A&&&& ( ( (m''(s   C, ,Dc                 :    t          t          |                     S )zVerify that *address* is a valid text form IPv4 address and return its
    canonical text form.

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

    Raises ``dns.exception.SyntaxError`` if the text is not valid.
    )r   r)   )r   s    r   canonicalizer+   B   s     Yt__%%%r   )	__doc__r#   dns.exceptionr   r   strr   r)   r+   r   r   r   <module>r/      s   $       
Bu 
B 
B 
B 
B 
B(C%K (E ( ( ( (8
&sU{ 
&s 
& 
& 
& 
& 
& 
&r   