2018-10-08 23:33:05 +02:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2019-11-08 20:33:10 +01:00
|
|
|
#include "cgroup.h"
|
2018-10-08 23:33:05 +02:00
|
|
|
|
2019-11-08 20:33:10 +01:00
|
|
|
typedef struct BPFProgram BPFProgram;
|
2018-10-08 23:33:05 +02:00
|
|
|
|
2020-06-23 08:31:16 +02:00
|
|
|
int bpf_devices_cgroup_init(BPFProgram **ret, CGroupDevicePolicy policy, bool allow_list);
|
2019-11-08 20:33:10 +01:00
|
|
|
int bpf_devices_apply_policy(
|
|
|
|
BPFProgram *prog,
|
|
|
|
CGroupDevicePolicy policy,
|
2020-06-23 08:31:16 +02:00
|
|
|
bool allow_list,
|
2019-11-08 20:33:10 +01:00
|
|
|
const char *cgroup_path,
|
|
|
|
BPFProgram **prog_installed);
|
2018-10-08 23:33:05 +02:00
|
|
|
|
2019-11-08 15:51:28 +01:00
|
|
|
int bpf_devices_supported(void);
|
2020-06-23 08:31:16 +02:00
|
|
|
int bpf_devices_allow_list_device(BPFProgram *prog, const char *path, const char *node, const char *acc);
|
|
|
|
int bpf_devices_allow_list_major(BPFProgram *prog, const char *path, const char *name, char type, const char *acc);
|
|
|
|
int bpf_devices_allow_list_static(BPFProgram *prog, const char *path);
|