
    zf                     j    d dl Z d dlmZ ddlmZmZmZ ddlmZ g Z	dddd ddddde j
        ddd	fd
ZdS )    N)randint   )networkexecutorpayload_provider)random_text      Flegacyc                 ,   t          j        dd          }|r0|r.||k    r(|st          |          }t          j        |||          }n.|r,|dk    r&|st          |          }t          j        ||          }d}|rt          j        j        }	 t          dd          }|t          vrt          	                    |           n5t          j        | |||||	|
|||
  
        }|                    |           t                              |           |j        S )	ac  Pings a remote host and handles the responses

    :param target: The remote hostname or IP address to ping
    :type target: str
    :param timeout: Time in seconds before considering each non-arrived reply permanently lost.
    :type timeout: Union[int, float]
    :param count: How many times to attempt the ping
    :type count: int
    :param size: Size of the entire packet to send
    :type size: int
    :param interval: Interval to wait between pings
    :type interval: int
    :param payload: Payload content, leave None if size is set to use random text
    :type payload: Union[str, bytes]
    :param sweep_start: If size is not set, initial size in a sweep of sizes
    :type sweep_start: int
    :param sweep_end: If size is not set, final size in a sweep of sizes
    :type sweep_end: int
    :param df: Don't Fragment flag value for IP Header
    :type df: bool
    :param verbose: Print output while performing operations
    :type verbose: bool
    :param out: Stream to which redirect the verbose output
    :type out: stream
    :param match: Do payload matching between request and reply (default behaviour follows that of Windows which is
    by packet identifier only, Linux behaviour counts a non equivalent payload in reply as fail, such as when pinging
    8.8.8.8 with 1000 bytes and reply is truncated to only the first 74 of request payload with packet identifiers
    the same in request and reply)
    :type match: bool
    :param repr_format: How to __repr__ the response. Allowed: legacy, None
    :type repr_format: str
    :return: List with the result of each ping
    :rtype: executor.ResponseList    r    Tr   i  )socket_optionsverboseoutputseed_idsourcerepr_format)match_payloads)r   Repeatr   Sweepr   SocketDONT_FRAGMENTr   SEED_IDsappendr   Communicatorrunremove	responses)targettimeoutcountsizeintervalpayloadsweep_start	sweep_enddfr   outmatchr   
out_formatprovideroptionsr   comms                     U/var/www/ffwdstore.be/apps/py-env/lib/python3.11/site-packages/pythonping/__init__.pypingr0      sF   ^  &sA..H ;y ;Y+%=%= 	/!+..G#)';	JJ	 ;$(( 	(!$''G#*7E::G	 /..#v&&(""OOG$$$  7HU\fmvy)0ZY Y YD 	HHEH"""OOG>r   )sysrandomr    r   r   r   utilsr   r   stdoutr0   r   r   r/   <module>r6      s    



       1 1 1 1 1 1 1 1 1 1        ZM M M M M Mr   