forked from osmocom/wireshark
Falco Bridge: Switch to the sinsp capabilities API.
falcosecurity/libs 448c380e switched from a plugin type to a more generic capabilities enum.
This commit is contained in:
parent
b104af1c7d
commit
0f695875ac
|
@ -29,7 +29,7 @@ typedef struct ss_plugin_info ss_plugin_info;
|
|||
#include <sinsp.h>
|
||||
|
||||
typedef struct sinsp_source_info_t {
|
||||
sinsp_source_plugin *source;
|
||||
sinsp_plugin *source;
|
||||
const char *name;
|
||||
const char *description;
|
||||
char *last_error;
|
||||
|
@ -59,11 +59,11 @@ create_sinsp_source(sinsp_span_t *sinsp_span, const char* libname, sinsp_source_
|
|||
sinsp_source_info_t *ssi = new sinsp_source_info_t();
|
||||
|
||||
try {
|
||||
sinsp_plugin *sp = sinsp_source_plugin::register_plugin(&sinsp_span->inspector, libname, "{}").get();
|
||||
if (sp->type() == TYPE_SOURCE_PLUGIN) {
|
||||
ssi->source = dynamic_cast<sinsp_source_plugin *>(sp);
|
||||
sinsp_plugin *sp = sinsp_span->inspector.register_plugin(libname, "{}").get();
|
||||
if (sp->caps() & CAP_EXTRACTION) {
|
||||
ssi->source = dynamic_cast<sinsp_plugin *>(sp);
|
||||
} else {
|
||||
err_str = g_strdup_printf("%s has unsupported plugin type %d", libname, sp->type());
|
||||
err_str = g_strdup_printf("%s has unsupported plugin capabilities 0x%02x", libname, sp->caps());
|
||||
}
|
||||
} catch (const sinsp_exception& e) {
|
||||
err_str = g_strdup_printf("Caught sinsp exception %s", e.what());
|
||||
|
@ -90,11 +90,6 @@ bool init_sinsp_source(sinsp_source_info_t *ssi, const char *config)
|
|||
return ssi->source->init(config);
|
||||
}
|
||||
|
||||
uint32_t get_sinsp_source_type(sinsp_source_info_t *ssi)
|
||||
{
|
||||
return ssi->source->type();
|
||||
}
|
||||
|
||||
const char *get_sinsp_source_last_error(sinsp_source_info_t *ssi)
|
||||
{
|
||||
if (ssi->last_error) {
|
||||
|
|
|
@ -66,7 +66,6 @@ char *create_sinsp_source(sinsp_span_t *sinsp_span, const char* libname, sinsp_s
|
|||
// These roughly match common_plugin_info
|
||||
uint32_t get_sinsp_source_id(sinsp_source_info_t *ssi);
|
||||
bool init_sinsp_source(sinsp_source_info_t *ssi, const char *config);
|
||||
uint32_t get_sinsp_source_type(sinsp_source_info_t *ssi);
|
||||
const char *get_sinsp_source_last_error(sinsp_source_info_t *ssi);
|
||||
const char *get_sinsp_source_name(sinsp_source_info_t *ssi);
|
||||
const char* get_sinsp_source_description(sinsp_source_info_t *ssi);
|
||||
|
|
Loading…
Reference in New Issue