vfs_relay example

This example demonstrates how to use the VFS relay mechanism to separate data streams among multiple VFS system programs.

The rules for selecting various VFS programs for performing file operations are implemented in the RelayVfsServer program code as follows:

Example directory in the SDK

The code of the example and build scripts are available at the following path:

/opt/KasperskyOS-Community-Edition-<platform>-<version>/examples/vfs_relay

List of programs

Initialization description

The solution initialization description file named init.yaml is generated during the solution build process based on the ./einit/src/init.yaml.in template. Macros in @INIT_*@‌ ‌format contained in the template are automatically expanded in the resulting init.yaml file. For more details, refer to init.yaml.in template.

Security policy description

The security.psl file contains a description of a security policy for a KasperskyOS-based solution and is located in the ./einit/src directory. The declarations in the PSL file are provided with comments that explain the purpose of these declarations.

The solution security policy description in this example allows any interaction between different processes and between processes and the kernel. This policy can be used only as a stub during the early stages of a solution development so that the security module does not interfere with interactions. It would be unacceptable to apply such a policy in a real-world KasperskyOS-based solution.

Resources

The directory ./resources/xdl/relay_vfs contains EDL descriptions for the Client, RelayVfsServer, and VfsServer. programs.

Operating scenario

The Client program performs the following actions:

  1. Creates two directories: /local_vfs_dir and /remote_vfs_dir.
  2. Conducts tests that create, read, and write files in each of the created directories.

    In this case, operations with files in the /local_vfs_dir directory are performed locally by the RelayVfsServer program, and operations with files in the /remote_vfs_dir directory are redirected to the VfsServer program via IPC.

Building and running the example

The CMake system, which is included with KasperskyOS Community Edition, is used to build and run the example.

See Building and running examples section.

Page top