master
c 64 lines 1.25 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #include "ebpf_socket_ipc.h"
4
5 LISTEN_SOCKETS ipc_sockets;
6
7 static void ebpf_initialize_sockets()
8 {
9 memset(&ipc_sockets, 0, sizeof(ipc_sockets));
10
11 ipc_sockets.config = &collector_config;
12 ipc_sockets.config_section = NETDATA_EBPF_IPC_INTEGRATION;
13 }
14
15 // Receive data
16 static int ebpf_ipc_rcv_callback(POLLINFO *pi, nd_poll_event_t *events)
17 {
18 (void)pi;
19 (void)events;
20
21 return 0;
22 }
23
24 static int ebpf_ipc_snd_callback(POLLINFO *pi __maybe_unused, nd_poll_event_t *events __maybe_unused)
25 {
26 (void)pi;
27 (void)events;
28
29 return 0;
30 }
31
32 static bool ebpf_ipc_should_stop(void)
33 {
34 return ebpf_plugin_stop();
35 }
36
37 void ebpf_socket_thread_ipc(void *ptr)
38 {
39 (void)ptr;
40
41 ebpf_initialize_sockets();
42
43 poll_events(
44 &ipc_sockets,
45 NULL,
46 NULL,
47 ebpf_ipc_rcv_callback,
48 ebpf_ipc_snd_callback,
49 NULL,
50 ebpf_ipc_should_stop,
51 NULL // No access control pattern
52 ,
53 0 // No dns lookups for access control pattern
54 ,
55 NULL,
56 0 // tcp request timeout, 0 = disabled
57 ,
58 0 // tcp idle timeout, 0 = disabled
59 ,
60 EBPF_DEFAULT_UPDATE_EVERY * 1000,
61 ptr,
62 0 // We are going to use UDP
63 );
64 }