All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duncan Roe <duncan_roe@optusnet.com.au>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Development <netfilter-devel@vger.kernel.org>
Subject: Re: Documentation question
Date: Mon, 5 Jul 2021 23:13:36 +1000	[thread overview]
Message-ID: <YOMFgP6KBQIBoiWo@slk1.local.net> (raw)
In-Reply-To: <20210705085610.GB16975@salvia>

On Mon, Jul 05, 2021 at 10:56:10AM +0200, Pablo Neira Ayuso wrote:
> On Mon, Jul 05, 2021 at 09:45:56AM +1000, Duncan Roe wrote:
> > Hi Pablo,
> >
> > Did you follow the email thread
> > https://www.spinics.net/lists/netfilter/msg60278.html?
> >
> > In summary, OP asked:
> > > Good morning! I am using the nf-queue.c example from
> > > libnetfilter_queue repo. In the queue_cb() function, I am trying to
> > > get the conntrack info but this condition is always false.
> > >
> > > if(attr[NFQA_CT])
> > >
> > > I can see the flow in conntrack -L output. Anyone know what I am
> > > missing? Appreciate your help!
> >
> > and Florian replied:
> > > IIRC you need to set NFQA_CFG_F_CONNTRACK in NFQA_CFG_FLAGS when setting
> > > up the queue.  The example only sets F_GSO, so no conntrack info is
> > > added.
> >
> > My question is, where should all this have been documented?
> >
> > `man nfq_set_queue_flags` documents NFQA_CFG_F_CONNTRACK, but
> > nfq_set_queue_flags() is deprecated and OP was not using it.
> >
> > The modern approach is to code
> > > mnl_attr_put_u32(nlh, NFQA_CFG_MASK, htonl(NFQA_CFG_F_GSO));
> >
> > NFQA_CFG_MASK is supplied by a libnetfilter_queue header, while
> > mnl_attr_put_u32() is a libmnl function. What to do?
>
> NFQA_CFG_MASK is supplied by linux/netfilter/nfnetlink_queue.h
>
> The UAPI header is the main reference, it provides the kernel
> definitions for the netlink attributes.
>
> libnetfilter_queue provides a "cache copy" of this header too, that
> is: libnetfilter_queue/linux_nfnetlink_queue.h

Are you saying that the UAPI headers are adequate as documentation of how to use
the system?

If not, where should extra documentation go?

In any case, do we tell the users to use header files in linux/ or
libnetfilter_queue/ (i.e. in the yet-to-be-written SYNOPSIS in man pages)?

Cheers ... Duncan.

  reply	other threads:[~2021-07-05 13:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04 23:45 Documentation question Duncan Roe
2021-07-05  8:56 ` Pablo Neira Ayuso
2021-07-05 13:13   ` Duncan Roe [this message]
2021-07-05 14:42     ` Pablo Neira Ayuso
2021-07-06  4:27       ` [PATCH libnetfilter_queue] src: examples: Use libnetfilter_queue cached linux headers throughout Duncan Roe
2021-07-06  5:36         ` [PATCH libnetfilter_queue v2] " Duncan Roe
2021-07-06 22:52           ` Pablo Neira Ayuso
2021-07-07  1:58             ` Duncan Roe
2021-07-18  5:27               ` Duncan Roe
  -- strict thread matches above, loose matches on Subject: below --
2019-12-15  2:02 Documentation question Duncan Roe
2019-12-20  0:29 ` Pablo Neira Ayuso
2019-12-21 10:43   ` Duncan Roe
2019-12-22  2:23     ` Duncan Roe
2019-11-20 23:09 Duncan Roe
2019-11-20 23:26 ` Florian Westphal
2019-11-21  5:33   ` Duncan Roe
2019-10-30  9:07 Duncan Roe
2019-10-30  9:15 ` Pablo Neira Ayuso
2019-10-30  9:38   ` Duncan Roe
2019-10-30  9:47     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YOMFgP6KBQIBoiWo@slk1.local.net \
    --to=duncan_roe@optusnet.com.au \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.