Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

routing table

Status
Not open for further replies.

panthangi

Programmer
Jan 17, 2001
2
US
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.

hope this clarifies...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top