| Barry Margolin 2005-03-19, 5:49 pm |
| In article <1d55641b.0503191040.16906fc4@posting.google.com>,
cranium.2003@gmail.com (kernel.lover) wrote:
> Hello all,
> I require a kernel module that will print gateway IP addresses in
> routing table as well as it should not print Gateways that appear to
> be the same interface ip addresses of that linux machine.
> e.g. If my eth1 is 172.16.x.x and if same appear in routing
> table for any entry having 172.16.x.x as Gateway then it should not
> appear in output.
kernel modules don't usually produce output, that's normally done by
user-mode programs that make system calls and then format the output.
So write a program that reads the routing table (look up "routing
sockets" in Unix Network Programming, Vol.1) and the interface table,
and then compares the gateways address of each route with the interfaces
before printing it.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|