nk-psl-gen-c
The nk-psl-gen-c
compiler generates the C-language source code of the Kaspersky Security Module based on the solution security policy description and the IDL, CDL, and EDL descriptions. This code is used by the makekss script.
The nk-psl-gen-c
compiler can also generate the C-language source code of solution security policy tests based on solution security policy tests in PAL.
Syntax of the shell command for starting the nk-psl-gen-c
compiler:
Parameters:
INPUT
Path to the top-level file of the solution security policy description. This is normally the
security.psl
file.- {
-I
|--include-dir
}SYSROOT_INCLUDE_DIR
>Path to the
sysroot-*-kos/include
directory from the KasperskyOS SDK. - {
-I
|--include-dir
}DIR
>These parameters must be used to define the paths to directories containing IDL, CDL, and EDL files pertaining to the solution, and the paths to directories containing auxiliary files from the KasperskyOS SDK (
common
,toolchain/include
). - {
-o
|--output
}FILE
>Path to the file that will save the source code of the Kaspersky Security Module and (optionally) the source code of solution security policy tests. The path must include existing directories.
--out-tests
<FILE
>Path to the file that will save the source code of the solution security policy tests.
- {
-t
|--tests
}ARG
>Defines whether the source code of solution security policy tests must be generated.
ARG
can take the following values:skip
– source code of tests is not generated. This value is used by default if the {-t
|--tests
}ARG
> parameter is not specified.generate
– source code of tests is generated. If the source code of tests is generated, you are advised to use the--out-tests
<FILE
> parameter. Otherwise, the source code of tests will be saved in the same file containing the source code of the Kaspersky Security Module, which may lead to errors during the build.
- {
-a
|--audit
}FILE
>Path to the file that will save the C-language source code of the audit decoder.
--enable-preprocessor
Enables the Ginger template engine.
--preprocessor-definition=
<VAR_NAME
>[=
<VAR_VALUE
>]These parameters must be used to define the variables that are utilized when expanding Ginger PSL templates. For example,
--preprocessor-definition=foo=bar
sets thefoo
variable tobar
, and--preprocessor-definition=USE_DYNLD
sets theUSE_DYNLD
variable toTRUE
. TheUSE_DYNLD
variable is set toTRUE
because variables used when expanding Ginger PSL templates are set toTRUE
by default.--preprocessor-dump-dir
<DIR
>Path to the directory where PSL files received from Ginger PSL templates will be stored. These PSL files are needed only to verify what was obtained as a result of expanding Ginger PSL templates, and are not used to generate source code of the Kaspersky Security Module. (When source code of the security module is generated, Ginger PSL templates are expanded in memory irrespective of whether or not the
--preprocessor-dump-dir
<DIR
> parameter is being used.) The names of PSL files are generated based on the absolute paths to Ginger PSL templates. For example, the PSL file namedfoo!bar!baz.psl
corresponds to the Ginger PSL template located at the path/foo/bar/baz.psl
.-h
|--help
Prints the Help text.
--version
Prints the version of the
nk-psl-gen-c
compiler.