DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
ssh_server.cpp File Reference

SSH message dispatcher implementation. More...

Go to the source code of this file.

Classes

struct  SshServerCtx
 

Functions

void ssh_server_set_emit_cb (SshEmitCb cb)
 Install the outbound-message callback.
 
int ssh_server_dispatch (uint8_t i, uint8_t msg_type, const uint8_t *payload, size_t len)
 Dispatch one decrypted inbound SSH message for slot i.
 

Detailed Description

SSH message dispatcher implementation.

Definition in file ssh_server.cpp.

Function Documentation

◆ ssh_server_set_emit_cb()

void ssh_server_set_emit_cb ( SshEmitCb  cb)

Install the outbound-message callback.

Definition at line 28 of file ssh_server.cpp.

References SshServerCtx::emit_cb.

Referenced by ssh_conn_setup().

◆ ssh_server_dispatch()

int ssh_server_dispatch ( uint8_t  i,
uint8_t  msg_type,
const uint8_t *  payload,
size_t  len 
)

Dispatch one decrypted inbound SSH message for slot i.

Routes by message type and handshake phase, driving the handshake and, once open, the channel protocol. Responses are produced via the emit callback.

Parameters
[in]iSSH slot.
[in]msg_typeFirst payload byte (SSH message number).
[in]payloadFull message payload (including msg_type at [0]).
[in]lenPayload length.
Returns
0 if handled, -1 if the connection must be closed.

Definition at line 65 of file ssh_server.cpp.

References SshSession::auth_failures, SshSession::authed, SshSession::ext_info_c, MAX_SSH_CONNS, SshSession::phase, SshPacketState::seq_no_recv, ssh_auth_handle_request(), ssh_auth_handle_service_request(), ssh_channel_handle_close(), ssh_channel_handle_data(), ssh_channel_handle_open(), ssh_channel_handle_open_confirm(), ssh_channel_handle_open_failure(), ssh_channel_handle_request(), ssh_channel_handle_window_adjust(), ssh_extinfo_build(), ssh_global_request_handle(), ssh_kex_generate(), ssh_kexdh_handle(), ssh_kexinit_build(), ssh_kexinit_parse(), SSH_MAX_AUTH_ATTEMPTS, SSH_MSG_CHANNEL_CLOSE, SSH_MSG_CHANNEL_DATA, SSH_MSG_CHANNEL_EOF, SSH_MSG_CHANNEL_OPEN, SSH_MSG_CHANNEL_OPEN_CONFIRM, SSH_MSG_CHANNEL_OPEN_FAILURE, SSH_MSG_CHANNEL_REQUEST, SSH_MSG_CHANNEL_WINDOW_ADJUST, SSH_MSG_DISCONNECT, SSH_MSG_EXT_INFO, SSH_MSG_GLOBAL_REQUEST, SSH_MSG_IGNORE, SSH_MSG_KEXDH_INIT, SSH_MSG_KEXINIT, SSH_MSG_NEWKEYS, SSH_MSG_SERVICE_REQUEST, SSH_MSG_UNIMPLEMENTED, SSH_MSG_USERAUTH_FAILURE, SSH_MSG_USERAUTH_REQUEST, SSH_MSG_USERAUTH_SUCCESS, ssh_newkeys_complete(), ssh_newkeys_sent(), SSH_PHASE_AUTH, SSH_PHASE_DH_INIT, SSH_PHASE_SERVICE, ssh_pkt, SSH_PKT_BUF_SIZE, and ssh_sess.