Is there a way to have a callback argument passed to the netlink receive function when running in kernel space? I have the following code to create the socket:
struct netlink_kernel_cfg net_cfg =
{
.input = netlink_rcv,
};
private_data->netlink_sock = netlink_kernel_create(&init_net, private_data->netlink_type_id, &net_cfg);
Which works fine, but after endless digging through the man pages I can't see a way to have an argument passed through to the callback handler, to provide state information for example or access to the module's private data.
For info (since the netlink API seems to have changed significantly over recent years), I am using Linux kernel 3.14.
Could somebody please point me to a code snippet or somewhere in the man pages which I may have missed?