From 49e0f1dc6e52e791f5e0ba21097aea17d5950d38 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 29 Aug 2018 16:23:28 +0200 Subject: JSON: Add metainfo object to all output Right now this object merely contains the nftables version and release name as well as a JSON schema version, but it could be extended arbitrarily. In the future, this will also allow for non-compatible schema changes should the need for this arise. Adjust the parser to accept metainfo objects and make it verify json_schema_version to be less than or equal to the one hard-coded in the library. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- include/json.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/json.h') diff --git a/include/json.h b/include/json.h index e64151de..66f60e76 100644 --- a/include/json.h +++ b/include/json.h @@ -15,6 +15,8 @@ struct table; #ifdef HAVE_LIBJANSSON +#define JSON_SCHEMA_VERSION 1 + #include json_t *binop_expr_json(const struct expr *expr, struct output_ctx *octx); -- cgit v1.2.3