[PATCH libnetfilter_queue 0/1] src: Add nfq_hdr_put to library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux