libscap  0.1.0.0
Enumerator | Functions | Variables

Functions

scap_tscap_open_live (char *error, int32_t *rc)
 Start a live event capture. More...
 
scap_tscap_open_offline (const char *fname, char *error, int32_t *rc)
 Start an event capture from file. More...
 
scap_tscap_open_offline_fd (int fd, char *error, int32_t *rc)
 Start an event capture from an already opened file descriptor. More...
 
scap_tscap_open (scap_open_args args, char *error, int32_t *rc)
 Advanced function to start a capture. More...
 
void scap_close (scap_t *handle)
 Close a capture handle. More...
 
scap_os_platform scap_get_os_platform (scap_t *handle)
 Retrieve the OS platform for the given capture handle. More...
 
const char * scap_getlasterr (scap_t *handle)
 Return a string with the last error that happened on the given capture. More...
 
uint64_t scap_max_buf_used (scap_t *handle)
 returns the maximum amount of memory used by any driver queue More...
 
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. More...
 
uint32_t scap_event_getlen (scap_evt *e)
 Get the length of an event. More...
 
uint64_t scap_event_get_ts (scap_evt *e)
 Get the timestamp of an event. More...
 
uint64_t scap_event_get_num (scap_t *handle)
 Get the number of events that have been captured from the given capture instance. More...
 
void scap_event_reset_count (scap_t *handle)
 Reset the event count to 0. More...
 
const struct ppm_event_info * scap_event_getinfo (scap_evt *e)
 Return the meta-information describing the given event. More...
 
uint32_t scap_event_get_dump_flags (scap_t *handle)
 Return the dump flags for the last event received from this handle. More...
 
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. More...
 
scap_dumper_tscap_dump_open (scap_t *handle, const char *fname, compression_mode compress, bool skip_proc_scan)
 Open a trace file for writing. More...
 
scap_dumper_tscap_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. More...
 
void scap_dump_close (scap_dumper_t *d)
 Close a trace file. More...
 
int64_t scap_dump_get_offset (scap_dumper_t *d)
 Return the current size of a trace file. More...
 
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 uses gzoffset. More...
 
void scap_dump_flush (scap_dumper_t *d)
 Flush all pending output into the file. More...
 
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) More...
 
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. More...
 
scap_threadinfoscap_get_proc_table (scap_t *handle)
 Get the process list for the given capture instance. More...
 
int32_t scap_get_stats (scap_t *handle, OUT scap_stats *stats)
 Return the capture statistics for the given capture handle. More...
 
int32_t scap_stop_capture (scap_t *handle)
 This function can be used to temporarily interrupt event capture. More...
 
int32_t scap_start_capture (scap_t *handle)
 Start capture the events, if it was stopped with scap_stop_capture. More...
 
scap_addrlistscap_get_ifaddr_list (scap_t *handle)
 Return the list of the the user interfaces of the machine from which the events are being captured. More...
 
scap_userlistscap_get_user_list (scap_t *handle)
 Return the machine user and group lists. More...
 
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. More...
 
const struct ppm_syscall_descscap_get_syscall_info_table ()
 Retrieve the table with the description of system call that the capture driver supports. More...
 
const scap_machine_infoscap_get_machine_info (scap_t *handle)
 Get generic machine information. More...
 
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 truncating it. More...
 
int32_t scap_clear_eventmask (scap_t *handle)
 Clear the event mask: no events will be passed to sysdig. More...
 
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 offloading operations such as evt.type=open. More...
 
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. It is the opposite of scap_set_eventmask. More...
 
const char * scap_get_host_root ()
 Get the root directory of the system. This usually changes if sysdig runs in a container, so that all the information for the host can be correctly extracted. More...
 
struct ppm_proclist_info * scap_get_threadlist (scap_t *handle)
 Get the process list. More...
 
const char * scap_get_bpf_probe_from_env ()
 
bool scap_get_bpf_enabled (scap_t *handle)
 
int32_t scap_suppress_events_comm (scap_t *handle, const char *comm)
 stop returning events for all subsequently spawned processes with the provided comm, as well as their children. This includes fork()/clone()ed processes that might later exec to a different comm. More...
 
bool scap_check_suppressed_tid (scap_t *handle, int64_t tid)
 return whether the provided tid is currently being suppressed. More...
 
uint32_t scap_get_ndevs (scap_t *handle)
 
int32_t scap_readbuf (scap_t *handle, uint32_t cpuid, OUT char **buf, OUT uint32_t *len)
 
struct scap_threadinfoscap_proc_get (scap_t *handle, int64_t tid, bool scan_sockets)
 
bool scap_is_thread_alive (scap_t *handle, int64_t pid, int64_t tid, const char *comm)
 
int32_t scap_getpid_global (scap_t *handle, int64_t *pid)
 
struct scap_threadinfoscap_proc_alloc (scap_t *handle)
 
void scap_proc_free (scap_t *handle, struct scap_threadinfo *procinfo)
 
void scap_dev_delete (scap_t *handle, scap_mountinfo *dev)
 
int32_t scap_stop_dropping_mode (scap_t *handle)
 
int32_t scap_start_dropping_mode (scap_t *handle, uint32_t sampling_ratio)
 
int32_t scap_enable_dynamic_snaplen (scap_t *handle)
 
int32_t scap_disable_dynamic_snaplen (scap_t *handle)
 
void scap_proc_free_table (scap_t *handle)
 
void scap_free_device_table (scap_t *handle)
 
void scap_refresh_iflist (scap_t *handle)
 
void scap_refresh_proc_table (scap_t *handle)
 
void scap_set_refresh_proc_table_when_saving (scap_t *handle, bool refresh)
 
uint64_t scap_ftell (scap_t *handle)
 
void scap_fseek (scap_t *handle, uint64_t off)
 
int32_t scap_enable_tracers_capture (scap_t *handle)
 
int32_t scap_enable_page_faults (scap_t *handle)
 
uint64_t scap_get_unexpected_block_readsize (scap_t *handle)
 
int32_t scap_proc_add (scap_t *handle, uint64_t tid, scap_threadinfo *tinfo)
 
int32_t scap_fd_add (scap_t *handle, scap_threadinfo *tinfo, uint64_t fd, scap_fdinfo *fdinfo)
 
scap_dumper_tscap_memory_dump_open (scap_t *handle, uint8_t *targetbuf, uint64_t targetbufsize)
 
uint8_t * scap_get_memorydumper_curpos (scap_dumper_t *d)
 
int32_t scap_write_proc_fds (scap_t *handle, struct scap_threadinfo *tinfo, scap_dumper_t *d)
 
int32_t scap_write_proclist_header (scap_t *handle, scap_dumper_t *d, uint32_t totlen)
 
int32_t scap_write_proclist_trailer (scap_t *handle, scap_dumper_t *d, uint32_t totlen)
 
int32_t scap_write_proclist_entry (scap_t *handle, scap_dumper_t *d, struct scap_threadinfo *tinfo, uint32_t len)
 
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)
 
int32_t scap_enable_simpledriver_mode (scap_t *handle)
 
int32_t scap_get_n_tracepoint_hit (scap_t *handle, long *ret)
 
int32_t scap_set_fullcapture_port_range (scap_t *handle, uint16_t range_start, uint16_t range_end)
 
int32_t scap_set_statsd_port (scap_t *handle, uint16_t port)
 

Variables

uint64_t scap_stats::n_evts
 Total number of events that were received by the driver. More...
 
uint64_t scap_stats::n_drops
 Number of dropped events. More...
 
uint64_t scap_stats::n_drops_buffer
 Number of dropped events caused by full buffer. More...
 
uint64_t scap_stats::n_drops_pf
 Number of dropped events caused by invalid memory access. More...
 
uint64_t scap_stats::n_drops_bug
 Number of dropped events caused by an invalid condition in the kernel instrumentation. More...
 
uint64_t scap_stats::n_preemptions
 Number of preemptions. More...
 
