]>
Commit | Line | Data |
---|---|---|
57183d11 LP |
1 | #pragma once |
2 | ||
3 | /*** | |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright 2014 Lennart Poettering | |
7 | ||
8 | systemd is free software; you can redistribute it and/or modify it | |
9 | under the terms of the GNU Lesser General Public License as published by | |
10 | the Free Software Foundation; either version 2.1 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | systemd is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | Lesser General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU Lesser General Public License | |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
20 | ***/ | |
21 | ||
a60e9f7f | 22 | #include <seccomp.h> |
f6281133 | 23 | #include <stdbool.h> |
a8fbdf54 | 24 | #include <stdint.h> |
57183d11 LP |
25 | |
26 | const char* seccomp_arch_to_string(uint32_t c); | |
27 | int seccomp_arch_from_string(const char *n, uint32_t *ret); | |
e9642be2 | 28 | |
8d7b0c8f LP |
29 | int seccomp_init_conservative(scmp_filter_ctx *ret, uint32_t default_action); |
30 | ||
31 | int seccomp_add_secondary_archs(scmp_filter_ctx c); | |
201c1cc2 | 32 | |
83f12b27 FS |
33 | bool is_seccomp_available(void); |
34 | ||
8130926d LP |
35 | typedef struct SyscallFilterSet { |
36 | const char *name; | |
201c1cc2 | 37 | const char *value; |
8130926d LP |
38 | } SyscallFilterSet; |
39 | ||
40 | enum { | |
41 | SYSCALL_FILTER_SET_CLOCK, | |
42 | SYSCALL_FILTER_SET_CPU_EMULATION, | |
43 | SYSCALL_FILTER_SET_DEBUG, | |
44 | SYSCALL_FILTER_SET_DEFAULT, | |
45 | SYSCALL_FILTER_SET_IO_EVENT, | |
46 | SYSCALL_FILTER_SET_IPC, | |
47 | SYSCALL_FILTER_SET_KEYRING, | |
48 | SYSCALL_FILTER_SET_MODULE, | |
49 | SYSCALL_FILTER_SET_MOUNT, | |
50 | SYSCALL_FILTER_SET_NETWORK_IO, | |
51 | SYSCALL_FILTER_SET_OBSOLETE, | |
52 | SYSCALL_FILTER_SET_PRIVILEGED, | |
53 | SYSCALL_FILTER_SET_PROCESS, | |
54 | SYSCALL_FILTER_SET_RAW_IO, | |
55 | _SYSCALL_FILTER_SET_MAX | |
56 | }; | |
57 | ||
58 | extern const SyscallFilterSet syscall_filter_sets[]; | |
59 | ||
60 | const SyscallFilterSet *syscall_filter_set_find(const char *name); | |
61 | ||
62 | int seccomp_add_syscall_filter_set(scmp_filter_ctx seccomp, const SyscallFilterSet *set, uint32_t action); | |
a3be2849 LP |
63 | |
64 | int seccomp_load_filter_set(uint32_t default_action, const SyscallFilterSet *set, uint32_t action); |