In KasperskyOS, all interactions between entities have statically defined types. The permissible structures of an IPC message are defined in the IDL description of the interfaces of the entity that receives the message (server).
A correct IPC message (request and response) contains a constant part and an arena.
Constant part of a message
The constant part of a message contains arguments of a fixed size, and the RIID and MID.
Fixed-size arguments can be arguments of any IDL types except the sequence
type.
The RIID and MID identify the interface and method being called:
The type of the constant part of the message is generated by the NK compiler based on the IDL description of the interface. A separate structure is generated for each interface method. Union
types are also generated for storing any request to a server, component or interface.
For example, for the Ping
method of the Ping
interface (the Ping
component of the Server
entity in the echo example), the NK compiler will create the Ping_Ping_req
type for the constant part of the request and the Ping_Ping_res
type for the constant part of the response. The following union
types will also be generated:
Ping_req
and Ping_res
are constant parts of the request and response for any method of the Ping
interface.Ping_component_req
and Ping_component_res
are constant parts of the request and response for any method of any interface whose implementation is included in the Ping
component.If embedded components are present, these types also contain structures of the constant part of a message for any method of any interface whose implementations are included in all embedded components. For more details, refer to "Generated methods and types".
Server_entity_req
and Server_entity_res
are the constant parts of the request and response for any method of any interface whose implementation is included in any component whose instance is included in the Server
entity.Arena
The arena is a buffer for storing variable-size arguments (sequence
IDL type).
Validating a message in Kaspersky Security System
Kaspersky Security System checks that the structure of the message being sent is correct. Requests and responses are both validated. If the message has an incorrect structure, it will be rejected without calling the security policies associated with it.
Forming a message structure
KasperskyOS Community Edition includes the following tools that make it easier for the developer to create and package an IPC message:
transport-kos
library for working with NkKosTransport.The echo example shows the creation of a simple IPC message.
Page top