�
Ϫ�fF: � � � d Z ddlmZmZ G d� de� Z G d� de� Z G d� de� Z G d � d
e� Z G d� de� Z G d
� de� Z
G d� de� Zy)zK
This module contains interfaces defined for the L{twisted.conch} package.
� )� Attribute� Interfacec �2 � e Zd ZdZ ed� Zd� Zd� Zd� Zy)�
IConchUserz�
A user who has been authenticated to Cred through Conch. This is
the interface between the SSH connection and the user.
z'The SSHConnection object for this user.c � � y)a�
The other side requested a channel of some sort.
C{channelType} is the type of channel being requested,
as an ssh connection protocol channel type.
C{data} is any other packet data (often nothing).
We return a subclass of L{SSHChannel<ssh.channel.SSHChannel>}. If
the channel type is unknown, we return C{None}.
For other failures, we raise an exception. If a
L{ConchError<error.ConchError>} is raised, the C{.value} will
be the message, and the C{.data} will be the error code.
@param channelType: The requested channel type
@type channelType: L{bytes}
@param windowSize: The initial size of the remote window
@type windowSize: L{int}
@param maxPacket: The largest packet we should send
@type maxPacket: L{int}
@param data: Additional request data
@type data: L{bytes}
@rtype: a subclass of L{SSHChannel} or L{None}
N� )�channelType�
windowSize� maxPacket�datas �:/usr/lib/python3/dist-packages/twisted/conch/interfaces.py�
lookupChannelzIConchUser.lookupChannel � � � c � � y)a�
The other side requested a subsystem.
We return a L{Protocol} implementing the requested subsystem.
If the subsystem is not available, we return C{None}.
@param subsystem: The name of the subsystem being requested
@type subsystem: L{bytes}
@param data: Additional request data (often nothing)
@type data: L{bytes}
@rtype: L{Protocol} or L{None}
Nr )� subsystemr s r
�lookupSubsystemzIConchUser.lookupSubsystem- r r c � � y)a�
A global request was sent from the other side.
We return a true value on success or a false value on failure.
If we indicate success by returning a tuple, its second item
will be sent to the other side as additional response data.
@param requestType: The type of the request
@type requestType: L{bytes}
@param data: Additional request data
@type data: L{bytes}
@rtype: boolean or L{tuple}
Nr )�requestTyper s r
�gotGlobalRequestzIConchUser.gotGlobalRequest; r r N) �__name__�
__module__�__qualname__�__doc__r �connr r r r r r
r r s# � ��
�>�?�D��4�
r r c �0 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zy)�ISessionc � � y)z�
Get a pseudo-terminal for use by a shell or command.
If a pseudo-terminal is not available, or the request otherwise
fails, raise an exception.
Nr )�termr
�modess r
�getPtyzISession.getPtyL r r c � � y)zm
Open a shell and connect it to proto.
@param proto: a L{ProcessProtocol} instance.
Nr )�protos r
� openShellzISession.openShellT r r c � � y)zZ
Execute a command.
@param proto: a L{ProcessProtocol} instance.
Nr )r# �commands r
�execCommandzISession.execCommand[ r r c � � y)zH
Called when the size of the remote screen has changed.
Nr )�
newWindowSizes r
�
windowChangedzISession.windowChangedb r r c � � y)zU
Called when the other side has indicated no more data will be sent.
Nr r r r
�eofReceivedzISession.eofReceivedg r r c � � y)z4
Called when the session is closed.
Nr r r r
�closedzISession.closedl r r N) r r r r! r$ r' |