13#ifndef __WSUTIL_PROCESS_LOOKUP_H__
14#define __WSUTIL_PROCESS_LOOKUP_H__
52 WS_PROCESS_LOOKUP_TCP = 6,
53 WS_PROCESS_LOOKUP_UDP = 17
177WS_DLL_PUBLIC
unsigned
182 GPtrArray *processes);
struct e_in6_addr ws_in6_addr
Represents a 128-bit IPv6 address.
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
WS_DLL_PUBLIC unsigned ws_process_lookup_socket(ws_process_lookup_t *lookup, ws_process_lookup_protocol_t protocol, const ws_socket_endpoint_t *local, const ws_socket_endpoint_t *remote, GPtrArray *processes)
Find the processes that have a socket open.
Definition process_lookup.c:383
WS_DLL_PUBLIC bool ws_process_lookup_refresh(ws_process_lookup_t *lookup, char **err_msg)
Read the operating system's socket tables again now.
Definition process_lookup.c:238
WS_DLL_PUBLIC const ws_process_info_t * ws_process_lookup_pid(ws_process_lookup_t *lookup, uint32_t pid)
Describe a process by its ID.
Definition process_lookup.c:437
WS_DLL_PUBLIC ws_process_lookup_t * ws_process_lookup_new(char **err_msg)
Create a lookup context.
Definition process_lookup.c:140
WS_DLL_PUBLIC void ws_process_lookup_set_detail(ws_process_lookup_t *lookup, ws_process_detail_t detail)
Set how much is found out about the processes.
Definition process_lookup.c:209
ws_process_detail_t
How much is found out about a process.
Definition process_lookup.h:110
@ WS_PROCESS_DETAIL_FULL
Definition process_lookup.h:112
@ WS_PROCESS_DETAIL_BASIC
Definition process_lookup.h:111
struct ws_process_info ws_process_info_t
What the operating system knows about a process.
struct ws_process_lookup ws_process_lookup_t
A lookup context.
Definition process_lookup.h:75
struct ws_socket_endpoint ws_socket_endpoint_t
One end of a socket: an IPv4 or IPv6 address and a port.
WS_DLL_PUBLIC void ws_process_lookup_set_refresh_interval(ws_process_lookup_t *lookup, unsigned interval_ms)
Set how soon the socket tables may be read again after a miss.
Definition process_lookup.c:215
WS_DLL_PUBLIC void ws_process_lookup_free(ws_process_lookup_t *lookup)
Free a lookup context and every ws_process_info_t it returned.
Definition process_lookup.c:194
WS_DLL_PUBLIC bool ws_process_lookup_supported(void)
Whether the operating system's socket tables can be read on this platform.
Definition process_lookup.c:134
ws_process_lookup_protocol_t
The transport protocols of the sockets that can be looked up.
Definition process_lookup.h:51
What the operating system knows about a process.
Definition process_lookup.h:31
char * user
Definition process_lookup.h:39
bool has_ppid
Definition process_lookup.h:33
uint32_t uid
Definition process_lookup.h:36
char * name
Definition process_lookup.h:37
uint64_t start_time_ns
Definition process_lookup.h:42
uint8_t * cmdline
Definition process_lookup.h:40
size_t cmdline_len
Definition process_lookup.h:41
uint32_t pid
Definition process_lookup.h:32
uint32_t ppid
Definition process_lookup.h:34
bool has_uid
Definition process_lookup.h:35
char * path
Definition process_lookup.h:38
Definition process_lookup.c:27
One end of a socket: an IPv4 or IPv6 address and a port.
Definition process_lookup.h:59
ws_in4_addr ipv4
Definition process_lookup.h:62
uint8_t ip_version
Definition process_lookup.h:60
uint16_t port
Definition process_lookup.h:65
ws_in6_addr ipv6
Definition process_lookup.h:63