netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan Roe <duncan_roe@optusnet.com.au>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH libnetfilter_log] src: consistently use `gh` in code, code snippets and examples
Date: Mon,  6 Sep 2021 14:12:12 +1000	[thread overview]
Message-ID: <20210906041212.28886-1-duncan_roe@optusnet.com.au> (raw)

i.e. rather than `qh` sometimes

Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
---
 src/libnetfilter_log.c |  6 +++---
 utils/nfulnl_test.c    | 22 +++++++++++-----------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c
index a7554b5..546d667 100644
--- a/src/libnetfilter_log.c
+++ b/src/libnetfilter_log.c
@@ -183,14 +183,14 @@ struct nfnl_handle *nflog_nfnlh(struct nflog_handle *h)
  * Here's a little code snippet that binds to the group 100:
  * \verbatim
 	printf("binding this socket to group 100\n");
-	qh = nflog_bind_group(h, 100);
-	if (!qh) {
+	gh = nflog_bind_group(h, 100);
+	if (!gh) {
 		fprintf(stderr, "no handle for group 100\n");
 		exit(1);
 	}
 
 	printf("setting copy_packet mode\n");
-	if (nflog_set_mode(qh, NFULNL_COPY_PACKET, 0xffff) < 0) {
+	if (nflog_set_mode(gh, NFULNL_COPY_PACKET, 0xffff) < 0) {
 		fprintf(stderr, "can't set packet copy mode\n");
 		exit(1);
 	}
diff --git a/utils/nfulnl_test.c b/utils/nfulnl_test.c
index da140b4..d888fc1 100644
--- a/utils/nfulnl_test.c
+++ b/utils/nfulnl_test.c
@@ -51,8 +51,8 @@ static int cb(struct nflog_g_handle *gh, struct nfgenmsg *nfmsg,
 int main(int argc, char **argv)
 {
 	struct nflog_handle *h;
-	struct nflog_g_handle *qh;
-	struct nflog_g_handle *qh100;
+	struct nflog_g_handle *gh;
+	struct nflog_g_handle *gh100;
 	int rv, fd;
 	char buf[4096];
 
@@ -74,21 +74,21 @@ int main(int argc, char **argv)
 		exit(1);
 	}
 	printf("binding this socket to group 0\n");
-	qh = nflog_bind_group(h, 0);
-	if (!qh) {
-		fprintf(stderr, "no handle for grup 0\n");
+	gh = nflog_bind_group(h, 0);
+	if (!gh) {
+		fprintf(stderr, "no handle for group 0\n");
 		exit(1);
 	}
 
 	printf("binding this socket to group 100\n");
-	qh100 = nflog_bind_group(h, 100);
-	if (!qh100) {
+	gh100 = nflog_bind_group(h, 100);
+	if (!gh100) {
 		fprintf(stderr, "no handle for group 100\n");
 		exit(1);
 	}
 
 	printf("setting copy_packet mode\n");
-	if (nflog_set_mode(qh, NFULNL_COPY_PACKET, 0xffff) < 0) {
+	if (nflog_set_mode(gh, NFULNL_COPY_PACKET, 0xffff) < 0) {
 		fprintf(stderr, "can't set packet copy mode\n");
 		exit(1);
 	}
@@ -96,7 +96,7 @@ int main(int argc, char **argv)
 	fd = nflog_fd(h);
 
 	printf("registering callback for group 0\n");
-	nflog_callback_register(qh, &cb, NULL);
+	nflog_callback_register(gh, &cb, NULL);
 
 	printf("going into main loop\n");
 	while ((rv = recv(fd, buf, sizeof(buf), 0)) && rv >= 0) {
@@ -107,9 +107,9 @@ int main(int argc, char **argv)
 	}
 
 	printf("unbinding from group 100\n");
-	nflog_unbind_group(qh100);
+	nflog_unbind_group(gh100);
 	printf("unbinding from group 0\n");
-	nflog_unbind_group(qh);
+	nflog_unbind_group(gh);
 
 #ifdef INSANE
 	/* norally, applications SHOULD NOT issue this command,
-- 
2.17.5


             reply	other threads:[~2021-09-06  4:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  4:12 Duncan Roe [this message]
2021-09-06 10:08 ` [PATCH libnetfilter_log] src: consistently use `gh` in code, code snippets and examples 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=20210906041212.28886-1-duncan_roe@optusnet.com.au \
    --to=duncan_roe@optusnet.com.au \
    --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).