summaryrefslogtreecommitdiffstats
path: root/src/nsresourced/userns-restrict.h
blob: 37aed7b350fb1f00c8fcffc1511ce0c8219c1f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once

#include <stdbool.h>

#include "macro.h"

#if HAVE_VMLINUX_H
#include "bpf/userns_restrict/userns-restrict-skel.h"
#else
struct userns_restrict_bpf;
#endif

int userns_restrict_install(bool pin, struct userns_restrict_bpf **ret);
struct userns_restrict_bpf *userns_restrict_bpf_free(struct userns_restrict_bpf *obj);

int userns_restrict_put_by_fd(struct userns_restrict_bpf *obj, int userns_fd, bool replace, const int mount_fds[], size_t n_mount_fds);
int userns_restrict_put_by_inode(struct userns_restrict_bpf *obj, uint64_t userns_inode, bool replace, const int mount_fds[], size_t n_mount_fds);

int userns_restrict_reset_by_inode(struct userns_restrict_bpf *obj, uint64_t userns_inode);

DEFINE_TRIVIAL_CLEANUP_FUNC(struct userns_restrict_bpf*, userns_restrict_bpf_free);