Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.SSH.ServerChannel

Feature notes: SSH implementation notes

Classes, interfaces and records

interfaceiSSHServerChannel

(no public members)

interfaceiSSHServerSubSystem

procedure ReadData(const aChannel: iSSHServerChannel); procedure ChannelClosed;

classeSSHServerChannelError

inherits from Exception

(no public members)

interfaceiSSHServerChannelEvents

function GetRemoteChannel: UInt32; function DoConnected(aRemoteChannel : UInt32; aRemoteWindowSize: Integer; aRemotePacketSize: Integer; const aBuf : tBytes; aOffset, aLength : Integer; var aReasonCode : UInt32; var aErrorMsg : string) : Boolean; procedure DoDisconnected(aErrorCode : UInt32; const aErrorMessage: string); function HandleRequest(const aRequestType: string; const aBuf : tBytes; aOffset, aCount : Integer) : Boolean; procedure RemoveFromBroker; function BrokerCallsDone: Boolean;
True once no Send/SendEOF/Close of this channel is still calling through the broker (fInBrokerCall = 0), so the broker may be freed. See tCustomSSHServerChannel.Send and tSSHServerChannelBroker.ReleaseChannels.
procedure IncreaseWindow(aAdd: UInt32); procedure ResetLocalWindow; procedure CloseLocalWindow; procedure WriteChannelData(const aData : tBytes; aOffset: Integer; aCount : Integer); procedure DiscardChannelData(aCount: Integer);
Counts aCount octets of extended data against the channel's receive window without keeping them.
procedure BeginSubSystemThread; procedure EndSubSystemThread; property RemoteChannel: UInt32 read GetRemoteChannel;

classtAbstractSSHServerChannelBroker

(no public members)

interfaceiSSHServerChannel

inherits from iSSHWindowedChannel

function GetBroker: tAbstractSSHServerChannelBroker; function GetLocalChannel: UInt32; function GetRemoteChannel: UInt32; function GetPeerEOF: Boolean; procedure SendEOF;
Half-close: send SSH_MSG_CHANNEL_EOF, meaning "no more data from us" while staying open to receive. Sending CHANNEL_CLOSE instead is a hard teardown -- RFC 4254 section 5.3 forbids the peer sending after it, so a reply still in flight is lost. Idempotent; ignored once CHANNEL_CLOSE has been sent.
function GetTransport: iSSHServerTransport; property Broker: tAbstractSSHServerChannelBroker read GetBroker; property LocalChannel: UInt32 read GetLocalChannel; property RemoteChannel: UInt32 read GetRemoteChannel; property PeerEOF: Boolean read GetPeerEOF;
True once the peer has sent SSH_MSG_CHANNEL_EOF, i.e. it will send no more data on this channel. EOF deliberately does NOT change State and does not close the channel (the peer may still be reading, and we may still have data to send), so a consumer that has to react to a half-close -- typically... Full description »
property Transport: iSSHServerTransport read GetTransport;

interfaceiSSHServerChannelSession

inherits from iSSHServerChannel

function GetSubSystemName: string; procedure SetSubSystem(const aSubSystem: iSSHServerSubSystem); procedure SetThreadPrio(const aValue: Integer); property SubSystemName: string read GetSubSystemName; function WaitForEvent(aTimeout: Cardinal): TWaitResult;

interfaceiSSHServerChannelForwarded

inherits from iSSHServerChannel

procedure RemoveSender;

interfaceiSSHServerChannelForwardedTcpIp

inherits from iSSHServerChannelForwarded

function GetLocalAddress: string; function GetLocalPort: UInt32; function GetRemoteAddress: string; function GetRemotePort: UInt32; property LocalAddress: string read GetLocalAddress; property LocalPort: UInt32 read GetLocalPort; property RemoteAddress: string read GetRemoteAddress; property RemotePort: UInt32 read GetRemotePort;

interfaceiSSHServerChannelDirectTcpIp

inherits from iSSHServerChannelForwarded

function GetHostToConnect: string; function GetPortToConnect: UInt32; function GetOriginatorHost: string; function GetOriginatorPort: UInt32; property HostToConnect: string read GetHostToConnect; property PortToConnect: UInt32 read GetPortToConnect; property OriginatorHost: string read GetOriginatorHost; property OriginatorPort: UInt32 read GetOriginatorPort;

interfaceiSSHDirectRawEvents

procedure Close; function RecvLength: Integer; function Recv(const aBuffer: tBytes; aOffset, aCount : Integer; aBlock : Boolean = True) : Integer; function Send(const aBuffer: tBytes; aOffset, aCount : Integer) : UInt32;

interfaceiSSHDirectTcpIpRawEvents

inherits from iSSHDirectRawEvents

procedure Connect(const aChannel : iSSHServerChannel; const aHostToConnect : string; aPortToConnect : UInt32; const aOriginatorAddress: string; aOriginatorPort : UInt32);

classtAbstractSSHForwardedListener

