From 0758d102627744847d0bd2e4744d27695edb9a14 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Thu, 22 Sep 2016 16:58:13 +0200 Subject: src: remove libmxml support This patch removes the libmxml integration in libnftnl, since we have JSON in place and there is no need to support two at the same time. The JSON support is much better, for example libjansson has a better parsing error reporting. Moreover, libmxml 2.10 breaks the integration with libnftnl somehow, as reported in Debian bug #83870 [0]. Also, the XML support inside libnftnl has never been in good shape, with several tiny inconsitencies. [0] https://bugs.debian.org/838370 Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- src/expr/meta.c | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/expr/meta.c') diff --git a/src/expr/meta.c b/src/expr/meta.c index 6abf6c4..2c75841 100644 --- a/src/expr/meta.c +++ b/src/expr/meta.c @@ -215,38 +215,6 @@ static int nftnl_expr_meta_json_parse(struct nftnl_expr *e, json_t *root, #endif } - -static int nftnl_expr_meta_xml_parse(struct nftnl_expr *e, mxml_node_t *tree, - struct nftnl_parse_err *err) -{ -#ifdef XML_PARSING - const char *key_str; - int key; - uint32_t dreg, sreg; - - key_str = nftnl_mxml_str_parse(tree, "key", MXML_DESCEND_FIRST, - NFTNL_XML_MAND, err); - if (key_str != NULL) { - key = str2meta_key(key_str); - if (key >= 0) - nftnl_expr_set_u32(e, NFTNL_EXPR_META_KEY, key); - } - - if (nftnl_mxml_reg_parse(tree, "dreg", &dreg, MXML_DESCEND_FIRST, - NFTNL_XML_OPT, err) == 0) - nftnl_expr_set_u32(e, NFTNL_EXPR_META_DREG, dreg); - - if (nftnl_mxml_reg_parse(tree, "sreg", &sreg, MXML_DESCEND_FIRST, - NFTNL_XML_OPT, err) == 0) - nftnl_expr_set_u32(e, NFTNL_EXPR_META_SREG, sreg); - - return 0; -#else - errno = EOPNOTSUPP; - return -1; -#endif -} - static int nftnl_expr_meta_snprintf_default(char *buf, size_t len, const struct nftnl_expr *e) @@ -323,6 +291,5 @@ struct expr_ops expr_ops_meta = { .parse = nftnl_expr_meta_parse, .build = nftnl_expr_meta_build, .snprintf = nftnl_expr_meta_snprintf, - .xml_parse = nftnl_expr_meta_xml_parse, .json_parse = nftnl_expr_meta_json_parse, }; -- cgit v1.2.3