Skip to content

NAME

fileclo - DTN file-based convergence layer output task

SYNOPSIS

fileclo duct_name library_path output_file_path

DESCRIPTION

fileclo is a background "daemon" task that writes bundles to 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 write framed bundles to the file specified by output_file_path.

duct_name is the name of the outduct 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).

output_file_path is the path to the file where bundles will be written.

The provider library must implement the following functions:

  • int init_file_sender(const char *file_path)
  • void finalize_file_sender(void)
  • int file_write_bundle(unsigned char *data, size_t length)

fileclo 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 output task is terminated by bpadmin in response to an 'x' (STOP) command.

EXIT STATUS

  • "0"

    fileclo terminated normally, for reasons noted in the ion.log file.

  • "1"

    fileclo 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 fileclo.

FILES

No configuration files are needed. The provider library must be accessible at the specified path. The output file will be created if it does not exist.

ENVIRONMENT

No environment variables apply.

DIAGNOSTICS

The following diagnostics may be issued to the ion.log log file:

  • fileclo can't attach to BP.

    bpadmin has not yet initialized Bundle Protocol operations.

  • No such file duct.

    No file outduct matching duct_name has been added to the BP database. Use bpadmin to stop the file convergence-layer protocol, add the outduct, 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_sender, finalize_file_sender, and file_write_bundle.

EXAMPLES

Example bprc configuration:

a protocol file 65536 12
a outduct file loopback 'fileclo loopback /path/to/libfile_simple_provider.so /tmp/bundles.dat'

BUGS

Report bugs to <https://github.com/nasa-jpl/ION-DTN/issues>

SEE ALSO

bpadmin(1), filecli(1), bprc(5)