![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
MOC_EXTERN sbyte4 | SSHC_closeDirectory (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr) |
Close a directory on an SFTP server. More... | |
MOC_EXTERN sbyte4 | SSHC_openDirectory (sbyte4 connectionInstance, ubyte *pPath, ubyte4 pathLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr) |
MOC_EXTERN sbyte4 | SSHC_readDirectory (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr, ubyte **ppRetFilename, ubyte4 *pRetFilenameLen) |
Get a directory's list of files (using a read directory request). More... | |
MOC_EXTERN void | SSHC_sftpGetDirEntryFilePermission (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr, ubyte4 *pRetFilePermission, intBoolean *pRetIsPresent) |
Determine whether a directory's file permission flag is set. More... | |
MOC_EXTERN void | SSHC_sftpGetDirEntryFileSize (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr, ubyte4 *pRetFileSize, intBoolean *pRetIsPresent) |
Get a directory's size (number of bytes). More... | |
MOC_EXTERN void | SSHC_sftpGetDirEntryFileType (sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr, ubyte4 *pRetFileType, intBoolean *pRetIsPresent) |
Get a directory's type. More... | |
MOC_EXTERN sbyte4 SSHC_closeDirectory | ( | sbyte4 | connectionInstance, |
sftpcFileHandleDescr * | p_sftpFileHandleDescr | ||
) |
This function sends a close directory request to the connected SSH/SFTP server to close an open directory, disabling it from further access.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_FTP_CLIENT__
connectionInstance | Connection instance returned from SSHC_connect(). |
p_sftpFileHandleDescr | File handle returned from SSHC_openDirectory(). |
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 SSHC_openDirectory | ( | sbyte4 | connectionInstance, |
ubyte * | pPath, | ||
ubyte4 | pathLen, | ||
sftpcFileHandleDescr ** | pp_sftpFileHandleDescr | ||
) |
Open a directory. This function sends an open directory request to the connected SSH/SFTP server.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_FTP_CLIENT__
connectionInstance | Connection instance returned from SSHC_connect(). |
pPath | Pointer to buffer containing directory name. |
pathLen | Number of bytes (characters) in the directory name (pPath ). |
pp_sftpFileHandleDescr | Pointer to address of handle descriptor structure, which on return contains the opened directory's information. |
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 SSHC_readDirectory | ( | sbyte4 | connectionInstance, |
sftpcFileHandleDescr * | p_sftpFileHandleDescr, | ||
ubyte ** | ppRetFilename, | ||
ubyte4 * | pRetFilenameLen | ||
) |
This function sends a read directory request to the connected SSH/SFTP server to return the specified directory's list of files (through the ppRetFilename
parameter).
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_FTP_CLIENT__
connectionInstance | Connection instance returned from SSHC_connect(). |
p_sftpFileHandleDescr | Pointer to handle descriptor structure containing the desired directory's information. |
ppRetFilename | Pointer to address of ubyte buffer, which on return contains the directory's filenames as strings. |
pRetFilenameLen | Pointer to ubyte4 , which on return contains the number of bytes in the ppRetFilename 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.MOC_EXTERN void SSHC_sftpGetDirEntryFilePermission | ( | sbyte4 | connectionInstance, |
sftpcFileHandleDescr * | p_sftpFileHandleDescr, | ||
ubyte4 * | pRetFilePermission, | ||
intBoolean * | pRetIsPresent | ||
) |
This function determines the specified directory's attributes are set. If so, TRUE
is returned through the pRetIsPresent
parameter, and the pRetFilePermission
parameter value is set to TRUE
or FALSE
to indicate whether the SSH_FILEXFER_ATTR_PERMISSIONS
bit flag is set or clear in the directory attribute's bitmask. If the attributes are not set, FALSE
is returned trough the pRetFilePermission
parameter.
For a list of handle descriptor attribute flags, see sshc_hnd_desc_flags.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_FTP_CLIENT__
connectionInstance | Connection instance returned from SSHC_connect(). |
p_sftpFileHandleDescr | Pointer to file handle descriptor. |
pRetFilePermission | (Valid only if pRetIsPresent value is TRUE ) On return, pointer to TRUE (if the attribute's SSH_FILEXFER_ATTR_PERMISSIONS bit flag is set) or FALSE . |
pRetIsPresent | On return, pointer to TRUE (if the handle descriptor's directory attributes are set) or FALSE . |
MOC_EXTERN void SSHC_sftpGetDirEntryFileSize | ( | sbyte4 | connectionInstance, |
sftpcFileHandleDescr * | p_sftpFileHandleDescr, | ||
ubyte4 * | pRetFileSize, | ||
intBoolean * | pRetIsPresent | ||
) |
This function determines whether the specified directory's attributes are set. If so, TRUE
is returned through the pRetIsPresent
parameter, and the directory attribute's SSH_FILEXFER_ATTR_SIZE
bit flag is checked. If the bit flag is set, the RetFileSize
parameter value is set to the number of bytes used by the directory; otherwise the RetFileSize
value is set to 0.
For a list of handle descriptor attribute flags, see sshc_hnd_desc_flags.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_FTP_CLIENT__
connectionInstance | Connection instance returned from SSHC_connect(). |
p_sftpFileHandleDescr | Pointer to file handle descriptor. |
pRetFileSize | (Valid only if pRetIsPresent value is TRUE ) On return, pointer to number of bytes used by the directory (if the attribute's SSH_FILEXFER_ATTR_SIZE bit flag is set) or 0. |
pRetIsPresent | On return, pointer to TRUE (if the handle descriptor's directory attributes are set) or FALSE . |
MOC_EXTERN void SSHC_sftpGetDirEntryFileType | ( | sbyte4 | connectionInstance, |
sftpcFileHandleDescr * | p_sftpFileHandleDescr, | ||
ubyte4 * | pRetFileType, | ||
intBoolean * | pRetIsPresent | ||
) |
This function determines whether the specified directory's attributes are set. If so, TRUE
is returned through the pRetIsPresent
parameter, and the directory attribute's type is returned through the pRetFileType
parameter.
FALSE
is returned through the pRetIsPresent
parameter.To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
__ENABLE_MOCANA_SSH_FTP_CLIENT__
connectionInstance | Connection instance returned from SSHC_connect(). |
p_sftpFileHandleDescr | Pointer to file handle descriptor. |
pRetFileType | (Valid only if pRetIsPresent value is TRUE ) On return, pointer to value indicating directory type (definitions in ssh_defs.h):
|
pRetIsPresent | On return, pointer to TRUE (if the handle descriptor's directory attributes are set) or FALSE . |