Skip to content

Commit

Permalink
Merge branch 'falcosecurity:master' into issue_515_listen
Browse files Browse the repository at this point in the history
  • Loading branch information
oheifetz authored Jul 15, 2023
2 parents be61939 + 5eaf64f commit 7a1378a
Show file tree
Hide file tree
Showing 11 changed files with 243 additions and 465 deletions.
1 change: 1 addition & 0 deletions userspace/libscap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ endif()

list(APPEND targetfiles
scap.c
scap_api_version.c
scap_fds.c
scap_savefile.c
scap_platform.c
Expand Down
19 changes: 15 additions & 4 deletions userspace/libscap/engine/udig/scap_udig.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,8 @@ bool acquire_and_init_ring_status_buffer(struct scap_device *dev)
return res;
}

int32_t udig_begin_capture(struct scap_engine_handle engine, char *error)
int32_t udig_begin_capture(struct scap_device *dev, char *error)
{
struct scap_device *dev = &engine.m_handle->m_dev_set.m_devs[0];
struct udig_ring_buffer_status* rbs = dev->m_bufstatus;

if(rbs->m_capturing_pid != 0)
Expand Down Expand Up @@ -311,7 +310,6 @@ int32_t udig_begin_capture(struct scap_engine_handle engine, char *error)

if(acquire_and_init_ring_status_buffer(dev))
{
engine.m_handle->m_udig_capturing = true;
return SCAP_SUCCESS;
}
else
Expand Down Expand Up @@ -547,7 +545,20 @@ static int32_t init(scap_t* main_handle, scap_open_args* oargs)
return rc;
}

return scap_udig_alloc_dev(&handle->m_dev_set.m_devs[0], handle->m_lasterr);
rc = scap_udig_alloc_dev(&handle->m_dev_set.m_devs[0], handle->m_lasterr);
if(rc != SCAP_SUCCESS)
{
return rc;
}

struct scap_device *dev = &handle->m_dev_set.m_devs[0];
rc = udig_begin_capture(dev, handle->m_lasterr);
if(rc == SCAP_SUCCESS)
{
handle->m_udig_capturing = true;
}

return rc;
}

static uint32_t get_n_devs(struct scap_engine_handle engine)
Expand Down
6 changes: 0 additions & 6 deletions userspace/libscap/scap-int.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ struct scap
struct scap_engine_handle m_engine;
struct scap_platform *m_platform;

scap_mode_t m_mode;
char m_lasterr[SCAP_LASTERR_SIZE];

uint64_t m_evtcnt;
Expand Down Expand Up @@ -123,11 +122,6 @@ extern const struct syscall_evt_pair g_syscall_table[];
extern const struct ppm_event_info g_event_info[];
extern const struct ppm_event_entry g_ppm_events[];

//
// udig stuff
//
int32_t udig_begin_capture(struct scap_engine_handle engine, char *error);

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 7a1378a

Please sign in to comment.