![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
MOC_EXTERN sbyte4 | SSH_acceptConnection (TCP_SOCKET socket) |
Register an SSH client-server connection and get its connection instance. More... | |
MOC_EXTERN sbyte4 | SSH_closeConnection (sbyte4 connectionInstance) |
Close an NanoSSH server session and releases its resources. More... | |
MOC_EXTERN sbyte4 | SSH_init (sbyte4 sshMaxConnections) |
Initialize NanoSSH server internal structures. More... | |
MOC_EXTERN sbyte4 | SSH_negotiateConnection (sbyte4 connectionInstance) |
Exchange keys and establishe a secure SSHv2 client-server connection. More... | |
MOC_EXTERN sbyte4 | SSH_sendPing (sbyte4 connectionInstance) |
Determine which connections are alive by pinging each open connection. More... | |
MOC_EXTERN sbyte4 SSH_acceptConnection | ( | TCP_SOCKET | socket | ) |
This function registers a connection between SSH server and client and returns the session's connection instance.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
tempSocket | Socket or TCB identifier returned by a call to accept() . |
DISPLAY_ERROR
macro.MOC_EXTERN sbyte4 SSH_closeConnection | ( | sbyte4 | connectionInstance | ) |
This function closes an NanoSSH server session and releases all its resources.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
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 SSH_init | ( | sbyte4 | sshMaxConnections | ) |
This function initializes NanoSSH server internal structures. Your application should call this function before starting the HTTPS and application servers.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
sshMaxConnections | Maximum number of SSH server connections to allow. (Each connection requires only a few bytes of memory.) |
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 SSH_negotiateConnection | ( | sbyte4 | connectionInstance | ) |
This function exchanges keys and establishes a secure SSHv2 client-server connection.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
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 SSH_sendPing | ( | sbyte4 | connectionInstance | ) |
This function determines which connections are alive by pinging (sending an message with no data) each open connection.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_PING__
Additionally, the following flag must not be defined:
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection(). |
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.