From: Phil Sutter <phil@nwl.cc>
To: netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH 0/3] xshared: Review option parsing
Date: Wed, 29 Nov 2023 02:21:00 +0100 [thread overview]
Message-ID: <ZWaR/LhhbCZwStEl@orbyte.nwl.cc> (raw)
In-Reply-To: <20231124111325.5221-1-phil@nwl.cc>
On Fri, Nov 24, 2023 at 12:13:22PM +0100, Phil Sutter wrote:
> Faced with the need to extend optflags, inverse_for_options and
> commands_v_options arrays in order to integrate ebtables-specific
> options, I chose to get rid of them all instead.
>
> Patch 1 replaces opt2char() function which didn't work well since not
> every option has printable short-option character. The callback-based
> replacement returns the long-option and should make error messages more
> readable this way.
>
> Patch 2 elminates the inverse_for_options array along with the loop
> turning a given option into its bit's position for use in the array. The
> switch statement in the replacing callback is much easier to maintain
> and extend.
>
> Patch 3 makes use of the fact that no command has a mandatory option
> anymore. So every combination is either allowed or not, and a single bit
> may indicate that.
>
> Phil Sutter (3):
> xshared: Introduce xt_cmd_parse_ops::option_name
> xshared: Introduce xt_cmd_parse_ops::option_invert
> xshared: Simplify generic_opt_check()
Series applied.
prev parent reply other threads:[~2023-11-29 1:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 11:13 [iptables PATCH 0/3] xshared: Review option parsing Phil Sutter
2023-11-24 11:13 ` [iptables PATCH 1/3] xshared: Introduce xt_cmd_parse_ops::option_name Phil Sutter
2023-11-24 11:13 ` [iptables PATCH 2/3] xshared: Introduce xt_cmd_parse_ops::option_invert Phil Sutter
2023-11-24 11:13 ` [iptables PATCH 3/3] xshared: Simplify generic_opt_check() Phil Sutter
2023-11-29 1:21 ` Phil Sutter [this message]
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=ZWaR/LhhbCZwStEl@orbyte.nwl.cc \
--to=phil@nwl.cc \
--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).