netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net
Subject: [PATCH nft] scanner: add aliases to symbols for easier interaction with most shells
Date: Tue, 14 Jan 2014 15:55:14 +0100	[thread overview]
Message-ID: <1389711314-9008-1-git-send-email-pablo@netfilter.org> (raw)

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>
---
 src/scanner.l |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/scanner.l b/src/scanner.l
index ee71492..50e24a4 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; }
-- 
1.7.10.4


             reply	other threads:[~2014-01-14 14:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 14:55 Pablo Neira Ayuso [this message]
2014-01-15  9:30 ` [PATCH nft] scanner: add aliases to symbols for easier interaction with most shells Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1389711314-9008-1-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).