All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
@ 2021-08-28 19:38 Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 1/6] Add doxygen directory to .gitignore Jeremy Sowden
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 19:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

The first four patches contain some miscellaneous improvements, then the
last two add code to retrieve time-stamps and interface names from
packets.

Incidentally, I notice that the last release of libnetfilter_log was in
2012.  Time for 1.0.2, perhaps?

Jeremy Sowden (6):
  Add doxygen directory to .gitignore.
  build: remove references to non-existent man-pages.
  doc: fix typo's in example.
  src: use calloc instead of malloc + memset.
  libipulog: use correct index to find attribute in packet.
  libipulog: fill in missing packet fields.

 .gitignore             |  1 +
 Makefile.am            |  4 +---
 src/libipulog_compat.c | 28 ++++++++++++++++++----------
 src/libnetfilter_log.c | 12 +++++-------
 utils/ulog_test.c      |  7 +++++++
 5 files changed, 32 insertions(+), 20 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH libnetfilter_log 1/6] Add doxygen directory to .gitignore.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
@ 2021-08-28 19:38 ` Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 2/6] build: remove references to non-existent man-pages Jeremy Sowden
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 19:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index f4938e98d7e9..5eaabe38a514 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,5 +13,6 @@ Makefile.in
 /configure
 /libtool
 
+/doxygen/
 /doxygen.cfg
 /*.pc
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH libnetfilter_log 2/6] build: remove references to non-existent man-pages.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 1/6] Add doxygen directory to .gitignore Jeremy Sowden
@ 2021-08-28 19:38 ` Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 3/6] doc: fix typo's in example Jeremy Sowden
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 19:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 Makefile.am | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9a1cbcb481f4..2a9cdd826dae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,9 +2,7 @@ SUBDIRS	= include src utils
 
 ACLOCAL_AMFLAGS = -I m4
 
-EXTRA_DIST = $(man_MANS) Make_global.am
-
-man_MANS = #nfnetlink_log.3 nfnetlink_log.7
+EXTRA_DIST = Make_global.am
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libnetfilter_log.pc
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH libnetfilter_log 3/6] doc: fix typo's in example.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 1/6] Add doxygen directory to .gitignore Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 2/6] build: remove references to non-existent man-pages Jeremy Sowden
@ 2021-08-28 19:38 ` Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 4/6] src: use calloc instead of malloc + memset Jeremy Sowden
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 19:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Use the right group number in nflog_bind_group example.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 src/libnetfilter_log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c
index 567049ccfb37..339f286f36bc 100644
--- a/src/libnetfilter_log.c
+++ b/src/libnetfilter_log.c
@@ -182,10 +182,10 @@ 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 0\n");
-	qh = nflog_bind_group(h, 0);
+	printf("binding this socket to group 100\n");
+	qh = nflog_bind_group(h, 100);
 	if (!qh) {
-		fprintf(stderr, "no handle for grup 0\n");
+		fprintf(stderr, "no handle for group 100\n");
 		exit(1);
 	}
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH libnetfilter_log 4/6] src: use calloc instead of malloc + memset.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
                   ` (2 preceding siblings ...)
  2021-08-28 19:38 ` [PATCH libnetfilter_log 3/6] doc: fix typo's in example Jeremy Sowden
@ 2021-08-28 19:38 ` Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 5/6] libipulog: use correct index to find attribute in packet Jeremy Sowden
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 19:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 src/libipulog_compat.c | 3 +--
 src/libnetfilter_log.c | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/libipulog_compat.c b/src/libipulog_compat.c
