|
K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
|
Data Structures | |
| struct | kfsw_ftp_entry |
| struct | kfsw_ftp_stat |
| struct | kfsw_ftp_transfer_result |
| struct | kfsw_ftp_stats |
Macros | |
| #define | KFSW_FTP_MAX_PATH_SIZE 96U |
| #define | KFSW_FTP_CHUNK_SIZE 192U |
| #define | KFSW_FTP_STORAGE_ROOT "/kfsw/ftp" |
| #define | KFSW_FTP_READONLY_ROOT "/kfsw/hk" |
| #define | KFSW_FTP_TIMEOUT_MIN_MS 1000U |
| #define | KFSW_FTP_TIMEOUT_MAX_MS 120000U |
| #define | KFSW_FTP_PARAM_TABLE_ID 29U |
| #define | KFSW_FTP_PARAM_TABLE_NAME "ftp" |
Types | |
| typedef bool(* | kfsw_ftp_list_visitor_t) (const struct kfsw_ftp_entry *entry, void *context) |
Enumerations | |
| enum | kfsw_ftp_entry_type { KFSW_FTP_ENTRY_FILE = 1 , KFSW_FTP_ENTRY_DIRECTORY = 2 } |
| enum | kfsw_event_ftp_id { KFSW_EVENT_FTP_PUT_DONE = 1 , KFSW_EVENT_FTP_GET_DONE = 2 , KFSW_EVENT_FTP_TRANSFER_FAILED = 3 } |
Functions | |
| int | kfsw_ftp_get_stats (struct kfsw_ftp_stats *stats) |
| uint32_t | kfsw_ftp_get_timeout_ms (void) |
| int | kfsw_ftp_set_timeout_ms (uint32_t timeout_ms) |
| int | kfsw_ftp_check_timeout_ms (uint32_t timeout_ms) |
| uint16_t | kfsw_ftp_get_chunk_size (void) |
| int | kfsw_ftp_set_chunk_size (uint16_t chunk_size) |
| int | kfsw_ftp_check_chunk_size (uint16_t chunk_size) |
| int | kfsw_ftp_init (void) |
| int | kfsw_ftp_start (void) |
| int | kfsw_ftp_stop (void) |
| bool | kfsw_ftp_is_started (void) |
| int | kfsw_ftp_validate_path (const char *path, bool allow_root) |
| int | kfsw_ftp_list (uint16_t node, const char *path, kfsw_ftp_list_visitor_t visitor, void *context) |
| int | kfsw_ftp_stat (uint16_t node, const char *path, struct kfsw_ftp_stat *info) |
| int | kfsw_ftp_mkdir (uint16_t node, const char *path) |
| int | kfsw_ftp_put (uint16_t node, const char *local_path, const char *remote_path, struct kfsw_ftp_transfer_result *result) |
| int | kfsw_ftp_get (uint16_t node, const char *remote_path, const char *local_path, struct kfsw_ftp_transfer_result *result) |
Variables | |
| const struct kfsw_param_definition_set | kfsw_ftp_param_definitions |
Sandboxed CSP/RDP file-transfer API.
| #define KFSW_FTP_PARAM_TABLE_ID 29U |
Parameter table of this service, in the service band.
| #define KFSW_FTP_PARAM_TABLE_NAME "ftp" |
Parameter table name.
| #define KFSW_FTP_READONLY_ROOT "/kfsw/hk" |
A second, read-only root with the housekeeping files.
Writes, renames, deletes and mkdir under it are refused.
| enum kfsw_event_ftp_id |
Event IDs of the file transfer service.
IDs are never reused. Transfer payload: peer node as big-endian u16, then the byte count and CRC32 as big-endian u32.
| int kfsw_ftp_check_chunk_size | ( | uint16_t | chunk_size | ) |
Whether a chunk size would be accepted, without applying it.
| int kfsw_ftp_check_timeout_ms | ( | uint32_t | timeout_ms | ) |
Whether a timeout would be accepted, without applying it.
| int kfsw_ftp_get | ( | uint16_t | node, |
| const char * | remote_path, | ||
| const char * | local_path, | ||
| struct kfsw_ftp_transfer_result * | result | ||
| ) |
Stream a remote FTP-root file to a local FTP-root path.
Transfers are between two nodes; this node's own CSP address returns -ENOTSUP.
| uint16_t kfsw_ftp_get_chunk_size | ( | void | ) |
Bytes of file data carried per message.
| int kfsw_ftp_get_stats | ( | struct kfsw_ftp_stats * | stats | ) |
Read the lifetime totals.
Returns -EINVAL for a NULL destination.
| uint32_t kfsw_ftp_get_timeout_ms | ( | void | ) |
Reply timeout used by the next transfer; a running one keeps its value.
| int kfsw_ftp_init | ( | void | ) |
Prepare the sandboxed local file-transfer root after storage is mounted.
| bool kfsw_ftp_is_started | ( | void | ) |
Return whether the local service is initialized and accepting connections.
| int kfsw_ftp_list | ( | uint16_t | node, |
| const char * | path, | ||
| kfsw_ftp_list_visitor_t | visitor, | ||
| void * | context | ||
| ) |
List one directory.
Paths are relative to the FTP root.
A request addressed to this node's own CSP address is served directly from local storage, without a connection or a route.
| int kfsw_ftp_mkdir | ( | uint16_t | node, |
| const char * | path | ||
| ) |
Create one directory.
Parent directories must already exist.
A request addressed to this node's own CSP address is served locally.
| int kfsw_ftp_put | ( | uint16_t | node, |
| const char * | local_path, | ||
| const char * | remote_path, | ||
| struct kfsw_ftp_transfer_result * | result | ||
| ) |
Stream a local FTP-root file to a remote FTP-root path.
Transfers are between two nodes; this node's own CSP address returns -ENOTSUP.
| int kfsw_ftp_set_chunk_size | ( | uint16_t | chunk_size | ) |
Change how much file data each message carries.
Must fit the build-time buffer. Smaller chunks may help on lossy links.
| 0 | Applied to the next transfer. |
| -ERANGE | Zero, or larger than KFSW_FTP_CHUNK_SIZE. |
| int kfsw_ftp_set_timeout_ms | ( | uint32_t | timeout_ms | ) |
Change the reply timeout used by new transfers.
| 0 | Applied to the next transfer. |
| -ERANGE | Outside the range the composition could have been built with. |
| int kfsw_ftp_start | ( | void | ) |
Bind the RDP/CRC32 CSP endpoint and start the static server threads.
| int kfsw_ftp_stat | ( | uint16_t | node, |
| const char * | path, | ||
| struct kfsw_ftp_stat * | info | ||
| ) |
Return file/directory metadata and a file CRC32.
A request addressed to this node's own CSP address is served locally.
| int kfsw_ftp_stop | ( | void | ) |
Stop accepting new transfers and close the server endpoint.
| int kfsw_ftp_validate_path | ( | const char * | path, |
| bool | allow_root | ||
| ) |
Validate a virtual path using the same rules as the client and server.
|
extern |
File-transfer counters and settings.