netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ana Rey <anarey@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Ana Rey <anarey@gmail.com>
Subject: [libnftnl PATCH v4 1/3] expr: log: Rename variables in nft_rule_expr_log_json_parse functions
Date: Tue,  3 Jun 2014 12:41:54 +0200	[thread overview]
Message-ID: <1401792116-17742-2-git-send-email-anarey@gmail.com> (raw)
In-Reply-To: <1401792116-17742-1-git-send-email-anarey@gmail.com>

Renames some variables for code readability reasons.

Signed-off-by: Ana Rey <anarey@gmail.com>
---
 src/expr/log.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/expr/log.c b/src/expr/log.c
index a61a8d3..eaba1d6 100644
--- a/src/expr/log.c
+++ b/src/expr/log.c
@@ -166,7 +166,8 @@ static int nft_rule_expr_log_json_parse(struct nft_rule_expr *e, json_t *root,
 #ifdef JSON_PARSING
 	const char *prefix;
 	uint32_t snaplen;
-	uint16_t uval16;
+	uint16_t group;
+	uint16_t qthreshold;
 
 	prefix = nft_jansson_parse_str(root, "prefix", err);
 	if (prefix == NULL)
@@ -174,11 +175,11 @@ static int nft_rule_expr_log_json_parse(struct nft_rule_expr *e, json_t *root,
 
 	nft_rule_expr_set_str(e, NFT_EXPR_LOG_PREFIX, prefix);
 
-	if (nft_jansson_parse_val(root, "group", NFT_TYPE_U16, &uval16,
+	if (nft_jansson_parse_val(root, "group", NFT_TYPE_U16, &group,
 				  err) < 0)
 		return -1;
 
-	nft_rule_expr_set_u16(e, NFT_EXPR_LOG_GROUP, uval16);
+	nft_rule_expr_set_u16(e, NFT_EXPR_LOG_GROUP, group);
 
 	if (nft_jansson_parse_val(root, "snaplen", NFT_TYPE_U32, &snaplen,
 				  err) < 0)
@@ -187,10 +188,10 @@ static int nft_rule_expr_log_json_parse(struct nft_rule_expr *e, json_t *root,
 	nft_rule_expr_set_u32(e, NFT_EXPR_LOG_SNAPLEN, snaplen);
 
 	if (nft_jansson_parse_val(root, "qthreshold", NFT_TYPE_U16,
-				  &uval16, err) < 0)
+				  &qthreshold, err) < 0)
 		return -1;
 
-	nft_rule_expr_set_u16(e, NFT_EXPR_LOG_QTHRESHOLD, uval16);
+	nft_rule_expr_set_u16(e, NFT_EXPR_LOG_QTHRESHOLD, qthreshold);
 
 	return 0;
 #else
-- 
2.0.0.rc2


  reply	other threads:[~2014-06-03 10:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 10:41 [libnftnl PATCH v4 0/3] Do not print unset value in xml file Ana Rey
2014-06-03 10:41 ` Ana Rey [this message]
2014-06-05 13:17   ` [libnftnl PATCH v4 1/3] expr: log: Rename variables in nft_rule_expr_log_json_parse functions Pablo Neira Ayuso
2014-06-03 10:41 ` [libnftnl PATCH v4 2/3] expr: log: Use nft_rule_expr_set_* in the xml parsing code Ana Rey
2014-06-05 13:17   ` Pablo Neira Ayuso
2014-06-03 10:41 ` [libnftnl PATCH v4 3/3] expr: log: Do not print unset values in xml Ana Rey
2014-06-05 13:18   ` 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=1401792116-17742-2-git-send-email-anarey@gmail.com \
    --to=anarey@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).