uint64_t scap_stats::n_suppressed
 Number of events skipped due to the tid being in a set of suppressed tids. More...
 
uint64_t scap_stats::n_tids_suppressed
 Number of threads currently being suppressed. More...
 
const char * evt_param_info::name
 The event name. More...
 
uint32_t evt_param_info::type
 The event type. See the ppm_event_type enum in driver/ppm_events_public.h. More...
 
uint32_t evt_param_info::len
 The event total length. More...
 
char * evt_param_info::val
 The event data. More...
 
int64_t scap_fdinfo::fd
 The FD number, which uniquely identifies this file descriptor. More...
 
uint64_t scap_fdinfo::ino
 For unix sockets, the inode. More...
 
scap_fd_type scap_fdinfo::type
 This file descriptor's type. More...
 
uint32_t   scap_fdinfo::sip
 Source IP. More...
 
uint32_t   scap_fdinfo::dip
 Destination IP. More...
 
uint16_t   scap_fdinfo::sport
 Source port. More...
 
uint16_t   scap_fdinfo::dport
 Destination port. More...
 
uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
struct {
   uint32_t   scap_fdinfo::sip
 Source IP. More...
 
   uint32_t   scap_fdinfo::dip
 Destination IP. More...
 
   uint16_t   scap_fdinfo::sport
 Source port. More...
 
   uint16_t   scap_fdinfo::dport
 Destination port. More...
 
   uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
}   scap_fdinfo::ipv4info
 Information specific to IPv4 sockets. More...
 
uint32_t   scap_fdinfo::sip [4]
 Source IP. More...
 
uint32_t   scap_fdinfo::dip [4]
 Destination IP. More...
 
uint16_t   scap_fdinfo::sport
 Source Port. More...
 
uint16_t   scap_fdinfo::dport
 Destination Port. More...
 
uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
struct {
   uint32_t   scap_fdinfo::sip [4]
 Source IP. More...
 
   uint32_t   scap_fdinfo::dip [4]
 Destination IP. More...
 
   uint16_t   scap_fdinfo::sport
 Source Port. More...
 
   uint16_t   scap_fdinfo::dport
 Destination Port. More...
 
   uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
}   scap_fdinfo::ipv6info
 Information specific to IPv6 sockets. More...
 
uint32_t   scap_fdinfo::ip
 Local IP. More...
 
uint16_t   scap_fdinfo::port
 Local Port. More...
 
uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
struct {
   uint32_t   scap_fdinfo::ip
 Local IP. More...
 
   uint16_t   scap_fdinfo::port
 Local Port. More...
 
   uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
}   scap_fdinfo::ipv4serverinfo
 Information specific to IPv4 server sockets, e.g. sockets used for bind(). More...
 
uint32_t   scap_fdinfo::ip [4]
 Local IP. More...
 
uint16_t   scap_fdinfo::port
 Local Port. More...
 
uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
struct {
   uint32_t   scap_fdinfo::ip [4]
 Local IP. More...
 
   uint16_t   scap_fdinfo::port
 Local Port. More...
 
   uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
}   scap_fdinfo::ipv6serverinfo
 Information specific to IPv6 server sockets, e.g. sockets used for bind(). More...
 
uint64_t   scap_fdinfo::source
 Source socket endpoint. More...
 
uint64_t   scap_fdinfo::destination
 Destination socket endpoint. More...
 
char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 Name associated to this unix socket. More...
 
struct {
   uint64_t   scap_fdinfo::source
 Source socket endpoint. More...
 
   uint64_t   scap_fdinfo::destination
 Destination socket endpoint. More...
 
   char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 Name associated to this unix socket. More...
 
}   scap_fdinfo::unix_socket_info
 Information specific to unix sockets. More...
 
uint32_t   scap_fdinfo::open_flags
 Flags associated with the file. More...
 
char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 Name associated to this file. More...
 
uint32_t   scap_fdinfo::mount_id
 The id of the vfs mount the file is in until we find dev major:minor. More...
 
uint32_t   scap_fdinfo::dev
 Major/minor number of the device containing this file. More...
 
struct {
   uint32_t   scap_fdinfo::open_flags
 Flags associated with the file. More...
 
   char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 Name associated to this file. More...
 
   uint32_t   scap_fdinfo::mount_id
 The id of the vfs mount the file is in until we find dev major:minor. More...
 
   uint32_t   scap_fdinfo::dev
 Major/minor number of the device containing this file. More...
 
}   scap_fdinfo::regularinfo
 Information specific to regular files. More...
 
char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 The name for file system FDs. More...
 
union {
   struct {
      uint32_t   scap_fdinfo::sip
 Source IP. More...
 
      uint32_t   scap_fdinfo::dip
 Destination IP. More...
 
      uint16_t   scap_fdinfo::sport
 Source port. More...
 
      uint16_t   scap_fdinfo::dport
 Destination port. More...
 
      uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
   }   scap_fdinfo::ipv4info
 Information specific to IPv4 sockets. More...
 
   struct {
      uint32_t   scap_fdinfo::sip [4]
 Source IP. More...
 
      uint32_t   scap_fdinfo::dip [4]
 Destination IP. More...
 
      uint16_t   scap_fdinfo::sport
 Source Port. More...
 
      uint16_t   scap_fdinfo::dport
 Destination Port. More...
 
      uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
   }   scap_fdinfo::ipv6info
 Information specific to IPv6 sockets. More...
 
   struct {
      uint32_t   scap_fdinfo::ip
 Local IP. More...
 
      uint16_t   scap_fdinfo::port
 Local Port. More...
 
      uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
   }   scap_fdinfo::ipv4serverinfo
 Information specific to IPv4 server sockets, e.g. sockets used for bind(). More...
 
   struct {
      uint32_t   scap_fdinfo::ip [4]
 Local IP. More...
 
      uint16_t   scap_fdinfo::port
 Local Port. More...
 
      uint8_t   scap_fdinfo::l4proto
 Transport protocol. See scap_l4_proto. More...
 
   }   scap_fdinfo::ipv6serverinfo
 Information specific to IPv6 server sockets, e.g. sockets used for bind(). More...
 
   struct {
      uint64_t   scap_fdinfo::source
 Source socket endpoint. More...
 
      uint64_t   scap_fdinfo::destination
 Destination socket endpoint. More...
 
      char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 Name associated to this unix socket. More...
 
   }   scap_fdinfo::unix_socket_info
 Information specific to unix sockets. More...
 
   struct {
      uint32_t   scap_fdinfo::open_flags
 Flags associated with the file. More...
 
      char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 Name associated to this file. More...
 
      uint32_t   scap_fdinfo::mount_id
 The id of the vfs mount the file is in until we find dev major:minor. More...
 
      uint32_t   scap_fdinfo::dev
 Major/minor number of the device containing this file. More...
 
   }   scap_fdinfo::regularinfo
 Information specific to regular files. More...
 
