TrustCore SDK NanoSSH API reference  version 7.0
sshClientSettings Struct Reference

Configuration settings and callback function pointers for SSH clients. More...

Data Fields

void(* funcPtrAuthOpen )(sbyte4 connectionInstance)
 Inform the calling application that authentication has been successful. More...
 
MSTATUS(* funcPtrBreakOp )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
sbyte4(* funcPtrCertStatus )(sbyte4 connectionInstance, sbyte4 cert_status, ubyte *pCertificate, ubyte4 certLen, certChainPtr pCertChain, const ubyte *pAnchorCert, ubyte4 anchorCertLen)
 Verify a client's certificate. More...
 
MSTATUS(* funcPtrClosed )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
void(* funcPtrDisconnectMsg )(sbyte4 connectionInstance, ubyte4 reasonCode, ubyte *pMsg, ubyte4 msgLength, ubyte *pMsgLanguageTag)
 Display disconnetion message from server. More...
 
sbyte4(* funcPtrDisplayBanner )(sbyte4 connectionInstance, ubyte *pBanner, ubyte4 length, ubyte *pMsgLanguageTag)
 Display a warning message from the server. More...
 
MSTATUS(* funcPtrEof )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
sbyte4(* funcPtrKeyIntAuthResp )(sbyte4 connectionInstance, keyIntInfoReq *pRequestInfo, keyIntInfoResp *pResponseInfo)
 
MSTATUS(* funcPtrOpenSftp )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
MSTATUS(* funcPtrOpenShell )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
void(* funcPtrPortForwardClosed )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a session close request. More...
 
sbyte4(* funcPtrPortForwardConnect )(sbyte4 connectionInstance, enum pfType, sbyte *pHostAddr, ubyte4 hostPort, ubyte *pIgnoreRequest, ubyte4 channel)
 
void(* funcPtrPortForwardEof )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a session EOF request. More...
 
void(* funcPtrPortFwdReceivedData )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a session message. More...
 
void(* funcPtrPortFwdSessionOpen )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen, ubyte4 channel)
 Respond to a successful session open request. More...
 
sbyte4(* funcPtrPortFwdSessionOpenFail )(sbyte4 connectionInstance, ubyte *pInfo, ubyte4 infoLength, ubyte *pLanguage, ubyte4 languageLength, sbyte4 channel)
 Respond to a failed session open request. More...
 
MSTATUS(* funcPtrPtyRequest )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
MSTATUS(* funcPtrReceivedData )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
sbyte4(* funcPtrReleaseKeyIntAuthResp )(sbyte4 connectionInstance, keyIntInfoResp *pResponse)
 
sbyte4(* funcPtrReleaseNakedAuthKeys )(sbyte4 connectionInstance, ubyte **ppFreeKeyBlob)
 Release (free) memory allocated for authentication keys. More...
 
void(* funcPtrRemotePortReqStatus )(sbyte4 status, ubyte4 port)
 
sbyte4(* funcPtrRetrieveNakedAuthKeys )(sbyte4 connectionInstance, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyBlobLength)
 Get a public/private key pair (naked key blob). More...
 
sbyte4(* funcPtrRetrieveUserAuthRequestInfo )(sbyte4 connectionInstance, ubyte *pAuthNameList, ubyte4 authNameListLen, ubyte **ppUserName, ubyte4 *pUserNameLength, ubyte4 *pMethod)
 Select which authentication methods can be used with the server. More...
 
sbyte4(* funcPtrRetrieveUserAuthRequestInfoEx )(sbyte4 connectionInstance, ubyte messageCode, ubyte4 methodType, ubyte *pAuthNameList, ubyte4 authNameListLen, ubyte **ppUserName, ubyte4 *pUserNameLength, ubyte4 *pMethod, intBoolean *pSendSignature)
 Select which authentication methods can be used with the server, and decide whether to query if server supports authentication method first. More...
 
sbyte4(* funcPtrRetrieveUserPassword )(sbyte4 connectionInstance, ubyte *pUserName, ubyte4 userNameLength, ubyte **ppUserPassword, ubyte4 *pUserPasswordLength)
 Return user's password and its length. More...
 
sbyte4(* funcPtrServerPubKeyAuth )(sbyte4 connectionInstance, const ubyte *pPubKey, ubyte4 pubKeyLength)
 Validate a public key. More...
 
MSTATUS(* funcPtrSessionOpen )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
sbyte4(* funcPtrSessionOpenFail )(sbyte4 connectionInstance, ubyte *pInfo, ubyte4 infoLength, ubyte *pLanguage, ubyte4 languageLength)
 Respond to a failed session open request. More...
 
MSTATUS(* funcPtrSessionReKey )(sbyte4 connectionInstance, intBoolean initiatedByRemote)
 Inform the calling application that Session Rekey has been initiated. More...
 
void(* funcPtrStartTimer )(sbyte4 connectionInstance, ubyte4 msTimerExpire, sbyte4 boolUserAuthenticated)
 Start a timer to use for timeout notifications. More...
 
