TrustCore SDK NanoSSH API reference  version 7.0

Variables

sbyte4(* sftpSettings::funcPtrCloseFileUpcall )(sbyte4 connectionInstance, void *sftpInternelDescr)
 Respond to a file close request. More...
 
sbyte4(* sftpSettings::funcPtrOpenFileUpcall )(sbyte4 connectionInstance, void *sftpInternelDescr, sbyte *pLongDirectoryName, sbyte *pFilename, sbyte4 flags)
 Respond to a file open request. More...
 
sbyte4(* sftpSettings::funcPtrReadFileUpcall )(sbyte4 connectionInstance, void *sftpInternelDescr)
 Respond to a file download request. More...
 
sbyte4(* sftpSettings::funcPtrWriteFileUpcall )(sbyte4 connectionInstance, void *sftpInternelDescr)
 Respond to a file upload request. More...
 

Detailed Description

Variable Documentation

◆ funcPtrCloseFileUpcall

sbyte4(* sftpSettings::funcPtrCloseFileUpcall) (sbyte4 connectionInstance, void *sftpInternelDescr)

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_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
sftpInternelDescrState information for a specific open file connection (similar to a connection instance).
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.

sftp.h

◆ funcPtrOpenFileUpcall

sbyte4(* sftpSettings::funcPtrOpenFileUpcall) (sbyte4 connectionInstance, void *sftpInternelDescr, sbyte *pLongDirectoryName, sbyte *pFilename, sbyte4 flags)

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_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
sftpInternelDescrState information for a specific open file connection (similar to a connection instance).
pLongDirectoryNamePointer to string specifying full directory path of the file.
pFilenamePointer to string specifying the name of the file to open.
flagsCombination of bit flag constant(s) specifying the file's permissions (SFTP_OPEN_FILE_READ_BINARY and/or SFTP_OPEN_FILE_WRITE_BINARY).
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.

sftp.h

◆ funcPtrReadFileUpcall

sbyte4(* sftpSettings::funcPtrReadFileUpcall) (sbyte4 connectionInstance, void *sftpInternelDescr)

This callback function is invoked when a client 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_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
sftpInternelDescrState information for a specific open file connection (similar to a connection instance).
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.

sftp.h

◆ funcPtrWriteFileUpcall

sbyte4(* sftpSettings::funcPtrWriteFileUpcall) (sbyte4 connectionInstance, void *sftpInternelDescr)

This callback function is invoked when a client 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_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
sftpInternelDescrState information for a specific open file connection (similar to a connection instance).
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.

sftp.h