Linux Netfilter discussions
 help / color / mirror / Atom feed
* Confusion regarding nfct_query and nfct_callback_register
@ 2016-02-12  4:10 Gadre Nayan
  2016-02-12  7:30 ` Ken-ichirou MATSUZAWA
  0 siblings, 1 reply; 3+ messages in thread
From: Gadre Nayan @ 2016-02-12  4:10 UTC (permalink / raw)
  To: netfilter

Dear All,

I using Netfilter framework and associated tools (
libnetfilter_conntrack, Conntrack-tools).

I am particularly confused with the arguments of 2 functions.

1. int nfct_callback_register ( struct nfct_handle * h, enum
nf_conntrack_msg_type type,
                                                int(*)(enum
nf_conntrack_msg_type type, struct nf_conntrack *ct, void *data)cb,
                                                void * data ).

2. int nfct_query (struct nfct_handle *h, const enum
nf_conntrack_query qt, const void *data).

The typical usage I see is as below:

nfct_callback_register(h, NFCT_T_ALL, update_cb, NULL); ret =
nfct_query(h, NFCT_Q_DUMP, &family);

static int update_cb(enum nf_conntrack_msg_type type, struct
nf_conntrack *ct, void *data)
{
        int res;
        struct nf_conntrack *obj = data;
}

So both data and ct parameters of update_cb are of type struct nf_conntrack.
Who is providing both these structures (struct nf_conntrack *ct, void
data) in update_cb.
Which struct nf_conntrack* among the 2 is the actual data received
from the kernel space.

Thanks and Regards

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

end of thread, other threads:[~2016-02-23  4:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12  4:10 Confusion regarding nfct_query and nfct_callback_register Gadre Nayan
2016-02-12  7:30 ` Ken-ichirou MATSUZAWA
2016-02-23  4:16   ` Gadre Nayan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox