Hello,
If I write a program to use "netlink" sockets to receive route updates
and then add a static route, should i get that route update???
To be more precise,I have something like this
I open socket using
socket (AF_NETLINK, SOCK_RAW, NETLINK_ROUTE) call, and
then I use the "groups" as
groups = RTMGRP_LINK|RTMGRP_IPV4_ROUTE|RTMGRP_IPV4_IFADDR;
I do a sendto (netlink_sock_fd) with these
flags |= NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST
and then the receive function
while (1)
{
FD_SET(netlink_sock_fd, &rd);
status = select (2, &rd, NULL, NULL, NULL);
if (status < 0)
{
perror ("select()");
exit (1);
}
if (FD_ISSET (netlink_sock_fd, &rd))
{
status = recvmsg (netlink_sock_fd, &msg, 0);
// further processing from here.....
}
So, first time I get an entire routing table, which I print. But if I
add a static route while the program is running nothing happens!!
I expect the new "modified" routing table to get printed.
Any help in this would be really appreciated.
thanks,
deepak.
|