(no public members)

interfaceiSSHServer

function GetActive: Boolean; procedure BeginSubSystemThread; procedure EndSubSystemThread; function SupportsSubSystem(const aChannel: iSSHServerChannel): Boolean; function ExecuteSubSystem(const aChannel: iSSHServerChannel): Boolean; function FindListener(const aRequest: string; aBroker : tAbstractSSHServerChannelBroker) : tAbstractSSHForwardedListener; function FindSender(const aChannel : iSSHServerChannel; const aChannelType: string; const aBuf : tBytes; aOffset : Integer; aCount : Integer) : iSSHDirectRawEvents; function HostNameToAddress(const aChannelType: string; const aHostName : string) : string; function SupportsTcpIpForward(const aUsername: string; const aAddress : string; aPort : UInt32) : Boolean; function SupportsDirectTcpIp(const aUsername: string; const aAddress : string; aPort : UInt32) : Boolean;

interfaceiSSHServerIgnoreController

function BeforeSendIgnore(const aTransport : iSSHTransport; aTicksSinceLast: Cardinal; var aLength : Integer) : Boolean;

interfaceiSSHServerChannelBroker

procedure Execute;

interfaceiSSHForwardedListener

function GetName: string; function HandleGlobalRequest(const aRequest: string; const aBuf : tBytes; aOffset : Integer; aCount : Integer) : Boolean; procedure RemoveFromBroker; property Name: string read GetName;

interfaceiSSHForwardedTcpIpListener

inherits from iSSHForwardedListener

function GetBindAddress: string; function GetBindPort: UInt32; property BindAddress: string read GetBindAddress; property BindPort: UInt32 read GetBindPort;

classtAbstractSSHServerChannelBroker

inherits from TInterfacedObject

constructor Create(const aTransport : iSSHServerTransport); procedure Close(aRemoteChannel: UInt32); virtual; abstract;
Sends SSH_MSG_CHANNEL_CLOSE to aRemoteChannel, the peer's number for the channel (the protocol's recipient channel).
procedure SendEOF(aRemoteChannel: UInt32); virtual; abstract;
Sends SSH_MSG_CHANNEL_EOF ("I will send no more data on this channel").
function Send(aRemoteChannel: UInt32; const aData : tBytes; aOffset, aCount : Integer) : UInt32; function SendRaw(const aData : tBytes; aOffset, aCount : Integer) : UInt32; procedure IncreaseWindow(aLocalChannel: UInt32; aAdd : UInt32); function GetLocalChannel(aLocalChannel: UInt32) : iSSHServerChannel; virtual; abstract;

classtCustomSSHServerChannel

(no public members)

classtAbstractSSHForwardedListener

inherits from tObjectMapping

implements iSSHForwardedListener

constructor Create(aBroker: tAbstractSSHServerChannelBroker; const aServer: iSSHServer); destructor Destroy; override;

classtAbstractSSHForwardedTcpIpListener

destructor Destroy; override;

classtSSHServerChannelBroker

constructor Create(const aServer : iSSHServer; const aTransport : iSSHServerTransport; aChannels : Integer; aWindowSize: UInt32; aPacketSize: UInt32); destructor Destroy; override; procedure Execute; procedure Close(aRemoteChannel: UInt32); override; procedure SendEOF(aRemoteChannel: UInt32); override; function GetLocalChannel(aLocalChannel: UInt32) : iSSHServerChannel; override;

classtSSHServerChannel

(no public members)

classtSSHSubSystemThread

inherits from TThread

constructor Create(aChannel: tSSHServerChannel); destructor Destroy; override; procedure ReadData; procedure SetEvent; procedure TerminateAndWait; function WaitForEvent(aTimeout: Cardinal): TWaitResult;
Delegates to fEvent.WaitFor, forwarding aTimeout, and returns its result.

classtCustomSSHServerChannel

constructor Create(const aBroker : tAbstractSSHServerChannelBroker; aWindowSize: UInt32; aPacketSize: UInt32); virtual; destructor Destroy; override; class function FindClass(const aName: string): tSSHServerChannelClass;

classtSSHServerChannel

inherits from tCustomSSHServerChannel

implements iSSHServerChannelSession

constructor Create(const aBroker : tAbstractSSHServerChannelBroker; aWindowSize: UInt32; aPacketSize: UInt32); override; destructor Destroy; override;

classtCustomSSHServerChannelForwarded

inherits from tCustomSSHServerChannel

(no public members)

classtSSHServerChannelForwardedTcpIp

(no public members)

classtCustomSSHServerChannelDirect

inherits from tCustomSSHServerChannelForwarded

(no public members)

classtSSHServerChannelDirectTcpIp

(no public members)

Types (enumerations, sets, aliases)

typetSSHForwardedListenerClass

  tSSHForwardedListenerClass = class of tAbstractSSHForwardedListener;

typetSSHServerChannelClass

  tSSHServerChannelClass = class of tCustomSSHServerChannel;