   char   scap_fdinfo::fname [SCAP_MAX_PATH_SIZE]
 The name for file system FDs. More...
 
scap_fdinfo::info
 
UT_hash_handle scap_fdinfo::hh
 makes this structure hashable More...
 
uint64_t scap_threadinfo::tid
 The thread/task id. More...
 
uint64_t scap_threadinfo::pid
 The id of the process containing this thread. In single thread processes, this is equal to tid. More...
 
uint64_t scap_threadinfo::ptid
 The id of the thread that created this thread. More...
 
uint64_t scap_threadinfo::sid
 The session id of the process containing this thread. More...
 
uint64_t scap_threadinfo::vpgid
 The process group of this thread, as seen from its current pid namespace. More...
 
char scap_threadinfo::comm [SCAP_MAX_PATH_SIZE+1]
 Command name (e.g. "top") More...
 
char scap_threadinfo::exe [SCAP_MAX_PATH_SIZE+1]
 argv0 More...
 
char scap_threadinfo::exepath [SCAP_MAX_PATH_SIZE+1]
 full executable path More...
 
char scap_threadinfo::args [SCAP_MAX_ARGS_SIZE+1]
 Command line arguments (e.g. "-d1") More...
 
uint16_t scap_threadinfo::args_len
 Command line arguments length. More...
 
char scap_threadinfo::env [SCAP_MAX_ENV_SIZE+1]
 Environment. More...
 
uint16_t scap_threadinfo::env_len
 Environment length. More...
 
char scap_threadinfo::cwd [SCAP_MAX_PATH_SIZE+1]
 The current working directory. More...
 
int64_t scap_threadinfo::fdlimit
 The maximum number of files this thread is allowed to open. More...
 
uint32_t scap_threadinfo::flags
 the process flags. More...
 
uint32_t scap_threadinfo::uid
 user id More...
 
uint32_t scap_threadinfo::gid
 group id More...
 
uint32_t scap_threadinfo::vmsize_kb
 total virtual memory (as kb) More...
 
uint32_t scap_threadinfo::vmrss_kb
 resident non-swapped memory (as kb) More...
 
uint32_t scap_threadinfo::vmswap_kb
 swapped memory (as kb) More...
 
uint64_t scap_threadinfo::pfmajor
 number of major page faults since start More...
 
uint64_t scap_threadinfo::pfminor
 number of minor page faults since start More...
 
int64_t scap_threadinfo::vtid
 
int64_t scap_threadinfo::vpid
 
char scap_threadinfo::cgroups [SCAP_MAX_CGROUPS_SIZE]
 
uint16_t scap_threadinfo::cgroups_len
 
char scap_threadinfo::root [SCAP_MAX_PATH_SIZE+1]
 
int scap_threadinfo::filtered_out
 nonzero if this entry should not be saved to file More...
 
scap_fdinfoscap_threadinfo::fdlist
 The fd table for this process. More...
 
uint64_t scap_threadinfo::clone_ts
 
int32_t scap_threadinfo::tty
 
int32_t scap_threadinfo::loginuid
 loginuid (auid) More...
 
UT_hash_handle scap_threadinfo::hh
 makes this structure hashable More...
 
uint64_t scap_mountinfo::mount_id
 mount id from /proc/self/mountinfo More...
 
uint32_t scap_mountinfo::dev
 device number More...
 
UT_hash_handle scap_mountinfo::hh
 makes this structure hashable More...
 
scap_mode_t scap_open_args::mode
 
int scap_open_args::fd
 
const char * scap_open_args::fname
 The name of the file to open. NULL for live captures. More...
 
proc_entry_callback scap_open_args::proc_callback
 Callback to be invoked for each thread/fd that is extracted from /proc, or NULL if no callback is needed. More...
 
void * scap_open_args::proc_callback_context
 Opaque pointer that will be included in the calls to proc_callback. Ignored if proc_callback is NULL. More...
 
bool scap_open_args::import_users
 true if the user list should be created when opening the capture. More...
 
uint64_t scap_open_args::start_offset
 Used to start reading a capture file from an arbitrary offset. This is leveraged when opening merged files. More...
 
const char * scap_open_args::bpf_probe
 The name of the BPF probe to open. If NULL, the kernel driver will be used. More...
 
const char * scap_open_args::suppressed_comms [SCAP_MAX_SUPPRESSED_COMMS]
 A list of processes (comm) for which no. More...
 
bool scap_open_args::udig
 If true, UDIG will be used for event capture. Otherwise, the kernel driver will be used. More...
 
uint32_t _scap_machine_info::num_cpus
 Number of processors. More...
 
uint64_t _scap_machine_info::memory_size_bytes
 Physical memory size. More...
 
uint64_t _scap_machine_info::max_pid
 Highest PID number on this machine. More...
 
char _scap_machine_info::hostname [128]
 The machine hostname. More...
 
uint64_t _scap_machine_info::reserved1
 reserved for future use More...
 
uint64_t _scap_machine_info::reserved2
 reserved for future use More...
 
uint64_t _scap_machine_info::reserved3
 reserved for future use More...
 
uint64_t _scap_machine_info::reserved4
 reserved for future use More...
 
uint16_t scap_ifinfo_ipv4::type
 Interface type. More...
 
uint16_t scap_ifinfo_ipv4::ifnamelen
 
uint32_t scap_ifinfo_ipv4::addr
 Interface address. More...
 
uint32_t scap_ifinfo_ipv4::netmask
 Interface netmask. More...
 
uint32_t scap_ifinfo_ipv4::bcast
 Interface broadcast address. More...
 
uint64_t scap_ifinfo_ipv4::linkspeed
 Interface link speed. More...
 
char scap_ifinfo_ipv4::ifname [SCAP_MAX_PATH_SIZE]
 interface name (e.g. "eth0") More...
 
uint16_t scap_ifinfo_ipv4_nolinkspeed::type
 
uint16_t scap_ifinfo_ipv4_nolinkspeed::ifnamelen
 
uint32_t scap_ifinfo_ipv4_nolinkspeed::addr
 
uint32_t scap_ifinfo_ipv4_nolinkspeed::netmask
 
uint32_t scap_ifinfo_ipv4_nolinkspeed::bcast
 
char scap_ifinfo_ipv4_nolinkspeed::ifname [SCAP_MAX_PATH_SIZE]
 
uint16_t scap_ifinfo_ipv6::type
 
uint16_t scap_ifinfo_ipv6::ifnamelen
 
char scap_ifinfo_ipv6::addr [SCAP_IPV6_ADDR_LEN]
 Interface address. More...
 
char scap_ifinfo_ipv6::netmask [SCAP_IPV6_ADDR_LEN]
 Interface netmask. More...
 
char scap_ifinfo_ipv6::bcast [SCAP_IPV6_ADDR_LEN]
 Interface broadcast address. More...
 
uint64_t scap_ifinfo_ipv6::linkspeed
 Interface link speed. More...
 
char scap_ifinfo_ipv6::ifname [SCAP_MAX_PATH_SIZE]
 interface name (e.g. "eth0") More...
 
uint16_t scap_ifinfo_ipv6_nolinkspeed::type
 
uint16_t scap_ifinfo_ipv6_nolinkspeed::ifnamelen
 
char scap_ifinfo_ipv6_nolinkspeed::addr [SCAP_IPV6_ADDR_LEN]
 
char scap_ifinfo_ipv6_nolinkspeed::netmask [SCAP_IPV6_ADDR_LEN]
 
char scap_ifinfo_ipv6_nolinkspeed::bcast [SCAP_IPV6_ADDR_LEN]
 
char scap_ifinfo_ipv6_nolinkspeed::ifname [SCAP_MAX_PATH_SIZE]
 
uint32_t scap_addrlist::n_v4_addrs
 Number of IPv4 addresses. More...
 
uint32_t scap_addrlist::n_v6_addrs
 Number of IPv6 addresses. More...
 
uint32_t scap_addrlist::totlen
 For internal use. More...
 
scap_ifinfo_ipv4scap_addrlist::v4list
 List of IPv4 Addresses. More...
 
scap_ifinfo_ipv6scap_addrlist::v6list
 List of IPv6 Addresses. More...
 
uint32_t scap_userinfo::uid
 User ID. More...
 
uint32_t scap_userinfo::gid
 Group ID. More...
 
char scap_userinfo::name [MAX_CREDENTIALS_STR_LEN]
 Username. More...
 
char scap_userinfo::homedir [SCAP_MAX_PATH_SIZE]
 Home directory. More...
 
char scap_userinfo::shell [SCAP_MAX_PATH_SIZE]
 Shell program. More...
 
uint32_t scap_groupinfo::gid
 Group ID. More...
 
char scap_groupinfo::name [MAX_CREDENTIALS_STR_LEN]
 Group name. More...
 
uint32_t scap_userlist::nusers
 Number of users. More...
 
uint32_t scap_userlist::ngroups
 Number of groups. More...
 
uint32_t scap_userlist::totsavelen
 For internal use. More...
 
scap_userinfoscap_userlist::users
 User list. More...
 
scap_groupinfoscap_userlist::groups
 Group list. More...
 
enum ppm_event_category ppm_syscall_desc::category
 
enum ppm_event_flags ppm_syscall_desc::flags
 
char * ppm_syscall_desc::name
 
volatile uint64_t udig_ring_buffer_status::m_buffer_lock
 
volatile int udig_ring_buffer_status::m_initialized
 
volatile int udig_ring_buffer_status::m_capturing_pid
 
volatile int udig_ring_buffer_status::m_stopped
 
volatile struct timespec udig_ring_buffer_status::m_last_print_time
 
struct udig_consumer_t udig_ring_buffer_status::m_consumer
 

Detailed Description

Function Documentation

◆ 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_clear_eventmask()

int32_t scap_clear_eventmask ( scap_t handle)

Clear the event mask: no events will be passed to sysdig.

Parameters
handleHandle to the capture instance.
Note
This function can only be called for live captures.

◆ scap_close()

void scap_close ( scap_t handle)

Close a capture handle.

Parameters
handleHandle to the capture instance.

◆ scap_dev_delete()

void scap_dev_delete ( scap_t handle,
scap_mountinfo dev 
)

◆ scap_disable_dynamic_snaplen()

int32_t scap_disable_dynamic_snaplen ( scap_t handle)

◆ 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.

Parameters
handleHandle to the capture instance.
dThe dump handle, returned by scap_dump_open
epointer to an event returned by scap_next.
cpuidThe cpu from which the event was captured. Returned by scap_next.
flagsThe event flags. 0 means no flags.
Returns
SCAP_SUCCESS if the call is successful. On Failure, SCAP_FAILURE is returned and scap_getlasterr() can be used to obtain the cause of the error.

◆ scap_dump_close()

void scap_dump_close ( scap_dumper_t d)

Close a trace file.

Parameters
dThe dump handle, returned by scap_dump_open

◆ scap_dump_flush()

void scap_dump_flush ( scap_dumper_t d)

Flush all pending output into the file.

Parameters
dThe dump handle, returned by scap_dump_open

◆ 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 uses gzoffset.

Parameters
dThe dump handle, returned by scap_dump_open
Returns
The next write position.

◆ scap_dump_get_offset()

int64_t scap_dump_get_offset ( scap_dumper_t d)

Return the current size of a trace file.

Parameters
dThe dump handle, returned by scap_dump_open
Returns
The current size of the dump file pointed by d.

◆ 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.

Parameters
handleHandle to the capture instance.
fnameThe name of the trace file.
Returns
Dump handle that can be used to identify this specific dump instance.

◆ 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.

Parameters
handleHandle to the capture instance.
fdA file descriptor to which the dumper will write
Returns
Dump handle that can be used to identify this specific dump instance.

◆ scap_enable_dynamic_snaplen()

int32_t scap_enable_dynamic_snaplen ( scap_t handle)

◆ scap_enable_page_faults()

int32_t scap_enable_page_faults ( scap_t handle)

◆ scap_enable_simpledriver_mode()

int32_t scap_enable_simpledriver_mode ( scap_t handle)

◆ scap_enable_tracers_capture()

int32_t scap_enable_tracers_capture ( scap_t handle)

◆ 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.

Parameters
handleHandle to the capture instance.
Returns
The flags if the capture is offline, 0 if the capture is live.

◆ 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.

Parameters
handleHandle to the capture instance.
Returns
The total number of events.

◆ scap_event_get_ts()

uint64_t scap_event_get_ts ( scap_evt e)

Get the timestamp of an event.

Parameters
epointer to an event returned by scap_next.
Returns
The event timestamp, in nanoseconds since epoch.

◆ scap_event_getinfo()

const struct ppm_event_info* scap_event_getinfo ( scap_evt e)

Return the meta-information describing the given event.

Parameters
epointer to an event returned by scap_next.
Returns
The pointer to the the event table entry for the given event.

◆ scap_event_getlen()

uint32_t scap_event_getlen ( scap_evt e)

Get the length of an event.

Parameters
epointer to an event returned by scap_next.
Returns
The event length in bytes.

◆ scap_event_reset_count()

void scap_event_reset_count ( scap_t handle)

Reset the event count to 0.

Parameters
handleHandle to the capture instance.

◆ scap_fd_add()

int32_t scap_fd_add ( scap_t handle,
scap_threadinfo tinfo,
uint64_t  fd,
scap_fdinfo fdinfo 
)

◆ scap_free_device_table()

void scap_free_device_table ( scap_t handle)

◆ scap_fseek()

void scap_fseek ( scap_t handle,
uint64_t  off 
)

◆ scap_ftell()

uint64_t scap_ftell ( scap_t handle)

◆ scap_get_bpf_enabled()

bool scap_get_bpf_enabled ( scap_t handle)

◆ scap_get_bpf_probe_from_env()

const char* scap_get_bpf_probe_from_env ( )

◆ 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.

Returns
The pointer to a table of scap_userlist entries, each of which describes one of the events that can come from the driver. The table contains PPM_EVENT_MAX entries, and the position of each entry in the table corresponds to its event ID. The ppm_event_info contains the full information necessary to decode an event coming from scap_next.

◆ 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, so that all the information for the host can be correctly extracted.

◆ 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.

Parameters
handleHandle to the capture instance.
Returns
The pointer to a scap_addrlist structure containing the interface list, or NULL if the function fails.

◆ scap_get_machine_info()

const scap_machine_info* scap_get_machine_info ( scap_t handle)

Get generic machine information.

Returns
The pointer to a scap_machine_info structure containing the information.
Note
for live captures, the information is collected from the operating system. For offline captures, it comes from the capture file.

◆ scap_get_memorydumper_curpos()

uint8_t* scap_get_memorydumper_curpos ( scap_dumper_t d)

◆ scap_get_n_tracepoint_hit()

int32_t scap_get_n_tracepoint_hit ( scap_t handle,
long *  ret 
)

◆ scap_get_ndevs()

uint32_t scap_get_ndevs ( scap_t handle)

◆ scap_get_os_platform()

scap_os_platform scap_get_os_platform ( scap_t handle)

Retrieve the OS platform for the given capture handle.

Parameters
handleHandle to the capture instance.
Returns
The type of operating system on which the capture was made.
Note
For live handles, the return value indicates the current local OS. For offline handles, the return value indicates the OS where the data was originally captured.

◆ scap_get_proc_table()

scap_threadinfo* scap_get_proc_table ( scap_t handle)

Get the process list for the given capture instance.

Parameters
handleHandle to the capture instance.
Returns
Pointer to the process list.

for live captures, the process list is created when the capture starts by scanning the proc file system. For offline captures, it is retrieved from the file. The process list contains information about the processes that were already open when the capture started. It can be traversed with uthash, using the following syntax:

HASH_ITER(hh, table, pi, tpi)
{
// do something with pi
}

Refer to the documentation of the scap_threadinfo struct for details about its content.

◆ 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.

Parameters
handleHandle to the capture instance.

◆ scap_get_stats()

int32_t scap_get_stats ( scap_t handle,
OUT scap_stats stats 
)

Return the capture statistics for the given capture handle.

Parameters
handleHandle to the capture instance.
statsPointer to a scap_stats structure that will be filled with the statistics.
Returns
SCAP_SECCESS if the call is successful. On Failure, SCAP_FAILURE is returned and scap_getlasterr() can be used to obtain the cause of the error.

◆ 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.

Returns
The pointer to a table of ppm_syscall_desc entries, each of which describes one of the events that can come from the driver. The table contains SYSCALL_TABLE_SIZE entries, and the position of each entry in the table corresponds to the system call ID.

This table can be used to interpret the ID parameter of PPME_GENERIC_E and PPME_GENERIC_X.

◆ scap_get_threadlist()

struct ppm_proclist_info* scap_get_threadlist ( scap_t handle)

Get the process list.

◆ scap_get_unexpected_block_readsize()

uint64_t scap_get_unexpected_block_readsize ( scap_t handle)

◆ scap_get_user_list()

scap_userlist* scap_get_user_list ( scap_t handle)

Return the machine user and group lists.

Parameters
handleHandle to the capture instance.
Returns
The pointer to a scap_userlist structure containing the user and group lists, or NULL if the function fails.

◆ scap_getlasterr()

const char* scap_getlasterr ( scap_t handle)

Return a string with the last error that happened on the given capture.

◆ scap_getpid_global()

int32_t scap_getpid_global ( scap_t handle,
int64_t *  pid 
)

◆ scap_is_thread_alive()

bool scap_is_thread_alive ( scap_t handle,
int64_t  pid,
int64_t  tid,
const char *  comm 
)

◆ 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_memory_dump_open()

scap_dumper_t* scap_memory_dump_open ( scap_t handle,
uint8_t *  targetbuf,
uint64_t  targetbufsize 
)

◆ 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.

Parameters
handleHandle to the capture instance.
peventUser-provided event pointer that will be initialized with address of the event.
pcpuidUser-provided event pointer that will be initialized with the ID if the CPU where the event was captured.
Returns
SCAP_SUCCESS if the call is successful and pevent and pcpuid contain valid data. SCAP_TIMEOUT in case the read timeout expired and no event is available. SCAP_EOF when the end of an offline capture is reached. On Failure, SCAP_FAILURE is returned and scap_getlasterr() can be used to obtain the cause of the error.

◆ 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)

