netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alvaro Neira Ayuso <alvaroneay@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [libnftnl PATCH 1/2] ruleset: add the set_id to the parsed sets
Date: Fri,  3 Oct 2014 20:02:39 +0200	[thread overview]
Message-ID: <1412359360-30695-1-git-send-email-alvaroneay@gmail.com> (raw)

Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
---
 src/ruleset.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/ruleset.c b/src/ruleset.c
index a19cbc1..8cc0c40 100644
--- a/src/ruleset.c
+++ b/src/ruleset.c
@@ -234,6 +234,7 @@ static int nft_ruleset_json_parse_sets(struct nft_ruleset *rs, json_t *array,
 				       struct nft_parse_err *err)
 {
 	int i, len;
+	uint32_t set_id = 0;
 	json_t *node;
 	struct nft_set *s = NULL;
 	struct nft_set_list *list = nft_set_list_alloc();
@@ -265,6 +266,7 @@ static int nft_ruleset_json_parse_sets(struct nft_ruleset *rs, json_t *array,
 			goto err;
 		}
 
+		nft_set_attr_set_u32(s, NFT_SET_ATTR_ID, set_id++);
 		nft_set_list_add_tail(s, list);
 	}
 
@@ -457,6 +459,7 @@ static int
 nft_ruleset_xml_parse_sets(struct nft_ruleset *rs, mxml_node_t *tree,
 			   struct nft_parse_err *err)
 {
+	uint32_t set_id = 0;
 	mxml_node_t *node;
 	struct nft_set *s;
 	struct nft_set_list *set_list = nft_set_list_alloc();
@@ -479,6 +482,7 @@ nft_ruleset_xml_parse_sets(struct nft_ruleset *rs, mxml_node_t *tree,
 			goto err_free;
 		}
 
+		nft_set_attr_set_u32(s, NFT_SET_ATTR_ID, set_id++);
 		nft_set_list_add_tail(s, set_list);
 	}
 
-- 
1.7.10.4


             reply	other threads:[~2014-10-03 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 18:02 Alvaro Neira Ayuso [this message]
2014-10-03 18:02 ` [libnftnl PATCH 2/2] src: internal set id allocation from nft_ruleset_parse*() Alvaro Neira Ayuso
2014-10-09 16:52   ` Pablo Neira Ayuso
2014-10-09 16:52 ` [libnftnl PATCH 1/2] ruleset: add the set_id to the parsed sets 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=1412359360-30695-1-git-send-email-alvaroneay@gmail.com \
    --to=alvaroneay@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).