net_with_separate_vfs example

This example demonstrates how to establish a connection between programs running in KasperskyOS via TCP sockets using a loopback interface.

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/net_with_separate_vfs

List of programs

When you build an example for the target hardware platform, platform-specific drivers are automatically included in the solution:

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.

Resources

The ./resources/xdl/net_with_separate_vfs directory contains the Client.edl and Server.edl files, which are the EDL descriptions of the Client and Server programs, respectively.

The ./resources/romfs/etc directory contains the hosts configuration file for the VfsNet program.

Operating scenario

The Client and Server programs establish a TCP connection through the loopback interface. To do so, they use one instance of the network stack. In other words, they interact with a "shared" VFS program (in the example, this is the VfsNet program). Both programs use standard POSIX functions in their code. The Server program waits for incoming data using the recv() function, and the Client program sends data over an established TCP connection using the send() function.

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