Hi folks,
how to copy the linux routing table(FIB) to the user space. Also, i need to get notified whenever routing table gets updated. How can we do that ?
Thanks,
Sreekanth.
Using system utilities and shell stuff or something more
sophisticated?
You could run a shell script that reports changes in
the kernel routing table by wrapping it in a while
loop, and having the output be evaluated by an awk
function inside the loop, the function itself looping and saving the previous runs data. You could also inject new
routing info as you wanted using the route command.
man route
OR:
You could parse the data from /proc/net/route with your
own interpreter.
OR:
Or you could run routed -t which prints the route daemon
(a RIP 1 clone) output to your tty.
You are not very specific about what you need.
Oh..sorry !!
To be more specific, what i need is to have a module(language is c) which triggers an event whenever routing table gets updated. Also, my module should get the updated routing table entry. I know something like this can be done using netlink sockets, but not sure how to do !!
The first step of this module is to copy entire routing table to user space and thereafter get the updates.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.