33 #ifndef __SSHC_HEADER__ 34 #define __SSHC_HEADER__ 36 #include "../../common/mtcp.h" 37 #include "../../crypto/pubcrypto.h" 43 #define SSHC_SFTP_MAX_READ_BYTES (MAX_SESSION_WINDOW_SIZE - (4 + 4 + 1 + 4)) 44 #define SSHC_BUFFER_SIZE (SSHC_MAX_BUFFER_SIZE) 46 #define CONNECT_CLOSING -1 47 #define CONNECT_DISABLED 0 48 #define CONNECT_CLOSED 1 49 #define CONNECT_NEGOTIATE 2 50 #define CONNECT_OPEN 3 52 #define SSH_BYTE_SIZE 1 53 #define SSH_UINT64_FIELD_SIZE 8 60 #define TIMEOUT_SSHC_OPEN (2000) 61 #ifdef __ENABLE_MOCANA_QS__ 62 #define TIMEOUT_SSHC_KEX (120000) 63 #elif defined(__FSL_MSS_FIX_ENABLED__) 64 #define TIMEOUT_SSHC_KEX (40000) 66 #define TIMEOUT_SSHC_KEX (10000) 69 #define TIMEOUT_SSHC_NEWKEYS (15000) 70 #ifdef __ENABLE_MOCANA_QS__ 71 #define TIMEOUT_SSHC_SERVICE_REQUEST (120000) 73 #define TIMEOUT_SSHC_SERVICE_REQUEST (30000) 75 #define TIMEOUT_SSHC_OPEN_STATE (30000) 76 #define TIMEOUT_SSHC_UPPER_LAYER (15000) 77 #define TIMEOUT_SSHC_PORTFWD_MESG (500) 78 #define TIMEOUT_SSHC_PORTFWD_START (1000) 80 #define TIMEOUT_SSHC_OPEN (0) 81 #define TIMEOUT_SSHC_KEX (0) 82 #define TIMEOUT_SSHC_NEWKEYS (0) 83 #define TIMEOUT_SSHC_SERVICE_REQUEST (0) 84 #define TIMEOUT_SSHC_OPEN_STATE (0) 85 #define TIMEOUT_SSHC_UPPER_LAYER (0) 90 #ifdef __ENABLE_MOCANA_QS__ 91 #define TIMEOUT_SSHC_AUTH_LOGON (1000 * 60 * 200) 93 #define TIMEOUT_SSHC_AUTH_LOGON (1000 * 60 * 10) 97 #define MAX_SSHC_AUTH_ATTEMPTS (20) 101 #ifndef SSHC_MAX_BUFFER_SIZE 102 #ifdef __ENABLE_MOCANA_QS__ 103 #define SSHC_MAX_BUFFER_SIZE (2097152) 104 #elif defined(__FSL_MSS_FIX_ENABLED__) 105 #define SSHC_MAX_BUFFER_SIZE (2200) 107 #define SSHC_MAX_BUFFER_SIZE (1024*4) 111 #ifdef __FSL_MSS_FIX_ENABLED__ 112 #define MAX_SESSION_WINDOW_SIZE (2500) 114 #define MAX_SESSION_WINDOW_SIZE (1024*2) 117 #define SSHC_SYNC_BUFFER_SIZE (1000) 118 #define SSHC_SFTP_GetMaxBytesToRead() (SSHC_SYNC_BUFFER_SIZE) 121 #ifndef SSHC_MAX_BUFFER_SIZE 122 #define SSHC_MAX_BUFFER_SIZE (16000) 125 #define MAX_SESSION_WINDOW_SIZE (15000) 126 #define SSHC_SYNC_BUFFER_SIZE (8192) 127 #define SSHC_SFTP_GetMaxBytesToRead() (SSHC_SYNC_BUFFER_SIZE) 131 #define SSH_PUBLIC_KEY_BLOB 1 132 #define SSH_PRIVATE_KEY_BLOB 2 135 #define MOCANA_SSH_AUTH_PUBLIC_KEY 0x80 136 #define MOCANA_SSH_AUTH_PASSWORD 0x40 137 #define MOCANA_SSH_AUTH_NONE 0x10 138 #define MOCANA_SSH_AUTH_KEYBOARD_INTERACTIVE 0x20 139 #define MOCANA_SSH_AUTH_CERT 0x100 142 #define MAX_OCSP_TRUSTED_RESPONDERS 3 144 #define SSH_MAX_RPF_HOSTS 16 145 #define SSH_MAX_REMOTE_PORT_FWD_CHANNEL 64 148 #define AUTH_ECHO (1) 149 #define AUTH_NO_ECHO (0) 151 #ifndef AUTH_MAX_NUM_PROMPTS 152 #define AUTH_MAX_NUM_PROMPTS 3 155 #ifndef MAX_SSH_DH_SIZE 156 #define MAX_SSH_DH_SIZE (8192) 162 enum sshcSessionTypes
166 SSH_SESSION_PTY_REQUEST,
167 SSH_SESSION_OPEN_SHELL,
168 SSH_SESSION_OPEN_SFTP,
169 SSH_SESSION_OPEN_PTY,
170 SSH_SESSION_WINDOW_CHANGE,
180 SSH_LOCAL_PORT_FORWARDING,
181 SSH_REMOTE_PORT_FORWARDING
197 sbyte* pTerminalEnvironment;
198 ubyte4 terminalEnvironmentLength;
200 sbyte* pEncodedTerminalModes;
201 ubyte4 encodedTerminalModes;
210 #ifdef __ENABLE_MOCANA_SSH_FTP_CLIENT__ 219 intBoolean isFileHandleInUse;
225 sbyte4 readBufferSize;
227 sbyte4 writeLocation;
229 sbyte4 writeBufferSize;
234 ubyte4 requestStatusResponse;
238 struct ATTRClient* pATTR;
242 ubyte* pFileListingPayload;
243 ubyte4 fileListingCount;
244 ubyte4 fileListingPosition;
245 ubyte4 fileListingBufIndex;
246 ubyte4 fileListingPayloadLen;
274 ubyte4 instructionLen;
303 typedef struct certChain* certChainPtr;
393 #if ((defined(__ENABLE_MOCANA_SSH_OCSP_SUPPORT__)) && (defined(__ENABLE_MOCANA_OCSP_CLIENT__))) 401 certDescriptor ocspTrustedResponderCerts[MAX_OCSP_TRUSTED_RESPONDERS];
409 MSTATUS (*funcPtrSessionOpen) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
416 MSTATUS (*funcPtrPtyRequest) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
423 MSTATUS (*funcPtrOpenShell) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
430 MSTATUS (*funcPtrOpenSftp) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
437 MSTATUS (*funcPtrWindowChange) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
444 MSTATUS (*funcPtrReceivedData) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
451 MSTATUS (*funcPtrStdErr) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
458 MSTATUS (*funcPtrEof) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
465 MSTATUS (*funcPtrClosed) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
472 MSTATUS (*funcPtrBreakOp) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen);
502 void(*funcPtrStartTimer) (sbyte4 connectionInstance, ubyte4 msTimerExpire, sbyte4 boolUserAuthenticated);
540 sbyte4(*funcPtrRetrieveNakedAuthKeys)(sbyte4 connectionInstance, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyBlobLength);
573 sbyte4(*funcPtrReleaseNakedAuthKeys) (sbyte4 connectionInstance, ubyte **ppFreeKeyBlob);
665 sbyte4(*funcPtrServerPubKeyAuth) (sbyte4 connectionInstance,
const ubyte *pPubKey, ubyte4 pubKeyLength);
710 sbyte4(*funcPtrRetrieveUserAuthRequestInfo)(sbyte4 connectionInstance, ubyte *pAuthNameList, ubyte4 authNameListLen, ubyte **ppUserName, ubyte4 *pUserNameLength, ubyte4 *pMethod);
713 #ifdef __ENABLE_MOCANA_SSH_AUTH_KEYBOARD_INTERACTIVE__ 716 sbyte4(*funcPtrReleaseKeyIntAuthResp)(sbyte4 connectionInstance,
keyIntInfoResp *pResponse);
776 sbyte4(*funcPtrRetrieveUserAuthRequestInfoEx)(sbyte4 connectionInstance, ubyte messageCode, ubyte4 methodType, ubyte *pAuthNameList, ubyte4 authNameListLen, ubyte **ppUserName, ubyte4 *pUserNameLength, ubyte4 *pMethod, intBoolean *pSendSignature);
812 sbyte4(*funcPtrCertStatus) (sbyte4 connectionInstance,
813 sbyte4 cert_status, ubyte *pCertificate, ubyte4 certLen,
814 certChainPtr pCertChain,
const ubyte *pAnchorCert, ubyte4 anchorCertLen);
850 sbyte4(*funcPtrRetrieveUserPassword) (sbyte4 connectionInstance, ubyte *pUserName, ubyte4 userNameLength, ubyte **ppUserPassword, ubyte4 *pUserPasswordLength);
878 void(*funcPtrAuthOpen) (sbyte4 connectionInstance);
917 sbyte4(*funcPtrSessionOpenFail) (sbyte4 connectionInstance, ubyte *pInfo, ubyte4 infoLength, ubyte *pLanguage, ubyte4 languageLength);
919 #ifdef __ENABLE_MOCANA_SSH_PORT_FORWARDING__ 954 void(*funcPtrPortFwdSessionOpen) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel);
999 sbyte4(*funcPtrPortFwdSessionOpenFail) (sbyte4 connectionInstance, ubyte *pInfo, ubyte4 infoLength, ubyte *pLanguage, ubyte4 languageLength, sbyte4 channel);
1035 void(*funcPtrPortForwardClosed) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel);
1071 void(*funcPtrPortForwardEof) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel);
1107 void(*funcPtrPortFwdReceivedData) (sbyte4 connectionInstance,
enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel );
1113 sbyte4(*funcPtrPortForwardConnect) (sbyte4 connectionInstance,
enum pfType, sbyte *pHostAddr, ubyte4 hostPort, ubyte *pIgnoreRequest, ubyte4 channel );
1119 void(*funcPtrRemotePortReqStatus) (sbyte4 status, ubyte4 port );
1123 #ifdef __ENABLE_MOCANA_SSH_AUTH_BANNER__ 1160 sbyte4(* funcPtrDisplayBanner)(sbyte4 connectionInstance, ubyte *pBanner, ubyte4 length, ubyte *pMsgLanguageTag);
1189 void(* funcPtrDisconnectMsg)(sbyte4 connectionInstance, ubyte4 reasonCode, ubyte *pMsg, ubyte4 msgLength, ubyte *pMsgLanguageTag);
1216 MSTATUS (*funcPtrSessionReKey) (sbyte4 connectionInstance, intBoolean initiatedByRemote);
1283 MOC_EXTERN sbyte4
SSHC_init(sbyte4 numClientConnections);
1345 MOC_EXTERN sbyte4
SSHC_connect(TCP_SOCKET tempSocket, sbyte4 *pConnectionInstance, sbyte *pCommonName,
struct certStore *pCertStore);
1414 MOC_EXTERN sbyte4
SSHC_useThisHmac(sbyte4 connectionInstance, ubyte *pHmac);
1668 MOC_EXTERN sbyte4
SSHC_sendMessage(sbyte4 connectionInstance, ubyte *pBuffer, ubyte4 bufferSize, ubyte4 *pBytesSent);
1708 MOC_EXTERN sbyte4
SSHC_recvMessage(sbyte4 connectionInstance, sbyte4 *pMessageType, sbyte *pRetMessage, sbyte4 *pNumBytesReceived, ubyte4 timeout);
1772 MOC_EXTERN
void SSHC_close(sbyte4 connectionInstance);
1806 MOC_EXTERN sbyte4
SSHC_initiateReKey(sbyte4 connectionInstance, ubyte4 msAllowToComply);
1878 MOC_EXTERN sbyte4
SSHC_getCookie(sbyte4 connectionInstance,
void **pRetCookie);
1913 MOC_EXTERN sbyte4
SSHC_setCookie(sbyte4 connectionInstance,
void* cookie);
1917 #ifdef __ENABLE_MOCANA_SSH_PORT_FORWARDING__ 1992 ubyte* pConnectHost, ubyte4 connectPort,
1993 ubyte* pSrcHost, ubyte4 srcPort);
2063 MOC_EXTERN sbyte4
SSHC_lpfSendMessage(sbyte4 connectionInstance, ubyte4 channel, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent);
2097 SSHC_startRemotePortForwarding(sbyte4 connectionInstance, sbyte *pBindAddr, ubyte4 bindPort, sbyte *pHostAddr, ubyte4 hostPort);
2099 SSHC_cancelRemotePortForwarding(sbyte4 connectionInstance, sbyte *pHostAddr, ubyte4 hostPort);
2103 #ifdef __ENABLE_MOCANA_SSH_FTP_CLIENT__ 2143 MOC_EXTERN sbyte4
SSHC_openFile(sbyte4 connectionInstance, ubyte* pFName, ubyte4 pFNameLen, sbyte4 readOrWrite,
sftpcFileHandleDescr **pp_retSftpFileHandleDescr);
2664 MOC_EXTERN sbyte4
SSHC_freeFilename(sbyte4 connectionInstance, ubyte **ppFreeFilename);
2996 MOC_EXTERN sbyte4
SSHC_realpath(sbyte4 connectionInstance, ubyte *pRealpath, ubyte4 realpathLen,
sftpcFileHandleDescr** pp_sftpFileHandleDescr, ubyte **ppRetRealpath, ubyte4 *pRetRealpathLen);
3076 MOC_EXTERN sbyte4
SSHC_mkdir(sbyte4 connectionInstance, ubyte *pNewDirName, ubyte4 newDirNameLen,
sftpcFileHandleDescr** pp_sftpFileHandleDescr,
void *pFuture);
3115 MOC_EXTERN sbyte4
SSHC_rmdir(sbyte4 connectionInstance, ubyte *pRemoveDirName, ubyte4 removeDirNameLen,
sftpcFileHandleDescr** pp_sftpFileHandleDescr);
3155 MOC_EXTERN MSTATUS
SSHC_generateServerAuthKeyFile(ubyte *pKeyBlob, ubyte4 keyBlobLen, ubyte **ppRetEncodedAuthKey, ubyte4 *pRetEncodedAuthKeyLen);
3191 AsymmetricKey *pAsymKey);
3228 AsymmetricKey *pAsymKey);
MOC_EXTERN sbyte4 SSHC_removeFile(sbyte4 connectionInstance, ubyte *pRemoveFileName, ubyte4 removeFileNameLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr)
Delete a file from an SFTP server.
MOC_EXTERN sbyte4 SSHC_doProtocolProcessPortForwardSession(sbyte4 connectionInstance, intBoolean useTimeout, ubyte4 timeout)
MOC_EXTERN sbyte4 SSHC_lpfSendMessage(sbyte4 connectionInstance, ubyte4 channel, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent)
Send local port forwarding connection data from SSH client to SSH server.
MOC_EXTERN sbyte4 SSHC_setTerminalTextWindowSize(sbyte4 connectionInstance, ubyte4 width, ubyte4 height)
Set a terminal window's dimensions.
ubyte4 sshTimeOutServiceRequest
Number of milliseconds the client waits for a service request response before timing out...
Definition: sshc.h:375
MOC_EXTERN sbyte4 SSHC_sftpWriteLocation(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get a file's current write location.
MOC_EXTERN sbyte * SSHC_sftpWriteBuffer(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get a pointer to a file's write data buffer.
MOC_EXTERN sbyte4 SSHC_recvMessage(sbyte4 connectionInstance, sbyte4 *pMessageType, sbyte *pRetMessage, sbyte4 *pNumBytesReceived, ubyte4 timeout)
Get data from a connected server/client.
MOC_EXTERN sbyte4 SSHC_sftpNumBytesRead(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get the number of bytes read from an open file.
MOC_EXTERN sbyte4 SSHC_rmdir(sbyte4 connectionInstance, ubyte *pRemoveDirName, ubyte4 removeDirNameLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr)
Delete a directory from an SFTP server.
MOC_EXTERN sbyte4 SSHC_lpfStopConnection(sbyte4 connectionInstance, ubyte4 channel)
Stop port forwarding through the specified SSH connection.
MOC_EXTERN sbyte4 SSHC_mkdir(sbyte4 connectionInstance, ubyte *pNewDirName, ubyte4 newDirNameLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr, void *pFuture)
Create a directory on an SFTP server.
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).
MOC_EXTERN sbyte4 SSHC_negotiateCloseChannel(sbyte4 connectionInstance, sbyte4 channelNumber)
Negotiate closing of a channel.
MOC_EXTERN sbyte4 SSHC_negotiateSubsystemSFTPChannelRequest(sbyte4 connectionInstance)
Send an SSH exec sftp command on the specified connection.
MOC_EXTERN void SSHC_sftpGetDirEntryFileType(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr, ubyte4 *pRetFileType, intBoolean *pRetIsPresent)
Get a directory's type.
MOC_EXTERN sbyte4 SSHC_getFileStat(sbyte4 connectionInstance, ubyte *pGetStatFile, ubyte4 getStatFileLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr)
Get a file's statistics from an SFTP server.
MOC_EXTERN void SSHC_close(sbyte4 connectionInstance)
Close an SSH session and releases all its resources.
MOC_EXTERN sbyte4 SSHC_closeDirectory(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
Close a directory on an SFTP server.
MOC_EXTERN sbyte4 SSHC_initiateReKey(sbyte4 connectionInstance, ubyte4 msAllowToComply)
Initiate an SSH re-key operation.
MOC_EXTERN sbyte4 SSHC_sftpReadLocation(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get a file's current read location.
sbyte4 sshMaxConnections
Maximum number of connections to this client.
Definition: sshc.h:335
MOC_EXTERN sbyte4 SSHC_useThisHmac(sbyte4 connectionInstance, ubyte *pHmac)
Set an SSH connection's HMAC.
MOC_EXTERN sbyte4 SSHC_readFile(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
Read a file on an SFTP server.
MOC_EXTERN sbyte4 SSHC_realpath(sbyte4 connectionInstance, ubyte *pRealpath, ubyte4 realpathLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr, ubyte **ppRetRealpath, ubyte4 *pRetRealpathLen)
Get the fully-qualified directory path of an an SSH Client's virtual directory.
MOC_EXTERN sbyte4 SSHC_lpfRegisterConnection(sbyte4 connectionInstance, ubyte4 *pChannel)
Register the port number on which to listen for port forwarding messages from the SSH server...
MOC_EXTERN sbyte4 SSHC_openFile(sbyte4 connectionInstance, ubyte *pFName, ubyte4 pFNameLen, sbyte4 readOrWrite, sftpcFileHandleDescr **pp_retSftpFileHandleDescr)
Open a file on an SFTP server.
MOC_EXTERN MSTATUS SSHC_parsePublicKeyBuffer(ubyte *pKeyFile, ubyte4 keyFileLen, AsymmetricKey *pAsymKey)
Parses an public key and generates an AsymmetricKey object.
MOC_EXTERN MSTATUS SSHC_freeGenerateServerAuthKeyFile(ubyte **ppFreeEncodedAuthKey)
Release an authentication key's memory.
ubyte4 sshMaxAuthAttempts
Number of authentication tries allowed before the connection is said to have failed.
Definition: sshc.h:343
MOC_EXTERN sbyte4 SSHC_setCookie(sbyte4 connectionInstance, void *cookie)
Save a cookie containing custom information.
NanoSSH Client SFTP file handle descriptor.
Definition: sshc.h:217
MOC_EXTERN sbyte4 SSHC_useThisCipher(sbyte4 connectionInstance, ubyte *pCipher)
Set an SSH connection's cipher.
MOC_EXTERN sbyte4 SSHC_freeFilename(sbyte4 connectionInstance, ubyte **ppFreeFilename)
Release memory used to store a filename.
ubyte4 sshTimeOutDefaultOpenState
Number of milliseconds before timing out for the client to make a request (such as open a shell) afte...
Definition: sshc.h:391
MOC_EXTERN sbyte4 SSHC_sftpRequestStatusCode(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get a file's SFTP operation status.
MOC_EXTERN sbyte4 SSHC_lpfStartConnection(sbyte4 connectionInstance, ubyte4 channel, ubyte *pConnectHost, ubyte4 connectPort, ubyte *pSrcHost, ubyte4 srcPort)
Start a port forwarding session.
MOC_EXTERN void SSHC_sftpSetCookie(sftpcFileHandleDescr *p_sftpFileHandleDescr, void *sftpCookie)
Set a file's cookie value (custom information).
MOC_EXTERN sbyte4 SSHC_numBytesTransmitted(sbyte4 connectionInstance, ubyte8 *pRetNumBytes)
Get the number of bytes sent and received through a given connectionInstance.
MOC_EXTERN sbyte4 SSHC_negotiateConnection(sbyte4 connectionInstance)
Authenticate a server (which establishes a secure connection).
MOC_EXTERN sbyte4 SSHC_closeFile(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
Close a file on an SFTP server.
MOC_EXTERN MSTATUS SSHC_generateServerAuthKeyFile(ubyte *pKeyBlob, ubyte4 keyBlobLen, ubyte **ppRetEncodedAuthKey, ubyte4 *pRetEncodedAuthKeyLen)
Generate an exportable public key for an internal public key BLOB.
MOC_EXTERN sbyte4 SSHC_sftpReadBufferSize(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get the number of bytes in a file's read buffer.
MOC_EXTERN void SSHC_sftpGetDirEntryFilePermission(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr, ubyte4 *pRetFilePermission, intBoolean *pRetIsPresent)
Determine whether a directory's file permission flag is set.
ubyte4 trustedResponderCount
(field added after 5.3.1...)
Definition: sshc.h:397
MOC_EXTERN sbyte4 SSHC_shutdown(void)
Release memory initialized by SSHC_init().
MOC_EXTERN sbyte * SSHC_sftpReadBuffer(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get a pointer to a file's read data buffer.
MOC_EXTERN sbyte4 SSHC_sendMessage(sbyte4 connectionInstance, ubyte *pBuffer, ubyte4 bufferSize, ubyte4 *pBytesSent)
Send data to a server.
MOC_EXTERN sbyte4 SSHC_getCookie(sbyte4 connectionInstance, void **pRetCookie)
Get a connection's cookie containing custom (application-specific) information.
ubyte4 sshTimeOutNewKeys
Number of milliseconds the client waits for new keys before timing out.
Definition: sshc.h:367
MOC_EXTERN MSTATUS SSHC_parseServerAuthKeyFile(ubyte *pKeyFile, ubyte4 keyFileLen, AsymmetricKey *pAsymKey)
Parses an exportable public key and generates an AsymmetricKey object.
MOC_EXTERN sbyte4 SSHC_negotiateSFTPHello(sbyte4 connectionInstance)
Start a NanoSSH client SFTP session.
ubyte4 sshTimeOutKeyExchange
Number of milliseconds the client waits for a key exchange before timing out.
Definition: sshc.h:359
MOC_EXTERN sbyte4 SSHC_sftpNumBytesWritten(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get the number of bytes written to an open file.
MOC_EXTERN sbyte4 SSHC_sftpWriteBufferSize(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get the number of bytes in a file's write buffer.
MOC_EXTERN sshClientSettings * SSHC_sshClientSettings(void)
Get a pointer to the session's NanoSSH Client settings.
MOC_EXTERN sbyte4 SSHC_negotiatePtyTerminalChannelRequest(sbyte4 connectionInstance)
Send an SSH PTY command on the specified connection.
MOC_EXTERN sbyte4 SSHC_init(sbyte4 numClientConnections)
Initialize NanoSSH client internal structures.
MOC_EXTERN sbyte4 SSHC_negotiateShellChannelRequest(sbyte4 connectionInstance)
Send an SSH shell command on the specified connection.
MOC_EXTERN void SSHC_sftpGetDirEntryFileSize(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr, ubyte4 *pRetFileSize, intBoolean *pRetIsPresent)
Get a directory's size (number of bytes).
MOC_EXTERN void * SSHC_sftpGetCookie(sftpcFileHandleDescr *p_sftpFileHandleDescr)
Get a file's cookie value.
ubyte4 sshTimeOutOpen
Number of milliseconds the client waits for an open session response before timing out...
Definition: sshc.h:351
MOC_EXTERN sbyte4 SSHC_negotiateSession(sbyte4 connectionInstance)
Negotiate a connection (the client is authenticated by the server).
ubyte4 sshTimeOutAuthentication
Number of milliseconds the client waits for an authentication response before timing out...
Definition: sshc.h:383
MOC_EXTERN sbyte4 SSHC_openDirectory(sbyte4 connectionInstance, ubyte *pPath, ubyte4 pathLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr)
MOC_EXTERN sbyte4 SSHC_writeFile(sbyte4 connectionInstance, sftpcFileHandleDescr *p_sftpFileHandleDescr)
Write a file to an SFTP server.
Configuration settings and callback function pointers for SSH clients.
Definition: sshc.h:329
MOC_EXTERN sbyte4 SSHC_connect(TCP_SOCKET tempSocket, sbyte4 *pConnectionInstance, sbyte *pCommonName, struct certStore *pCertStore)
Create a secure SSH connection with a remote server.
MOC_EXTERN sbyte4 SSHC_freeHandle(sbyte4 connectionInstance, sftpcFileHandleDescr **pp_sftpFileHandleDescr)
Release (free) memory used to store a file/directory descriptor handle.