diff options
author | Simon THOBY <git@nightmared.fr> | 2022-12-03 22:53:23 +0100 |
---|---|---|
committer | Simon THOBY <git@nightmared.fr> | 2022-12-05 22:40:01 +0100 |
commit | edb440a952320ea4f021c1d7063ff6d5f2f13818 (patch) | |
tree | 5c18e7f1fabdcef8e140920ea75bfd0d0b400bd0 /src/parser.rs | |
parent | 4b60b3cd41f5198c47a260ce69abf4c15b60ca92 (diff) |
Macros: introduce a macro to simplify enums
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/parser.rs b/src/parser.rs index 7d89a1e..55f1e1c 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,5 +1,4 @@ use std::{ - any::TypeId, convert::TryFrom, fmt::{Debug, DebugStruct}, mem::{size_of, transmute}, @@ -9,10 +8,7 @@ use std::{ use thiserror::Error; use crate::{ - //expr::ExpressionHolder, - nlmsg::{ - AttributeDecoder, NetlinkType, NfNetlinkAttribute, NfNetlinkDeserializable, NfNetlinkWriter, - }, + nlmsg::{AttributeDecoder, NetlinkType, NfNetlinkAttribute, NfNetlinkDeserializable}, sys::{ nfgenmsg, nlattr, nlmsgerr, nlmsghdr, NFNETLINK_V0, NFNL_MSG_BATCH_BEGIN, NFNL_MSG_BATCH_END, NFNL_SUBSYS_NFTABLES, NLA_F_NESTED, NLA_TYPE_MASK, NLMSG_ALIGNTO, @@ -75,10 +71,10 @@ pub enum DecodeError { UnknownIcmpCode(u8), #[error("Invalid value for a register")] - UnknownRegisterValue, + UnknownRegister(u32), #[error("Invalid type for a verdict expression")] - UnknownExpressionVerdictType, + UnknownVerdictType(i32), #[error("The object does not contain a name for the expression being parsed")] MissingExpressionName, |