[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: metric? procedure



> Hello,
> 
> I have one question regarding  unicast routing in NS. 
> 
> In the case when dynamic routing is used there exists an instance procedure of 
> the class rtObject called "metric?" that returns the metric of the route to 
> the specified destination.
> 
> Is such a procedure that returns the metric of the route between two nodes is 
> available for static route strategy?

No.

However, ...

> Can anybody help me?

The routine that compute the static routes uses an array hopcnt_
internally that it destroys after the route computation is done.
You could change that to be a statically allocated array, and fix
RouteLogic::compute_routes() in route.cc.  Then, you need to add
to the RouteLogic::command() routine to read a src/dst, and return
the hopcnt_ value.

An added nice thing to have would be a RouteLogic::metric? instance
procedure that, if the rtObject at a node exists, would invoke 
rtObject::metric?, else it would get the values from the hopcnt_ array.
This would be similar to how RouteLogic::lookup{} works.


Kannan