Your IP : 13.59.5.179


Current Path : /usr/lib/python3.6/site-packages/dns/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/dns/__pycache__/ipv4.cpython-36.opt-1.pyc

3

�b�W��@s4dZddlZddlZddlmZdd�Zdd�ZdS)	zIPv4 helper functions.�N�)�binary_typecCsJt|�dkrtjj�t|t�s&t|�}d|d|d|d|dfj�S)z�Convert an IPv4 address in network form to text form.

    @param address: The IPv4 address
    @type address: string
    @returns: string
    �z%u.%u.%u.%urr��)�len�dns�	exception�SyntaxError�
isinstance�	bytearray�encode)Zaddress�r�/usr/lib/python3.6/ipv4.py�	inet_ntoas
rc	Cs�t|t�s|j�}|jd�}t|�dkr0tjj�x<|D]4}|j�sJtjj�t|�dkr6|ddkr6tjj�q6Wydd�|D�}t	j
d
|��Stjj�YnXd	S)z�Convert an IPv4 address in text form to network form.

    @param text: The IPv4 address
    @type text: string
    @returns: string
    �.rrr�0cSsg|]}t|��qSr)�int)�.0�partrrr�
<listcomp>8szinet_aton.<locals>.<listcomp>�BBBBN)r)rrr
�splitrrr	r
�isdigit�struct�pack)�text�partsr�bytesrrr�	inet_aton%s


r)�__doc__rZ
dns.exceptionrZ_compatrrrrrrr�<module>s


?>