TrustCore SDK NanoSSH API reference  version 7.0
SFTP Client Callbacks

Variables

sbyte4(* sftpClientSettings::funcPtrCloseFileUpcall )(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Respond to a file close request. More...
 
sbyte4(* sftpClientSettings::funcPtrOpenFileClientUpcall )(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Respond to a file open request. More...
 
sbyte4(* sftpClientSettings::funcPtrReadFileUpcall )(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Respond to a file download request. More...
 
void(* sftpClientSettings::funcPtrStatus )(sbyte4 connectionInstance, ubyte4 statusCode, ubyte *message, ubyte4 messageLength, ubyte *pLanguage, ubyte4 languageLength)
 Respond to a file open request. More...
 
sbyte4(* sftpClientSettings::funcPtrWriteFileUpcall )(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Respond to a file upload request. More...
 

Detailed Description

Variable Documentation

◆ funcPtrCloseFileUpcall

sbyte4(* sftpClientSettings::funcPtrCloseFileUpcall) (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)

This callback function is invoked when a user is finished viewing, modifying, or adding a file.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_FTP_CLIENT__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
p_sftpFileHandleDescrFile handle descriptor returned from SSHC_openFile(). Contains state information for a specific open file connection (similar to a connection instance).
Returns
OK (0) if successful; otherwise a negative number error code that is meaningful within the context of your application.

sshc_filesys.h

◆ funcPtrOpenFileClientUpcall

sbyte4(* sftpClientSettings::funcPtrOpenFileClientUpcall) (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)

This callback function is invoked when a user issues a file open request (for either reading or writing).

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_FTP_CLIENT__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
p_sftpFileHandleDescrFile handle descriptor returned from SSHC_openFile(). Contains state information for a specific open file connection (similar to a connection instance).
Returns
OK (0) if successful; otherwise a negative number error code that is meaningful within the context of your application.

sshc_filesys.h

◆ funcPtrReadFileUpcall

sbyte4(* sftpClientSettings::funcPtrReadFileUpcall) (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)

This callback function is invoked when a server downloads (requests) a file by using get.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_FTP_CLIENT__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
p_sftpFileHandleDescrFile handle descriptor returned from SSHC_openFile(). Contains state information for a specific open file connection (similar to a connection instance).
Returns
OK (0) if successful; otherwise a negative number error code that is meaningful within the context of your application.

sshc_filesys.h

◆ funcPtrStatus

void(* sftpClientSettings::funcPtrStatus) (sbyte4 connectionInstance, ubyte4 statusCode, ubyte *message, ubyte4 messageLength, ubyte *pLanguage, ubyte4 languageLength)

This is an optional callback that you can implement and invoke anytime to obtain the SSH server's response to NanoSSH client. This is particularly useful when a NanoSSH API method returns an error code and you want to learn the low-level details from the server's message, and display or log that information.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_FTP_CLIENT__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
statusCodeError/status code contained in the payload of the server's response. The location of the error code in the payload varies by server response type, as per the RFC.
messageMessage text contained in the payload of the server's response. The location of the message in the payload varies by server response type, as per the RFC.
messageLengthNumber of bytes in the server's response message text. The location of the message length in the payload varies by server response type, as per the RFC.
pLanguageLanguage tag in the server's response, as defined in RFC 1766.
languageLengthNumber of bytes in the language tag of the server's response.
Returns
OK (0) if successful; otherwise a negative number error code that is meaningful within the context of your application.

sshc_filesys.h

◆ funcPtrWriteFileUpcall

sbyte4(* sftpClientSettings::funcPtrWriteFileUpcall) (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)

This callback function is invoked when a server uploads a file by using put.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_FTP_CLIENT__
Parameters
connectionInstanceConnection instance returned from SSHC_connect().
p_sftpFileHandleDescrFile handle descriptor returned from SSHC_openFile(). Contains state information for a specific open file connection (similar to a connection instance).
Returns
OK (0) if successful; otherwise a negative number error code that is meaningful within the context of your application.

sshc_filesys.h