관리-도구
편집 파일: ipv4.cpython-38.pyc
U /?�f� � @ sd d Z ddlZddlmZ ddlZeed�dd�Zeeef ed�dd �Z eeef ed�d d�Z dS )zIPv4 helper functions.� N)�Union)�address�returnc C s4 t | �dkrtjj�d| d | d | d | d f S )z�Convert an IPv4 address in binary form to text form. *address*, a ``bytes``, the IPv4 address in binary form. Returns a ``str``. � z%u.%u.%u.%ur � � � )�len�dns� exception�SyntaxError)r � r �6/opt/hc_python/lib/python3.8/site-packages/dns/ipv4.py� inet_ntoa s r )�textr c C s� t | t�s| �� }n| }|�d�}t|�dkr6tjj�|D ]8}|�� sNtjj�t|�dkr:|d t d�kr:tjj�q:zdd� |D �}t jd |�� W S tk r� tjj�Y nX d S )z�Convert 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 S s g | ]}t |��qS r )�int)�.0�partr r r � <listcomp>= s zinet_aton.<locals>.<listcomp>�BBBBN)r ) � isinstance�bytes�encode�splitr r r r �isdigit�ord�struct�pack� Exception)r Zbtext�partsr �br r r � inet_aton'