![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
MOC_EXTERN sbyte4 | SSH_recv (sbyte4 connectionInstance, sbyte4 *pMessageType, ubyte *pRetBuffer, ubyte4 bufferSize, sbyte4 *pNumBytesReceived, ubyte4 timeout) |
Get data from a server and decrypt the data. More... | |
MOC_EXTERN sbyte4 | SSH_recvMessage (sbyte4 connectionInstance, sbyte4 *pMessageType, sbyte *pRetMessage, sbyte4 *pNumBytesReceived, ubyte4 timeout) |
Get an entire message from a server and decrypt the data. More... | |
MOC_EXTERN sbyte4 | SSH_recvPending (sbyte4 connectionInstance, sbyte4 *pRetBooleanIsPending) |
Determine whether there is data in a connection instance's SSH receive buffer. More... | |
MOC_EXTERN sbyte4 | SSH_sendErrMessage (sbyte4 connectionInstance, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent) |
Send stderr error message output data over SSH. More... | |
MOC_EXTERN sbyte4 | SSH_sendMessage (sbyte4 connectionInstance, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent) |
Send data to a client. More... | |
MOC_EXTERN sbyte4 SSH_recv | ( | sbyte4 | connectionInstance, |
sbyte4 * | pMessageType, | ||
ubyte * | pRetBuffer, | ||
ubyte4 | bufferSize, | ||
sbyte4 * | pNumBytesReceived, | ||
ubyte4 | timeout | ||
) |
This function retrieves data from a server, decrypts the data, and stores it in the provided buffer. The retrieved data may be the full message or only part of the message.
In contrast to SSH_recvMessage(), which reads an entire message, this function enables streaming data reads of just part of a message.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_STREAM_API__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
pMessageType | On return, pointer to type of message received (an sshSessionTypes enumerated value, defined in ssh.h). |
pRetBuffer | Pointer to receive message buffer. |
bufferSize | Number of bytes in receive message buffer (pRetBuffer ). |
pNumBytesReceived | On return, pointer to the number of bytes received. |
timeout | Number of milliseconds for the client to wait to receive the message; 0 specifies no timeout (an infinite wait). |
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 SSH_recvMessage | ( | sbyte4 | connectionInstance, |
sbyte4 * | pMessageType, | ||
sbyte * | pRetMessage, | ||
sbyte4 * | pNumBytesReceived, | ||
ubyte4 | timeout | ||
) |
This function retrieves an entire message from a server, decrypts the data, and stores it in the provided buffer.
In contrast to SSH_recv(), which reads just part of a message, this function reads an entire message at once.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
Additionally, the following flags must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
__ENABLE_MOCANA_SSH_STREAM_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
pMessageType | On return, pointer to type of message received (an sshSessionTypes enumerated value, defined in ssh.h). |
pRetMessage | Pointer to receive message buffer. |
pNumBytesReceived | On return, pointer to the number of bytes received. |
timeout | Number of milliseconds for the client to wait to receive the message; 0 specifies no timeout (an infinite wait). |
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 SSH_recvPending | ( | sbyte4 | connectionInstance, |
sbyte4 * | pRetBooleanIsPending | ||
) |
This function determines whether there is data in a connection instance's SSH receive buffer, and returns the result (TRUE
or FALSE
) through the pRetBooleanIsPending
parameter.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_STREAM_API__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
pRetBooleanIsPending | On return, pointer to TRUE if there is data to be received; otherwise pointer to FALSE . |
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 SSH_sendErrMessage | ( | sbyte4 | connectionInstance, |
sbyte * | pBuffer, | ||
sbyte4 | bufferSize, | ||
sbyte4 * | pBytesSent | ||
) |
This function sends stderr
error message output data over SSH.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
pBuffer | Pointer to buffer containing the stderr error message data to send. |
bufferSize | Number of bytes in the error message (bBuffer ). |
pBytesSent | On return, pointer to number of bytes successfully sent. |
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 SSH_sendMessage | ( | sbyte4 | connectionInstance, |
sbyte * | pBuffer, | ||
sbyte4 | bufferSize, | ||
sbyte4 * | pBytesSent | ||
) |
This function sends data to a server unless deadlock prevention is enabled by the ENABLE_MOCANA_SSH_SENDER_RECV
flag and the SSH transport window size indicates insufficient client acknowledgement of previously sent data.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
pBuffer | Pointer to the buffer containing the data to send. |
bufferSize | Number of bytes in the send data buffer (pBuffer ). |
pBytesSent | On return, pointer to number of bytes successfully sent. |
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.