|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Data Structures | |
| struct | ssh_channel_event_channel_request |
| Data for SSH_CHANNEL_EVENT_REQUEST event. More... | |
| struct | ssh_channel_event_channel_request_result |
| Data for SSH_CHANNEL_EVENT_REQUEST_RESULT event. More... | |
| struct | ssh_channel_event |
| SSH channel event information. More... | |
| struct | ssh_transport_event_authenticate_result |
| Data for SSH_TRANSPORT_EVENT_AUTHENTICATE_RESULT event. More... | |
| struct | ssh_transport_event_channel_open |
| Data for SSH_TRANSPORT_EVENT_CHANNEL_OPEN event. More... | |
| struct | ssh_transport_event |
| SSH transport event information. More... | |
| struct | ssh_transport_conf |
| SSH transport callback configuration. More... | |
Macros | |
| #define | SSH_EXTENDED_DATA_STDERR 1 |
| Extended data type for standard error channel data. | |
Typedefs | |
| typedef int(* | ssh_channel_event_callback_t) (struct ssh_channel *channel, const struct ssh_channel_event *event, void *user_data) |
| SSH channel event callback. | |
| typedef int(* | ssh_transport_event_callback_t) (struct ssh_transport *transport, const struct ssh_transport_event *event, void *user_data) |
| SSH transport event callback. | |
| typedef void(* | ssh_service_client_cb_t) (struct ssh_client *ssh, int instance, void *user_data) |
| Callback used while iterating over SSH client connections. | |
| typedef void(* | ssh_service_server_cb_t) (struct ssh_server *sshd, int instance, void *user_data) |
| Callback used while iterating over SSH server connections. | |
Functions | |
| const char * | ssh_transport_client_user_name (struct ssh_transport *transport) |
| Get the authenticated client username for a transport. | |
| int | ssh_transport_auth_password (struct ssh_transport *transport, const char *user_name, const char *password) |
| Authenticate an SSH transport using a password. | |
| int | ssh_transport_channel_open (struct ssh_transport *transport, ssh_channel_event_callback_t callback, void *user_data) |
| Open a new channel on an SSH transport. | |
| int | ssh_channel_open_result (struct ssh_channel *channel, bool success, ssh_channel_event_callback_t callback, void *user_data) |
| Reply to a channel open request. | |
| int | ssh_channel_request_result (struct ssh_channel *channel, bool success) |
| Reply to a channel request. | |
| int | ssh_channel_request_shell (struct ssh_channel *channel) |
| Request an interactive shell on a channel. | |
| int | ssh_channel_read (struct ssh_channel *channel, void *data, uint32_t len) |
| Read channel data. | |
| int | ssh_channel_write (struct ssh_channel *channel, const void *data, uint32_t len) |
| Write channel data. | |
| int | ssh_channel_read_stderr (struct ssh_channel *channel, void *data, uint32_t len) |
| Read channel standard error data. | |
| int | ssh_channel_write_stderr (struct ssh_channel *channel, const void *data, uint32_t len) |
| Write channel standard error data. | |
| int | ssh_channel_close (struct ssh_channel *channel) |
| Close an SSH channel. | |
| void | ssh_client_foreach (ssh_service_client_cb_t cb, void *user_data) |
| Go through all SSH client connections. | |
| void | ssh_server_foreach (ssh_service_server_cb_t cb, void *user_data) |
| Go through all SSH server connections. | |
| int | ssh_transport_traverse_callbacks (bool is_server, struct ssh_transport *transport, const struct ssh_transport_event *event) |
| Call user configured callbacks for a given transport. | |
| #define SSH_EXTENDED_DATA_STDERR 1 |
#include <common.h>
Extended data type for standard error channel data.
| typedef int(* ssh_channel_event_callback_t) (struct ssh_channel *channel, const struct ssh_channel_event *event, void *user_data) |
#include <common.h>
SSH channel event callback.
| channel | Pointer to the SSH channel that produced the event. |
| event | Pointer to channel event data. |
| user_data | User-provided context pointer. |
| typedef void(* ssh_service_client_cb_t) (struct ssh_client *ssh, int instance, void *user_data) |
#include <common.h>
Callback used while iterating over SSH client connections.
| ssh | Pointer to the SSH client instance |
| instance | SSH client instance id |
| user_data | A valid pointer to user data or NULL |
| typedef void(* ssh_service_server_cb_t) (struct ssh_server *sshd, int instance, void *user_data) |
#include <common.h>
Callback used while iterating over SSH server connections.
| sshd | Pointer to the SSH server instance |
| instance | SSH server instance id |
| user_data | A valid pointer to user data or NULL |
| typedef int(* ssh_transport_event_callback_t) (struct ssh_transport *transport, const struct ssh_transport_event *event, void *user_data) |
#include <common.h>
SSH transport event callback.
| transport | Pointer to the SSH transport that produced the event. |
| event | Pointer to transport event data. |
| user_data | User-provided context pointer. |
| enum ssh_auth_type |
#include <common.h>
Authentication methods supported by SSH transports.
| Enumerator | |
|---|---|
| SSH_AUTH_NONE | No authentication method selected. |
| SSH_AUTH_PASSWORD | Username and password authentication. |
| SSH_AUTH_PUBKEY | Public key authentication. |
#include <common.h>
Types of events emitted for an SSH channel.
#include <common.h>
Types of SSH channel requests.
#include <common.h>
Types of events emitted for an SSH transport.
| int ssh_channel_close | ( | struct ssh_channel * | channel | ) |
#include <common.h>
Close an SSH channel.
Send a channel close message to the peer and release the channel. On success, the channel handle must no longer be used. The associated channel callback (if any) receives a SSH_CHANNEL_EVENT_CLOSED event.
| channel | Pointer to the SSH channel. |
| int ssh_channel_open_result | ( | struct ssh_channel * | channel, |
| bool | success, | ||
| ssh_channel_event_callback_t | callback, | ||
| void * | user_data ) |
#include <common.h>
Reply to a channel open request.
| channel | Pointer to the SSH channel. |
| success | True to accept the open request, false to reject it. |
| callback | Channel event callback to associate with the opened channel. |
| user_data | User-provided context pointer passed to callback. |
| int ssh_channel_read | ( | struct ssh_channel * | channel, |
| void * | data, | ||
| uint32_t | len ) |
#include <common.h>
Read channel data.
| channel | Pointer to the SSH channel. |
| data | Buffer to store the received data. |
| len | Maximum number of bytes to read. |
| int ssh_channel_read_stderr | ( | struct ssh_channel * | channel, |
| void * | data, | ||
| uint32_t | len ) |
#include <common.h>
Read channel standard error data.
| channel | Pointer to the SSH channel. |
| data | Buffer to store the received standard error data. |
| len | Maximum number of bytes to read. |
| int ssh_channel_request_result | ( | struct ssh_channel * | channel, |
| bool | success ) |
#include <common.h>
Reply to a channel request.
| channel | Pointer to the SSH channel. |
| success | True if the request succeeded, false otherwise. |
| int ssh_channel_request_shell | ( | struct ssh_channel * | channel | ) |
#include <common.h>
Request an interactive shell on a channel.
| channel | Pointer to the SSH channel. |
| int ssh_channel_write | ( | struct ssh_channel * | channel, |
| const void * | data, | ||
| uint32_t | len ) |
#include <common.h>
Write channel data.
| channel | Pointer to the SSH channel. |
| data | Buffer containing data to send. |
| len | Number of bytes to write. |
| int ssh_channel_write_stderr | ( | struct ssh_channel * | channel, |
| const void * | data, | ||
| uint32_t | len ) |
#include <common.h>
Write channel standard error data.
| channel | Pointer to the SSH channel. |
| data | Buffer containing standard error data to send. |
| len | Number of bytes to write. |
| void ssh_client_foreach | ( | ssh_service_client_cb_t | cb, |
| void * | user_data ) |
#include <common.h>
Go through all SSH client connections.
| cb | User-supplied callback function to call |
| user_data | User specified data |
| void ssh_server_foreach | ( | ssh_service_server_cb_t | cb, |
| void * | user_data ) |
#include <common.h>
Go through all SSH server connections.
| cb | User-supplied callback function to call |
| user_data | User specified data |
| int ssh_transport_auth_password | ( | struct ssh_transport * | transport, |
| const char * | user_name, | ||
| const char * | password ) |
#include <common.h>
Authenticate an SSH transport using a password.
| transport | Pointer to the SSH transport. |
| user_name | Username to authenticate with. |
| password | Password to authenticate with. |
| int ssh_transport_channel_open | ( | struct ssh_transport * | transport, |
| ssh_channel_event_callback_t | callback, | ||
| void * | user_data ) |
#include <common.h>
Open a new channel on an SSH transport.
| transport | Pointer to the SSH transport. |
| callback | Channel event callback for the new channel. |
| user_data | User-provided context pointer passed to callback. |
| const char * ssh_transport_client_user_name | ( | struct ssh_transport * | transport | ) |
#include <common.h>
Get the authenticated client username for a transport.
| transport | Pointer to the SSH transport. |
| int ssh_transport_traverse_callbacks | ( | bool | is_server, |
| struct ssh_transport * | transport, | ||
| const struct ssh_transport_event * | event ) |
#include <common.h>
Call user configured callbacks for a given transport.
This function is used to call user configured callbacks for a given transport. It is used by the SSH transport to notify the user of events such as authentication results, channel open requests, and channel data. The function will traverse the list of configured callbacks and call each one with the provided transport and event information. Note that the callbacks must not call the transport register or unregister API as that could lead to a deadlock.
| is_server | If set to true, then traverse configured server callbacks. If set to false, then traverse configured client callbacks. |
| transport | Transport to pass to user specified callback. |
| event | Event information to pass to user callback. |