All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: phil@nwl.cc, fw@strlen.de
Subject: [PATCH nft 5/5] netlink: remove netlink_list_table()
Date: Mon, 17 Jun 2019 14:25:18 +0200	[thread overview]
Message-ID: <20190617122518.10486-5-pablo@netfilter.org> (raw)
In-Reply-To: <20190617122518.10486-1-pablo@netfilter.org>

Remove this wrapper, call netlink_list_rules() instead.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/netlink.h | 2 +-
 src/netlink.c     | 7 +------
 src/rule.c        | 2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/include/netlink.h b/include/netlink.h
index 0c08b1abbf6a..279723f33d31 100644
--- a/include/netlink.h
+++ b/include/netlink.h
@@ -104,6 +104,7 @@ extern struct expr *netlink_alloc_data(const struct location *loc,
 				       const struct nft_data_delinearize *nld,
 				       enum nft_registers dreg);
 
+extern int netlink_list_rules(struct netlink_ctx *ctx, const struct handle *h);
 extern void netlink_linearize_rule(struct netlink_ctx *ctx,
 				   struct nftnl_rule *nlr,
 				   const struct rule *rule);
@@ -115,7 +116,6 @@ extern struct chain *netlink_delinearize_chain(struct netlink_ctx *ctx,
 					       const struct nftnl_chain *nlc);
 
 extern int netlink_list_tables(struct netlink_ctx *ctx, const struct handle *h);
-extern int netlink_list_table(struct netlink_ctx *ctx, const struct handle *h);
 extern struct table *netlink_delinearize_table(struct netlink_ctx *ctx,
 					       const struct nftnl_table *nlt);
 
diff --git a/src/netlink.c b/src/netlink.c
index a6d81b4f6424..24d8f03ae4be 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -333,7 +333,7 @@ static int list_rule_cb(struct nftnl_rule *nlr, void *arg)
 	return 0;
 }
 
-static int netlink_list_rules(struct netlink_ctx *ctx, const struct handle *h)
+int netlink_list_rules(struct netlink_ctx *ctx, const struct handle *h)
 {
 	struct nftnl_rule_list *rule_cache;
 
@@ -485,11 +485,6 @@ int netlink_list_tables(struct netlink_ctx *ctx, const struct handle *h)
 	return 0;
 }
 
-int netlink_list_table(struct netlink_ctx *ctx, const struct handle *h)
-{
-	return netlink_list_rules(ctx, h);
-}
-
 enum nft_data_types dtype_map_to_kernel(const struct datatype *dtype)
 {
 	switch (dtype->type) {
diff --git a/src/rule.c b/src/rule.c
index 732de2874877..2d42a0328b66 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -190,7 +190,7 @@ static int cache_init_objects(struct netlink_ctx *ctx, unsigned int flags)
 			list_splice_tail_init(&ctx->list, &table->objs);
 		}
 		if (flags & NFT_CACHE_RULE) {
-			ret = netlink_list_table(ctx, &table->handle);
+			ret = netlink_list_rules(ctx, &table->handle);
 			list_for_each_entry_safe(rule, nrule, &ctx->list, list) {
 				chain = chain_lookup(table, &rule->handle);
 				list_move_tail(&rule->list, &chain->rules);
-- 
2.11.0


      parent reply	other threads:[~2019-06-17 12:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 12:25 [PATCH nft 1/5] src: remove useless parameter from cache_flush() Pablo Neira Ayuso
2019-06-17 12:25 ` [PATCH nft 2/5] tests: shell: cannot use handle for non-existing rule in kernel Pablo Neira Ayuso
2019-06-17 16:00   ` Phil Sutter
2019-06-17 16:06     ` Pablo Neira Ayuso
2019-06-17 16:29       ` Phil Sutter
2019-06-17 12:25 ` [PATCH nft 3/5] src: add cache level flags Pablo Neira Ayuso
2019-06-17 15:57   ` Phil Sutter
2019-06-17 16:11   ` Phil Sutter
2019-06-17 16:28     ` Pablo Neira Ayuso
2019-06-17 16:45       ` Phil Sutter
2019-06-17 17:24         ` Pablo Neira Ayuso
2019-06-17 17:28           ` Phil Sutter
2019-06-17 17:33             ` Pablo Neira Ayuso
2019-06-17 20:37               ` Phil Sutter
2019-06-17 12:25 ` [PATCH nft 4/5] rule: skip cache population from do_command_monitor() Pablo Neira Ayuso
2019-06-17 12:25 ` Pablo Neira Ayuso [this message]

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=20190617122518.10486-5-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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 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.