TrustCore SDK NanoSSH API reference  version 7.0
Port Forwarding Callbacks

Variables

void(* sshClientSettings::funcPtrPortForwardClosed )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a session close request. More...
 
sbyte4(* sshClientSettings::funcPtrPortForwardConnect )(sbyte4 connectionInstance, enum pfType, sbyte *pHostAddr, ubyte4 hostPort, ubyte *pIgnoreRequest, ubyte4 channel)
 
void(* sshClientSettings::funcPtrPortForwardEof )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a session EOF request. More...
 
void(* sshClientSettings::funcPtrPortFwdReceivedData )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a session message. More...
 
void(* sshClientSettings::funcPtrPortFwdSessionOpen )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a successful session open request. More...
 
sbyte4(* sshClientSettings::funcPtrPortFwdSessionOpenFail )(sbyte4 connectionInstance, ubyte *pInfo, ubyte4 infoLength, ubyte *pLanguage, ubyte4 languageLength, sbyte4 channel)
 Respond to a failed session open request. More...
 
void(* sshClientSettings::funcPtrRemotePortReqStatus )(sbyte4 status, ubyte4 port)
 

Detailed Description

Variable Documentation

◆ funcPtrPortForwardClosed

void(* sshClientSettings::funcPtrPortForwardClosed) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)

This callback function is invoked when the SSH Client receives a session close message from the SSH server. This callback function is used only for a local port forwarding session close request.

Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.

Since
3.06
Version
3.06 and later

(function name changed...)

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_PORT_FORWARDING__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
sessionEventAny of the sshcSessionTypes enumerated values (see sshc.h).
pMesgPointer to message to forward.
mesgLenNumber of bytes in the message (pMesg).
channelChannel number returned from SSHC_lpfRegisterConnection().
Returns
None.

sshc.h

◆ funcPtrPortForwardEof

void(* sshClientSettings::funcPtrPortForwardEof) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)

This callback function is invoked when the SSH Client receives a session EOF request from the SSH server. This callback function is used only for a local port forwarding session EOF request.

Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.

Since
3.06
Version
3.06 and later

(function name changed...)

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_PORT_FORWARDING__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
sessionEventAny of the sshcSessionTypes enumerated values (see sshc.h).
pMesgPointer to message to forward.
mesgLenNumber of bytes in the message (pMesg).
channelChannel number returned from SSHC_lpfRegisterConnection().
Returns
None.

sshc.h

◆ funcPtrPortFwdReceivedData

void(* sshClientSettings::funcPtrPortFwdReceivedData) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)

This callback function is invoked when the SSH Client receives a session data message from the SSH server. This callback function is used only for a local port forwarding session open request.

Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.

Since
3.06
Version
3.06 and later

(function name changed...)

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_PORT_FORWARDING__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
sessionEventAny of the sshcSessionTypes enumerated values (see sshc.h).
pMesgPointer to message to forward.
mesgLenNumber of bytes in the message (pMesg).
channelChannel number returned from SSHC_lpfRegisterConnection().
Returns
None.

sshc.h

◆ funcPtrPortFwdSessionOpen

void(* sshClientSettings::funcPtrPortFwdSessionOpen) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)

This callback function is invoked when the SSH Client successfully opens a service. This callback function is used only for a local port forwarding session open request.

Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.

Since
3.06
Version
3.06 and later

(function name changed...)

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_PORT_FORWARDING__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
sessionEventAny of the sshcSessionTypes enumerated values (see sshc.h).
pMesgPointer to message to forward.
mesgLenNumber of bytes in the message (pMesg).
channelChannel number returned from SSHC_lpfRegisterConnection().
Returns
None.

sshc.h

◆ funcPtrPortFwdSessionOpenFail

sbyte4(* sshClientSettings::funcPtrPortFwdSessionOpenFail) (sbyte4 connectionInstance, ubyte *pInfo, ubyte4 infoLength, ubyte *pLanguage, ubyte4 languageLength, sbyte4 channel)

This callback function is invoked when the SSH Client attempts to open a service, but fails because the service is not available on the server. This callback function (which is used only for a local port forwarding session open request) should try a different service or return an error code.

Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.

Since
3.06
Version
3.06 and later

(function name changed...)

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_PORT_FORWARDING__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
pInfoPointer to text explaining why the session was closed.
infoLengthNumber of bytes in text explanation (pInfo).
pLanguagePointer to language tag as defined in RFC 1766, Tags for the Identification of Languages; includes the ISO 639 2-letter language code.
languageLengthNumber of bytes in language tag (pLanguage).
channelChannel number returned from SSHC_lpfRegisterConnection().
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

sshc.h