§
    ÷¢±j  ã                   ó¤  — d dl Z d dlZd dlZ G d„ de¦  «        Zdd„Zd„ ZdZd„ Ze	d	k    r¡d dl
Z
	  e
j
        e j        d
d…         d¦  «        \  ZZn"# e
j        $ rZ ee¦  «         Y dZ[ndZ[ww xY wdZ ee¦  «        d k    r ed¦  «         eD ];\  ZZedk    r eee¦  «         edk    r ee¦  «         edk    r ee¦  «        ZŒ:dS dS )é    Nc                   ó   — e Zd ZdS )ÚConnectionErrorN)Ú__name__Ú
__module__Ú__qualname__© ó    úaC:\Users\johnn\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32/scripts/rasutil.pyr   r   	   s   € € € € € Ø€Dr	   r   é   c                 ó®  — |dk    sJ ‚t          j        ¦   «         D ]N}|d                              ¦   «         |                      ¦   «         k    rt          d| ¦  «         d|d         fc S ŒOt          j        d| ¦  «        \  }}|s2t          d¦  «         t          d¦  «         t          j        d¦  «         t          d| d¦  «         |}|dk    r_t          j        dd|d¦  «        \  }}t          j        |¦  «        rd}n.t          d	¦  «         t          j
        d
¦  «         |dz  }|dk    °_|r"t          |t          j        |¦  «        ¦  «        ‚d|fS )aa  Make a connection to the specified RAS entry.

    Returns a tuple of (bool, handle) on success.
    - bool is 1 if a new connection was established, or 0 is a connection already existed.
    - handle is a RAS HANDLE that can be passed to Disconnect() to end the connection.

    Raises a ConnectionError if the connection could not be established.
    r   é   zAlready connected toNz4Error: The password is not saved for this connectionzJPlease connect manually selecting the 'save password' option and try againzConnecting toz...zRetrying...iˆ  )Úwin32rasÚEnumConnectionsÚlowerÚprintÚGetEntryDialParamsÚsysÚexitÚDialÚIsHandleValidÚwin32apiÚSleepr   ÚGetErrorString)	ÚrasEntryNameÚ
numRetriesÚinfoÚdial_paramsÚhave_pwÚ
retryCountÚ	rasHandleÚerrCodeÚbValids	            r
   ÚConnectr#      s�  € ð ˜Š>ˆ>ˆ>ˆ>ÝÔ(Ñ*Ô*ð ð ˆØ�Œ7�=Š=‰?Œ?˜l×0Ò0Ñ2Ô2Ò2Ð2ÝÐ(¨,Ñ7Ô7Ð7Ø�d˜1”g�:ÐÐÐð 3õ $Ô6°t¸\ÑJÔJÑ€K�Øð ÝÐDÑEÔEÐEÝØXñ	
ô 	
ð 	
õ 	Œ�‰Œˆå	ˆ/˜<¨Ñ/Ô/Ð/Ø€JØ
�qŠ.ˆ.Ý%œ]¨4°°{ÀDÑIÔIÑˆ	�7ÝÔ! )Ñ,Ô,ð 	ØˆFØÝˆmÑÔÐÝŒ�tÑÔÐØ�a‰ˆ
ð �qŠ.ˆ.ð ð IÝ˜g¥xÔ'>¸wÑ'GÔ'GÑHÔHÐHØˆiˆ<Ðr	   c                 ó  — t          | t          ¦  «        rct          j        ¦   «         D ]<}|d                              ¦   «         |                      ¦   «         k    r
|d         }  nŒ=t          dd| z  ¦  «        ‚t          j        | ¦  «         d S )Nr   r   zNot connected to entry '%s')Ú
isinstanceÚstrr   r   r   r   ÚHangUp)Úhandler   s     r
   Ú
Disconnectr)   4   s�   € Ý�&�#ÑÔð MÝÔ,Ñ.Ô.ð 	Mð 	MˆDØ�AŒw�}Š}‰Œ &§,¢,¡.¤.Ò0Ð0Ø˜aœ�Ø�ð 1õ " !Ð%BÀVÑ%KÑLÔLÐLå„O�FÑÔÐÐÐr	   a+  rasutil.py - Utilities for using RAS

Usage:
  rasutil [-r retryCount] [-c rasname] [-d rasname]

  -r retryCount - Number of times to retry the RAS connection
  -c rasname - Connect to the phonebook entry specified by rasname
  -d rasname - Disconnect from the phonebook entry specified by rasname
c                 ót   — t          | ¦  «         t          t          ¦  «         t          j        d¦  «         d S )Nr   )r   Úusager   r   )Úwhys    r
   ÚUsager-   K   s)   € Ý	ˆ#�J„J€JÝ	�%�L„L€LÝ„HˆQ�K„K€K€K€Kr	   Ú__main__r   zr:c:d:zInvalid argumentz-cz-dz-r)r   )r   r   r   Ú	Exceptionr   r#   r)   r+   r-   r   ÚgetoptÚargvÚoptsÚargsÚerrorr,   ÚretriesÚlenÚoptÚvalÚintr   r	   r
   ú<module>r:      sŽ  ðà 
€
€
€
à €€€Ø €€€ð	ð 	ð 	ð 	ð 	�iñ 	ô 	ð 	ð$ð $ð $ð $ðN	ð 	ð 	ð	€ðð ð ð ˆzÒÐØ€M€M€MðØ"�V”] 3¤8¨A¨B¨B¤<°Ñ:Ô:‰
ˆˆdˆdøØŒ<ð ð ð Øˆˆc‰
Œ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
øøøøðøøøà€GØ
€sˆ4�y„y�A‚~€~ØˆÐ Ñ!Ô!Ð!àð ð ‰ˆˆSØ�$Š;ˆ;ØˆG�C˜Ñ!Ô!Ð!Ø�$Š;ˆ;ØˆJ�s‰OŒOˆOØ�$Š;ˆ;Ø�c˜#‘h”hˆGøð# Ððð s   ²!A Á
A3ÁA.Á.A3