[parisc-linux] Accessing the FIB tables

Mahesh Pujara Mahesh.Pujara@lntinfotech.com
Sat, 15 Mar 2003 17:22:26 +0530


HI,
      I have Linux machine acting as a router and Zebra Daemon  is running
on that. Currently
RIP is configured which is  receiving routes from another gateway. The
routes are updated in FIB
tables.
      I want to read This FIB table , which is declared  as a
struct fib_table *main_table .
I am able to access  and read this table.  i want  to read certain
information from this FIB table and want
to build my own forwarding  table. from this table i am reading NetID,
Netmask, and IP address of  Next Hop gateway.

IP address of  Next Hope gateway is available in fib_nh->nh_gw.  Apart from
this i also want the Mac  address of  Next Hope gateway.   so how  can i
get the MAC address for  Next Hop gateway ??

I  am able to get the pointer to Next hop device that is ,
 #define fib_dev        fib_nh[0].nh_dev

in net_device structure definition ,

#ifdef CONFIG_NET_FASTROUTE
#define NETDEV_FASTROUTE_HMASK 0xF
      /* Semi-private data. Keep it at the end of device struct. */
      rwlock_t          fastpath_lock;
      struct dst_entry  *fastpath[NETDEV_FASTROUTE_HMASK+1];
#endif

 There is a dst_entry in which the hh_cache * is stored .
But the  struct dst_entry     *fastpath[NETDEV_FASTROUTE_HMASK+1];  is null
.
even  CONFIG_NET_FASTROUTE is configured.

So what could be the reason for that??


or  is there any other way to get the MAC address for  Next Hop gateway ??
I know one way is to Do
ARP. But doing ARP would slow down the process.

Any help or link on this is Appreciated.







Cheers,
Mahesh Pujara