this is how the function looks like:
struct net_device_stats* (*get_stats)(struct net_device *dev);
I simply need to call this function in my code and get it’s results in a net_device_stats struct I declared earlier. Can anyone give a simple implementation code for this?
This is not a function. Its the declaration of a function pointer
get_statswhich points to a function which receives a pointer to the structurenet_deviceand returns a pointer to a structure of typenet_device_statsHere is one use case
EDIT From your comments, I see you are using an older version of the kernel. IN later kernels , structure
net_devicestill resides inlinux/netdevice.hbut there’s noget_statsfunction pointer. Its changed intondo_get_statsand it is now under another structurenet_device_opsSo start using these new function pointers.