Look at the code starting at line 175:
// remove all routes of the previous round
routes.clear();
// look for routes to this node
for (std::list<StaticRoute*>::const_iterator iter = _routes.begin();
iter != _routes.end(); ++iter)
{
const StaticRoute *route = (*iter);
if (route->getDestination() == task.eid)
{
// add to the valid routes
routes.push_back(route);
}
}
In this part the router selects the valid routes for a neighbor. The best way would be to limit routes here, so that only the routes are selected where no other path exists. "dtn::core::BundleCore::getInstance().getConnectionManager().getNeighbors()" gives you a list of current neighbors.
The reason way you can not simply abort a loop here is that bundle routing is much different to usual network routing. Here, the extensions are select the bundles to forward in rounds and in each round only one neighbor is considered. So you can not know, if another round has already forwarded the bundle to another neighbor.
Kind regards,
Johannes Morgenroth
Am 21.08.2013 14:49, schrieb ssireskin@gmail.com:
Johannes,
I know that there is no such an option, I was asking about the possibility of adding such an option.
I tried to add
iter = _routes.end();
after
transferTo(route.getDestination(), task.bundle);
in StaticRoutingExtension.cpp, but it didn't help.
Could you please advise, which part of StaticRoutingExtension I should look at?
Best regards,
Sergey Sireskin