1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include <inttypes.h>
5 
6 #include "cgroup.h"
7 
8 typedef struct BPFProgram BPFProgram;
9 
10 int bpf_devices_cgroup_init(BPFProgram **ret, CGroupDevicePolicy policy, bool allow_list);
11 int bpf_devices_apply_policy(
12                 BPFProgram **prog,
13                 CGroupDevicePolicy policy,
14                 bool allow_list,
15                 const char *cgroup_path,
16                 BPFProgram **prog_installed);
17 
18 int bpf_devices_supported(void);
19 int bpf_devices_allow_list_device(BPFProgram *prog, const char *path, const char *node, const char *acc);
20 int bpf_devices_allow_list_major(BPFProgram *prog, const char *path, const char *name, char type, const char *acc);
21 int bpf_devices_allow_list_static(BPFProgram *prog, const char *path);
22