Re: [PATCH nft 1/2] json: implement json() hook for "symbol_expr_ops"/"variabl_expr_ops"

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

 



On Thu, Nov 02, 2023 at 12:20:28PM +0100, Thomas Haller wrote:
> The ultimate goal is that all "struct expr_ops" have a "json()" hook
> set.
> 
> It's also faster, to just create the JSON node, instead of creating a
> memory stream, write there using print only to get the sting.
> 
> Signed-off-by: Thomas Haller <thaller@xxxxxxxxxx>
> ---
> The patches 1/2 and 2/2 replaces
> 
>   Subject:	[PATCH nft 2/7] json: drop messages "warning: stmt ops chain have no json callback"
>   Date:	Tue, 31 Oct 2023 19:53:28 +0100
> 
>  include/json.h   |  4 ++++
>  src/expression.c |  2 ++
>  src/json.c       | 10 ++++++++++
>  3 files changed, 16 insertions(+)
> 
> diff --git a/include/json.h b/include/json.h
> index 39be8928e8ee..134e503afe54 100644
> --- a/include/json.h
> +++ b/include/json.h
> @@ -49,7 +49,9 @@ json_t *rt_expr_json(const struct expr *expr, struct output_ctx *octx);
>  json_t *numgen_expr_json(const struct expr *expr, struct output_ctx *octx);
>  json_t *hash_expr_json(const struct expr *expr, struct output_ctx *octx);
>  json_t *fib_expr_json(const struct expr *expr, struct output_ctx *octx);
> +json_t *symbol_expr_json(const struct expr *expr, struct output_ctx *octx);
>  json_t *constant_expr_json(const struct expr *expr, struct output_ctx *octx);
> +json_t *variable_expr_json(const struct expr *expr, struct output_ctx *octx);

Makes no sense.

Are these expression really triggering specifically errors? I don't
think so.

This expressions are consumed, ie. the get transformed into a
value_expr, but never use in an output path.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux