All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libnetfilter_queue 0/1] src: Add nfq_hdr_put to library
@ 2020-02-04  2:00 Duncan Roe
  2020-02-04  2:00 ` [PATCH libnetfilter_queue 1/1] src: move static nfq_hdr_put from examples/nf-queue.c into the library since everyone is going to want it Duncan Roe
  0 siblings, 1 reply; 6+ messages in thread
From: Duncan Roe @ 2020-02-04  2:00 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

This is the first of a number of proposed additions to libnetfilter_queue.

The plan is to minimise the need for direct calls to libmnl functions in a
libnetfilter_queue program.

 - example program nf-queue.c is shorter
 - calling sequences are simplaer
 - documentation is mostly in one place

Other planned functions include:

 Function                  Purpose
 ========                  =======
 nfq_socket_sendto         Eliminate mnl_socket_sendto arg 3 (nlh->nlmsg_len)
 nfq_socket_open           Eliminate mnl_socket_open arg (NETLINK_NETFILTER)
 nfq_socket_bind           Eliminate mnl_socket_bind args 2 & 3
                           (0, MNL_SOCKET_AUTOPID)
 nfq_socket_setsockopt     Eliminate mnl_socket_setsockopt args 3 & 4
                           (&ret, sizeof(int))
 nfq_cb_run                Eliminate mnl_cb_run arg 3 (0). Also:
                           Replace mnl_cb_run arg 4 (unsigned int portid) with
                           (struct nlmsghdr *nlh). This eliminates the call to
                           mnl_socket_get_portid and the need to declare portid
 nfq_attr_put_config_flags Avoid having to call mnl_attr_put_u32 twice, also
                           avoid having to use htonl.
                           Implementation note: copy nfq_set_queue_flags
                                                documentation
 nfq_attr_put_u32          Avoid call to htonl
 nfq_attr_get_u32          Avoid call to ntohl

Leading eventually to the new top-level module:

Library Setup [CURRENT]

Duncan Roe (1):
  src: move static nfq_hdr_put from examples/nf-queue.c into the library
    since everyone is going to want it.

 examples/nf-queue.c                             | 15 -------------
 include/libnetfilter_queue/libnetfilter_queue.h |  1 +
 src/nlmsg.c                                     | 28 ++++++++++++++++++++++---
 3 files changed, 26 insertions(+), 18 deletions(-)

-- 
2.14.5


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

end of thread, other threads:[~2020-02-24  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04  2:00 [PATCH libnetfilter_queue 0/1] src: Add nfq_hdr_put to library Duncan Roe
2020-02-04  2:00 ` [PATCH libnetfilter_queue 1/1] src: move static nfq_hdr_put from examples/nf-queue.c into the library since everyone is going to want it Duncan Roe
2020-02-23 22:16   ` Pablo Neira Ayuso
2020-02-24  0:52     ` [PATCH libnetfilter_queue v2] " Duncan Roe
2020-02-24  2:21       ` [PATCH libnetfilter_queue v3] " Duncan Roe
2020-02-24  9:39         ` 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.