I want to try and correlate an IP packet (using libpcap) to a process. I have had some limited success using the relevant /proc/net/ files but found that on some of the machines i’m using, this file can be many thousands of lines and parsing it is not efficient (caching has alleviated some performance problems). I read that using sock_diag
Tag: netlink
Obtaining real device of VLAN-interface through the netlink
I need to obtain the real_dev (f.e. ID) of the given VLAN-inteface. I wrote some test snippet using libnl: So I have some interface ID and I can check if it’s a VLAN-interface, but I have no idea how to obtain the interface the vlan is attached to. It seems that libnl’s API does not provide such possibility. Is there
libusb-1.0 hotplug events stop working in parent after fork(), when child calls libusb_exit()
I’ve been developing an application that monitors the USB device tree using libusb_hotplug_register_callback(). When a device that matches some criteria is attached, it will fork() and exec() an application to handle this device. The application has been working fine for some time now, but I’ve come back to try and ‘tidy it up’… libusb will open a number of file
How are netlink sockets in the Linux kernel different from polling from userland?
I have doubt about the functioning of netlink socket in kernel-application interaction context. As I have read that netlink socket is used for event based notification from kernel to application. The benefit of this is Application is not required to poll. But as in case of netlink socket also, it will also be polling finally to check whether some data