Struct seccompiler::SeccompRule
source · [−]pub struct SeccompRule { /* private fields */ }
Expand description
Rule that a filter attempts to match for a syscall.
If all conditions match then rule gets matched.
A syscall can have many rules associated. If either of them matches, the match_action
of the
SeccompFilter
is triggered.
Implementations
sourceimpl SeccompRule
impl SeccompRule
sourcepub fn new(conditions: Vec<SeccompCondition>) -> Result<Self, Error>
pub fn new(conditions: Vec<SeccompCondition>) -> Result<Self, Error>
Creates a new rule. Rules with 0 conditions are not allowed.
Arguments
conditions
- Vector ofSeccompCondition
s that the syscall must match.
Example
use seccompiler::{SeccompCmpArgLen, SeccompCmpOp, SeccompCondition, SeccompRule};
let rule = SeccompRule::new(vec![
SeccompCondition::new(0, SeccompCmpArgLen::Dword, SeccompCmpOp::Eq, 1).unwrap(),
SeccompCondition::new(1, SeccompCmpArgLen::Dword, SeccompCmpOp::Eq, 1).unwrap(),
])
.unwrap();
Trait Implementations
sourceimpl Clone for SeccompRule
impl Clone for SeccompRule
sourcefn clone(&self) -> SeccompRule
fn clone(&self) -> SeccompRule
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SeccompRule
impl Debug for SeccompRule
sourceimpl From<SeccompRule> for BpfProgram
impl From<SeccompRule> for BpfProgram
sourcefn from(rule: SeccompRule) -> Self
fn from(rule: SeccompRule) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<SeccompRule> for SeccompRule
impl PartialEq<SeccompRule> for SeccompRule
sourcefn eq(&self, other: &SeccompRule) -> bool
fn eq(&self, other: &SeccompRule) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Eq for SeccompRule
impl StructuralEq for SeccompRule
impl StructuralPartialEq for SeccompRule
Auto Trait Implementations
impl RefUnwindSafe for SeccompRule
impl Send for SeccompRule
impl Sync for SeccompRule
impl Unpin for SeccompRule
impl UnwindSafe for SeccompRule
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more