Is there any netlink socket example using libuv?

111 views
Skip to first unread message

zhengfish

unread,
Jun 12, 2016, 3:00:34 AM6/12/16
to li...@googlegroups.com
Hello,
    I want to program netlink connection with libuv.
    I don't found any example besides there is one line text in documentation here:
./docs/src/udp.rst:129:    In other words, other datagram-type sockets like raw sockets or netlink

    Then I tried to modify this ./test/test-udp-open.c example to support netlink socket, however while it will assert at:
    r = uv_udp_bind ( &client, ( const struct sockaddr* ) &addr, 0 );
    ASSERT ( r == 0 );

    I don't know whether libuv can support netlink programming.
    Do you have any idea or advice?

Thanks in advance.

zhengfish

Ben Noordhuis

unread,
Jun 12, 2016, 4:27:53 AM6/12/16
to li...@googlegroups.com
You can create the netlink socket yourself with socket(AF_NETLINK),
then hand it off to uv_poll_init().
Reply all
Reply to author
Forward
0 new messages