ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/ipaddress.cpython-311.opt-2.pyc

�

�fC%���	dZddlZdZdZGd�de��ZGd�de��Zd	�Zd2d�Zd�Z	d
�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�ZGd�d��ZdaejGd�de����ZejGd�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"Gd0�d1��Z#e#e _e#e"_dS)3z1.0�N� �c��eZdZdS)�AddressValueErrorN��__name__�
__module__�__qualname__���0/opt/alt/python311/lib64/python3.11/ipaddress.pyrr�������/�/rrc��eZdZdS)�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_addressrs����
��7�#�#�#���0�1�
�
�
���
����
��7�#�#�#���0�1�
�
�
���
������Q�Q�Q�
R�
R�R���&�&�9�A
�A
Tc���		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_networkr9s����
��7�F�+�+�+���0�1�
�
�
���
����
��7�F�+�+�+���0�1�
�
�
���
������Q�Q�Q�
R�
R�Rs��'�'�;�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!Vs����(
��W�%�%�%���0�1�
�
�
���
����
��W�%�%�%���0�1�
�
�
���
������S�S�S�
T�
T�Trc�j�		|�d��S#t$rtd���wxYw)N�z&Address negative or too large for IPv4��to_bytes�
OverflowErrorrrs r
�v4_int_to_packedr'xsO���C�����"�"�"���C�C�C��A�B�B�B�C������2c�j�		|�d��S#t$rtd���wxYw)N�z&Address negative or too large for IPv6r$rs r
�v6_int_to_packedr+�sO���C�����#�#�#���C�C�C��A�B�B�B�C���r(c��	t|���d��}t|��dkrtd|�����|S)N�/�zOnly one '/' permitted in )�str�split�lenr)r�addrs  r
�_split_optional_netmaskr3�sI��K��w�<�<���c�"�"�D�
�4�y�y�1�}�}�� H�W� H� H�I�I�I��Krc#�K�	t|��}t|��x}}|D]}|j|jdzkr||fV�|}|}� ||fV�dS�N�)�iter�next�_ip)�	addresses�it�first�last�ips     r
�_find_address_ranger?�s|�����
�i���B���8�8��E�D�����
�6�T�X��\�!�!���+�����E����
��+�����rc�f�	|dkr|St|||dz
z�����S)Nrr6)�min�
bit_length)�number�bitss  r
�_count_righthand_zero_bitsrE�s>��	���{�{����t�v�g����*�6�6�8�8�9�9�9rc#�lK�	t|t��rt|t��std���|j|jkrt|�d|�d����||krt	d���|jdkrt
}n"|jdkrt}nt	d���|j}|j}|j}||krmtt||��||z
dz���dz
��}||||z
f��}|V�|d|zz
}|dz
|jkrdS||k�kdSdS)	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��|�
,�
,�M�
��l�
+�
+�M��K�L�L�L��}���$�$��������&�'�'�	'��t�|�|��E�F�F�F��}����
���	��!�	�	�
����-�.�.�.��"�G��	�I��x�H�
�x�
�
��.�y�'�B�B��	�)�A�-�9�9�;�;�a�?�A�A���b�)�W�u�_�-�.�.���	�	�	��Q�%�Z��	��q�=�B�L�(�(��E��x�
�
�
�
�
�
rc#�zK�	t|��}i}|re|���}|���}|�|��}|�|||<n||kr||=|�|��|�ed}t|�����D]}|�|j|jkr�|V�|}�dS�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�n���<�<�>�>���;�;�x�(�(���� #�G�H���
��_�_���!��O�O�H�%�%�%��	&��D��g�n�n�&�&�'�'�������%��)>�>�>���	�	�	�����rc�L�	g}g}g}|D�]2}t|t��rI|r1|dj|jkrt|�d|d�d����|�|���a|j|jkry|r1|dj|jkrt|�d|d�d����	|�|j����#t$r|�|j	��Y��wxYw|r1|dj|jkrt|�d|d�d����|�|����4tt|����}|r8t|��D](\}}|�
t||�����)t||z��S)N���rGrH)rJrK�_versionrLr\�
_prefixlenrNr>�AttributeError�network_addressr]�setr?�extendrUrc)r:�addrs�ips�netsr>r<r=s       r
�collapse_addressesro0s����"
�E�
�C�
�D������b�,�'�'�	��
/�s�2�w�'�2�;�6�6��!#���S��W�W�W�!.�/�/�/��J�J�r�N�N�N�N�
�]�b�/�
/�
/��
/�s�2�w�'�2�;�6�6��!#���S��W�W�W�!.�/�/�/�
/��
�
�2�5�!�!�!�!��!�
/�
/�
/��
�
�2�-�.�.�.�.�.�
/�����
0��R��)�R�[�8�8��!#���T�"�X�X�X�!/�0�0�0��K�K��O�O�O�O���S���
�
�C��?�.�s�3�3�	?�	?�K�E�4��L�L�0���=�=�>�>�>�>�'����5�5�5s�/C
�
$C1�0C1c��	t|t��r|���St|t��r|���St
SrW)rJ�_BaseNetwork�_get_networks_keyrK�_get_address_key�NotImplemented)�objs r
�get_mixed_type_keyrvfsW���"�#�|�$�$�&��$�$�&�&�&�	�C��	&�	&�&��#�#�%�%�%��rc��eZdZ	dZed���Zed���Zed���Zed���Zd�Z	d�Z
ed���Zed	���Z
ed
���Zed���Zed���Zed
���Zd�ZdS)�_IPAddressBaserc�,�	|���SrW)�_explode_shorthand_ip_string��selfs r
�explodedz_IPAddressBase.exploded�s��H��0�0�2�2�2rc�"�	t|��SrW�r/r{s r
�
compressedz_IPAddressBase.compressed�s��I��4�y�y�rc�,�	|���SrW)�_reverse_pointerr{s r
�reverse_pointerz_IPAddressBase.reverse_pointer�s��	��$�$�&�&�&rc�F�dt|��fz}t|���)Nz%200s has no version specified��type�NotImplementedError�r|�msgs  r
rMz_IPAddressBase.version�s"��.�$�t�*�*��>��!�#�&�&�&rc��|dkrd}t|||jfz���||jkr!d}t|||j|jfz���dS)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�sn���Q�;�;�A�C�#�C�7�D�M�*B�$B�C�C�C��T�^�#�#�F�C�#�C�7�D�4G�+/�=�+:�%:�;�;�
;�$�#rc�j�t|��}||krd}t|||||jfz���dS)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�sS���'�l�l���,�&�&�J�C�#�C�7�K�+7���+H�%H�I�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
}||kr4|jdz}|�|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�I�I���&��8�	���0����N�a�'���8�#�#��)�Q�.�H��o�o�h��6�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�@�	|���r|���s|�|��	t|��}n%#t$r|�|��YnwxYwd|cxkr|jksn|�|��|S�Nr)�isascii�isdigitr��intrrN)r��
prefixlen_strr�s   r
�_prefix_from_prefix_stringz)_IPAddressBase._prefix_from_prefix_string�s���
	��%�%�'�'�	7�M�,A�,A�,C�,C�	7��'�'�
