From 8125785d5c5d35ec275e508166091d5472748bc1 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 29 Aug 2018 16:23:23 +0200 Subject: JSON: Review verdict statement and expression Change jump and goto verdicts to become extensible by dedicating an object for the target parameter. While being at it, drop break and queue verdict expressions since they don't seem to exist, no idea where I got those from in the first place. For queue, there is a dedicated expression at least. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/json.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/json.c') diff --git a/src/json.c b/src/json.c index 0c708c7d..30ee81cf 100644 --- a/src/json.c +++ b/src/json.c @@ -642,7 +642,10 @@ json_t *verdict_expr_json(const struct expr *expr, struct output_ctx *octx) BUG("Unknown verdict %d.", expr->verdict); return NULL; } - return json_pack("{s:o}", name, chain ? json_string(chain) : json_null()); + if (chain) + return json_pack("{s:{s:s}}", name, "target", chain); + else + return json_pack("{s:n}", name); } json_t *rt_expr_json(const struct expr *expr, struct output_ctx *octx) -- cgit v1.2.3