Parameters
epointer to an event returned by scap_next.
cpuidThe cpu from which the event was captured. Returned by scap_next.
bytesThe number of bytes to write
Returns
SCAP_SUCCESS if the call is successful. On Failure, SCAP_FAILURE is returned and scap_getlasterr() can be used to obtain the cause of the error.

◆ scap_open()

scap_t* scap_open ( scap_open_args  args,
char *  error,
int32_t *  rc 
)

Advanced function to start a capture.

Parameters
argsa scap_open_args structure containing the open parameters.
errorPointer to a buffer that will contain the error string in case the function fails. The buffer must have size SCAP_LASTERR_SIZE.
rcInteger pointer that will contain the scap return code in case the function fails.
Returns
The capture instance handle in case of success. NULL in case of failure.

◆ scap_open_live()

scap_t* scap_open_live ( char *  error,
int32_t *  rc 
)

Start a live event capture.

Parameters
errorPointer to a buffer that will contain the error string in case the function fails. The buffer must have size SCAP_LASTERR_SIZE.
rcInteger pointer that will contain the scap return code in case the function fails.
Returns
The capture instance handle in case of success. NULL in case of failure.

◆ scap_open_offline()

scap_t* scap_open_offline ( const char *  fname,
char *  error,
int32_t *  rc 
)

