%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/netaddr/ip/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/netaddr/ip/__pycache__/nmap.cpython-312.pyc

�

ӊ�^���V�dZddlmZddlmZmZddlmZmZm	Z	d�Z
d�Zd�Zd�Z
d	�Zy
)z�
Routines for dealing with nmap-style IPv4 address ranges.

Based on nmap's Target Specification :-

    http://nmap.org/book/man-target-specification.html
�)�AddrFormatError)�	IPAddress�	IPNetwork)�_iter_range�_is_str�
_iter_nextc��t�}|jd�D]�}d|vr�|jdd�\}}|sd}|sd}t|�}t|�}d|cxkrdkrnn
d|cxkrdksntd|�d���||kDrtd|����t	||dz�D]}|j|����t|�}d|cxkrdksntd|�d���|j|���t
|�S)	N�,�-�r�zoctet value overflow for spec �!z%left side of hyphen must be <= right )�set�split�int�
ValueErrorr�add�sorted)�spec�values�element�left�right�low�high�octets        �1/usr/lib/python3/dist-packages/netaddr/ip/nmap.py�_nmap_octet_target_valuesrs����U�F��:�:�c�?����'�>�!�-�-��Q�/�K�D�%��������d�)�C��u�:�D��#�_��_�1��+;��+;� ��!N�O�O��T�z� �g�!W�X�X�$�S�$��(�3�
"���
�
�5�!�
"���L�E���%�#�%� ��!N�O�O��J�J�u��'�*�&�>��c�&�t|�stdt|�z��|std��|j	d�}t|�dk7rt
d|����t|d�t|d�t|d�t|d	�fS)
Nzstring expected, not %sz*nmap target specification cannot be blank!�.�zinvalid nmap range: rr��)r�	TypeError�typerr�lenrr)�nmap_target_spec�tokenss  r�_generate_nmap_octet_rangesr*0s����#�$��1�D�9I�4J�J�K�K���E�F�F�
�
#�
#�C�
(�F�
�6�{�a���:J�L�M�M�%�f�Q�i�0�%�f�Q�i�0�%�f�Q�i�0�%�f�Q�i�0�2�2rc#�K�d|vrj|jdd�\}}dt|�cxkrdksntd|����t|�}|jdk7rtd��|D]}|���yd|vrt|���yt
|�}|dD]5}|dD]+}|d	D]!}|d
D]}	td||||	fzd�����#�-�7y�w)N�/rr�!zCIDR prefix expected, not r"zCIDR only support for IPv4!�:r#r$z%d.%d.%d.%d)rrrr�versionrr*)
�target_spec�_�prefix�net�ip�octet_ranges�w�x�y�zs
          r�_parse_nmap_target_specr:Ds����
�k���%�%�c�1�-�	��6��C��K�$�"�$�!�F�"L�M�M���$���;�;�!��!�"?�@�@��	�B��H�	�	��	���$�$�2�;�?���a��	I�A�!�!�_�
I��%�a��I�A�)�!�_�I��'�
��A�q�!��(D�a�H�H�I�I�
I�	I�s�C
Cc�b�	tt|��y#tttf$rYywxYw)z�
    :param target_spec: an nmap-style IP range target specification.

    :return: ``True`` if IP range target spec is valid, ``False`` otherwise.
    TF)rr:r%rr)r0s r�valid_nmap_ranger<Zs4��
��*�;�7�8����z�?�3�
���
�s��.�.c'�BK�|D]}t|�D]}|����y�w)aV
    An generator that yields IPAddress objects from defined by nmap target
    specifications.

    See https://nmap.org/book/man-target-specification.html for details.

    :param *nmap_target_spec: one or more nmap IP range target specification.

    :return: an iterator producing IPAddress objects for each IP in the target spec(s).
    N)r:)r(r0�addrs   r�iter_nmap_ranger?hs0����(���+�K�8�	�D��J�	��s�N)�__doc__�netaddr.corer�
netaddr.iprr�netaddr.compatrrrrr*r:r<r?�rr�<module>rEs2���)�+�;�;��:2�(I�,�
r

Zerion Mini Shell 1.0