Skip to contentSkip to conversation

libnftnl: remove libmxml support

PATCH Applied Arturo Borrero Gonzalez 2 participants 2 messages Sep 22, 2016 – Sep 23, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libnftnl: 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

---
 configure.ac                           |   10 -
 examples/nft-chain-get.c               |    7 -
 examples/nft-chain-parse-add.c         |    9 -
 examples/nft-events.c                  |    6 -
 examples/nft-rule-get.c                |    8 -
 examples/nft-rule-parse-add.c          |    9 -
 examples/nft-ruleset-get.c             |    8 -
 examples/nft-ruleset-parse-file.c      |    5 -
 examples/nft-set-elem-get.c            |    4 -
 examples/nft-set-get.c                 |    4 -
 examples/nft-set-parse-add.c           |    9 -
 examples/nft-table-get.c               |    8 -
 examples/nft-table-parse-add.c         |    9 -
 include/Makefile.am                    |    1 
 include/expr_ops.h                     |    2 
 include/internal.h                     |    1 
 include/xml.h                          |   58 --------
 src/Makefile.am                        |    3 
 src/buffer.c                           |   26 +---
 src/chain.c                            |  107 ---------------
 src/expr/bitwise.c                     |   42 ------
 src/expr/byteorder.c                   |   43 ------
 src/expr/cmp.c                         |   36 -----
 src/expr/counter.c                     |   23 ---
 src/expr/ct.c                          |   48 -------
 src/expr/data_reg.c                    |  156 ----------------------
 src/expr/dup.c                         |   21 ---
 src/expr/dynset.c                      |   38 -----
 src/expr/exthdr.c                      |   40 ------
 src/expr/fwd.c                         |   18 --
 src/expr/hash.c                        |   44 ------
 src/expr/immediate.c                   |   39 -----
 src/expr/limit.c                       |   33 -----
 src/expr/log.c                         |   45 ------
 src/expr/lookup.c                      |   34 -----
 src/expr/masq.c                        |   27 ----
 src/expr/match.c                       |   21 ---
 src/expr/meta.c                        |   33 -----
 src/expr/nat.c                         |   55 --------
 src/expr/numgen.c                      |   30 ----
 src/expr/payload.c                     |   40 ------
 src/expr/queue.c                       |   30 ----
 src/expr/quota.c                       |   22 ---
 src/expr/redir.c                       |   27 ----
 src/expr/reject.c                      |   24 ---
 src/expr/target.c                      |   22 ---
 src/mxml.c                             |  232 --------------------------------
 src/rule.c                             |  162 ----------------------
 src/ruleset.c                          |  162 +---------------------
 src/set.c                              |  194 +--------------------------
 src/set_elem.c                         |  118 +---------------
 src/table.c                            |   53 -------
 tests/Makefile.am                      |    5 -
 tests/nft-parsing-test.c               |   62 ---------
 tests/test-script.sh                   |    1 
 tests/xmlfiles/01-table.xml            |    1 
 tests/xmlfiles/02-table.xml            |    1 
 tests/xmlfiles/10-chain.xml            |    1 
 tests/xmlfiles/11-chain.xml            |    1 
 tests/xmlfiles/12-chain.xml            |    1 
 tests/xmlfiles/20-rule-bitwise.xml     |    1 
 tests/xmlfiles/21-rule-byteorder.xml   |    1 
 tests/xmlfiles/22-rule-cmp.xml         |    1 
 tests/xmlfiles/23-rule-counter.xml     |    1 
 tests/xmlfiles/24-rule-ct.xml          |    1 
 tests/xmlfiles/25-rule-exthdr.xml      |    1 
 tests/xmlfiles/26-rule-immediate.xml   |    1 
 tests/xmlfiles/27-rule-limit.xml       |    1 
 tests/xmlfiles/28-rule-log.xml         |    1 
 tests/xmlfiles/29-rule-lookup.xml      |    1 
 tests/xmlfiles/30-rule-match.xml       |    1 
 tests/xmlfiles/31-rule-meta.xml        |    1 
 tests/xmlfiles/32-rule-nat6.xml        |    1 
 tests/xmlfiles/33-rule-nat4.xml        |    1 
 tests/xmlfiles/34-rule-payload.xml     |    1 
 tests/xmlfiles/35-rule-target.xml      |    1 
 tests/xmlfiles/36-rule-real.xml        |    1 
 tests/xmlfiles/37-rule-real.xml        |    1 
 tests/xmlfiles/38-rule-real.xml        |    1 
 tests/xmlfiles/39-rule-real.xml        |    1 
 tests/xmlfiles/40-rule-real.xml        |    1 
 tests/xmlfiles/41-rule-real.xml        |    1 
 tests/xmlfiles/42-rule-real.xml        |    1 
 tests/xmlfiles/43-rule-real.xml        |    1 
 tests/xmlfiles/44-rule-real.xml        |    1 
 tests/xmlfiles/45-rule-real.xml        |    1 
 tests/xmlfiles/46-rule-real.xml        |    1 
 tests/xmlfiles/47-rule-real.xml        |    1 
 tests/xmlfiles/48-rule-real.xml        |    1 
 tests/xmlfiles/49-rule-real.xml        |    1 
 tests/xmlfiles/50-rule-real.xml        |    1 
 tests/xmlfiles/51-rule-real.xml        |    1 
 tests/xmlfiles/52-rule-real.xml        |    1 
 tests/xmlfiles/53-rule-real.xml        |    1 
 tests/xmlfiles/54-rule-real.xml        |    1 
 tests/xmlfiles/55-rule-real.xml        |    1 
 tests/xmlfiles/56-rule-real.xml        |    1 
 tests/xmlfiles/57-rule-real.xml        |    1 
 tests/xmlfiles/58-rule-real.xml        |    1 
 tests/xmlfiles/59-rule-real.xml        |    1 
 tests/xmlfiles/60-rule-real.xml        |    1 
 tests/xmlfiles/61-rule-real.xml        |    1 
 tests/xmlfiles/62-rule-real.xml        |    1 
 tests/xmlfiles/63-rule-real.xml        |    1 
 tests/xmlfiles/64-rule-real.xml        |    1 
 tests/xmlfiles/65-rule-real.xml        |    1 
 tests/xmlfiles/66-rule-real.xml        |    1 
 tests/xmlfiles/67-rule-real.xml        |    1 
 tests/xmlfiles/68-rule-real.xml        |    1 
 tests/xmlfiles/69-rule-real.xml        |    1 
 tests/xmlfiles/70-rule-real.xml        |    1 
 tests/xmlfiles/71-rule-real.xml        |    1 
 tests/xmlfiles/72-rule-real.xml        |    1 
 tests/xmlfiles/73-set.xml              |    1 
 tests/xmlfiles/74-set.xml              |    1 
 tests/xmlfiles/75-ruleset.xml          |    1 
 tests/xmlfiles/76-rule-meta_target.xml |    1 
 tests/xmlfiles/77-rule-queue.xml       |    1 
 tests/xmlfiles/78-rule-queue.xml       |    2 
 tests/xmlfiles/79-rule-masq.xml        |    1 
 tests/xmlfiles/80-rule-redir.xml       |    1 
 tests/xmlfiles/81-rule-real.xml        |    1 
 122 files changed, 59 insertions(+), 2283 deletions(-)
 delete mode 100644 include/xml.h
 delete mode 100644 src/mxml.c
 delete mode 100644 tests/xmlfiles/01-table.xml
 delete mode 100644 tests/xmlfiles/02-table.xml
 delete mode 100644 tests/xmlfiles/10-chain.xml
 delete mode 100644 tests/xmlfiles/11-chain.xml
 delete mode 100644 tests/xmlfiles/12-chain.xml
 delete mode 100644 tests/xmlfiles/20-rule-bitwise.xml
 delete mode 100644 tests/xmlfiles/21-rule-byteorder.xml
 delete mode 100644 tests/xmlfiles/22-rule-cmp.xml
 delete mode 100644 tests/xmlfiles/23-rule-counter.xml
 delete mode 100644 tests/xmlfiles/24-rule-ct.xml
 delete mode 100644 tests/xmlfiles/25-rule-exthdr.xml
 delete mode 100644 tests/xmlfiles/26-rule-immediate.xml
 delete mode 100644 tests/xmlfiles/27-rule-limit.xml
 delete mode 100644 tests/xmlfiles/28-rule-log.xml
 delete mode 100644 tests/xmlfiles/29-rule-lookup.xml
 delete mode 100644 tests/xmlfiles/30-rule-match.xml
 delete mode 100644 tests/xmlfiles/31-rule-meta.xml
 delete mode 100644 tests/xmlfiles/32-rule-nat6.xml
 delete mode 100644 tests/xmlfiles/33-rule-nat4.xml
 delete mode 100644 tests/xmlfiles/34-rule-payload.xml
 delete mode 100644 tests/xmlfiles/35-rule-target.xml
 delete mode 100644 tests/xmlfiles/36-rule-real.xml
 delete mode 100644 tests/xmlfiles/37-rule-real.xml
 delete mode 100644 tests/xmlfiles/38-rule-real.xml
 delete mode 100644 tests/xmlfiles/39-rule-real.xml
 delete mode 100644 tests/xmlfiles/40-rule-real.xml
 delete mode 100644 tests/xmlfiles/41-rule-real.xml
 delete mode 100644 tests/xmlfiles/42-rule-real.xml
 delete mode 100644 tests/xmlfiles/43-rule-real.xml
 delete mode 100644 tests/xmlfiles/44-rule-real.xml
 delete mode 100644 tests/xmlfiles/45-rule-real.xml
 delete mode 100644 tests/xmlfiles/46-rule-real.xml
 delete mode 100644 tests/xmlfiles/47-rule-real.xml
 delete mode 100644 tests/xmlfiles/48-rule-real.xml
 delete mode 100644 tests/xmlfiles/49-rule-real.xml
 delete mode 100644 tests/xmlfiles/50-rule-real.xml
 delete mode 100644 tests/xmlfiles/51-rule-real.xml
 delete mode 100644 tests/xmlfiles/52-rule-real.xml
 delete mode 100644 tests/xmlfiles/53-rule-real.xml
 delete mode 100644 tests/xmlfiles/54-rule-real.xml
 delete mode 100644 tests/xmlfiles/55-rule-real.xml
 delete mode 100644 tests/xmlfiles/56-rule-real.xml
 delete mode 100644 tests/xmlfiles/57-rule-real.xml
 delete mode 100644 tests/xmlfiles/58-rule-real.xml
 delete mode 100644 tests/xmlfiles/59-rule-real.xml
 delete mode 100644 tests/xmlfiles/60-rule-real.xml
 delete mode 100644 tests/xmlfiles/61-rule-real.xml
 delete mode 100644 tests/xmlfiles/62-rule-real.xml
 delete mode 100644 tests/xmlfiles/63-rule-real.xml
 delete mode 100644 tests/xmlfiles/64-rule-real.xml
 delete mode 100644 tests/xmlfiles/65-rule-real.xml
 delete mode 100644 tests/xmlfiles/66-rule-real.xml
 delete mode 100644 tests/xmlfiles/67-rule-real.xml
 delete mode 100644 tests/xmlfiles/68-rule-real.xml
 delete mode 100644 tests/xmlfiles/69-rule-real.xml
 delete mode 100644 tests/xmlfiles/70-rule-real.xml
 delete mode 100644 tests/xmlfiles/71-rule-real.xml
 delete mode 100644 tests/xmlfiles/72-rule-real.xml
 delete mode 100644 tests/xmlfiles/73-set.xml
 delete mode 100644 tests/xmlfiles/74-set.xml
 delete mode 100644 tests/xmlfiles/75-ruleset.xml
 delete mode 100644 tests/xmlfiles/76-rule-meta_target.xml
 delete mode 100644 tests/xmlfiles/77-rule-queue.xml
 delete mode 100644 tests/xmlfiles/78-rule-queue.xml
 delete mode 100644 tests/xmlfiles/79-rule-masq.xml
 delete mode 100644 tests/xmlfiles/80-rule-redir.xml
 delete mode 100644 tests/xmlfiles/81-rule-real.xml