Start an event capture from file.

Parameters
fnameThe name of the file to open.
errorPointer to a buffer that will contain the error string in case the function fails. The buffer must have size SCAP_LASTERR_SIZE.
rcInteger pointer that will contain the scap return code in case the function fails.
Returns
The capture instance handle in case of success. NULL in case of failure.

◆ 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.

Parameters
fdThe fd to use.
errorPointer to a buffer that will contain the error string in case the function fails. The buffer must have size SCAP_LASTERR_SIZE.
rcInteger pointer that will contain the scap return code in case the function fails.
Returns
The capture instance handle in case of success. NULL in case of failure.

◆ scap_proc_add()

int32_t scap_proc_add ( scap_t handle,
uint64_t  tid,
scap_threadinfo tinfo 
)

◆ scap_proc_alloc()

struct scap_threadinfo* scap_proc_alloc ( scap_t handle)

◆ scap_proc_free()

void scap_proc_free ( scap_t handle,
struct scap_threadinfo procinfo 
)

◆ scap_proc_free_table()

void scap_proc_free_table ( scap_t handle)

◆ scap_proc_get()

struct scap_threadinfo* scap_proc_get ( scap_t handle,
int64_t  tid,
bool  scan_sockets 
)

◆ scap_readbuf()

int32_t scap_readbuf ( scap_t handle,
uint32_t  cpuid,
OUT char **  buf,
OUT uint32_t *  len 
)

◆ scap_refresh_iflist()

void scap_refresh_iflist ( scap_t handle)

◆ scap_refresh_proc_table()

void scap_refresh_proc_table ( scap_t handle)

◆ 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 offloading operations such as evt.type=open.

Parameters
handleHandle to the capture instance.
eventid (example PPME_SOCKET_BIND_X)
Note
This function can only be called for live captures.

◆ scap_set_fullcapture_port_range()

int32_t scap_set_fullcapture_port_range ( scap_t handle,
uint16_t  range_start,
uint16_t  range_end 
)

◆ scap_set_refresh_proc_table_when_saving()

void scap_set_refresh_proc_table_when_saving ( scap_t handle,
bool  refresh 
)

◆ 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 truncating it.

Parameters
handleHandle to the capture instance.
snaplenthe snaplen for this capture instance, in bytes.
Note
This function can only be called for live captures.
By default, the driver captures the first 80 bytes of the buffers coming from events like read, write, send, recv, etc. If you're not interested in payloads, smaller values will save capture buffer space and make capture files smaller. Conversely, big values should be used with care because they can easily generate huge capture files.

◆ scap_set_statsd_port()

int32_t scap_set_statsd_port ( scap_t handle,
uint16_t  port 
)

By default we have an expanded snaplen for the default statsd port. If the statsd port is non-standard, communicate that port value to the kernel to get the expanded snaplen for the correct port.

◆ scap_start_capture()

int32_t scap_start_capture ( scap_t handle)

Start capture the events, if it was stopped with scap_stop_capture.

Parameters
handleHandle to the capture that will be started.
Returns
SCAP_SUCCESS if the call is successful. On Failure, SCAP_FAILURE is returned and scap_getlasterr() can be used to obtain the cause of the error.

◆ scap_start_dropping_mode()

int32_t scap_start_dropping_mode ( scap_t handle,
uint32_t  sampling_ratio 
)

◆ scap_stop_capture()

int32_t scap_stop_capture ( scap_t handle)

This function can be used to temporarily interrupt event capture.

Parameters
handleHandle to the capture that will be stopped.
Returns
SCAP_SUCCESS if the call is successful. On Failure, SCAP_FAILURE is returned and scap_getlasterr() can be used to obtain the cause of the error.

◆ scap_stop_dropping_mode()

int32_t scap_stop_dropping_mode ( scap_t 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, as well as their children. This includes fork()/clone()ed processes that might later exec to a different comm.

returns SCAP_FAILURE if there are already MAX_SUPPRESSED_COMMS comm values, SCAP_SUCCESS otherwise.

◆ 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. It is the opposite of scap_set_eventmask.

Parameters
handleHandle to the capture instance.
eventid (example PPME_SOCKET_BIND_X)
Note
This function can only be called for live captures.

◆ scap_write_proc_fds()

int32_t scap_write_proc_fds ( scap_t handle,
struct scap_threadinfo tinfo,
scap_dumper_t d 
)

◆ 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_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_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 
)

Variable Documentation

◆ addr [1/4]

char scap_ifinfo_ipv6::addr[SCAP_IPV6_ADDR_LEN]

Interface address.

Definition at line 389 of file scap.h.

◆ addr [2/4]

char scap_ifinfo_ipv6_nolinkspeed::addr[SCAP_IPV6_ADDR_LEN]

Definition at line 403 of file scap.h.

◆ addr [3/4]

uint32_t scap_ifinfo_ipv4::addr

Interface address.

Definition at line 361 of file scap.h.

◆ addr [4/4]

uint32_t scap_ifinfo_ipv4_nolinkspeed::addr

Definition at line 375 of file scap.h.

◆ args

