fn make_basic_seccomp_filter(&self, filter: Filter) -> Result<SeccompFilter> {
        let mut rule_map: SeccompRuleMap = SeccompRuleMap::new();
        let filter_action = &filter.filter_action;

        for syscall_rule in filter.filter {
            let syscall_name = syscall_rule.syscall;
            // Basic filters bypass the rule-level action and use the filter_action.
            let action = filter_action.clone();
            let syscall_nr = self
                .syscall_table
                .get_syscall_nr(&syscall_name)
                .ok_or_else(|| Error::SyscallName(syscall_name.clone(), self.arch))?;

            // If there is already an entry for this syscall, do nothing.
            // Otherwise, insert an empty rule that triggers the filter_action.
            rule_map
                .entry(syscall_nr)
                .or_insert_with(|| vec![SeccompRule::new(vec![], action)]);
        }

        SeccompFilter::new(rule_map, filter.default_action, self.arch.into())
            .map_err(Error::SeccompFilter)
    }
/// Transforms the deserialized `Filter` into a basic `SeccompFilter` (IR language).
/// This filter will drop any argument checks and any rule-level action.
/// All rules will trigger the filter-level `filter_action`.
Transforms the deserialized `Filter` into a basic `SeccompFilter` (IR language).
This filter will drop any argument checks and any rule-level action.
All rules will trigger the filter-level `filter_action`.
Transforms the deserialized ` Filter ` into a basic ` SeccompFilter ` ( IR language ) . This filter will drop any argument checks and any rule - level action . All rules will trigger the filter - level ` filter_action ` .
fn make_basic_seccomp_filter(&self, filter: Filter) -> Result<SeccompFilter> {
        let mut rule_map: SeccompRuleMap = SeccompRuleMap::new();
        let filter_action = &filter.filter_action;
        for syscall_rule in filter.filter {
            let syscall_name = syscall_rule.syscall;
            // Basic filters bypass the rule-level action and use the filter_action.
            let action = filter_action.clone();
            let syscall_nr = self
                .syscall_table
                .get_syscall_nr(&syscall_name)
                .ok_or_else(|| Error::SyscallName(syscall_name.clone(), self.arch))?;
            // If there is already an entry for this syscall, do nothing.
            // Otherwise, insert an empty rule that triggers the filter_action.
            rule_map
                .entry(syscall_nr)
                .or_insert_with(|| vec![SeccompRule::new(vec![], action)]);
        }
        SeccompFilter::new(rule_map, filter.default_action, self.arch.into())
            .map_err(Error::SeccompFilter)
    }
fn make_basic_seccomp_filter ( & self , filter : Filter ) -> Result < SeccompFilter > { let mut rule_map : SeccompRuleMap = SeccompRuleMap :: new ( ) ; let filter_action = & filter . filter_action ; for syscall_rule in filter . filter { let syscall_name = syscall_rule . syscall ; // Basic filters bypass the rule-level action and use the filter_action. let action = filter_action . clone ( ) ; let syscall_nr = self . syscall_table . get_syscall_nr ( & syscall_name ) . ok_or_else ( | | Error :: SyscallName ( syscall_name . clone ( ) , self . arch ) ) ? ; // If there is already an entry for this syscall, do nothing. // Otherwise, insert an empty rule that triggers the filter_action. rule_map . entry ( syscall_nr ) . or_insert_with ( | | vec ! [ SeccompRule new ( vec [ ] action ) ] ) ; } SeccompFilter :: new ( rule_map , filter . default_action , self . arch . into ( ) ) . map_err ( Error :: SeccompFilter ) }
Transforms the deserialized `Filter` into a basic `SeccompFilter` (IR language).
Transforms the deserialized ` Filter ` into a basic ` SeccompFilter ` ( IR language ) .
&self
filter
Filter
&self
filter
Filter