From 80077787f8f21da1efd8dc27a4c5767ab47a1df6 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 9 Oct 2018 00:03:28 +0200 Subject: src: remove json support We have better json support in libnftables these days. Signed-off-by: Pablo Neira Ayuso --- src/expr/match.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'src/expr/match.c') diff --git a/src/expr/match.c b/src/expr/match.c index dd09e1e..85dd79c 100644 --- a/src/expr/match.c +++ b/src/expr/match.c @@ -164,36 +164,6 @@ static int nftnl_expr_match_parse(struct nftnl_expr *e, struct nlattr *attr) return 0; } -static int nftnl_expr_match_json_parse(struct nftnl_expr *e, json_t *root, - struct nftnl_parse_err *err) -{ -#ifdef JSON_PARSING - const char *name; - - name = nftnl_jansson_parse_str(root, "name", err); - if (name != NULL) - nftnl_expr_set_str(e, NFTNL_EXPR_MT_NAME, name); - - return 0; -#else - errno = EOPNOTSUPP; - return -1; -#endif -} - - -static int nftnl_expr_match_export(char *buf, size_t size, - const struct nftnl_expr *e, int type) -{ - struct nftnl_expr_match *mt = nftnl_expr_data(e); - NFTNL_BUF_INIT(b, buf, size); - - if (e->flags & (1 << NFTNL_EXPR_MT_NAME)) - nftnl_buf_str(&b, type, mt->name, NAME); - - return nftnl_buf_done(&b); -} - static int nftnl_expr_match_snprintf(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e) @@ -206,7 +176,6 @@ nftnl_expr_match_snprintf(char *buf, size_t len, uint32_t type, match->name, match->rev); case NFTNL_OUTPUT_XML: case NFTNL_OUTPUT_JSON: - return nftnl_expr_match_export(buf, len, e, type); default: break; } @@ -250,5 +219,4 @@ struct expr_ops expr_ops_match = { .parse = nftnl_expr_match_parse, .build = nftnl_expr_match_build, .snprintf = nftnl_expr_match_snprintf, - .json_parse = nftnl_expr_match_json_parse, }; -- cgit v1.2.3