관리-도구
편집 파일: ipv4.cpython-36.pyc
3 �b�W� � @ s4 d Z ddlZddlZddlmZ dd� Zdd� ZdS ) zIPv4 helper functions.� N� )�binary_typec C sJ t | �dkrtjj�t| t�s&t| �} d| d | d | d | d f j� 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.%ur r � � )�len�dns� exception�SyntaxError� isinstance� bytearray�encode)Zaddress� r �/usr/lib/python3.6/ipv4.py� inet_ntoa s r c C s� t | t�s| j� } | jd�}t|�dkr0tjj�x<|D ]4}|j� sJtjj�t|�dkr6|d dkr6tjj�q6W ydd� |D �}t j d |�� S tjj�Y nX d S )z�Convert an IPv4 address in text form to network form. @param text: The IPv4 address @type text: string @returns: string � .r r r �0c S s g | ]}t |��qS r )�int)�.0�partr r r � <listcomp>8 s zinet_aton.<locals>.<listcomp>�BBBBN)r )r r r �splitr r r r �isdigit�struct�pack)�text�partsr �bytesr r r � inet_aton% s r )�__doc__r Z dns.exceptionr Z_compatr r r r r r r �<module> s