From f95e8598af7e3a1641166b4e6be31b87d4690326 Mon Sep 17 00:00:00 2001 From: Giuseppe Longo Date: Fri, 5 Jul 2013 10:06:28 +0200 Subject: src: improve default text output This patch improves default plain text output by mimicing the default output of libnl-nft. While at it, several %lu has been translated to use %"PRIu64" for correctness. [ I have added the policy to string translation --pablo ] Signed-off-by: Giuseppe Longo Signed-off-by: Pablo Neira Ayuso --- src/expr/nat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/expr/nat.c') diff --git a/src/expr/nat.c b/src/expr/nat.c index 32be564..66ae405 100644 --- a/src/expr/nat.c +++ b/src/expr/nat.c @@ -363,28 +363,28 @@ nft_rule_expr_nat_snprintf_default(char *buf, size_t size, switch (nat->type) { case NFT_NAT_SNAT: - ret = snprintf(buf, len, "type=NFT_NAT_SNAT "); + ret = snprintf(buf, len, "snat "); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); break; case NFT_NAT_DNAT: - ret = snprintf(buf, len, "type=NFT_NAT_DNAT "); + ret = snprintf(buf, len, "dnat "); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); break; } - ret = snprintf(buf+offset, len, "family=%s ", nft_family2str(nat->family)); + ret = snprintf(buf+offset, len, "%s ", nft_family2str(nat->family)); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); if (e->flags & (1 << NFT_EXPR_NAT_REG_ADDR_MIN)) { ret = snprintf(buf+offset, len, - "sreg_addr_min_v4=%u sreg_addr_max_v4=%u ", + "addr_min reg %u addr_max reg %u ", nat->sreg_addr_min, nat->sreg_addr_max); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); } if (e->flags & (1 << NFT_EXPR_NAT_REG_PROTO_MIN)) { ret = snprintf(buf+offset, len, - "sreg_proto_min=%u sreg_proto_max=%u ", + "proto_min reg %u proto_max reg %u ", nat->sreg_proto_min, nat->sreg_proto_max); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); } -- cgit v1.2.3