Your IP : 3.15.225.164


Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/ipaddress.cpython-33.pyo

�
��f�c@s�dZdZddlZdZdZGdd�de�ZGdd	�d	e�Zd
d�Ze	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZGd"d#�d#�ZGd$d%�d%e�ZGd&d'�d'e�ZGd(d)�d)e�ZGd*d+�d+�ZGd,d-�d-ee�ZGd.d/�d/e�ZGd0d1�d1ee�ZGd2d3�d3�ZGd4d5�d5ee�ZGd6d7�d7e�ZGd8d9�d9ee�Z dS(:u�A fast, lightweight IPv4/IPv6 manipulation library in Python.

This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.

u1.0iNi i�cBs|EeZdZdZdS(uAddressValueErroru%A Value Error related to the address.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuAddressValueErrorsuAddressValueErrorcBs|EeZdZdZdS(uNetmaskValueErroru%A Value Error related to the netmask.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuNetmaskValueErrorsuNetmaskValueErrorcCsfyt|�SWnttfk
r(YnXyt|�SWnttfk
rQYnXtd|��dS(u�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Address or IPv6Address object.

    Raises:
        ValueError: if the *address* passed isn't either a v4 or a v6
          address

    u0%r does not appear to be an IPv4 or IPv6 addressN(uIPv4AddressuAddressValueErroruNetmaskValueErroruIPv6Addressu
ValueError(uaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
ip_addresssu
ip_addresscCslyt||�SWnttfk
r+YnXyt||�SWnttfk
rWYnXtd|��dS(u�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP network.  Either IPv4 or
          IPv6 networks may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Network or IPv6Network object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address. Or if the network has host bits set.

    u0%r does not appear to be an IPv4 or IPv6 networkN(uIPv4NetworkuAddressValueErroruNetmaskValueErroruIPv6Networku
ValueError(uaddressustrict((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
ip_network9su
ip_networkcCsfyt|�SWnttfk
r(YnXyt|�SWnttfk
rQYnXtd|��dS(ugTake an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Interface or IPv6Interface object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address.

    Notes:
        The IPv?Interface classes describe an Address on a particular
        Network, so they're basically a combination of both the Address
        and Network classes.

    u2%r does not appear to be an IPv4 or IPv6 interfaceN(u
IPv4InterfaceuAddressValueErroruNetmaskValueErroru
IPv6Interfaceu
ValueError(uaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuip_interfaceWsuip_interfacec	Cs/y|jdd�SWntd��YnXdS(u`Represent an address as 4 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv4 IP address.

    Returns:
        The integer address packed as 4 bytes in network (big-endian) order.

    Raises:
        ValueError: If the integer is negative or too large to be an
          IPv4 IP address.

    iubigu&Address negative or too large for IPv4N(uto_bytesu
ValueError(uaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuv4_int_to_packedzsuv4_int_to_packedc	Cs/y|jdd�SWntd��YnXdS(u�Represent an address as 16 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv6 IP address.

    Returns:
        The integer address packed as 16 bytes in network (big-endian) order.

    iubigu&Address negative or too large for IPv6N(uto_bytesu
ValueError(uaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuv6_int_to_packed�s
uv6_int_to_packedcCs>t|�jd�}t|�dkr:td|��n|S(uAHelper to split the netmask and raise AddressValueError if neededu/iuOnly one '/' permitted in %r(ustrusplitulenuAddressValueError(uaddressuaddr((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_split_optional_netmask�su_split_optional_netmaskcCsS|d}}x8|dd�D]&}|j|jdkrD|}qPqW||fS(u�Find a sequence of IPv#Address.

    Args:
        addresses: a list of IPv#Address objects.

    Returns:
        A tuple containing the first and last IP addresses in the sequence.

    iiN(u_ip(u	addressesufirstulastuip((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_find_address_range�s
	u_find_address_rangecCs=|dkr|Sx&t|�D]}||?d@r|SqW|S(u�Count the number of zero bits on the right hand side.

    Args:
        number: an integer.
        bits: maximum number of bits to count.

    Returns:
        The number of zero bits on the right hand side of the number.

    ii(urange(unumberubitsui((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_count_righthand_zero_bits�su_count_righthand_zero_bitsccs^t|t�ot|t�s-td��n|j|jkrXtd||f��n||krstd��n|jdkr�t}n$|jdkr�t}ntd��|j}|j}|j}x�||krYt	t
||�||dj�d�}|d|||f�}|V|d|>7}|d|jkrGPn|j
|�}q�Wd	S(
u�Summarize a network range given the first and last IP addresses.

    Example:
        >>> list(summarize_address_range(IPv4Address('192.0.2.0'),
        ...                              IPv4Address('192.0.2.130')))
        ...                                #doctest: +NORMALIZE_WHITESPACE
        [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'),
         IPv4Network('192.0.2.130/32')]

    Args:
        first: the first IPv4Address or IPv6Address in the range.
        last: the last IPv4Address or IPv6Address in the range.

    Returns:
        An iterator of the summarized IPv(4|6) network objects.

    Raise:
        TypeError:
            If the first and last objects are not IP addresses.
            If the first and last objects are not the same version.
        ValueError:
            If the last object is not greater than the first.
            If the version of the first address is not 4 or 6.

    u1first and last must be IP addresses, not networksu%%s and %s are not of the same versionu*last IP address must be greater than firstiiuunknown IP versioniu%s/%dN(u
isinstanceu_BaseAddressu	TypeErroruversionu
ValueErroruIPv4NetworkuIPv6Networku_max_prefixlenu_ipuminu_count_righthand_zero_bitsu
bit_lengthu	_ALL_ONESu	__class__(ufirstulastuipuip_bitsu	first_intulast_intunbitsunet((u./opt/alt/python33/lib64/python3.3/ipaddress.pyusummarize_address_range�s2					usummarize_address_rangecCs�x�d}g}d}x�|D]�}|s>|}|j|�q|j|jkrk|j|jkrkd}q|t|j�j��dkr�|j�|d<}d}q|}|j|�qW|}|s|SqdS(uvLoops through the addresses, collapsing concurrent netblocks.

    Example:

        ip1 = IPv4Network('192.0.2.0/26')
        ip2 = IPv4Network('192.0.2.64/26')
        ip3 = IPv4Network('192.0.2.128/26')
        ip4 = IPv4Network('192.0.2.192/26')

        _collapse_addresses_recursive([ip1, ip2, ip3, ip4]) ->
          [IPv4Network('192.0.2.0/24')]

        This shouldn't be called directly; it is called via
          collapse_addresses([]).

    Args:
        addresses: A list of IPv4Network's or IPv6Network's

    Returns:
        A list of IPv4Network's or IPv6Network's depending on what we were
        passed.

    iNFTi����(	uNoneuFalseuappendunetwork_addressubroadcast_addressuTrueulistusupernetusubnets(u	addressesu	last_addru	ret_arrayu	optimizeducur_addr((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_collapse_addresses_recursives&
	"	u_collapse_addresses_recursivec
Cs�d}g}g}g}x3|D]+}t|t�r}|rm|dj|jkrmtd||df��n|j|�q|j|jkr|r�|dj|jkr�td||d	f��ny|j|j�WqJtk
r|j|j	�YqJXq|r=|d
j|jkr=td||df��n|j|�qWt
t|��}t
t|��}x[|t|�kr�t
||d��\}}|j|�d}|jt||��quWttt
||dtj���S(u�Collapse a list of IP objects.

    Example:
        collapse_addresses([IPv4Network('192.0.2.0/25'),
                            IPv4Network('192.0.2.128/25')]) ->
                           [IPv4Network('192.0.2.0/24')]

    Args:
        addresses: An iterator of IPv4Network or IPv6Network objects.

    Returns:
        An iterator of the collapsed IPv(4|6)Network objects.

    Raises:
        TypeError: If passed a list of mixed version objects.

    iiu%%s and %s are not of the same versionNukeyi����i����i����i����i����i����(u
isinstanceu_BaseAddressu_versionu	TypeErroruappendu
_prefixlenu_max_prefixlenuipuAttributeErrorunetwork_addressusortedusetulenu_find_address_rangeuindexuextendusummarize_address_rangeuiteru_collapse_addresses_recursiveu_BaseNetworku_get_networks_key(u	addressesuiuaddrsuipsunetsuipufirstulast((u./opt/alt/python33/lib64/python3.3/ipaddress.pyucollapse_addresses5s<

	ucollapse_addressescCs6t|t�r|j�St|t�r2|j�StS(u2Return a key suitable for sorting between networks and addresses.

    Address and Network objects are not sortable by default; they're
    fundamentally different so the expression

        IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')

    doesn't make any sense.  There are some times however, where you may wish
    to have ipaddress sort these for you anyway. If you need to do this, you
    can use this function as the key= argument to sorted().

    Args:
      obj: either a Network or Address object.
    Returns:
      appropriate key.

    (u
isinstanceu_BaseNetworku_get_networks_keyu_BaseAddressu_get_address_keyuNotImplemented(uobj((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuget_mixed_type_keyns


uget_mixed_type_keycBs\|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S(u_TotalOrderingMixincCs
t�dS(N(uNotImplementedError(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__eq__�su_TotalOrderingMixin.__eq__cCs$|j|�}|tkrtS|S(N(u__eq__uNotImplemented(uselfuotheruequal((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__ne__�su_TotalOrderingMixin.__ne__cCs
t�dS(N(uNotImplementedError(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__lt__�su_TotalOrderingMixin.__lt__cCs3|j|�}|tks"|r/|j|�S|S(N(u__lt__uNotImplementedu__eq__(uselfuotheruless((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__le__�s
u_TotalOrderingMixin.__le__cCsI|j|�}|tkrtS|j|�}|tkr>tS|pG|S(N(u__lt__uNotImplementedu__eq__(uselfuotherulessuequal((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__gt__�su_TotalOrderingMixin.__gt__cCs$|j|�}|tkrtS|S(N(u__lt__uNotImplemented(uselfuotheruless((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__ge__�su_TotalOrderingMixin.__ge__N(	u__name__u
__module__u__qualname__u__eq__u__ne__u__lt__u__le__u__gt__u__ge__(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_TotalOrderingMixin�su_TotalOrderingMixincBs�|EeZdZdZedd��Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�ZdS(u_IPAddressBaseuThe mother class.cCs
|j�S(u:Return the longhand version of the IP address as a string.(u_explode_shorthand_ip_string(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuexploded�su_IPAddressBase.explodedcCs
t|�S(u;Return the shorthand version of the IP address as a string.(ustr(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
compressed�su_IPAddressBase.compressedcCs#dt|�f}t|��dS(Nu%200s has no version specified(utypeuNotImplementedError(uselfumsg((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuversion�su_IPAddressBase.versioncCsi|dkr.d}t|||jf��n||jkred}t|||j|jf��ndS(Niu-%d (< 0) is not permitted as an IPv%d addressu2%d (>= 2**%d) is not permitted as an IPv%d address(uAddressValueErroru_versionu	_ALL_ONESu_max_prefixlen(uselfuaddressumsg((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_check_int_address�su!_IPAddressBase._check_int_addresscCsDt|�}||kr@d}t|||||jf��ndS(Nu6%r (len %d != %d) is not permitted as an IPv%d address(ulenuAddressValueErroru_version(uselfuaddressuexpected_lenuaddress_lenumsg((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_check_packed_address�s
u$_IPAddressBase._check_packed_addresscCs|j|j|?AS(u�Turn the prefix length into a bitwise netmask

        Args:
            prefixlen: An integer, the prefix length.

        Returns:
            An integer.

        (u	_ALL_ONES(uselfu	prefixlen((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_ip_int_from_prefix�s
u"_IPAddressBase._ip_int_from_prefixc	Cst||j�}|j|}||?}d|>d}||kr{|jd}|j|d�}d}t||��n|S(uReturn prefix length from the bitwise netmask.

        Args:
            ip_int: An integer, the netmask in axpanded bitwise format

        Returns:
            An integer, the prefix length.

        Raises:
            ValueError: If the input intermingles zeroes & ones
        iiubigu&Netmask pattern %r mixes zeroes & ones(u_count_righthand_zero_bitsu_max_prefixlenuto_bytesu
ValueError(	uselfuip_intutrailing_zeroesu	prefixlenuleading_onesuall_onesubyteslenudetailsumsg((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_prefix_from_ip_int�s


u"_IPAddressBase._prefix_from_ip_intcCsd|}t|�d�dS(Nu%r is not a valid netmask(uNetmaskValueErroruNone(uselfunetmask_strumsg((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_report_invalid_netmask�s
u&_IPAddressBase._report_invalid_netmaskcCs�tjj|�s"|j|�nyt|�}Wntk
rS|j|�YnXd|kon|jkns�|j|�n|S(u	Return prefix length from a numeric string

        Args:
            prefixlen_str: The string to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask
        i(u_BaseV4u_DECIMAL_DIGITSu
issupersetu_report_invalid_netmaskuintu
ValueErroru_max_prefixlen(uselfu
prefixlen_stru	prefixlen((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_prefix_from_prefix_string�s
u)_IPAddressBase._prefix_from_prefix_stringcCs�y|j|�}Wntk
r4|j|�YnXy|j|�SWntk
rZYnX||jN}y|j|�SWntk
r�|j|�YnXdS(uTurn a netmask/hostmask string into a prefix length

        Args:
            ip_str: The netmask/hostmask to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask/hostmask
        N(u_ip_int_from_stringuAddressValueErroru_report_invalid_netmasku_prefix_from_ip_intu
ValueErroru	_ALL_ONES(uselfuip_struip_int((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_prefix_from_ip_strings




u%_IPAddressBase._prefix_from_ip_stringN(u__name__u
__module__u__qualname__u__doc__upropertyuexplodedu
compresseduversionu_check_int_addressu_check_packed_addressu_ip_int_from_prefixu_prefix_from_ip_intu_report_invalid_netmasku_prefix_from_prefix_stringu_prefix_from_ip_string(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_IPAddressBase�s	u_IPAddressBasecBs�|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS(u_BaseAddressu�A generic IP object.

    This IP class contains the version independent methods which are
    used by single IP addresses.
    cCs9t|t�r5dt|�kr5td|��ndS(Nu/uUnexpected '/' in %r(u
isinstanceubytesustruAddressValueError(uselfuaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__5su_BaseAddress.__init__cCs|jS(N(u_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__int__:su_BaseAddress.__int__cCsCy&|j|jko$|j|jkSWntk
r>tSYnXdS(N(u_ipu_versionuAttributeErroruNotImplemented(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__eq__=s

u_BaseAddress.__eq__cCsy|j|jkr+td||f��nt|t�sStd||f��n|j|jkru|j|jkSdS(Nu%%s and %s are not of the same versionu"%s and %s are not of the same typeF(u_versionu	TypeErroru
isinstanceu_BaseAddressu_ipuFalse(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__lt__Dsu_BaseAddress.__lt__cCs*t|t�stS|jt|�|�S(N(u
isinstanceuintuNotImplementedu	__class__(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__add__Qsu_BaseAddress.__add__cCs*t|t�stS|jt|�|�S(N(u
isinstanceuintuNotImplementedu	__class__(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__sub__Vsu_BaseAddress.__sub__cCsd|jjt|�fS(Nu%s(%r)(u	__class__u__name__ustr(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__repr__[su_BaseAddress.__repr__cCst|j|j��S(N(ustru_string_from_ip_intu_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__str__^su_BaseAddress.__str__cCsttt|j���S(N(uhashuhexuintu_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__hash__asu_BaseAddress.__hash__cCs
|j|fS(N(u_version(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_get_address_keydsu_BaseAddress._get_address_keyN(u__name__u
__module__u__qualname__u__doc__u__init__u__int__u__eq__u__lt__u__add__u__sub__u__repr__u__str__u__hash__u_get_address_key(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_BaseAddress-s
u_BaseAddresscBs�|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zedd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d?d/d0�Zd.d?d1d2�Zed3d4��Zed5d6��Zed7d8��Z ed9d:��Z!ed;d<��Z"ed=d>��Z#d?S(@u_BaseNetworku~A generic IP network object.

    This IP class contains the version independent methods which are
    used by networks.

    cCs
i|_dS(N(u_cache(uselfuaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__psu_BaseNetwork.__init__cCsd|jjt|�fS(Nu%s(%r)(u	__class__u__name__ustr(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__repr__ssu_BaseNetwork.__repr__cCsd|j|jfS(Nu%s/%d(unetwork_addressu	prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__str__vsu_BaseNetwork.__str__ccsNt|j�}t|j�}x)t|d|�D]}|j|�Vq2WdS(u�Generate Iterator over usable hosts in a network.

        This is like __iter__ except it doesn't return the network
        or broadcast addresses.

        iN(uintunetwork_addressubroadcast_addressurangeu_address_class(uselfunetworku	broadcastux((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuhostsysu_BaseNetwork.hostsccsNt|j�}t|j�}x)t||d�D]}|j|�Vq2WdS(Ni(uintunetwork_addressubroadcast_addressurangeu_address_class(uselfunetworku	broadcastux((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__iter__�su_BaseNetwork.__iter__cCs�t|j�}t|j�}|dkrT|||krCt�n|j||�S|d7}|||krwt�n|j||�SdS(Nii(uintunetwork_addressubroadcast_addressu
IndexErroru_address_class(uselfununetworku	broadcast((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__getitem__�s	
	u_BaseNetwork.__getitem__cCs�|j|jkr+td||f��nt|t�sStd||f��n|j|jkru|j|jkS|j|jkr�|j|jkSdS(Nu%%s and %s are not of the same versionu"%s and %s are not of the same typeF(u_versionu	TypeErroru
isinstanceu_BaseNetworkunetwork_addressunetmaskuFalse(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__lt__�su_BaseNetwork.__lt__cCsayD|j|jkoB|j|jkoBt|j�t|j�kSWntk
r\tSYnXdS(N(u_versionunetwork_addressuintunetmaskuAttributeErroruNotImplemented(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__eq__�s 
u_BaseNetwork.__eq__cCs tt|j�t|j�A�S(N(uhashuintunetwork_addressunetmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__hash__�su_BaseNetwork.__hash__cCs`|j|jkrdSt|t�r)dSt|j�t|j�koYt|j�kSSdS(NF(u_versionuFalseu
isinstanceu_BaseNetworkuintunetwork_addressu_ipubroadcast_address(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__contains__�s u_BaseNetwork.__contains__cCs:|j|kp9|j|kp9|j|kp9|j|kS(u*Tell if self is partly contained in other.(unetwork_addressubroadcast_address(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuoverlaps�su_BaseNetwork.overlapscCsW|jjd�}|dkrS|jt|j�t|j�B�}||jd<n|S(Nubroadcast_address(u_cacheugetuNoneu_address_classuintunetwork_addressuhostmask(uselfux((u./opt/alt/python33/lib64/python3.3/ipaddress.pyubroadcast_address�su_BaseNetwork.broadcast_addresscCsQ|jjd�}|dkrM|jt|j�|jA�}||jd<n|S(Nuhostmask(u_cacheugetuNoneu_address_classuintunetmasku	_ALL_ONES(uselfux((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuhostmask�s
u_BaseNetwork.hostmaskcCsd|j|jfS(Nu%s/%d(unetwork_addressu
_prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuwith_prefixlen�su_BaseNetwork.with_prefixlencCsd|j|jfS(Nu%s/%s(unetwork_addressunetmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuwith_netmask�su_BaseNetwork.with_netmaskcCsd|j|jfS(Nu%s/%s(unetwork_addressuhostmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
with_hostmask�su_BaseNetwork.with_hostmaskcCst|j�t|j�dS(u&Number of hosts in the current subnet.i(uintubroadcast_addressunetwork_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
num_addresses�su_BaseNetwork.num_addressescCs#dt|�f}t|��dS(Nu%%200s has no associated address class(utypeuNotImplementedError(uselfumsg((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_address_class�su_BaseNetwork._address_classcCs|jS(N(u
_prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu	prefixlen�su_BaseNetwork.prefixlenc	cs�|j|jks+td||f��nt|t�sMtd|��n|j|jkon|j|jks�td||f��n||kr�t�n|jd|j|j	f�}|j
�\}}x�||kr�||kr�|j|jkr)|j|jkr)|V|j
�\}}q�|j|jkrg|j|jkrg|V|j
�\}}q�td|||f��q�W||kr�|Vn-||kr�|Vntd|||f��dS(u�Remove an address from a larger block.

        For example:

            addr1 = ip_network('192.0.2.0/28')
            addr2 = ip_network('192.0.2.1/32')
            addr1.address_exclude(addr2) =
                [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'),
                IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')]

        or IPv6:

            addr1 = ip_network('2001:db8::1/32')
            addr2 = ip_network('2001:db8::1/128')
            addr1.address_exclude(addr2) =
                [ip_network('2001:db8::1/128'),
                ip_network('2001:db8::2/127'),
                ip_network('2001:db8::4/126'),
                ip_network('2001:db8::8/125'),
                ...
                ip_network('2001:db8:8000::/33')]

        Args:
            other: An IPv4Network or IPv6Network object of the same type.

        Returns:
            An iterator of the IPv(4|6)Network objects which is self
            minus other.

        Raises:
            TypeError: If self and other are of differing address
              versions, or if other is not a network object.
            ValueError: If other is not completely contained by self.

        u%%s and %s are not of the same versionu%s is not a network objectu%s not contained in %su%s/%su3Error performing exclusion: s1: %s s2: %s other: %sN(u_versionu	TypeErroru
isinstanceu_BaseNetworkunetwork_addressubroadcast_addressu
ValueErroru
StopIterationu	__class__u	prefixlenusubnetsuAssertionError(uselfuotherus1us2((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuaddress_exclude�s<$	u_BaseNetwork.address_excludecCs�|j|jkr+td||f��n|j|jkrAdS|j|jkrWdS|j|jkrmdS|j|jkr�dSdS(u�Compare two IP objects.

        This is only concerned about the comparison of the integer
        representation of the network addresses.  This means that the
        host bits aren't considered at all in this method.  If you want
        to compare host bits, you can easily enough do a
        'HostA._ip < HostB._ip'

        Args:
            other: An IP object.

        Returns:
            If the IP versions of self and other are the same, returns:

            -1 if self < other:
              eg: IPv4Network('192.0.2.0/25') < IPv4Network('192.0.2.128/25')
              IPv6Network('2001:db8::1000/124') <
                  IPv6Network('2001:db8::2000/124')
            0 if self == other
              eg: IPv4Network('192.0.2.0/24') == IPv4Network('192.0.2.0/24')
              IPv6Network('2001:db8::1000/124') ==
                  IPv6Network('2001:db8::1000/124')
            1 if self > other
              eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25')
                  IPv6Network('2001:db8::2000/124') >
                      IPv6Network('2001:db8::1000/124')

          Raises:
              TypeError if the IP versions are different.

        u"%s and %s are not of the same typeiii����i����(u_versionu	TypeErrorunetwork_addressunetmask(uselfuother((u./opt/alt/python33/lib64/python3.3/ipaddress.pyucompare_networks@s!u_BaseNetwork.compare_networkscCs|j|j|jfS(u�Network-only key function.

        Returns an object that identifies this address' network and
        netmask. This function is a suitable "key" argument for sorted()
        and list.sort().

        (u_versionunetwork_addressunetmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_get_networks_keypsu_BaseNetwork._get_networks_keyiccsK|j|jkr|VdS|dk	rp||jkrEtd��n|dkr`td��n||j}n|dkr�td��n|j|}||jkr�td||f��n|jd|j|j|f�}|V|}xV|j}||jkr
dS|jt|�d�}|jd||f�}|Vq�dS(	u�The subnets which join to make the current subnet.

        In the case that self contains only one IP
        (self._prefixlen == 32 for IPv4 or self._prefixlen == 128
        for IPv6), yield an iterator with just ourself.

        Args:
            prefixlen_diff: An integer, the amount the prefix length
              should be increased by. This should not be set if
              new_prefix is also set.
            new_prefix: The desired new prefix length. This must be a
              larger number (smaller prefix) than the existing prefix.
              This should not be set if prefixlen_diff is also set.

        Returns:
            An iterator of IPv(4|6) objects.

        Raises:
            ValueError: The prefixlen_diff is too small or too large.
                OR
            prefixlen_diff and new_prefix are both set or new_prefix
              is a smaller number than the current prefix (smaller
              number means a larger network)

        Nunew prefix must be longeriu(cannot set prefixlen_diff and new_prefixiuprefix length diff must be > 0u0prefix length diff %d is invalid for netblock %su%s/%s(	u
_prefixlenu_max_prefixlenuNoneu
ValueErroru	__class__unetwork_addressubroadcast_addressu_address_classuint(uselfuprefixlen_diffu
new_prefixu
new_prefixlenufirstucurrentu	broadcastunew_addr((u./opt/alt/python33/lib64/python3.3/ipaddress.pyusubnetszs:
		
u_BaseNetwork.subnetscCs�|jdkr|S|dk	rh||jkr=td��n|dkrXtd��n|j|}n|j|dkr�td|j|f��n|jd|j|j|fdd	�}|jd|j|jf�S(
u�The supernet containing the current network.

        Args:
            prefixlen_diff: An integer, the amount the prefix length of
              the network should be decreased by.  For example, given a
              /24 network and a prefixlen_diff of 3, a supernet with a
              /21 netmask is returned.

        Returns:
            An IPv4 network object.

        Raises:
            ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have
              a negative prefix length.
                OR
            If prefixlen_diff and new_prefix are both set or new_prefix is a
              larger number than the current prefix (larger number means a
              smaller network)

        iunew prefix must be shorteriu(cannot set prefixlen_diff and new_prefixu;current prefixlen is %d, cannot have a prefixlen_diff of %du%s/%dustrictNF(u
_prefixlenuNoneu
ValueErroru	prefixlenu	__class__unetwork_addressuFalse(uselfuprefixlen_diffu
new_prefixut((u./opt/alt/python33/lib64/python3.3/ipaddress.pyusupernet�s 	u_BaseNetwork.supernetcCs|jjo|jjS(u�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        (unetwork_addressuis_multicastubroadcast_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_multicast�s	u_BaseNetwork.is_multicastcCs|jjo|jjS(u�Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        (unetwork_addressuis_reservedubroadcast_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_reserved�s	u_BaseNetwork.is_reservedcCs|jjo|jjS(u�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        (unetwork_addressu
is_link_localubroadcast_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_link_local�su_BaseNetwork.is_link_localcCs|jjo|jjS(u�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per RFC 4193.

        (unetwork_addressu
is_privateubroadcast_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_privatesu_BaseNetwork.is_privatecCs|jjo|jjS(u�Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        (unetwork_addressuis_unspecifiedubroadcast_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_unspecifieds	u_BaseNetwork.is_unspecifiedcCs|jjo|jjS(u�Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        (unetwork_addressuis_loopbackubroadcast_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_loopbacks	u_BaseNetwork.is_loopbackN($u__name__u
__module__u__qualname__u__doc__u__init__u__repr__u__str__uhostsu__iter__u__getitem__u__lt__u__eq__u__hash__u__contains__uoverlapsupropertyubroadcast_addressuhostmaskuwith_prefixlenuwith_netmasku
with_hostmasku
num_addressesu_address_classu	prefixlenuaddress_excludeucompare_networksu_get_networks_keyuNoneusubnetsusupernetuis_multicastuis_reservedu
is_link_localu
is_privateuis_unspecifieduis_loopback(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_BaseNetworkhs>


	N0
>)u_BaseNetworkc
Bs�|EeZdZdZdedZed�Zed!�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��Zedd��Zd S("u_BaseV4uyBase IPv4 object.

    The following methods are used by IPv4 objects in both single IP
    addresses and networks.

    iiu
0123456789i�i�i�i�i�i�i�i�icCsd|_t|_dS(Ni(u_versionu
IPV4LENGTHu_max_prefixlen(uselfuaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__8s	u_BaseV4.__init__cCs
t|�S(N(ustr(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_explode_shorthand_ip_string<su$_BaseV4._explode_shorthand_ip_stringcCs�|std��n|jd�}t|�dkrItd|��ny tjt|j|�d�SWn>tk
r�}ztd||f�d�WYdd}~XnXdS(uTurn the given IP string into an integer for comparison.

        Args:
            ip_str: A string, the IP ip_str.

        Returns:
            The IP ip_str as an integer.

        Raises:
            AddressValueError: if ip_str isn't a valid IPv4 Address.

        uAddress cannot be emptyu.iuExpected 4 octets in %rubigu%s in %rN(	uAddressValueErrorusplitulenuintu
from_bytesumapu_parse_octetu
ValueErroruNone(uselfuip_struoctetsuexc((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_ip_int_from_string?s
 u_BaseV4._ip_int_from_stringcCs�|std��n|jj|�s@d}t||��nt|�dkrkd}t||��nt|d�}|dkr�|ddkr�d	}t||��n|d
kr�td|��n|S(uConvert a decimal octet into an integer.

        Args:
            octet_str: A string, the number to parse.

        Returns:
            The octet as an integer.

        Raises:
            ValueError: if the octet isn't strictly a decimal from [0..255].

        uEmpty octet not permittedu#Only decimal digits permitted in %riu$At most 3 characters permitted in %ri
iiu0u3Ambiguous (octal/decimal) value in %r not permittedi�uOctet %d (> 255) not permitted(u
ValueErroru_DECIMAL_DIGITSu
issupersetulenuint(uselfu	octet_strumsgu	octet_int((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_parse_octetXs
u_BaseV4._parse_octetcCs"djtt|jdd���S(u�Turns a 32-bit integer into dotted decimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            The IP address as a string in dotted decimal notation.

        u.iubig(ujoinumapustruto_bytes(uselfuip_int((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_string_from_ip_int|s
u_BaseV4._string_from_ip_intcCs�|jd�}t|�dkr�y.x'|D]}t|�|jkr+dSq+WWntk
rgdSYnXx>t|�D]0\}}|dkru|||dkrudSquWdSyt|�}Wntk
r�dSYnXd|ko�|jkSS(u�Verify that the netmask is valid.

        Args:
            netmask: A string, either a prefix or dotted decimal
              netmask.

        Returns:
            A boolean, True if the prefix represents a valid IPv4
            netmask.

        u.iiiFT(	usplitulenuintu_valid_mask_octetsuFalseu
ValueErroru	enumerateuTrueu_max_prefixlen(uselfunetmaskumaskuxuidxuy((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_is_valid_netmask�s"

	 
	u_BaseV4._is_valid_netmaskcs�|jd�}y&�fdd�tt|�D�}Wntk
rMdSYnXt|�t|�krjdS|d|dkr�dSdS(	u�Test if the IP string is a hostmask (rather than a netmask).

        Args:
            ip_str: A string, the potential hostmask.

        Returns:
            A boolean, True if the IP string is a hostmask.

        u.cs%g|]}|�jkr|�qS((u_valid_mask_octets(u.0ux(uself(u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
<listcomp>�s	u(_BaseV4._is_hostmask.<locals>.<listcomp>iiFi����T(usplitumapuintu
ValueErroruFalseulenuTrue(uselfuip_strubitsuparts((uselfu./opt/alt/python33/lib64/python3.3/ipaddress.pyu_is_hostmask�s
&
	u_BaseV4._is_hostmaskcCs|jS(N(u_max_prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
max_prefixlen�su_BaseV4.max_prefixlencCs|jS(N(u_version(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuversion�su_BaseV4.versionN(	i�i�i�i�i�i�i�i�i(u__name__u
__module__u__qualname__u__doc__u
IPV4LENGTHu	_ALL_ONESu	frozensetu_DECIMAL_DIGITSu_valid_mask_octetsu__init__u_explode_shorthand_ip_stringu_ip_int_from_stringu_parse_octetu_string_from_ip_intu_is_valid_netmasku_is_hostmaskupropertyu
max_prefixlenuversion(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_BaseV4(s$u_BaseV4cBs�|EeZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zedd��ZdS(uIPv4Addressu/Represent and manipulate single IPv4 Addresses.cCs�tj||�tj||�t|t�rI|j|�||_dSt|t�r�|j|d�tj	|d�|_dSt
|�}|j|�|_dS(u�
        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv4Address('192.0.2.1') == IPv4Address(3221225985).
              or, more generally
              IPv4Address(int(IPv4Address('192.0.2.1'))) ==
                IPv4Address('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.

        Niubig(u_BaseAddressu__init__u_BaseV4u
isinstanceuintu_check_int_addressu_ipubytesu_check_packed_addressu
from_bytesustru_ip_int_from_string(uselfuaddressuaddr_str((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__�s
	uIPv4Address.__init__cCs
t|j�S(u*The binary representation of this address.(uv4_int_to_packedu_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyupacked�suIPv4Address.packedcCstd�}||kS(u�Test if the address is otherwise IETF reserved.

         Returns:
             A boolean, True if the address is within the
             reserved IPv4 Network range.

        u240.0.0.0/4(uIPv4Network(uselfureserved_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_reserved�s	uIPv4Address.is_reservedcCsFtd�}td�}td�}||kpE||kpE||kS(u�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per RFC 1918.

        u
10.0.0.0/8u
172.16.0.0/12u192.168.0.0/16(uIPv4Network(uselfu
private_10uprivate_172uprivate_192((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_private�suIPv4Address.is_privatecCstd�}||kS(u�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is multicast.
            See RFC 3171 for details.

        u224.0.0.0/4(uIPv4Network(uselfumulticast_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_multicast
s	uIPv4Address.is_multicastcCstd�}||kS(u�Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 5735 3.

        u0.0.0.0(uIPv4Address(uselfuunspecified_address((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_unspecifieds	uIPv4Address.is_unspecifiedcCstd�}||kS(u�Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback per RFC 3330.

        u127.0.0.0/8(uIPv4Network(uselfuloopback_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_loopback%suIPv4Address.is_loopbackcCstd�}||kS(u�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is link-local per RFC 3927.

        u169.254.0.0/16(uIPv4Network(uselfulinklocal_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_link_local0suIPv4Address.is_link_localN(
u__name__u
__module__u__qualname__u__doc__u__init__upropertyupackeduis_reservedu
is_privateuis_multicastuis_unspecifieduis_loopbacku
is_link_local(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuIPv4Address�s$uIPv4AddresscBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zedd��Z	ed
d��Z
edd��Zedd��ZdS(u
IPv4InterfacecCs�t|ttf�rGtj||�t|j�|_|j|_	dSt
|�}tj||d�t|dd�|_|jj	|_	|jj|_|jj
|_
dS(NiustrictF(u
isinstanceubytesuintuIPv4Addressu__init__uIPv4Networku_ipunetworku_max_prefixlenu
_prefixlenu_split_optional_netmaskuFalseunetmaskuhostmask(uselfuaddressuaddr((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__>suIPv4Interface.__init__cCs d|j|j�|jjfS(Nu%s/%d(u_string_from_ip_intu_ipunetworku	prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__str__NsuIPv4Interface.__str__cCsZtj||�}|s%|tkr)|Sy|j|jkSWntk
rUdSYnXdS(NF(uIPv4Addressu__eq__uNotImplementedunetworkuAttributeErroruFalse(uselfuotheru
address_equal((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__eq__Rs
uIPv4Interface.__eq__cCsStj||�}|tkr"tSy|j|jkSWntk
rNdSYnXdS(NF(uIPv4Addressu__lt__uNotImplementedunetworkuAttributeErroruFalse(uselfuotheruaddress_less((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__lt__^s
uIPv4Interface.__lt__cCs|j|jAt|jj�AS(N(u_ipu
_prefixlenuintunetworkunetwork_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__hash__isuIPv4Interface.__hash__cCs
t|j�S(N(uIPv4Addressu_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuiplsuIPv4Interface.ipcCsd|j|j�|jfS(Nu%s/%s(u_string_from_ip_intu_ipu
_prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuwith_prefixlenpsuIPv4Interface.with_prefixlencCsd|j|j�|jfS(Nu%s/%s(u_string_from_ip_intu_ipunetmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuwith_netmaskusuIPv4Interface.with_netmaskcCsd|j|j�|jfS(Nu%s/%s(u_string_from_ip_intu_ipuhostmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
with_hostmaskzsuIPv4Interface.with_hostmaskN(
u__name__u
__module__u__qualname__u__init__u__str__u__eq__u__lt__u__hash__upropertyuipuwith_prefixlenuwith_netmasku
with_hostmask(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
IPv4Interface<su
IPv4InterfacecBs/|EeZdZdZeZddd�ZdS(uIPv4NetworkueThis class represents and manipulates 32-bit IPv4 network + addresses..

    Attributes: [examples for IPv4Network('192.0.2.0/27')]
        .network_address: IPv4Address('192.0.2.0')
        .hostmask: IPv4Address('0.0.0.31')
        .broadcast_address: IPv4Address('192.0.2.32')
        .netmask: IPv4Address('255.255.255.224')
        .prefixlen: 27

    cCs�tj||�tj||�t|t�r`t|�|_|j|_t|j	�|_
dSt|t�r�t|�|_|j|_t|j	�|_
dSt|�}t|j
|d��|_t|�dkr"y|j|d�|_Wq.tk
r|j|d�|_Yq.Xn|j|_t|j|j��|_
|r�tt|j�t|j
�@�|jkr�td|��q�ntt|j�t|j
�@�|_|j|jdkr�|j|_ndS(uInstantiate a new IPv4 network object.

        Args:
            address: A string or integer representing the IP [& network].
              '192.0.2.0/24'
              '192.0.2.0/255.255.255.0'
              '192.0.0.2/0.0.0.255'
              are all functionally the same in IPv4. Similarly,
              '192.0.2.1'
              '192.0.2.1/255.255.255.255'
              '192.0.2.1/32'
              are also functionally equivalent. That is to say, failing to
              provide a subnetmask will create an object with a mask of /32.

              If the mask (portion after the / in the argument) is given in
              dotted quad form, it is treated as a netmask if it starts with a
              non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it
              starts with a zero field (e.g. 0.255.255.255 == /8), with the
              single exception of an all-zero mask which is treated as a
              netmask == /0. If no mask is given, a default of /32 is used.

              Additionally, an integer can be passed, so
              IPv4Network('192.0.2.1') == IPv4Network(3221225985)
              or, more generally
              IPv4Interface(int(IPv4Interface('192.0.2.1'))) ==
                IPv4Interface('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv4 address.
            ValueError: If strict is True and a network address is not
              supplied.

        Niiiu%s has host bits set(u_BaseV4u__init__u_BaseNetworku
isinstanceubytesuIPv4Addressunetwork_addressu_max_prefixlenu
_prefixlenu	_ALL_ONESunetmaskuintu_split_optional_netmasku_ip_int_from_stringulenu_prefix_from_prefix_stringuNetmaskValueErroru_prefix_from_ip_stringu_ip_int_from_prefixu
ValueErroru__iter__uhosts(uselfuaddressustrictuaddr((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__�s:&
uIPv4Network.__init__NT(u__name__u
__module__u__qualname__u__doc__uIPv4Addressu_address_classuTrueu__init__(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuIPv4Network�suIPv4NetworkcBs�|EeZdZdZdedZdZed�Zdd�Z	dd	�Z
d
d�Zdd
�Zddd�Zdd�Zedd��Zedd��ZdS(u_BaseV6uyBase IPv6 object.

    The following methods are used by IPv6 objects in both single IP
    addresses and networks.

    iiiu0123456789ABCDEFabcdefcCsd|_t|_dS(Ni(u_versionu
IPV6LENGTHu_max_prefixlen(uselfuaddress((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__�s	u_BaseV6.__init__cCs�|std��n|jd�}d}t|�|kr[d||f}t|��nd|dkr�yt|j��j}Wn>tk
r�}ztd||f�d�WYdd}~XnX|jd	|d
?d@�|jd	|d@�n|jd}t|�|kr8d|d|f}t|��nd}xYt	dt|�d�D]>}	||	sX|dk	r�d
|}t|��n|	}qXqXW|dk	rr|}
t|�|d}|ds�|
d8}
|
r�d}t||��q�n|ds,|d8}|r,d}t||��q,n|j|
|}|dkrd}t||jd|f��qn�t|�|jkr�d}t||j|f��n|ds�d}t||��n|ds�d}t||��nt|�}
d}d}y�d}
x5t	|
�D]'}	|
d
K}
|
|j
||	�O}
qW|
d
|K}
x9t	|d�D]'}	|
d
K}
|
|j
||	�O}
qgW|
SWn>tk
r�}ztd||f�d�WYdd}~XnXdS(u�Turn an IPv6 ip_str into an integer.

        Args:
            ip_str: A string, the IPv6 ip_str.

        Returns:
            An int, the IPv6 address

        Raises:
            AddressValueError: if ip_str isn't a valid IPv6 Address.

        uAddress cannot be emptyu:iu At least %d parts expected in %ru.iu%s in %rNu%xii��u!At most %d colons permitted in %ru At most one '::' permitted in %riu0Leading ':' only permitted as part of '::' in %ru1Trailing ':' only permitted as part of '::' in %ru/Expected at most %d other parts with '::' in %ru,Exactly %d parts expected without '::' in %ri����i����i����(uAddressValueErrorusplitulenuIPv4Addressupopu_ipuNoneuappendu
_HEXTET_COUNTurangeu
_parse_hextetu
ValueError(uselfuip_strupartsu
_min_partsumsguipv4_intuexcu
_max_partsu
skip_indexuiuparts_hiuparts_lou
parts_skippeduip_int((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_ip_int_from_string�s�
,
 






#



u_BaseV6._ip_int_from_stringcCs]|jj|�s%td|��nt|�dkrPd}t||��nt|d�S(u&Convert an IPv6 hextet string into an integer.

        Args:
            hextet_str: A string, the number to parse.

        Returns:
            The hextet as an integer.

        Raises:
            ValueError: if the input isn't strictly a hex number from
              [0..FFFF].

        uOnly hex digits permitted in %riu$At most 4 characters permitted in %ri(u_HEX_DIGITSu
issupersetu
ValueErrorulenuint(uselfu
hextet_strumsg((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
_parse_hextet\su_BaseV6._parse_hextetc	Cs�d}d}d}d}xot|�D]a\}}|dkrz|d7}|dkr\|}n||kr�|}|}q�q%d}d}q%W|dkr�||}|t|�kr�|dg7}ndg|||�<|dkr�dg|}q�n|S(	u�Compresses a list of hextets.

        Compresses a list of strings, replacing the longest continuous
        sequence of "0" in the list with "" and adding empty strings at
        the beginning or at the end of the string such that subsequently
        calling ":".join(hextets) will produce the compressed version of
        the IPv6 address.

        Args:
            hextets: A list of strings, the hextets to compress.

        Returns:
            A list of strings.

        iiu0ui����i����i����i����(u	enumerateulen(	uselfuhextetsubest_doublecolon_startubest_doublecolon_lenudoublecolon_startudoublecolon_lenuindexuhextetubest_doublecolon_end((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_compress_hextetsus.
	
u_BaseV6._compress_hextetscs�|d	krt|j�}n||jkr<td��nd|��fdd�tddd�D�}|j|�}dj|�S(
u,Turns a 128-bit integer into hexadecimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            A string, the hexadecimal representation of the address.

        Raises:
            ValueError: The address is bigger than 128 bits of all ones.

        uIPv6 address is too largeu%032xcs1g|]'}dt�||d�d��qS(u%xii(uint(u.0ux(uhex_str(u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
<listcomp>�s	u/_BaseV6._string_from_ip_int.<locals>.<listcomp>ii iu:N(uNoneuintu_ipu	_ALL_ONESu
ValueErrorurangeu_compress_hextetsujoin(uselfuip_intuhextets((uhex_stru./opt/alt/python33/lib64/python3.3/ipaddress.pyu_string_from_ip_int�s

%u_BaseV6._string_from_ip_intcs�t|t�r!t|j�}n-t|t�rBt|j�}nt|�}|j|�}d|��fdd�tddd�D�}t|ttf�r�ddj	|�|j
fSdj	|�S(	u�Expand a shortened IPv6 address.

        Args:
            ip_str: A string, the IPv6 address.

        Returns:
            A string, the expanded IPv6 address.

        u%032xcs$g|]}�||d��qS(i((u.0ux(uhex_str(u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
<listcomp>�s	u8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>ii iu%s/%du:(u
isinstanceuIPv6Networkustrunetwork_addressu
IPv6Interfaceuipu_ip_int_from_stringurangeu_BaseNetworkujoinu
_prefixlen(uselfuip_struip_intuparts((uhex_stru./opt/alt/python33/lib64/python3.3/ipaddress.pyu_explode_shorthand_ip_string�s

%u$_BaseV6._explode_shorthand_ip_stringcCs|jS(N(u_max_prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
max_prefixlen�su_BaseV6.max_prefixlencCs|jS(N(u_version(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuversion�su_BaseV6.versionN(u__name__u
__module__u__qualname__u__doc__u
IPV6LENGTHu	_ALL_ONESu
_HEXTET_COUNTu	frozensetu_HEX_DIGITSu__init__u_ip_int_from_stringu
_parse_hextetu_compress_hextetsuNoneu_string_from_ip_intu_explode_shorthand_ip_stringupropertyu
max_prefixlenuversion(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu_BaseV6�sg/u_BaseV6cBs�|EeZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��ZdS(uIPv6Addressu/Represent and manipulate single IPv6 Addresses.cCs�tj||�tj||�t|t�rI|j|�||_dSt|t�r�|j|d�tj	|d�|_dSt
|�}|j|�|_dS(uInstantiate a new IPv6 address object.

        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv6Address('2001:db8::') ==
                IPv6Address(42540766411282592856903984951653826560)
              or, more generally
              IPv6Address(int(IPv6Address('2001:db8::'))) ==
                IPv6Address('2001:db8::')

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.

        Niubig(u_BaseAddressu__init__u_BaseV6u
isinstanceuintu_check_int_addressu_ipubytesu_check_packed_addressu
from_bytesustru_ip_int_from_string(uselfuaddressuaddr_str((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__�s
	uIPv6Address.__init__cCs
t|j�S(u*The binary representation of this address.(uv6_int_to_packedu_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyupackedsuIPv6Address.packedcCstd�}||kS(u�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        uff00::/8(uIPv6Network(uselfumulticast_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_multicasts	uIPv6Address.is_multicastcs�td�td�td�td�td�td�td�td�td	�td
�td�td�td
�td�td�g}t�fdd�|D��S(u�Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        u::/8u100::/8u200::/7u400::/6u800::/5u1000::/4u4000::/3u6000::/3u8000::/3uA000::/3uC000::/3uE000::/4uF000::/5uF800::/6uFE00::/9c3s|]}�|kVqdS(N((u.0ux(uself(u./opt/alt/python33/lib64/python3.3/ipaddress.pyu	<genexpr>*su*IPv6Address.is_reserved.<locals>.<genexpr>(uIPv6Networkuany(uselfureserved_networks((uselfu./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_reserveds	uIPv6Address.is_reservedcCstd�}||kS(u�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        u	fe80::/10(uIPv6Network(uselfulinklocal_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_link_local,suIPv6Address.is_link_localcCstd�}||kS(u`Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        u	fec0::/10(uIPv6Network(uselfusitelocal_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_site_local7suIPv6Address.is_site_localcCstd�}||kS(u�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per RFC 4193.

        ufc00::/7(uIPv6Network(uselfuprivate_network((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_privateFsuIPv6Address.is_privatecCs
|jdkS(u�Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        i(u_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_unspecifiedQs	uIPv6Address.is_unspecifiedcCs
|jdkS(u�Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        i(u_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_loopback\s	uIPv6Address.is_loopbackcCs(|jd?dkrdSt|jd@�S(u�Return the IPv4 mapped address.

        Returns:
            If the IPv6 address is a v4 mapped address, return the
            IPv4 mapped address. Return None otherwise.

        i i��l��N(u_ipuNoneuIPv4Address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuipv4_mappedgs	uIPv6Address.ipv4_mappedcCs@|jd?dkrdSt|jd?d@�t|jd@�fS(u�Tuple of embedded teredo IPs.

        Returns:
            Tuple of the (server, client) IPs or None if the address
            doesn't appear to be a teredo address (doesn't start with
            2001::/32)

        i`i i@l��N(u_ipuNoneuIPv4Address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuteredots
uIPv6Address.teredocCs,|jd?dkrdSt|jd?d@�S(u�Return the IPv4 6to4 embedded address.

        Returns:
            The IPv4 6to4-embedded address if present or None if the
            address doesn't appear to contain a 6to4 embedded address.

        ipi iPl��N(u_ipuNoneuIPv4Address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu	sixtofour�s	uIPv6Address.sixtofourN(u__name__u
__module__u__qualname__u__doc__u__init__upropertyupackeduis_multicastuis_reservedu
is_link_localu
is_site_localu
is_privateuis_unspecifieduis_loopbackuipv4_mappeduteredou	sixtofour(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuIPv6Address�s%
uIPv6AddresscBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zedd��Z	ed
d��Z
edd��Zedd��Zedd��Z
edd��ZdS(u
IPv6InterfacecCs�t|ttf�rGtj||�t|j�|_|j|_	dSt
|�}tj||d�t|dd�|_|jj|_|jj	|_	|jj
|_
dS(NiustrictF(u
isinstanceubytesuintuIPv6Addressu__init__uIPv6Networku_ipunetworku_max_prefixlenu
_prefixlenu_split_optional_netmaskuFalseunetmaskuhostmask(uselfuaddressuaddr((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__�suIPv6Interface.__init__cCs d|j|j�|jjfS(Nu%s/%d(u_string_from_ip_intu_ipunetworku	prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__str__�suIPv6Interface.__str__cCsZtj||�}|s%|tkr)|Sy|j|jkSWntk
rUdSYnXdS(NF(uIPv6Addressu__eq__uNotImplementedunetworkuAttributeErroruFalse(uselfuotheru
address_equal((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__eq__�s
uIPv6Interface.__eq__cCsStj||�}|tkr"tSy|j|jkSWntk
rNdSYnXdS(NF(uIPv6Addressu__lt__uNotImplementedunetworkuAttributeErroruFalse(uselfuotheruaddress_less((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__lt__�s
uIPv6Interface.__lt__cCs|j|jAt|jj�AS(N(u_ipu
_prefixlenuintunetworkunetwork_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__hash__�suIPv6Interface.__hash__cCs
t|j�S(N(uIPv6Addressu_ip(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuip�suIPv6Interface.ipcCsd|j|j�|jfS(Nu%s/%s(u_string_from_ip_intu_ipu
_prefixlen(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuwith_prefixlen�suIPv6Interface.with_prefixlencCsd|j|j�|jfS(Nu%s/%s(u_string_from_ip_intu_ipunetmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuwith_netmask�suIPv6Interface.with_netmaskcCsd|j|j�|jfS(Nu%s/%s(u_string_from_ip_intu_ipuhostmask(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
with_hostmask�suIPv6Interface.with_hostmaskcCs|jdko|jjS(Ni(u_ipunetworkuis_unspecified(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_unspecified�suIPv6Interface.is_unspecifiedcCs|jdko|jjS(Ni(u_ipunetworkuis_loopback(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuis_loopback�suIPv6Interface.is_loopbackN(u__name__u
__module__u__qualname__u__init__u__str__u__eq__u__lt__u__hash__upropertyuipuwith_prefixlenuwith_netmasku
with_hostmaskuis_unspecifieduis_loopback(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
IPv6Interface�su
IPv6InterfacecBsA|EeZdZdZeZddd�Zedd��Z	dS(uIPv6NetworkuvThis class represents and manipulates 128-bit IPv6 networks.

    Attributes: [examples for IPv6('2001:db8::1000/124')]
        .network_address: IPv6Address('2001:db8::1000')
        .hostmask: IPv6Address('::f')
        .broadcast_address: IPv6Address('2001:db8::100f')
        .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0')
        .prefixlen: 124

    cCs�tj||�tj||�t|t�r`t|�|_|j|_t|j	�|_
dSt|t�r�t|�|_|j|_t|j	�|_
dSt|�}t|j
|d��|_t|�dkr�|j|d�|_n|j|_t|j|j��|_
|ratt|j�t|j
�@�|jkratd|��qantt|j�t|j
�@�|_|j|jdkr�|j|_ndS(u�Instantiate a new IPv6 Network object.

        Args:
            address: A string or integer representing the IPv6 network or the
              IP and prefix/netmask.
              '2001:db8::/128'
              '2001:db8:0000:0000:0000:0000:0000:0000/128'
              '2001:db8::'
              are all functionally the same in IPv6.  That is to say,
              failing to provide a subnetmask will create an object with
              a mask of /128.

              Additionally, an integer can be passed, so
              IPv6Network('2001:db8::') ==
                IPv6Network(42540766411282592856903984951653826560)
              or, more generally
              IPv6Network(int(IPv6Network('2001:db8::'))) ==
                IPv6Network('2001:db8::')

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::1000/124 and not an
              IP address on a network, eg, 2001:db8::1/124.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.

        Niiiu%s has host bits set(u_BaseV6u__init__u_BaseNetworku
isinstanceuintuIPv6Addressunetwork_addressu_max_prefixlenu
_prefixlenu	_ALL_ONESunetmaskubytesu_split_optional_netmasku_ip_int_from_stringulenu_prefix_from_prefix_stringu_ip_int_from_prefixu
ValueErroru__iter__uhosts(uselfuaddressustrictuaddr((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu__init__�s4 uIPv6Network.__init__cCs|jjo|jjS(u`Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        (unetwork_addressu
is_site_localubroadcast_address(uself((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu
is_site_local3suIPv6Network.is_site_localNT(
u__name__u
__module__u__qualname__u__doc__uIPv6Addressu_address_classuTrueu__init__upropertyu
is_site_local(u
__locals__((u./opt/alt/python33/lib64/python3.3/ipaddress.pyuIPv6Network�sHuIPv6Network(!u__doc__u__version__u	functoolsu
IPV4LENGTHu
IPV6LENGTHu
ValueErroruAddressValueErroruNetmaskValueErroru
ip_addressuTrueu
ip_networkuip_interfaceuv4_int_to_packeduv6_int_to_packedu_split_optional_netmasku_find_address_rangeu_count_righthand_zero_bitsusummarize_address_rangeu_collapse_addresses_recursiveucollapse_addressesuget_mixed_type_keyu_TotalOrderingMixinu_IPAddressBaseu_BaseAddressu_BaseNetworku_BaseV4uIPv4Addressu
IPv4InterfaceuIPv4Networku_BaseV6uIPv6Addressu
IPv6InterfaceuIPv6Network(((u./opt/alt/python33/lib64/python3.3/ipaddress.pyu<module>	s>#809!�;���wDd��J

?>