This example demonstrates support of the network protocol named Dynamic Host Configuration Protocol (DHCP) in KasperskyOS. The Dhcpcd program is provided in KasperskyOS Community Edition and is an implementation of a DHCP client, which configures network interfaces.
In addition, the example also demonstrates integration of multiple virtual file systems (VFSes) in a single solution. For more information about using multiple VFS programs, please refer to the File systems and network section.
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/multi_vfs_dhcpcd
List of programs
Client – application that uses libc library functions for getting information on network interfaces (ioctl). These functions are converted into queries to the VFS program via IPC.Dhcpcd – system program that implements the DHCP client.DCM – system program that lets you dynamically create IPC channels.VfsSdCardFs – system program that supports the file system of SD cards.VfsNet – system program that supports network protocols.EntropyEntity – system program that implements random number generation.DNetSrv – network card driver.SDCard – SD card driver.When you build an example for the target hardware platform, platform-specific drivers are automatically included in the solution:
BSP is a hardware platform support package (Board Support Package). Provides cross-platform configuration of peripherals 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.GPIO – GPIO support driver for the Radxa ROCK 3A.PinCtrl – low-level pin multiplexing (pinmux) configuration driver for the Radxa ROCK 3A.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/multi_vfs_dhcpcd directory contains the Client.edl file, which is the EDL description for the Client program.
The ./resources/hdd/etc directory contains:
hosts – configuration file for the VfsNet program.dhcpcd.conf, dhcpcd_static.conf, and dhcpcd_dynamic.conf are configuration files for the Dhcpcd program. The CMakeLists.txt root file defines the values of variables that determine the selected configuration file:DHCPCD_FALLBACKDynamically receive the parameters of network interfaces from an external DHCP server but statically define the parameters if the DHCP server is not available. This value is used by default.
DHCPCD_DYNAMICDynamically receive the parameters of network interfaces from an external DHCP server.
DHCPCD_STATICStatically define the parameters of network interfaces.
The ./resources/hdd/var/db/dhcpcd directory is used by the Dhcpcd program to store network connection data.
Operating scenario
The Dhcpcd program is provided in KasperskyOS Community Edition and is an implementation of a DHCP client, which configures network interfaces. The Client program receives information about the configured network interfaces and prints them to standard error.
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