netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: anarey@gmail.com
Subject: [PATCH 2/3] iptables-compat: statify unused built-in table/chain functions
Date: Thu, 23 Oct 2014 13:18:48 +0200	[thread overview]
Message-ID: <1414063129-10091-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1414063129-10091-1-git-send-email-pablo@netfilter.org>

The functions that allows you to create built-in table and chains are
required out of the scope of nft.c

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 iptables/nft.c |   14 +++++++-------
 iptables/nft.h |    5 -----
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/iptables/nft.c b/iptables/nft.c
index b68b275..33afae4 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -518,7 +518,7 @@ static int nft_table_builtin_add(struct nft_handle *h,
 	return ret;
 }
 
-struct nft_chain *
+static struct nft_chain *
 nft_chain_builtin_alloc(struct builtin_table *table,
 			struct builtin_chain *chain, int policy)
 {
@@ -561,8 +561,9 @@ int nft_chain_add(struct nft_handle *h, struct nft_chain *c, uint16_t flags)
 	return mnl_talk(h, nlh, NULL, NULL);
 }
 
-void nft_chain_builtin_add(struct nft_handle *h, struct builtin_table *table,
-			   struct builtin_chain *chain, int policy)
+static void nft_chain_builtin_add(struct nft_handle *h,
+				  struct builtin_table *table,
+				  struct builtin_chain *chain, int policy)
 {
 	struct nft_chain *c;
 
@@ -598,7 +599,7 @@ nft_table_builtin_find(struct nft_handle *h, const char *table)
 }
 
 /* find if built-in chain already exists */
-struct builtin_chain *
+static struct builtin_chain *
 nft_chain_builtin_find(struct builtin_table *t, const char *chain)
 {
 	int i;
@@ -643,9 +644,8 @@ __nft_chain_builtin_init(struct nft_handle *h,
 	nft_chain_list_free(list);
 }
 
-int
-nft_chain_builtin_init(struct nft_handle *h, const char *table,
-		       const char *chain, int policy)
+static int nft_chain_builtin_init(struct nft_handle *h, const char *table,
+				  const char *chain, int policy)
 {
 	int ret = 0;
 	struct builtin_table *t;
diff --git a/iptables/nft.h b/iptables/nft.h
index 339d7bc..0db2ed6 100644
--- a/iptables/nft.h
+++ b/iptables/nft.h
@@ -54,7 +54,6 @@ void nft_fini(struct nft_handle *h);
 struct nft_table;
 struct nft_chain_list;
 
-struct builtin_table *nft_table_builtin_find(struct nft_handle *h, const char *table);
 int nft_table_add(struct nft_handle *h, struct nft_table *t, uint16_t flags);
 int nft_for_each_table(struct nft_handle *h, int (*func)(struct nft_handle *h, const char *tablename, bool counters), bool counters);
 bool nft_table_find(struct nft_handle *h, const char *tablename);
@@ -65,10 +64,6 @@ int nft_table_purge_chains(struct nft_handle *h, const char *table, struct nft_c
  */
 struct nft_chain;
 
-struct nft_chain *nft_chain_builtin_alloc(struct builtin_table *table, struct builtin_chain *chain, int policy);
-void nft_chain_builtin_add(struct nft_handle *h, struct builtin_table *table, struct builtin_chain *chain, int policy);
-struct builtin_chain *nft_chain_builtin_find(struct builtin_table *t, const char *chain);
-int nft_chain_builtin_init(struct nft_handle *h, const char *table, const char *chain, int policy);
 int nft_chain_add(struct nft_handle *h, struct nft_chain *c, uint16_t flags);
 int nft_chain_set(struct nft_handle *h, const char *table, const char *chain, const char *policy, const struct xt_counters *counters);
 struct nft_chain_list *nft_chain_dump(struct nft_handle *h);
-- 
1.7.10.4


  reply	other threads:[~2014-10-23 11:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 11:18 [PATCH 1/3] iptables-compat: fix chain policy reset with iptables -L -n Pablo Neira Ayuso
2014-10-23 11:18 ` Pablo Neira Ayuso [this message]
2014-10-23 11:18 ` [PATCH 3/3] iptables-compat: assume chain policy NF_ACCEPT when creating built-in chains Pablo Neira Ayuso
2014-10-24  7:49 ` [PATCH 1/3] iptables-compat: fix chain policy reset with iptables -L -n Ana Rey

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=1414063129-10091-2-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=anarey@gmail.com \
    --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).