char scap_threadinfo::args[SCAP_MAX_ARGS_SIZE+1]

Command line arguments (e.g. "-d1")

Definition at line 226 of file scap.h.

◆ args_len

uint16_t scap_threadinfo::args_len

Command line arguments length.

Definition at line 227 of file scap.h.

◆ bcast [1/4]

char scap_ifinfo_ipv6::bcast[SCAP_IPV6_ADDR_LEN]

Interface broadcast address.

Definition at line 391 of file scap.h.

◆ bcast [2/4]

char scap_ifinfo_ipv6_nolinkspeed::bcast[SCAP_IPV6_ADDR_LEN]

Definition at line 405 of file scap.h.

◆ bcast [3/4]

uint32_t scap_ifinfo_ipv4::bcast

Interface broadcast address.

Definition at line 363 of file scap.h.

◆ bcast [4/4]

uint32_t scap_ifinfo_ipv4_nolinkspeed::bcast

Definition at line 377 of file scap.h.

◆ bpf_probe

const char* scap_open_args::bpf_probe

The name of the BPF probe to open. If NULL, the kernel driver will be used.

Definition at line 302 of file scap.h.

◆ category

enum ppm_event_category ppm_syscall_desc::category

System call category.

Definition at line 515 of file scap.h.

◆ cgroups

char scap_threadinfo::cgroups[SCAP_MAX_CGROUPS_SIZE]

Definition at line 242 of file scap.h.

◆ cgroups_len

uint16_t scap_threadinfo::cgroups_len

Definition at line 243 of file scap.h.

◆ clone_ts

uint64_t scap_threadinfo::clone_ts

Definition at line 247 of file scap.h.

◆ comm

char scap_threadinfo::comm[SCAP_MAX_PATH_SIZE+1]

Command name (e.g. "top")

Definition at line 223 of file scap.h.

◆ cwd

char scap_threadinfo::cwd[SCAP_MAX_PATH_SIZE+1]

The current working directory.

Definition at line 230 of file scap.h.

◆ destination [1/2]

uint64_t scap_fdinfo::destination

Destination socket endpoint.

Definition at line 198 of file scap.h.

◆ destination [2/2]

uint64_t { ... } ::destination

Destination socket endpoint.

Definition at line 198 of file scap.h.

◆ dev [1/3]

uint32_t { ... } ::dev

Major/minor number of the device containing this file.

Definition at line 206 of file scap.h.

◆ dev [2/3]

uint32_t scap_fdinfo::dev

Major/minor number of the device containing this file.

Definition at line 206 of file scap.h.

◆ dev [3/3]

uint32_t scap_mountinfo::dev

device number

Definition at line 259 of file scap.h.

◆ dip [1/3]

uint32_t { ... } ::dip[4]

Destination IP.

Definition at line 178 of file scap.h.

◆ dip [2/3]

uint32_t { ... } ::dip

Destination IP.

Definition at line 170 of file scap.h.

◆ dip [3/3]

uint32_t scap_fdinfo::dip[4]

Destination IP.

Definition at line 170 of file scap.h.

◆ dport [1/3]

uint16_t { ... } ::dport

Destination port.

Definition at line 172 of file scap.h.

◆ dport [2/3]

uint16_t scap_fdinfo::dport

Destination port.

Destination Port.

Definition at line 172 of file scap.h.

◆ dport [3/3]

uint16_t { ... } ::dport

Destination Port.

Definition at line 180 of file scap.h.

◆ env

char scap_threadinfo::env[SCAP_MAX_ENV_SIZE+1]

Environment.

Definition at line 228 of file scap.h.

◆ env_len

uint16_t scap_threadinfo::env_len

Environment length.

Definition at line 229 of file scap.h.

◆ exe

char scap_threadinfo::exe[SCAP_MAX_PATH_SIZE+1]

argv0

Definition at line 224 of file scap.h.

◆ exepath

char scap_threadinfo::exepath[SCAP_MAX_PATH_SIZE+1]

full executable path

Definition at line 225 of file scap.h.

◆ fd [1/2]

int64_t scap_fdinfo::fd

The FD number, which uniquely identifies this file descriptor.

Definition at line 162 of file scap.h.

◆ fd [2/2]

int scap_open_args::fd

Definition at line 296 of file scap.h.

◆ fdlimit

int64_t scap_threadinfo::fdlimit

The maximum number of files this thread is allowed to open.

Definition at line 231 of file scap.h.

◆ fdlist

scap_fdinfo* scap_threadinfo::fdlist

The fd table for this process.

Definition at line 246 of file scap.h.

◆ filtered_out

int scap_threadinfo::filtered_out

nonzero if this entry should not be saved to file

Definition at line 245 of file scap.h.

◆ flags [1/2]

uint32_t scap_threadinfo::flags

the process flags.

Definition at line 232 of file scap.h.

◆ flags [2/2]

enum ppm_event_flags ppm_syscall_desc::flags

Definition at line 516 of file scap.h.

◆ fname [1/5]

char scap_fdinfo::fname[SCAP_MAX_PATH_SIZE]

Name associated to this unix socket.

The name for file system FDs.

Name associated to this file.

Definition at line 199 of file scap.h.

◆ fname [2/5]

char { ... } ::fname[SCAP_MAX_PATH_SIZE]

Name associated to this unix socket.

Definition at line 199 of file scap.h.

◆ fname [3/5]

char { ... } ::fname[SCAP_MAX_PATH_SIZE]

Name associated to this file.

Definition at line 204 of file scap.h.

◆ fname [4/5]

char { ... } ::fname[SCAP_MAX_PATH_SIZE]

The name for file system FDs.

Definition at line 208 of file scap.h.

◆ fname [5/5]

const char* scap_open_args::fname

The name of the file to open. NULL for live captures.

Definition at line 297 of file scap.h.

◆ gid [1/3]

uint32_t scap_threadinfo::gid

group id

Definition at line 234 of file scap.h.

◆ gid [2/3]

uint32_t scap_userinfo::gid

Group ID.

Definition at line 437 of file scap.h.

◆ gid [3/3]

uint32_t scap_groupinfo::gid

Group ID.

Definition at line 448 of file scap.h.

◆ groups

scap_groupinfo* scap_userlist::groups

Group list.

Definition at line 461 of file scap.h.

◆ hh [1/3]

UT_hash_handle scap_fdinfo::hh

makes this structure hashable

Definition at line 210 of file scap.h.

◆ hh [2/3]

UT_hash_handle scap_threadinfo::hh

makes this structure hashable

Definition at line 251 of file scap.h.

◆ hh [3/3]

UT_hash_handle scap_mountinfo::hh

makes this structure hashable

Definition at line 260 of file scap.h.

◆ homedir

char scap_userinfo::homedir[SCAP_MAX_PATH_SIZE]

Home directory.

Definition at line 439 of file scap.h.

◆ hostname

char _scap_machine_info::hostname[128]

The machine hostname.

Definition at line 331 of file scap.h.

◆ ifname [1/4]

char scap_ifinfo_ipv4::ifname[SCAP_MAX_PATH_SIZE]

interface name (e.g. "eth0")

Definition at line 365 of file scap.h.

◆ ifname [2/4]

char scap_ifinfo_ipv4_nolinkspeed::ifname[SCAP_MAX_PATH_SIZE]

Definition at line 378 of file scap.h.

◆ ifname [3/4]

char scap_ifinfo_ipv6::ifname[SCAP_MAX_PATH_SIZE]

interface name (e.g. "eth0")

Definition at line 393 of file scap.h.

◆ ifname [4/4]

char scap_ifinfo_ipv6_nolinkspeed::ifname[SCAP_MAX_PATH_SIZE]

Definition at line 406 of file scap.h.

◆ ifnamelen [1/4]

uint16_t scap_ifinfo_ipv4::ifnamelen

Definition at line 360 of file scap.h.

◆ ifnamelen [2/4]

uint16_t scap_ifinfo_ipv4_nolinkspeed::ifnamelen

