U
    
W[                     @   s6   d Z ddlmZmZ ddlmZ G dd dejZdS )z
The parent class for all the SSH services.  Currently implemented services
are ssh-userauth and ssh-connection.

Maintainer: Paul Swartz
    )divisionabsolute_import)logc                   @   s8   e Zd ZdZi ZdZdd Zdd Zdd Zdd	 Z	dS )

SSHServiceNc                 C   s   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   s    zSSHService.serviceStartedc                 C   s   dS )z
        called when the service is stopped, either by the connection ending
        or by another service being started
        Nr   r   r   r   r	   serviceStopped   s    zSSHService.serviceStoppedc                 C   s   d| j | jj f S )NzSSHService %r on %s)name	transport	logPrefixr   r   r   r	   r      s    
zSSHService.logPrefixc                 C   sf   || j kr<| j | }t| d|dd  d}|dk	r<||S td|  tt| | j  dS )zB
        called when we receive a packet on the transport
        zssh_%s   Nzcouldn't handle %r)protocolMessagesgetattrr   msgreprr   ZsendUnimplemented)r   Z
messageNumZpacketZmessageTypefr   r   r	   packetReceived#   s    

zSSHService.packetReceived)
__name__
__module____qualname__r   r   r   r
   r   r   r   r   r   r   r	   r      s   r   N)__doc__Z
__future__r   r   Ztwisted.pythonr   ZLoggerr   r   r   r   r	   <module>   s   