AlkantarClanX12

Your IP : 18.119.137.175


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/ipaddress.cpython-312.opt-2.pyc

�

�Q�fR2��F�	dZddlZdZdZGd�de�ZGd�de�Zd	�Zd1d
�Zd�Z	d�Z
d
�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�ZGd�d�Zdaej*Gd�de��Zej*Gd�de��ZGd�d�Zee_Gd�d�ZGd�d ee�ZGd!�d"e�ZGd#�d$ee�ZGd%�d&�Zee_ee_Gd'�d(�ZGd)�d*ee�Z Gd+�d,e �Z!Gd-�d.ee�Z"Gd/�d0�Z#e#e _e#e"_y)2z1.0�N� �c��eZdZy)�AddressValueErrorN��__name__�
__module__�__qualname__���0/opt/alt/python312/lib64/python3.12/ipaddress.pyrr���/rrc��eZdZy)�NetmaskValueErrorNrrrr
rrrrrc��		t|�S#ttf$rYnwxYw	t|�S#ttf$rYnwxYwt	|�d���)Nz. does not appear to be an IPv4 or IPv6 address)�IPv4Addressrr�IPv6Address�
ValueError��addresss r
�
ip_addressrsl���
��7�#�#���0�1�
��
��
��7�#�#���0�1�
��
����{�"P�Q�
R�R��
� � �
/�A�Ac��		t||�S#ttf$rYnwxYw	t||�S#ttf$rYnwxYwt	|�d���)Nz. does not appear to be an IPv4 or IPv6 network)�IPv4Networkrr�IPv6Networkr)r�stricts  r
�
ip_networkr9sp���
��7�F�+�+���0�1�
��
��
��7�F�+�+���0�1�
��
����{�"P�Q�
R�Rs��!�!�1�A�Ac��		t|�S#ttf$rYnwxYw	t|�S#ttf$rYnwxYwt	|�d���)Nz0 does not appear to be an IPv4 or IPv6 interface)�
IPv4Interfacerr�
IPv6Interfacerrs r
�ip_interfacer!Vsl���(
��W�%�%���0�1�
��
��
��W�%�%���0�1�
��
����{�"R�S�
T�Trc�X�		|jd�S#t$rtd��wxYw)N�z&Address negative or too large for IPv4��to_bytes�
OverflowErrorrrs r
�v4_int_to_packedr'xs;���C�����"�"���C��A�B�B�C����)c�X�		|jd�S#t$rtd��wxYw)N�z&Address negative or too large for IPv6r$rs r
�v6_int_to_packedr+�s;���C�����#�#���C��A�B�B�C�r(c�t�	t|�jd�}t|�dkDrtd|����|S)N�/�zOnly one '/' permitted in )�str�split�lenr)r�addrs  r
�_split_optional_netmaskr3�s<��K��w�<���c�"�D�
�4�y�1�}��"<�W�K� H�I�I��Krc#�K�	t|�}t|�x}}|D](}|j|jdzk7r||f��|}|}�*||f��y�w�N�)�iter�next�_ip)�	addresses�it�first�last�ips     r
�_find_address_ranger?�sb�����
�i��B���8��E�D���
�6�6�T�X�X��\�!���+���E���	�
��+��s�AAc�T�	|dk(r|St|||dz
zj��S)Nrr6)�min�
bit_length)�number�bitss  r
�_count_righthand_zero_bitsrE�s6��	���{����t�v�g����*�6�6�8�9�9rc#�XK�	t|t�rt|t�std��|j|jk7rt|�d|�d���||kDrt	d��|jdk(rt
}n!|jdk(rt}nt	d��|j}|j}|j}||kr`tt||�||z
dzj�dz
�}||||z
f�}|��|d|zz
}|dz
|jk(ry||kr�_yy�w)	Nz1first and last must be IP addresses, not networks� and � are not of the same versionz*last IP address must be greater than firstr#�zunknown IP versionr6)
�
isinstance�_BaseAddress�	TypeError�versionrrr�_max_prefixlenr9rArErB�	_ALL_ONES)r<r=r>�ip_bits�	first_int�last_int�nbits�nets        r
�summarize_address_rangerU�s-�����2��|�
,�
��l�
+��K�L�L��}�}����$����&�'�	'��t�|��E�F�F��}�}���
��	���!�	�
���-�.�.��"�"�G��	�	�I��x�x�H�
�x�
��.�y�'�B��	�)�A�-�9�9�;�a�?�A���)�W�u�_�-�.���	��Q�%�Z��	��q�=�B�L�L�(���x�
�s�D%D*�(D*c#�ZK�	t|�}i}|rU|j�}|j�}|j|�}|�|||<n||k7r||=|j	|�|r�Ud}t|j
��D]$}|�|j|jk\r�|��|}�&y�w�N)�list�pop�supernet�get�append�sorted�values�broadcast_address)r:�to_merge�subnetsrTrZ�existingr=s       r
�_collapse_addresses_internalrc�s������0�I��H��G�
��l�l�n���<�<�>���;�;�x�(���� #�G�H��
��_���!��O�O�H�%���D��g�n�n�&�'�����%�%��)>�)>�>���	���(�s
�A%B+�(AB+c��	g}g}g}|D�]}t|t�rD|r0|dj|jk7rt|�d|d�d���|j	|��X|j
|jk(rO|r0|dj|jk7rt|�d|d�d���	|j	|j���|r0|dj|jk7rt|�d|d�d���|j	|���tt|��}|r.t|�D] \}}|jt||���"t||z�S#t$r|j	|j�Y��wxYw)N���rGrH)rJrK�_versionrLr\�
_prefixlenrNr>�AttributeError�network_addressr]�setr?�extendrUrc)r:�addrs�ips�netsr>r<r=s       r
�collapse_addressesro0sv���"
�E�
�C�
�D����b�,�'��s�2�w�'�'�2�;�;�6��!#�S��W�!.�/�/��J�J�r�N�
�]�]�b�/�/�
/��s�2�w�'�'�2�;�;�6��!#�S��W�!.�/�/�
/��
�
�2�5�5�!���R��)�)�R�[�[�8��!#�T�"�X�!/�0�0��K�K��O�%�*��S��
�C��.�s�3�K�E�4��L�L�0���=�>�4�(����5�5��!"�
/��
�
�2�-�-�.�
/�s�.E"�"$F
�	F
c��	t|t�r|j�St|t�r|j	�St
SrW)rJ�_BaseNetwork�_get_networks_keyrK�_get_address_key�NotImplemented)�objs r
�get_mixed_type_keyrvfsA���"�#�|�$��$�$�&�&�	�C��	&��#�#�%�%��rc���eZdZ	dZed��Zed��Zed��Zed��Zd�Z	d�Z
ed��Zed	��Z
ed
��Zed��Zed��Zed
��Zd�Zy)�_IPAddressBaserc�$�	|j�SrW)�_explode_shorthand_ip_string��selfs r
�explodedz_IPAddressBase.exploded�s��H��0�0�2�2rc��	t|�SrW�r/r{s r
�
compressedz_IPAddressBase.compressed�s��I��4�y�rc�$�	|j�SrW)�_reverse_pointerr{s r
�reverse_pointerz_IPAddressBase.reverse_pointer�s��	��$�$�&�&rc�6�dt|�fz}t|��)Nz%200s has no version specified��type�NotImplementedError�r|�msgs  r
rMz_IPAddressBase.version�s��.�$�t�*��>��!�#�&�&rc��|dkrd}t|||jfz��||jkDr'd}t|||j|jfz��y)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrfrOrN)r|rr�s   r
�_check_int_addressz!_IPAddressBase._check_int_address�sg���Q�;�A�C�#�C�7�D�M�M�*B�$B�C�C��T�^�^�#�F�C�#�C�7�D�4G�4G�+/�=�=�+:�%:�;�
;�$rc�`�t|�}||k7rd}t|||||jfz��y)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r1rrf)r|r�expected_len�address_lenr�s     r
�_check_packed_addressz$_IPAddressBase._check_packed_address�sG���'�l���,�&�J�C�#�C�7�K�+7����+H�%H�I�
I�'rc�<�	|j|j|z	zSrW)rO)�cls�	prefixlens  r
�_ip_int_from_prefixz"_IPAddressBase._ip_int_from_prefix�s!��	��}�}��
�
�� :�;�;rc���	t||j�}|j|z
}||z	}d|zdz
}||k7r1|jdz}|j|d�}d}t||z��|S)Nr6��bigz&Netmask pattern %r mixes zeroes & ones)rErNr%r)	r��ip_int�trailing_zeroesr��leading_ones�all_ones�byteslen�detailsr�s	         r
�_prefix_from_ip_intz"_IPAddressBase._prefix_from_ip_int�s���
	�5�V�58�5G�5G�I���&�&��8�	���0����N�a�'���8�#��)�)�Q�.�H��o�o�h��6�G�:�C��S�7�]�+�+��rc�$�d|z}t|�d�)Nz%r is not a valid netmask)r)r��netmask_strr�s   r