�6�6�6�	7��M�*�*�I�I���	7�	7�	7��'�'�
�6�6�6�6�6�	7�����Y�4�4�4�4�#�"4�4�4�4�4��'�'�
�6�6�6��s�A�A2�1A2c�T�		|�|��}n%#t$r|�|��YnwxYw	|�|��S#t$rYnwxYw||jz}	|�|��S#t$r|�|��YdSwxYwrW)�_ip_int_from_stringrr�r�rrO)r��ip_strr�s   r
�_prefix_from_ip_stringz%_IPAddressBase._prefix_from_ip_string�s���
	�	0��,�,�V�4�4�F�F�� �	0�	0�	0��'�'��/�/�/�/�/�	0����	��*�*�6�2�2�2���	�	�	��D�	����	�#�-���	0��*�*�6�2�2�2���	0�	0�	0��'�'��/�/�/�/�/�/�	0���s/��;�;�A�
A!� A!�/B�B'�&B'c���	t|ttf��r	||jfSt|t��st|��}t
|��dkr|S|d|jfS)Nr6r)rJ�bytesr�rN�tupler3r1)r�rs  r
�_split_addr_prefixz!_IPAddressBase._split_addr_prefixsx��	��g��s�|�,�,�	/��C�.�.�.��'�5�)�)�	7�.�g�6�6�G��w�<�<�!����N��q�z�3�-�-�-rc�0�|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
rxrxsY��������I�
�3�3��X�3�����X���'�'��X�'��'�'��X�'�;�;�;�I�I�I��
<�
<��[�
<�����[��0�/�/��[�/�����[��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�rc�r�	|j|jko|j|jkS#t$r
tcYSwxYwrW)r9rfrhrt�r|�others  r
�__eq__z_BaseAddress.__eq__AsP��	"��H��	�)�8��
���7�
9���	"�	"�	"�!�!�!�!�	"���s�"�6�6c���t|t��stS|j|jkrt	|�d|�d����|j|jkr|j|jkSdS�NrGrHF)rJrKrtrfrLr9r�s  r
�__lt__z_BaseAddress.__lt__Hsp���%��.�.�	"�!�!��=�E�N�*�*��!�T�T�5�5�5�*�+�+�
+��8�u�y� � ��8�e�i�'�'��urc��t|t��stS|�t|��|z��SrW�rJr�rtr�r�s  r
�__add__z_BaseAddress.__add__T�7���%��%�%�	"�!�!��~�~�c�$�i�i�%�/�0�0�0rc��t|t��stS|�t|��|z
��SrWr�r�s  r
�__sub__z_BaseAddress.__sub__Yr�rc�@�|jj�dt|���d�S�N�(�)�r�rr/r{s r
�__repr__z_BaseAddress.__repr__^�"���>�2�2�2�C��I�I�I�I�>�>rc�P�t|�|j����SrW)r/�_string_from_ip_intr9r{s r
�__str__z_BaseAddress.__str__as ���4�+�+�D�H�5�5�6�6�6rc�^�ttt|j������SrW)�hash�hexr�r9r{s r
�__hash__z_BaseAddress.__hash__ds ���C��D�H�
�
�&�&�'�'�'rc��|j|fSrW�rfr{s r
rsz_BaseAddress._get_address_keygs���
�t�$�$rc� �|j|jffSrW)r�r9r{s r
r�z_BaseAddress.__reduce__js���~���{�*�*rc���	|r|ddkrtt|��|��St�ddl}|�d��at�|��}|s!t
���|��S|���\}}}|dkr|j	dkrd}nd}|dkr|j
}n
|j
dz}|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�n��#�d�)�)�S�)�)�)��"��I�I�I� �j�j�);�<�<�O��%�%�c�*�*���	+��7�7�%�%�c�*�*�*�()���
�
�%�	�8�X��s�?�?��}��!�!�������s�?�?��(�F�F��(�A�-�F��	&��f��k�A�o�%�F��	��a�K�F��c�$�i�i�I�!L�!L��!L��!L�(�!L�!L�M�M�Mr)rr	r
r�r�r�r�r�r�r�r�r�rsr�r��
__classcell__�r�s@r
rKrK3s����������I����"�"�"����1�1�1�
1�1�1�
?�?�?�7�7�7�(�(�(�%�%�%�+�+�+�/N�/N�/N�/N�/N�/N�/N�/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'dS)%rqc�@�|jj�dt|���d�Sr�r�r{s r
r�z_BaseNetwork.__repr__�r�rc�$�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]}|�|��V��dSr5�r�rir_�range�_address_class�r|�network�	broadcastr�s    r
�hostsz_BaseNetwork.hosts�sq����	��d�*�+�+����.�/�/�	��w��{�I�.�.�	)�	)�A��%�%�a�(�(�(�(�(�(�	)�	)rc#�K�t|j��}t|j��}t||dz��D]}|�|��V��dSr5r�r�s    r
�__iter__z_BaseNetwork.__iter__�sj�����d�*�+�+����.�/�/�	��w�	�A�
�.�.�	)�	)�A��%�%�a�(�(�(�(�(�(�	)�	)rc�(�t|j��}t|j��}|dkr0||z|krtd���|�||z��S|dz
}||z|krtd���|�||z��S)Nrzaddress out of ranger6)r�rir_�
IndexErrorr�)r|r�r�r�s    r
�__getitem__z_BaseNetwork.__getitem__�s����d�*�+�+����.�/�/�	���6�6���{�Y�&�&� �!7�8�8�8��&�&�w��{�3�3�3�
��F�A��1�}�w�&�&� �!7�8�8�8��&�&�y�1�}�5�5�5rc��t|t��stS|j|jkrt	|�d|�d����|j|jkr|j|jkS|j|jkr|j|jkSdSr�)rJrqrtrfrLri�netmaskr�s  r
r�z_BaseNetwork.__lt__�s����%��.�.�	"�!�!��=�E�N�*�*��!�T�T�5�5�5�*�+�+�
+���5�#8�8�8��'�%�*?�?�?��<�5�=�(�(��<�%�-�/�/��urc���	|j|jko9|j|jko)t|j��t|j��kS#t$r
t
cYSwxYwrW)rfrir�rrhrtr�s  r
r�z_BaseNetwork.__eq__�su��	"��M�U�^�3�<��(�E�,A�A�<����%�%��U�]�);�);�;�
=���	"�	"�	"�!�!�!�!�	"���s�A	A�A �A c�n�tt|j��t|j��z��SrW)r�r�rirr{s r
r�z_BaseNetwork.__hash__�s*���C��,�-�-��D�L�0A�0A�A�B�B�Brc��|j|jkrdSt|t��rdS|j|jjz|jjkS�NF)rfrJrqr9rrir�s  r
�__contains__z_BaseNetwork.__contains__�sM���=�E�N�*�*��5��e�\�*�*�	L��5��9�t�|�/�/�4�3G�3K�K�Krc�L�	|j|vp|j|vp|j|vp|j|vSrW�rir_r�s  r
�overlapsz_BaseNetwork.overlaps�sE��8��#�u�,�7��"�e�+�
6��%��-�5��+�t�3�	7rc�z�|�t|j��t|j��z��SrW)r�r�ri�hostmaskr{s r
r_z_BaseNetwork.broadcast_address�s9���"�"�3�t�';�#<�#<�#&�t�}�#5�#5�$6�7�7�	7rc�`�|�t|j��|jz��SrW)r�r�rrOr{s r
rz_BaseNetwork.hostmask�s'���"�"�3�t�|�#4�#4�t�~�#E�F�F�Frc�$�d|j|jfzSr�)rirgr{s r
�with_prefixlenz_BaseNetwork.with_prefixlen�s���$�.���@�@�@rc�$�|j�d|j��S�Nr-)rirr{s r
�with_netmaskz_BaseNetwork.with_netmasks���.�.�.����=�=rc�$�|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�-F�-F�F��J�Jrc�F�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|jkst|�d|�d����t|t��std|z���|�|��st|�d|�����||krdS|�|j�d|j����}|�	��\}}||kr�||kr�|�|��r|V�|�	��\}}nI|�|��r|V�|�	��\}}ntd|�d|�d|�����||kr||k��||kr|V�dS||kr|V�dStd|�d|�d|�����)	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_excludes�����"	�F�}���.�.��!�T�T�5�5�5�*�+�+�
+��%��.�.�	B��8�5�@�A�A�A����t�$�$�	G�������E�F�F�F��D�=�=��F����5�+@�+@�+@�+0�?�?�!<�=�=���������B��E�k�k�b�E�k�k����r�"�"�

