diff options
author | Simon THOBY <git@nightmared.fr> | 2022-12-03 22:47:53 +0100 |
---|---|---|
committer | Simon THOBY <git@nightmared.fr> | 2022-12-03 22:50:09 +0100 |
commit | 4b60b3cd41f5198c47a260ce69abf4c15b60ca92 (patch) | |
tree | ef3b7df96306820fc35db909762ac3c4227de87f /src/expr/log.rs | |
parent | 3b11070076f0509f9423d6c4f582f6cf636df65a (diff) |
convert the expressions to the new macros
Diffstat (limited to 'src/expr/log.rs')
-rw-r--r-- | src/expr/log.rs | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/src/expr/log.rs b/src/expr/log.rs index 82c201d..3c72257 100644 --- a/src/expr/log.rs +++ b/src/expr/log.rs @@ -1,29 +1,17 @@ +use rustables_macros::nfnetlink_struct; + use super::{Expression, ExpressionError}; -use crate::create_wrapper_type; -use crate::sys; +use crate::sys::{NFTA_LOG_GROUP, NFTA_LOG_PREFIX}; -// A Log expression will log all packets that match the rule. -create_wrapper_type!( - inline: Log, - [ - ( - get_group, - set_group, - with_group, - sys::NFTA_LOG_GROUP, - group, - u32 - ), - ( - get_prefix, - set_prefix, - with_prefix, - sys::NFTA_LOG_PREFIX, - prefix, - String - ) - ] -); +#[derive(Clone, PartialEq, Eq, Default, Debug)] +#[nfnetlink_struct] +/// A Log expression will log all packets that match the rule. +pub struct Log { + #[field(NFTA_LOG_GROUP)] + group: u32, + #[field(NFTA_LOG_PREFIX)] + prefix: String, +} impl Log { pub fn new( |