netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH libnetfilter_queue v2 00/15] Convert libnetfilter_queue to not need libnfnetlink
@ 2024-05-24  5:37 Duncan Roe
  2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 01/15] src: Convert nfq_open() to use libmnl Duncan Roe
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Duncan Roe @ 2024-05-24  5:37 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

The general method is to make the opaque struct nfq_handle contain fully
populated libnfnetlink-style and libmnl-style handles.
Patch 1 (nfq_open()) and patch 2 (nfq_open_nfnl()) sets this up.
Patch 3 (nfq_close()) cleans it away.
Patches 3-10 convert the other nfq_* functions that used to use
  libnfnetlink, except for the nfq_get_*_name functions that need nlif.
Patches 11-13 provide all the nlif_* functions that libnfnetlink used to
  offer, converted to use libmnl.
Patch 14 removes all use of and reference to header files provided by
  libnfnetlink. It provides prototypes as required.
Patch 15 removes libnfnetlink as a private library.

There is a tester for this patchset at
https://github.com/duncan-roe/nfqnltester
Some of the tests require checking out different branches,
e.g. for testing the effect of loading libraries in a diffrernt order.
There is more info in the README. In particular I checked that nlif still
works with -lnfnetlink coming first
(app will use libnfnetlink's functions).

The nlif functions sit a little uneasily in libnetfilter_queue.
ulogd2 and conntrack-tools both use them so perhaps they would
be better placed in libmnl.
---
 Changes in v2:
 - 11/32 (Fix checkpatch whitespace and block comment warnings) is
   subsumed into previous patches
 - 22/32 becomes 14
 - 21/32 becomes 15
 - 12/32 & 17/32 become 11, but rtnl.c is not copied
 - 14/32 & 16/32 become 12
 - 19/32 & (some of) 32/32 become 13
 - The only changes to linux_list.h are to fix or suppress checkpatch errors.
   There is no attempt to document the circular linked list functions
   and macros, so no changes to build_man.sh. That is how the rest of the
   patches disappear.
 - Other changes are documented in the individual patches

Duncan Roe (15):
  src: Convert nfq_open() to use libmnl
  src: Convert nfq_open_nfnl() to use libmnl
  src: Convert nfq_close() to use libmnl
  src: Convert nfq_create_queue(), nfq_bind_pf() & nfq_unbind_pf() to
    use libmnl
  src: Convert nfq_set_queue_flags(), nfq_set_queue_maxlen() &
    nfq_set_mode() to use libmnl
  src: Convert nfq_handle_packet(), nfq_get_secctx(), nfq_get_payload()
    and all the nfq_get_ functions to use libmnl
  src: Convert nfq_set_verdict() and nfq_set_verdict2() to use libmnl if
    there is no data
  src: Incorporate nfnl_rcvbufsiz() in libnetfilter_queue
  src: Convert nfq_fd() to use libmnl
  src: Convert remaining nfq_* functions to use libmnl
  src: Copy nlif-related files from libnfnetlink
  doc: Add iftable.c to the doxygen system
  src: Convert all nlif_* functions to use libmnl
  include: Use libmnl.h instead of libnfnetlink.h
  build: Remove libnfnetlink from the build

 Make_global.am                                |   2 +-
 configure.ac                                  |   1 -
 doxygen/Makefile.am                           |   1 +
 doxygen/doxygen.cfg.in                        |   6 +
 .../libnetfilter_queue/libnetfilter_queue.h   |  38 +-
 include/libnetfilter_queue/linux_list.h       | 730 ++++++++++++++++++
 .../linux_nfnetlink_queue.h                   |   3 +-
 libnetfilter_queue.pc.in                      |   2 -
 src/Makefile.am                               |   3 +-
 src/iftable.c                                 | 373 +++++++++
 src/libnetfilter_queue.c                      | 543 ++++++++-----
 11 files changed, 1512 insertions(+), 190 deletions(-)
 create mode 100644 include/libnetfilter_queue/linux_list.h
 create mode 100644 src/iftable.c

-- 
2.35.8


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

end of thread, other threads:[~2024-05-24  5:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24  5:37 [PATCH libnetfilter_queue v2 00/15] Convert libnetfilter_queue to not need libnfnetlink Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 01/15] src: Convert nfq_open() to use libmnl Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 02/15] src: Convert nfq_open_nfnl() " Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 03/15] src: Convert nfq_close() " Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 04/15] src: Convert nfq_create_queue(), nfq_bind_pf() & nfq_unbind_pf() " Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 05/15] src: Convert nfq_set_queue_flags(), nfq_set_queue_maxlen() & nfq_set_mode() " Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 06/15] src: Convert nfq_handle_packet(), nfq_get_secctx(), nfq_get_payload() and all the nfq_get_ functions " Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 07/15] src: Convert nfq_set_verdict() and nfq_set_verdict2() to use libmnl if there is no data Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 08/15] src: Incorporate nfnl_rcvbufsiz() in libnetfilter_queue Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 09/15] src: Convert nfq_fd() to use libmnl Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 10/15] src: Convert remaining nfq_* functions " Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 11/15] src: Copy nlif-related files from libnfnetlink Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 12/15] doc: Add iftable.c to the doxygen system Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 13/15] src: Convert all nlif_* functions to use libmnl Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 14/15] include: Use libmnl.h instead of libnfnetlink.h Duncan Roe
2024-05-24  5:37 ` [PATCH libnetfilter_queue v2 15/15] build: Remove libnfnetlink from the build Duncan Roe

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).