configure.ac +0 -10
index b78091e..813523d 100644
@@ -15,15 +15,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 dnl Dependencies
 PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.0])
-AC_ARG_WITH([xml-parsing],
-	AS_HELP_STRING([--with-xml-parsing], [XML parsing support]))
 AC_ARG_WITH([json-parsing],
 	AS_HELP_STRING([--with-json-parsing], [JSON parsing support]))
 
-AS_IF([test "x$with_xml_parsing" = "xyes"],
-	[PKG_CHECK_MODULES([LIBXML], [mxml >= 2.6])],
-	[with_xml_parsing="no"]
-)
 AS_IF([test "x$with_json_parsing" = "xyes"],
 	[PKG_CHECK_MODULES([LIBJSON], [jansson >= 2.3])],
 	[with_json_parsing="no"]
@@ -40,9 +34,6 @@ case "$host" in
 esac
 
 regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
-AS_IF([test "x$with_xml_parsing" = "xyes"], [
-	regular_CPPFLAGS="$regular_CPPFLAGS -DXML_PARSING"
-])
 
 AS_IF([test "x$with_json_parsing" = "xyes"], [
 	regular_CPPFLAGS="$regular_CPPFLAGS -DJSON_PARSING"
@@ -57,5 +48,4 @@ AC_OUTPUT
 
 echo "
 libnftnl configuration:
-  XML support:				${with_xml_parsing}
   JSON support:				${with_json_parsing}"
examples/nft-chain-get.c +2 -5
index f5d4593..6fda2d8 100644
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
 	seq = time(NULL);
 
 	if (argc < 2 || argc > 5) {
-		fprintf(stderr, "Usage: %s <family> [<table> <chain>] [xml]\n",
+		fprintf(stderr, "Usage: %s <family> [<table> <chain>] [json]\n",
 			argv[0]);
 		exit(EXIT_FAILURE);
 	}
@@ -95,11 +95,8 @@ int main(int argc, char *argv[])
 						NLM_F_DUMP, seq);
 	}
 
-	if (strcmp(argv[argc-1], "xml") == 0){
-		type = NFTNL_OUTPUT_XML;
-	}else if (strcmp(argv[argc-1], "json") == 0){
+	if (strcmp(argv[argc-1], "json") == 0)
 		type = NFTNL_OUTPUT_JSON;
-	}
 
 	nl = mnl_socket_open(NETLINK_NETFILTER);
 	if (nl == NULL) {
examples/nft-chain-parse-add.c +3 -6
index cf43cc2..dd27343 100644
@@ -81,18 +81,15 @@ int main(int argc, char *argv[])
 	struct mnl_nlmsg_batch *batch;
 
 	if (argc < 3) {
-		printf("Usage: %s {xml|json} <file>\n", argv[0]);
+		printf("Usage: %s {json} <file>\n", argv[0]);
 		exit(EXIT_FAILURE);
 	}
 
-	if (strcmp(argv[1], "xml") == 0) {
-		format = NFTNL_PARSE_XML;
-		outformat = NFTNL_OUTPUT_XML;
-	} else if (strcmp(argv[1], "json") == 0) {
+	if (strcmp(argv[1], "json") == 0) {
 		format = NFTNL_PARSE_JSON;
 		outformat = NFTNL_OUTPUT_JSON;
 	} else {
-		printf("Unknown format: xml, json\n");
+		printf("Unknown format: only json is supported\n");
 		exit(EXIT_FAILURE);
 	}
 
examples/nft-events.c +2 -4
index 885af45..bd8c752 100644
@@ -236,9 +236,7 @@ int main(int argc, char *argv[])
 		type = NFTNL_OUTPUT_DEFAULT;
 		break;
 	case 2:
-		if (strcmp(argv[1], "xml") == 0) {
-			type = NFTNL_OUTPUT_XML;
-		} else if (strcmp(argv[1], "json") == 0) {
+		if (strcmp(argv[1], "json") == 0) {
 			type = NFTNL_OUTPUT_JSON;
 		} else if (strcmp(argv[1], "default") == 0) {
 			type = NFTNL_OUTPUT_DEFAULT;
@@ -248,7 +246,7 @@ int main(int argc, char *argv[])
 		}
 		break;
 	default:
-		fprintf(stderr, "%s [<default|xml|json>]\n", argv[0]);
+		fprintf(stderr, "%s [<default|json>]\n", argv[0]);
 		return EXIT_FAILURE;
 	}
 
examples/nft-rule-get.c +3 -5
index 6a15d56..aa49612 100644
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
 	int ret, family;
 
 	if (argc < 2 || argc > 5) {
-		fprintf(stderr, "Usage: %s <family> [<table> <chain>] [xml|json]\n",
+		fprintf(stderr, "Usage: %s <family> [<table> <chain>] [json]\n",
 			argv[0]);
 		exit(EXIT_FAILURE);
 	}
@@ -102,11 +102,9 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	/* [xml|json] specified */
+	/* json specified */
 	if (argc == 3 || argc == 5) {
-		if (strcmp(argv[argc - 1], "xml") == 0)
-			type = NFTNL_OUTPUT_XML;
-		else if (strcmp(argv[argc - 1], "json") == 0)
+		if (strcmp(argv[argc - 1], "json") == 0)
 			type = NFTNL_OUTPUT_JSON;
 	}
 
examples/nft-rule-parse-add.c +3 -6
index 3707de3..90f1da7 100644
@@ -84,18 +84,15 @@ int main(int argc, char *argv[])
 	uint16_t family, format, outformat;
 
 	if (argc < 3) {
-		printf("Usage: %s {xml|json} <file>\n", argv[0]);
+		printf("Usage: %s {json} <file>\n", argv[0]);
 		exit(EXIT_FAILURE);
 	}
 
-	if (strcmp(argv[1], "xml") == 0) {
-		format = NFTNL_PARSE_XML;
-		outformat = NFTNL_OUTPUT_XML;
-	} else if (strcmp(argv[1], "json") == 0) {
+	if (strcmp(argv[1], "json") == 0) {
 		format = NFTNL_PARSE_JSON;
 		outformat = NFTNL_OUTPUT_JSON;
 	} else {
-		printf("Unknown format: xml, json\n");
+		printf("Unknown format: json\n");
 		exit(EXIT_FAILURE);
 	}
 
examples/nft-ruleset-get.c +3 -5
index 2c9d775..9e997c2 100644
@@ -344,18 +344,16 @@ int main(int argc, char *argv[])
 	int ret;
 
 	if (argc > 2) {
-		fprintf(stderr, "%s {xml|json}\n",
+		fprintf(stderr, "%s {json}\n",
 			argv[0]);
 		exit(EXIT_FAILURE);
 	}
 
 	if (argc == 2) {
-		if (strcmp(argv[1], "xml") == 0)
-			type = NFTNL_OUTPUT_XML;
-		else if (strcmp(argv[1], "json") == 0)
+		if (strcmp(argv[1], "json") == 0)
 			type = NFTNL_OUTPUT_JSON;
 		else {
-			fprintf(stderr, "Unknown type: {xml|json}\n");
+			fprintf(stderr, "Unknown type: only json is supported\n");
 			exit(EXIT_FAILURE);
 		}
 	}
examples/nft-ruleset-parse-file.c +1 -4
index 84dc304..505c43c 100644
@@ -422,11 +422,8 @@ int main(int argc, char *argv[])
 	if (len >= 5 && strcmp(&filename[len - 5], ".json") == 0)
 		ret = nftnl_ruleset_parse_file_cb(NFTNL_PARSE_JSON, fp, err, NULL,
 						&ruleset_elems_cb);
-	else if (len >= 4 && strcmp(&filename[len - 4], ".xml") == 0)
-		ret = nftnl_ruleset_parse_file_cb(NFTNL_PARSE_XML, fp, err, NULL,
-						&ruleset_elems_cb);
 	else {
-		printf("the filename %s must to end in .xml or .json\n",
+		printf("the filename %s does not have a trailing .json\n",
 			filename);
 		exit(EXIT_FAILURE);
 	}
examples/nft-set-elem-get.c +1 -3
index 9c637ee..9a3ccd7 100644
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
 	int ret;
 
 	if (argc < 4 || argc > 5) {
-		fprintf(stderr, "%s <family> <table> <set> [<json|xml>]\n",
+		fprintf(stderr, "%s <family> <table> <set> [<json>]\n",
 			argv[0]);
 		return EXIT_FAILURE;
 	}
@@ -82,8 +82,6 @@ int main(int argc, char *argv[])
 
 	if (argc == 5 && strcmp(argv[4], "json") == 0 )
 		type = NFTNL_OUTPUT_JSON;
-	else if (argc == 5 && strcmp(argv[4], "xml") == 0)
-		type = NFTNL_OUTPUT_XML;
 
 	nlh = nftnl_set_nlmsg_build_hdr(buf, NFT_MSG_GETSETELEM, family,
 					NLM_F_DUMP|NLM_F_ACK, seq);
examples/nft-set-get.c +1 -3
index 245ac5f..c4ad8ee 100644
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
 	int ret;
 
 	if (argc < 2 || argc > 3) {
-		fprintf(stderr, "%s <family> [<json|xml>]\n", argv[0]);
+		fprintf(stderr, "%s <family> [<json>]\n", argv[0]);
 		return EXIT_FAILURE;
 	}
 	t = nftnl_set_alloc();
@@ -83,8 +83,6 @@ int main(int argc, char *argv[])
 
 	if (argc == 3 && strcmp(argv[2], "json") == 0)
 		type = NFTNL_OUTPUT_JSON;
-	else if (argc == 3 && strcmp(argv[2], "xml") == 0)
-		type = NFTNL_OUTPUT_XML;
 
 	nlh = nftnl_set_nlmsg_build_hdr(buf, NFT_MSG_GETSET, family,
 					NLM_F_DUMP|NLM_F_ACK, seq);
examples/nft-set-parse-add.c +3 -6
index 3648730..550e8f4 100644
@@ -85,18 +85,15 @@ int main(int argc, char *argv[])
 	struct mnl_nlmsg_batch *batch;
 
 	if (argc < 2) {
-		printf("Usage: %s {xml|json} <file>\n", argv[0]);
+		printf("Usage: %s {json} <file>\n", argv[0]);
 		exit(EXIT_FAILURE);
 	}
 
-	if (strcmp(argv[1], "xml") == 0) {
-		format = NFTNL_PARSE_XML;
-		outformat = NFTNL_OUTPUT_XML;
-	} else if (strcmp(argv[1], "json") == 0) {
+	if (strcmp(argv[1], "json") == 0) {
 		format = NFTNL_PARSE_JSON;
 		outformat = NFTNL_OUTPUT_JSON;
 	} else {
-		printf("Unknown format: xml, json\n");
+		printf("Unknown format: only json is supported\n");
 		exit(EXIT_FAILURE);
 	}
 
examples/nft-table-get.c +2 -6
index d648a11..193db77 100644
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
 	uint32_t type = NFTNL_OUTPUT_DEFAULT;
 
 	if (argc < 2 || argc > 4) {
-		fprintf(stderr, "%s <family> [<table>] [<default|xml|json>]\n",
+		fprintf(stderr, "%s <family> [<table>] [<default|json>]\n",
 			argv[0]);
 		return EXIT_FAILURE;
 	}
@@ -77,11 +77,7 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	if (strcmp(argv[argc-1], "xml") == 0) {
-		type = NFTNL_OUTPUT_XML;
-		argv[argc-1] = NULL;
-		argc--;
-	}else if (strcmp(argv[argc-1], "json") == 0) {
+	if (strcmp(argv[argc-1], "json") == 0) {
 		type = NFTNL_OUTPUT_JSON;
 		argv[argc-1] = NULL;
 		argc--;
examples/nft-table-parse-add.c +3 -6
index 31d31cc..28cb276 100644
@@ -80,18 +80,15 @@ int main(int argc, char *argv[])
 	struct mnl_nlmsg_batch *batch;
 
 	if (argc < 3) {
-		printf("Usage: %s {xml|json} <file>\n", argv[0]);
+		printf("Usage: %s {json} <file>\n", argv[0]);
 		exit(EXIT_FAILURE);
 	}
 
-	if (strcmp(argv[1], "xml") == 0) {
-		format = NFTNL_PARSE_XML;
-		outformat = NFTNL_OUTPUT_XML;
-	} else if (strcmp(argv[1], "json") == 0) {
+	if (strcmp(argv[1], "json") == 0) {
 		format = NFTNL_PARSE_JSON;
 		outformat = NFTNL_OUTPUT_JSON;
 	} else {
-		printf("Unknown format: xml, json\n");
+		printf("Unknown format: only json is supported\n");
 		exit(EXIT_FAILURE);
 	}
 
include/Makefile.am +0 -1
index 9f55737..a049e2e 100644
@@ -7,7 +7,6 @@ noinst_HEADERS = internal.h	\
 		 expr_ops.h	\
 		 linux_list.h	\
 		 set.h		\
-		 xml.h		\
 		 common.h	\
 		 expr.h		\
 		 json.h		\
include/expr_ops.h +0 -2
index a334732..e639390 100644
@@ -19,8 +19,6 @@ struct expr_ops {
 	int 	(*parse)(struct nftnl_expr *e, struct nlattr *attr);
 	void	(*build)(struct nlmsghdr *nlh, const struct nftnl_expr *e);
 	int	(*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e);
-	int	(*xml_parse)(struct nftnl_expr *e, mxml_node_t *tree,
-			     struct nftnl_parse_err *err);
 	int	(*json_parse)(struct nftnl_expr *e, json_t *data,
 			      struct nftnl_parse_err *err);
 };
include/internal.h +0 -1
index c74e2bf..7e97c4a 100644
@@ -6,7 +6,6 @@
 #include "linux_list.h"
 #include "utils.h"
 #include "common.h"
-#include "xml.h"
 #include "json.h"
 #include "linux_list.h"
 #include "set.h"
include/xml.h deleted +0 -58

58 lines not on this page · raw message

src/Makefile.am +1 -2
index 4a91cdb..4ab8fca 100644
@@ -1,7 +1,7 @@
 include $(top_srcdir)/Make_global.am
 lib_LTLIBRARIES = libnftnl.la
 
-libnftnl_la_LIBADD = ${LIBMNL_LIBS} ${LIBXML_LIBS} ${LIBJSON_LIBS}
+libnftnl_la_LIBADD = ${LIBMNL_LIBS} ${LIBJSON_LIBS}
 libnftnl_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnftnl.map	\
 		      -version-info $(LIBVERSION)
 
@@ -17,7 +17,6 @@ libnftnl_la_SOURCES = utils.c		\
 		      set.c		\
 		      set_elem.c	\
 		      ruleset.c		\
-		      mxml.c		\
 		      jansson.c		\
 		      udata.c		\
 		      expr.c		\
src/buffer.c +7 -19
index 57d3c0c..d97d517 100644
@@ -62,10 +62,9 @@ static int nftnl_buf_put(struct nftnl_buf *b, const char *fmt, ...)
 int nftnl_buf_open(struct nftnl_buf *b, int type, const char *tag)
 {
 	switch (type) {
-	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "<%s>", tag);
 	case NFTNL_OUTPUT_JSON:
 		return nftnl_buf_put(b, "{\"%s\":{", tag);
+	case NFTNL_OUTPUT_XML:
 	default:
 		return 0;
 	}
@@ -74,8 +73,6 @@ int nftnl_buf_open(struct nftnl_buf *b, int type, const char *tag)
 int nftnl_buf_close(struct nftnl_buf *b, int type, const char *tag)
 {
 	switch (type) {
-	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "</%s>", tag);
 	case NFTNL_OUTPUT_JSON:
 		/* Remove trailing comma in json */
 		if (b->size > 0 && b->buf[b->size - 1] == ',') {
@@ -85,6 +82,7 @@ int nftnl_buf_close(struct nftnl_buf *b, int type, const char *tag)
 		}
 
 		return nftnl_buf_put(b, "}}");
+	case NFTNL_OUTPUT_XML:
 	default:
 		return 0;
 	}
@@ -96,7 +94,6 @@ int nftnl_buf_open_array(struct nftnl_buf *b, int type, const char *tag)
 	case NFTNL_OUTPUT_JSON:
 		return nftnl_buf_put(b, "{\"%s\":[", tag);
 	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "<%s>", tag);
 	default:
 		return 0;
 	}
@@ -108,7 +105,6 @@ int nftnl_buf_close_array(struct nftnl_buf *b, int type, const char *tag)
 	case NFTNL_OUTPUT_JSON:
 		return nftnl_buf_put(b, "]}");
 	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "</%s>", tag);
 	default:
 		return 0;
 	}
@@ -117,10 +113,9 @@ int nftnl_buf_close_array(struct nftnl_buf *b, int type, const char *tag)
 int nftnl_buf_u32(struct nftnl_buf *b, int type, uint32_t value, const char *tag)
 {
 	switch (type) {
-	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "<%s>%u</%s>", tag, value, tag);
 	case NFTNL_OUTPUT_JSON:
 		return nftnl_buf_put(b, "\"%s\":%u,", tag, value);
+	case NFTNL_OUTPUT_XML:
 	default:
 		return 0;
 	}
@@ -129,10 +124,9 @@ int nftnl_buf_u32(struct nftnl_buf *b, int type, uint32_t value, const char *tag
 int nftnl_buf_s32(struct nftnl_buf *b, int type, uint32_t value, const char *tag)
 {
 	switch (type) {
-	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "<%s>%d</%s>", tag, value, tag);
 	case NFTNL_OUTPUT_JSON:
 		return nftnl_buf_put(b, "\"%s\":%d,", tag, value);
+	case NFTNL_OUTPUT_XML:
 	default:
 		return 0;
 	}
@@ -141,10 +135,9 @@ int nftnl_buf_s32(struct nftnl_buf *b, int type, uint32_t value, const char *tag
 int nftnl_buf_u64(struct nftnl_buf *b, int type, uint64_t value, const char *tag)
 {
 	switch (type) {
-	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "<%s>%"PRIu64"</%s>", tag, value, tag);
 	case NFTNL_OUTPUT_JSON:
 		return nftnl_buf_put(b, "\"%s\":%"PRIu64",", tag, value);
+	case NFTNL_OUTPUT_XML:
 	default:
 		return 0;
 	}
@@ -153,10 +146,9 @@ int nftnl_buf_u64(struct nftnl_buf *b, int type, uint64_t value, const char *tag
 int nftnl_buf_str(struct nftnl_buf *b, int type, const char *str, const char *tag)
 {
 	switch (type) {
-	case NFTNL_OUTPUT_XML:
-		return nftnl_buf_put(b, "<%s>%s</%s>", tag, str, tag);
 	case NFTNL_OUTPUT_JSON:
 		return nftnl_buf_put(b, "\"%s\":\"%s\",", tag, str);
+	case NFTNL_OUTPUT_XML:
 	default:
 		return 0;
 	}
@@ -169,11 +161,7 @@ int nftnl_buf_reg(struct nftnl_buf *b, int type, union nftnl_data_reg *reg,
 
 	switch (type) {
 	case NFTNL_OUTPUT_XML:
-		ret = nftnl_buf_put(b, "<%s>", tag);
-		ret = nftnl_data_reg_snprintf(b->buf + b->off, b->len, reg,
-                                    NFTNL_OUTPUT_XML, 0, reg_type);
-		nftnl_buf_update(b, ret);
-		return nftnl_buf_put(b, "</%s>", tag);
+		return 0;
 	case NFTNL_OUTPUT_JSON:
 		nftnl_buf_put(b, "\"%s\":{", tag);
 		ret = nftnl_data_reg_snprintf(b->buf + b->off, b->len, reg,
src/chain.c +1 -106

122 lines not on this page · raw message

src/expr/bitwise.c +0 -42

53 lines not on this page · raw message

src/expr/byteorder.c +0 -43

54 lines not on this page · raw message

src/expr/cmp.c +0 -36
index a46c15a..e7ed0db 100644
@@ -209,41 +209,6 @@ static int nftnl_expr_cmp_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int nftnl_expr_cmp_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-				       struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	struct nftnl_expr_cmp *cmp = nftnl_expr_data(e);
-	const char *op;
-	int32_t op_value;
-	uint32_t sreg;
-
-	if (nftnl_mxml_reg_parse(tree, "sreg", &sreg, MXML_DESCEND_FIRST,
-			       NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_CMP_SREG, sreg);
-
-	op = nftnl_mxml_str_parse(tree, "op", MXML_DESCEND_FIRST, NFTNL_XML_MAND,
-				err);
-	if (op != NULL) {
-		op_value = nftnl_str2cmp(op);
-		if (op_value < 0)
-			return -1;
-
-		nftnl_expr_set_u32(e, NFTNL_EXPR_CMP_OP, op_value);
-	}
-
-	if (nftnl_mxml_data_reg_parse(tree, "data",
-				    &cmp->data, NFTNL_XML_MAND,
-				    err) == DATA_VALUE)
-		e->flags |= (1 << NFTNL_EXPR_CMP_DATA);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_cmp_export(char *buf, size_t size,
 				 const struct nftnl_expr *e, int type)
 {
@@ -320,6 +285,5 @@ struct expr_ops expr_ops_cmp = {
 	.parse		= nftnl_expr_cmp_parse,
 	.build		= nftnl_expr_cmp_build,
 	.snprintf	= nftnl_expr_cmp_snprintf,
-	.xml_parse	= nftnl_expr_cmp_xml_parse,
 	.json_parse	= nftnl_expr_cmp_json_parse,
 };
src/expr/counter.c +0 -23
index 4488afc..21901e8 100644
@@ -137,28 +137,6 @@ nftnl_expr_counter_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int
-nftnl_expr_counter_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-				struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint64_t pkts, bytes;
-
-	if (nftnl_mxml_num_parse(tree, "pkts", MXML_DESCEND_FIRST, BASE_DEC,
-			       &pkts, NFTNL_TYPE_U64, NFTNL_XML_MAND,  err) == 0)
-		nftnl_expr_set_u64(e, NFTNL_EXPR_CTR_PACKETS, pkts);
-
-	if (nftnl_mxml_num_parse(tree, "bytes", MXML_DESCEND_FIRST, BASE_DEC,
-			       &bytes, NFTNL_TYPE_U64, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u64(e, NFTNL_EXPR_CTR_BYTES, bytes);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_counter_export(char *buf, size_t size,
 				     const struct nftnl_expr *e, int type)
 {
@@ -223,6 +201,5 @@ struct expr_ops expr_ops_counter = {
 	.parse		= nftnl_expr_counter_parse,
 	.build		= nftnl_expr_counter_build,
 	.snprintf	= nftnl_expr_counter_snprintf,
-	.xml_parse	= nftnl_expr_counter_xml_parse,
 	.json_parse	= nftnl_expr_counter_json_parse,
 };
src/expr/ct.c +0 -48

59 lines not on this page · raw message

src/expr/data_reg.c +2 -154

192 lines not on this page · raw message

src/expr/dup.c +0 -21
index ac1923c..9aa332b 100644
@@ -133,26 +133,6 @@ static int nftnl_expr_dup_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int nftnl_expr_dup_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-				    struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint32_t sreg_addr, sreg_dev;
-
-	if (nftnl_mxml_reg_parse(tree, "sreg_addr", &sreg_addr, MXML_DESCEND_FIRST,
-			       NFTNL_XML_OPT, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_DUP_SREG_ADDR, sreg_addr);
-	if (nftnl_mxml_reg_parse(tree, "sreg_dev", &sreg_dev, MXML_DESCEND_FIRST,
-			       NFTNL_XML_OPT, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_DUP_SREG_DEV, sreg_dev);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_dup_export(char *buf, size_t size,
 				 const struct nftnl_expr *e, int type)
 {
@@ -227,6 +207,5 @@ struct expr_ops expr_ops_dup = {
 	.parse		= nftnl_expr_dup_parse,
 	.build		= nftnl_expr_dup_build,
 	.snprintf	= nftnl_expr_dup_snprintf,
-	.xml_parse	= nftnl_expr_dup_xml_parse,
 	.json_parse	= nftnl_expr_dup_json_parse,
 };
src/expr/dynset.c +0 -38
index ea59145..20a5004 100644
@@ -242,43 +242,6 @@ nftnl_expr_dynset_json_parse(struct nftnl_expr *e, json_t *root,
 }
 
 static int
-nftnl_expr_dynset_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-			       struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	const char *set_name;
-	uint32_t uval32;
-	uint64_t uval64;
-
-	set_name = nftnl_mxml_str_parse(tree, "set", MXML_DESCEND_FIRST,
-				      NFTNL_XML_MAND, err);
-	if (set_name != NULL)
-		nftnl_expr_set_str(e, NFTNL_EXPR_DYNSET_SET_NAME, set_name);
-
-	if (nftnl_mxml_reg_parse(tree, "sreg_key", &uval32, MXML_DESCEND,
-			       NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_DYNSET_SREG_KEY, uval32);
-
-	if (nftnl_mxml_reg_parse(tree, "sreg_data", &uval32, MXML_DESCEND,
-			       NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_DYNSET_SREG_DATA, uval32);
-
-	if (nftnl_mxml_num_parse(tree, "op", MXML_DESCEND_FIRST, BASE_DEC,
-			       &uval32, NFTNL_TYPE_U32, NFTNL_XML_MAND,  err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_DYNSET_OP, uval32);
-
-	if (nftnl_mxml_num_parse(tree, "timeout", MXML_DESCEND_FIRST, BASE_DEC,
-			       &uval64, NFTNL_TYPE_U64, NFTNL_XML_MAND,  err) == 0)
-		nftnl_expr_set_u64(e, NFTNL_EXPR_DYNSET_TIMEOUT, uval64);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
-static int
 nftnl_expr_dynset_export(char *buf, size_t size,
 			 const struct nftnl_expr *e, int type)
 {
@@ -406,6 +369,5 @@ struct expr_ops expr_ops_dynset = {
 	.parse		= nftnl_expr_dynset_parse,
 	.build		= nftnl_expr_dynset_build,
 	.snprintf	= nftnl_expr_dynset_snprintf,
-	.xml_parse	= nftnl_expr_dynset_xml_parse,
 	.json_parse	= nftnl_expr_dynset_json_parse,
 };
src/expr/exthdr.c +0 -40
index deb0d7c..b164e3f 100644
@@ -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,
 };
src/expr/fwd.c +0 -18
index 9c5520c..c30d494 100644
@@ -116,23 +116,6 @@ static int nftnl_expr_fwd_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int nftnl_expr_fwd_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-				    struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint32_t sreg_dev;
-
-	if (nftnl_mxml_reg_parse(tree, "sreg_dev", &sreg_dev, MXML_DESCEND_FIRST,
-			       NFTNL_XML_OPT, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_FWD_SREG_DEV, sreg_dev);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_fwd_export(char *buf, size_t size,
 				 const struct nftnl_expr *e, int type)
 {
@@ -198,6 +181,5 @@ struct expr_ops expr_ops_fwd = {
 	.parse		= nftnl_expr_fwd_parse,
 	.build		= nftnl_expr_fwd_build,
 	.snprintf	= nftnl_expr_fwd_snprintf,
-	.xml_parse	= nftnl_expr_fwd_xml_parse,
 	.json_parse	= nftnl_expr_fwd_json_parse,
 };
src/expr/hash.c +0 -44

55 lines not on this page · raw message

src/expr/immediate.c +0 -39
index 2fdae9c..0b188cc 100644
@@ -210,44 +210,6 @@ nftnl_expr_immediate_json_parse(struct nftnl_expr *e, json_t *root,
 }
 
 static int
-nftnl_expr_immediate_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-				  struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	struct nftnl_expr_immediate *imm = nftnl_expr_data(e);
-	int datareg_type;
-	uint32_t reg;
-
-	if (nftnl_mxml_reg_parse(tree, "dreg", &reg, MXML_DESCEND_FIRST,
-			       NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_IMM_DREG, reg);
-
-	datareg_type = nftnl_mxml_data_reg_parse(tree, "data",
-					       &imm->data, NFTNL_XML_MAND, err);
-	if (datareg_type >= 0) {
-		switch (datareg_type) {
-		case DATA_VALUE:
-			e->flags |= (1 << NFTNL_EXPR_IMM_DATA);
-			break;
-		case DATA_VERDICT:
-			e->flags |= (1 << NFTNL_EXPR_IMM_VERDICT);
-			break;
-		case DATA_CHAIN:
-			e->flags |= (1 << NFTNL_EXPR_IMM_CHAIN);
-			break;
-		default:
-			return -1;
-		}
-	}
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
-static int
 nftnl_expr_immediate_export(char *buf, size_t size, const struct nftnl_expr *e,
 			    int type)
 {
@@ -355,6 +317,5 @@ struct expr_ops expr_ops_immediate = {
 	.parse		= nftnl_expr_immediate_parse,
 	.build		= nftnl_expr_immediate_build,
 	.snprintf	= nftnl_expr_immediate_snprintf,
-	.xml_parse	= nftnl_expr_immediate_xml_parse,
 	.json_parse	= nftnl_expr_immediate_json_parse,
 };
src/expr/limit.c +0 -33
index 9f19d53..856ab18 100644
@@ -186,38 +186,6 @@ static int nftnl_expr_limit_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int nftnl_expr_limit_xml_parse(struct nftnl_expr *e,
-					 mxml_node_t *tree,
-					 struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint64_t rate, unit;
-	uint32_t burst, type, flags;
-
-	if (nftnl_mxml_num_parse(tree, "rate", MXML_DESCEND_FIRST, BASE_DEC,
-			       &rate, NFTNL_TYPE_U64, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u64(e, NFTNL_EXPR_LIMIT_RATE, rate);
-
-	if (nftnl_mxml_num_parse(tree, "unit", MXML_DESCEND_FIRST, BASE_DEC,
-			       &unit, NFTNL_TYPE_U64, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u64(e, NFTNL_EXPR_LIMIT_UNIT, unit);
-	if (nftnl_mxml_num_parse(tree, "burst", MXML_DESCEND_FIRST, BASE_DEC,
-			       &burst, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_LIMIT_BURST, burst);
-	if (nftnl_mxml_num_parse(tree, "type", MXML_DESCEND_FIRST, BASE_DEC,
-			       &type, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_LIMIT_TYPE, type);
-	if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC,
-			       &flags, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_LIMIT_FLAGS, flags);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static const char *get_unit(uint64_t u)
 {
 	switch (u) {
@@ -318,6 +286,5 @@ struct expr_ops expr_ops_limit = {
 	.parse		= nftnl_expr_limit_parse,
 	.build		= nftnl_expr_limit_build,
 	.snprintf	= nftnl_expr_limit_snprintf,
-	.xml_parse	= nftnl_expr_limit_xml_parse,
 	.json_parse	= nftnl_expr_limit_json_parse,
 };
src/expr/log.c +0 -45

56 lines not on this page · raw message

src/expr/lookup.c +0 -34
index 1377c0c..861815f 100644
@@ -197,39 +197,6 @@ nftnl_expr_lookup_json_parse(struct nftnl_expr *e, json_t *root,
 }
 
 static int
-nftnl_expr_lookup_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-			       struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	const char *set_name;
-	uint32_t sreg, dreg, flags;
-
-	set_name = nftnl_mxml_str_parse(tree, "set", MXML_DESCEND_FIRST,
-				      NFTNL_XML_MAND, err);
-	if (set_name != NULL)
-		nftnl_expr_set_str(e, NFTNL_EXPR_LOOKUP_SET, set_name);
-
-	if (nftnl_mxml_reg_parse(tree, "sreg", &sreg, MXML_DESCEND, NFTNL_XML_MAND,
-			       err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_LOOKUP_SREG, sreg);
-
-	if (nftnl_mxml_reg_parse(tree, "dreg", &dreg, MXML_DESCEND, NFTNL_XML_OPT,
-			       err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_LOOKUP_DREG, dreg);
-
-        if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC,
-				 &flags, NFTNL_TYPE_U32,
-				 NFTNL_XML_MAND, err) == 0)
-                nftnl_expr_set_u32(e, NFTNL_EXPR_LOOKUP_FLAGS, flags);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
-static int
 nftnl_expr_lookup_export(char *buf, size_t size,
 			 const struct nftnl_expr *e, int type)
 {
@@ -327,6 +294,5 @@ struct expr_ops expr_ops_lookup = {
 	.parse		= nftnl_expr_lookup_parse,
 	.build		= nftnl_expr_lookup_build,
 	.snprintf	= nftnl_expr_lookup_snprintf,
-	.xml_parse	= nftnl_expr_lookup_xml_parse,
 	.json_parse	= nftnl_expr_lookup_json_parse,
 };
src/expr/masq.c +0 -27
index 77506fe..32b5ad9 100644
@@ -155,32 +155,6 @@ nftnl_expr_masq_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int
-nftnl_expr_masq_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-			     struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint32_t flags;
-	uint32_t reg_proto_min, reg_proto_max;
-
-	if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC,
-			       &flags, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_MASQ_FLAGS, flags);
-	if (nftnl_mxml_reg_parse(tree, "sreg_proto_min", &reg_proto_min,
-				 MXML_DESCEND, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_MASQ_REG_PROTO_MIN,
-				   reg_proto_min);
-	if (nftnl_mxml_reg_parse(tree, "sreg_proto_max", &reg_proto_max,
-				 MXML_DESCEND, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_MASQ_REG_PROTO_MAX,
-				   reg_proto_max);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
 static int nftnl_expr_masq_export(char *buf, size_t size,
 				  const struct nftnl_expr *e, int type)
 {
@@ -255,6 +229,5 @@ struct expr_ops expr_ops_masq = {
 	.parse		= nftnl_expr_masq_parse,
 	.build		= nftnl_expr_masq_build,
 	.snprintf	= nftnl_expr_masq_snprintf,
-	.xml_parse	= nftnl_expr_masq_xml_parse,
 	.json_parse	= nftnl_expr_masq_json_parse,
 };
src/expr/match.c +0 -21
index c48518e..dd09e1e 100644
@@ -182,26 +182,6 @@ static int nftnl_expr_match_json_parse(struct nftnl_expr *e, json_t *root,
 }
 
 
-static int nftnl_expr_match_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-					 struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	const char *name;
-
-	name = nftnl_mxml_str_parse(tree, "name", MXML_DESCEND_FIRST,
-				  NFTNL_XML_MAND, err);
-	if (name != NULL)
-		nftnl_expr_set_str(e, NFTNL_EXPR_MT_NAME, name);
-
-	/* mt->info is ignored until other solution is reached */
-
-	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)
 {
@@ -270,6 +250,5 @@ struct expr_ops expr_ops_match = {
 	.parse		= nftnl_expr_match_parse,
 	.build		= nftnl_expr_match_build,
 	.snprintf	= nftnl_expr_match_snprintf,
-	.xml_parse 	= nftnl_expr_match_xml_parse,
 	.json_parse 	= nftnl_expr_match_json_parse,
 };
src/expr/meta.c +0 -33
index 6abf6c4..2c75841 100644
@@ -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,
 };
src/expr/nat.c +0 -55

66 lines not on this page · raw message

src/expr/numgen.c +0 -30
index a23be53..cd7dd60 100644
@@ -153,35 +153,6 @@ static int nftnl_expr_ng_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-
-static int nftnl_expr_ng_xml_parse(struct nftnl_expr *e,
-				   mxml_node_t *tree,
-				   struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint32_t dreg, modulus, type;
-
-	if (nftnl_mxml_reg_parse(tree, "dreg", &dreg, MXML_DESCEND_FIRST,
-				 NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_NG_DREG, dreg);
-
-	if (nftnl_mxml_num_parse(tree, "modulus", MXML_DESCEND_FIRST, BASE_DEC,
-				 &modulus, NFTNL_TYPE_U32, NFTNL_XML_MAND,
-				 err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_NG_MODULUS, modulus);
-
-	if (nftnl_mxml_num_parse(tree, "type", MXML_DESCEND_FIRST, BASE_DEC,
-				 &type, NFTNL_TYPE_U32, NFTNL_XML_MAND,
-				 err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_NG_TYPE, type);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int
 nftnl_expr_ng_snprintf_default(char *buf, size_t size,
 			       const struct nftnl_expr *e)
@@ -267,6 +238,5 @@ struct expr_ops expr_ops_ng = {
 	.parse		= nftnl_expr_ng_parse,
 	.build		= nftnl_expr_ng_build,
 	.snprintf	= nftnl_expr_ng_snprintf,
-	.xml_parse	= nftnl_expr_ng_xml_parse,
 	.json_parse	= nftnl_expr_ng_json_parse,
 };
src/expr/payload.c +0 -40
index c9ab5d4..17dd4cd 100644
@@ -251,45 +251,6 @@ nftnl_expr_payload_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int
-nftnl_expr_payload_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-				struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	const char *base_str;
-	int32_t base;
-	uint32_t dreg, offset, len;
-
-	if (nftnl_mxml_reg_parse(tree, "dreg", &dreg, MXML_DESCEND_FIRST,
-			       NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_PAYLOAD_DREG, dreg);
-
-	base_str = nftnl_mxml_str_parse(tree, "base", MXML_DESCEND_FIRST,
-				      NFTNL_XML_MAND, err);
-	if (base_str != NULL) {
-		base = nftnl_str2base(base_str);
-		if (base < 0)
-			return -1;
-
-		nftnl_expr_set_u32(e, NFTNL_EXPR_PAYLOAD_BASE, base);
-	}
-
-	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_PAYLOAD_OFFSET, offset);
-
-
-	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_PAYLOAD_LEN, len);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_payload_export(char *buf, size_t size, uint32_t flags,
 				     const struct nftnl_expr *e, int type)
 {
@@ -370,6 +331,5 @@ struct expr_ops expr_ops_payload = {
 	.parse		= nftnl_expr_payload_parse,
 	.build		= nftnl_expr_payload_build,
 	.snprintf	= nftnl_expr_payload_snprintf,
-	.xml_parse	= nftnl_expr_payload_xml_parse,
 	.json_parse	= nftnl_expr_payload_json_parse,
 };
src/expr/queue.c +0 -30
index 033c542..281950f 100644
@@ -150,35 +150,6 @@ nftnl_expr_queue_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int
-nftnl_expr_queue_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-			      struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint16_t queue_num, queue_total, flags;
-
-	if (nftnl_mxml_num_parse(tree, "num", MXML_DESCEND_FIRST, BASE_DEC,
-			       &queue_num, NFTNL_TYPE_U16, NFTNL_XML_MAND,
-			       err) == 0)
-		nftnl_expr_set_u16(e, NFTNL_EXPR_QUEUE_NUM, queue_num);
-
-	if (nftnl_mxml_num_parse(tree, "total", MXML_DESCEND_FIRST, BASE_DEC,
-			       &queue_total, NFTNL_TYPE_U16,
-			       NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u16(e, NFTNL_EXPR_QUEUE_TOTAL, queue_total);
-
-	if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC,
-			       &flags, NFTNL_TYPE_U16,
-			       NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u16(e, NFTNL_EXPR_QUEUE_FLAGS, flags);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_queue_snprintf_default(char *buf, size_t len,
 					     const struct nftnl_expr *e)
 {
@@ -269,6 +240,5 @@ struct expr_ops expr_ops_queue = {
 	.parse		= nftnl_expr_queue_parse,
 	.build		= nftnl_expr_queue_build,
 	.snprintf	= nftnl_expr_queue_snprintf,
-	.xml_parse	= nftnl_expr_queue_xml_parse,
 	.json_parse	= nftnl_expr_queue_json_parse,
 };
src/expr/quota.c +0 -22
index 47db62f..7740b24 100644
@@ -136,27 +136,6 @@ nftnl_expr_quota_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int nftnl_expr_quota_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-				      struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint64_t bytes;
-	uint32_t flags;
-
-	if (nftnl_mxml_num_parse(tree, "bytes", MXML_DESCEND_FIRST, BASE_DEC,
-				 &bytes, NFTNL_TYPE_U64, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u64(e, NFTNL_EXPR_QUOTA_BYTES, bytes);
-	if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC,
-				 &flags, NFTNL_TYPE_U32, NFTNL_XML_MAND,  err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_QUOTA_FLAGS, flags);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_quota_export(char *buf, size_t size,
 				   const struct nftnl_expr *e, int type)
 {
@@ -205,6 +184,5 @@ struct expr_ops expr_ops_quota = {
 	.parse		= nftnl_expr_quota_parse,
 	.build		= nftnl_expr_quota_build,
 	.snprintf	= nftnl_expr_quota_snprintf,
-	.xml_parse	= nftnl_expr_quota_xml_parse,
 	.json_parse	= nftnl_expr_quota_json_parse,
 };
src/expr/redir.c +0 -27
index d9dba00..d5bc179 100644
@@ -157,32 +157,6 @@ nftnl_expr_redir_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int
-nftnl_expr_redir_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-			      struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint32_t reg, flags;
-
-	if (nftnl_mxml_reg_parse(tree, "sreg_proto_min", &reg,
-			       MXML_DESCEND, NFTNL_XML_OPT, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_REDIR_REG_PROTO_MIN, reg);
-
-	if (nftnl_mxml_reg_parse(tree, "sreg_proto_max", &reg,
-			       MXML_DESCEND, NFTNL_XML_OPT, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_REDIR_REG_PROTO_MAX, reg);
-
-	if (nftnl_mxml_num_parse(tree, "flags", MXML_DESCEND_FIRST, BASE_DEC,
-			       &flags, NFTNL_TYPE_U32, NFTNL_XML_OPT, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_REDIR_FLAGS, flags);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_redir_export(char *buf, size_t size,
 				   const struct nftnl_expr *e, int type)
 {
@@ -269,6 +243,5 @@ struct expr_ops expr_ops_redir = {
 	.parse		= nftnl_expr_redir_parse,
 	.build		= nftnl_expr_redir_build,
 	.snprintf	= nftnl_expr_redir_snprintf,
-	.xml_parse	= nftnl_expr_redir_xml_parse,
 	.json_parse	= nftnl_expr_redir_json_parse,
 };
src/expr/reject.c +0 -24
index 2906082..11d8b20 100644
@@ -137,29 +137,6 @@ nftnl_expr_reject_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int
-nftnl_expr_reject_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-			       struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	uint32_t type;
-	uint8_t code;
-
-	if (nftnl_mxml_num_parse(tree, "type", MXML_DESCEND_FIRST, BASE_DEC,
-			       &type, NFTNL_TYPE_U32, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u32(e, NFTNL_EXPR_REJECT_TYPE, type);
-
-	if (nftnl_mxml_num_parse(tree, "code", MXML_DESCEND_FIRST, BASE_DEC,
-			       &code, NFTNL_TYPE_U8, NFTNL_XML_MAND, err) == 0)
-		nftnl_expr_set_u8(e, NFTNL_EXPR_REJECT_CODE, code);
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_expr_reject_snprintf_default(char *buf, size_t len,
 					      const struct nftnl_expr *e)
 {
@@ -224,6 +201,5 @@ struct expr_ops expr_ops_reject = {
 	.parse		= nftnl_expr_reject_parse,
 	.build		= nftnl_expr_reject_build,
 	.snprintf	= nftnl_expr_reject_snprintf,
-	.xml_parse	= nftnl_expr_reject_xml_parse,
 	.json_parse	= nftnl_expr_reject_json_parse,
 };
src/expr/target.c +0 -22
index 5a3301c..ed4bf7d 100644
@@ -182,27 +182,6 @@ nftnl_expr_target_json_parse(struct nftnl_expr *e, json_t *root,
 #endif
 }
 
-static int
-nftnl_expr_target_xml_parse(struct nftnl_expr *e, mxml_node_t *tree,
-			       struct nftnl_parse_err *err)
-{
-#ifdef XML_PARSING
-	const char *name;
-
-	name = nftnl_mxml_str_parse(tree, "name", MXML_DESCEND_FIRST,
-				  NFTNL_XML_MAND, err);
-	if (name != NULL)
-		nftnl_expr_set_str(e, NFTNL_EXPR_TG_NAME, name);
-
-	/* tg->info is ignored until other solution is reached */
-
-	return 0;
-#else
-	errno = EOPNOTSUPP;
-	return -1;
-#endif
-}
-
 static int nftnl_rule_exp_target_export(char *buf, size_t size,
 				        const struct nftnl_expr *e, int type)
 {
@@ -271,6 +250,5 @@ struct expr_ops expr_ops_target = {
 	.parse		= nftnl_expr_target_parse,
 	.build		= nftnl_expr_target_build,
 	.snprintf	= nftnl_expr_target_snprintf,
-	.xml_parse	= nftnl_expr_target_xml_parse,
 	.json_parse	= nftnl_expr_target_json_parse,
 };
src/mxml.c deleted +0 -232

232 lines not on this page · raw message

src/rule.c +2 -160

193 lines not on this page · raw message

src/ruleset.c +6 -156

253 lines not on this page · raw message

src/set.c +4 -190

227 lines not on this page · raw message

src/set_elem.c +4 -114

151 lines not on this page · raw message

src/table.c +1 -52

68 lines not on this page · raw message

tests/Makefile.am +2 -3
index e5588c9..99d2974 100644
@@ -1,8 +1,7 @@
 include $(top_srcdir)/Make_global.am
 
 EXTRA_DIST =		test-script.sh			\
-			jsonfiles			\
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

tests/nft-parsing-test.c +2 -60

62 lines not on this page · raw message

tests/test-script.sh +0 -1
index dcd9080..1c93e93 100755

Lines of this file are not shown. View the raw message.

tests/xmlfiles/01-table.xml deleted +0 -1
deleted file mode 100644
index c83c4e2..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/02-table.xml deleted +0 -1
deleted file mode 100644
index 99dc6df..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/10-chain.xml deleted +0 -1
deleted file mode 100644
index 8ae807b..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/11-chain.xml deleted +0 -1
deleted file mode 100644
index d48fa40..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/12-chain.xml deleted +0 -1
deleted file mode 100644
index 448feb2..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/20-rule-bitwise.xml deleted +0 -1
deleted file mode 100644
index 69ff702..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/21-rule-byteorder.xml deleted +0 -1
deleted file mode 100644
index 2c30ad7..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/22-rule-cmp.xml deleted +0 -1
deleted file mode 100644
index 103b7da..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/23-rule-counter.xml deleted +0 -1
deleted file mode 100644
index c6708c6..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/24-rule-ct.xml deleted +0 -1
deleted file mode 100644
index 832ae2f..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/25-rule-exthdr.xml deleted +0 -1
deleted file mode 100644
index 483d269..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/26-rule-immediate.xml deleted +0 -1
deleted file mode 100644
index fa5b3e7..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/27-rule-limit.xml deleted +0 -1
deleted file mode 100644
index e186204..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/28-rule-log.xml deleted +0 -1
deleted file mode 100644
index 9a11bbb..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/29-rule-lookup.xml deleted +0 -1
deleted file mode 100644
index 2074908..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/30-rule-match.xml deleted +0 -1
deleted file mode 100644
index 094f913..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/31-rule-meta.xml deleted +0 -1
deleted file mode 100644
index 1b9e1fa..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/32-rule-nat6.xml deleted +0 -1
deleted file mode 100644
index 5a71148..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/33-rule-nat4.xml deleted +0 -1
deleted file mode 100644
index c55618b..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/34-rule-payload.xml deleted +0 -1
deleted file mode 100644
index 34084d0..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/35-rule-target.xml deleted +0 -1
deleted file mode 100644
index 8bcfeb0..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/36-rule-real.xml deleted +0 -1
deleted file mode 100644
index 54db02b..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/37-rule-real.xml deleted +0 -1
deleted file mode 100644
index 97882b9..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

"ct"><dreg>1</dreg><key>state</key><dir>original</dir></expr><expr type="bitwise"><sreg>1</sreg><dreg>1</dreg><len>4</len><mask><reg type="value"><len>4</len><data0>0x0000000a</data0></reg><
/mask><xor><reg type="value"><len>4</len><data0>0x00000000</data0></reg></xor></expr><expr type="cmp"><sreg>1</sreg><op>neq</op><data><reg type="value"><len>4</len><data0>0x00000000</data0></reg></data></expr><expr type="counter"><pkts>0</pkts><bytes>0</bytes></expr><expr type="log"><prefix>testprefix</prefix><group>1</group></expr></rule></add></nftables>

tests/xmlfiles/38-rule-real.xml deleted +0 -1
deleted file mode 100644
index 49ab7b5..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

g type="verdict"><verdict>accept</verdict></reg></data></expr></rule></add></nftables>

tests/xmlfiles/39-rule-real.xml deleted +0 -1
deleted file mode 100644
index fa63b28..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

2a</data0><data1>0x2700cac1</data1><data2>0x00000000</data2><data3>0x50010000</data3></reg></data></expr><expr type="payload"><dreg>1</dreg><offset>6</offset><len>1</len><base>network</base>
</expr><expr type="cmp"><sreg>1</sreg><op>eq</op><data><reg type="value"><len>1</len><data0>0x00000011</data0></reg></data></expr><expr type="payload"><dreg>1</dreg><offset>2</offset><len>2</len><base>transport</base></expr><expr type="cmp"><sreg>1</sreg><op>eq</op><data><reg type="value"><len>2</len><data0>0x00003500</data0></reg></data></expr><expr type="ct"><dreg>1</dreg><key>status</key><dir>original</dir></expr><expr type="cmp"><sreg>1</sreg><op>eq</op><data><reg type="value"><len>4</len><data0>0x00000001</data0></reg></data></expr><expr type="counter"><pkts>0</pkts><bytes>0</bytes></expr><expr type="log"><prefix>dns_drop</prefix><group>2</group></expr><expr type="immediate"><dreg>0</dreg><data><reg type="verdict"><verdict>drop</verdict></reg></data></expr></rule></add></nftables>

tests/xmlfiles/40-rule-real.xml deleted +0 -1
deleted file mode 100644
index 55f195b..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/41-rule-real.xml deleted +0 -1
deleted file mode 100644
index 87dc713..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/42-rule-real.xml deleted +0 -1
deleted file mode 100644
index 7f66ab8..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/43-rule-real.xml deleted +0 -1
deleted file mode 100644
index fd9ac33..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/44-rule-real.xml deleted +0 -1
deleted file mode 100644
index ce026d0..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/45-rule-real.xml deleted +0 -1
deleted file mode 100644
index 0448be6..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/46-rule-real.xml deleted +0 -1
deleted file mode 100644
index 973df55..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/47-rule-real.xml deleted +0 -1
deleted file mode 100644
index 0d35fd9..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/48-rule-real.xml deleted +0 -1
deleted file mode 100644
index ebcd219..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/49-rule-real.xml deleted +0 -1
deleted file mode 100644
index 5fdf0d8..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/50-rule-real.xml deleted +0 -1
deleted file mode 100644
index 0ac1ac0..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/51-rule-real.xml deleted +0 -1
deleted file mode 100644
index 3976636..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/52-rule-real.xml deleted +0 -1
deleted file mode 100644
index 889415a..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/53-rule-real.xml deleted +0 -1
deleted file mode 100644
index a484270..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/54-rule-real.xml deleted +0 -1
deleted file mode 100644
index 6859ac2..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/55-rule-real.xml deleted +0 -1
deleted file mode 100644
index 8ee83e4..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/56-rule-real.xml deleted +0 -1
deleted file mode 100644
index be0b868..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/57-rule-real.xml deleted +0 -1
deleted file mode 100644
index 7a1d68f..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/58-rule-real.xml deleted +0 -1
deleted file mode 100644
index d32ed8f..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/59-rule-real.xml deleted +0 -1
deleted file mode 100644
index dc86dfb..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/60-rule-real.xml deleted +0 -1
deleted file mode 100644
index e5938e3..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/61-rule-real.xml deleted +0 -1
deleted file mode 100644
index 0c097b9..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/62-rule-real.xml deleted +0 -1
deleted file mode 100644
index 387a4f1..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/63-rule-real.xml deleted +0 -1
deleted file mode 100644
index 1f6aa92..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/64-rule-real.xml deleted +0 -1
deleted file mode 100644
index 68f9d8a..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/65-rule-real.xml deleted +0 -1
deleted file mode 100644
index 6eeb3d0..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/66-rule-real.xml deleted +0 -1
deleted file mode 100644
index 1294a85..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/67-rule-real.xml deleted +0 -1
deleted file mode 100644
index 162d084..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/68-rule-real.xml deleted +0 -1
deleted file mode 100644
index 08371f9..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/69-rule-real.xml deleted +0 -1
deleted file mode 100644
index 62119cd..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/70-rule-real.xml deleted +0 -1
deleted file mode 100644
index 436c517..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/71-rule-real.xml deleted +0 -1
deleted file mode 100644
index bb50afd..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/72-rule-real.xml deleted +0 -1
deleted file mode 100644
index 85ce226..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/73-set.xml deleted +0 -1
deleted file mode 100644
index 17b5995..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/74-set.xml deleted +0 -1
deleted file mode 100644
index bf39c46..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/75-ruleset.xml deleted +0 -1
deleted file mode 100644
index 9c63686..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0></reg></key></set_elem><set_elem><key><reg type="value"><len>2</len><data0>0x00003500</data0></reg></key></set_elem></set><set><family>ip</family><table>filter</table><name>map0</name><fla
gs>11</flags><key_type>12</key_type><key_len>2</key_len><data_type>4294967040</data_type><data_len>16</data_len><set_elem><key><reg type="value"><len>2</len><data0>0x00005000</data0></reg></key><data><reg type="verdict"><verdict>drop</verdict></reg></data></set_elem><set_elem><key><reg type="value"><len>2</len><data0>0x00001600</data0></reg></key><data><reg type="verdict"><verdict>accept</verdict></reg></data></set_elem></set><rule><family>ip</family><table>filter</table><chain>input</chain><handle>8</handle><expr type="counter"><pkts>0</pkts><bytes>0</bytes></expr><expr type="immediate"><dreg>0</dreg><data><reg type="verdict"><verdict>accept</verdict></reg></data></expr></rule><rule><family>ip</family><table>filter</table><chain>output</chain><handle>9</handle><expr type="payload"><dreg> 1</dreg><offset>9</offset><len>1</len><base>network</base></expr><expr type="cmp"><sreg>1</sreg><op>eq</op><data><reg type="value"><len>1</len><data0>0x00000006</data0></reg></data></expr><e
xpr type="payload"><dreg>1</dreg><offset>2</offset><len>2</len><base>transport</base></expr><expr type="lookup"><set>map0</set><sreg>1</sreg><dreg>0</dreg></expr></rule><rule><family>ip6</family><table>filter</table><chain>forward</chain><handle>2</handle><expr type="payload"><dreg>1</dreg><offset>6</offset><len>1</len><base>network</base></expr><expr type="cmp"><sreg>1</sreg><op>eq</op><data><reg type="value"><len>1</len><data0>0x00000011</data0></reg></data></expr><expr type="payload"><dreg>1</dreg><offset>2</offset><len>2</len><base>transport</base></expr><expr type="lookup"><set>set0</set><sreg>1</sreg><dreg>0</dreg></expr><expr type="counter"><pkts>0</pkts><bytes>0</bytes></expr><expr type="immediate"><dreg>0</dreg><data><reg type="verdict"><verdict>accept</verdict></reg></data></exp r></rule></add></nftables>

tests/xmlfiles/76-rule-meta_target.xml deleted +0 -1
deleted file mode 100644
index beac9f3..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/77-rule-queue.xml deleted +0 -1
deleted file mode 100644
index b9e9628..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/78-rule-queue.xml deleted +0 -2
deleted file mode 100644
index d192d7d..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/79-rule-masq.xml deleted +0 -1
deleted file mode 100644
index 59f9c53..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/80-rule-redir.xml deleted +0 -1
deleted file mode 100644
index 00abc58..0000000

Lines of this file are not shown. View the raw message.

tests/xmlfiles/81-rule-real.xml deleted +0 -1
deleted file mode 100644
index 11a860e..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

maintainer Applied
#1 lore raw
Quoted 11 lines · Arturo Borrero Gonzalez

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.

Applied, thanks Arturo.