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   