On 08/10/2016 01:41 PM, Pablo Neira Ayuso wrote:
On Wed, Aug 10, 2016 at 11:48:54AM +0200, Carlos Falgueras García wrote:
Introduce nftnl_expr_iter_init() to allow stack allocated iterators for
internal use.
Applied with minor changes, see below.
Signed-off-by: Carlos Falgueras García <carlosfg@xxxxxxxxxx>
---
src/rule.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/src/rule.c b/src/rule.c
index 11fceca..69ffc7e 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -29,6 +29,14 @@
#include <libnftnl/set.h>
#include <libnftnl/expr.h>
+struct nftnl_expr_iter {
+ const struct nftnl_rule *r;
+ struct nftnl_expr *cur;
+};
+
+static void nftnl_expr_iter_init(const struct nftnl_rule *r,
+ struct nftnl_expr_iter *iter);
No need for this forward declaration. I have removed this.
+
struct nftnl_rule {
struct list_head head;
@@ -1025,10 +1033,16 @@ int nftnl_expr_foreach(struct nftnl_rule *r,
}
EXPORT_SYMBOL_ALIAS(nftnl_expr_foreach, nft_rule_expr_foreach);
-struct nftnl_expr_iter {
- const struct nftnl_rule *r;
- struct nftnl_expr *cur;
-};
I have kept this structure definition here, we don't have to scroll up
and down to get the context when looking at the iterators code.
After my change, the patch looks even smaller.
But we will need it at the next patch, so I will include these changes
in the patch : 2/4 - "Implement rule comparison". It is ok?
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html