This example demonstrates the special features of a solution in which a program uses standard POSIX functions to interact with an external server.
The net2_with_separate_vfs
example is a modified net_with_separate_vfs
example. In contrast to the net_with_separate_vfs
example, in this example a program interacts over the network with an external server rather than another program running in KasperskyOS.
This example consists of the Client
program running in KasperskyOS on QEMU or Raspberry Pi and the Server
program running in a Linux host operating system. The Client
program and Server
program are bound by a TCP socket. Standard POSIX functions are used in the code of the Client
program.
To connect the Client
program and the Server
program using a socket, the Client
program must interact with the NetVfs
program. During the build, the NetVfs
program is linked to a network driver that supports interaction with the Server
program running in Linux.
The CMake system, which is included with KasperskyOS Community Edition, is used to build and run the example.
Example files
The code of the example and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<version>/examples/net2_with_separate_vfs
Building and running example
See Building and running examples section.
To ensure that an example runs correctly, you must run the Server
program in a Linux host operating system or on a computer connected to Raspberry Pi.
After performing the build, the server
executable file of the Server
program is located in the following directory:
/opt/KasperskyOS-Community-Edition-<version>/examples/net2_with_separate_vfs/build/host/server/
To independently build the executable file of the Server
program, you need to run the following commands:
$ cd net2_with_separate_vfs/server/src/
$ gcc -o server server.c
Page top