Remove debugging statements and correct routes to use a multimap and insert the corre...
authorRichard Whitehouse <github@richardwhiuk.com>
Sun, 20 Feb 2011 04:21:36 +0000 (04:21 +0000)
committerRichard Whitehouse <github@richardwhiuk.com>
Sun, 20 Feb 2011 04:21:36 +0000 (04:21 +0000)
code/src/helper/moose-helper.cc

index c894686d1bf5f9ba38308c72c044f4ca85fb1bf9..00158d8bde8b4deb0743449509ff2bab43e17845 100644 (file)
@@ -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<graph_t>::vertex_iterator vi, vend;
 
-                               std::map<Ptr<NetDevice>, MoosePrefixAddress> routes;
+                               std::multimap<Ptr<NetDevice>, 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