summaryrefslogtreecommitdiffstats
path: root/src/expr/nat.c
diff options
context:
space:
mode:
authorGiuseppe Longo <giuseppelng@gmail.com>2013-07-05 10:06:28 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-07-05 13:06:23 +0200
commitf95e8598af7e3a1641166b4e6be31b87d4690326 (patch)
tree21714a822cb02404ba68e1dfd9da3b39a082991e /src/expr/nat.c
parent1085a4e18d297d8338cf9babe7e623e25a00f499 (diff)
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 <giuseppelng@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/nat.c')
-rw-r--r--src/expr/nat.c10
1 files changed, 5 insertions, 5 deletions
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);
}