Skip to content

Commit

Permalink
chore: formatted with make format.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP committed Oct 24, 2024
1 parent 58b9a1e commit e3a4fb4
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 77 deletions.
9 changes: 7 additions & 2 deletions examples/syscall_extract/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ class my_plugin
{
using ft = falcosecurity::field_value_type;
return {
{ft::FTYPE_BOOL, "sample.is_open", "Is Open Type",
{ft::FTYPE_BOOL,
"sample.is_open",
"Is Open Type",
"Value is true if event is of open family",
{}, false, {}, true}, // use as suggested output format
{},
false,
{},
true}, // use as suggested output format
{ft::FTYPE_UINT64, "sample.open_count", "Open Type Count",
"Counter for all the events of open family in the event's "
"thread thread"},
Expand Down
6 changes: 2 additions & 4 deletions include/falcosecurity/async_event_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class async_event_handler
async_event_handler(
falcosecurity::_internal::ss_plugin_owner_t* o,
const falcosecurity::_internal::ss_plugin_async_event_handler_t h):
m_owner(o),
m_handler(h), m_writer()
m_owner(o), m_handler(h), m_writer()
{
}
FALCOSECURITY_INLINE
Expand Down Expand Up @@ -83,8 +82,7 @@ class async_event_handler_factory
async_event_handler_factory(
falcosecurity::_internal::ss_plugin_owner_t* o,
const falcosecurity::_internal::ss_plugin_async_event_handler_t h):
m_owner(o),
m_handler(h)
m_owner(o), m_handler(h)
{
}
FALCOSECURITY_INLINE
Expand Down
9 changes: 3 additions & 6 deletions include/falcosecurity/inputs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class table_init_input
FALCOSECURITY_INLINE
table_init_input(_internal::ss_plugin_owner_t* o,
const _internal::ss_plugin_init_input* i):
m_owner(o),
m_input(i),
m_owner(o), m_input(i),
m_fielder(i->tables->fields_ext, i->owner, i->get_owner_last_error),
m_reader(i->tables->reader_ext, i->owner, i->get_owner_last_error),
m_writer(i->tables->writer_ext, i->owner, i->get_owner_last_error)
Expand Down Expand Up @@ -200,8 +199,7 @@ class parse_event_input
parse_event_input(const falcosecurity::event_reader& er,
const falcosecurity::table_reader& tr,
const falcosecurity::table_writer& tw):
m_evt_reader(er),
m_table_reader(tr), m_table_writer(tw)
m_evt_reader(er), m_table_reader(tr), m_table_writer(tw)
{
}
FALCOSECURITY_INLINE
Expand Down Expand Up @@ -243,8 +241,7 @@ class extract_fields_input
FALCOSECURITY_INLINE
extract_fields_input(const falcosecurity::event_reader& er,
const falcosecurity::table_reader& tr):
m_evt_reader(er),
m_table_reader(tr), m_extract_request(nullptr)
m_evt_reader(er), m_table_reader(tr), m_extract_request(nullptr)
{
}
FALCOSECURITY_INLINE
Expand Down
8 changes: 4 additions & 4 deletions include/falcosecurity/internal/plugin_mixin_async.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ template<class Plugin, class Base> class plugin_mixin_async : public Base

private:
template<typename T>
FALCOSECURITY_INLINE auto _get_async_event_sources(T* o)
-> decltype(o->get_async_event_sources())
FALCOSECURITY_INLINE auto
_get_async_event_sources(T* o) -> decltype(o->get_async_event_sources())
{
static_assert(
std::is_same<std::vector<std::string> (T::*)(),
Expand All @@ -156,8 +156,8 @@ template<class Plugin, class Base> class plugin_mixin_async : public Base
}

template<typename T>
FALCOSECURITY_INLINE auto _stop_async_events(T* o)
-> decltype(o->stop_async_events())
FALCOSECURITY_INLINE auto
_stop_async_events(T* o) -> decltype(o->stop_async_events())
{
static_assert(std::is_same<bool (Plugin::*)() noexcept,
decltype(&Plugin::stop_async_events)>::value,
Expand Down
12 changes: 6 additions & 6 deletions include/falcosecurity/internal/plugin_mixin_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ template<class Plugin> class plugin_mixin_common : public Plugin
auto _destroy(...) -> void {}

template<typename T>
FALCOSECURITY_INLINE auto _get_required_api_version(T* o)
-> decltype(o->get_required_api_version())
FALCOSECURITY_INLINE auto
_get_required_api_version(T* o) -> decltype(o->get_required_api_version())
{
static_assert(
std::is_same<std::string (T::*)(),
Expand All @@ -202,8 +202,8 @@ template<class Plugin> class plugin_mixin_common : public Plugin
}

template<typename T>
FALCOSECURITY_INLINE auto _get_init_schema(T* o)
-> decltype(o->get_init_schema())
FALCOSECURITY_INLINE auto
_get_init_schema(T* o) -> decltype(o->get_init_schema())
{
static_assert(std::is_same<falcosecurity::init_schema (T::*)(),
decltype(&T::get_init_schema)>::value,
Expand All @@ -219,8 +219,8 @@ template<class Plugin> class plugin_mixin_common : public Plugin
}

template<typename T>
FALCOSECURITY_INLINE auto _get_last_error(T* o)
-> decltype(o->get_last_error())
FALCOSECURITY_INLINE auto
_get_last_error(T* o) -> decltype(o->get_last_error())
{
static_assert(std::is_same<std::string (T::*)(),
decltype(&T::get_last_error)>::value,
Expand Down
8 changes: 4 additions & 4 deletions include/falcosecurity/internal/plugin_mixin_extraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ template<class Plugin, class Base> class plugin_mixin_extraction : public Base

private:
template<typename T>
FALCOSECURITY_INLINE auto _get_extract_event_sources(T* o)
-> decltype(o->get_extract_event_sources())
FALCOSECURITY_INLINE auto
_get_extract_event_sources(T* o) -> decltype(o->get_extract_event_sources())
{
static_assert(
std::is_same<std::vector<std::string> (T::*)(),
Expand All @@ -165,8 +165,8 @@ template<class Plugin, class Base> class plugin_mixin_extraction : public Base
}

template<typename T>
FALCOSECURITY_INLINE auto _get_extract_event_types(T* o)
-> decltype(o->get_extract_event_types())
FALCOSECURITY_INLINE auto
_get_extract_event_types(T* o) -> decltype(o->get_extract_event_types())
{
static_assert(
std::is_same<std::vector<falcosecurity::event_type> (T::*)(),
Expand Down
8 changes: 4 additions & 4 deletions include/falcosecurity/internal/plugin_mixin_parsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ template<class Plugin, class Base> class plugin_mixin_parsing : public Base

private:
template<typename T>
FALCOSECURITY_INLINE auto _get_parse_event_sources(T* o)
-> decltype(o->get_parse_event_sources())
FALCOSECURITY_INLINE auto
_get_parse_event_sources(T* o) -> decltype(o->get_parse_event_sources())
{
static_assert(
std::is_same<std::vector<std::string> (T::*)(),
Expand All @@ -117,8 +117,8 @@ template<class Plugin, class Base> class plugin_mixin_parsing : public Base
}

template<typename T>
FALCOSECURITY_INLINE auto _get_parse_event_types(T* o)
-> decltype(o->get_parse_event_types())
FALCOSECURITY_INLINE auto
_get_parse_event_types(T* o) -> decltype(o->get_parse_event_types())
{
static_assert(
std::is_same<std::vector<falcosecurity::event_type> (T::*)(),
Expand Down
12 changes: 6 additions & 6 deletions include/falcosecurity/internal/plugin_mixin_sourcing.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class plugin_instance_mixin : public PluginInstance

private:
template<typename T>
FALCOSECURITY_INLINE auto _get_progress(std::string& fmt, T* o)
-> decltype(o->get_progress(fmt))
FALCOSECURITY_INLINE auto
_get_progress(std::string& fmt, T* o) -> decltype(o->get_progress(fmt))
{
static_assert(std::is_same<double (T::*)(std::string&),
decltype(&T::get_progress)>::value,
Expand Down Expand Up @@ -251,8 +251,8 @@ template<class Plugin, class Base> class plugin_mixin_sourcing : public Base
auto _get_id(...) -> uint32_t { return 0; }

template<typename T>
FALCOSECURITY_INLINE auto _get_event_source(T* o)
-> decltype(o->get_event_source())
FALCOSECURITY_INLINE auto
_get_event_source(T* o) -> decltype(o->get_event_source())
{
static_assert(std::is_same<std::string (T::*)(),
decltype(&T::get_event_source)>::value,
Expand All @@ -264,8 +264,8 @@ template<class Plugin, class Base> class plugin_mixin_sourcing : public Base
auto _get_event_source(...) -> std::string { return ""; }

template<typename T>
FALCOSECURITY_INLINE auto _list_open_params(T* o)
-> decltype(o->list_open_params())
FALCOSECURITY_INLINE auto
_list_open_params(T* o) -> decltype(o->list_open_params())
{
static_assert(std::is_same<std::vector<open_param> (T::*)(),
decltype(&T::list_open_params)>::value,
Expand Down
15 changes: 3 additions & 12 deletions include/falcosecurity/internal/symbols_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,10 @@ limitations under the License.
} \
\
FALCOSECURITY_EXPORT \
const char* plugin_get_version() \
{ \
return s_plugin_common.get_version(); \
} \
const char* plugin_get_version() { return s_plugin_common.get_version(); } \
\
FALCOSECURITY_EXPORT \
const char* plugin_get_name() \
{ \
return s_plugin_common.get_name(); \
} \
const char* plugin_get_name() { return s_plugin_common.get_name(); } \
\
FALCOSECURITY_EXPORT \
const char* plugin_get_description() \
Expand All @@ -53,10 +47,7 @@ limitations under the License.
} \
\
FALCOSECURITY_EXPORT \
const char* plugin_get_contact() \
{ \
return s_plugin_common.get_contact(); \
} \
const char* plugin_get_contact() { return s_plugin_common.get_contact(); } \
\
FALCOSECURITY_EXPORT \
const char* plugin_get_init_schema(ss_plugin_schema_type* st) \
Expand Down
5 changes: 1 addition & 4 deletions include/falcosecurity/internal/symbols_sourcing.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ limitations under the License.
static plugin_mixin<__t> s_plugin_sourcing; \
\
FALCOSECURITY_EXPORT \
uint32_t plugin_get_id() \
{ \
return s_plugin_sourcing.get_id(); \
} \
uint32_t plugin_get_id() { return s_plugin_sourcing.get_id(); } \
\
FALCOSECURITY_EXPORT \
const char* plugin_get_event_source() \
Expand Down
24 changes: 8 additions & 16 deletions include/falcosecurity/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ class table_fields
table_fields(const _internal::ss_plugin_table_fields_vtable_ext* f,
_internal::ss_plugin_owner_t* o,
const char* (*glerr)(_internal::ss_plugin_owner_t* o)):
m_fields(f),
m_owner(o), m_get_owner_last_error(glerr)
m_fields(f), m_owner(o), m_get_owner_last_error(glerr)
{
}
FALCOSECURITY_INLINE
Expand Down Expand Up @@ -103,8 +102,7 @@ class table_reader
table_reader(const _internal::ss_plugin_table_reader_vtable_ext* r,
_internal::ss_plugin_owner_t* o,
const char* (*glerr)(_internal::ss_plugin_owner_t* o)):
m_reader(r),
m_owner(o), m_get_owner_last_error(glerr)
m_reader(r), m_owner(o), m_get_owner_last_error(glerr)
{
}
FALCOSECURITY_INLINE
Expand Down Expand Up @@ -133,8 +131,7 @@ class table_writer
table_writer(const _internal::ss_plugin_table_writer_vtable_ext* w,
_internal::ss_plugin_owner_t* o,
const char* (*glerr)(_internal::ss_plugin_owner_t* o)):
m_writer(w),
m_owner(o), m_get_owner_last_error(glerr)
m_writer(w), m_owner(o), m_get_owner_last_error(glerr)
{
}
FALCOSECURITY_INLINE
Expand Down Expand Up @@ -189,15 +186,13 @@ class table_entry
FALCOSECURITY_INLINE
table_entry(_internal::ss_plugin_table_entry_t* e,
_internal::ss_plugin_table_t* t, const table_reader& r):
m_entry(e),
m_table(t), m_reader(&r)
m_entry(e), m_table(t), m_reader(&r)
{
}
FALCOSECURITY_INLINE
table_entry(_internal::ss_plugin_table_entry_t* e,
_internal::ss_plugin_table_t* t, const table_reader* r):
m_entry(e),
m_table(t), m_reader(r)
m_entry(e), m_table(t), m_reader(r)
{
}

Expand Down Expand Up @@ -258,8 +253,7 @@ class table_stale_entry
FALCOSECURITY_INLINE
table_stale_entry(_internal::ss_plugin_table_entry_t* e,
_internal::ss_plugin_table_t* t, const table_writer& w):
m_entry(e),
m_table(t), m_writer(&w)
m_entry(e), m_table(t), m_writer(&w)
{
}

Expand All @@ -284,8 +278,7 @@ class table_field
FALCOSECURITY_INLINE
table_field(const std::string& n, _internal::ss_plugin_state_type ft,
_internal::ss_plugin_table_field_t* f):
m_name(n),
m_field_type(ft), m_field(f)
m_name(n), m_field_type(ft), m_field(f)
{
}
FALCOSECURITY_INLINE
Expand Down Expand Up @@ -417,8 +410,7 @@ class table
FALCOSECURITY_INLINE
table(const std::string& n, _internal::ss_plugin_state_type kt,
_internal::ss_plugin_table_t* t):
m_name(n),
m_key_type(kt), m_table(t), m_data()
m_name(n), m_key_type(kt), m_table(t), m_data()
{
}
FALCOSECURITY_INLINE
Expand Down
15 changes: 6 additions & 9 deletions include/falcosecurity/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,10 @@ struct field_info
FALCOSECURITY_INLINE
field_info(field_value_type t, const std::string& n, const std::string& di,
const std::string& de, const field_arg& a = field_arg(),
bool l = false, const std::vector<std::string>& p = {}, bool o = false):
type(t),
name(n), list(l), arg(a), display(di), description(de),
properties(p),
addOutput(o)
bool l = false, const std::vector<std::string>& p = {},
bool o = false):
type(t), name(n), list(l), arg(a), display(di), description(de),
properties(p), addOutput(o)
{
}
FALCOSECURITY_INLINE
Expand Down Expand Up @@ -187,8 +186,7 @@ struct open_param
FALCOSECURITY_INLINE
open_param(const std::string& v, const std::string& d,
const std::string& s = ";"):
value(v),
description(d), separator(s)
value(v), description(d), separator(s)
{
}
FALCOSECURITY_INLINE
Expand All @@ -215,8 +213,7 @@ struct metric
const metric_value v = metric_value(),
const metric_value_type vt =
metric_value_type::SS_PLUGIN_METRIC_VALUE_TYPE_U64):
name(n),
type(t), value(v), value_type(vt)
name(n), type(t), value(v), value_type(vt)
{
}
FALCOSECURITY_INLINE
Expand Down

0 comments on commit e3a4fb4

Please sign in to comment.