aboutsummaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
authorSimon THOBY <git@nightmared.fr>2022-11-15 22:25:36 +0100
committerSimon THOBY <git@nightmared.fr>2022-11-15 22:25:36 +0100
commitd1170d81c85254d2fe5ef5d3fc92cc6eb35357a4 (patch)
tree6f5645e3b7313681f083135a3718a8da129574f3 /src/parser.rs
parent22edb0197854bf4f504e833e69b0e545d382f065 (diff)
exprs: implement bitwise and add support for unknown expressions
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 42bcb00..8b14d74 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -36,6 +36,9 @@ pub enum DecodeError {
#[error("Missing information in the chain to create a rule")]
MissingChainInformationError,
+ #[error("The length of the arguments are not compatible with each other")]
+ IncompatibleLength,
+
#[error("Invalid subsystem, expected NFTABLES")]
InvalidSubsystem(u8),
@@ -72,9 +75,6 @@ pub enum DecodeError {
#[error("The object does not contain a name for the expression being parsed")]
MissingExpressionName,
- #[error("The expression name was not recognized")]
- UnknownExpressionName(String),
-
#[error("Unsupported attribute type")]
UnsupportedAttributeType(u16),
@@ -486,11 +486,12 @@ impl_attribute_holder!(
[ExpressionVariant, crate::expr::ExpressionVariant],
[ExpressionList, crate::expr::ExpressionList],
[ExprLog, crate::expr::Log],
- [ExprImmediate, crate::expr::ImmediateData],
- [ExprImmediateData, crate::expr::ImmediateData],
+ [ExprImmediate, crate::expr::Immediate],
+ [ExprData, crate::expr::ExpressionData],
[ExprVerdictAttribute, crate::expr::VerdictAttribute],
[ExprVerdictType, crate::expr::VerdictType],
- [Register, crate::expr::Register]
+ [Register, crate::expr::Register],
+ [ExprRaw, crate::expr::ExpressionRaw]
);
#[macro_export]