Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_ssh.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Grant Ramsay <grant.ramsay@hotmail.com>
3 * Copyright (c) 2026 Nordic Semiconductor ASA
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
13
14#ifndef ZEPHYR_INCLUDE_SHELL_SSH_H_
15#define ZEPHYR_INCLUDE_SHELL_SSH_H_
16
17#include <zephyr/net/socket.h>
19#include <zephyr/shell/shell.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
26#define SHELL_SSH_MAX_PASSWORD_LEN 32
27
29
30struct ssh_channel;
31struct shell_ssh;
32
34
42
51 const struct shell *sh;
53 struct shell_ssh *ssh;
55 struct ssh_channel *channel;
57 struct ssh_transport *transport;
63 bool in_use;
64};
65
67extern const struct shell_transport_api shell_ssh_transport_api;
69
71#define SHELL_SSH_GET_NAME(_name) _name##_shell_ssh
72
83#define SHELL_SSH_DEFINE(_name) \
84 static struct shell_ssh SHELL_SSH_GET_NAME(_name); \
85 static struct shell_transport _name = { \
86 .api = &shell_ssh_transport_api, \
87 .ctx = &_name##_shell_ssh, \
88 }
89
103
105
106#if defined(CONFIG_SSH_SERVER)
107int shell_sshd_event_callback(struct ssh_server *ssh_server,
108 const struct ssh_server_event *event,
109 void *user_data);
110int shell_sshd_transport_event_callback(struct ssh_transport *transport,
111 const struct ssh_transport_event *event,
112 void *user_data);
113#endif /* CONFIG_SSH_SERVER */
114
116
117#ifdef __cplusplus
118}
119#endif
120
121#endif /* ZEPHYR_INCLUDE_SHELL_SSH_H_ */
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition shell.h:806
BSD Sockets compatible API definitions.
#define SHELL_SSH_MAX_PASSWORD_LEN
Maximum password length supported by the shell SSH transport.
Definition shell_ssh.h:26
SSH server API.
SSH transport user data.
Definition shell_ssh.h:49
int ssh_instance
Instance of the SSH connection (could be client or server).
Definition shell_ssh.h:61
struct shell_ssh * ssh
Shell SSH transport API.
Definition shell_ssh.h:53
bool in_use
Is this context in use (server-side pool tracking).
Definition shell_ssh.h:63
struct ssh_transport * transport
SSH transport associated with this user data.
Definition shell_ssh.h:57
struct ssh_channel * channel
SSH channel associated with this transport.
Definition shell_ssh.h:55
const struct shell * sh
Shell instance associated with this transport.
Definition shell_ssh.h:51
struct shell_ssh_passwd password
SSH server password storage.
Definition shell_ssh.h:59
SSH password storage.
Definition shell_ssh.h:36
size_t len
Length of the password stored in the buffer.
Definition shell_ssh.h:40
char buf[32+1]
Buffer to hold the password.
Definition shell_ssh.h:38
SSH transport API.
Definition shell_ssh.h:93
void * context
Transport context.
Definition shell_ssh.h:99
struct ssh_channel * ssh_channel
SSH channel.
Definition shell_ssh.h:97
shell_transport_handler_t handler
Transport handler.
Definition shell_ssh.h:95
bool in_use
Is this transport in use.
Definition shell_ssh.h:101
Unified shell transport interface.
Definition shell.h:829
Shell instance internals.
Definition shell.h:1076
SSH server event.
Definition server.h:64