pub const SCMP_VER_MAJOR: u32 = 2;
pub const SCMP_VER_MINOR: u32 = 5;
pub const SCMP_VER_MICRO: u32 = 1;
pub const SCMP_ARCH_NATIVE: u32 = 0;
pub const SCMP_ARCH_X86: u32 = 1073741827;
pub const SCMP_ARCH_X86_64: u32 = 3221225534;
pub const SCMP_ARCH_X32: u32 = 1073741886;
pub const SCMP_ARCH_ARM: u32 = 1073741864;
pub const SCMP_ARCH_AARCH64: u32 = 3221225655;
pub const SCMP_ARCH_MIPS: u32 = 8;
pub const SCMP_ARCH_MIPS64: u32 = 2147483656;
pub const SCMP_ARCH_MIPS64N32: u32 = 2684354568;
pub const SCMP_ARCH_MIPSEL: u32 = 1073741832;
pub const SCMP_ARCH_MIPSEL64: u32 = 3221225480;
pub const SCMP_ARCH_MIPSEL64N32: u32 = 3758096392;
pub const SCMP_ARCH_PPC: u32 = 20;
pub const SCMP_ARCH_PPC64: u32 = 2147483669;
pub const SCMP_ARCH_PPC64LE: u32 = 3221225493;
pub const SCMP_ARCH_S390: u32 = 22;
pub const SCMP_ARCH_S390X: u32 = 2147483670;
pub const SCMP_ARCH_PARISC: u32 = 15;
pub const SCMP_ARCH_PARISC64: u32 = 2147483663;
pub const SCMP_ARCH_RISCV64: u32 = 3221225715;
pub const SCMP_ACT_KILL_PROCESS: u32 = 2147483648;
pub const SCMP_ACT_KILL_THREAD: u32 = 0;
pub const SCMP_ACT_KILL: u32 = 0;
pub const SCMP_ACT_TRAP: u32 = 196608;
pub const SCMP_ACT_NOTIFY: u32 = 2143289344;
pub const SCMP_ACT_LOG: u32 = 2147221504;
pub const SCMP_ACT_ALLOW: u32 = 2147418112;
pub const __NR_SCMP_ERROR: i32 = -1;
pub const __NR_SCMP_UNDEF: i32 = -2;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __u16 = ::std::os::raw::c_ushort;
pub type __s32 = ::std::os::raw::c_int;
pub type __u32 = ::std::os::raw::c_uint;
pub type __s64 = ::std::os::raw::c_longlong;
pub type __u64 = ::std::os::raw::c_ulonglong;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct seccomp_data {
pub nr: ::std::os::raw::c_int,
pub arch: __u32,
pub instruction_pointer: __u64,
pub args: [__u64; 6usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct seccomp_notif_sizes {
pub seccomp_notif: __u16,
pub seccomp_notif_resp: __u16,
pub seccomp_data: __u16,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct seccomp_notif {
pub id: __u64,
pub pid: __u32,
pub flags: __u32,
pub data: seccomp_data,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct seccomp_notif_resp {
pub id: __u64,
pub val: __s64,
pub error: __s32,
pub flags: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct scmp_version {
pub major: ::std::os::raw::c_uint,
pub minor: ::std::os::raw::c_uint,
pub micro: ::std::os::raw::c_uint,
}
pub type scmp_filter_ctx = *mut ::std::os::raw::c_void;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum scmp_filter_attr {
_SCMP_FLTATR_MIN = 0,
SCMP_FLTATR_ACT_DEFAULT = 1,
SCMP_FLTATR_ACT_BADARCH = 2,
SCMP_FLTATR_CTL_NNP = 3,
SCMP_FLTATR_CTL_TSYNC = 4,
SCMP_FLTATR_API_TSKIP = 5,
SCMP_FLTATR_CTL_LOG = 6,
SCMP_FLTATR_CTL_SSB = 7,
SCMP_FLTATR_CTL_OPTIMIZE = 8,
SCMP_FLTATR_API_SYSRAWRC = 9,
_SCMP_FLTATR_MAX = 10,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum scmp_compare {
_SCMP_CMP_MIN = 0,
SCMP_CMP_NE = 1,
SCMP_CMP_LT = 2,
SCMP_CMP_LE = 3,
SCMP_CMP_EQ = 4,
SCMP_CMP_GE = 5,
SCMP_CMP_GT = 6,
SCMP_CMP_MASKED_EQ = 7,
_SCMP_CMP_MAX = 8,
}
pub type scmp_datum_t = u64;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct scmp_arg_cmp {
pub arg: ::std::os::raw::c_uint,
pub op: scmp_compare,
pub datum_a: scmp_datum_t,
pub datum_b: scmp_datum_t,
}
extern "C" {
pub fn seccomp_version() -> *const scmp_version;
}
extern "C" {
pub fn seccomp_api_get() -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn seccomp_api_set(level: ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_init(def_action: u32) -> scmp_filter_ctx;
}
extern "C" {
pub fn seccomp_reset(ctx: scmp_filter_ctx, def_action: u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_release(ctx: scmp_filter_ctx);
}
extern "C" {
pub fn seccomp_merge(
ctx_dst: scmp_filter_ctx,
ctx_src: scmp_filter_ctx,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_arch_resolve_name(arch_name: *const ::std::os::raw::c_char) -> u32;
}
extern "C" {
pub fn seccomp_arch_native() -> u32;
}
extern "C" {
pub fn seccomp_arch_exist(ctx: scmp_filter_ctx, arch_token: u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_arch_add(ctx: scmp_filter_ctx, arch_token: u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_arch_remove(ctx: scmp_filter_ctx, arch_token: u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_load(ctx: scmp_filter_ctx) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_attr_get(
ctx: scmp_filter_ctx,
attr: scmp_filter_attr,
value: *mut u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_attr_set(
ctx: scmp_filter_ctx,
attr: scmp_filter_attr,
value: u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_syscall_resolve_num_arch(
arch_token: u32,
num: ::std::os::raw::c_int,
) -> *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn seccomp_syscall_resolve_name_arch(
arch_token: u32,
name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_syscall_resolve_name_rewrite(
arch_token: u32,
name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_syscall_resolve_name(
name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_syscall_priority(
ctx: scmp_filter_ctx,
syscall: ::std::os::raw::c_int,
priority: u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_rule_add(
ctx: scmp_filter_ctx,
action: u32,
syscall: ::std::os::raw::c_int,
arg_cnt: ::std::os::raw::c_uint,
...
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_rule_add_array(
ctx: scmp_filter_ctx,
action: u32,
syscall: ::std::os::raw::c_int,
arg_cnt: ::std::os::raw::c_uint,
arg_array: *const scmp_arg_cmp,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_rule_add_exact(
ctx: scmp_filter_ctx,
action: u32,
syscall: ::std::os::raw::c_int,
arg_cnt: ::std::os::raw::c_uint,
...
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_rule_add_exact_array(
ctx: scmp_filter_ctx,
action: u32,
syscall: ::std::os::raw::c_int,
arg_cnt: ::std::os::raw::c_uint,
arg_array: *const scmp_arg_cmp,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_notify_alloc(
req: *mut *mut seccomp_notif,
resp: *mut *mut seccomp_notif_resp,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_notify_free(req: *mut seccomp_notif, resp: *mut seccomp_notif_resp);
}
extern "C" {
pub fn seccomp_notify_receive(
fd: ::std::os::raw::c_int,
req: *mut seccomp_notif,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_notify_respond(
fd: ::std::os::raw::c_int,
resp: *mut seccomp_notif_resp,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_notify_id_valid(fd: ::std::os::raw::c_int, id: u64) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_notify_fd(ctx: scmp_filter_ctx) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_export_pfc(
ctx: scmp_filter_ctx,
fd: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn seccomp_export_bpf(
ctx: scmp_filter_ctx,
fd: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}