Skip to contentSkip to conversation

doc: make the HTML main page available as `man 7 libnetfilter_queue`

PATCH Superseded Duncan Roe 2 participants 2 messages Sep 21, 2023 – Sep 27, 2023 netfilter

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Duncan Roe

author
#0 lore raw

PATCH v2 1/1 doc: make the HTML main page available as `man 7 libnetfilter_queue`

Without this patch, man page users can miss important general information.

The HTML display stays as it was.
The man3 pages are updated to reference libnetfilter_queue.7. build_man.sh must be invoked with arguments to activate man7 generation, so will continue to work in other projects as before. build_man.sh remains generic,
so should be able to make man7 pages for other netfilter projects.

v2: Change commit message from "how" to "why"

---
 doxygen/Makefile.am      |   6 +--
 doxygen/build_man.sh     | 101 +++++++++++++++++++++++++++++++++++++--
 doxygen/man7.extra.txt   |   1 +
 doxygen/old_doxy_fix.txt |   5 ++
 src/libnetfilter_queue.c |  14 +++---
 5 files changed, 113 insertions(+), 14 deletions(-)
 create mode 100644 doxygen/man7.extra.txt
 create mode 100644 doxygen/old_doxy_fix.txt
doxygen/Makefile.am +3 -3
index c6eeed7..e98368b 100644
@@ -10,12 +10,12 @@ doc_srcs = $(top_srcdir)/src/libnetfilter_queue.c\
            $(top_srcdir)/src/extra/udp.c\
            $(top_srcdir)/src/extra/icmp.c
 
-doxyfile.stamp: $(doc_srcs) Makefile
+doxyfile.stamp: $(doc_srcs) Makefile build_man.sh man7.extra.txt old_doxy_fix.txt
 	rm -rf html man
 	doxygen doxygen.cfg >/dev/null
 
 if BUILD_MAN
-	$(abs_top_srcdir)/doxygen/build_man.sh
+	$(abs_top_srcdir)/doxygen/build_man.sh libnetfilter_queue libnetfilter_queue.c
 endif
 
 	touch doxyfile.stamp
@@ -42,4 +42,4 @@ uninstall-local:
 	rm -rf $(DESTDIR)$(mandir) man html doxyfile.stamp $(DESTDIR)$(htmldir)
 endif
 
-EXTRA_DIST = build_man.sh
+EXTRA_DIST = build_man.sh man7.extra.txt old_doxy_fix.txt
doxygen/build_man.sh +97 -4

129 lines not on this page · raw message

doxygen/man7.extra.txt new file +1 -0
new file mode 100644
index 0000000..62c8698
@@ -0,0 +1 @@
+ * \anchor LibrarySetup
doxygen/old_doxy_fix.txt new file +5 -0
new file mode 100644
index 0000000..46eeff8
@@ -0,0 +1,5 @@
+ * \manonly
+.PP
+.SH "Detailed Description"
+.PP
+\endmanonly
src/libnetfilter_queue.c +7 -7
index a170143..1269181 100644
@@ -45,11 +45,11 @@
  * libnetfilter_queue homepage is:
  * 	https://netfilter.org/projects/libnetfilter_queue/
  *
- * \section deps Dependencies
+ <h1>Dependencies</h1>
  * libnetfilter_queue requires libmnl, libnfnetlink and a kernel that includes
  * the Netfilter NFQUEUE over NFNETLINK interface (i.e. 2.6.14 or later).
  *
- * \section features Main Features
+ * <h1>Main Features</h1>
  *  - receiving queued packets from the kernel nfnetlink_queue subsystem
  *  - issuing verdicts and possibly reinjecting altered packets to the kernel
  *  nfnetlink_queue subsystem
@@ -71,15 +71,15 @@
  * When a queue is full, packets that should have been enqueued are dropped by
  * kernel instead of being enqueued.
  *
- * \section git Git Tree
+ * <h1>Git Tree</h1>
  * The current development version of libnetfilter_queue can be accessed at
  * https://git.netfilter.org/libnetfilter_queue.
  *
- * \section privs Privileges
+ * <h1>Privileges</h1>
  * You need the CAP_NET_ADMIN capability in order to allow your application
  * to receive from and to send packets to kernel-space.
  *
- * \section using Using libnetfilter_queue
+ * <h1>Using libnetfilter_queue</h1>
  *
  * To write your own program using libnetfilter_queue, you should start by
  * reading (or, if feasible, compiling and stepping through with *gdb*)
@@ -97,7 +97,7 @@ gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c
  * article:
  *  https://home.regit.org/netfilter-en/using-nfqueue-and-libnetfilter_queue/
  *
- * \section errors ENOBUFS errors in recv()
+ * <h1>ENOBUFS errors in recv()</h1>
  *
  * recv() may return -1 and errno is set to ENOBUFS in case that your
  * application is not fast enough to retrieve the packets from the kernel.
@@ -106,7 +106,7 @@ gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c
  * you may hit it again sooner or later. The next section provides some hints
  * on how to obtain the best performance for your application.
  *
- * \section perf Performance
+ * <h1>Performance</h1>
  * To improve your libnetfilter_queue application in terms of performance,
  * you may consider the following tweaks:
  *
Signature · 1 line
2.35.8
#1 lore raw

Hi Duncan,

Quoted 42 lines · Duncan Roe

Without this patch, man page users can miss important general information.

The HTML display stays as it was.
The man3 pages are updated to reference libnetfilter_queue.7. build_man.sh must be invoked with arguments to activate man7 generation, so will continue to work in other projects as before. build_man.sh remains generic,
so should be able to make man7 pages for other netfilter projects.

v2: Change commit message from "how" to "why"

---
 doxygen/Makefile.am      |   6 +--
 doxygen/build_man.sh     | 101 +++++++++++++++++++++++++++++++++++++--
 doxygen/man7.extra.txt   |   1 +
 doxygen/old_doxy_fix.txt |   5 ++
 src/libnetfilter_queue.c |  14 +++---
 5 files changed, 113 insertions(+), 14 deletions(-)
 create mode 100644 doxygen/man7.extra.txt
 create mode 100644 doxygen/old_doxy_fix.txt
doxygen/Makefile.am +2 -2
index c6eeed7..e98368b 100644
@@ -10,12 +10,12 @@ doc_srcs = $(top_srcdir)/src/libnetfilter_queue.c\
            $(top_srcdir)/src/extra/udp.c\
            $(top_srcdir)/src/extra/icmp.c
 
-doxyfile.stamp: $(doc_srcs) Makefile
+doxyfile.stamp: $(doc_srcs) Makefile build_man.sh man7.extra.txt old_doxy_fix.txt
 	rm -rf html man
 	doxygen doxygen.cfg >/dev/null
 
 if BUILD_MAN
-	$(abs_top_srcdir)/doxygen/build_man.sh
+	$(abs_top_srcdir)/doxygen/build_man.sh libnetfilter_queue libnetfilter_queue.c
 endif
 
 	touch doxyfile.stamp

doxygen/Makefile.am uninstall-local: · line 45

Quoted 5 lines
doxygen/Makefile.am +1 -1
@@ -42,4 +42,4 @@ uninstall-local:
 	rm -rf $(DESTDIR)$(mandir) man html doxyfile.stamp $(DESTDIR)$(htmldir)
 endif
 
-EXTRA_DIST = build_man.sh
+EXTRA_DIST = build_man.sh man7.extra.txt old_doxy_fix.txt

Please, find a way to make this self-contained. We agreed to keep this mangling to generate the API manpages and such in the build_man.sh script, it will probably require more work on that front.

Thanks.