|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
SCP server - the rcp SINK state machine over an SSH exec channel (PROTOCORE_ENABLE_SSH_SCP). More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | SshScpNs |
| Dispatch table. Addressed by offset, so the layout is asserted below. More... | |
Functions | |
| PROTOCORE_NS_LAYOUT (SshScpNs, begin) | |
| void | protocore_ssh_scp_begin (uint8_t *work) |
| Serve SCP uploads onto the mounted filesystem. Installs the channel . | |
| uint8_t * | protocore_ssh_scp_span (void) |
| The PROTOCORE_SSH_SCP_BORROW bytes this module's state lives in. | |
Variables | |
| PROTOCORE_NS SshScpNs SshScp | PROTOCORE_UNUSED = {.begin = protocore_ssh_scp_begin} |
| Module namespace. | |
SCP server - the rcp SINK state machine over an SSH exec channel (PROTOCORE_ENABLE_SSH_SCP).
Drives the SCP/RCP codec (network_drivers/session/scp) over an SSH exec "scp …" channel so a client can drop a file onto the device: scp localfile admin@device:/path. v1 serves the SINK direction (client -> device, scp -t); the SOURCE direction (scp -f, device -> client) is a follow-up - use SFTP get to download.
Storage is reached through the filesystem accessor (server/storage/filesystem.h), so this file names no vendor type and holds no mount, no root, and no path buffer. Mount the backend and set the root once with protocore_mnt_mount() + protocore_fs_begin(); every server over that storage then answers from the same root by construction rather than by each being told the same string.
Streamed writes, fixed buffers, no heap. Call protocore_ssh_scp_begin() once after protocore_ssh_conn_setup().
work is PROTOCORE_SSH_SCP_BORROW bytes the CALLER took, at an address it knows. It is not held past the call, so nothing here aliases it. How those bytes are carved is this module's and is never named here.
Definition in file ssh_scp.h.
| PROTOCORE_NS_LAYOUT | ( | SshScpNs | , |
| begin | |||
| ) |
| void protocore_ssh_scp_begin | ( | uint8_t * | work | ) |
Serve SCP uploads onto the mounted filesystem. Installs the channel .
| work | PROTOCORE_SSH_SCP_BORROW bytes the caller took. Not held past the call. |
| uint8_t * protocore_ssh_scp_span | ( | void | ) |
The PROTOCORE_SSH_SCP_BORROW bytes this module's state lives in.
Stated beside the namespace rather than on it: an entry takes a borrow, and this is where that borrow comes from. Taken once from the end of the pool, which no mark and no release walks, so the state lasts the life of the program.
| PROTOCORE_NS SshScpNs SshScp PROTOCORE_UNUSED = {.begin = protocore_ssh_scp_begin} |