관리-도구
편집 파일: ipaddress.cpython-36.opt-2.pyc
3 �Qg�/ � @ s� d Z ddlZdZdZG dd� de�ZG dd� de�Zd d � Zd<dd �Zdd� Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zd d!� ZG d"d#� d#�ZejG d$d%� d%e��ZejG d&d'� d'e��ZG d(d)� d)�ZG d*d+� d+ee�ZG d,d-� d-e�ZG d.d/� d/ee�ZG d0d1� d1�Zee_G d2d3� d3�ZG d4d5� d5ee�ZG d6d7� d7e�ZG d8d9� d9ee�Z G d:d;� d;�Z!e!e_dS )=z1.0� N� � c @ s e Zd ZdS )�AddressValueErrorN)�__name__� __module__�__qualname__� r r �!/usr/lib64/python3.6/ipaddress.pyr s r c @ s e Zd ZdS )�NetmaskValueErrorN)r r r r r r r r s r c C sT yt | �S ttfk r Y nX yt| �S ttfk rB Y nX td| ��d S )Nz0%r does not appear to be an IPv4 or IPv6 address)�IPv4Addressr r �IPv6Address� ValueError)�addressr r r � ip_address s r Tc C sX y t | |�S ttfk r" Y nX y t| |�S ttfk rF Y nX td| ��d S )Nz0%r does not appear to be an IPv4 or IPv6 network)�IPv4Networkr r �IPv6Networkr )r �strictr r r � ip_network9 s r c C sT yt | �S ttfk r Y nX yt| �S ttfk rB Y nX td| ��d S )Nz2%r does not appear to be an IPv4 or IPv6 interface)� IPv4Interfacer r � IPv6Interfacer )r r r r �ip_interfaceW s r c C s. y| j dd�S tk r( td��Y nX d S )N� �bigz&Address negative or too large for IPv4)�to_bytes� OverflowErrorr )r r r r �v4_int_to_packedz s r c C s. y| j dd�S tk r( td��Y nX d S )N� r z&Address negative or too large for IPv6)r r r )r r r r �v6_int_to_packed� s r c C s* t | �jd�}t|�dkr&td| ��|S )N�/� zOnly one '/' permitted in %r)�str�split�lenr )r �addrr r r �_split_optional_netmask� s r$ c c sR t | �}t|� }}x.|D ]&}|j|jd kr<||fV |}|}qW ||fV d S )N� )�iter�next�_ip)� addresses�it�first�last�ipr r r �_find_address_range� s r. c C s$ | dkr|S t || | d @ j� �S )Nr r% )�min� bit_length)Znumber�bitsr r r �_count_righthand_zero_bits� s r2 c c s� t | t�ot |t�std��| j|jkr8td| |f ��| |krHtd��| jdkrXt}n| jdkrht}ntd��| j}| j}|j}x^||kr�t t ||�|| d j� d �}|||| f�}|V |d|>