Struct libscmp::Filter[][src]

pub struct Filter { /* fields omitted */ }
Expand description

Represents a syscall filter.

Implementations

Create a new seccomp filter with the given default action.

Re-initialize this seccomp filter with the given default action.

Merge another seccomp filter into this one.

See seccomp_merge(3) for more details.

Load the syscall filter rules into the kernel.

Export this filter as BPF (Berkeley Packet Filter) code to the file with the specified file descriptor.

See seccomp_export_bpf(3) for more details.

Export this filter as PFC (Pseudo Filter Code) code to the file with the specified file descriptor.

See seccomp_export_pfc(3) for more details.

Add the given architecture to the filter,

See seccomp_arch_add(3) for details.

Remove the given architecture from the filter,

See seccomp_arch_remove(3) for details.

Check if the given architecture has been added to the filter.

See seccomp_arch_exist(3) for details.

Prioritize the given syscall in this filter.

This provides a hint to the seccomp filter generator that the given syscall should be prioritized and placed earlier in the filter code. Higher priority values represent higher priorities.

See seccomp_syscall_priority(3) for details.

Add a new rule to this filter.

action specifies the action to take if the filter matches, syscall specifies the system call number which should be matched against, and args is a list of syscall argument comparisons to use to match the syscall’s arguments.

This function may alter the rule slightly depending on architecture-specific semantics. To add the rule with no changes, see add_rule_exact().

Add a new rule to this filter, without any per-architecture modifications.

Other than the lack of per-architecture modifications, this is exactly equivalent to add_rule().

Get the default filter action (as set when the filter was created or reset).

Get the action taken when the loaded filter does not match the application’s architecture (defaults to KillThread).

Set the action taken when the loaded filter does not match the application’s architecture.

Get the value of the given flag in this filter.

See Flag for more details.

Set the value of the given flag in this filter.

See Flag for more details.

Get the current optimization level of the filter.

See seccomp_attr_get(3) for more information.

Note: This only works on libseccomp v2.5.0+.

Set the optimization level of the filter.

See seccomp_attr_get(3) for more information.

Note: This only works on libseccomp v2.5.0+.

Get the notification file descriptor of the filter after it has been loaded.

Receive a seccomp notification from the notification file descriptor of this filter.

Send a seccomp notification response along the notification file descriptor of this filter.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.