Definition at line 374 of file scap.h.

◆ ifnamelen [3/4]

uint16_t scap_ifinfo_ipv6::ifnamelen

Definition at line 388 of file scap.h.

◆ ifnamelen [4/4]

uint16_t scap_ifinfo_ipv6_nolinkspeed::ifnamelen

Definition at line 402 of file scap.h.

◆ import_users

bool scap_open_args::import_users

true if the user list should be created when opening the capture.

Definition at line 300 of file scap.h.

◆ info

union { ... } scap_fdinfo::info

◆ ino

uint64_t scap_fdinfo::ino

For unix sockets, the inode.

Definition at line 163 of file scap.h.

◆ ip [1/3]

uint32_t { ... } ::ip[4]

Local IP.

Definition at line 191 of file scap.h.

◆ ip [2/3]

uint32_t scap_fdinfo::ip[4]

Local IP.

Definition at line 185 of file scap.h.

◆ ip [3/3]

uint32_t { ... } ::ip

Local IP.

Definition at line 185 of file scap.h.

◆ ipv4info [1/2]

struct { ... } scap_fdinfo::ipv4info

Information specific to IPv4 sockets.

◆ ipv4info [2/2]

struct { ... } ::ipv4info

Information specific to IPv4 sockets.

◆ ipv4serverinfo [1/2]

struct { ... } scap_fdinfo::ipv4serverinfo

Information specific to IPv4 server sockets, e.g. sockets used for bind().

◆ ipv4serverinfo [2/2]

struct { ... } ::ipv4serverinfo

Information specific to IPv4 server sockets, e.g. sockets used for bind().

◆ ipv6info [1/2]

struct { ... } scap_fdinfo::ipv6info

Information specific to IPv6 sockets.

◆ ipv6info [2/2]

struct { ... } ::ipv6info

Information specific to IPv6 sockets.

◆ ipv6serverinfo [1/2]

struct { ... } scap_fdinfo::ipv6serverinfo

Information specific to IPv6 server sockets, e.g. sockets used for bind().

◆ ipv6serverinfo [2/2]

struct { ... } ::ipv6serverinfo

Information specific to IPv6 server sockets, e.g. sockets used for bind().

◆ l4proto [1/5]

uint8_t { ... } ::l4proto

Transport protocol. See scap_l4_proto.

Definition at line 173 of file scap.h.

◆ l4proto [2/5]

uint8_t scap_fdinfo::l4proto

Transport protocol. See scap_l4_proto.

Definition at line 173 of file scap.h.

◆ l4proto [3/5]

uint8_t { ... } ::l4proto

Transport protocol. See scap_l4_proto.

Definition at line 181 of file scap.h.

◆ l4proto [4/5]

uint8_t { ... } ::l4proto

Transport protocol. See scap_l4_proto.

Definition at line 187 of file scap.h.

◆ l4proto [5/5]

uint8_t { ... } ::l4proto

Transport protocol. See scap_l4_proto.

Definition at line 193 of file scap.h.

◆ len

uint32_t evt_param_info::len

The event total length.

Definition at line 109 of file scap.h.

◆ linkspeed [1/2]

uint64_t scap_ifinfo_ipv4::linkspeed

Interface link speed.

Definition at line 364 of file scap.h.

◆ linkspeed [2/2]

uint64_t scap_ifinfo_ipv6::linkspeed

Interface link speed.

Definition at line 392 of file scap.h.

◆ loginuid

int32_t scap_threadinfo::loginuid

loginuid (auid)

Definition at line 249 of file scap.h.

◆ m_buffer_lock

volatile uint64_t udig_ring_buffer_status::m_buffer_lock

Definition at line 538 of file scap.h.

◆ m_capturing_pid

volatile int udig_ring_buffer_status::m_capturing_pid

Definition at line 540 of file scap.h.

◆ m_consumer

struct udig_consumer_t udig_ring_buffer_status::m_consumer

Definition at line 543 of file scap.h.

◆ m_initialized

volatile int udig_ring_buffer_status::m_initialized

Definition at line 539 of file scap.h.

◆ m_last_print_time

volatile struct timespec udig_ring_buffer_status::m_last_print_time

Definition at line 542 of file scap.h.

◆ m_stopped

volatile int udig_ring_buffer_status::m_stopped

Definition at line 541 of file scap.h.

◆ max_pid

uint64_t _scap_machine_info::max_pid

Highest PID number on this machine.

Definition at line 330 of file scap.h.

◆ memory_size_bytes

uint64_t _scap_machine_info::memory_size_bytes

Physical memory size.

Definition at line 329 of file scap.h.

◆ mode

scap_mode_t scap_open_args::mode

Definition at line 295 of file scap.h.

◆ mount_id [1/3]

uint32_t scap_fdinfo::mount_id

The id of the vfs mount the file is in until we find dev major:minor.

Definition at line 205 of file scap.h.

◆ mount_id [2/3]

uint32_t { ... } ::mount_id

The id of the vfs mount the file is in until we find dev major:minor.

Definition at line 205 of file scap.h.

◆ mount_id [3/3]

uint64_t scap_mountinfo::mount_id

mount id from /proc/self/mountinfo

Definition at line 258 of file scap.h.

◆ n_drops

uint64_t scap_stats::n_drops

Number of dropped events.

Definition at line 93 of file scap.h.

◆ n_drops_buffer

uint64_t scap_stats::n_drops_buffer

Number of dropped events caused by full buffer.

Definition at line 94 of file scap.h.

◆ n_drops_bug

uint64_t scap_stats::n_drops_bug

Number of dropped events caused by an invalid condition in the kernel instrumentation.

Definition at line 96 of file scap.h.

◆ n_drops_pf

uint64_t scap_stats::n_drops_pf

Number of dropped events caused by invalid memory access.

Definition at line 95 of file scap.h.

◆ n_evts

uint64_t scap_stats::n_evts

Total number of events that were received by the driver.

Definition at line 92 of file scap.h.

◆ n_preemptions

uint64_t scap_stats::n_preemptions

Number of preemptions.

Definition at line 97 of file scap.h.

◆ n_suppressed

uint64_t scap_stats::n_suppressed

Number of events skipped due to the tid being in a set of suppressed tids.

Definition at line 98 of file scap.h.

◆ n_tids_suppressed

uint64_t scap_stats::n_tids_suppressed

Number of threads currently being suppressed.

Definition at line 99 of file scap.h.

◆ n_v4_addrs

uint32_t scap_addrlist::n_v4_addrs

Number of IPv4 addresses.

Definition at line 420 of file scap.h.

◆ n_v6_addrs

uint32_t scap_addrlist::n_v6_addrs

Number of IPv6 addresses.

Definition at line 421 of file scap.h.

◆ name [1/4]

char scap_userinfo::name[MAX_CREDENTIALS_STR_LEN]

Username.

Definition at line 438 of file scap.h.

◆ name [2/4]

char scap_groupinfo::name[MAX_CREDENTIALS_STR_LEN]

Group name.

Definition at line 449 of file scap.h.

◆ name [3/4]

const char* evt_param_info::name

The event name.

Definition at line 107 of file scap.h.

◆ name [4/4]

char* ppm_syscall_desc::name

System call name, e.g. 'open'.

Definition at line 517 of file scap.h.

◆ netmask [1/4]

char scap_ifinfo_ipv6::netmask[SCAP_IPV6_ADDR_LEN]

Interface netmask.

Definition at line 390 of file scap.h.

◆ netmask [2/4]

char scap_ifinfo_ipv6_nolinkspeed::netmask[SCAP_IPV6_ADDR_LEN]

Definition at line 404 of file scap.h.

◆ netmask [3/4]

uint32_t scap_ifinfo_ipv4::netmask

Interface netmask.

Definition at line 362 of file scap.h.

◆ netmask [4/4]

uint32_t scap_ifinfo_ipv4_nolinkspeed::netmask