6������������B�B�����$�$�
6������������B�B�%�n�&(�b�b�"�"�"�e�e�&5�6�6�6��E�k�k�b�E�k�k���;�;��H�H�H�H�H�
�5�[�[��H�H�H�H�H�!�.�"$�"�"�b�b�b�%�%�"1�2�2�
2rc���	|j|jkrt|�d|�d����|j|jkrdS|j|jkrdS|j|jkrdS|j|jkrdSdS)NrGz are not of the same typerer6r)rfrLrirr�s  r
�compare_networksz_BaseNetwork.compare_networksgs���	�@�=�E�N�*�*��!�T�T�5�5�5�*�+�+�
+���%�"7�7�7��2���%�"7�7�7��1��<�%�-�'�'��2��<�%�-�'�'��1��qrc�,�	|j|j|jfSrW)rfrirr{s r
rrz_BaseNetwork._get_networks_key�s��	��
�t�3�T�\�B�Brr6Nc#�K�	|j|jkr|V�dS|�9||jkrtd���|dkrtd���||jz
}|dkrtd���|j|z}||jkrtd||fz���t|j��}t|j��dz}t|j��dz|z	}t|||��D]}|�||f��}|V��dS)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�sR����	�2�?�d�1�1�1��J�J�J��F��!��D�O�+�+� �!<�=�=�=���"�"� �!K�L�L�L�'�$�/�9�N��A����=�>�>�>���.�8�
��4�.�.�.��B�!�4�F)�)�*�*�
*��D�(�)�)���$�(�)�)�A�-���D�M�"�"�Q�&�>�9���e�S�$�/�/�	�	�H��n�n�h�
�%>�?�?�G��M�M�M�M�	�	rc�h�	|jdkr|S|�9||jkrtd���|dkrtd���|j|z
}|j|z
}|dkrtd|j|fz���|�t	|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�+�+� �!=�>�>�>���"�"� �!K�L�L�L�!�_�z�9�N����7�
��1����M����0�1�2�2�
2��~�~���$�%�%��T�\�):�):�n�)L�M�����	rc�4�	|jjo|jjSrW)ri�is_multicastr_r{s r
r.z_BaseNetwork.is_multicast�s%��	��$�1�4��&�3�	5rc���	|j|jkrt|�d|�d����|j|jko|j|jkS#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�Q�Z�'�'��1� J� J�1� J� J� J�K�K�K��%��):�:�?��'�1�+>�>�
@���	4�	4�	4��3�'(�3�3�/0�3�3�4�4�
4�	4���s�AA� A'c�0�	|�||��SrW�r1r�s  r
rz_BaseNetwork.subnet_ofs��?��!�!�$��.�.�.rc�0�	|�||��SrWr3r�s  r
�supernet_ofz_BaseNetwork.supernet_ofs��A��!�!�%��.�.�.rc�4�	|jjo|jjSrW)ri�is_reservedr_r{s r
r7z_BaseNetwork.is_reserved�%��	��$�0�3��&�2�	4rc�4�	|jjo|jjSrW)ri�
is_link_localr_r{s r
r:z_BaseNetwork.is_link_local+s%��	��$�2�5��&�4�	6rc�P��	t�fd��jjD����S)Nc3�<�K�|]}�j|vo�j|vV��dSrWr	)�.0�priv_networkr|s  �r
�	<genexpr>z*_BaseNetwork.is_private.<locals>.<genexpr>?sW�����J�J�#��'�<�7�:��)�\�9�J�J�J�J�J�Jr��any�
_constants�_private_networksr{s`r
�
is_privatez_BaseNetwork.is_private6sQ���	��J�J�J�J�'+��'H�J�J�J�J�J�	Jrc��	|jSrW�rDr{s r
�	is_globalz_BaseNetwork.is_globalC���	��?�"�"rc�4�	|jjo|jjSrW)ri�is_unspecifiedr_r{s r
rJz_BaseNetwork.is_unspecifiedNs%��	��$�3�6��&�5�	7rc�4�	|jjo|jjSrW)ri�is_loopbackr_r{s r
rLz_BaseNetwork.is_loopbackZr8r)r6N)(rr	r
r�r�r�r�rr�r�r�rr
�	functools�cached_propertyr_rr�rrrrr�r�rr rrrarZr.�staticmethodr1rr5r7r:rDrGrJrLrrr
rqrq�s��������?�?�?�@�@�@�
)�
)�
)�)�)�)�6�6�6�
�
�
�"�"�"�C�C�C�
L�
L�
L�7�7�7���7�7���7���G�G���G��A�A��X�A��>�>��X�>��?�?��X�?��K�K��X�K��'�'��X�'�����X��I2�I2�I2�V.�.�.�`C�C�C�3�3�3�3�j'�'�'�'�R�	5�	5��X�	5��	4�	4��\�	4�/�/�/�/�/�/��	4�	4��X�	4��6�6��X�6��
J�
J��X�
J��#�#��X�#��	7�	7��X�	7��	4�	4��X�	4�	4�	4rrqc��eZdZgZdS)�_BaseConstantsN)rr	r
rCrrr
rQrQgs���������rrQc��eZdZ	dZdZdezdz
ZeZiZd�Z	e
d���Ze
d���Ze
d���Z
e
d	���Zd
�Zed���Zed���Zd
S)�_BaseV4rr#r.r6c� �t|��SrWrr{s r
rzz$_BaseV4._explode_shorthand_ip_string�s���4�y�y�rc��	||jvr�t|t��r,|}d|cxkr|jksn|�|��n<	|�|��}n%#t$r|�|��}YnwxYwt|�	|����}||f|j|<|j|Sr�)
�_netmask_cacherJr�rNr�r�rr�rr��r��argr�rs    r
�
_make_netmaskz_BaseV4._make_netmask�s���	��c�(�(�(��#�s�#�#�
@��	��Y�<�<�<�<�#�*<�<�<�<�<��/�/�	�:�:�:��@� #� >� >�s� C� C�I�I��(�@�@�@�!$� :� :�3� ?� ?�I�I�I�@����"�#�"9�"9�)�"D�"D�E�E�G�&-�y�&8�C��s�#��!�#�&�&s�
A#�#B�Bc�F�	|std���|�d��}t|��dkrtd|z���	t�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�G�	J��>�>�#�c�&6��"?�"?��G�G�G���	J�	J�	J�#�#�#�#�v�v�$>�?�?�T�I�����	J���s�-A<�<
B �B�B c��	|std���|���r|���sd}t||z���t|��dkrd}t||z���|dkr |ddkrd}t||z���t	|d��}|d	krtd
|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
r`z_BaseV4._parse_octet�s���	��	:��8�9�9�9��!�!�#�#�	.�	�(9�(9�(;�(;�	.�7�C��S�9�_�-�-�-��y�>�>�A���8�C��S�9�_�-�-�-�����	�!��� 3� 3�9�C��S�9�_�-�-�-��	�2�&�&�	��s�?�?��=�	�I�J�J�J��rc	�|�	d�tt|�dd������S)Nr\r#r�)�joinr_r/r%)r�r�s  r
r�z_BaseV4._string_from_ip_int�s3��	��x�x��C�����E�!:�!:�;�;�<�<�<rc��	t|���d��ddd�}d�|��dzS)Nr\rez
.in-addr.arpa)r/r0rj)r|�reverse_octetss  r
r�z_BaseV4._reverse_pointer�sB��	�
�T������-�-�d�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�
IPV4LENGTHrOrNrVrzr�rYr�r`r�r�r�rorMrrr
rSrSos��������I��H��J��!�#�I��N��N�����'�'��[�'�2�J�J��[�J�2�!�!��[�!�F�
=�
=��[�
=�:�:�:��#�#��X�#�����X���rrSc��eZdZ	dZd�Zed���Zed���Zeej	��d�����Z
eej	��d�����Zed���Zed���Z
ed	���Zed
���ZdS)r)r9�__weakref__c��	t|t��r|�|��||_dSt|t��r7|�|d��t�|��|_dSt|��}d|vrtd|�����|�	|��|_dS)Nr#r-�Unexpected '/' in )
rJr�r�r9r�r�r^r/rr��r|r�addr_strs   r
�__init__zIPv4Address.__init__s���
	��g�s�#�#�	��#�#�G�,�,�,��D�H��F��g�u�%�%�	��&�&�w��2�2�2��~�~�g�.�.�D�H��F��w�<�<���(�?�?�#�$D��$D�$D�E�E�E��+�+�H�5�5����rc�,�	t|j��SrW)r'r9r{s r
