From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH 3/8] xtables-restore: Introduce rule counter tokenizer function
Date: Fri, 18 Oct 2019 11:50:54 +0200 [thread overview]
Message-ID: <20191018095054.GC26123@orbyte.nwl.cc> (raw)
In-Reply-To: <20191018081124.obynzh3xbpo5k4gf@salvia>
Hi Pablo,
On Fri, Oct 18, 2019 at 10:11:24AM +0200, Pablo Neira Ayuso wrote:
> On Fri, Oct 18, 2019 at 12:48:31AM +0200, Phil Sutter wrote:
> > The same piece of code appears three times, introduce a function to take
> > care of tokenizing and error reporting.
> >
> > Pass buffer pointer via reference so it can be updated to point to after
> > the counters (if found).
> >
> > While being at it, drop pointless casting when passing pcnt/bcnt to
> > add_argv().
> >
> > Signed-off-by: Phil Sutter <phil@nwl.cc>
>
> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
>
> If you get to consolidate more common code between xml and native
> parsers, probably you can add a xtables-restore.c file to store all
> these functions are common, just an idea for the future.
I get the point, but we have xtables-restore.c already. Though it
contains *tables-nft-restore code. I would add to xshared.c until we
decide it's large enough to split (currently ~750 lines). AFAICT, this
is the only source file included in both xtables-*-multi binaries. Other
than that, I could extend libxtables to really share code but it's
probably not worth it.
Cheers, Phil
next prev parent reply other threads:[~2019-10-18 9:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 22:48 [iptables PATCH 0/8] A bit of *tables-restore review fallout Phil Sutter
2019-10-17 22:48 ` [iptables PATCH 1/8] xtables-restore: Treat struct nft_xt_restore_parse as const Phil Sutter
2019-10-18 8:09 ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 2/8] xtables-restore: Use xt_params->program_name Phil Sutter
2019-10-18 8:09 ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 3/8] xtables-restore: Introduce rule counter tokenizer function Phil Sutter
2019-10-18 8:11 ` Pablo Neira Ayuso
2019-10-18 9:50 ` Phil Sutter [this message]
2019-10-18 10:03 ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 4/8] xtables-restore: Constify struct nft_xt_restore_cb Phil Sutter
2019-10-18 8:11 ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 5/8] iptables-restore: Constify struct iptables_restore_cb Phil Sutter
2019-10-18 8:12 ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 6/8] xtables-restore: Drop pointless newargc reset Phil Sutter
2019-10-18 8:30 ` Pablo Neira Ayuso
2019-10-18 9:54 ` Phil Sutter
2019-10-17 22:48 ` [iptables PATCH 7/8] xtables-restore: Drop local xtc_ops instance Phil Sutter
2019-10-18 8:31 ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 8/8] xtables-restore: Drop chain_list callback Phil Sutter
2019-10-18 8:32 ` 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=20191018095054.GC26123@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).