From 1d1b818f3d6713b0a79bb1c0bda71446f08428af Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Mon, 3 Jun 2013 22:44:55 +0200 Subject: expr: xml: don't print target and match info This is binary layout of the iptables target/match, we can do nothing with it at this moment. Let's get rid of it. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- src/expr/match.c | 12 +----------- src/expr/target.c | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) (limited to 'src/expr') diff --git a/src/expr/match.c b/src/expr/match.c index 03d7e47..165d24d 100644 --- a/src/expr/match.c +++ b/src/expr/match.c @@ -245,22 +245,12 @@ static int nft_rule_expr_match_snprintf_xml(char *buf, size_t len, struct nft_expr_match *mt) { int ret, size=len; - int i; int offset = 0; - uint8_t *data = (uint8_t *)mt->data; - ret = snprintf(buf, len, "%s%u0x", + ret = snprintf(buf, len, "%s%u", mt->name, mt->rev); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - for (i=0; i < mt->data_len; i++) { - ret = snprintf(buf+offset, len, "%x", data[i] & 0xff); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - } - - ret = snprintf(buf+offset, len, ""); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - return offset; } diff --git a/src/expr/target.c b/src/expr/target.c index 4fd48a2..8c454a9 100644 --- a/src/expr/target.c +++ b/src/expr/target.c @@ -249,22 +249,12 @@ int nft_rule_exp_target_snprintf_xml(char *buf, size_t len, struct nft_expr_target *tg) { int ret, size=len; - int i; int offset = 0; - uint8_t *data = (uint8_t *)tg->data; - ret = snprintf(buf, len, "%s%u0x", + ret = snprintf(buf, len, "%s%u", tg->name, tg->rev); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - for (i=0; i < tg->data_len; i++) { - ret = snprintf(buf+offset, len, "%x", data[i] & 0xff); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - } - - ret = snprintf(buf+offset, len, ""); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - return offset; } -- cgit v1.2.3