Re: [libnftables PATCH 1/3] parsing: rework and generalize the build/parse system

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

 



On Thu, Jan 09, 2014 at 12:19:06PM +0100, Arturo Borrero Gonzalez wrote:
> The intention behind this patch is to allow adding more input sources in the
> near future.

This looks more simple and easier to read which is what I needed,
thanks. Applied with minor glitches, see below.

> For this to happen without duplicating many code, we need to generalize
> the build/parse system.
> 
> The path flow is now as follow:
>  * API func: here we decide what kind of input we have.
> 	nft_table_parse()
> 
>  * Common function to decide what format to parse (JSON/XML).
> 	nft_table_do_parse()
> 
>  * Common function per format to order the build of the tree and launch the
>    parsing:
> 	nft_table_xml_parse()
> 	nft_table_json_parse()
> 
>  * Common function per format to build the tree (here more builders can be
>    easily implemented):
> 	nft_mxml_build_tree()
> 	nft_jansson_create_root()
> 
> Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
> ---
>  0 files changed
> 
> diff --git a/src/chain.c b/src/chain.c
> index a4ddb06..a7a6d99 100644
> --- a/src/chain.c
> +++ b/src/chain.c
> @@ -591,14 +591,14 @@ err:
>  }
>  #endif
>  
> -static int nft_chain_json_parse(struct nft_chain *c, const char *json,
> -				struct nft_parse_err *err)
> +static int nft_chain_json_parse(struct nft_chain *c, const void *json,
> +				struct nft_parse_err *err, uint32_t buildsrc)

Comestical: I have added enum nft_parse_input, I think this improves
readability instead of buildsrc.
--
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