TrustCore SDK NanoSSH API reference  version 7.0
Directory Management and Traversal Callbacks

Variables

sbyte4(* sftpSettings::funcPtrCloseDirUpcall )(sbyte4 connectionInstance, void **pDirCookie)
 Respond to completion of a file list command or directory list command. More...
 
sbyte4(* sftpSettings::funcPtrCreateDir )(sbyte4 connectionInstance, sbyte *pCreateDirectoryName)
 Respond to a directory create (make) request. More...
 
sbyte4(* sftpSettings::funcPtrOpenDirUpcall )(sbyte4 connectionInstance, const sbyte *pLongDirectoryName, void **pDirCookie)
 Respond to a directory listing request. More...
 
sbyte4(* sftpSettings::funcPtrReadDirUpcall )(sbyte4 connectionInstance, sbyte *pLongDirectoryName, sftpFileObjDescr *p_sftpFileDescr, void **pDirCookie)
 Respond to a file list request. More...
 
sbyte4(* sftpSettings::funcPtrRemoveDir )(sbyte4 connectionInstance, sbyte *pRemoveDirectoryName)
 Respond to a directory remove (delete) request. More...
 

Detailed Description

Variable Documentation

◆ funcPtrCloseDirUpcall

sbyte4(* sftpSettings::funcPtrCloseDirUpcall) (sbyte4 connectionInstance, void **pDirCookie)

This callback function is invoked upon completion of a file list command or directory list command.

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().
pDirCookiePointer to directory name identifier cookie.
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

◆ funcPtrCreateDir

sbyte4(* sftpSettings::funcPtrCreateDir) (sbyte4 connectionInstance, sbyte *pCreateDirectoryName)

This callback function is invoked when a user issues a create (make) directory command.

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().
pCreateDirectoryNamePointer to string containing desired directory name.
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

◆ funcPtrOpenDirUpcall

sbyte4(* sftpSettings::funcPtrOpenDirUpcall) (sbyte4 connectionInstance, const sbyte *pLongDirectoryName, void **pDirCookie)

This callback function is invoked when a user requests a directory listing.

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().
pLongDirectoryNamePointer to string specifying full directory path of the file.
pDirCookieOn return, pointer to structure containing directory's contents.
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

◆ funcPtrReadDirUpcall

sbyte4(* sftpSettings::funcPtrReadDirUpcall) (sbyte4 connectionInstance, sbyte *pLongDirectoryName, sftpFileObjDescr *p_sftpFileDescr, void **pDirCookie)

This callback function is invoked when a user requests a list of files in a directory.

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().
pLongDirectoryNamePointer to string specifying full directory path of the file.
p_sftpFileDescrOn return, pointer to structure containing a single file's or directory's descriptor.
pDirCookieOn invocation, cookie containing the information necessary to traverse a directory listing; on return, pointer to the file handle.
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

◆ funcPtrRemoveDir

sbyte4(* sftpSettings::funcPtrRemoveDir) (sbyte4 connectionInstance, sbyte *pRemoveDirectoryName)

This callback function is invoked when a user issues a directory remove (delete) request.

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().
pRemoveDirectoryNamePointer to string containing name of the directory to remove (delete).
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