From: Alvaro Neira <alvaroneay@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: eric@regit.org
Subject: [libnftables PATCH 1/7] chain: change policy2str function to nft_verdict2str function
Date: Wed, 31 Jul 2013 15:20:51 +0200 [thread overview]
Message-ID: <20130731132051.29730.53717.stgit@Ph0enix> (raw)
From: Álvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
---
src/chain.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/src/chain.c b/src/chain.c
index 14db5f7..621794c 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -659,19 +659,6 @@ int nft_chain_parse(struct nft_chain *c, enum nft_chain_parse_type type,
}
EXPORT_SYMBOL(nft_chain_parse);
-static const char *policy2str(int policy)
-{
- switch (policy) {
- case NF_ACCEPT:
- return "accept";
- case NF_DROP:
- return "drop";
- default:
- break;
- }
- return "unknown";
-}
-
static int nft_chain_snprintf_json(char *buf, size_t size, struct nft_chain *c)
{
int ret, len = size, offset = 0;
@@ -698,7 +685,7 @@ static int nft_chain_snprintf_json(char *buf, size_t size, struct nft_chain *c)
"\"prio\": %d,"
"\"policy\": \"%s\"",
c->type, hooknum2str_array[c->hooknum], c->prio,
- policy2str(c->policy));
+ nft_verdict2str(c->policy));
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
}
@@ -762,7 +749,7 @@ static int nft_chain_snprintf_default(char *buf, size_t size,
" type %s hook %s prio %d policy %s use %d "
"packets %"PRIu64" bytes %"PRIu64"",
c->type, hooknum2str_array[c->hooknum], c->prio,
- policy2str(c->policy), c->use,
+ nft_verdict2str(c->policy), c->use,
c->packets, c->bytes);
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
}
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2013-07-31 13:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 13:20 Alvaro Neira [this message]
2013-07-31 13:20 ` [libnftables PATCH 2/7] jansson: Add helper function for building the tree Alvaro Neira
2013-07-31 13:21 ` [libnftables PATCH 3/7] table: remove the properties node in Json output Alvaro Neira
2013-07-31 13:21 ` [libnftables PATCH 4/7] chain: " Alvaro Neira
2013-07-31 13:21 ` [libnftables PATCH 5/7] chain:Add json parser support Alvaro Neira
2013-07-31 13:21 ` [libnftables PATCH 6/7] test:chain:test json parsing support Alvaro Neira
2013-07-31 13:21 ` [libnftables PATCH 7/7] examples: Add nft-chain-json-add Alvaro Neira
2013-07-31 17:14 ` [libnftables PATCH 1/7] chain: change policy2str function to nft_verdict2str function Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130731132051.29730.53717.stgit@Ph0enix \
--to=alvaroneay@gmail.com \
--cc=eric@regit.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).