From 63548f5664e0e149f5e51219ad6f582f985e3c42 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Thu, 14 Jul 2011 12:48:00 +0200 Subject: documentation updates --- doc/src/examples/sk_group_example.c | 43 ------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 doc/src/examples/sk_group_example.c (limited to 'doc/src/examples/sk_group_example.c') diff --git a/doc/src/examples/sk_group_example.c b/doc/src/examples/sk_group_example.c deleted file mode 100644 index f948e18..0000000 --- a/doc/src/examples/sk_group_example.c +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -/* - * This function will be called for each valid netlink message received - * in nl_recvmsgs_default() - */ -static int my_func(struct nl_msg *msg, void *arg) -{ - return 0; -} - -struct nl_sock *sk; - -/* Allocate a new socket */ -sk = nl_socket_alloc(); - -/* - * Notifications do not use sequence numbers, disable sequence number - * checking. - */ -nl_socket_disable_seq_check(sk); - -/* - * Define a callback function, which will be called for each notification - * received - */ -nl_socket_modify_cb(sk, NL_CB_VALID, NL_CB_CUSTOM, my_func, NULL); - -/* Connect to routing netlink protocol */ -nl_connect(sk, NETLINK_ROUTE); - -/* Subscribe to link notifications group */ -nl_socket_add_memberships(sk, RTNLGRP_LINK); - -/* - * Start receiving messages. The function nl_recvmsgs_default() will block - * until one or more netlink messages (notification) are received which - * will be passed on to my_func(). - */ -while (1) - nl_recvmsgs_default(sock); -- cgit v1.2.1