From: Richard Whitehouse Date: Sun, 20 Feb 2011 04:21:36 +0000 (+0000) Subject: Remove debugging statements and correct routes to use a multimap and insert the corre... X-Git-Url: https://git.richardwhiuk.com/?a=commitdiff_plain;h=41b7f3bde16b7e793569016410d7ccc1393ddfcc;p=ns-moose.git Remove debugging statements and correct routes to use a multimap and insert the correct prefix --- diff --git a/code/src/helper/moose-helper.cc b/code/src/helper/moose-helper.cc index c894686..00158d8 100644 --- a/code/src/helper/moose-helper.cc +++ b/code/src/helper/moose-helper.cc @@ -158,17 +158,14 @@ void MooseHelper::Create(MooseHelper::Network& n){ vertex_descriptor s = boost::vertex(root,g); boost::dijkstra_shortest_paths(g, s, boost::predecessor_map(&p[0])); - std::cout << "parents from " << root << ":" << std::endl; boost::graph_traits::vertex_iterator vi, vend; - std::map, MoosePrefixAddress> routes; + std::multimap, MoosePrefixAddress> routes; for (boost::tie(vi, vend) = vertices(g); vi != vend; ++vi) { - std::cout << root << "->" << *vi << " "; if(*vi == s){ // Don't inject into routing table. - std::cout << "At destination" << std::endl; } else { vertex_descriptor current = *vi; while(p[current] != p[p[current]]){ @@ -178,19 +175,13 @@ void MooseHelper::Create(MooseHelper::Network& n){ if(p[current] == s){ // Inject routing decision - std::cout << current << std::endl; - - routes[portMap[root][current]] = MoosePrefixAddress(root); + routes.insert(std::make_pair(portMap[root][current],MoosePrefixAddress(*vi))); } else { - // Don't inject - - std::cout << "unreachable" << std::endl; } } } - std::cout << std::endl; // Create the switch