![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
MOC_EXTERN sbyte4 | SSHC_doProtocolProcessPortForwardSession (sbyte4 connectionInstance, intBoolean useTimeout, ubyte4 timeout) |
MOC_EXTERN sbyte4 | SSHC_lpfRegisterConnection (sbyte4 connectionInstance, ubyte4 *pChannel) |
Register the port number on which to listen for port forwarding messages from the SSH server. More... | |
MOC_EXTERN sbyte4 | SSHC_lpfSendMessage (sbyte4 connectionInstance, ubyte4 channel, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent) |
Send local port forwarding connection data from SSH client to SSH server. More... | |
MOC_EXTERN sbyte4 | SSHC_lpfStartConnection (sbyte4 connectionInstance, ubyte4 channel, ubyte *pConnectHost, ubyte4 connectPort, ubyte *pSrcHost, ubyte4 srcPort) |
Start a port forwarding session. More... | |
MOC_EXTERN sbyte4 | SSHC_lpfStopConnection (sbyte4 connectionInstance, ubyte4 channel) |
Stop port forwarding through the specified SSH connection. More... | |
MOC_EXTERN sbyte4 SSHC_doProtocolProcessPortForwardSession | ( | sbyte4 | connectionInstance, |
intBoolean | useTimeout, | ||
ubyte4 | timeout | ||
) |
Forward port forwarding messages from an SSH server to local ports. This function forwards port forwarding messages from an SSH server to local ports.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_PORT_FORWARDING__
connectionInstance | Connection instance returned from SSHC_connect(). |
useTimeout | TRUE to use the dead man timer specified by the timeout parameter; FALSE otherwise. |
timeout | Number of milliseconds to wait for the forwarding result. |
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.MOC_EXTERN sbyte4 SSHC_lpfRegisterConnection | ( | sbyte4 | connectionInstance, |
ubyte4 * | pChannel | ||
) |
This function registers the port number on which to listen for port forwarding messages from the SSH server.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_PORT_FORWARDING__
connectionInstance | Connection instance returned from SSHC_connect(). |
pChannel | Pointer to port forwarding channel number through which to send the message. |
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.MOC_EXTERN sbyte4 SSHC_lpfSendMessage | ( | sbyte4 | connectionInstance, |
ubyte4 | channel, | ||
sbyte * | pBuffer, | ||
sbyte4 | bufferSize, | ||
sbyte4 * | pBytesSent | ||
) |
This function sends local port forwarding connection data from SSH client to SSH server.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_PORT_FORWARDING__
connectionInstance | Connection instance returned from SSHC_connect(). |
channel | Port forwarding channel number through which to send the message. |
pBuffer | Pointer to message to forward. |
bufferSize | Number of bytes in message to forward (pBuffer ). |
pBytesSent | On return, pointer to number of bytes forwarded. |
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.MOC_EXTERN sbyte4 SSHC_lpfStartConnection | ( | sbyte4 | connectionInstance, |
ubyte4 | channel, | ||
ubyte * | pConnectHost, | ||
ubyte4 | connectPort, | ||
ubyte * | pSrcHost, | ||
ubyte4 | srcPort | ||
) |
This function starts a port forwarding session by sending the required SSH message from SSH client to the SSH server.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_PORT_FORWARDING__
connectionInstance | Connection instance returned from SSHC_connect(). |
channel | Port forwarding channel number through which to send the message. |
pConnectHost | Pointer to string representation of SSH server host computer IP address. |
connectPort | Port number through which to connect to the SSH server host. |
pSrcHost | Pointer to string representation of originating computer IP address. |
srcPort | Port number of originating computer's forwarding connection. |
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.MOC_EXTERN sbyte4 SSHC_lpfStopConnection | ( | sbyte4 | connectionInstance, |
ubyte4 | channel | ||
) |
This function stops port forwarding (terminates the connection) by sending an SSH CLOSE
message to the SSH server.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_PORT_FORWARDING__
connectionInstance | Connection instance returned from SSHC_connect(). |
channel | Port forwarding channel number through which to send the message. |
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.