path: root/src/json.c
diff options
authorPhil Sutter <>2018-08-29 16:23:23 +0200
committerPablo Neira Ayuso <>2018-08-30 12:19:36 +0200
commit8125785d5c5d35ec275e508166091d5472748bc1 (patch)
treef95de547642eab67d12762a5297645e80ffa22c3 /src/json.c
parent2a4a5a2c8ae21f2bcf7e81b5eafea91d799ee88a (diff)
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 <>
Diffstat (limited to 'src/json.c')
1 files changed, 4 insertions, 1 deletions
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)