Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
common.h File Reference

SSH client/server common API. More...

#include <zephyr/kernel.h>

Go to the source code of this file.

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...

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.

Enumerations

enum  ssh_auth_type { SSH_AUTH_NONE , SSH_AUTH_PASSWORD , SSH_AUTH_PUBKEY }
 Authentication methods supported by SSH transports. More...
enum  ssh_channel_request_type {
  SSH_CHANNEL_REQUEST_UNKNOWN , SSH_CHANNEL_REQUEST_PSEUDO_TERMINAL , SSH_CHANNEL_REQUEST_X11_FORWARD , SSH_CHANNEL_REQUEST_ENV_VAR ,
  SSH_CHANNEL_REQUEST_SHELL , SSH_CHANNEL_REQUEST_EXEC , SSH_CHANNEL_REQUEST_SUBSYSTEM , SSH_CHANNEL_REQUEST_WINDOW_CHANGE ,
  SSH_CHANNEL_REQUEST_FLOW_CONTROL , SSH_CHANNEL_REQUEST_SIGNAL , SSH_CHANNEL_REQUEST_EXIT_STATUS , SSH_CHANNEL_REQUEST_EXIT_SIGNAL
}
 Types of SSH channel requests. More...
enum  ssh_channel_event_type {
  SSH_CHANNEL_EVENT_OPEN_RESULT , SSH_CHANNEL_EVENT_REQUEST , SSH_CHANNEL_EVENT_REQUEST_RESULT , SSH_CHANNEL_EVENT_RX_DATA_READY ,
  SSH_CHANNEL_EVENT_TX_DATA_READY , SSH_CHANNEL_EVENT_RX_STDERR_DATA_READY , SSH_CHANNEL_EVENT_EOF , SSH_CHANNEL_EVENT_CLOSED
}
 Types of events emitted for an SSH channel. More...
enum  ssh_transport_event_type { SSH_TRANSPORT_EVENT_CLOSED , SSH_TRANSPORT_EVENT_SERVICE_ACCEPTED , SSH_TRANSPORT_EVENT_AUTHENTICATE_RESULT , SSH_TRANSPORT_EVENT_CHANNEL_OPEN }
 Types of events emitted for an SSH transport. More...

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.
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.

Detailed Description

SSH client/server common API.