index 2d5b23a25c88..99cd86622d9b 100644
--- a/src/libipulog_compat.c
+++ b/src/libipulog_compat.c
@@ -90,12 +90,11 @@ struct ipulog_handle *ipulog_create_handle(uint32_t gmask,
 	struct ipulog_handle *h;
 	unsigned int group = gmask2group(gmask);
 
-	h = malloc(sizeof(*h)+PAYLOAD_SIZE);
+	h = calloc(1, sizeof(*h)+PAYLOAD_SIZE);
 	if (! h) {
 		ipulog_errno = IPULOG_ERR_HANDLE;
 		return NULL;
 	}
-	memset(h, 0, sizeof(*h));
 	h->nfulh = nflog_open();
 	if (!h->nfulh)
 		goto out_free;
diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c
index 339f286f36bc..7d37570e70cb 100644
--- a/src/libnetfilter_log.c
+++ b/src/libnetfilter_log.c
@@ -238,11 +238,10 @@ struct nflog_handle *nflog_open_nfnl(struct nfnl_handle *nfnlh)
 	struct nflog_handle *h;
 	int err;
 
-	h = malloc(sizeof(*h));
+	h = calloc(1, sizeof(*h));
 	if (!h)
 		return NULL;
 
-	memset(h, 0, sizeof(*h));
 	h->nfnlh = nfnlh;
 
 	h->nfnlssh = nfnl_subsys_open(h->nfnlh, NFNL_SUBSYS_ULOG, 
@@ -398,11 +397,10 @@ nflog_bind_group(struct nflog_handle *h, uint16_t num)
 	if (find_gh(h, num))
 		return NULL;
 	
-	gh = malloc(sizeof(*gh));
+	gh = calloc(1, sizeof(*gh));
 	if (!gh)
 		return NULL;
 
-	memset(gh, 0, sizeof(*gh));
 	gh->h = h;
 	gh->id = num;
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH libnetfilter_log 5/6] libipulog: use correct index to find attribute in packet.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
                   ` (3 preceding siblings ...)
  2021-08-28 19:38 ` [PATCH libnetfilter_log 4/6] src: use calloc instead of malloc + memset Jeremy Sowden
@ 2021-08-28 19:38 ` Jeremy Sowden
  2021-08-28 19:38 ` [PATCH libnetfilter_log 6/6] libipulog: fill in missing packet fields Jeremy Sowden
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 19:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

The time-stamp is at `NFULA_TIMESTAMP-1` not `NFULA_TIMESTAMP`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 src/libipulog_compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libipulog_compat.c b/src/libipulog_compat.c
index 99cd86622d9b..bf957274ca22 100644
--- a/src/libipulog_compat.c
+++ b/src/libipulog_compat.c
@@ -158,7 +158,7 @@ next_msg:	printf("next\n");
 	else
 		h->upmsg.mark = 0;
 
-	if (tb[NFULA_TIMESTAMP]) {
+	if (tb[NFULA_TIMESTAMP-1]) {
 		/* FIXME: 64bit network-to-host */
 		h->upmsg.timestamp_sec = h->upmsg.timestamp_usec = 0;
 	} else
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH libnetfilter_log 6/6] libipulog: fill in missing packet fields.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
                   ` (4 preceding siblings ...)
  2021-08-28 19:38 ` [PATCH libnetfilter_log 5/6] libipulog: use correct index to find attribute in packet Jeremy Sowden
@ 2021-08-28 19:38 ` Jeremy Sowden
  2021-08-28 19:53 ` [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jan Engelhardt
  2021-08-30  0:16 ` Pablo Neira Ayuso
  7 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 19:38 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Retrieval of time-stamp, input- and output-device fields had not been
implemented in `ipulog_get_packet`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 src/libipulog_compat.c | 23 ++++++++++++++++-------
 utils/ulog_test.c      |  7 +++++++
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/libipulog_compat.c b/src/libipulog_compat.c
index bf957274ca22..85f7cf59c2fc 100644
--- a/src/libipulog_compat.c
+++ b/src/libipulog_compat.c
@@ -4,6 +4,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <net/if.h>
 #include <netinet/in.h>
 #include <libnfnetlink/libnfnetlink.h>
 #include <libnetfilter_log/libnetfilter_log.h>
@@ -159,20 +160,29 @@ next_msg:	printf("next\n");
 		h->upmsg.mark = 0;
 
 	if (tb[NFULA_TIMESTAMP-1]) {
-		/* FIXME: 64bit network-to-host */
-		h->upmsg.timestamp_sec = h->upmsg.timestamp_usec = 0;
+		struct nfulnl_msg_packet_timestamp *ts;
+		ts = NFA_DATA(tb[NFULA_TIMESTAMP-1]);
+
+		h->upmsg.timestamp_sec  = __be64_to_cpu(ts->sec);
+		h->upmsg.timestamp_usec = __be64_to_cpu(ts->usec);
 	} else
 		h->upmsg.timestamp_sec = h->upmsg.timestamp_usec = 0;
 
 	if (tb[NFULA_IFINDEX_INDEV-1]) {
-		/* FIXME: ifindex lookup */	
-		h->upmsg.indev_name[0] = '\0';
+		void *indev_ptr = NFA_DATA(tb[NFULA_IFINDEX_INDEV-1]);
+		uint32_t indev_idx = ntohl(*(uint32_t *)indev_ptr);
+
+		if (!if_indextoname(indev_idx, h->upmsg.indev_name))
+			h->upmsg.indev_name[0] = '\0';
 	} else
 		h->upmsg.indev_name[0] = '\0';
 
 	if (tb[NFULA_IFINDEX_OUTDEV-1]) {
-		/* FIXME: ifindex lookup */	
-		h->upmsg.outdev_name[0] = '\0';
+		void *outdev_ptr = NFA_DATA(tb[NFULA_IFINDEX_OUTDEV-1]);
+		uint32_t outdev_idx = ntohl(*(uint32_t *)outdev_ptr);
+
+		if (!if_indextoname(outdev_idx, h->upmsg.outdev_name))
+			h->upmsg.outdev_name[0] = '\0';
 	} else
 		h->upmsg.outdev_name[0] = '\0';
 
@@ -222,4 +232,3 @@ void ipulog_perror(const char *s)
 		fprintf(stderr, ": %s", strerror(errno));
 	fputc('\n', stderr);
 }
-
diff --git a/utils/ulog_test.c b/utils/ulog_test.c
index f3adec2daf2e..20f61630d2ef 100644
--- a/utils/ulog_test.c
+++ b/utils/ulog_test.c
@@ -27,6 +27,13 @@ void handle_packet(ulog_packet_msg_t *pkt)
 	       pkt->hook, pkt->mark, pkt->data_len);
 	if (strlen(pkt->prefix))
 		printf("Prefix=%s ", pkt->prefix);
+	if (strlen(pkt->indev_name))
+		printf("Input device=%s ", pkt->indev_name);
+	if (strlen(pkt->outdev_name))
+		printf("Output device=%s ", pkt->outdev_name);
+	if (pkt->timestamp_sec || pkt->timestamp_usec)
+		printf("Timestamp=%ld.%06lds ",
+		       pkt->timestamp_sec, pkt->timestamp_usec);
 	
 	if (pkt->mac_len)
 	{
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
                   ` (5 preceding siblings ...)
  2021-08-28 19:38 ` [PATCH libnetfilter_log 6/6] libipulog: fill in missing packet fields Jeremy Sowden
@ 2021-08-28 19:53 ` Jan Engelhardt
  2021-08-28 22:19   ` Jeremy Sowden
  2021-08-30  0:16 ` Pablo Neira Ayuso
  7 siblings, 1 reply; 16+ messages in thread
From: Jan Engelhardt @ 2021-08-28 19:53 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Pablo Neira Ayuso, Netfilter Devel

On Saturday 2021-08-28 21:38, Jeremy Sowden wrote:

>Jeremy Sowden (6):
>  Add doxygen directory to .gitignore.
>  build: remove references to non-existent man-pages.
>  doc: fix typo's in example.
>  src: use calloc instead of malloc + memset.
>  libipulog: use correct index to find attribute in packet.
>  libipulog: fill in missing packet fields.

Subjects are not full sentences, as such they should never contain 
trailing periods.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-28 19:53 ` [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jan Engelhardt
@ 2021-08-28 22:19   ` Jeremy Sowden
  0 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-28 22:19 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Pablo Neira Ayuso, Netfilter Devel

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

On 2021-08-28, at 21:53:19 +0200, Jan Engelhardt wrote:
> On Saturday 2021-08-28 21:38, Jeremy Sowden wrote:
> > Jeremy Sowden (6):
> >  Add doxygen directory to .gitignore.
> >  build: remove references to non-existent man-pages.
> >  doc: fix typo's in example.
> >  src: use calloc instead of malloc + memset.
> >  libipulog: use correct index to find attribute in packet.
> >  libipulog: fill in missing packet fields.
>
> Subjects are not full sentences, as such they should never contain
> trailing periods.

The ones above were certainly intended to be full sentences, but I see
that the kernel docuemntation talks about "summary phrases" in subjects,
so I take your point.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
                   ` (6 preceding siblings ...)
  2021-08-28 19:53 ` [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jan Engelhardt
@ 2021-08-30  0:16 ` Pablo Neira Ayuso
  2021-08-30  1:33   ` Duncan Roe
  2021-08-30 10:05   ` Jeremy Sowden
  7 siblings, 2 replies; 16+ messages in thread
From: Pablo Neira Ayuso @ 2021-08-30  0:16 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Netfilter Devel

On Sat, Aug 28, 2021 at 08:38:18PM +0100, Jeremy Sowden wrote:
> The first four patches contain some miscellaneous improvements, then the
> last two add code to retrieve time-stamps and interface names from
> packets.

Applied, thanks.

> Incidentally, I notice that the last release of libnetfilter_log was in
> 2012.  Time for 1.0.2, perhaps?

I'll prepare for release, thanks for signalling.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-30  0:16 ` Pablo Neira Ayuso
@ 2021-08-30  1:33   ` Duncan Roe
  2021-08-30 10:02     ` Jeremy Sowden
  2021-08-30 10:05   ` Jeremy Sowden
  1 sibling, 1 reply; 16+ messages in thread
From: Duncan Roe @ 2021-08-30  1:33 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Development, Jeremy Sowden

On Mon, Aug 30, 2021 at 02:16:21AM +0200, Pablo Neira Ayuso wrote:
> On Sat, Aug 28, 2021 at 08:38:18PM +0100, Jeremy Sowden wrote:
> > The first four patches contain some miscellaneous improvements, then the
> > last two add code to retrieve time-stamps and interface names from
> > packets.
>
> Applied, thanks.
>
> > Incidentally, I notice that the last release of libnetfilter_log was in
> > 2012.  Time for 1.0.2, perhaps?
>
> I'll prepare for release, thanks for signalling.

With man pages?

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-30  1:33   ` Duncan Roe
@ 2021-08-30 10:02     ` Jeremy Sowden
  2021-08-31  9:00       ` Duncan Roe
  0 siblings, 1 reply; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-30 10:02 UTC (permalink / raw)
  To: Duncan Roe; +Cc: Pablo Neira Ayuso, Netfilter Development

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

On 2021-08-30, at 11:33:40 +1000, Duncan Roe wrote:
> On Mon, Aug 30, 2021 at 02:16:21AM +0200, Pablo Neira Ayuso wrote:
> > On Sat, Aug 28, 2021 at 08:38:18PM +0100, Jeremy Sowden wrote:
> > > The first four patches contain some miscellaneous improvements,
> > > then the last two add code to retrieve time-stamps and interface
> > > names from packets.
> >
> > Applied, thanks.
> >
> > > Incidentally, I notice that the last release of libnetfilter_log
> > > was in 2012.  Time for 1.0.2, perhaps?
> >
> > I'll prepare for release, thanks for signalling.
>
> With man pages?

I was waiting for you and Pablo to finalize the changes to
libnetfilter_queue with the intention of then looking at porting them to
libnetfilter_log. :)

The most recent Debian release included a -doc package with the HTML
doc's in it, and the next one will include the test programmes as
examples, but I think the man-pages need a bit of work first.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-30  0:16 ` Pablo Neira Ayuso
  2021-08-30  1:33   ` Duncan Roe
@ 2021-08-30 10:05   ` Jeremy Sowden
  2021-08-30 10:46     ` Pablo Neira Ayuso
  1 sibling, 1 reply; 16+ messages in thread
From: Jeremy Sowden @ 2021-08-30 10:05 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel


[-- Attachment #1.1: Type: text/plain, Size: 566 bytes --]

On 2021-08-30, at 02:16:21 +0200, Pablo Neira Ayuso wrote:
> On Sat, Aug 28, 2021 at 08:38:18PM +0100, Jeremy Sowden wrote:
> > The first four patches contain some miscellaneous improvements, then the
> > last two add code to retrieve time-stamps and interface names from
> > packets.
>
> Applied, thanks.
>
> > Incidentally, I notice that the last release of libnetfilter_log was in
> > 2012.  Time for 1.0.2, perhaps?
>
> I'll prepare for release, thanks for signalling.

Thanks.  Here's a patch to create a LIBVERSION variable for
libnetfilter_log_libipulog.

J.

[-- Attachment #1.2: 0001-build-add-LIBVERSION-variable-for-ipulog.patch --]
[-- Type: text/x-diff, Size: 1621 bytes --]

From f41fb8baa5993e21dbe21ad9ad52c8af2fae4d98 Mon Sep 17 00:00:00 2001
From: Jeremy Sowden <jeremy@azazel.net>
Date: Sun, 29 Aug 2021 11:40:13 +0100
Subject: [PATCH] build: add LIBVERSION variable for ipulog

Replace hard-coded version-info in LDFLAGS.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 src/Makefile.am | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 335c393f760a..815d9d31cfc0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,13 +18,14 @@
 # set age to 0.
 # </snippet>
 #
-LIBVERSION=2:0:1
+LIBVERSION = 2:0:1
+IPULOG_LIBVERSION = 1:0:0
 
 include ${top_srcdir}/Make_global.am
 
 lib_LTLIBRARIES = libnetfilter_log.la
 
-libnetfilter_log_la_LDFLAGS = -Wc,-nostartfiles	\
+libnetfilter_log_la_LDFLAGS = -Wc,-nostartfiles \
 			      -version-info $(LIBVERSION)
 libnetfilter_log_la_SOURCES = libnetfilter_log.c nlmsg.c
 libnetfilter_log_la_LIBADD  = ${LIBNFNETLINK_LIBS} ${LIBMNL_LIBS}
@@ -32,8 +33,8 @@ libnetfilter_log_la_LIBADD  = ${LIBNFNETLINK_LIBS} ${LIBMNL_LIBS}
 if BUILD_IPULOG
 lib_LTLIBRARIES += libnetfilter_log_libipulog.la
 
-libnetfilter_log_libipulog_la_LDFLAGS = -Wc,-nostartfiles	\
-					-version-info 1:0:0
-libnetfilter_log_libipulog_la_LIBADD = libnetfilter_log.la ${LIBNFNETLINK_LIBS}
+libnetfilter_log_libipulog_la_LDFLAGS = -Wc,-nostartfiles \
+					-version-info $(IPULOG_LIBVERSION)
+libnetfilter_log_libipulog_la_LIBADD  = libnetfilter_log.la ${LIBNFNETLINK_LIBS}
 libnetfilter_log_libipulog_la_SOURCES = libipulog_compat.c
 endif
-- 
2.33.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-30 10:05   ` Jeremy Sowden
@ 2021-08-30 10:46     ` Pablo Neira Ayuso
  0 siblings, 0 replies; 16+ messages in thread
From: Pablo Neira Ayuso @ 2021-08-30 10:46 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Netfilter Devel

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

On Mon, Aug 30, 2021 at 11:05:59AM +0100, Jeremy Sowden wrote:
> From f41fb8baa5993e21dbe21ad9ad52c8af2fae4d98 Mon Sep 17 00:00:00 2001
> From: Jeremy Sowden <jeremy@azazel.net>
> Date: Sun, 29 Aug 2021 11:40:13 +0100
> Subject: [PATCH] build: add LIBVERSION variable for ipulog
> 
> Replace hard-coded version-info in LDFLAGS.

Applied, thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-30 10:02     ` Jeremy Sowden
@ 2021-08-31  9:00       ` Duncan Roe
  2021-09-01 10:03         ` Jeremy Sowden
  0 siblings, 1 reply; 16+ messages in thread
From: Duncan Roe @ 2021-08-31  9:00 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Netfilter Development, Pablo Neira Ayuso

[-- Attachment #1: Type: text/plain, Size: 1946 bytes --]

On Mon, Aug 30, 2021 at 11:02:45AM +0100, Jeremy Sowden wrote:
> On 2021-08-30, at 11:33:40 +1000, Duncan Roe wrote:
> > On Mon, Aug 30, 2021 at 02:16:21AM +0200, Pablo Neira Ayuso wrote:
> > > On Sat, Aug 28, 2021 at 08:38:18PM +0100, Jeremy Sowden wrote:
> > > > The first four patches contain some miscellaneous improvements,
> > > > then the last two add code to retrieve time-stamps and interface
> > > > names from packets.
> > >
> > > Applied, thanks.
> > >
> > > > Incidentally, I notice that the last release of libnetfilter_log
> > > > was in 2012.  Time for 1.0.2, perhaps?
> > >
> > > I'll prepare for release, thanks for signalling.
> >
> > With man pages?
>
> I was waiting for you and Pablo to finalize the changes to
> libnetfilter_queue with the intention of then looking at porting them to
> libnetfilter_log. :)

The are at least 3 areas which could be worked on in the meantime:
 1. Fix the remaining doxygen warnings (attached)
 2. Insert the SYNOPSIS sections with required #include stmts. I've found that
    to be a bit of a black art e.g. pktb_alloc() doesn't actually need
    libmnl.h but if you leave it out then you need stdint.h which libmnl.h
    drags in. So specify libmnl.h because other functions in the program will
    need it anyway.
 3. The doxygen code will need a bit of "tightening" so man pages look better:
    ensure all functions that return something have a \returns;
    add \sa (see also) where appropriate;
    list possible errno values in an Errors paragraph (or detail the underlying
    system calls that might set errno);
    maybe clarify wording where appropriate.
>
> The most recent Debian release included a -doc package with the HTML
> doc's in it, and the next one will include the test programmes as
> examples, but I think the man-pages need a bit of work first.

Yes the 3 items above should be most of it.
I'm happy to work on them or would you rather?
>
> J.

Cheers ... Duncan.

[-- Attachment #2: blurb1.la --]
[-- Type: text/plain, Size: 1373 bytes --]

Fix the following doxygen warnings:
src/libnetfilter_log.c:888: warning: missing title after \defgroup Printing
src/libnetfilter_log.c:216: warning: argument 'log' of command @param is not found in the argument list of nflog_fd(struct nflog_handle *h)
src/libnetfilter_log.c:216: warning: The following parameters of nflog_fd(struct nflog_handle *h) are not documented:
  parameter 'h'
src/libnetfilter_log.c:443: warning: argument 'qh' of command @param is not found in the argument list of nflog_set_mode(struct nflog_g_handle *gh, uint8_t mode, uint32_t range)
src/libnetfilter_log.c:443: warning: The following parameters of nflog_set_mode(struct nflog_g_handle *gh, uint8_t mode, uint32_t range) are not documented:
  parameter 'gh'
src/libnetfilter_log.c:824: warning: The following parameters of nflog_get_gid(struct nflog_data *nfad, uint32_t *gid) are not documented:
  parameter 'gid'
src/libnetfilter_log.c:839: warning: The following parameters of nflog_get_seq(struct nflog_data *nfad, uint32_t *seq) are not documented:
  parameter 'seq'
src/libnetfilter_log.c:856: warning: The following parameters of nflog_get_seq_global(struct nflog_data *nfad, uint32_t *seq) are not documented:
  parameter 'seq'
src/libnetfilter_log.c:809: warning: The following parameters of nflog_get_uid(struct nflog_data *nfad, uint32_t *uid) are not documented:
  parameter 'uid'

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet`.
  2021-08-31  9:00       ` Duncan Roe
@ 2021-09-01 10:03         ` Jeremy Sowden
  0 siblings, 0 replies; 16+ messages in thread
From: Jeremy Sowden @ 2021-09-01 10:03 UTC (permalink / raw)
  To: Netfilter Development, Pablo Neira Ayuso

[-- Attachment #1: Type: text/plain, Size: 2126 bytes --]

On 2021-08-31, at 19:00:02 +1000, Duncan Roe wrote:
> On Mon, Aug 30, 2021 at 11:02:45AM +0100, Jeremy Sowden wrote:
> > On 2021-08-30, at 11:33:40 +1000, Duncan Roe wrote:
> > > On Mon, Aug 30, 2021 at 02:16:21AM +0200, Pablo Neira Ayuso wrote:
> > > > On Sat, Aug 28, 2021 at 08:38:18PM +0100, Jeremy Sowden wrote:
> > > > > The first four patches contain some miscellaneous improvements,
> > > > > then the last two add code to retrieve time-stamps and interface
> > > > > names from packets.
> > > >
> > > > Applied, thanks.
> > > >
> > > > > Incidentally, I notice that the last release of libnetfilter_log
> > > > > was in 2012.  Time for 1.0.2, perhaps?
> > > >
> > > > I'll prepare for release, thanks for signalling.
> > >
> > > With man pages?
> >
> > I was waiting for you and Pablo to finalize the changes to
> > libnetfilter_queue with the intention of then looking at porting them to
> > libnetfilter_log. :)
>
> The are at least 3 areas which could be worked on in the meantime:
>  1. Fix the remaining doxygen warnings (attached)
>  2. Insert the SYNOPSIS sections with required #include stmts. I've
>     found that to be a bit of a black art e.g. pktb_alloc() doesn't
>     actually need libmnl.h but if you leave it out then you need
>     stdint.h which libmnl.h drags in. So specify libmnl.h because
>     other functions in the program will need it anyway.
>  3. The doxygen code will need a bit of "tightening" so man pages look
>     better: ensure all functions that return something have a
>     \returns; add \sa (see also) where appropriate; list possible
>     errno values in an Errors paragraph (or detail the underlying
>     system calls that might set errno); maybe clarify wording where
>     appropriate.
> >
> > The most recent Debian release included a -doc package with the HTML
> > doc's in it, and the next one will include the test programmes as
> > examples, but I think the man-pages need a bit of work first.
>
> Yes the 3 items above should be most of it.  I'm happy to work on them
> or would you rather?

I dare say that the work will probably go more quickly if you do it.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-09-01 10:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28 19:38 [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jeremy Sowden
2021-08-28 19:38 ` [PATCH libnetfilter_log 1/6] Add doxygen directory to .gitignore Jeremy Sowden
2021-08-28 19:38 ` [PATCH libnetfilter_log 2/6] build: remove references to non-existent man-pages Jeremy Sowden
2021-08-28 19:38 ` [PATCH libnetfilter_log 3/6] doc: fix typo's in example Jeremy Sowden
2021-08-28 19:38 ` [PATCH libnetfilter_log 4/6] src: use calloc instead of malloc + memset Jeremy Sowden
2021-08-28 19:38 ` [PATCH libnetfilter_log 5/6] libipulog: use correct index to find attribute in packet Jeremy Sowden
2021-08-28 19:38 ` [PATCH libnetfilter_log 6/6] libipulog: fill in missing packet fields Jeremy Sowden
2021-08-28 19:53 ` [PATCH libnetfilter_log 0/6] Implementation of some fields omitted by `ipulog_get_packet` Jan Engelhardt
2021-08-28 22:19   ` Jeremy Sowden
2021-08-30  0:16 ` Pablo Neira Ayuso
2021-08-30  1:33   ` Duncan Roe
2021-08-30 10:02     ` Jeremy Sowden
2021-08-31  9:00       ` Duncan Roe
2021-09-01 10:03         ` Jeremy Sowden
2021-08-30 10:05   ` Jeremy Sowden
2021-08-30 10:46     ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.