summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-01-14 15:55:14 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2014-01-15 10:18:34 +0100
commitb59e65c0f24b64936113e2b72f83466a88f8a4c2 (patch)
tree33b89cff52c6bab4ca2d4532c57499dfa8f99a2c /src
parent6a69a383143da57143fe42f786adfd1e804dd784 (diff)
scanner: add aliases to symbols for easier interaction with most shells
These symbols need to be escaped in bash and if you use them without escaping then, it can lead to confusion. This patch adds nominal aliases, eg. nft add rule filter output meta mark and 0x3 eq 0x1 as an alternative to: nft add rule filter output meta mark \& 0x3 == 0x1 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/scanner.l12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/scanner.l b/src/scanner.l
index 345b1314..66735b11 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -182,11 +182,17 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
%%
"==" { return EQ; }
+"eq" { return EQ; }
"!=" { return NEQ; }
+"ne" { return NEQ; }
"<=" { return LTE; }
+"le" { return LTE; }
"<" { return LT; }
+"lt" { return LT; }
">=" { return GTE; }
+"ge" { return GTE; }
">" { return GT; }
+"gt" { return GT; }
"," { return COMMA; }
"." { return DOT; }
":" { return COLON; }
@@ -198,11 +204,17 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
"(" { return '('; }
")" { return ')'; }
"<<" { return LSHIFT; }
+"lshift" { return LSHIFT; }
">>" { return RSHIFT; }
+"rshift" { return RSHIFT; }
"^" { return CARET; }
+"xor" { return CARET; }
"&" { return AMPERSAND; }
+"and" { return AMPERSAND; }
"|" { return '|'; }
+"or" { return '|'; }
"!" { return NOT; }
+"not" { return NOT; }
"/" { return SLASH; }
"-" { return DASH; }
"*" { return ASTERISK; }