diff options
author | Arturo Borrero <arturo.borrero.glez@gmail.com> | 2016-09-22 16:58:13 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-09-23 10:04:16 +0200 |
commit | 0758d102627744847d0bd2e4744d27695edb9a14 (patch) | |
tree | d8e004ddfba5ba10f63bd857dbf82f1834cdcf3d /src/expr/exthdr.c | |
parent | f3bd67823b16fb7ef1ca4e4d93535f77eb0c2b53 (diff) |
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 <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/exthdr.c')
-rw-r--r-- | src/expr/exthdr.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c index deb0d7c..b164e3f 100644 --- a/src/expr/exthdr.c +++ b/src/expr/exthdr.c @@ -221,45 +221,6 @@ nftnl_expr_exthdr_json_parse(struct nftnl_expr *e, json_t *root, #endif } -static int -nftnl_expr_exthdr_xml_parse(struct nftnl_expr *e, mxml_node_t *tree, - struct nftnl_parse_err *err) -{ -#ifdef XML_PARSING - const char *exthdr_type; - int type; - uint32_t dreg, len, offset; - - if (nftnl_mxml_reg_parse(tree, "dreg", &dreg, MXML_DESCEND_FIRST, - NFTNL_XML_MAND, err) == 0) - nftnl_expr_set_u32(e, NFTNL_EXPR_EXTHDR_DREG, dreg); - - exthdr_type = nftnl_mxml_str_parse(tree, "exthdr_type", - MXML_DESCEND_FIRST, NFTNL_XML_MAND, err); - if (exthdr_type != NULL) { - type = str2exthdr_type(exthdr_type); - if (type < 0) - return -1; - nftnl_expr_set_u8(e, NFTNL_EXPR_EXTHDR_TYPE, type); - } - - /* Get and set <offset> */ - if (nftnl_mxml_num_parse(tree, "offset", MXML_DESCEND_FIRST, BASE_DEC, - &offset, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0) - nftnl_expr_set_u32(e, NFTNL_EXPR_EXTHDR_OFFSET, offset); - - /* Get and set <len> */ - if (nftnl_mxml_num_parse(tree, "len", MXML_DESCEND_FIRST, BASE_DEC, - &len, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0) - nftnl_expr_set_u32(e, NFTNL_EXPR_EXTHDR_LEN, len); - - return 0; -#else - errno = EOPNOTSUPP; - return -1; -#endif -} - static int nftnl_expr_exthdr_export(char *buf, size_t len, const struct nftnl_expr *e, int type) { @@ -333,6 +294,5 @@ struct expr_ops expr_ops_exthdr = { .parse = nftnl_expr_exthdr_parse, .build = nftnl_expr_exthdr_build, .snprintf = nftnl_expr_exthdr_snprintf, - .xml_parse = nftnl_expr_exthdr_xml_parse, .json_parse = nftnl_expr_exthdr_json_parse, }; |