Skip to content

Commit

Permalink
update(userspace/libsinsp): add factory method for sinsp_evt from a g…
Browse files Browse the repository at this point in the history
…iven scap buffer

Co-authored-by: Vadim Zyarko <[email protected]>
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
VadimZy authored and poiana committed Nov 20, 2023
1 parent 60e5b74 commit 011b081
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions userspace/libsinsp/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,17 @@ class SINSP_PUBLIC sinsp_evt : public gen_event
m_info = ppm_event;
m_errorcode = errorcode;
}

static std::unique_ptr<sinsp_evt> from_scap_evt(
std::unique_ptr<uint8_t, std::default_delete<uint8_t[]>> scap_event)
{
auto ret = std::make_unique<sinsp_evt>();
auto evdata = scap_event.release();
ret->init(evdata, 0);
ret->m_pevt_storage = (char*)evdata;
return ret;
}

inline void load_params()
{
uint32_t j;
Expand Down

0 comments on commit 011b081

Please sign in to comment.