�packedzIPv4Address.packed%���8����)�)�)rc� �	||jjvSrW)rB�_reserved_networkr{s r
r7zIPv4Address.is_reserved*s��	��t��8�8�8rc�P��	t�fd��jjD����S)Nc3� �K�|]}�|vV��	dSrWr�r=rTr|s  �r
r?z)IPv4Address.is_private.<locals>.<genexpr>?�'�����L�L�3�4�3�;�L�L�L�L�L�Lrr@r{s`r
rDzIPv4Address.is_private5s2���	��L�L�L�L�$�/�*K�L�L�L�L�L�Lrc�.�||jjvo|jSrW)rB�_public_networkrDr{s r
rGzIPv4Address.is_globalAs���4�?�:�:�R�4�?�?R�Rrc� �	||jjvSrW�rB�_multicast_networkr{s r
r.zIPv4Address.is_multicastF���	��t��9�9�9rc�$�	||jjkSrW)rB�_unspecified_addressr{s r
rJzIPv4Address.is_unspecifiedQs��	��t��;�;�;rc� �	||jjvSrW)rB�_loopback_networkr{s r
rLzIPv4Address.is_loopback\s��	��t��8�8�8rc� �	||jjvSrW�rB�_linklocal_networkr{s r
r:zIPv4Address.is_link_localf���	��t��9�9�9rN)rr	r
r�rzr�r|r7rM�	lru_cacherDrGr.rJrLr:rrr
rr�s6������9�&�I�!6�!6�!6�F�*�*��X�*��9�9��X�9���Y����M�M����X�M���Y����S�S����X�S��:�:��X�:��<�<��X�<��9�9��X�9��:�:��X�:�:�:rrc��eZdZd�Zejd���Zd�Zd�Zd�Z	d�Z
ejZe
d���Ze
d���Ze
d	���Ze
d
���ZdS)rc���|�|��\}}t�||��t||fd���|_|jj|_|jj|_dS�NF)r)r�rrzrr�rrg�r|rr2�masks    r
rzzIPv4Interface.__init__s�c���,�,�W�5�5�
��d����T�4�(�(�(�"�D�$�<��>�>�>����|�+����,�1����rc��|jjSrW�r�rr{s r
rzIPv4Interface.hostmask{�
���|�$�$rc�J�d|�|j��|jfzSr��r�r9rgr{s r
r�zIPv4Interface.__str__s+���$�2�2�4�8�<�<��/�+�+�	+rc��t�||��}|tus|s|S	|j|jkS#t$rYdSwxYwr)rr�rtr�rh�r|r��
address_equals   r
r�zIPv4Interface.__eq__��e��#�*�*�4��7�7�
��N�*�*�-�*� � �	��<�5�=�0�0���	�	�	��5�5�		�����:�
A�Ac��t�||��}|turtS	|j|jkp|j|jko|S#t$rYdSwxYwr)rr�rtr�rh�r|r��address_lesss   r
r�zIPv4Interface.__lt__�sz��"�)�)�$��6�6���>�)�)�!�!�	��L�5�=�0�C��L�E�M�1�B�l�
D���	�	�	��5�5�	���s�!A�
A�Ac�h�t|j|jt|jj��f��SrW�r�r9rgr�r�rir{s r
r�zIPv4Interface.__hash__��(���T�X�t���D�L�4P�0Q�0Q�R�S�S�Src�*�t|j��SrW)rr9r{s r
r>zIPv4Interface.ip�����4�8�$�$�$rc�J�|�|j���d|j��Srr�r{s r
rzIPv4Interface.with_prefixlen��,���2�2�4�8�<�<�<�<��/�/�+�	+rc�J�|�|j���d|j��Sr�r�r9rr{s r
rzIPv4Interface.with_netmask��,���2�2�4�8�<�<�<�<��,�,�(�	(rc�J�|�|j���d|j��Sr�r�r9rr{s r
rzIPv4Interface.with_hostmask��,���2�2�4�8�<�<�<�<��-�-�)�	)rN)rr	r
rzrMrNrr�r�r�r�rxr�r�r>rrrrrr
rrqs�������2�2�2���%�%���%�+�+�+�
�
�
�
�
�
�T�T�T� �*�J�
�%�%��X�%��+�+��X�+��(�(��X�(��)�)��X�)�)�)rrc�\�eZdZ	eZdd�Zeej��d�����Z	dS)rTc���	|�|��\�}t���|_|�|��\|_|_t
|j��}|t
|j��z|kr=|rtd|z���t|t
|j��z��|_|j|jdz
kr|j	|_
dS|j|jkr�fd�|_
dSdS)N�%s has host bits setr6c�$��t���gSrW)r�r2s�r
�<lambda>z&IPv4Network.__init__.<locals>.<lambda>�����+�d�"3�"3�!4�r)r�rrirYrrgr�rrNr�r��r|rrr�r|r2s     @r
rzzIPv4Network.__init__�s���!	�D�,�,�W�5�5�
��d�*�4�0�0���(,�(:�(:�4�(@�(@�%���d�o��T�)�*�*���C���%�%�%��/�/��
F� �!7�$�!>�?�?�?�'2�6�36�t�|�3D�3D�4E�(F�(F��$��?�t�2�Q�6�7�7���D�J�J�J�
�_��!4�
5�
5�4�4�4�4�D�J�J�J�6�
5rc�n�	|jtd��vo|jtd��vo|jS)N�
100.64.0.0/10)rirr_rDr{s r
rGzIPv4Network.is_global�sM��	��)�[��-I�-I�I�K��*�k�/�.J�.J�J�L�$��O�#�	%rN�T)
rr	r
rr�rzr�rMr�rGrrr
rr�sf������	�!�N�25�25�25�25�h��Y����
%�
%����X�
%�
%�
%rrc��eZdZed��Zed��Zed��Zed��Zed��ed��ed��ed��ed��ed��ed	��ed
��ed��ed��ed
��ed��ed��ed��gZed��Z	e
d��ZdS)�_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/29z192.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/32z0.0.0.0N)rr	r
rr�r�r�r�rCrrr�rrr
r�r�s8������$��%5�6�6��#��M�2�2��$��]�3�3��!�k�/�2�2�O�	��K� � ���L�!�!���M�"�"���$�%�%���O�$�$���N�#�#���$�%�%���N�#�#���$�%�%���O�$�$���%�&�&���$�%�%���M�"�"���(�)�)�
��"$��M�2�2��&�;�y�1�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���ZdS)�_BaseV6rrIr.r6r��0123456789ABCDEFabcdefc�8�	||jvr�t|t��r,|}d|cxkr|jksn|�|��n|�|��}t
|�|����}||f|j|<|j|Sr�)rVrJr�rNr�r�rr�rWs    r
rYz_BaseV6._make_netmask=s���	��c�(�(�(��#�s�#�#�
@��	��Y�<�<�<�<�#�*<�<�<�<�<��/�/�	�:�:�:���:�:�3�?�?�	�!�#�"9�"9�)�"D�"D�E�E�G�&-�y�&8�C��s�#��!�#�&�&rc��	|std���|�d��}d}t|��|krd||fz}t|���d|dvr�	t|�����j}n'#t$r}t|�d|����d�d}~wwxYw|�d|d	z	d
zz��|�d|d
zz��|jdz}t|��|krd|dz
|fz}t|���d}tdt|��dz
��D]"}	||	s|�d
|z}t|���|	}�#|��|}
t|��|z
dz
}|ds|
dz}
|
rd}t||z���|ds|dz}|rd}t||z���|j|
|zz
}|dkrd}t||jdz
|fz���n~t|��|jkrd}t||j|fz���|dsd}t||z���|dsd}t||z���t|��}
d}d}	d}
t|
��D]%}	|
d	z}
|
|�	||	��z}
�&|
d	|zz}
t|d��D]%}	|
d	z}
|
|�	||	��z}
�&|
S#t$r}t|�d|����d�d}~wwxYw)Nr[�:rdz 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_intrb�
_max_parts�
skip_index�i�parts_hi�parts_lo�
parts_skippedr�s              r
r�z_BaseV6._ip_int_from_stringQs���	��	?�#�$=�>�>�>����S�!�!���
��u�:�:�
�"�"�4�
�F�7K�K�C�#�C�(�(�(��%��)���
N�&�u�y�y�{�{�3�3�7����$�
N�
N�
N�'�c�c�c�6�6�(B�C�C��M�����
N�����L�L��(�b�.�F�!:�;�<�<�<��L�L���F�!2�3�4�4�4�
�&��*�
��u�:�:�
�"�"�5��A��v�8N�N�C�#�C�(�(�(��
��q�#�e�*�*�q�.�)�)�	�	�A���8�
��)�<�v�E�C�+�C�0�0�0��
���!�!�H��5�z�z�J�.��2�H���8�
:��A�
���:�L�C�+�C�&�L�9�9�9���9�
:��A�
���:�M�C�+�C�&�L�9�9�9��-��H�1D�E�M��q� � �G��'��s�/@��/B�F�.K�(K�L�L�L�!��5�z�z�S�.�.�.�D��'��s�/@�&�.I�(I�J�J�J���8�
6�H��'��f��5�5�5���9�
6�I��'��f��5�5�5��5�z�z�H��H��M�	J��F��8�_�_�
6�
6���2�
���#�+�+�E�!�H�5�5�5����r�M�)�)�F��H�9�a�(�(�
6�
6���2�
���#�+�+�E�!�H�5�5�5����M���	J�	J�	J�#�#�#�#�v�v�$>�?�?�T�I�����	J���s1�&B�
B)�B$�$B)�0A7K(�(
L�2L�Lc���	|j�|��std|z���t|��dkrd}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�sq��	���)�)�*�5�5�	M��>��K�L�L�L��z�?�?�Q���8�C��S�:�-�.�.�.��:�r�"�"�"rc��	d}d}d}d}t|��D]'\}}|dkr|dz
}|dkr|}||kr|}|}�#d}d}�(|dkr2||z}|t|��kr|dgz
}dg|||�<|dkrdg|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�9�+:�(�->�*��"#��$&�!�!��!�#�#�$:�$8�%9� �$�s�7�|�|�3�3��B�4���DF�4�G�*�+?�?�@�%��*�*��$��.���rNc���	|�t|j��}||jkrtd���d|z��fd�t	ddd��D��}|�|��}d�|��S)NzIPv6 address is too large�%032xc	�L��g|] }dt�||dz�d��z��!S)r�r#r*)r��r=r��hex_strs  �r
�
<listcomp>z/_BaseV6._string_from_ip_int.<locals>.<listcomp>s4���K�K�K�a�4�#�g�a��!��e�n�b�1�1�1�K�K�Krrrr#r�)r�r9rOrr�r�rj)r�r�r�r�s   @r
r�z_BaseV6._string_from_ip_ints����	��>����\�\�F��C�M�!�!��8�9�9�9��F�"��K�K�K�K�5��B��?�?�K�K�K���'�'��0�0���x�x�� � � rc����	t|t��rt|j��}n9t|t��rt|j��}nt|��}|�|��}d|z��fd�tddd��D��}t|ttf��rdd�	|��|j
fzSd�	|��S)Nr�c�*��g|]}�||dz���S)r#rr�s  �r
r�z8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>0s%���9�9�9�A���1�Q�3���9�9�9rrrr#r�r�)rJrr/rir r>r�r�rqrjrg)r|r�r�r�r�s    @r
rzz$_BaseV6._explode_shorthand_ip_strings����	��d�K�(�(�	���-�.�.�F�F�
��m�
,�
,�	����\�\�F�F���Y�Y�F��)�)�&�1�1���F�"��9�9�9�9��q�"�a���9�9�9���d�\�=�9�:�:�	@��c�h�h�u�o�o�t��?�?�?��x�x����rc�|�	|jddd��dd��}d�|��dzS)Nrer�r�r\z	.ip6.arpa)r}�replacerj)r|�
reverse_charss  r
r�z_BaseV6._reverse_pointer5sB��	�
�
�d�d��d�+�3�3�C��<�<�
��x�x�
�&�&��4�4rc�x�	|�d��\}}}|sd}n|rd|vrtd|z���||fS)N�%zInvalid IPv6 address: "%r")�	partitionr)r�r2�sep�scope_ids    r
�_split_scope_idz_BaseV6._split_scope_id>sb��
	�%�.�.�s�3�3���c�8��	K��H�H��	K�S�H�_�_�#�$@�6�$I�J�J�J��X�~�rc��|jSrWrnr{s r
