6#include <netlink/cli/utils.h>
8#define PROC_NETLINK "/proc/net/netlink"
10int main(
int argc,
char *argv[])
13 char buf[2048], p[64];
15 fd = fopen(PROC_NETLINK,
"re");
21 printf(
"Address Family PID Groups rmem "
24 while (fgets(buf,
sizeof(buf), fd)) {
26 int ret, proto, pid, rmem, wmem, refcnt;
29 ret = sscanf(buf,
"%lx %d %d %08x %d %d %lx %d\n",
30 &sk, &proto, &pid, &groups, &rmem, &wmem,
35 printf(
"0x%016lx %-16s %-6d %08x %-6d %-6d 0x%08lx %d\n",
36 sk, nl_nlfamily2str(proto, p,
sizeof(p)), pid,
37 groups, rmem, wmem, cb, refcnt);