SSHChannelOpenRequest Event

Fired when a host attempts to open a new channel.

Syntax

ANSI (Cross Platform)
virtual int FireSSHChannelOpenRequest(SSHClientSSHChannelOpenRequestEventParams *e);
typedef struct {
const char *ChannelId;
const char *Service;
const char *Parameters; int lenParameters;
int Accept; int reserved; } SSHClientSSHChannelOpenRequestEventParams; Unicode (Windows) virtual INT FireSSHChannelOpenRequest(SSHClientSSHChannelOpenRequestEventParams *e);
typedef struct {
LPCWSTR ChannelId;
LPCWSTR Service;
LPCSTR Parameters; INT lenParameters;
BOOL Accept; INT reserved; } SSHClientSSHChannelOpenRequestEventParams;
- (void)onSSHChannelOpenRequest:(NSString*)channelId :(NSString*)service :(NSData*)parameters :(int*)accept;
#define EID_SSHCLIENT_SSHCHANNELOPENREQUEST 10

virtual INT IPWORKSSSH_CALL FireSSHChannelOpenRequest(LPSTR &lpszChannelId, LPSTR &lpszService, LPSTR &lpParameters, INT &lenParameters, BOOL &bAccept);

Remarks

This event is fired whenever a host attempts to open a new channel. ChannelId will contain the id of the channel to be created. Service will identify the type of channel that is being requested (e.g.: "session"). Set Accept to true to accept the channel open request.

If the channel open request contains extra information, it will be contained in Parameters; you can extract data from it using GetSSHParam and GetSSHParamBytes. The most common example of a request with parameters would be a request with Service set to "direct-tcpip" (for SSH tunneling); in that case Parameters will contain the host to connect (string), the port to connect (int), the originator IP address (string) and the originator TCP port (int).

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 C++ Edition - Version 20.0 [Build 8501]