All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [libnftnl PATCH 2/2] ruleset: refactor ruleset element parsing function calls to nft_ruleset_*_parse_ruleset()
Date: Thu, 15 Jan 2015 13:11:14 +0100	[thread overview]
Message-ID: <20150115121114.GA6473@salvia> (raw)
In-Reply-To: <1421070375-1057-2-git-send-email-alvaroneay@gmail.com>

On Mon, Jan 12, 2015 at 02:46:15PM +0100, Alvaro Neira Ayuso wrote:
> Refactor the parsing ruleset element functions calls in xml/json to do that
> calls in the functions nft_ruleset_*_parse_ruleset. This patch is used in follow
> up patches.

Applied with minor change.

> 
> Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
> ---
>  src/ruleset.c |   59 ++++++++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 39 insertions(+), 20 deletions(-)
> 
> diff --git a/src/ruleset.c b/src/ruleset.c
> index a397824..6488d72 100644
> --- a/src/ruleset.c
> +++ b/src/ruleset.c
> @@ -332,6 +332,24 @@ err:
>  
>  #endif

I had to move this endif to cover this new function too, so I don't
get compilation warnings with XML/JSON disabled.

> +static int nft_ruleset_json_parse_ruleset(struct nft_ruleset *rs, json_t *array,
> +					  struct nft_parse_err *err)
> +{
> +	if (nft_ruleset_json_parse_tables(rs, array, err) != 0)
> +		return -1;
> +
> +	if (nft_ruleset_json_parse_chains(rs, array, err) != 0)
> +		return -1;
> +
> +	if (nft_ruleset_json_parse_sets(rs, array, err) != 0)
> +		return -1;
> +
> +	if (nft_ruleset_json_parse_rules(rs, array, err) != 0)
> +		return -1;
> +
> +	return 0;
> +}

  reply	other threads:[~2015-01-15 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 13:46 [libnftnl PATCH 1/2 v2] src: not create iterator with empty list Alvaro Neira Ayuso
2015-01-12 13:46 ` [libnftnl PATCH 2/2] ruleset: refactor ruleset element parsing function calls to nft_ruleset_*_parse_ruleset() Alvaro Neira Ayuso
2015-01-15 12:11   ` Pablo Neira Ayuso [this message]
2015-01-15 12:10 ` [libnftnl PATCH 1/2 v2] src: not create iterator with empty list 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=20150115121114.GA6473@salvia \
    --to=pablo@netfilter.org \
    --cc=alvaroneay@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.