diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/json.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/json.h b/include/json.h index 579bd5df..ae393814 100644 --- a/include/json.h +++ b/include/json.h @@ -1,6 +1,8 @@ #ifndef NFTABLES_JSON_H #define NFTABLES_JSON_H +#include <errno.h> + struct chain; struct cmd; struct expr; @@ -74,6 +76,11 @@ json_t *verdict_stmt_json(const struct stmt *stmt, struct output_ctx *octx); int do_command_list_json(struct netlink_ctx *ctx, struct cmd *cmd); +int nft_parse_json_buffer(struct nft_ctx *nft, char *buf, size_t buflen, + struct list_head *msgs, struct list_head *cmds); +int nft_parse_json_filename(struct nft_ctx *nft, const char *filename, + struct list_head *msgs, struct list_head *cmds); + #else /* ! HAVE_LIBJANSSON */ typedef void json_t; @@ -156,6 +163,19 @@ static inline int do_command_list_json(struct netlink_ctx *ctx, struct cmd *cmd) return -1; } +static inline int +nft_parse_json_buffer(struct nft_ctx *nft, char *buf, size_t buflen, + struct list_head *msgs, struct list_head *cmds) +{ + return -EINVAL; +} +static inline int +nft_parse_json_filename(struct nft_ctx *nft, const char *filename, + struct list_head *msgs, struct list_head *cmds) +{ + return -EINVAL; +} + #endif /* HAVE_LIBJANSSON */ #endif /* NFTABLES_JSON_H */ |