Definition at line 376 of file scap.h.

◆ ngroups

uint32_t scap_userlist::ngroups

Number of groups.

Definition at line 458 of file scap.h.

◆ num_cpus

uint32_t _scap_machine_info::num_cpus

Number of processors.

Definition at line 328 of file scap.h.

◆ nusers

uint32_t scap_userlist::nusers

Number of users.

Definition at line 457 of file scap.h.

◆ open_flags [1/2]

uint32_t { ... } ::open_flags

Flags associated with the file.

Definition at line 203 of file scap.h.

◆ open_flags [2/2]

uint32_t scap_fdinfo::open_flags

Flags associated with the file.

Definition at line 203 of file scap.h.

◆ pfmajor

uint64_t scap_threadinfo::pfmajor

number of major page faults since start

Definition at line 238 of file scap.h.

◆ pfminor

uint64_t scap_threadinfo::pfminor

number of minor page faults since start

Definition at line 239 of file scap.h.

◆ pid

uint64_t scap_threadinfo::pid

The id of the process containing this thread. In single thread processes, this is equal to tid.

Definition at line 219 of file scap.h.

◆ port [1/3]

uint16_t scap_fdinfo::port

Local Port.

Definition at line 186 of file scap.h.

◆ port [2/3]

uint16_t { ... } ::port

Local Port.

Definition at line 186 of file scap.h.

◆ port [3/3]

uint16_t { ... } ::port

Local Port.

Definition at line 192 of file scap.h.

◆ proc_callback

proc_entry_callback scap_open_args::proc_callback

Callback to be invoked for each thread/fd that is extracted from /proc, or NULL if no callback is needed.

Definition at line 298 of file scap.h.

◆ proc_callback_context

void* scap_open_args::proc_callback_context

Opaque pointer that will be included in the calls to proc_callback. Ignored if proc_callback is NULL.

Definition at line 299 of file scap.h.

◆ ptid

uint64_t scap_threadinfo::ptid

The id of the thread that created this thread.

Definition at line 220 of file scap.h.

◆ regularinfo [1/2]

struct { ... } scap_fdinfo::regularinfo

Information specific to regular files.

◆ regularinfo [2/2]

struct { ... } ::regularinfo

Information specific to regular files.

◆ reserved1

uint64_t _scap_machine_info::reserved1

reserved for future use

Definition at line 332 of file scap.h.

◆ reserved2

uint64_t _scap_machine_info::reserved2

reserved for future use

Definition at line 333 of file scap.h.

◆ reserved3

uint64_t _scap_machine_info::reserved3

reserved for future use

Definition at line 334 of file scap.h.

◆ reserved4

uint64_t _scap_machine_info::reserved4

reserved for future use

Definition at line 335 of file scap.h.

◆ root

char scap_threadinfo::root[SCAP_MAX_PATH_SIZE+1]

Definition at line 244 of file scap.h.

◆ shell

char scap_userinfo::shell[SCAP_MAX_PATH_SIZE]

Shell program.

Definition at line 440 of file scap.h.

◆ sid

uint64_t scap_threadinfo::sid

The session id of the process containing this thread.

Definition at line 221 of file scap.h.

◆ sip [1/3]

uint32_t { ... } ::sip[4]

Source IP.

Definition at line 177 of file scap.h.

◆ sip [2/3]

uint32_t scap_fdinfo::sip[4]

Source IP.

Definition at line 169 of file scap.h.

◆ sip [3/3]

uint32_t { ... } ::sip

Source IP.

Definition at line 169 of file scap.h.

◆ source [1/2]

uint64_t scap_fdinfo::source

Source socket endpoint.

Definition at line 197 of file scap.h.

◆ source [2/2]

uint64_t { ... } ::source

Source socket endpoint.

Definition at line 197 of file scap.h.

◆ sport [1/3]

uint16_t scap_fdinfo::sport

Source port.

Source Port.

Definition at line 171 of file scap.h.

◆ sport [2/3]

uint16_t { ... } ::sport

Source port.

Definition at line 171 of file scap.h.

◆ sport [3/3]

uint16_t { ... } ::sport

Source Port.

Definition at line 179 of file scap.h.

◆ start_offset

uint64_t scap_open_args::start_offset

Used to start reading a capture file from an arbitrary offset. This is leveraged when opening merged files.

Definition at line 301 of file scap.h.

◆ suppressed_comms

const char* scap_open_args::suppressed_comms[SCAP_MAX_SUPPRESSED_COMMS]

A list of processes (comm) for which no.

Definition at line 303 of file scap.h.

◆ tid

uint64_t scap_threadinfo::tid

The thread/task id.

Definition at line 218 of file scap.h.

◆ totlen

uint32_t scap_addrlist::totlen

For internal use.

Definition at line 422 of file scap.h.

◆ totsavelen

uint32_t scap_userlist::totsavelen

For internal use.

Definition at line 459 of file scap.h.

◆ tty

int32_t scap_threadinfo::tty

Definition at line 248 of file scap.h.

◆ type [1/6]

uint32_t evt_param_info::type

The event type. See the ppm_event_type enum in driver/ppm_events_public.h.

Definition at line 108 of file scap.h.

◆ type [2/6]

scap_fd_type scap_fdinfo::type

This file descriptor's type.

Definition at line 164 of file scap.h.

◆ type [3/6]

uint16_t scap_ifinfo_ipv4::type

Interface type.

Definition at line 359 of file scap.h.

◆ type [4/6]

uint16_t scap_ifinfo_ipv4_nolinkspeed::type

Definition at line 373 of file scap.h.

◆ type [5/6]

uint16_t scap_ifinfo_ipv6::type

Definition at line 387 of file scap.h.

◆ type [6/6]

uint16_t scap_ifinfo_ipv6_nolinkspeed::type

Definition at line 401 of file scap.h.

◆ udig

bool scap_open_args::udig

If true, UDIG will be used for event capture. Otherwise, the kernel driver will be used.

Definition at line 307 of file scap.h.

◆ uid [1/2]

uint32_t scap_threadinfo::uid

user id

Definition at line 233 of file scap.h.

◆ uid [2/2]

uint32_t scap_userinfo::uid

User ID.

Definition at line 436 of file scap.h.

◆ unix_socket_info [1/2]

struct { ... } scap_fdinfo::unix_socket_info

Information specific to unix sockets.

◆ unix_socket_info [2/2]

struct { ... } ::unix_socket_info

Information specific to unix sockets.

◆ users

scap_userinfo* scap_userlist::users

User list.

Definition at line 460 of file scap.h.

◆ v4list

scap_ifinfo_ipv4* scap_addrlist::v4list

List of IPv4 Addresses.

Definition at line 423 of file scap.h.

◆ v6list

scap_ifinfo_ipv6* scap_addrlist::v6list

List of IPv6 Addresses.

Definition at line 424 of file scap.h.

◆ val

char* evt_param_info::val

The event data.

Definition at line 110 of file scap.h.

◆ vmrss_kb

uint32_t scap_threadinfo::vmrss_kb

resident non-swapped memory (as kb)

Definition at line 236 of file scap.h.

◆ vmsize_kb

uint32_t scap_threadinfo::vmsize_kb

total virtual memory (as kb)

Definition at line 235 of file scap.h.

◆ vmswap_kb

uint32_t scap_threadinfo::vmswap_kb

swapped memory (as kb)

Definition at line 237 of file scap.h.

◆ vpgid

uint64_t scap_threadinfo::vpgid

The process group of this thread, as seen from its current pid namespace.

Definition at line 222 of file scap.h.

◆ vpid

int64_t scap_threadinfo::vpid

Definition at line 241 of file scap.h.

◆ vtid

int64_t scap_threadinfo::vtid

Definition at line 240 of file scap.h.

scap_threadinfo
Process information.
Definition: scap.h:216
scap_get_proc_table
scap_threadinfo * scap_get_proc_table(scap_t *handle)
Get the process list for the given capture instance.