summaryrefslogtreecommitdiffstats
path: root/src/expr/log.c
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2016-09-22 16:58:13 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-09-23 10:04:16 +0200
commit0758d102627744847d0bd2e4744d27695edb9a14 (patch)
treed8e004ddfba5ba10f63bd857dbf82f1834cdcf3d /src/expr/log.c
parentf3bd67823b16fb7ef1ca4e4d93535f77eb0c2b53 (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/log.c')
-rw-r--r--src/expr/log.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/expr/log.c b/src/expr/log.c
index d1e7b8d..57490d9 100644
--- a/src/expr/log.c
+++ b/src/expr/log.c
@@ -224,50 +224,6 @@ static int nftnl_expr_log_json_parse(struct nftnl_expr *e, json_t *root,
#endif
}
-static int nftnl_expr_log_xml_parse(struct nftnl_expr *e,
- mxml_node_t *tree,
- struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
- const char *prefix;
- uint32_t snaplen, level, flags;
- uint16_t group, qthreshold;
-
- prefix = nftnl_mxml_str_parse(tree, "prefix", MXML_DESCEND_FIRST,
- NFTNL_XML_MAND, err);
- if (prefix != NULL)
- nftnl_expr_set_str(e, NFTNL_EXPR_LOG_PREFIX, prefix);
-
- if (nftnl_mxml_num_parse(tree, "group", MXML_DESCEND_FIRST, BASE_DEC,
- &group, NFTNL_TYPE_U16, NFTNL_XML_MAND, err) == 0)
- nftnl_expr_set_u16(e, NFTNL_EXPR_LOG_GROUP, group);
-
- if (nftnl_mxml_num_parse(tree, "snaplen", MXML_DESCEND_FIRST, BASE_DEC,
- &snaplen, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0)
- nftnl_expr_set_u32(e, NFTNL_EXPR_LOG_SNAPLEN, snaplen);
-
- if (nftnl_mxml_num_parse(tree, "qthreshold", MXML_DESCEND_FIRST, BASE_DEC,
- &qthreshold, NFTNL_TYPE_U16, NFTNL_XML_MAND,
- err) == 0)
- nftnl_expr_set_u16(e, NFTNL_EXPR_LOG_QTHRESHOLD, qthreshold);
-
- if (nftnl_mxml_num_parse(tree, "level", MXML_DESCEND_FIRST, BASE_DEC,
- &level, NFTNL_TYPE_U16, NFTNL_XML_MAND,
- err) == 0)
- nftnl_expr_set_u32(e, NFTNL_EXPR_LOG_LEVEL, level);
-
- if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC,
- &flags, NFTNL_TYPE_U16, NFTNL_XML_MAND,
- err) == 0)
- nftnl_expr_set_u32(e, NFTNL_EXPR_LOG_FLAGS, flags);
-
- return 0;
-#else
- errno = EOPNOTSUPP;
- return -1;
-#endif
-}
-
static int nftnl_expr_log_snprintf_default(char *buf, size_t size,
const struct nftnl_expr *e)
{
@@ -370,6 +326,5 @@ struct expr_ops expr_ops_log = {
.parse = nftnl_expr_log_parse,
.build = nftnl_expr_log_build,
.snprintf = nftnl_expr_log_snprintf,
- .xml_parse = nftnl_expr_log_xml_parse,
.json_parse = nftnl_expr_log_json_parse,
};