Enum libseccomp::ScmpAction
source · [−]#[non_exhaustive]
pub enum ScmpAction {
KillProcess,
KillThread,
Trap,
Notify,
Errno(i32),
Trace(u16),
Log,
Allow,
}
Expand description
Represents an action to be taken on a filter rule match in the libseccomp.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
KillProcess
Kills the process.
KillThread
Kills the thread.
Trap
Throws a SIGSYS signal.
Notify
Triggers a userspace notification. NOTE: This action is only usable when the libseccomp API level 6 or higher is supported.
Errno(i32)
Returns the specified error code.
NOTE: You can only use integers from 0 to u16::MAX
.
Trace(u16)
Notifies a tracing process with the specified value.
Log
Allows the syscall to be executed after the action has been logged.
Allow
Allows the syscall to be executed.
Implementations
sourceimpl ScmpAction
impl ScmpAction
sourcepub fn from_str(action: &str, val: Option<i32>) -> Result<Self, SeccompError>
pub fn from_str(action: &str, val: Option<i32>) -> Result<Self, SeccompError>
Converts string seccomp action to ScmpAction
.
Arguments
action
- A string action, e.g.SCMP_ACT_*
.
See the seccomp_rule_add(3)
man page for details on valid action values.
Errors
If an invalid action is specified or a value on "SCMP_ACT_TRACE"
is not in the
range from 0 to u16::MAX
, an error will be returned.
Trait Implementations
sourceimpl Clone for ScmpAction
impl Clone for ScmpAction
sourcefn clone(&self) -> ScmpAction
fn clone(&self) -> ScmpAction
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 moresourceimpl Debug for ScmpAction
impl Debug for ScmpAction
sourceimpl Hash for ScmpAction
impl Hash for ScmpAction
sourceimpl PartialEq<ScmpAction> for ScmpAction
impl PartialEq<ScmpAction> for ScmpAction
sourcefn eq(&self, other: &ScmpAction) -> bool
fn eq(&self, other: &ScmpAction) -> bool
impl Copy for ScmpAction
impl Eq for ScmpAction
impl StructuralEq for ScmpAction
impl StructuralPartialEq for ScmpAction
Auto Trait Implementations
impl RefUnwindSafe for ScmpAction
impl Send for ScmpAction
impl Sync for ScmpAction
impl Unpin for ScmpAction
impl UnwindSafe for ScmpAction
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