[][src]Struct libseccomp_rs::Seccomp

pub struct Seccomp { /* fields omitted */ }

Methods

impl Seccomp[src]

pub fn init(act: c_uint) -> Self[src]

initialize the seccomp and set the context into the struct

pub fn load(self) -> Result<c_int, String>[src]

load seccomp to kernel

pub fn add_arch(&self, arch_token: c_uint) -> Result<c_int, String>[src]

add an architecture

pub fn remove_arch(&self, arch_token: c_uint) -> Result<c_int, String>[src]

remove an architecture

pub fn get_attr(
    ctx: *const SCMP_FILTER_CTX,
    attr: SCMP_FILTER_ATTR,
    value: *mut c_uint
) -> Result<*mut c_uint, String>
[src]

pub fn set_attr(
    &self,
    attr: SCMP_FILTER_ATTR,
    value: c_uint
) -> Result<c_int, String>
[src]

pub fn add_exact_rule(
    &self,
    action: c_uint,
    syscall: c_int,
    arg_cnt: c_uint,
    arg: SCMP_ARG_CMP
) -> Result<c_int, String>
[src]

pub fn add_exact_rules(
    &self,
    action: c_uint,
    syscall: c_int,
    arg_cnt: c_uint,
    arg_array: Vec<SCMP_ARG_CMP>
) -> Result<c_int, String>
[src]

pub fn add_rule(
    &self,
    action: c_uint,
    syscall: c_int,
    arg_cnt: c_uint,
    arg: SCMP_ARG_CMP
) -> Result<c_int, String>
[src]

adding rule to seccomp before the seccomp loaded to kernel

pub fn add_rules(
    &self,
    action: c_uint,
    syscall: c_int,
    arg_cnt: c_uint,
    arg_array: Vec<SCMP_ARG_CMP>
) -> Result<c_int, String>
[src]

adding rules(vector) to seccomp before the seccomp loaded to kernel

pub fn export_bpf(
    ctx: *const SCMP_FILTER_CTX,
    fd: c_int
) -> Result<c_int, String>
[src]

pub fn export_pfc(
    ctx: *const SCMP_FILTER_CTX,
    fd: c_int
) -> Result<c_int, String>
[src]

pub fn resolve_syscall_name(name: &str) -> i32[src]

if you are using arm/aarch64 you could use this instead of SCMP_SYS

pub fn syscall_priority(
    &self,
    syscall: c_int,
    priority: u8
) -> Result<c_int, String>
[src]

pub fn reset(&self, def_action: c_uint) -> Result<c_int, String>[src]

reset the seccomp

pub fn release(ctx: *mut SCMP_FILTER_CTX)[src]

release the seccomp from kernel

Auto Trait Implementations

impl Unpin for Seccomp

impl !Sync for Seccomp

impl !Send for Seccomp

impl UnwindSafe for Seccomp

impl RefUnwindSafe for Seccomp

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]