From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net
Subject: Re: [PATCH 1/3] scanner: replace binary characters '&' '|' and '!' by their names
Date: Tue, 14 Jan 2014 13:00:57 +0100 [thread overview]
Message-ID: <20140114120057.GA6957@localhost> (raw)
In-Reply-To: <1389699030-6301-2-git-send-email-pablo@netfilter.org>
On Tue, Jan 14, 2014 at 12:30:28PM +0100, Pablo Neira Ayuso wrote:
> These symbol need to be escaped in bash and can lead to confusion,
> so let's use their names instead which are still short, eg.
>
> nft add rule filter output meta mark and 0x3 == 0x1
>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> src/scanner.l | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/scanner.l b/src/scanner.l
> index cee6aa6..2d7ac88 100644
> --- a/src/scanner.l
> +++ b/src/scanner.l
> @@ -200,9 +200,9 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
> "<<" { return LSHIFT; }
> ">>" { return RSHIFT; }
> "^" { return CARET; }
Extending this proposal:
For consistency, we can also rename the caret to 'xor'.
Regarding <<, we can use lshift, but that's a bit longer.
We also have >, >=, < and <=. We could use gt, ge, lt, le.
> -"&" { return AMPERSAND; }
> -"|" { return '|'; }
> -"!" { return NOT; }
> +"and" { return AMPERSAND; }
> +"or" { return '|'; }
> +"not" { return NOT; }
> "/" { return SLASH; }
> "-" { return DASH; }
> "*" { return ASTERISK; }
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-01-14 12:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 11:30 [PATCH 0/3 nft] [RFC] more syntax changes Pablo Neira Ayuso
2014-01-14 11:30 ` [PATCH 1/3] scanner: replace binary characters '&' '|' and '!' by their names Pablo Neira Ayuso
2014-01-14 12:00 ` Pablo Neira Ayuso [this message]
2014-01-14 12:24 ` Patrick McHardy
2014-01-14 12:21 ` Patrick McHardy
2014-01-14 11:30 ` [PATCH 2/3] evaluate: allow to use string with binary operations Pablo Neira Ayuso
2014-01-14 12:22 ` Patrick McHardy
2014-01-14 15:25 ` Pablo Neira Ayuso
2014-01-14 15:49 ` Patrick McHardy
2014-01-15 9:29 ` Pablo Neira Ayuso
2014-01-15 15:58 ` Pablo Neira Ayuso
2014-01-15 16:05 ` Patrick McHardy
2014-01-14 11:30 ` [PATCH 3/3] scanner: rename address selector from 'eth' to 'ether' Pablo Neira Ayuso
2014-01-14 12:23 ` Patrick McHardy
2014-01-14 11:47 ` [PATCH 0/3 nft] [RFC] more syntax changes Arturo Borrero Gonzalez
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=20140114120057.GA6957@localhost \
--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).