Skip to contentSkip to conversation

Documentation question

DISCUSSION Duncan Roe 2 participants 3 messages Nov 20, 2019 – Nov 21, 2019 netfilter

lore
Share & tools
lore

Duncan Roe

author
#0 lore raw

Hi Pablo,

Deprecated nfq_set_queue_flags documents flag NFQA_CFG_F_FAIL_OPEN for kernel to accept packets if the kernel queue gets full.

Does this still work with libmnl?I'm thinking we need a new "Library Setup [CURRENT]" section to document available flags (including e.g. NFQA_CFG_F_GSO that examples/nf-queue.c uses).

Maybe we need Attribute helper functions as well? (documentation *and* new code).

Cheers ... Duncan.

maintainer
#1 lore raw
Quoted 4 lines · Duncan Roe

Deprecated nfq_set_queue_flags documents flag NFQA_CFG_F_FAIL_OPEN for kernel to accept packets if the kernel queue gets full.

Does this still work with libmnl?

Yes.

Quoted 3 lines

I'm thinking we need a new "Library Setup
[CURRENT]" section to document available flags (including e.g. NFQA_CFG_F_GSO that examples/nf-queue.c uses).

Makes sense, thanks.

Quoted 2 lines

Maybe we need Attribute helper functions as well? (documentation *and* new code).

If you think it makes it easier, sure, why not.
But it would be something like this:

void nfq_nlmsg_cfg_put_flags(struct nlmsghdr *nlh, uint32_t flags)

{
        mnl_attr_put_u32(nlh, NFQA_CFG_FLAGS, htonl(flags));
        mnl_attr_put_u32(nlh, NFQA_CFG_MASK, htonl(flags));
}

I'm not sure that warrants a library helper.

author
#2 lore raw
Quoted 19 lines · Florian Westphal
Quoted 4 lines · Duncan Roe

Deprecated nfq_set_queue_flags documents flag NFQA_CFG_F_FAIL_OPEN for kernel to accept packets if the kernel queue gets full.

Does this still work with libmnl?

Yes.

Quoted 3 lines

I'm thinking we need a new "Library Setup
[CURRENT]" section to document available flags (including e.g. NFQA_CFG_F_GSO that examples/nf-queue.c uses).

Makes sense, thanks.

Quoted 2 lines

Maybe we need Attribute helper functions as well? (documentation *and* new code).

If you think it makes it easier, sure, why not.
But it would be something like this:

Quoted 7 lines

void nfq_nlmsg_cfg_put_flags(struct nlmsghdr *nlh, uint32_t flags)

{
        mnl_attr_put_u32(nlh, NFQA_CFG_FLAGS, htonl(flags));
        mnl_attr_put_u32(nlh, NFQA_CFG_MASK, htonl(flags));
}

I'm not sure that warrants a library helper.

Many of the existing helper functions are 2-liners, some even 1 line. These little functions often have more lines of doxygen documentation than of code.

So I think the extra helpers would fit in fine.

Cheers ... Duncan.