libscap  0.1.0.0
scap.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2013-2018 Draios Inc dba Sysdig.
3 
4 This file is part of sysdig.
5 
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 
18 */
19 
20 #pragma once
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
42 // Public structs and defines
45 
50 //
51 // Forward declarations
52 //
53 typedef struct scap scap_t;
54 typedef struct ppm_evt_hdr scap_evt;
55 
56 struct iovec;
57 
58 //
59 // Core types
60 //
61 #ifndef __APPLE__
62 #include <time.h>
63 #endif
64 #include "uthash.h"
65 #include "./common/sysdig_types.h"
66 #include "./driver/ppm_events_public.h"
67 
68 //
69 // Return types
70 //
71 #define SCAP_SUCCESS 0
72 #define SCAP_FAILURE 1
73 #define SCAP_TIMEOUT -1
74 #define SCAP_ILLEGAL_INPUT 3
75 #define SCAP_NOTFOUND 4
76 #define SCAP_INPUT_TOO_SMALL 5
77 #define SCAP_EOF 6
78 #define SCAP_UNEXPECTED_BLOCK 7
79 #define SCAP_VERSION_MISMATCH 8
80 #define SCAP_NOT_SUPPORTED 9
81 
82 //
83 // Last error string size for scap_open_live()
84 //
85 #define SCAP_LASTERR_SIZE 256
86 
90 typedef struct scap_stats
91 {
92  uint64_t n_evts;
93  uint64_t n_drops;
94  uint64_t n_drops_buffer;
95  uint64_t n_drops_pf;
96  uint64_t n_drops_bug;
97  uint64_t n_preemptions;
98  uint64_t n_suppressed;
99  uint64_t n_tids_suppressed;
100 }scap_stats;
101 
105 typedef struct evt_param_info
106 {
107  const char* name;
108  uint32_t type;
109  uint32_t len;
110  char* val;
112 
113 #define SCAP_MAX_PATH_SIZE 1024
114 #define SCAP_MAX_ARGS_SIZE 4096
115 #define SCAP_MAX_ENV_SIZE 4096
116 #define SCAP_MAX_CGROUPS_SIZE 4096
117 #define SCAP_MAX_SUPPRESSED_COMMS 32
118 
122 typedef enum scap_fd_type
123 {
142 }scap_fd_type;
143 
147 typedef enum scap_l4_proto
148 {
156 
160 typedef struct scap_fdinfo
161 {
162  int64_t fd;
163  uint64_t ino;
165  union
166  {
167  struct
168  {
169  uint32_t sip;
170  uint32_t dip;
171  uint16_t sport;
172  uint16_t dport;
173  uint8_t l4proto;
174  } ipv4info;
175  struct
176  {
177  uint32_t sip[4];
178  uint32_t dip[4];
179  uint16_t sport;
180  uint16_t dport;
181  uint8_t l4proto;
182  } ipv6info;
183  struct
184  {
185  uint32_t ip;
186  uint16_t port;
187  uint8_t l4proto;
188  } ipv4serverinfo;
189  struct
190  {
191  uint32_t ip[4];
192  uint16_t port;
193  uint8_t l4proto;
194  } ipv6serverinfo;
195  struct
196  {
197  uint64_t source;
198  uint64_t destination;
200  } unix_socket_info;
201  struct
202  {
203  uint32_t open_flags;
205  uint32_t mount_id;
206  uint32_t dev;
207  } regularinfo;
209  }info;
210  UT_hash_handle hh;
211 }scap_fdinfo;
212 
216 typedef struct scap_threadinfo
217 {
218  uint64_t tid;
219  uint64_t pid;
220  uint64_t ptid;
221  uint64_t sid;
222  uint64_t vpgid;
227  uint16_t args_len;
229  uint16_t env_len;
231  int64_t fdlimit;
232  uint32_t flags;
233  uint32_t uid;
234  uint32_t gid;
235  uint32_t vmsize_kb;
236  uint32_t vmrss_kb;
237  uint32_t vmswap_kb;
238  uint64_t pfmajor;
239  uint64_t pfminor;
240  int64_t vtid;
241  int64_t vpid;
243  uint16_t cgroups_len;
247  uint64_t clone_ts;
248  int32_t tty;
249  int32_t loginuid;
250 
251  UT_hash_handle hh;
253 
257 typedef struct {
258  uint64_t mount_id;
259  uint32_t dev;
260  UT_hash_handle hh;
262 
263 typedef void (*proc_entry_callback)(void* context,
264  scap_t* handle,
265  int64_t tid,
266  scap_threadinfo* tinfo,
267  scap_fdinfo* fdinfo);
268 
272 typedef enum {
291 } scap_mode_t;
292 
293 typedef struct scap_open_args
294 {
296  int fd; // If non-zero, will be used instead of fname.
297  const char* fname;
301  uint64_t start_offset;
302  const char *bpf_probe;
304  // events should be returned, with a trailing NULL value.
305  // You can provide additional comm
306  // values via scap_suppress_events_comm().
307  bool udig;
309 
310 
311 //
312 // The following stuff is byte aligned because we save it to disk.
313 //
314 #if defined _MSC_VER
315 #pragma pack(push)
316 #pragma pack(1)
317 #elif defined __sun
318 #pragma pack(1)
319 #else
320 #pragma pack(push, 1)
321 #endif
322 
326 typedef struct _scap_machine_info
327 {
328  uint32_t num_cpus;
329  uint64_t memory_size_bytes;
330  uint64_t max_pid;
331  char hostname[128];
332  uint64_t reserved1;
333  uint64_t reserved2;
334  uint64_t reserved3;
335  uint64_t reserved4;
337 
338 
339 #define SCAP_IPV6_ADDR_LEN 16
340 
344 typedef enum scap_ifinfo_type
345 {
352 
356 typedef struct scap_ifinfo_ipv4
357 {
358  // NB: new fields must be appended
359  uint16_t type;
360  uint16_t ifnamelen;
361  uint32_t addr;
362  uint32_t netmask;
363  uint32_t bcast;
364  uint64_t linkspeed;
367 
372 {
373  uint16_t type;
374  uint16_t ifnamelen;
375  uint32_t addr;
376  uint32_t netmask;
377  uint32_t bcast;
380 
384 typedef struct scap_ifinfo_ipv6
385 {
386  // NB: new fields must be appended
387  uint16_t type;
388  uint16_t ifnamelen;
392  uint64_t linkspeed;
395 
400 {
401  uint16_t type;
402  uint16_t ifnamelen;
408 
409 #if defined __sun
410 #pragma pack()
411 #else
412 #pragma pack(pop)
413 #endif
414 
418 typedef struct scap_addrlist
419 {
420  uint32_t n_v4_addrs;
421  uint32_t n_v6_addrs;
422  uint32_t totlen;
426 
427 #define MAX_CREDENTIALS_STR_LEN 256
428 #define USERBLOCK_TYPE_USER 0
429 #define USERBLOCK_TYPE_GROUP 1
430 
434 typedef struct scap_userinfo
435 {
436  uint32_t uid;
437  uint32_t gid;
442 
446 typedef struct scap_groupinfo
447 {
448  uint32_t gid;
451 
455 typedef struct scap_userlist
456 {
457  uint32_t nusers;
458  uint32_t ngroups;
459  uint32_t totsavelen;
463 
464 //
465 // Misc definitions
466 //
467 
471 typedef enum scap_os_platform
472 {
479 
483 typedef enum event_direction
484 {
488 
492 typedef enum compression_mode
493 {
497 
501 typedef enum scap_dump_flags
502 {
505  SCAP_DF_TRACER = (1 << 1)
508 
509 typedef struct scap_dumper scap_dumper_t;
510 
515  enum ppm_event_category category;
516  enum ppm_event_flags flags;
517  char *name;
518 };
519 
522 // Structs and defines used internally
525 
526 #define IN
527 #define OUT
528 
529 //
530 // udig stuff
531 //
532 #define UDIG_RING_SM_FNAME "udig_buf"
533 #define UDIG_RING_DESCS_SM_FNAME "udig_descs"
534 #define UDIG_RING_SIZE (8 * 1024 * 1024)
535 
536 #ifndef __APPLE__
538  volatile uint64_t m_buffer_lock;
539  volatile int m_initialized;
540  volatile int m_capturing_pid;
541  volatile int m_stopped;
542  volatile struct timespec m_last_print_time;
543  struct udig_consumer_t m_consumer;
544 };
545 #endif // __APPLE__
546 
548 
549 int32_t udig_alloc_ring(int* ring_fd, uint8_t** ring, uint32_t *ringsize, char *error);
550 int32_t udig_alloc_ring_descriptors(int* ring_descs_fd,
551  struct ppm_ring_buffer_info** ring_info,
552  struct udig_ring_buffer_status** ring_status,
553  char *error);
554 void udig_free_ring(uint8_t* addr, uint32_t size);
555 void udig_free_ring_descriptors(uint8_t* addr);
556 
558 // API functions
560 
575 scap_t* scap_open_live(char *error, int32_t *rc);
576 
588 scap_t* scap_open_offline(const char* fname, char *error, int32_t *rc);
589 
601 scap_t* scap_open_offline_fd(int fd, char *error, int32_t *rc);
602 
614 scap_t* scap_open(scap_open_args args, char *error, int32_t *rc);
615 
621 void scap_close(scap_t* handle);
622 
635 
639 const char* scap_getlasterr(scap_t* handle);
640 
644 uint64_t scap_max_buf_used(scap_t* handle);
645 
659 int32_t scap_next(scap_t* handle, OUT scap_evt** pevent, OUT uint16_t* pcpuid);
660 
668 uint32_t scap_event_getlen(scap_evt* e);
669 
677 uint64_t scap_event_get_ts(scap_evt* e);
678 
687 uint64_t scap_event_get_num(scap_t* handle);
688 
694 void scap_event_reset_count(scap_t* handle);
695 
703 const struct ppm_event_info* scap_event_getinfo(scap_evt* e);
704 
712 uint32_t scap_event_get_dump_flags(scap_t* handle);
713 
720 int64_t scap_get_readfile_offset(scap_t* handle);
721 
730 scap_dumper_t* scap_dump_open(scap_t *handle, const char *fname, compression_mode compress, bool skip_proc_scan);
731 
740 scap_dumper_t* scap_dump_open_fd(scap_t *handle, int fd, compression_mode compress, bool skip_proc_scan);
741 
748 
756 
764 int64_t scap_dump_ftell(scap_dumper_t *d);
765 
772 
784 int32_t scap_number_of_bytes_to_write(scap_evt *e, uint16_t cpuid, int32_t* bytes);
785 
799 int32_t scap_dump(scap_t *handle, scap_dumper_t *d, scap_evt* e, uint16_t cpuid, uint32_t flags);
800 
828 
840 int32_t scap_get_stats(scap_t* handle, OUT scap_stats* stats);
841 
851 int32_t scap_stop_capture(scap_t* handle);
852 
862 int32_t scap_start_capture(scap_t* handle);
863 
874 
884 
895 const struct ppm_event_info* scap_get_event_info_table();
896 
908 
918 
934 int32_t scap_set_snaplen(scap_t* handle, uint32_t snaplen);
935 
943 int32_t scap_clear_eventmask(scap_t* handle);
944 
954 int32_t scap_set_eventmask(scap_t* handle, uint32_t event_id);
955 
956 
966 int32_t scap_unset_eventmask(scap_t* handle, uint32_t event_id);
967 
968 
974 const char* scap_get_host_root();
975 
979 struct ppm_proclist_info* scap_get_threadlist(scap_t* handle);
980 
981 const char *scap_get_bpf_probe_from_env();
982 
983 bool scap_get_bpf_enabled(scap_t* handle);
984 
995 int32_t scap_suppress_events_comm(scap_t* handle, const char *comm);
996 
1001 bool scap_check_suppressed_tid(scap_t *handle, int64_t tid);
1002 
1005 // Non public functions
1008 
1009 //
1010 // Return the number of event capture devices that the library is handling. Each processor
1011 // has its own event capture device.
1012 //
1013 uint32_t scap_get_ndevs(scap_t* handle);
1014 
1015 // Retrieve a buffer of events from one of the cpus
1016 extern int32_t scap_readbuf(scap_t* handle, uint32_t cpuid, OUT char** buf, OUT uint32_t* len);
1017 
1018 #ifdef PPM_ENABLE_SENTINEL
1019 // Get the sentinel at the beginning of the event
1020 uint32_t scap_event_get_sentinel_begin(scap_evt* e);
1021 #endif
1022 
1023 // Get the information about a process.
1024 // The returned pointer must be freed via scap_proc_free by the caller.
1025 struct scap_threadinfo* scap_proc_get(scap_t* handle, int64_t tid, bool scan_sockets);
1026 
1027 // Check if the given thread exists in ;proc
1028 bool scap_is_thread_alive(scap_t* handle, int64_t pid, int64_t tid, const char* comm);
1029 
1030 // like getpid() but returns the global PID even inside a container
1031 int32_t scap_getpid_global(scap_t* handle, int64_t* pid);
1032 
1033 struct scap_threadinfo *scap_proc_alloc(scap_t* handle);
1034 void scap_proc_free(scap_t* handle, struct scap_threadinfo* procinfo);
1035 void scap_dev_delete(scap_t* handle, scap_mountinfo* dev);
1036 int32_t scap_stop_dropping_mode(scap_t* handle);
1037 int32_t scap_start_dropping_mode(scap_t* handle, uint32_t sampling_ratio);
1038 int32_t scap_enable_dynamic_snaplen(scap_t* handle);
1039 int32_t scap_disable_dynamic_snaplen(scap_t* handle);
1040 void scap_proc_free_table(scap_t* handle);
1041 void scap_free_device_table(scap_t* handle);
1042 void scap_refresh_iflist(scap_t* handle);
1043 void scap_refresh_proc_table(scap_t* handle);
1044 void scap_set_refresh_proc_table_when_saving(scap_t* handle, bool refresh);
1045 uint64_t scap_ftell(scap_t *handle);
1046 void scap_fseek(scap_t *handle, uint64_t off);
1047 int32_t scap_enable_tracers_capture(scap_t* handle);
1048 int32_t scap_enable_page_faults(scap_t *handle);
1049 uint64_t scap_get_unexpected_block_readsize(scap_t* handle);
1050 int32_t scap_proc_add(scap_t* handle, uint64_t tid, scap_threadinfo* tinfo);
1051 int32_t scap_fd_add(scap_t *handle, scap_threadinfo* tinfo, uint64_t fd, scap_fdinfo* fdinfo);
1052 scap_dumper_t *scap_memory_dump_open(scap_t *handle, uint8_t* targetbuf, uint64_t targetbufsize);
1053 #ifdef USE_ZLIB
1054 int32_t compr(uint8_t* dest, uint64_t* destlen, const uint8_t* source, uint64_t sourcelen, int level);
1055 #endif
1057 int32_t scap_write_proc_fds(scap_t *handle, struct scap_threadinfo *tinfo, scap_dumper_t *d);
1058 int32_t scap_write_proclist_header(scap_t *handle, scap_dumper_t *d, uint32_t totlen);
1059 int32_t scap_write_proclist_trailer(scap_t *handle, scap_dumper_t *d, uint32_t totlen);
1060 int32_t scap_write_proclist_entry(scap_t *handle, scap_dumper_t *d, struct scap_threadinfo *tinfo, uint32_t len);
1061 // Variant of scap_write_proclist_entry where array-backed information
1062 // about the thread is provided separate from the scap_threadinfo
1063 // struct.
1064 int32_t scap_write_proclist_entry_bufs(scap_t *handle, scap_dumper_t *d, struct scap_threadinfo *tinfo, uint32_t len,
1065  const char *comm,
1066  const char *exe,
1067  const char *exepath,
1068  const struct iovec *args, int argscnt,
1069  const struct iovec *envs, int envscnt,
1070  const char *cwd,
1071  const struct iovec *cgroups, int cgroupscnt,
1072  const char *root);
1073 
1074 // Turn on processing only a subset syscalls. This is only appliable when scap
1075 // is in LIVE mode.
1076 int32_t scap_enable_simpledriver_mode(scap_t* handle);
1077 int32_t scap_get_n_tracepoint_hit(scap_t* handle, long* ret);
1078 #ifdef CYGWING_AGENT
1079 typedef struct wh_t wh_t;
1080 wh_t* scap_get_wmi_handle(scap_t* handle);
1081 #endif
1082 int32_t scap_set_fullcapture_port_range(scap_t* handle, uint16_t range_start, uint16_t range_end);
1083 
1089 int32_t scap_set_statsd_port(scap_t* handle, uint16_t port);
1090 
1091 #ifdef __cplusplus
1092 }
1093 #endif
scap_stats::n_drops_buffer
uint64_t n_drops_buffer
Number of dropped events caused by full buffer.
Definition: scap.h:94
scap_fdinfo::@0::@3::ip
uint32_t ip
Local IP.
Definition: scap.h:185
scap_fdinfo::@0::@1::dport
uint16_t dport
Destination port.
Definition: scap.h:172
SCAP_MAX_ARGS_SIZE
#define SCAP_MAX_ARGS_SIZE
Definition: scap.h:114
scap_enable_tracers_capture
int32_t scap_enable_tracers_capture(scap_t *handle)
scap_open_args::start_offset
uint64_t start_offset
Used to start reading a capture file from an arbitrary offset. This is leveraged when opening merged ...
Definition: scap.h:301
scap_next
int32_t scap_next(scap_t *handle, OUT scap_evt **pevent, OUT uint16_t *pcpuid)
Get the next event from the from the given capture instance.
SCAP_ED_OUT
@ SCAP_ED_OUT
Definition: scap.h:486
scap_get_bpf_enabled
bool scap_get_bpf_enabled(scap_t *handle)
udig_ring_buffer_status::m_consumer
struct udig_consumer_t m_consumer
Definition: scap.h:543
scap_proc_add
int32_t scap_proc_add(scap_t *handle, uint64_t tid, scap_threadinfo *tinfo)
scap_get_stats
int32_t scap_get_stats(scap_t *handle, OUT scap_stats *stats)
Return the capture statistics for the given capture handle.
scap_fdinfo::dip
uint32_t dip
Destination IP.
Definition: scap.h:170
scap_fdinfo::@0::@2::sport
uint16_t sport
Source Port.
Definition: scap.h:179
scap_stats::n_drops_pf
uint64_t n_drops_pf
Number of dropped events caused by invalid memory access.
Definition: scap.h:95
scap_get_ndevs
uint32_t scap_get_ndevs(scap_t *handle)
scap_stats::n_suppressed
uint64_t n_suppressed
Number of events skipped due to the tid being in a set of suppressed tids.
Definition: scap.h:98
scap_ifinfo_ipv4_nolinkspeed
For backward compatibility only.
Definition: scap.h:371
scap_open_args
Definition: scap.h:293
scap_stats::n_tids_suppressed
uint64_t n_tids_suppressed
Number of threads currently being suppressed.
Definition: scap.h:99
scap_ifinfo_ipv4_nolinkspeed::type
uint16_t type
Definition: scap.h:373
scap_fdinfo::type
scap_fd_type type
This file descriptor's type.
Definition: scap.h:164
scap_threadinfo::hh
UT_hash_handle hh
makes this structure hashable
Definition: scap.h:251
scap_t
struct scap scap_t
Definition: scap.h:53
scap_get_n_tracepoint_hit
int32_t scap_get_n_tracepoint_hit(scap_t *handle, long *ret)
udig_ring_buffer_status
Definition: scap.h:537
scap_open_offline
scap_t * scap_open_offline(const char *fname, char *error, int32_t *rc)
Start an event capture from file.
scap_open_args::fd
int fd
Definition: scap.h:296
scap_groupinfo::gid
uint32_t gid
Group ID.
Definition: scap.h:448
scap_ifinfo_ipv6::addr
char addr[SCAP_IPV6_ADDR_LEN]
Interface address.
Definition: scap.h:389
scap_stats::n_drops_bug
uint64_t n_drops_bug
Number of dropped events caused by an invalid condition in the kernel instrumentation.
Definition: scap.h:96
SCAP_IPV6_ADDR_LEN
#define SCAP_IPV6_ADDR_LEN
Definition: scap.h:339
scap_ifinfo_ipv6::linkspeed
uint64_t linkspeed
Interface link speed.
Definition: scap.h:392
scap_threadinfo::vtid
int64_t vtid
Definition: scap.h:240
_scap_machine_info::reserved2
uint64_t reserved2
reserved for future use
Definition: scap.h:333
scap_stop_dropping_mode
int32_t scap_stop_dropping_mode(scap_t *handle)
scap_fdinfo::ino
uint64_t ino
For unix sockets, the inode.
Definition: scap.h:163
scap_threadinfo::cgroups
char cgroups[SCAP_MAX_CGROUPS_SIZE]
Definition: scap.h:242
scap_threadinfo::sid
uint64_t sid
The session id of the process containing this thread.
Definition: scap.h:221
scap_fdinfo::@0::@1::dip
uint32_t dip
Destination IP.
Definition: scap.h:170
scap_ifinfo_ipv6_nolinkspeed::ifnamelen
uint16_t ifnamelen
Definition: scap.h:402
event_direction
event_direction
Indicates if an event is an enter one or an exit one.
Definition: scap.h:483
scap_fdinfo::ipv6serverinfo
struct scap_fdinfo::@0::@4 ipv6serverinfo
Information specific to IPv6 server sockets, e.g. sockets used for bind().
scap_proc_free_table
void scap_proc_free_table(scap_t *handle)
scap_threadinfo::ptid
uint64_t ptid
The id of the thread that created this thread.
Definition: scap.h:220
scap_refresh_proc_table
void scap_refresh_proc_table(scap_t *handle)
scap_threadinfo::comm
char comm[SCAP_MAX_PATH_SIZE+1]
Command name (e.g. "top")
Definition: scap.h:223
scap_groupinfo::name
char name[MAX_CREDENTIALS_STR_LEN]
Group name.
Definition: scap.h:449
scap_ifinfo_ipv6::ifnamelen
uint16_t ifnamelen
Definition: scap.h:388
evt_param_info::len
uint32_t len
The event total length.
Definition: scap.h:109
scap_userlist::nusers
uint32_t nusers
Number of users.
Definition: scap.h:457
scap_is_thread_alive
bool scap_is_thread_alive(scap_t *handle, int64_t pid, int64_t tid, const char *comm)
scap_threadinfo::env
char env[SCAP_MAX_ENV_SIZE+1]
Environment.
Definition: scap.h:228
scap_ifinfo_ipv6::netmask
char netmask[SCAP_IPV6_ADDR_LEN]
Interface netmask.
Definition: scap.h:390
scap_getlasterr
const char * scap_getlasterr(scap_t *handle)
Return a string with the last error that happened on the given capture.
scap_threadinfo::cgroups_len
uint16_t cgroups_len
Definition: scap.h:243
SCAP_L4_ICMP
@ SCAP_L4_ICMP
Definition: scap.h:153
scap_fdinfo
Information about a file descriptor.
Definition: scap.h:160
scap_fdinfo::@0::@3::port
uint16_t port
Local Port.
Definition: scap.h:186
scap_stats
struct scap_stats scap_stats
Statistics about an in progress capture.
scap_fdinfo::hh
UT_hash_handle hh
makes this structure hashable
Definition: scap.h:210
udig_ring_buffer_status::m_capturing_pid
volatile int m_capturing_pid
Definition: scap.h:540
scap_fd_add
int32_t scap_fd_add(scap_t *handle, scap_threadinfo *tinfo, uint64_t fd, scap_fdinfo *fdinfo)
scap_threadinfo::vmswap_kb
uint32_t vmswap_kb
swapped memory (as kb)
Definition: scap.h:237
SCAP_COMPRESSION_NONE
@ SCAP_COMPRESSION_NONE
Definition: scap.h:494
SCAP_II_IPV6_NOLINKSPEED
@ SCAP_II_IPV6_NOLINKSPEED
Definition: scap.h:350
scap_threadinfo::cwd
char cwd[SCAP_MAX_PATH_SIZE+1]
The current working directory.
Definition: scap.h:230
scap_free_device_table
void scap_free_device_table(scap_t *handle)
scap_threadinfo::exe
char exe[SCAP_MAX_PATH_SIZE+1]
argv0
Definition: scap.h:224
ppm_syscall_desc::flags
enum ppm_event_flags flags
Definition: scap.h:516
scap_fdinfo::@0::@4::l4proto
uint8_t l4proto
Transport protocol. See scap_l4_proto.
Definition: scap.h:193
SCAP_DF_TRACER
@ SCAP_DF_TRACER
This event is a tracer.
Definition: scap.h:506
scap_threadinfo::fdlist
scap_fdinfo * fdlist
The fd table for this process.
Definition: scap.h:246
scap_addrlist::n_v4_addrs
uint32_t n_v4_addrs
Number of IPv4 addresses.
Definition: scap.h:420
scap_fdinfo::@0::@4::port
uint16_t port
Local Port.
Definition: scap.h:192
scap_threadinfo::args_len
uint16_t args_len
Command line arguments length.
Definition: scap.h:227
SCAP_FD_FIFO
@ SCAP_FD_FIFO
Definition: scap.h:132
scap_get_memorydumper_curpos
uint8_t * scap_get_memorydumper_curpos(scap_dumper_t *d)
scap_machine_info
struct _scap_machine_info scap_machine_info
Machine information.
SCAP_FD_DIRECTORY
@ SCAP_FD_DIRECTORY
Definition: scap.h:127
scap_userlist::ngroups
uint32_t ngroups
Number of groups.
Definition: scap.h:458
MAX_CREDENTIALS_STR_LEN
#define MAX_CREDENTIALS_STR_LEN
Definition: scap.h:427
scap_open_offline_fd
scap_t * scap_open_offline_fd(int fd, char *error, int32_t *rc)
Start an event capture from an already opened file descriptor.
ppm_syscall_desc::category
enum ppm_event_category category
Definition: scap.h:515
scap_get_bpf_probe_from_env
const char * scap_get_bpf_probe_from_env()
scap_threadinfo::fdlimit
int64_t fdlimit
The maximum number of files this thread is allowed to open.
Definition: scap.h:231
scap_disable_dynamic_snaplen
int32_t scap_disable_dynamic_snaplen(scap_t *handle)
SCAP_L4_TCP
@ SCAP_L4_TCP
Definition: scap.h:151
scap_userinfo::name
char name[MAX_CREDENTIALS_STR_LEN]
Username.
Definition: scap.h:438
scap_fdinfo::info
union scap_fdinfo::@0 info
scap_event_get_dump_flags
uint32_t scap_event_get_dump_flags(scap_t *handle)
Return the dump flags for the last event received from this handle.
scap_ifinfo_ipv6
IPv6 interface address information.
Definition: scap.h:384
scap_threadinfo::uid
uint32_t uid
user id
Definition: scap.h:233
scap_userlist::groups
scap_groupinfo * groups
Group list.
Definition: scap.h:461
scap_fdinfo::sip
uint32_t sip
Source IP.
Definition: scap.h:169
scap_fdinfo::@0::@2::dport
uint16_t dport
Destination Port.
Definition: scap.h:180
_scap_machine_info::num_cpus
uint32_t num_cpus
Number of processors.
Definition: scap.h:328
OUT
#define OUT
Definition: scap.h:527
scap_ifinfo_ipv4_nolinkspeed::netmask
uint32_t netmask
Definition: scap.h:376
scap_stats
Statistics about an in progress capture.
Definition: scap.h:90
SCAP_MAX_PATH_SIZE
#define SCAP_MAX_PATH_SIZE
Definition: scap.h:113
scap_stats::n_evts
uint64_t n_evts
Total number of events that were received by the driver.
Definition: scap.h:92
scap_threadinfo::pfminor
uint64_t pfminor
number of minor page faults since start
Definition: scap.h:239
scap_ifinfo_ipv6_nolinkspeed::ifname
char ifname[SCAP_MAX_PATH_SIZE]
Definition: scap.h:406
scap_threadinfo::pfmajor
uint64_t pfmajor
number of major page faults since start
Definition: scap.h:238
scap_dump_flags
scap_dump_flags
Flags for scap_dump.
Definition: scap.h:501
scap_threadinfo::vmsize_kb
uint32_t vmsize_kb
total virtual memory (as kb)
Definition: scap.h:235
SCAP_FD_UNKNOWN
@ SCAP_FD_UNKNOWN
Definition: scap.h:125
scap_start_capture
int32_t scap_start_capture(scap_t *handle)
Start capture the events, if it was stopped with scap_stop_capture.
scap_fdinfo::unix_socket_info
struct scap_fdinfo::@0::@5 unix_socket_info
Information specific to unix sockets.
scap_event_get_ts
uint64_t scap_event_get_ts(scap_evt *e)
Get the timestamp of an event.
SCAP_FD_IPV6_SOCK
@ SCAP_FD_IPV6_SOCK
Definition: scap.h:129
SCAP_MODE_LIVE
@ SCAP_MODE_LIVE
Definition: scap.h:285
scap_write_proc_fds
int32_t scap_write_proc_fds(scap_t *handle, struct scap_threadinfo *tinfo, scap_dumper_t *d)
scap_ifinfo_ipv4::ifnamelen
uint16_t ifnamelen
Definition: scap.h:360
scap_dump_close
void scap_dump_close(scap_dumper_t *d)
Close a trace file.
scap_max_buf_used
uint64_t scap_max_buf_used(scap_t *handle)
returns the maximum amount of memory used by any driver queue
scap_open_args::import_users
bool import_users
true if the user list should be created when opening the capture.
Definition: scap.h:300
scap_enable_page_faults
int32_t scap_enable_page_faults(scap_t *handle)
SCAP_FD_UNSUPPORTED
@ SCAP_FD_UNSUPPORTED
Definition: scap.h:135
compression_mode
compression_mode
Indicates the compression type used when writing a tracefile.
Definition: scap.h:492
SCAP_L4_UDP
@ SCAP_L4_UDP
Definition: scap.h:152
scap_ifinfo_ipv6
struct scap_ifinfo_ipv6 scap_ifinfo_ipv6
IPv6 interface address information.
scap_open_args::proc_callback_context
void * proc_callback_context
Opaque pointer that will be included in the calls to proc_callback. Ignored if proc_callback is NULL.
Definition: scap.h:299
scap_dev_delete
void scap_dev_delete(scap_t *handle, scap_mountinfo *dev)
scap_event_getinfo
const struct ppm_event_info * scap_event_getinfo(scap_evt *e)
Return the meta-information describing the given event.
scap_check_suppressed_tid
bool scap_check_suppressed_tid(scap_t *handle, int64_t tid)
return whether the provided tid is currently being suppressed.
scap_get_readfile_offset
int64_t scap_get_readfile_offset(scap_t *handle)
Return the current offset in the file opened by scap_open_offline(), or -1 if this is a live capture.
SCAP_DF_NONE
@ SCAP_DF_NONE
Definition: scap.h:503
scap_ftell
uint64_t scap_ftell(scap_t *handle)
SCAP_FD_NETLINK
@ SCAP_FD_NETLINK
Definition: scap.h:140
scap_stats::n_drops
uint64_t n_drops
Number of dropped events.
Definition: scap.h:93
udig_alloc_ring
int32_t udig_alloc_ring(int *ring_fd, uint8_t **ring, uint32_t *ringsize, char *error)
scap_fdinfo::@0::@5::destination
uint64_t destination
Destination socket endpoint.
Definition: scap.h:198
scap_get_threadlist
struct ppm_proclist_info * scap_get_threadlist(scap_t *handle)
Get the process list.
scap_open_args::fname
const char * fname
The name of the file to open. NULL for live captures.
Definition: scap.h:297
scap_fdinfo::@0::@2::l4proto
uint8_t l4proto
Transport protocol. See scap_l4_proto.
Definition: scap.h:181
scap_ifinfo_ipv4::ifname
char ifname[SCAP_MAX_PATH_SIZE]
interface name (e.g. "eth0")
Definition: scap.h:365
scap_get_ifaddr_list
scap_addrlist * scap_get_ifaddr_list(scap_t *handle)
Return the list of the the user interfaces of the machine from which the events are being captured.
scap_number_of_bytes_to_write
int32_t scap_number_of_bytes_to_write(scap_evt *e, uint16_t cpuid, int32_t *bytes)
Tell how many bytes would be written (a dry run of scap_dump)
SCAP_FD_IPV6_SERVSOCK
@ SCAP_FD_IPV6_SERVSOCK
Definition: scap.h:131
SCAP_PFORM_UNKNOWN
@ SCAP_PFORM_UNKNOWN
Definition: scap.h:473
scap_set_eventmask
int32_t scap_set_eventmask(scap_t *handle, uint32_t event_id)
Set the event into the eventmask so that sysdig-based apps can receive the event. Useful for offloadi...
scap_threadinfo::args
char args[SCAP_MAX_ARGS_SIZE+1]
Command line arguments (e.g. "-d1")
Definition: scap.h:226
scap_ifinfo_ipv4::addr
uint32_t addr
Interface address.
Definition: scap.h:361
scap_getpid_global
int32_t scap_getpid_global(scap_t *handle, int64_t *pid)
scap_threadinfo::gid
uint32_t gid
group id
Definition: scap.h:234
scap_userlist::users
scap_userinfo * users
User list.
Definition: scap.h:460
SCAP_L4_NA
@ SCAP_L4_NA
protocol not available, because the fd is not a socket
Definition: scap.h:150
SCAP_COMPRESSION_GZIP
@ SCAP_COMPRESSION_GZIP
Definition: scap.h:495
scap_threadinfo
Process information.
Definition: scap.h:216
scap_write_proclist_header
int32_t scap_write_proclist_header(scap_t *handle, scap_dumper_t *d, uint32_t totlen)
scap_write_proclist_trailer
int32_t scap_write_proclist_trailer(scap_t *handle, scap_dumper_t *d, uint32_t totlen)
SCAP_II_UNKNOWN
@ SCAP_II_UNKNOWN
Definition: scap.h:346
scap_enable_dynamic_snaplen
int32_t scap_enable_dynamic_snaplen(scap_t *handle)
SCAP_FD_EVENTPOLL
@ SCAP_FD_EVENTPOLL
Definition: scap.h:137
scap_proc_alloc
struct scap_threadinfo * scap_proc_alloc(scap_t *handle)
scap_set_fullcapture_port_range
int32_t scap_set_fullcapture_port_range(scap_t *handle, uint16_t range_start, uint16_t range_end)
scap_ifinfo_ipv6_nolinkspeed
struct scap_ifinfo_ipv6_nolinkspeed scap_ifinfo_ipv6_nolinkspeed
For backword compatibility only.
scap_threadinfo
struct scap_threadinfo scap_threadinfo
Process information.
evt_param_info
struct evt_param_info evt_param_info
Information about the parameter of an event.
scap_open_args::proc_callback
proc_entry_callback proc_callback
Callback to be invoked for each thread/fd that is extracted from /proc, or NULL if no callback is nee...
Definition: scap.h:298
SCAP_MODE_NONE
@ SCAP_MODE_NONE
Definition: scap.h:277
scap_ifinfo_ipv6_nolinkspeed::netmask
char netmask[SCAP_IPV6_ADDR_LEN]
Definition: scap.h:404
scap_unset_eventmask
int32_t scap_unset_eventmask(scap_t *handle, uint32_t event_id)
Unset the event into the eventmask so that sysdig-based apps can no longer receive the event....
udig_alloc_ring_descriptors
int32_t udig_alloc_ring_descriptors(int *ring_descs_fd, struct ppm_ring_buffer_info **ring_info, struct udig_ring_buffer_status **ring_status, char *error)
SCAP_MODE_CAPTURE
@ SCAP_MODE_CAPTURE
Definition: scap.h:281
scap_fdinfo::ip
uint32_t ip
Local IP.
Definition: scap.h:185
scap_open_args::bpf_probe
const char * bpf_probe
The name of the BPF probe to open. If NULL, the kernel driver will be used.
Definition: scap.h:302
scap_ifinfo_ipv6::bcast
char bcast[SCAP_IPV6_ADDR_LEN]
Interface broadcast address.
Definition: scap.h:391
scap_readbuf
int32_t scap_readbuf(scap_t *handle, uint32_t cpuid, OUT char **buf, OUT uint32_t *len)
scap_event_get_num
uint64_t scap_event_get_num(scap_t *handle)
Get the number of events that have been captured from the given capture instance.
SCAP_PFORM_WINDOWS_I386
@ SCAP_PFORM_WINDOWS_I386
Definition: scap.h:476
scap_dump_ftell
int64_t scap_dump_ftell(scap_dumper_t *d)
Return the position for the next write to a trace file. This uses gztell, while scap_dump_get_offset ...
scap_threadinfo::loginuid
int32_t loginuid
loginuid (auid)
Definition: scap.h:249
scap_addrlist
List of the machine network interfaces.
Definition: scap.h:418
scap_threadinfo::exepath
char exepath[SCAP_MAX_PATH_SIZE+1]
full executable path
Definition: scap.h:225
ppm_ring_buffer_info
struct ppm_ring_buffer_info ppm_ring_buffer_info
Definition: scap.h:547
ppm_syscall_desc::name
char * name
Definition: scap.h:517
SCAP_DF_STATE_ONLY
@ SCAP_DF_STATE_ONLY
Definition: scap.h:504
scap_dump_flush
void scap_dump_flush(scap_dumper_t *d)
Flush all pending output into the file.
scap_dumper_t
struct scap_dumper scap_dumper_t
Definition: scap.h:509
scap_fdinfo::fname
char fname[SCAP_MAX_PATH_SIZE]
Name associated to this unix socket.
Definition: scap.h:199
scap_userlist
List of the machine users and groups.
Definition: scap.h:455
scap_get_unexpected_block_readsize
uint64_t scap_get_unexpected_block_readsize(scap_t *handle)
SCAP_II_IPV4
@ SCAP_II_IPV4
Definition: scap.h:347
scap_l4_proto
scap_l4_proto
Socket type / transport protocol.
Definition: scap.h:147
scap_mode_t
scap_mode_t
Arguments for scap_open.
Definition: scap.h:272
scap_threadinfo::vmrss_kb
uint32_t vmrss_kb
resident non-swapped memory (as kb)
Definition: scap.h:236
scap_ifinfo_ipv4::netmask
uint32_t netmask
Interface netmask.
Definition: scap.h:362
scap_ifinfo_ipv4::bcast
uint32_t bcast
Interface broadcast address.
Definition: scap.h:363
scap_fdinfo::@0::@1::l4proto
uint8_t l4proto
Transport protocol. See scap_l4_proto.
Definition: scap.h:173
scap_fdinfo::ipv4serverinfo
struct scap_fdinfo::@0::@3 ipv4serverinfo
Information specific to IPv4 server sockets, e.g. sockets used for bind().
scap_event_getlen
uint32_t scap_event_getlen(scap_evt *e)
Get the length of an event.
scap_ifinfo_ipv4
struct scap_ifinfo_ipv4 scap_ifinfo_ipv4
IPv4 interface address information.
scap_fdinfo
struct scap_fdinfo scap_fdinfo
Information about a file descriptor.
scap_ifinfo_ipv4_nolinkspeed::ifnamelen
uint16_t ifnamelen
Definition: scap.h:374
SCAP_ED_IN
@ SCAP_ED_IN
Definition: scap.h:485
scap_addrlist::n_v6_addrs
uint32_t n_v6_addrs
Number of IPv6 addresses.
Definition: scap.h:421
evt_param_info::val
char * val
The event data.
Definition: scap.h:110
scap_userlist::totsavelen
uint32_t totsavelen
For internal use.
Definition: scap.h:459
scap_open_args
struct scap_open_args scap_open_args
SCAP_FD_UNIX_SOCK
@ SCAP_FD_UNIX_SOCK
Definition: scap.h:133
scap_mountinfo::hh
UT_hash_handle hh
makes this structure hashable
Definition: scap.h:260
proc_entry_callback
void(* proc_entry_callback)(void *context, scap_t *handle, int64_t tid, scap_threadinfo *tinfo, scap_fdinfo *fdinfo)
Definition: scap.h:263
scap_mountinfo::dev
uint32_t dev
device number
Definition: scap.h:259
_scap_machine_info
Machine information.
Definition: scap.h:326
udig_ring_buffer_status::m_last_print_time
volatile struct timespec m_last_print_time
Definition: scap.h:542
SCAP_FD_UNINITIALIZED
@ SCAP_FD_UNINITIALIZED
Definition: scap.h:124
SCAP_PFORM_WINDOWS_X64
@ SCAP_PFORM_WINDOWS_X64
Definition: scap.h:477
scap_set_snaplen
int32_t scap_set_snaplen(scap_t *handle, uint32_t snaplen)
Set the capture snaplen, i.e. the maximum size an event parameter can reach before the driver starts ...
scap_threadinfo::vpgid
uint64_t vpgid
The process group of this thread, as seen from its current pid namespace.
Definition: scap.h:222
ppm_syscall_desc
System call description struct.
Definition: scap.h:514
scap_threadinfo::env_len
uint16_t env_len
Environment length.
Definition: scap.h:229
SCAP_II_IPV4_NOLINKSPEED
@ SCAP_II_IPV4_NOLINKSPEED
Definition: scap.h:349
scap_ifinfo_ipv4_nolinkspeed
struct scap_ifinfo_ipv4_nolinkspeed scap_ifinfo_ipv4_nolinkspeed
For backward compatibility only.
scap_set_refresh_proc_table_when_saving
void scap_set_refresh_proc_table_when_saving(scap_t *handle, bool refresh)
SCAP_FD_FILE
@ SCAP_FD_FILE
Definition: scap.h:126
udig_free_ring_descriptors
void udig_free_ring_descriptors(uint8_t *addr)
scap_fdinfo::fd
int64_t fd
The FD number, which uniquely identifies this file descriptor.
Definition: scap.h:162
scap_proc_get
struct scap_threadinfo * scap_proc_get(scap_t *handle, int64_t tid, bool scan_sockets)
scap_addrlist::v4list
scap_ifinfo_ipv4 * v4list
List of IPv4 Addresses.
Definition: scap.h:423
scap_userinfo::homedir
char homedir[SCAP_MAX_PATH_SIZE]
Home directory.
Definition: scap.h:439
SCAP_FD_IPV4_SOCK
@ SCAP_FD_IPV4_SOCK
Definition: scap.h:128
SCAP_PFORM_LINUX_I386
@ SCAP_PFORM_LINUX_I386
Definition: scap.h:474
SCAP_MODE_NODRIVER
@ SCAP_MODE_NODRIVER
Definition: scap.h:290
udig_ring_buffer_status::m_initialized
volatile int m_initialized
Definition: scap.h:539
scap_set_statsd_port
int32_t scap_set_statsd_port(scap_t *handle, uint16_t port)
scap_fdinfo::regularinfo
struct scap_fdinfo::@0::@6 regularinfo
Information specific to regular files.
scap_threadinfo::flags
uint32_t flags
the process flags.
Definition: scap.h:232
SCAP_FD_IPV4_SERVSOCK
@ SCAP_FD_IPV4_SERVSOCK
Definition: scap.h:130
_scap_machine_info::reserved1
uint64_t reserved1
reserved for future use
Definition: scap.h:332
SCAP_L4_RAW
@ SCAP_L4_RAW
Raw socket.
Definition: scap.h:154
scap_mountinfo::mount_id
uint64_t mount_id
mount id from /proc/self/mountinfo
Definition: scap.h:258
scap_fdinfo::@0::@3::l4proto
uint8_t l4proto
Transport protocol. See scap_l4_proto.
Definition: scap.h:187
SCAP_FD_TIMERFD
@ SCAP_FD_TIMERFD
Definition: scap.h:139
scap_write_proclist_entry
int32_t scap_write_proclist_entry(scap_t *handle, scap_dumper_t *d, struct scap_threadinfo *tinfo, uint32_t len)
scap_get_host_root
const char * scap_get_host_root()
Get the root directory of the system. This usually changes if sysdig runs in a container,...
SCAP_PFORM_LINUX_X64
@ SCAP_PFORM_LINUX_X64
Definition: scap.h:475
SCAP_II_IPV6
@ SCAP_II_IPV6
Definition: scap.h:348
scap_refresh_iflist
void scap_refresh_iflist(scap_t *handle)
scap_os_platform
scap_os_platform
The OS on which the capture was made.
Definition: scap.h:471
scap_ifinfo_ipv6::ifname
char ifname[SCAP_MAX_PATH_SIZE]
interface name (e.g. "eth0")
Definition: scap.h:393
scap_fdinfo::ipv6info
struct scap_fdinfo::@0::@2 ipv6info
Information specific to IPv6 sockets.
scap_threadinfo::filtered_out
int filtered_out
nonzero if this entry should not be saved to file
Definition: scap.h:245
SCAP_FD_SIGNALFD
@ SCAP_FD_SIGNALFD
Definition: scap.h:136
scap_userinfo::gid
uint32_t gid
Group ID.
Definition: scap.h:437
udig_ring_buffer_status::m_stopped
volatile int m_stopped
Definition: scap.h:541
scap_mountinfo
Mount information.
Definition: scap.h:257
SCAP_L4_UNKNOWN
@ SCAP_L4_UNKNOWN
unknown protocol, likely caused by some parsing problem
Definition: scap.h:149
scap_open_args::mode
scap_mode_t mode
Definition: scap.h:295
scap_write_proclist_entry_bufs
int32_t scap_write_proclist_entry_bufs(scap_t *handle, scap_dumper_t *d, struct scap_threadinfo *tinfo, uint32_t len, const char *comm, const char *exe, const char *exepath, const struct iovec *args, int argscnt, const struct iovec *envs, int envscnt, const char *cwd, const struct iovec *cgroups, int cgroupscnt, const char *root)
scap_open
scap_t * scap_open(scap_open_args args, char *error, int32_t *rc)
Advanced function to start a capture.
scap_clear_eventmask
int32_t scap_clear_eventmask(scap_t *handle)
Clear the event mask: no events will be passed to sysdig.
scap_get_proc_table
scap_threadinfo * scap_get_proc_table(scap_t *handle)
Get the process list for the given capture instance.
_scap_machine_info::hostname
char hostname[128]
The machine hostname.
Definition: scap.h:331
evt_param_info
Information about the parameter of an event.
Definition: scap.h:105
scap_addrlist
struct scap_addrlist scap_addrlist
List of the machine network interfaces.
scap_userinfo
Information about one of the machine users.
Definition: scap.h:434
scap_threadinfo::tid
uint64_t tid
The thread/task id.
Definition: scap.h:218
scap_userinfo
struct scap_userinfo scap_userinfo
Information about one of the machine users.
scap_ifinfo_ipv4_nolinkspeed::ifname
char ifname[SCAP_MAX_PATH_SIZE]
Definition: scap.h:378
SCAP_MAX_CGROUPS_SIZE
#define SCAP_MAX_CGROUPS_SIZE
Definition: scap.h:116
_scap_machine_info::memory_size_bytes
uint64_t memory_size_bytes
Physical memory size.
Definition: scap.h:329
scap_ifinfo_ipv6::type
uint16_t type
Definition: scap.h:387
scap_open_live
scap_t * scap_open_live(char *error, int32_t *rc)
Start a live event capture.
scap_ifinfo_ipv4::type
uint16_t type
Interface type.
Definition: scap.h:359
scap_groupinfo
struct scap_groupinfo scap_groupinfo
Information about one of the machine user groups.
scap_dump_get_offset
int64_t scap_dump_get_offset(scap_dumper_t *d)
Return the current size of a trace file.
scap_ifinfo_type
scap_ifinfo_type
Interface address type.
Definition: scap.h:344
scap_ifinfo_ipv4::linkspeed
uint64_t linkspeed
Interface link speed.
Definition: scap.h:364
scap_userlist
struct scap_userlist scap_userlist
List of the machine users and groups.
scap_fdinfo::@0::@6::dev
uint32_t dev
Major/minor number of the device containing this file.
Definition: scap.h:206
scap_event_reset_count
void scap_event_reset_count(scap_t *handle)
Reset the event count to 0.
scap_addrlist::totlen
uint32_t totlen
For internal use.
Definition: scap.h:422
scap_fdinfo::@0::@1::sport
uint16_t sport
Source port.
Definition: scap.h:171
SCAP_MAX_ENV_SIZE
#define SCAP_MAX_ENV_SIZE
Definition: scap.h:115
scap_ifinfo_ipv6_nolinkspeed::bcast
char bcast[SCAP_IPV6_ADDR_LEN]
Definition: scap.h:405
scap_stop_capture
int32_t scap_stop_capture(scap_t *handle)
This function can be used to temporarily interrupt event capture.
evt_param_info::type
uint32_t type
The event type. See the ppm_event_type enum in driver/ppm_events_public.h.
Definition: scap.h:108
scap_dump_open
scap_dumper_t * scap_dump_open(scap_t *handle, const char *fname, compression_mode compress, bool skip_proc_scan)
Open a trace file for writing.
_scap_machine_info::max_pid
uint64_t max_pid
Highest PID number on this machine.
Definition: scap.h:330
scap_addrlist::v6list
scap_ifinfo_ipv6 * v6list
List of IPv6 Addresses.
Definition: scap.h:424
scap_fd_type
scap_fd_type
File Descriptor type.
Definition: scap.h:122
SCAP_FD_EVENT
@ SCAP_FD_EVENT
Definition: scap.h:134
scap_ifinfo_ipv4
IPv4 interface address information.
Definition: scap.h:356
scap_userinfo::shell
char shell[SCAP_MAX_PATH_SIZE]
Shell program.
Definition: scap.h:440
scap_stats::n_preemptions
uint64_t n_preemptions
Number of preemptions.
Definition: scap.h:97
_scap_machine_info::reserved4
uint64_t reserved4
reserved for future use
Definition: scap.h:335
scap_enable_simpledriver_mode
int32_t scap_enable_simpledriver_mode(scap_t *handle)
scap_fdinfo::@0::@6::mount_id
uint32_t mount_id
The id of the vfs mount the file is in until we find dev major:minor.
Definition: scap.h:205
scap_get_user_list
scap_userlist * scap_get_user_list(scap_t *handle)
Return the machine user and group lists.
scap_ifinfo_ipv4_nolinkspeed::bcast
uint32_t bcast
Definition: scap.h:377
scap_groupinfo
Information about one of the machine user groups.
Definition: scap.h:446
scap_dump
int32_t scap_dump(scap_t *handle, scap_dumper_t *d, scap_evt *e, uint16_t cpuid, uint32_t flags)
Write an event to a trace file.
scap_open_args::suppressed_comms
const char * suppressed_comms[SCAP_MAX_SUPPRESSED_COMMS]
A list of processes (comm) for which no.
Definition: scap.h:303
SCAP_FD_INOTIFY
@ SCAP_FD_INOTIFY
Definition: scap.h:138
scap_get_syscall_info_table
const struct ppm_syscall_desc * scap_get_syscall_info_table()
Retrieve the table with the description of system call that the capture driver supports.
scap_get_machine_info
const scap_machine_info * scap_get_machine_info(scap_t *handle)
Get generic machine information.
_scap_machine_info::reserved3
uint64_t reserved3
reserved for future use
Definition: scap.h:334
scap_threadinfo::tty
int32_t tty
Definition: scap.h:248
scap_open_args::udig
bool udig
If true, UDIG will be used for event capture. Otherwise, the kernel driver will be used.
Definition: scap.h:307
scap_fdinfo::ipv4info
struct scap_fdinfo::@0::@1 ipv4info
Information specific to IPv4 sockets.
scap_fdinfo::@0::@1::sip
uint32_t sip
Source IP.
Definition: scap.h:169
scap_threadinfo::vpid
int64_t vpid
Definition: scap.h:241
scap_dump_open_fd
scap_dumper_t * scap_dump_open_fd(scap_t *handle, int fd, compression_mode compress, bool skip_proc_scan)
Open a trace file for writing, using the provided fd.
scap_evt
struct ppm_evt_hdr scap_evt
Definition: scap.h:54
SCAP_MAX_SUPPRESSED_COMMS
#define SCAP_MAX_SUPPRESSED_COMMS
Definition: scap.h:117
scap_ifinfo_ipv6_nolinkspeed::type
uint16_t type
Definition: scap.h:401
scap_threadinfo::root
char root[SCAP_MAX_PATH_SIZE+1]
Definition: scap.h:244
scap_ifinfo_ipv6_nolinkspeed
For backword compatibility only.
Definition: scap.h:399
udig_free_ring
void udig_free_ring(uint8_t *addr, uint32_t size)
scap_userinfo::uid
uint32_t uid
User ID.
Definition: scap.h:436
scap_threadinfo::clone_ts
uint64_t clone_ts
Definition: scap.h:247
SCAP_FD_FILE_V2
@ SCAP_FD_FILE_V2
Definition: scap.h:141
scap_get_event_info_table
const struct ppm_event_info * scap_get_event_info_table()
Retrieve the table with the description of every event type that the capture driver supports.
scap_fdinfo::@0::@6::open_flags
uint32_t open_flags
Flags associated with the file.
Definition: scap.h:203
scap_fseek
void scap_fseek(scap_t *handle, uint64_t off)
scap_start_dropping_mode
int32_t scap_start_dropping_mode(scap_t *handle, uint32_t sampling_ratio)
udig_ring_buffer_status::m_buffer_lock
volatile uint64_t m_buffer_lock
Definition: scap.h:538
scap_ifinfo_ipv6_nolinkspeed::addr
char addr[SCAP_IPV6_ADDR_LEN]
Definition: scap.h:403
scap_fdinfo::@0::@5::source
uint64_t source
Source socket endpoint.
Definition: scap.h:197
scap_memory_dump_open
scap_dumper_t * scap_memory_dump_open(scap_t *handle, uint8_t *targetbuf, uint64_t targetbufsize)
scap_ifinfo_ipv4_nolinkspeed::addr
uint32_t addr
Definition: scap.h:375
scap_threadinfo::pid
uint64_t pid
The id of the process containing this thread. In single thread processes, this is equal to tid.
Definition: scap.h:219
scap_close
void scap_close(scap_t *handle)
Close a capture handle.
scap_proc_free
void scap_proc_free(scap_t *handle, struct scap_threadinfo *procinfo)
scap_get_os_platform
scap_os_platform scap_get_os_platform(scap_t *handle)
Retrieve the OS platform for the given capture handle.
scap_suppress_events_comm
int32_t scap_suppress_events_comm(scap_t *handle, const char *comm)
stop returning events for all subsequently spawned processes with the provided comm,...
evt_param_info::name
const char * name
The event name.
Definition: scap.h:107