roz_BaseV6.max_prefixlenRrprc��|jSrWr�r{s r
rMz_BaseV6.versionVrrrrW)rr	r
r�rf�
IPV6LENGTHrOr��	frozensetr�rNrVr�rYr�r�r�r�rzr�rOr�r�rorMrrr
r�r�)sU��������I��H��J��!�#�I��M��)�4�5�5�K��N��N��'�'��[�'�&�eJ�eJ��[�eJ�N�#�#��[�#�2�-�-��[�-�^�!�!�!��[�!�2���05�5�5�����\��&�#�#��X�#�����X���rr�c���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_idruc���	t|t��r%|�|��||_d|_dSt|t
��r?|�|d��t�|d��|_d|_dSt|��}d|vrtd|�����|�
|��\}|_|�|��|_dS)Nr*r�r-rw)rJr�r�r9r�r�r�r^r/rr�r�rxs   r
rzzIPv6Address.__init__as���	�"�g�s�#�#�	��#�#�G�,�,�,��D�H�!�D�N��F��g�u�%�%�	��&�&�w��3�3�3��~�~�g�u�5�5�D�H�!�D�N��F��w�<�<���(�?�?�#�$D��$D�$D�E�E�E�#'�#7�#7��#A�#A� ��$�.��+�+�H�5�5����rc�p��t�����}|jr
|dz|jzn|S)Nr�)r�r�r�)r|r�r�s  �r
r�zIPv6Address.__str__�s3��������"�"��04��J�v��|�d�n�,�,�F�Jrc�8�t|j|jf��SrW)r�r9r�r{s r
r�zIPv6Address.__hash__�s���T�X�t�~�.�/�/�/rc���t���|��}|turtS|sdS|jt	|dd��kS)NFr�)r�r�rtr��getattr)r|r�r�r�s   �r
r�zIPv6Address.__eq__�sO��������u�-�-�
��N�*�*�!�!��	��5��~����T�!B�!B�B�Brc�0�|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
r|zIPv6Address.packed�r}rc� �	||jjvSrWr�r{s r
r.zIPv6Address.is_multicast�r�rc�P��	t�fd��jjD����S)Nc3� �K�|]}�|vV��	dSrWr)r=r�r|s  �r
r?z*IPv6Address.is_reserved.<locals>.<genexpr>�s'�����I�I��4�1�9�I�I�I�I�I�Ir)rArB�_reserved_networksr{s`r
r7zIPv6Address.is_reserved�s2���	��I�I�I�I�d�o�&H�I�I�I�I�I�Irc� �	||jjvSrWr�r{s r
r:zIPv6Address.is_link_local�r�rc� �	||jjvSrW)rB�_sitelocal_networkr{s r
�
is_site_localzIPv6Address.is_site_local�s��		��t��9�9�9rc�p��	�j}|�|jSt�fd��jjD����S)Nc3� �K�|]}�|vV��	dSrWrr�s  �r
r?z)IPv6Address.is_private.<locals>.<genexpr>�r�r)�ipv4_mappedrDrArBrC)r|rs` r
rDzIPv6Address.is_private�sI���	��&���"��)�)��L�L�L�L�$�/�*K�L�L�L�L�L�Lrc��	|jSrWrFr{s r
rGzIPv6Address.is_global�rHrc��	|jdkSr�r�r{s r
rJzIPv6Address.is_unspecified����	��x�1�}�rc��	|jdkSr5r�r{s r
rLzIPv6Address.is_loopbackrrc�R�	|jdz	dkrdSt|jdz��S)Nrr�����r9rr{s r
rzIPv6Address.ipv4_mappeds4��	�
�H��N�v�%�%��4��4�8�j�0�1�1�1rc��	|jdz	dkrdSt|jdz	dz��t|jdz��fS)N�`i �@rrr{s r
�teredozIPv6Address.teredosS��	�
�H��N�z�)�)��4��T�X��^�z�9�:�:��T�X�I�
�2�3�3�5�	5rc�X�	|jdz	dkrdSt|jdz	dz��S)N�pi �Prrr{s r
�	sixtofourzIPv6Address.sixtofour's8��	�
�H��O��&�&��4��D�H��N�j�8�9�9�9r)rr	r
r�rzr�r�r�r�r�r�r|r.r7r:r	rMr�rDrGrJrLrrrr�r�s@r
rr[s�������9�3�I�&6�&6�&6�PK�K�K�K�K�0�0�0�C�C�C�C�C�.�.�.��	�	��X�	��*�*��X�*��:�:��X�:��J�J��X�J��:�:��X�:��:�:��X�:���Y����M�M����X�M��#�#��X�#�����X������X���
2�
2��X�
2��5�5��X�5��
:�
:��X�
:�
:�
:�
:�
:rrc����eZdZd�Zejd���Z�fd�Zd�Zd�Z	d�Z
ejZe
d���Ze
d���Ze
d	���Ze
d
���Ze
d���Ze
d���Z�xZS)
r c���|�|��\}}t�||��t||fd���|_|jj|_|jj|_dSr�)r�rrzrr�rrgr�s    r
rzzIPv6Interface.__init__7r�rc��|jjSrWr�r{s r
rzIPv6Interface.hostmask?r�rc�X��dt�����|jfzSr�)r�r�rg)r|r�s �r
r�zIPv6Interface.__str__Cs*����%�'�'�/�/�+�+��/�+�+�	+rc��t�||��}|tus|s|S	|j|jkS#t$rYdSwxYwr)rr�rtr�rhr�s   r
r�zIPv6Interface.__eq__Gr�r�c��t�||��}|tur|S	|j|jkp|j|jko|S#t$rYdSwxYwr)rr�rtr�rhr�s   r
r�zIPv6Interface.__lt__Ssz��"�)�)�$��6�6���>�)�)���	��L�5�=�0�C��L�E�M�1�B�l�
D���	�	�	��5�5�	���s�!A
�

