Ë ‘Òª©¬ãóv—dZddlZddlZddl­ddl­ddlmZmZejd«Z Gd„de «Z y) zÎThis module implements the TFTP Client functionality. Instantiate an instance of the client, and then use its upload or download method. Logging is performed via a standard logging object set in TftpShared.éNé)Ú*)ÚTftpContextClientDownloadÚTftpContextClientUploadztftpy.TftpClientcó:—eZdZdZdidfd„Zdeefd„Zdeefd„Zy)Ú TftpClientz©This class is an implementation of a tftp client. Once instantiated, a download can be initiated via the download() method, or an upload via the upload() method.éEÚcó6—tj|«d|_||_||_d|_||_||_d|j vrL|j d}ttt|«k(d«|tks |tkDrtd|z«‚yy)NÚblksizezblksize must be an intzInvalid blksize: %d)Ú TftpSessionÚ__init__ÚcontextÚhostÚiportÚfilenameÚoptionsÚlocalipÚ tftpassertÚintÚtypeÚ MIN_BLKSIZEÚ MAX_BLKSIZEÚ TftpException)ÚselfrÚportrrÚsizes ú5/usr/lib/python3.12/site-packages/tftpy/TftpClient.pyrzTftpClient.__init__s’€Ü×јTÔ"؈Œ ؈Œ ؈Œ ؈Œ ؈Œ ؈Œ Ø ˜Ÿ ™ Ñ $Ø—<‘<  Ñ*ˆDÜ ”sœd 4›jÑ(Ð*BÔ CØ”kÒ! T¬KÒ%7Ü#Ð$9¸DÑ$@ÓAÐAð&8ð %óNc ó¾—tjd«tjd|j›d|j›d|›�«tjd|j›d|›d|›�«t |j|j|||j||||j ¬« |_|jj«|jj«|jj}tjd «tjd «|jd k(rtjd «nPtjd |j|jfz«tjd|jz«tjd|jz«tjd|j z«y)aTThis method initiates a tftp download from the configured remote host, requesting the filename passed. It writes the file to output, which can be a file-like object or a path to a local file. If a packethook is provided, it must be a function that takes a single parameter, which will be a copy of each DAT packet received in the form of a TftpPacketDAT object. The timeout parameter may be used to override the default SOCK_TIMEOUT setting, which is the amount of time that the client will wait for a receive packet to arrive. The retires paramater may be used to override the default DEF_TIMEOUT_RETRIES settings, which is the amount of retransmission attemtpts the client will initiate after encountering a timeout. Note: If output is a hyphen, stdout is used.z4Creating download context with the following params:zhost = z , port = z , filename = z options = z, packethook = z , timeout = ©Úretriesrr zDownload complete.rú%Duration too short, rate undeterminedz%Downloaded %.2f bytes in %.2f secondsúAverage rate: %.2f kbpsú%.2f bytes in resent datazReceived %d duplicate packetsN)ÚlogÚdebugrrrrrrÚstartÚendÚmetricsÚinfoÚdurationÚbytesÚkbpsÚ resent_bytesÚdupcount)rrÚoutputÚ packethookÚtimeoutr"r*s rÚdownloadzTftpClient.download#sH€ô � ‰ ÐHÔIÜ � Š ¸4¿9»9ÀdÇjÃjÑRZÐ[Ô\Ü � Š À4Ç<Ã<ÒQ[Ñ]dÐeÔfÜ0°·±Ø15·±Ø19Ø17Ø15·±Ø1;Ø18Ø9@Ø9=¿¹ôGˆŒ ð � ‰ ×ÑÔà � ‰ ×ÑÔà—,‘,×&Ñ&ˆä �‰�Œ Ü �‰Ð%Ô&Ø × Ñ ˜qÒ Ü �H‰HÐ<Õ =ä �H‰HÐ<ÀÇ Á Èw×O_ÑO_Ð?`Ñ`Ô aÜ �H‰HÐ.°·±Ñ=Ô >Ü �‰Ð,¨w×/CÑ/CÑCÔDÜ �‰Ð0°7×3CÑ3CÑCÕDrc óà—t|j|j|||j||||j¬« |_|j j «|j j«|j j}tjd«tjd«|jdk(rtjd«nPtjd|j|jfz«tjd|jz«tjd|jz«tjd |jz«y ) aTThis method initiates a tftp upload to the configured remote host, uploading the filename passed. It reads the file from input, which can be a file-like object or a path to a local file. If a packethook is provided, it must be a function that takes a single parameter, which will be a copy of each DAT packet sent in the form of a TftpPacketDAT object. The timeout parameter may be used to override the default SOCK_TIMEOUT setting, which is the amount of time that the client will wait for a DAT packet to be ACKd by the server. The retires paramater may be used to override the default DEF_TIMEOUT_RETRIES settings, which is the amount of retransmission attemtpts the client will initiate after encountering a timeout. Note: If input is a hyphen, stdin is used.r!r zUpload complete.rr#z!Uploaded %d bytes in %.2f secondsr$r%zResent %d packetsN)rrrrrrr(r)r*r&r+r,r-r.r/r0)rrÚinputr2r3r"r*s rÚuploadzTftpClient.uploadNs€ô/¨t¯y©yØ/3¯z©zØ/7Ø/4Ø/3¯|©|Ø/9Ø/6Ø7>Ø7;·|±|ôEˆŒ ð � ‰ ×ÑÔà � ‰ ×ÑÔà—,‘,×&Ñ&ˆä �‰�Œ Ü �‰Ð#Ô$Ø × Ñ ˜qÒ Ü �H‰HÐ<Õ =ä �H‰HÐ8¸G¿M¹MÈ7×K[ÑK[Ð;\Ñ\Ô ]Ü �H‰HÐ.°·±Ñ=Ô >Ü �‰Ð,¨w×/CÑ/CÑCÔDÜ �‰Ð$ w×'7Ñ'7Ñ7Õ8r) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚ SOCK_TIMEOUTÚDEF_TIMEOUT_RETRIESr4r7©rrrrs6„ñð#%¨b¸Bó Bð59À,ÐXkó)EðV26¸|ÐUhô%9rr) r;ÚtypesÚloggingÚ TftpSharedÚTftpPacketTypesÚ TftpContextsrrÚ getLoggerr&r rr>rrÚrEs<ðñ>ó  ÛÜÜßLà€g×ÑÐ*Ó+€ôc9�õc9r