�_report_invalid_netmaskz&_IPAddressBase._report_invalid_netmask�s��)�K�7����$�$�.rc��	|j�r|j�s|j|�	t|�}dcxkr|j
ksn|j|�|S#t$r|j|�Y�FwxYw�Nr)�isascii�isdigitr��intrrN)r��
prefixlen_strr�s   r
�_prefix_from_prefix_stringz)_IPAddressBase._prefix_from_prefix_string�s���
	��%�%�'�M�,A�,A�,C��'�'�
�6�	7��M�*�I��Y�4�#�"4�"4�4��'�'�
�6����	�	7��'�'�
�6�	7�s�A)�)B�Bc�,�		|j|�}	|j�S#t$r|j|�Y�.wxYw#t$rYnwxYw|j
z}	|j|�S#t$r|j|�YywxYwrW)�_ip_int_from_stringrr�r�rrO)r��ip_strr�s   r
�_prefix_from_ip_stringz%_IPAddressBase._prefix_from_ip_string�s���
	�	0��,�,�V�4�F�	��*�*�6�2�2��!�	0��'�'��/�	0���	��	��	�#�-�-���	0��*�*�6�2�2���	0��'�'��/�	0�s2�&�A�A�A�	A�A�%A6�6B�Bc���	t|ttf�r||jfSt|t�st|�}t