A�Ac�h�t|j|jt|jj��f��SrWr�r{s r
r�zIPv6Interface.__hash___r�rc�*�t|j��SrW)rr9r{s r
r>zIPv6Interface.ipdr�rc�J�|�|j���d|j��Srr�r{s r
rzIPv6Interface.with_prefixlenhr�rc�J�|�|j���d|j��Srr�r{s r
rzIPv6Interface.with_netmaskmr�rc�J�|�|j���d|j��Srr�r{s r
rzIPv6Interface.with_hostmaskrr�rc�0�|jdko|jjSr�)r9r�rJr{s r
rJzIPv6Interface.is_unspecifiedws���x�1�}�<���!<�<rc�0�|jdko|jjSr5)r9r�rLr{s r
rLzIPv6Interface.is_loopback{s���x�1�}�9���!9�9r)rr	r
rzrMrNrr�r�r�r�rxr�r�r>rrrrJrLr�r�s@r
r r 5s@�������2�2�2���%�%���%�+�+�+�+�+�
�
�
�
�
�
�T�T�T� �*�J�
�%�%��X�%��+�+��X�+��(�(��X�(��)�)��X�)��=�=��X�=��:�:��X�:�:�:�:�:rr c�8�eZdZ	eZdd�Zd�Zed���ZdS)rTc���	|�|��\�}t���|_|�|��\|_|_t
|j��}|t
|j��z|kr=|rtd|z���t|t
|j��z��|_|j|jdz
kr|j	|_
dS|j|jkr�fd�|_
dSdS)Nr�r6c�$��t���gSrW)rr�s�r
r�z&IPv6Network.__init__.<locals>.<lambda>�r�r)r�rrirYrrgr�rrNr�r�r�s     @r
rzzIPv6Network.__init__�s
���	�<�,�,�W�5�5�
��d�*�4�0�0���(,�(:�(:�4�(@�(@�%���d�o��T�)�*�*���C���%�%�%��/�/��
F� �!7�$�!>�?�?�?�'2�6�36�t�|�3D�3D�4E�(F�(F��$��?�t�2�Q�6�7�7���D�J�J�J�
�_�� 3�
3�
3�4�4�4�4�D�J�J�J�4�
3rc#�K�	t|j��}t|j��}t|dz|dz��D]}|�|��V��dSr5r�r�s    r
r�zIPv6Network.hosts�su����	��d�*�+�+����.�/�/�	��w��{�I��M�2�2�	)�	)�A��%�%�a�(�(�(�(�(�(�	)�	)rc�4�	|jjo|jjSrW)rir	r_r{s r
r	zIPv6Network.is_site_local�s%��		��$�2�5��&�4�	6rNr�)	rr	r
rr�rzr�r�r	rrr
rr�s_������	�!�N�.5�.5�.5�.5�`
)�
)�
)��6�6��X�6�6�6rrc�L�eZdZed��Zed��Zed��ed��ed��ed��ed��ed��ed	��ed
��ed��ed��g
Zed��ed
��ed��ed��ed��ed��ed��ed��ed��ed��ed��ed��ed��ed��ed��gZed��ZdS)�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z100::/64z	2001::/23z2001:2::/48z
2001:db8::/32z2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)	rr	r
rr�r�rCrrrrr
r/r/�s�������$��[�1�1��$��Z�0�0��	��I�����H�����O�$�$���J�����K� � ���M�"�"���O�$�$���N�#�#���J�����K� � �
��	��F���[�[��3�3���I�����I� 6� 6���I�����J� 7� 7���J�����Z�!8�!8���J�����Z�!8�!8���J�����Z�!8�!8���J�����Z�!8�!8���J���	��%��[�1�1���rr/r�)$�__version__rMrsr�rrrrrr!r'r+r3r?rErUrcrorvrxr��total_orderingrKrqrQrBrSrrrr�r�rr rr/rrr
�<module>r2sW���������
�
�
�
�0�0�0�0�0�
�0�0�0�0�0�0�0�0�
�0�0�0�S�S�S�:S�S�S�S�:U�U�U�DC�C�C�(
C�
C�
C� ������(
:�
:�
:� 4�4�4�n.�.�.�b36�36�36�l���2o,�o,�o,�o,�o,�o,�o,�o,�d��
��hN�hN�hN�hN�hN�>�hN�hN���hN�V��D4�D4�D4�D4�D4�>�D4�D4���D4�N��������
)���J�J�J�J�J�J�J�J�Zr:�r:�r:�r:�r:�'�<�r:�r:�r:�j@)�@)�@)�@)�@)�K�@)�@)�@)�FO%�O%�O%�O%�O%�'�<�O%�O%�O%�d2�2�2�2�2�2�2�2�>(���'���o�o�o�o�o�o�o�o�d	W:�W:�W:�W:�W:�'�<�W:�W:�W:�tH:�H:�H:�H:�H:�K�H:�H:�H:�VY6�Y6�Y6�Y6�Y6�'�<�Y6�Y6�Y6�x2�2�2�2�2�2�2�2�B(���'����r

Zerion Mini Shell 1.0