pssht  latest
SSH server library written in PHP
fpoirotte\Pssht\Connection Class Reference
+ Inheritance diagram for fpoirotte\Pssht\Connection:

Public Member Functions

 __construct (\fpoirotte\Pssht\Transport $transport)
 
 allocateChannel (\fpoirotte\Pssht\Messages\CHANNEL\OPEN $message)
 
 freeChannel ($id)
 
 getChannel ($message)
 
 handle ($msgType,\fpoirotte\Pssht\Wire\Decoder $decoder,\fpoirotte\Pssht\Transport $transport, array &$context)
 
 setHandler ($message, $type,\fpoirotte\Pssht\Handlers\HandlerInterface $handler)
 
 unsetHandler ($message, $type,\fpoirotte\Pssht\Handlers\HandlerInterface $handler)
 

Protected Attributes

 $channels
 Opened SSH channels.
 

Detailed Description

Connection layer for the SSH protocol (RFC 4254).

Definition at line 21 of file Connection.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\Connection::__construct ( \fpoirotte\Pssht\Transport  $transport)

Construct a new SSH connection layer.

Parameters
fpoirotte::Pssht::Transport$transportSSH transport layer.

Definition at line 32 of file Connection.php.

References fpoirotte\Pssht\Messages\USERAUTH\REQUEST\Base\getMessageId().

Member Function Documentation

fpoirotte\Pssht\Connection::allocateChannel ( \fpoirotte\Pssht\Messages\CHANNEL\OPEN  $message)

Allocate a new communication channel.

Parameters
fpoirotte::Pssht::Messages::CHANNEL::OPEN$messageOriginal message requesting channel allocation.
Returns
int Newly allocated channel's identifier.

Definition at line 93 of file Connection.php.

fpoirotte\Pssht\Connection::freeChannel (   $id)

Free a channel allocation.

Parameters
int$idChannel identifier.
Return values
ConnectionReturns this connection.

Definition at line 112 of file Connection.php.

fpoirotte\Pssht\Connection::getChannel (   $message)

Retrieve the channel associated with a message.

Parameters
int | fpoirotte::Pssht::Messages::CHANNEL::REQUEST::Base$messageEither a message or the message's channel identifier.
Return values
intRemote channel associated with the message.

Definition at line 132 of file Connection.php.

fpoirotte\Pssht\Connection::handle (   $msgType,
\fpoirotte\Pssht\Wire\Decoder  $decoder,
\fpoirotte\Pssht\Transport  $transport,
array &  $context 
)

Handle an SSH message.

Parameters
int$msgTypeMessage identifier.
fpoirotte::Pssht::Wire::Decoder$decoderDecoder for the message.
fpoirotte::Pssht::Transport$transportTransport layer the message was received from.
array$contextContext for the SSH connection.

Implements fpoirotte\Pssht\Handlers\HandlerInterface.

Definition at line 56 of file Connection.php.

fpoirotte\Pssht\Connection::setHandler (   $message,
  $type,
\fpoirotte\Pssht\Handlers\HandlerInterface  $handler 
)

Register a handler.

Parameters
int | fpoirotte::Pssht::Messages::CHANNEL::REQUEST::Base$messageEither a message or the message's channel identifier.
int$typeMessage type.
fpoirotte::Pssht::Handlers::HandlerInterface$handlerHandler to associate with the message.

Definition at line 152 of file Connection.php.

fpoirotte\Pssht\Connection::unsetHandler (   $message,
  $type,
\fpoirotte\Pssht\Handlers\HandlerInterface  $handler 
)

Unregister a handler.

Parameters
int | fpoirotte::Pssht::Messages::CHANNEL::REQUEST::Base$messageEither a message or the message's channel identifier.
int$typeMessage type.
fpoirotte::Pssht::Handlers::HandlerInterface$handlerHandler to unregister.

Definition at line 184 of file Connection.php.


The documentation for this class was generated from the following file: