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§
source§impl 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§
source§impl Clone for SeccompRule
impl Clone for SeccompRule
source§fn clone(&self) -> SeccompRule
fn clone(&self) -> SeccompRule
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SeccompRule
impl Debug for SeccompRule
source§impl From<SeccompRule> for BpfProgram
impl From<SeccompRule> for BpfProgram
source§fn from(rule: SeccompRule) -> Self
fn from(rule: SeccompRule) -> Self
Converts to this type from the input type.
source§impl PartialEq for SeccompRule
impl PartialEq for SeccompRule
source§fn 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 ==
.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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more