|�dkDr|S|d|jfS)Nr6r)rJ�bytesr�rN�tupler3r1)r�rs  r
�_split_addr_prefixz!_IPAddressBase._split_addr_prefixsf��	��g��s�|�,��C�.�.�.�.��'�5�)�.�g�6�G��w�<�!���N��q�z�3�-�-�-�-rc�2�|jt|�ffSrW��	__class__r/r{s r
�
__reduce__z_IPAddressBase.__reduce__-s���~�~��D�	�|�+�+rN)rr	r
�	__slots__�propertyr}r�r�rMr�r��classmethodr�r�r�r�r�r�r�rrr
rxrxs�����I�
�3��3������'��'��'��'�;�I��
<��
<�����0�/��/�����0�0��0�B�.��.�.,rrxc�`��eZdZ	dZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
�fd�Z�xZS)
rKrc��|jSrW�r9r{s r
�__int__z_BaseAddress.__int__>s���x�x�rc��	|j|jk(xr|j|jk(S#t$r	tcYSwxYwrW)r9rfrhrt�r|�others  r
�__eq__z_BaseAddress.__eq__AsF��	"��H�H��	�	�)�8��
�
����7�
9���	"�!�!�	"�s�36�A�Ac���t|t�stS|j|jk7rt	|�d|�d���|j
|j
k7r|j
|j
kSy�NrGrHF)rJrKrtrfrLr9r�s  r
�__lt__z_BaseAddress.__lt__Hs_���%��.�!�!��=�=�E�N�N�*��!�5�*�+�
+��8�8�u�y�y� ��8�8�e�i�i�'�'�rc�h�t|t�stS|jt|�|z�SrW�rJr�rtr�r�s  r
�__add__z_BaseAddress.__add__T�*���%��%�!�!��~�~�c�$�i�%�/�0�0rc�h�t|t�stS|jt|�|z
�SrWr�r�s  r
�__sub__z_BaseAddress.__sub__Yr�rc�L�|jj�dt|��d�S�N�(�)�r�rr/r{s r
�__repr__z_BaseAddress.__repr__^����>�>�2�2�C��I�>�>rc�J�t|j|j��SrW)r/�_string_from_ip_intr9r{s r
�__str__z_BaseAddress.__str__as���4�+�+�D�H�H�5�6�6rc�P�ttt|j���SrW)�hash�hexr�r9r{s r
�__hash__z_BaseAddress.__hash__ds���C��D�H�H�
�&�'�'rc��|j|fSrW�rfr{s r
rsz_BaseAddress._get_address_keygs���
�
�t�$�$rc�4�|j|jffSrW)r�r9r{s r
r�z_BaseAddress.__reduce__js���~�~����{�*�*rc����	|r|ddk(rtt|�|�St�ddl}|j	d�atj|�}|st�|�|�S|j�\}}}|dk(r|jdk(rd}nd}|dk(r
|j}n|jdz}|r||dzd	z
z
}|r|d
z
}tt|�|�d|�|�|���S)Nre�srz(#?)(_?)([xbnX])�nr#�b�xr6r.�0)�formatr/�_address_fmt_re�re�compile�	fullmatch�super�
__format__�groupsrfrNr�)	r|�fmtr��m�	alternate�grouping�fmt_base�padlenr�s	        �r
r�z_BaseAddress.__format__ms����
	��c�"�g��n��#�d�)�S�)�)��"�� �j�j�);�<�O��%�%�c�*����7�%�c�*�*�()���
�%�	�8�X��s�?��}�}��!������s�?��(�(�F��(�(�A�-�F���f��k�A�o�%�F���a�K�F��c�$�i�I�;�a��x��z�(��!L�M�Mr)rr	r
r�r�r�r�r�r�r�r�r�rsr�r��
__classcell__�r�s@r
rKrK3sM�����I��"��1�
1�
?�7�(�%�+�/N�/NrrKc��eZdZ	d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Ze
jd��Ze
jd��Zed
��Zed��Zed��Zed��Zed��Zed��Zd�Zd�Zd�Zd#d�Zd#d�Zed��Zed��Zd�Z d�Z!ed��Z"ed��Z#ed��Z$ed ��Z%ed!��Z&ed"��Z'y)$rqc�L�|jj�dt|��d�Sr�r�r{s r
r�z_BaseNetwork.__repr__�r�rc�8�d|j|jfzS�N�%s/%d)rir�r{s r
r�z_BaseNetwork.__str__�s���$�.�.����?�?�?rc#�K�	t|j�}t|j�}t|dz|�D]}|j	|����y�wr5�r�rir_�range�_address_class�r|�network�	broadcastr�s    r
�hostsz_BaseNetwork.hosts�sS����	��d�*�*�+����.�.�/�	��w��{�I�.�A��%�%�a�(�(�/�s�AAc#�K�t|j�}t|j�}t||dz�D]}|j	|����y�wr5r�r�s    r
�__iter__z_BaseNetwork.__iter__�sL�����d�*�*�+����.�.�/�	��w�	�A�
�.�A��%�%�a�(�(�/�s�AAc��t|j�}t|j�}|dk\r'||z|kDrtd��|j	||z�S|dz
}||z|krtd��|j	||z�S)Nrzaddress out of ranger6)r�rir_�
IndexErrorr�)r|r�r�r�s    r
�__getitem__z_BaseNetwork.__getitem__�s����d�*�*�+����.�.�/�	���6���{�Y�&� �!7�8�8��&�&�w��{�3�3�
��F�A��1�}�w�&� �!7�8�8��&�&�y�1�}�5�5rc�L�t|t�stS|j|jk7rt	|�d|�d���|j
|j
k7r|j
|j
kS|j|jk7r|j|jkSyr�)rJrqrtrfrLri�netmaskr�s  r
r�z_BaseNetwork.__lt__�s����%��.�!�!��=�=�E�N�N�*��!�5�*�+�
+����5�#8�#8�8��'�'�%�*?�*?�?�?��<�<�5�=�=�(��<�<�%�-�-�/�/�rc���	|j|jk(xrF|j|jk(xr+t|j�t|j�k(S#t$r	t
cYSwxYwrW)rfrir�rrhrtr�s  r
r�z_BaseNetwork.__eq__�sk��	"��M�M�U�^�^�3�<��(�(�E�,A�,A�A�<�����%��U�]�]�);�;�
=���	"�!�!�	"�s�A A#�#A5�4A5c�j�tt|j�t|j�z�SrW)r�r�rirr{s r
r�z_BaseNetwork.__hash__�s&���C��,�,�-��D�L�L�0A�A�B�Brc���|j|jk7ryt|t�ry|j|jjz|j
jk(S�NF)rfrJrqr9rrir�s  r
�__contains__z_BaseNetwork.__contains__�sN���=�=�E�N�N�*���e�\�*���9�9�t�|�|�/�/�/�4�3G�3G�3K�3K�K�Krc��	|j|vxs.|j|vxs|j|vxs|j|vSrW�rir_r�s  r
�overlapsz_BaseNetwork.overlaps�sQ��8��#�#�u�,�7��"�"�e�+�
6��%�%��-�5��+�+�t�3�	7rc�v�|jt|j�t|j�z�SrW)r�r�ri�hostmaskr{s r
r_z_BaseNetwork.broadcast_address�s3���"�"�3�t�';�';�#<�#&�t�}�}�#5�$6�7�	7rc�d�|jt|j�|jz�SrW)r�r�rrOr{s r
rz_BaseNetwork.hostmask�s%���"�"�3�t�|�|�#4�t�~�~�#E�F�Frc�8�d|j|jfzSr�)rirgr{s r
�with_prefixlenz_BaseNetwork.with_prefixlen�s���$�.�.����@�@�@rc�8�|j�d|j��S�Nr-)rirr{s r
�with_netmaskz_BaseNetwork.with_netmasks���.�.����=�=rc�8�|j�d|j��Sr)rirr{s r
�
with_hostmaskz_BaseNetwork.with_hostmasks���.�.��
�
�>�>rc�`�	t|j�t|j�z
dzSr5)r�r_rir{s r
�
num_addressesz_BaseNetwork.num_addressess+��4��4�)�)�*�S��1E�1E�-F�F��J�Jrc�6�dt|�fz}t|��)Nz%%200s has no associated address classr�r�s  r
r�z_BaseNetwork._address_classs��
6��d��
�E��!�#�&�&rc��|jSrW)rgr{s r
r�z_BaseNetwork.prefixlens�����rc#�K�	|j|jk(st|�d|�d���t|t�std|z��|j	|�st|�d|����||k(ry|j
|j�d|j���}|j�\}}||k7rv||k7rq|j	|�r|��|j�\}}n=|j	|�r|��|j�\}}ntd|�d|�d|����||k7r||k7r�q||k(r|��y||k(r|��ytd|�d|�d|�����w)	NrGrHz%s is not a network objectz not contained in r-z Error performing exclusion: s1: z s2: z other: )rfrLrJrq�	subnet_ofrr�rir�ra�AssertionError)r|r��s1�s2s    r
�address_excludez_BaseNetwork.address_excludesY����"	�F�}�}����.��!�5�*�+�
+��%��.��8�5�@�A�A����t�$����E�F�F��D�=�����5�+@�+@�+0�?�?�!<�=��������B��E�k�b�E�k����r�"���������B�����$���������B�%�&(�"�e�&5�6�6��E�k�b�E�k���;��H�
�5�[��H�!�"$�b�%�"1�2�
2�s�D(E�+(Ec�*�	|j|jk7rt|�d|�d���|j|jkry|j|jkDry|j|jkry|j|jkDryy)NrGz are not of the same typerer6r)rfrLrirr�s  r
�compare_networksz_BaseNetwork.compare_networksgs���	�@�=�=�E�N�N�*��!�5�*�+�
+����%�"7�"7�7�����%�"7�"7�7���<�<�%�-�-�'���<�<�%�-�-�'��rc�J�	|j|j|jfSrW)rfrirr{s r
rrz_BaseNetwork._get_networks_key�s$��	��
�
�t�3�3�T�\�\�B�BrNc#�K�	|j|jk(r|��y|�9||jkrtd��|dk7rtd��||jz
}|dkrtd��|j|z}||jkDrtd||fz��t|j�}t|j
�dz}t|j�dz|z	}t|||�D]}|j||f�}|���y�w)Nznew prefix must be longerr6�(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s)	rgrNrr�rir_rr�r�)	r|�prefixlen_diff�
new_prefix�
new_prefixlen�start�end�step�new_addr�currents	         r
raz_BaseNetwork.subnets�s!����	�2�?�?�d�1�1�1��J���!��D�O�O�+� �!<�=�=���"� �!K�L�L�'�$�/�/�9�N��A���=�>�>����.�8�
��4�.�.�.��B�!�4�F)�)�*�
*��D�(�(�)���$�(�(�)�A�-���D�M�M�"�Q�&�>�9���e�S�$�/�H��n�n�h�
�%>�?�G��M�0�s�DD
c�v�	|jdk(r|S|�9||jkDrtd��|dk7rtd��|j|z
}|j|z
}|dkrtd|j|fz��|jt	|j
�t	|j�|zz|f�S)Nrznew prefix must be shorterr6r#z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rgrr�r�r�rir)r|r$r%r&s    r
rZz_BaseNetwork.supernet�s���	�(�?�?�a���K��!��D�O�O�+� �!=�>�>���"� �!K�L�L�!�_�_�z�9�N�����7�
��1���M�����0�1�2�
2��~�~���$�$�%��T�\�\�):�n�)L�M����	rc�`�	|jjxr|jjSrW)ri�is_multicastr_r{s r
r.z_BaseNetwork.is_multicast�s1��	��$�$�1�1�4��&�&�3�3�	5rc��	|j|jk7rt|�d|�d���|j|jkxr|j|jk\S#t$rtd|�d|����wxYw)NrGrHz*Unable to test subnet containment between )rfrLrir_rh)�ar�s  r
�
_is_subnet_ofz_BaseNetwork._is_subnet_ofs���	4��z�z�Q�Z�Z�'��1�#�U�1�#�-I� J�K�K��%�%��):�):�:�?��'�'�1�+>�+>�>�
@���	4��'�'(�c��q�c�3�4�
4�	4�s�AA � A;c�(�	|j||�SrW�r1r�s  r
rz_BaseNetwork.subnet_ofs��?��!�!�$��.�.rc�(�	|j||�SrWr3r�s  r
�supernet_ofz_BaseNetwork.supernet_ofs��A��!�!�%��.�.rc�`�	|jjxr|jjSrW)ri�is_reservedr_r{s r
r7z_BaseNetwork.is_reserved�1��	��$�$�0�0�3��&�&�2�2�	4rc�`�	|jjxr|jjSrW)ri�
is_link_localr_r{s r
r:z_BaseNetwork.is_link_local+s1��	��$�$�2�2�5��&�&�4�4�	6rc���	t�fd��jjD��xr(t�fd��jjD��S)Nc3�Z�K�|]"}�j|vxr�j|v���$y�wrWr	)�.0�priv_networkr|s  �r
�	<genexpr>z*_BaseNetwork.is_private.<locals>.<genexpr>?s=�����J�'H�|��'�'�<�7�:��)�)�\�9�:�'H���(+c3�Z�K�|]"}�j|vxr�j|v���$y�wrWr	)r=r�r|s  �r
r?z*_BaseNetwork.is_private.<locals>.<genexpr>As@�����R�$P���(�(��7�:��*�*�'�9�:�#O�r@��any�
_constants�_private_networks�all�_private_networks_exceptionsr{s`r
�
is_privatez_BaseNetwork.is_private6sZ���	��J�'+���'H�'H�J�J��NQ�R�$(�?�?�#O�#O�R�O�	rc��	|jSrW�rHr{s r
�	is_globalz_BaseNetwork.is_globalGs��	��?�?�"�"rc�`�	|jjxr|jjSrW)ri�is_unspecifiedr_r{s r
rMz_BaseNetwork.is_unspecifiedRs1��	��$�$�3�3�6��&�&�5�5�	7rc�`�	|jjxr|jjSrW)ri�is_loopbackr_r{s r
rOz_BaseNetwork.is_loopback^r8r)r6N)(rr	r
r�r�r�r�rr�r�r�rr
�	functools�cached_propertyr_rr�rrrrr�r�rr rrrarZr.�staticmethodr1rr5r7r:rHrKrMrOrrr
rqrq�s����?�@�
)�)�6�
�"�C�
L�7����7��7����G��G��A��A��>��>��?��?��K��K��'��'�����I2�V.�`C�3�j'�R�	5��	5��	4��	4�/�/��	4��	4��6��6����� �#��#��	7��	7��	4��	4rrqc��eZdZgZy)�_BaseConstantsN)rr	r
rErrr
rTrTks���rrTc��eZdZ	dZdZdezdz
ZeZiZd�Z	e
d��Ze
d��Ze
d��Z
e
d	��Zd
�Zed��Zed��Zy
)�_BaseV4rr#r.r6c��t|�SrWrr{s r
rzz$_BaseV4._explode_shorthand_ip_string�s���4�y�rc�n�	||jvrxt|t�r+|}d|cxkr|jks&n|j	|�n	|j|�}t|j|��}||f|j|<|j|S#t$r|j|�}Y�VwxYwr�)
�_netmask_cacherJr�rNr�r�rr�rr��r��argr�rs    r
�
_make_netmaskz_BaseV4._make_netmask�s���	��c�(�(�(��#�s�#��	��Y�<�#�*<�*<�<��/�/�	�:�@� #� >� >�s� C�I�
"�#�"9�"9�)�"D�E�G�&-�y�&8�C���s�#��!�!�#�&�&��
)�@�!$� :� :�3� ?�I�@�s�B�B4�3B4c��	|std��|jd�}t|�dk7rtd|z��	tj	t|j|�d�S#t$r}t|�d|���d�d}~wwxYw)N�Address cannot be empty�.r#zExpected 4 octets in %rr�� in )rr0r1r��
from_bytes�map�_parse_octetr)r�r��octets�excs    r
r�z_BaseV4._ip_int_from_string�s���	��#�$=�>�>����c�"���v�;�!��#�$=��$F�G�G�	J��>�>�#�c�&6�&6��"?��G�G���	J�#�#�v�$>�?�T�I��	J�s�)A'�'	B�0B�Bc�6�	|std��|j�r|j�sd}t||z��t|�dkDrd}t||z��|dk7r|ddk(rd}t||z��t	|d�}|d	kDrtd
|z��|S)NzEmpty octet not permittedz#Only decimal digits permitted in %r�z$At most 3 characters permitted in %rr�rz%Leading zeros are not permitted in %r�
�zOctet %d (> 255) not permitted)rr�r�r1r�)r��	octet_strr��	octet_ints    r
rcz_BaseV4._parse_octet�s���	���8�9�9��!�!�#�	�(9�(9�(;�7�C��S�9�_�-�-��y�>�A��8�C��S�9�_�-�-����	�!��� 3�9�C��S�9�_�-�-��	�2�&�	��s�?��=�	�I�J�J��rc	�b�	djtt|jdd���S)Nr_r#r�)�joinrbr/r%)r�r�s  r
r�z_BaseV4._string_from_ip_int�s*��	��x�x��C�����E�!:�;�<�<rc�l�	t|�jd�ddd�}dj|�dzS)Nr_rez
.in-addr.arpa)r/r0rm)r|�reverse_octetss  r
r�z_BaseV4._reverse_pointer�s8��	�
�T�����-�d��d�3���x�x��'�/�9�9rc��|jSrW�rNr{s r
�
max_prefixlenz_BaseV4.max_prefixlen�����"�"�"rc��|jSrWr�r{s r
rMz_BaseV4.version�����}�}�rN)rr	r
r�rf�
IPV4LENGTHrOrNrYrzr�r\r�rcr�r�r�rrrMrrr
rVrVss�����I��H��J��!�#�I��N��N���'��'�2�J��J�2�!��!�F�
=��
=�:��#��#����rrVc���eZdZ	dZd�Zed��Zed��Zeej�d���Z
eej�d���Zed��Zed��Z
ed	��Zed
��Zy)r)r9�__weakref__c�8�	t|t�r|j|�||_yt|t�r-|j|d�tj
|�|_yt|�}d|vrtd|����|j|�|_y)Nr#r-�Unexpected '/' in )
rJr�r�r9r�r�rar/rr��r|r�addr_strs   r
�__init__zIPv4Address.__init__s���
	��g�s�#��#�#�G�,��D�H���g�u�%��&�&�w��2��~�~�g�.�D�H���w�<���(�?�#�&8���$D�E�E��+�+�H�5��rc�.�	t|j�SrW)r'r9r{s r
�packedzIPv4Address.packed)���8�����)�)rc�4�	||jjvSrW)rD�_reserved_networkr{s r
r7zIPv4Address.is_reserved.s��	��t���8�8�8�8rc���	t�fd��jjD��xr(t�fd��jjD��S)Nc3�&�K�|]}�|v���
y�wrWr�r=rTr|s  �r
r?z)IPv4Address.is_private.<locals>.<genexpr>K������I�'H�����'H���c3�&�K�|]}�|v���
y�wrWrr�s  �r
r?z)IPv4Address.is_private.<locals>.<genexpr>L������\�/[��D��O�/[�r�rBr{s`r
rHzIPv4Address.is_private9sE���
	�
