Skip to content

Commit

Permalink
update(userspace/falco): add more info to --version output
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
  • Loading branch information
leogr committed Jun 23, 2022
1 parent 1ba83fa commit f9495d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 18 additions & 1 deletion userspace/falco/app_actions/print_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,25 @@ application::run_result application::print_version()
{
if(m_options.print_version_info)
{
auto s = new sinsp();
printf("Falco version: %s\n", FALCO_VERSION);
printf("Driver version: %s\n", DRIVER_VERSION);
printf("Libs version: %s\n", FALCOSECURITY_LIBS_VERSION);
printf("Plugin API: %s\n", s->get_plugin_api_version());

// todo(leogr): move string conversion to scap
auto driver_api_version = s->get_scap_api_version();
unsigned long driver_api_major = PPM_API_VERSION_MAJOR(driver_api_version);
unsigned long driver_api_minor = PPM_API_VERSION_MINOR(driver_api_version);
unsigned long driver_api_patch = PPM_API_VERSION_PATCH(driver_api_version);
auto driver_schema_version = s->get_scap_api_version();
unsigned long driver_schema_major = PPM_API_VERSION_MAJOR(driver_schema_version);
unsigned long driver_schema_minor = PPM_API_VERSION_MINOR(driver_schema_version);
unsigned long driver_schema_patch = PPM_API_VERSION_PATCH(driver_schema_version);
printf("Driver:\n");
printf(" API version: %ld.%ld.%ld\n", driver_api_major, driver_api_minor, driver_api_patch);
printf(" Schema version: %ld.%ld.%ld\n", driver_schema_major, driver_schema_minor, driver_schema_patch);
printf(" Default driver: %s\n", DRIVER_VERSION);

return run_result::exit();
}
return run_result::ok();
Expand Down
2 changes: 2 additions & 0 deletions userspace/falco/config_falco.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ limitations under the License.
#define FALCO_INSTALL_CONF_FILE "/etc/falco/falco.yaml"
#define FALCO_ENGINE_PLUGINS_DIR "${FALCO_ABSOLUTE_SHARE_DIR}/plugins/"

#define FALCOSECURITY_LIBS_VERSION "${FALCOSECURITY_LIBS_VERSION}"

#define DRIVER_NAME "@DRIVER_NAME@"
#define DRIVER_VERSION "@DRIVER_VERSION@"

0 comments on commit f9495d3

Please sign in to comment.