MSTATUS(* funcPtrStdErr )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
MSTATUS(* funcPtrWindowChange )(sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)
 Protocol-specific upcall (callback). More...
 
certDescriptor ocspTrustedResponderCerts [MAX_OCSP_TRUSTED_RESPONDERS]
 (field added after 5.3.1...)
 
ubyte4 sshMaxAuthAttempts
 Number of authentication tries allowed before the connection is said to have failed. More...
 
sbyte4 sshMaxConnections
 Maximum number of connections to this client. More...
 
ubyte4 sshTimeOutAuthentication
 Number of milliseconds the client waits for an authentication response before timing out. More...
 
ubyte4 sshTimeOutDefaultOpenState
 Number of milliseconds before timing out for the client to make a request (such as open a shell) after authentication. More...
 
ubyte4 sshTimeOutKeyExchange
 Number of milliseconds the client waits for a key exchange before timing out. More...
 
ubyte4 sshTimeOutNewKeys
 Number of milliseconds the client waits for new keys before timing out. More...
 
ubyte4 sshTimeOutOpen
 Number of milliseconds the client waits for an open session response before timing out. More...
 
ubyte4 sshTimeOutServiceRequest
 Number of milliseconds the client waits for a service request response before timing out. More...
 
ubyte4 trustedResponderCount
 (field added after 5.3.1...)
 

Detailed Description

This structure is used for NanoSSH Client configuration. Which products and features you've included (by defining the appropriate flags in moptions.h) determine which callback functions are present in this structure. Each included callback function should be customized for your application and then registered by assigning it to the appropriate structure function pointer(s).

Since
1.41
Version
3.06 and later

(ocsp trusted responder fields added...)

Whether the following flag is defined determines which callback functions are enabled:

  • __ENABLE_MOCANA_SSH_PORT_FORWARDING__

Field Documentation

◆ funcPtrBreakOp

MSTATUS(* sshClientSettings::funcPtrBreakOp) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrClosed

MSTATUS(* sshClientSettings::funcPtrClosed) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrDisconnectMsg

void(* sshClientSettings::funcPtrDisconnectMsg) (sbyte4 connectionInstance, ubyte4 reasonCode, ubyte *pMsg, ubyte4 msgLength, ubyte *pMsgLanguageTag)

This callback function is invoked when server sends a disconnection message.

Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.

Since
5.4
Version
5.4 and later

There are no flag dependencies to enable this callback.

Parameters
connectionInstanceConnection instance returned from SSHC_connect().
reasonCodeReason code for disconnection.
pMsgPointer to the disconnection message description.
msgLengthNumber of bytes in the message (pMsg).
pMsgLanguageTagPointer to the description string language tag.
Returns
None.

sshc.h

◆ funcPtrEof

MSTATUS(* sshClientSettings::funcPtrEof) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrOpenSftp

MSTATUS(* sshClientSettings::funcPtrOpenSftp) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrOpenShell

MSTATUS(* sshClientSettings::funcPtrOpenShell) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrPtyRequest

MSTATUS(* sshClientSettings::funcPtrPtyRequest) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrReceivedData

MSTATUS(* sshClientSettings::funcPtrReceivedData) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrSessionOpen

MSTATUS(* sshClientSettings::funcPtrSessionOpen) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrStdErr

MSTATUS(* sshClientSettings::funcPtrStdErr) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ funcPtrWindowChange

MSTATUS(* sshClientSettings::funcPtrWindowChange) (sbyte4 connectionInstance, enum sshcSessionTypes sessionEvent, ubyte *pMesg, ubyte4 mesgLen)

This protocol-specific upcall (callback) pointer's value is set to sshcProtocolUpcall, which should not be modified.

◆ sshMaxAuthAttempts

ubyte4 sshClientSettings::sshMaxAuthAttempts

Number of authentication tries allowed before the connection is said to have failed.

◆ sshMaxConnections

sbyte4 sshClientSettings::sshMaxConnections

Maximum number of connections to this client.

◆ sshTimeOutAuthentication

ubyte4 sshClientSettings::sshTimeOutAuthentication

Number of milliseconds the client waits for an authentication response before timing out.

◆ sshTimeOutDefaultOpenState

ubyte4 sshClientSettings::sshTimeOutDefaultOpenState

Number of milliseconds before timing out for the client to make a request (such as open a shell) after authentication.

◆ sshTimeOutKeyExchange

ubyte4 sshClientSettings::sshTimeOutKeyExchange

Number of milliseconds the client waits for a key exchange before timing out.

◆ sshTimeOutNewKeys

ubyte4 sshClientSettings::sshTimeOutNewKeys

Number of milliseconds the client waits for new keys before timing out.

◆ sshTimeOutOpen

ubyte4 sshClientSettings::sshTimeOutOpen

Number of milliseconds the client waits for an open session response before timing out.

◆ sshTimeOutServiceRequest

ubyte4 sshClientSettings::sshTimeOutServiceRequest

Number of milliseconds the client waits for a service request response before timing out.


The documentation for this struct was generated from the following file: