Unix Programming - require kernel module that will read routing table

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2005 > require kernel module that will read routing table





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author require kernel module that will read routing table
kernel.lover

2005-03-19, 5:49 pm

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.
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 ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com