The plug-in mechanism extends the functionality of TLS Terminator so that you can implement custom logic into the operation of the TLS Terminator component without changing its source code. Plug-ins for the TLS Terminator component are dynamic libraries. When developing plug-ins, you must comply with the prerequisites for using dynamic libraries. To use the plug-in mechanism, you must do the following:
/opt/KasperskyOS-Community-Edition-<platform>-<version>/sysroot-*-kos/include/tls/tls_plugin_interface.h. Implementation of the following interface functions is required:plugin_init() – initialize the plug-in.plugin_fini() – terminate the plug-in.plugin_get_version() – get the plug-in version.Implementation of the rest of the interface functions is optional and depends on the tasks for which the plug-in is being developed.
--plugin_path startup parameter. For more details, refer to TLS Terminator startup parameters and environment variables.Plug-in mechanism details:
dlopen().plugin_get_version() function, and the plug-in is initialized via the plugin_init() call.dlsym() to check whether the plug-in has an implementation of the called function.During initialization, the TLS Terminator component passes to the plug-in a set of pointers to its own implementations of functions through the tls_functions structure. This allows the plug-in to call these implementations as needed.
plugin_fini() function.dlclose ().