|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Data Structures | |
| struct | ssh_server_event_client_connected |
| Client connection transport data. More... | |
| struct | ssh_server_event_client_disconnected |
| Client disconnection transport data. More... | |
| struct | ssh_server_event |
| SSH server event. More... | |
Typedefs | |
| typedef int(* | ssh_server_event_callback_t) (struct ssh_server *sshd, const struct ssh_server_event *event, void *user_data) |
| Callback function type for SSH server events. | |
Enumerations | |
| enum | ssh_server_event_type { SSH_SERVER_EVENT_CLOSED , SSH_SERVER_EVENT_CLIENT_CONNECTED , SSH_SERVER_EVENT_CLIENT_DISCONNECTED } |
| Server event types. More... | |
Functions | |
| int | ssh_server_start (struct ssh_server *sshd, const struct net_sockaddr *bind_addr, int host_key_index, const char *username, const char *password, const int *authorized_keys, size_t authorized_keys_len, ssh_server_event_callback_t server_callback, ssh_transport_event_callback_t transport_callback, void *user_data) |
| Start an SSH server. | |
| int | ssh_server_stop (struct ssh_server *sshd) |
| Stop an SSH server. | |
| int | ssh_server_transport_close (struct ssh_server *sshd, int idx) |
| Close an SSH server transport connection. | |
| typedef int(* ssh_server_event_callback_t) (struct ssh_server *sshd, const struct ssh_server_event *event, void *user_data) |
#include <zephyr/net/ssh/server.h>
Callback function type for SSH server events.
This callback is invoked by the SSH server to notify the application of various events related to client connections and disconnections. The callback receives a pointer to the SSH server instance, an event structure containing details about the event, and user data provided during server initialization.
| sshd | Pointer to the SSH server instance that is invoking the callback. |
| event | Pointer to a structure containing details about the event that occurred. |
| user_data | Pointer to user-defined data that was provided when the server was started, |
#include <zephyr/net/ssh/server.h>
Server event types.
| int ssh_server_start | ( | struct ssh_server * | sshd, |
| const struct net_sockaddr * | bind_addr, | ||
| int | host_key_index, | ||
| const char * | username, | ||
| const char * | password, | ||
| const int * | authorized_keys, | ||
| size_t | authorized_keys_len, | ||
| ssh_server_event_callback_t | server_callback, | ||
| ssh_transport_event_callback_t | transport_callback, | ||
| void * | user_data ) |
#include <zephyr/net/ssh/server.h>
Start an SSH server.
| sshd | Pointer to the SSH server instance to start. |
| bind_addr | Network address to bind the SSH server to. |
| host_key_index | Index of the host key to use for the SSH server. |
| username | Username for SSH authentication. Set to NULL or empty string to allow any username to be used for incoming connections. |
| password | Password for SSH authentication. Set to NULL or empty string to disable password authentication. |
| authorized_keys | Array of indices for authorized public keys. Set to NULL to disable public key authentication. |
| authorized_keys_len | Length of the authorized_keys array. |
| server_callback | Callback function to handle SSH server events. |
| transport_callback | Callback function to handle SSH transport events. |
| user_data | Pointer to user-defined data that will be passed to the callback functions. |
| int ssh_server_stop | ( | struct ssh_server * | sshd | ) |
#include <zephyr/net/ssh/server.h>
Stop an SSH server.
| sshd | Pointer to the SSH server instance to stop. |
| int ssh_server_transport_close | ( | struct ssh_server * | sshd, |
| int | idx ) |
#include <zephyr/net/ssh/server.h>
Close an SSH server transport connection.
| sshd | Pointer to the SSH server instance. |
| idx | Index of the transport connection to close. |