From a9a599ab675b8feb942355a24934901a9adcef1b Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Wed, 24 Feb 2016 01:19:34 +0530 Subject: comment: Add translation to nft Add translation for match comment to nftables. This patch also adds the relevant infrastructure for carrying out the translation. Example: $ sudo iptables-translate -A INPUT -s 192.168.0.0 -m comment --comment "A privatized IP block" nft add rule ip filter INPUT ip saddr 192.168.0.0 counter comment \"A privatized IP block\" Signed-off-by: Shivani Bhardwaj Signed-off-by: Pablo Neira Ayuso --- libxtables/xtables.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libxtables') diff --git a/libxtables/xtables.c b/libxtables/xtables.c index c4b86f51..fe24caa2 100644 --- a/libxtables/xtables.c +++ b/libxtables/xtables.c @@ -2045,6 +2045,11 @@ void xt_xlate_add_comment(struct xt_xlate *xl, const char *comment) xl->comment[NFT_USERDATA_MAXLEN - 1] = '\0'; } +const char *xt_xlate_get_comment(struct xt_xlate *xl) +{ + return xl->comment[0] ? xl->comment : NULL; +} + const char *xt_xlate_get(struct xt_xlate *xl) { return xl->buf.data; -- cgit v1.2.3