o
    ¯b  ã                   @   s.   d Z ddlmZ ddlmZ G dd„ dƒZdS )zŠ
The parent class for all the SSH services.  Currently implemented services
are ssh-userauth and ssh-connection.

Maintainer: Paul Swartz
é    )ÚDict)ÚLoggerc                   @   sX   e Zd ZU dZeed< i Zeee	f ed< dZ
eƒ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )Ú
SSHServiceNÚnameÚprotocolMessagesc                 C   ó   dS )zE
        called when the service is active on the transport.
        N© ©Úselfr   r   ú;/usr/lib/python3/dist-packages/twisted/conch/ssh/service.pyÚserviceStarted   ó    zSSHService.serviceStartedc                 C   r   )z�
        called when the service is stopped, either by the connection ending
        or by another service being started
        Nr   r	   r   r   r   ÚserviceStopped   r   zSSHService.serviceStoppedc                 C   s   d  | j| jj ¡ ¡S )NzSSHService {!r} on {})Úformatr   Ú	transportÚ	logPrefixr	   r   r   r   r   $   s   ÿzSSHService.logPrefixc                 C   s\   || j v r| j | }t| d|dd…  dƒ}|dur||ƒS | jjd||d� | j ¡  dS )zB
        called when we receive a packet on the transport
        zssh_%sé   Nz'couldn't handle {messageNum} {packet!r})Ú
messageNumÚpacket)r   ÚgetattrÚ_logÚinfor   ÚsendUnimplemented)r
   r   r   ÚmessageTypeÚfr   r   r   ÚpacketReceived)   s   

ýzSSHService.packetReceived)Ú__name__Ú
__module__Ú__qualname__r   ÚbytesÚ__annotations__r   r   ÚintÚstrr   r   r   r   r   r   r   r   r   r   r   r      s   
 r   N)Ú__doc__Útypingr   Útwisted.loggerr   r   r   r   r   r   Ú<module>   s   