�I�t���'H�'H�I�I�
]��\�t���/[�/[�\�\�	
rc�R�	||jjvxr
|jSrW)rD�_public_networkrHr{s r
rKzIPv4Address.is_globalOs*��	��4�?�?�:�:�:�R�4�?�?�?R�Rrc�4�	||jjvSrW�rD�_multicast_networkr{s r
r.zIPv4Address.is_multicasta���	��t���9�9�9�9rc�6�	||jjk(SrW)rD�_unspecified_addressr{s r
rMzIPv4Address.is_unspecifiedls��	��t���;�;�;�;rc�4�	||jjvSrW)rD�_loopback_networkr{s r
rOzIPv4Address.is_loopbackws��	��t���8�8�8�8rc�4�	||jjvSrW�rD�_linklocal_networkr{s r
r:zIPv4Address.is_link_local����	��t���9�9�9�9rN)rr	r
r�r}r�rr7rP�	lru_cacherHrKr.rMrOr:rrr
rrs���9�&�I�!6�F�*��*��9��9���Y����
���
�(��Y����S���S� �:��:��<��<��9��9��:��:rrc��eZdZd�Zej
d��Zd�Zd�Zd�Z	d�Z
ejZe
d��Ze
d��Ze
d	��Ze
d
��Zy)rc���|j|�\}}tj||�t||fd��|_|jj
|_|jj|_y�NF)r)r�rr}rr�rrg�r|rr2�masks    r
r}zIPv4Interface.__init__��Z���,�,�W�5�
��d����T�4�(�"�D�$�<��>����|�|�+�+����,�,�1�1��rc�.�|jjSrW�r�rr{s r
rzIPv4Interface.hostmask�����|�|�$�$�$rc�V�d|j|j�|jfzSr��r�r9rgr{s r
r�zIPv4Interface.__str__�s,���$�2�2�4�8�8�<��/�/�+�+�	+rc��tj||�}|tus|s|S	|j|jk(S#t$rYywxYwr)rr�rtr�rh�r|r��
address_equals   r
r�zIPv4Interface.__eq__��P��#�*�*�4��7�
��N�*�-� � �	��<�<�5�=�=�0�0���	��		���=�	A	�A	c���tj||�}|turtS	|j|jkxs|j|jk(xr|S#t$rYywxYwr)rr�rtr�rh�r|r��address_lesss   r
r�zIPv4Interface.__lt__�sl��"�)�)�$��6���>�)�!�!�	��L�L�5�=�=�0�C��L�L�E�M�M�1�B�l�
D���	��	�s�7A�	A*�)A*c��t|j|jt|jj
�f�SrW�r�r9rgr�r�rir{s r
r�zIPv4Interface.__hash__��+���T�X�X�t����D�L�L�4P�4P�0Q�R�S�Src�,�t|j�SrW)rr9r{s r
r>zIPv4Interface.ip�����4�8�8�$�$rc�V�|j|j��d|j��Srr�r{s r
rzIPv4Interface.with_prefixlen��%���2�2�4�8�8�<��/�/�+�	+rc�V�|j|j��d|j��Sr�r�r9rr{s r
rzIPv4Interface.with_netmask��%���2�2�4�8�8�<��,�,�(�	(rc�V�|j|j��d|j��Sr�r�r9rr{s r
rzIPv4Interface.with_hostmask��%���2�2�4�8�8�<��-�-�)�	)rN)rr	r
r}rPrQrr�r�r�r�rxr�r�r>rrrrrr
rr�s���2����%��%�+�
�
�T� �*�*�J�
�%��%��+��+��(��(��)��)rrc�R�eZdZ	eZdd�Zeej�d���Z	y)rc���	|j|�\�}t��|_|j|�\|_|_t
|j�}|t
|j�z|k7r6|rtd|z��t|t
|j�z�|_|j
|jdz
k(r|j|_
y|j
|jk(r�fd�|_
yy)N�%s has host bits setr6c���t��gSrW)r�r2s�r
�<lambda>z&IPv4Network.__init__.<locals>.<lambda>�
���+�d�"3�!4r)r�rrir\rrgr�rrNr�r��r|rrr�rr2s     @r
r}zIPv4Network.__init__�s����!	�D�,�,�W�5�
��d�*�4�0���(,�(:�(:�4�(@�%���d�o��T�)�)�*���C����%�%��/�� �!7�$�!>�?�?�'2�6�36�t�|�|�3D�4E�(F��$��?�?�t�2�2�Q�6�7����D�J�
�_�_��!4�!4�
5�4�D�J�6rc��	|jtd�vxr|jtd�vxr
|jS)N�
100.64.0.0/10)rirr_rHr{s r
rKzIPv4Network.is_globalsO��	��)�)�[��-I�I�K��*�*�k�/�.J�J�L�$��O�O�#�	%rN�T)
rr	r
rr�r}r�rPr�rKrrr
rr�s;��	�!�N�25�h��Y����
%���
%rrc�T�eZdZed�Zed�Zed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�ed
�ed�ed�ed�gZed�ed�gZ	ed�Z
ed�Zy)�_IPv4Constantsz169.254.0.0/16z127.0.0.0/8z224.0.0.0/4r�z	0.0.0.0/8z
10.0.0.0/8z
172.16.0.0/12z192.0.0.0/24z192.0.0.170/31z192.0.2.0/24z192.168.0.0/16z
198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z240.0.0.0/4z255.255.255.255/32z192.0.0.9/32z
192.0.0.10/32z0.0.0.0N)
rr	r
rr�r�r�r�rErGr�rr�rrr
r�r�!s���$�%5�6��#�M�2��$�]�3��!�/�2�O�
	�K� ��L�!��M�"��$�%��O�$��N�#��$�%��N�#��$�%��O�$��%�&��$�%��M�"��(�)�
