ProtoCore v0.0.2
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
ssh_scp.h
Go to the documentation of this file.
1// Copyright (C) 2026 Douglas Quigg (dstroy0) <dquigg123@gmail.com>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4/**
5 * @file ssh_scp.h
6 * @brief SCP server - the fs::FS binding (PC_ENABLE_SSH_SCP).
7 *
8 * Binds the pure SCP/RCP codec (services/file_transfer/scp) to an SSH `exec "scp …"` channel + an Arduino fs::FS mount
9 * so a client can drop a file onto the device: `scp localfile admin@device:/path`. v1 serves the SINK direction (client
10 * -> device, `scp -t`); the SOURCE direction (`scp -f`, device -> client) is a follow-up - use SFTP `get` to download.
11 * Streamed writes, fixed buffers, no heap beyond the fs layer's file handle. Call pc_ssh_scp_begin() once after
12 * pc_ssh_conn_setup().
13 *
14 * @author Douglas Quigg (dstroy0)
15 * @date 2026
16 */
17
18#ifndef PROTOCORE_SSH_SCP_H
19#define PROTOCORE_SSH_SCP_H
20
21#include "protocore_config.h"
22
23#if PC_ENABLE_SSH_SCP
24
25#include <FS.h>
26
27/**
28 * @brief Serve SCP uploads from @p fs under @p root. Installs the channel exec-"scp" + data callbacks. Call
29 * once, after pc_ssh_conn_setup(). Coexists with pc_ssh_sftp_begin (they share the SSH channel layer).
30 */
31void pc_ssh_scp_begin(fs::FS &fs, const char *root);
32
33#endif // PC_ENABLE_SSH_SCP
34
35#endif // PROTOCORE_SSH_SCP_H
User-facing configuration for ProtoCore.