7#ifndef ZEPHYR_INCLUDE_NET_SSH_COMMON_H_
8#define ZEPHYR_INCLUDE_NET_SSH_COMMON_H_
206#define SSH_EXTENDED_DATA_STDERR 1
208#if defined(CONFIG_SSH_CLIENT) || defined(__DOXYGEN__)
228 const char *password);
244#if defined(CONFIG_SSH_SERVER) || defined(__DOXYGEN__)
270#if defined(CONFIG_SSH_CLIENT) || defined(__DOXYGEN__)
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:42
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_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_event_callback_t)(struct ssh_channel *channel, const struct ssh_channel_event *event, void *user_data)
SSH channel event callback.
Definition common.h:135
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.
int ssh_channel_request_shell(struct ssh_channel *channel)
Request an interactive shell on a channel.
ssh_transport_event_type
Types of events emitted for an SSH transport.
Definition common.h:140
int ssh_channel_request_result(struct ssh_channel *channel, bool success)
Reply to a channel request.
int ssh_channel_read_stderr(struct ssh_channel *channel, void *data, uint32_t len)
Read channel standard error data.
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.
const char * ssh_transport_client_user_name(struct ssh_transport *transport)
Get the authenticated client username for a transport.
ssh_auth_type
Authentication methods supported by SSH transports.
Definition common.h:39
int ssh_channel_close(struct ssh_channel *channel)
Close an SSH channel.
int ssh_channel_write_stderr(struct ssh_channel *channel, const void *data, uint32_t len)
Write channel standard error data.
ssh_channel_request_type
Types of SSH channel requests.
Definition common.h:49
void(* ssh_service_client_cb_t)(struct ssh_client *ssh, int instance, void *user_data)
Callback used while iterating over SSH client connections.
Definition common.h:347
int ssh_transport_auth_password(struct ssh_transport *transport, const char *user_name, const char *password)
Authenticate an SSH transport using a password.
ssh_channel_event_type
Types of events emitted for an SSH channel.
Definition common.h:77
int(* ssh_transport_event_callback_t)(struct ssh_transport *transport, const struct ssh_transport_event *event, void *user_data)
SSH transport event callback.
Definition common.h:187
void(* ssh_service_server_cb_t)(struct ssh_server *sshd, int instance, void *user_data)
Callback used while iterating over SSH server connections.
Definition common.h:367
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.
@ SSH_TRANSPORT_EVENT_AUTHENTICATE_RESULT
Authentication attempt result.
Definition common.h:146
@ SSH_TRANSPORT_EVENT_SERVICE_ACCEPTED
Requested SSH service was accepted by the peer.
Definition common.h:144
@ SSH_TRANSPORT_EVENT_CLOSED
Transport has been closed.
Definition common.h:142
@ SSH_TRANSPORT_EVENT_CHANNEL_OPEN
Server received a request to open a channel.
Definition common.h:148
@ SSH_AUTH_NONE
No authentication method selected.
Definition common.h:41
@ SSH_AUTH_PASSWORD
Username and password authentication.
Definition common.h:43
@ SSH_AUTH_PUBKEY
Public key authentication.
Definition common.h:45
@ SSH_CHANNEL_REQUEST_UNKNOWN
Unknown or unsupported channel request type.
Definition common.h:51
@ SSH_CHANNEL_REQUEST_FLOW_CONTROL
Request flow control.
Definition common.h:67
@ SSH_CHANNEL_REQUEST_PSEUDO_TERMINAL
Request a pseudo-terminal.
Definition common.h:53
@ SSH_CHANNEL_REQUEST_EXIT_STATUS
Report process exit status.
Definition common.h:71
@ SSH_CHANNEL_REQUEST_X11_FORWARD
Request X11 forwarding.
Definition common.h:55
@ SSH_CHANNEL_REQUEST_SUBSYSTEM
Start a subsystem.
Definition common.h:63
@ SSH_CHANNEL_REQUEST_EXEC
Execute a command.
Definition common.h:61
@ SSH_CHANNEL_REQUEST_EXIT_SIGNAL
Report process exit signal.
Definition common.h:73
@ SSH_CHANNEL_REQUEST_SHELL
Start an interactive shell.
Definition common.h:59
@ SSH_CHANNEL_REQUEST_SIGNAL
Send a signal to the remote process.
Definition common.h:69
@ SSH_CHANNEL_REQUEST_ENV_VAR
Set an environment variable.
Definition common.h:57
@ SSH_CHANNEL_REQUEST_WINDOW_CHANGE
Notify of terminal window size changes.
Definition common.h:65
@ SSH_CHANNEL_EVENT_RX_STDERR_DATA_READY
Standard error data is available to read.
Definition common.h:89
@ SSH_CHANNEL_EVENT_REQUEST_RESULT
Result of a previously sent channel request on the client side.
Definition common.h:83
@ SSH_CHANNEL_EVENT_OPEN_RESULT
Result of an open request on the client side.
Definition common.h:79
@ SSH_CHANNEL_EVENT_REQUEST
Incoming channel request on the server side.
Definition common.h:81
@ SSH_CHANNEL_EVENT_RX_DATA_READY
Channel data is available to read.
Definition common.h:85
@ SSH_CHANNEL_EVENT_EOF
End-of-file received for the channel.
Definition common.h:91
@ SSH_CHANNEL_EVENT_CLOSED
Channel has been closed.
Definition common.h:93
@ SSH_CHANNEL_EVENT_TX_DATA_READY
Channel can accept more transmit data.
Definition common.h:87
Header file for the single-linked list API.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Data for SSH_CHANNEL_EVENT_REQUEST_RESULT event.
Definition common.h:106
bool success
True if the request succeeded.
Definition common.h:108
Data for SSH_CHANNEL_EVENT_REQUEST event.
Definition common.h:97
bool want_reply
True if the peer expects a reply.
Definition common.h:101
enum ssh_channel_request_type type
Requested channel operation.
Definition common.h:99
SSH channel event information.
Definition common.h:112
enum ssh_channel_event_type type
Types of events emitted for an SSH channel.
Definition common.h:114
struct ssh_channel_event_channel_request_result channel_request_result
Data for SSH_CHANNEL_EVENT_REQUEST_RESULT.
Definition common.h:122
struct ssh_channel_event_channel_request channel_request
Data for SSH_CHANNEL_EVENT_REQUEST.
Definition common.h:119
SSH transport callback configuration.
Definition common.h:192
void * user_data
User data to be passed to the callback function.
Definition common.h:202
ssh_transport_event_callback_t cb
Callback function to be called by the server to retrieve the transport for a client connection.
Definition common.h:199
sys_snode_t node
List node.
Definition common.h:194
Data for SSH_TRANSPORT_EVENT_AUTHENTICATE_RESULT event.
Definition common.h:152
bool success
True if authentication succeeded.
Definition common.h:154
Data for SSH_TRANSPORT_EVENT_CHANNEL_OPEN event.
Definition common.h:158
struct ssh_channel * channel
Newly opened channel.
Definition common.h:160
SSH transport event information.
Definition common.h:164
struct ssh_transport_event_channel_open channel_open
Data for SSH_TRANSPORT_EVENT_CHANNEL_OPEN.
Definition common.h:174
struct ssh_transport_event_authenticate_result authenticate_result
Data for SSH_TRANSPORT_EVENT_AUTHENTICATE_RESULT.
Definition common.h:171
enum ssh_transport_event_type type
Types of events emitted for an SSH transport.
Definition common.h:166