This example demonstrates how to use the LogRR component to log the operation of programs in a KasperskyOS-based solution.
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/logrr
List of programs
Client – application that sends messages to the log server. To send messages to the log server, the Client program uses the logrr_cpp library, which filters messages based on the log level.Server – system program that implements a log server to which the Client program sends messages. The log server forwards the messages to the output channel named FsOutputChannel.FsOutputChannel – system program that implements an output channel for the Server program. The output channel saves messages received from the log server to a file.Ntpd – system program that implements an NTP client that receives time parameters from external NTP servers in the background and forwards them to the KasperskyOS kernel.VfsNet – system program that supports network protocols.Dhcpcd – system program that implements a DHCP client, which gets network interface parameters from an external DHCP server in the background and passes them to a virtual file system.EntropyEntity – system program that implements random number generation.VfsSdCardFs – system program that supports the file system of SD cards.BlobContainer – system program required for working with dynamic libraries in shared memory.DCM – system program that lets you dynamically create IPC channels.SDCard – SD card driver.DNetSrv – network card driver.When you build an example for the target hardware platform, platform-specific drivers are automatically included in the solution:
BSP – Board Support Package that provides cross-platform peripheral configuration for the Radxa ROCK 3A and Raspberry Pi 4 B.Bcm2711MboxArmToVc – driver for working with the VideoCore (VC6) coprocessor via mailbox technology for Raspberry Pi 4 B.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 policy description files for a KasperskyOS-based solution are located in the ./einit/src directory.
The security.psl file contains description of the solution security policy. This file is a top-level file into which a portion of the solution security policy description in the form of the PSL file dynld.psl is included via the use declaration. (The declarations in the PSL files are annotated to explain the purpose of these declarations.) The dynld.psl file contains the part of the security policy description that is used when dynamically linking the solution components.
Resources
The ./resources/xdl/logrr directory contains the Client.edl file, which is the EDL description of the Client program.
The ./resources/hdd/etc directory contains the configuration files for the VfsNet, Dhcpcd, and Ntpd programs: hosts, dhcpcd.conf, and ntp.conf, respectively.
The ./resources/hdd/var/db/dhcpcd directory is used by the Dhcpcd program to store network connection data.
Operating scenario
The Client program performs the following actions:
VfsNet program is used to work with the network, and the VfsSdCardFs program is used to work with the file system.)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