macro_rules! seccomp_arg_filter {
($argno:ident <= $value:expr) => { ... };
($argno:ident < $value:expr) => { ... };
($argno:ident >= $value:expr) => { ... };
($argno:ident > $value:expr) => { ... };
($argno:ident == $value:expr) => { ... };
($argno:ident != $value:expr) => { ... };
($argno:ident & $mask:tt == $value:expr) => { ... };
($_other:expr) => { ... };
}Expand description
A macro to easily create crate::SeccompArgumentFilters. Note that because internally it uses a
helper macro, to use this macro you should just use extrasafe::* if possible.
Usage:
use extrasafe::*;
// usage: `seccomp_arg_filter!(<argN> <operator> <value>);`
// or `seccomp_arg_filter!(<argN> & <mask> == <value>);`
// arg0 through arg5 are supported
// operations <=, <, >=, >, ==, != are supported
let argfilter = seccomp_arg_filter!(arg0 < 5);
// Masked equality is also supported to check specific bits are set.
// The following checks the second bit of the syscall's 4th argument is set.
let argfilter = seccomp_arg_filter!(arg4 & 0b10 == 0b10);