��$	�N�#��O�$�$� �
$�M�2��&�y�1�rr�c���eZdZ	dZdZdezdz
ZdZed�Z	eZ
iZed��Z
ed��Zed	��Zed
��Zedd��Zd
�Zd�Zed��Zed��Zed��Zy)�_BaseV6rrIr.r6r��0123456789ABCDEFabcdefc�,�	||jvrwt|t�r+|}d|cxkr|jks%n|j	|�n|j|�}t
|j|��}||f|j|<|j|Sr�)rYrJr�rNr�r�rr�rZs    r
r\z_BaseV6._make_netmask_s���	��c�(�(�(��#�s�#��	��Y�<�#�*<�*<�<��/�/�	�:��:�:�3�?�	�!�#�"9�"9�)�"D�E�G�&-�y�&8�C���s�#��!�!�#�&�&rc�H�	|std��|jd�}d}t|�|krd||fz}t|��d|dvrU	t|j	��j
}|j
d|d	z	d
zz�|j
d|d
zz�|jdz}t|�|kDrd|dz
|fz}t|��d}tdt|�dz
�D]}	||	r�	|�d
|z}t|��|	}�|��|}
t|�|z
dz
}|ds|
dz}
|
rd}t||z��|ds|dz}|rd}t||z��|j|
|zz
}|dkr�d}t||jdz
|fz��t|�|jk7rd}t||j|fz��|dsd}t||z��|dsd}t||z��t|�}
d}d}	d}
t|
�D]}	|
d	z}
|
|j||	�z}
� |
d	|zz}
t|d�D]}	|
d	z}
|
|j||	�z}
� |
S#t$r}t|�d|���d�d}~wwxYw#t$r}t|�d|���d�d}~wwxYw)Nr^�:rgz At least %d parts expected in %rr_rer`�%xr*�r6z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r)rr0r1rrYr9r\�
_HEXTET_COUNTr��
_parse_hextetr)r�r��parts�
_min_partsr��ipv4_intre�
_max_parts�
skip_index�i�parts_hi�parts_lo�
parts_skippedr�s              r
r�z_BaseV6._ip_int_from_stringss4��	��#�$=�>�>����S�!���
��u�:�
�"�4�
�F�7K�K�C�#�C�(�(��%��)��
N�&�u�y�y�{�3�7�7��
�L�L��(�b�.�F�!:�;�<��L�L���F�!2�3�4�
�&�&��*�
��u�:�
�"�5��A��v�8N�N�C�#�C�(�(��
��q�#�e�*�q�.�)�A���8��)�<�v�E�C�+�C�0�0��
�
*��!�!�H��5�z�J�.��2�H���8��A�
���L�C�+�C�&�L�9�9���9��A�
���M�C�+�C�&�L�9�9��-�-��H�1D�E�M��q� �G��'��s�/@�/@��/B�F�.K�(K�L�L�
�5�z�S�.�.�.�D��'��s�/@�/@�&�.I�(I�J�J���8�H��'��f��5�5���9�I��'��f��5�5��5�z�H��H��M�	J��F��8�_���2�
���#�+�+�E�!�H�5�5��%�
�r�M�)�)�F��H�9�a�(���2�
���#�+�+�E�!�H�5�5��)��M��O%�
N�'�c�6�(B�C��M��
N��P�	J�#�#�v�$>�?�T�I��	J�s1�
#I �:A%J� 	I?�)I:�:I?�	J!�J�J!c��	|jj|�std|z��t|�dkDrd}t||z��t	|d�S)NzOnly hex digits permitted in %rr#z$At most 4 characters permitted in %rr*)�_HEX_DIGITS�
issupersetrr1r�)r��
hextet_strr�s   r
r�z_BaseV6._parse_hextet�s\��	����)�)�*�5��>��K�L�L��z�?�Q��8�C��S�:�-�.�.��:�r�"�"rc���	d}d}d}d}t|�D]%\}}|dk(r|dz
}|dk(r|}||kDs�|}|}�"d}d}�'|dkDr*||z}|t|�k(r|dgz
}dg||||dk(rdg|z}|S)Nrerr�r6�)�	enumerater1)	r��hextets�best_doublecolon_start�best_doublecolon_len�doublecolon_start�doublecolon_len�index�hextet�best_doublecolon_ends	         r
�_compress_hextetsz_BaseV6._compress_hextets�s���	�"$�� ������&�w�/�M�E�6���}��1�$��$��*�(-�%�"�%9�9�+:�(�->�*�"#��$&�!�0� �!�#�$:�$8�%9� �$�s�7�|�3��B�4���DF�4�G�*�+?�@�%��*��$��.���rNc
��	|�t|j�}||jkDrtd��d|z}t	ddd�D�cgc]}dt|||dzd�z��}}|j|�}dj
|�Scc}w)	NzIPv6 address is too large�%032xrrr#r�r*r�)r�r9rOrr�r�rm)r�r��hex_strr�r�s     r
r�z_BaseV6._string_from_ip_int%s���	��>�����\�F��C�M�M�!��8�9�9��F�"��;@��B��?�K�?�a�4�#�g�a��!��n�b�1�1�?��K��'�'��0���x�x�� � ��Ls�Bc��	t|t�rt|j�}n1t|t�rt|j
�}nt|�}|j
|�}d|z}tddd�D�cgc]
}|||dz��}}t|ttf�r ddj|�|jfzSdj|�Scc}w)Nr�rrr#r�r�)rJrr/rir r>r�r�rqrmrg)r|r�r�r�r�r�s      r
rzz$_BaseV6._explode_shorthand_ip_string?s���	��d�K�(���-�-�.�F�
��m�
,�����\�F���Y�F��)�)�&�1���F�"��).�q�"�a��9��A���1�Q�3����9��d�\�=�9�:��c�h�h�u�o�t���?�?�?��x�x�����:s�>Cc�p�	|jddd�jdd�}dj|�dzS)Nrer�r�r_z	.ip6.arpa)r}�replacerm)r|�
reverse_charss  r
r�z_BaseV6._reverse_pointerTs<��	�
�
�
�d��d�+�3�3�C��<�
��x�x�
�&��4�4rc�n�	|jd�\}}}|sd}||fS|rd|vrtd|z��||fS)N�%zInvalid IPv6 address: "%r")�	partitionr)r�r2�sep�scope_ids    r
�_split_scope_idz_BaseV6._split_scope_id]sZ��
	�%�.�.�s�3���c�8���H��X�~���S�H�_�#�$@�6�$I�J�J��X�~�rc��|jSrWrqr{s r
