From: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org
Subject: [nft PATCH 6/8] netlink: refactorize set_elem conversion from netlink
Date: Mon, 14 Apr 2014 12:17:35 +0200 [thread overview]
Message-ID: <20140414101735.5018.72797.stgit@nfdev.cica.es> (raw)
In-Reply-To: <20140414101634.5018.86819.stgit@nfdev.cica.es>
Lets refactorize set_elem handling.
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
src/netlink.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/netlink.c b/src/netlink.c
index f0ea6ca..84f2b7e 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -953,11 +953,10 @@ int netlink_delete_setelems(struct netlink_ctx *ctx, const struct handle *h,
return err;
}
-static int list_setelem_cb(struct nft_set_elem *nlse, void *arg)
+static int netlink_delinearize_setelem(struct nft_set_elem *nlse,
+ struct set *set)
{
struct nft_data_delinearize nld;
- struct netlink_ctx *ctx = arg;
- struct set *set = ctx->set;
struct expr *expr, *data;
uint32_t flags = 0;
@@ -1001,6 +1000,12 @@ out:
return 0;
}
+static int list_setelem_cb(struct nft_set_elem *nlse, void *arg)
+{
+ struct netlink_ctx *ctx = arg;
+ return netlink_delinearize_setelem(nlse, ctx->set);
+}
+
extern void interval_map_decompose(struct expr *set);
int netlink_get_setelems(struct netlink_ctx *ctx, const struct handle *h,
next prev parent reply other threads:[~2014-04-14 10:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-14 10:17 [nft PATCH 0/8] nft event monitor Arturo Borrero Gonzalez
2014-04-14 10:17 ` [nft PATCH 1/8] rule: allow to print sets in plain format Arturo Borrero Gonzalez
2014-04-14 10:17 ` [nft PATCH 2/8] netlink: add netlink_delinearize_set() func Arturo Borrero Gonzalez
2014-04-14 10:17 ` [nft PATCH 3/8] rule: generalize chain_print() Arturo Borrero Gonzalez
2014-04-14 10:17 ` [nft PATCH 4/8] netlink: add netlink_delinearize_chain() func Arturo Borrero Gonzalez
2014-04-14 10:17 ` [nft PATCH 5/8] netlink: add netlink_delinearize_table() func Arturo Borrero Gonzalez
2014-04-14 10:17 ` Arturo Borrero Gonzalez [this message]
2014-04-14 10:17 ` [nft PATCH 7/8] netlink: add socket error reporting helper function Arturo Borrero Gonzalez
2014-04-14 10:17 ` [nft PATCH 8/8] src: add events reporting Arturo Borrero Gonzalez
2014-04-14 12:28 ` Pablo Neira Ayuso
2014-04-14 12:32 ` [nft PATCH 0/8] nft event monitor Pablo Neira Ayuso
2014-04-14 12:35 ` Patrick McHardy
2014-04-28 14:28 ` 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=20140414101735.5018.72797.stgit@nfdev.cica.es \
--to=arturo.borrero.glez@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).