]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: remove netlink_list_table()
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 17 Jun 2019 12:01:56 +0000 (14:01 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 17 Jun 2019 17:54:57 +0000 (19:54 +0200)
Remove this wrapper, call netlink_list_rules() instead.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/netlink.h
src/netlink.c
src/rule.c

index 0c08b1abbf6af97045ea3e44f7afb48ea3fe538b..279723f33d316bd5e5c6d01d0046b428b2ed17f1 100644 (file)
@@ -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);
 
index a6d81b4f642471a435141c377276929278c8869d..24d8f03ae4be79caf58dc47875cf6502925cda75 100644 (file)
@@ -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) {
index bcd1c0bf73e8f81ff9db2da89df5fe22b500007c..ed199889702f7855a75032fa8ea86edcb9f74c6d 100644 (file)
@@ -191,7 +191,7 @@ static int cache_init_objects(struct netlink_ctx *ctx, enum cmd_ops cmd)
                if (cmd != CMD_LIST)
                        continue;
 
-               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);