Confusion regarding nfct_query and nfct_callback_register

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux