All of lore.kernel.org
 help / color / mirror / Atom feed
* [libnftables PATCH 1/7] chain: change policy2str function to nft_verdict2str function
@ 2013-07-31 13:20 Alvaro Neira
  2013-07-31 13:20 ` [libnftables PATCH 2/7] jansson: Add helper function for building the tree Alvaro Neira
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Alvaro Neira @ 2013-07-31 13:20 UTC (permalink / raw)
  To: netfilter-devel; +Cc: eric

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-31 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-31 13:20 [libnftables PATCH 1/7] chain: change policy2str function to nft_verdict2str function Alvaro Neira
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.