Lines Matching refs:netlink_socket
44 int send_command(struct nl_sock* netlink_socket, uint16_t nlmsg_type, in send_command() argument
60 int result = nl_send(netlink_socket, message); in send_command()
85 int get_family_id(struct nl_sock* netlink_socket, const char* name) { in get_family_id() argument
86 if (send_command(netlink_socket, GENL_ID_CTRL, getpid(), in get_family_id()
99 if (nl_recvmsgs(netlink_socket, callbacks) < 0) { in get_family_id()
145 int query_task_stats(struct nl_sock* netlink_socket, int family_id, in query_task_stats() argument
149 int result = send_command(netlink_socket, family_id, getpid(), in query_task_stats()
160 result = nl_recvmsgs(netlink_socket, callbacks); in query_task_stats()
351 struct nl_sock* netlink_socket = nl_socket_alloc(); in main() local
352 if (!netlink_socket || genl_connect(netlink_socket) < 0) { in main()
357 int family_id = get_family_id(netlink_socket, TASKSTATS_GENL_NAME); in main()
364 if (query_task_stats(netlink_socket, family_id, command_type, pid, in main()
371 nl_socket_free(netlink_socket); in main()
375 if (netlink_socket) { in main()
376 nl_socket_free(netlink_socket); in main()