Re: [libnftnl PATCH 2/2] ruleset: refactor ruleset element parsing function calls to nft_ruleset_*_parse_ruleset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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;
> +}
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux