![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
MOC_EXTERN sbyte4 | SSH_ASYNC_ackReceivedMessageBytes (sbyte4 connectionInstance, enum sshSessionTypes sessionEvent, ubyte4 numBytesAck) |
Send an acknowledgement that data was received by the server. More... | |
MOC_EXTERN sbyte4 | SSH_ASYNC_recvContinueMessage (sbyte4 connectionInstance, sbyte4 result) |
Resume (continue) an authentication process that was waiting for a result. More... | |
MOC_EXTERN sbyte4 | SSH_ASYNC_recvMessage (sbyte4 connectionInstance, ubyte *pBytesReceived, ubyte4 numBytesReceived) |
Get data from a client. More... | |
MOC_EXTERN sbyte4 | SSH_ASYNC_sendMessage (sbyte4 connectionInstance, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent) |
Send data to a client. More... | |
MOC_EXTERN sbyte4 | SSH_ASYNC_sendMessagePending (sbyte4 connectionInstance, ubyte4 *pRetNumBytesPending) |
Determine whether there is data in a connection instance's SSH send buffer. More... | |
MOC_EXTERN sbyte4 SSH_ASYNC_ackReceivedMessageBytes | ( | sbyte4 | connectionInstance, |
enum sshSessionTypes | sessionEvent, | ||
ubyte4 | numBytesAck | ||
) |
This function sends an acknowledgement that data was received by the server on the specified connection. Your application must explicitly call this function; there is no automatic acknowledgement.
Important Digicert NanoSSH server versions earlier than 1.41 automatically acknowledged received data. Therefore, if you're porting your application from an earlier NanoSSH server version, be sure to add calls to this function.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_ASYNC_acceptConnection(). |
sessionEvent | Type of message for which data was received (an sshSessionTypes enumerated value, defined in ssh.h). |
numBytesAck | Number of bytes received. |
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_ASYNC_recvContinueMessage | ( | sbyte4 | connectionInstance, |
sbyte4 | result | ||
) |
This function resumes (continues) an authentication process that was waiting for a result from an authentication server.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_ASYNC_acceptConnection(). |
result | Result of previous authentication attempt; see ssh_auth_result_codes. |
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_ASYNC_recvMessage | ( | sbyte4 | connectionInstance, |
ubyte * | pBytesReceived, | ||
ubyte4 | numBytesReceived | ||
) |
This function retrieves data from a client. It should be called from your TCP/IP receive upcall handler, or from your application after reading a packet of data. The engine decrypts and processes the packet, and then calls the sshSettings::funcPtrReceivedData upcall to handle the decrypted data.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_ASYNC_acceptConnection(). |
pBytesReceived | Pointer to the packet or message received from the TCP/IP stack. |
numBytesReceived | Number of bytes in packet or message received (pBytesReceived ). |
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_ASYNC_sendMessage | ( | sbyte4 | connectionInstance, |
sbyte * | pBuffer, | ||
sbyte4 | bufferSize, | ||
sbyte4 * | pBytesSent | ||
) |
This function sends data to a client. It should not be called until an open shell upcall notification (sshSettings::funcPtrOpenShell).
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_ASYNC_acceptConnection(). |
pBuffer | Pointer to the send data buffer. |
bufferSize | Number of bytes in send data buffer (pBuffer ). |
pBytesSent | On return, pointer to the 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_ASYNC_sendMessagePending | ( | sbyte4 | connectionInstance, |
ubyte4 * | pRetNumBytesPending | ||
) |
This function determines whether there is data in a connection instance's SSH send buffer. If the send buffer is empty, zero (0) is returned through the pRetNumBytesPending
parameter. If send data is pending, an attempt is made to send the data, and the subsequent number of bytes remaining to be sent is returned through the pRetNumBytesPending
parameter.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_ASYNC_acceptConnection(). |
pRetNumBytesPending | On return, pointer to number of bytes remaining in the send buffer. |
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.