I've googled this all over the place, and I'm still at a loss. tcp_diag is supposed to replace /proc/net/tcp, but I can't find a shred of documentation on how to use it. Please tell me how to #include it, and what methods, classes and functions it has. Thanks!
You create a DGRAM socket with domain AF_NETLINK and protocol NETLINK_INET_DIAG. Then you use the netlink protocol to communicate with the kernel and get the information you need.
Further reading:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With