pub struct SeccompFilter {
pub instructions: Vec<BpfInstruction>,
pub inherit_on_fork: bool,
pub filter_id: u64,
}Expand description
A seccomp BPF filter program.
Fields§
§instructions: Vec<BpfInstruction>BPF instructions.
inherit_on_fork: boolWhether this filter should be inherited on fork.
filter_id: u64Filter ID for tracking.
Implementations§
Source§impl SeccompFilter
impl SeccompFilter
Sourcepub fn push(&mut self, insn: BpfInstruction)
pub fn push(&mut self, insn: BpfInstruction)
Add an instruction to the filter.
Sourcepub fn validate(&self) -> Result<(), KernelError>
pub fn validate(&self) -> Result<(), KernelError>
Validate the filter program.
Sourcepub fn evaluate(&self, data: &SeccompData) -> u32
pub fn evaluate(&self, data: &SeccompData) -> u32
Execute the filter against a seccomp_data structure. Returns the action (SeccompAction value | errno).
Sourcepub fn deny_syscalls(arch: u32, denied: &[u32], errno_val: u16) -> Self
pub fn deny_syscalls(arch: u32, denied: &[u32], errno_val: u16) -> Self
Build a filter that checks architecture and denies a set of syscall numbers.
Sourcepub fn allow_syscalls(arch: u32, allowed: &[u32]) -> Self
pub fn allow_syscalls(arch: u32, allowed: &[u32]) -> Self
Build a filter that only allows a whitelist of syscalls.
Trait Implementations§
Source§impl Clone for SeccompFilter
impl Clone for SeccompFilter
Source§fn clone(&self) -> SeccompFilter
fn clone(&self) -> SeccompFilter
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SeccompFilter
impl Debug for SeccompFilter
Auto Trait Implementations§
impl Freeze for SeccompFilter
impl RefUnwindSafe for SeccompFilter
impl Send for SeccompFilter
impl Sync for SeccompFilter
impl Unpin for SeccompFilter
impl UnwindSafe for SeccompFilter
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)