NAME
filecli - DTN file-based convergence layer input task
SYNOPSIS
filecli duct_name library_path input_file_path [poll_interval_ms]
DESCRIPTION
filecli is a background "daemon" task that reads bundles from a file using a dynamically loaded provider library. It supports store-and-forward and "sneakernet" scenarios where bundles are transported via file storage.
The task loads the provider library specified by library_path using dynamic linking (dlopen) and uses it to read framed bundles from the file specified by input_file_path.
duct_name is the name of the induct as configured in the BP database.
library_path is the full path to the provider shared library (e.g., /usr/local/lib/libfile_simple_provider.so).
input_file_path is the path to the file from which bundles will be read.
poll_interval_ms is an optional parameter specifying how often (in milliseconds) the receiver should check for new data when at end-of-file. The default is 1000 (1 second).
The provider library must implement the following functions:
- int init_file_receiver(const char *file_path, int poll_interval_ms)
- void finalize_file_receiver(void)
- size_t file_read_bundle(char *buffer)
filecli is spawned automatically by bpadmin in response to the 's' (START) command that starts operation of the Bundle Protocol; the text of the command that is used to spawn the task must be provided at the time the "file" convergence layer protocol is added to the BP database. The convergence layer input task is terminated by bpadmin in response to an 'x' (STOP) command.
EXIT STATUS
-
"0"
filecli terminated normally, for reasons noted in the ion.log file.
-
"1"
filecli terminated abnormally, for reasons noted in the ion.log file. Investigate and solve the problem identified in the log file, then use bpadmin to restart filecli.
FILES
No configuration files are needed. The provider library and input file must be accessible at the specified paths.
ENVIRONMENT
No environment variables apply.
DIAGNOSTICS
The following diagnostics may be issued to the ion.log log file:
-
filecli can't attach to BP.
bpadmin has not yet initialized Bundle Protocol operations.
-
No such file duct.
No file induct matching duct_name has been added to the BP database. Use bpadmin to stop the file convergence-layer protocol, add the induct, and then restart the file protocol.
-
Failed to load provider library.
The specified shared library could not be loaded. Check that the library exists and has correct permissions.
-
Failed to find required function in provider library.
The provider library does not export all required functions. Ensure the library implements init_file_receiver, finalize_file_receiver, and file_read_bundle.
EXAMPLES
Example bprc configuration:
a protocol file 65536 12
a induct file loopback 'filecli loopback /path/to/libfile_simple_provider.so /tmp/bundles.dat 500'
BUGS
Report bugs to <https://github.com/nasa-jpl/ION-DTN/issues>
SEE ALSO
bpadmin(1), fileclo(1), bprc(5)