rrz_BaseV6.max_prefixlenqrsrc��|jSrWr�r{s r
rMz_BaseV6.versionururrW)rr	r
r�rf�
IPV6LENGTHrOr��	frozensetr�rNrYr�r\r�r�r�r�rzr�rRr�r�rrrMrrr
r�r�Ks�����I��H��J��!�#�I��M��4�5�K��N��N��'��'�&�eJ��eJ�N�#��#�2�-��-�^�!��!�2�*5�����&�#��#����rr�c�8��eZdZ	dZd�Z�fd�Zd�Z�fd�Zd�Ze	d��Z
e	d��Ze	d	��Ze	d
��Z
e	d��Ze	d��Ze	ej"�d
���Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Z�xZS)r)r9�	_scope_idrxc��	t|t�r |j|�||_d|_yt|t
�r5|j
|d�tj|d�|_d|_yt|�}d|vrtd|����|j|�\}|_|j|�|_y)Nr*r�r-rz)rJr�r�r9r�r�r�rar/rr�r�r{s   r
r}zIPv6Address.__init__�s���	�"�g�s�#��#�#�G�,��D�H�!�D�N���g�u�%��&�&�w��3��~�~�g�u�5�D�H�!�D�N���w�<���(�?�#�&8���$D�E�E�#'�#7�#7��#A� ��$�.��+�+�H�5��rc�`��t�|��}|jr|dz|jzS|S)Nr�)r�r�r�)r|r�r�s  �r
r�zIPv6Address.__str__�s-������"��04���v��|�d�n�n�,�J�F�Jrc�D�t|j|jf�SrW)r�r9r�r{s r
r�zIPv6Address.__hash__�s���T�X�X�t�~�~�.�/�/rc�x��t�|�|�}|turtS|sy|jt	|dd�k(S)NFr�)r�r�rtr��getattr)r|r�r�r�s   �r
r�zIPv6Address.__eq__�s=������u�-�
��N�*�!�!����~�~����T�!B�B�Brc�2�|jt|�ffSrWr�r{s r
r�zIPv6Address.__reduce__�s������T���-�-rc��	|jSrW)r�r{s r
r�zIPv6Address.scope_id�s��	��~�~�rc�.�	t|j�SrW)r+r9r{s r
rzIPv6Address.packed�r�rc�4�	||jjvSrWr�r{s r
r.zIPv6Address.is_multicast�r�rc�V��	t�fd��jjD��S)Nc3�&�K�|]}�|v���
y�wrWr)r=r�r|s  �r
r?z*IPv6Address.is_reserved.<locals>.<genexpr>�s�����I�&H��4�1�9�&H�r�)rCrD�_reserved_networksr{s`r
r7zIPv6Address.is_reserved�s%���	��I�d�o�o�&H�&H�I�I�Irc�4�	||jjvSrWr�r{s r
r:zIPv6Address.is_link_local�r�rc�4�	||jjvSrW)rD�_sitelocal_networkr{s r
�
is_site_localzIPv6Address.is_site_local�s��		��t���9�9�9�9rc����	�j}|�|jSt�fd��jjD��xr(t�fd��jjD��S)Nc3�&�K�|]}�|v���
y�wrWrr�s  �r
r?z)IPv6Address.is_private.<locals>.<genexpr>r�r�c3�&�K�|]}�|v���
y�wrWrr�s  �r
r?z)IPv6Address.is_private.<locals>.<genexpr>r�r�)�ipv4_mappedrHrCrDrErFrG�r|rs` r
rHzIPv6Address.is_private�sb���
	��&�&���"��)�)�)��I�t���'H�'H�I�I�
]��\�t���/[�/[�\�\�	
rc��	|jSrWrJr{s r
rKzIPv6Address.is_globals��	��?�?�"�"rc�"�	|jdk(Sr�r�r{s r
rMzIPv6Address.is_unspecified#s��	��x�x�1�}�rc�V�	|j}|�|jS|jdk(Sr5)rrOr9rs  r
rOzIPv6Address.is_loopback.s4��	��&�&���"��*�*�*��x�x�1�}�rc�Z�	|jdz	dk7ryt|jdz�S)Nrr�����r9rr{s r
rzIPv6Address.ipv4_mapped<s0��	�
�H�H��N�v�%���4�8�8�j�0�1�1rc��	|jdz	dk7ryt|jdz	dz�t|jdz�fS)N�`i �@rrr{s r
�teredozIPv6Address.teredoIsN��	�
�H�H��N�z�)���T�X�X��^�z�9�:��T�X�X�I�
�2�3�5�	5rc�`�	|jdz	dk7ryt|jdz	dz�S)N�pi �Prrr{s r
�	sixtofourzIPv6Address.sixtofourXs4��	�
�H�H��O��&���D�H�H��N�j�8�9�9r)rr	r
r�r}r�r�r�r�r�r�rr.r7r:rrPr�rHrKrMrOrrrr�r�s@r
rrzs@���9�3�I�&6�PK�0�C�.��	��	��*��*��:��:��J��J��:��:��:��:���Y����
���
�.�#��#� ���������
2��
2��5��5��
:��
:rrc����eZdZd�Zej
d��Z�fd�Zd�Zd�Z	d�Z
ejZe
d��Ze
d��Ze
d	��Ze
d
��Ze
d��Ze
�fd��Z�xZS)
r c���|j|�\}}tj||�t||fd��|_|jj
|_|jj|_yr�)r�rr}rr�rrgr�s    r
r}zIPv6Interface.__init__hr�rc�.�|jjSrWr�r{s r
rzIPv6Interface.hostmaskpr�rc�>��dt�|��|jfzSr�)r�r�rg�r|r�s �r
r�zIPv6Interface.__str__ts%����%�'�/�+��/�/�+�+�	+rc��tj||�}|tus|s|S	|j|jk(S#t$rYywxYwr)rr�rtr�rhr�s   r
r�zIPv6Interface.__eq__xr�r�c���tj||�}|tur|S	|j|jkxs|j|jk(xr|S#t$rYywxYwr)rr�rtr�rhr�s   r
r�zIPv6Interface.__lt__�sl��"�)�)�$��6���>�)���	��L�L�5�=�=�0�C��L�L�E�M�M�1�B�l�
D���	��	�s�7A�	A&�%A&c��t|j|jt|jj
�f�SrWr�r{s r
r�zIPv6Interface.__hash__�r�rc�,�t|j�SrW)rr9r{s r
r>zIPv6Interface.ip�r�rc�V�|j|j��d|j��Srr�r{s r
rzIPv6Interface.with_prefixlen�r�rc�V�|j|j��d|j��Srr�r{s r
rzIPv6Interface.with_netmask�r�rc�V�|j|j��d|j��Srr�r{s r
rzIPv6Interface.with_hostmask�r�rc�P�|jdk(xr|jjSr�)r9r�rMr{s r
rMzIPv6Interface.is_unspecified�s���x�x�1�}�<����!<�!<�<rc�H��t�|�xr|jjSrW)r�rOr�r#s �r
rOzIPv6Interface.is_loopback�s����w�"�?�t�|�|�'?�'?�?r)rr	r
r}rPrQrr�r�r�r�rxr�r�r>rrrrMrOr�r�s@r
r r fs����2����%��%�+�
�
�T� �*�*�J�
�%��%��+��+��(��(��)��)��=��=��@��@rr c�0�eZdZ	eZdd�Zd�Zed��Zy)rc���	|j|�\�}t��|_|j|�\|_|_t
|j�}|t
|j�z|k7r6|rtd|z��t|t
|j�z�|_|j
|jdz
k(r|j|_
y|j
|jk(r�fd�|_
yy)Nr�r6c���t��gSrW)rr�s�r
r�z&IPv6Network.__init__.<locals>.<lambda>�r�r)r�rrir\rrgr�rrNr�r�r�s     @r
r}zIPv6Network.__init__�s����	�<�,�,�W�5�
��d�*�4�0���(,�(:�(:�4�(@�%���d�o��T�)�)�*���C����%�%��/�� �!7�$�!>�?�?�'2�6�36�t�|�|�3D�4E�(F��$��?�?�t�2�2�Q�6�7����D�J�
�_�_�� 3� 3�
3�4�D�J�4rc#�K�	t|j�}t|j�}t|dz|dz�D]}|j	|����y�wr5r�r�s    r
r�zIPv6Network.hosts�sW����	��d�*�*�+����.�.�/�	��w��{�I��M�2�A��%�%�a�(�(�3�s�AAc�`�	|jjxr|jjSrW)rirr_r{s r
rzIPv6Network.is_site_local�s1��		��$�$�2�2�5��&�&�4�4�	6rNr�)	rr	r
rr�r}r�r�rrrr
rr�s-��	�!�N�.5�`
)��6��6rrc��eZdZed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�g
Zed�ed
�ed�ed�ed�ed�gZed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed �gZed!�Z	y")#�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z64:ff9b:1::/48z100::/64z	2001::/23z
2001:db8::/32z	2002::/16zfc00::/7z
2001:1::1/128z
2001:1::2/128z2001:3::/32z2001:4:112::/48z2001:20::/28z2001:30::/28z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)
rr	r
rr�r�rErGrr
rrr
r3r3
	s6��$�[�1��$�Z�0��
	�I���H���O�$��$�%��J���K� ��O�$��K� ��J���K� �
��	�O�$��O�$��M�"��%�&��N�#��N�#�
$� �	�F��[��3��I���I� 6��I���J� 7��J���Z�!8��J���Z�!8��J���Z�!8��J���Z�!8��J��	��%�[�1�rr3r�)$�__version__rPrvr�rrrrrr!r'r+r3r?rErUrcrorvrxr��total_orderingrKrqrTrDrVrrrr�r�rr rr3rrr
�<module>r6s�������
�
�
�
�0�
�0�0�
�0�S�:S�:U�DC�(
C� ��(
:� 4�n.�b36�l�2o,�o,�d��
���hN�>�hN��hN�V���H4�>�H4��H4�V��
)���J�J�ZI:�'�<�I:�X@)�K�@)�FO%�'�<�O%�d#2�#2�L(���'���l�l�^	i:�'�<�i:�XH@�K�H@�VY6�'�<�Y6�x*2�*2�Z(���'��r