Re: [libnftnl PATCH 2/4 v2] src: add support to import json/xml with the new syntax

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

 



On Fri, Jan 30, 2015 at 03:35:23PM +0100, Alvaro Neira Ayuso wrote:
> diff --git a/src/ruleset.c b/src/ruleset.c
> index 3fb381d..0c8eadf 100644
> --- a/src/ruleset.c
> +++ b/src/ruleset.c
> @@ -32,6 +32,31 @@ struct nft_ruleset {
>  	uint16_t		flags;
>  };
>  
> +struct nft_parse_ctx {
> +	uint32_t cmd;
> +	uint32_t type;
> +	uint32_t format;
> +	union {
> +		struct nft_table *table;
> +		struct nft_chain *chain;
> +		struct nft_rule *rule;
> +		struct nft_set *set;
> +		struct nft_set_elem *set_elem;
> +	};
> +	union {
> +		json_t *json;
> +		mxml_node_t *xml;
> +	};
> +

Please, put all private fields below a comment like:

/* These fields below are not exposed to the user */

> +	uint32_t set_id;
> +	struct nft_set_list *set_list;

These two are private too, and include uint32_t format here too.

> +	void *data;

This 'data' public, so place it above that comment.

So if we need to have a look at this later on, we easily know what is
exposed and what is not.

> +	int (*cb)(const struct nft_parse_ctx *ctx);
> +	uint16_t flags;
> +};
--
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