Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce the public exposure of netcards_dict
[simgrid.git] / src / s4u / s4u_engine.cpp
index 682932f..71bf838 100644 (file)
@@ -17,7 +17,6 @@
 #include "src/kernel/routing/NetZoneImpl.hpp"
 
 #include "src/surf/network_interface.hpp"
-#include "src/surf/surf_routing.hpp" // routing_platf. FIXME:KILLME. SOON
 #include "surf/surf.h"               // routing_platf. FIXME:KILLME. SOON
 
 XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
@@ -112,5 +111,10 @@ NetZone* Engine::netzoneByNameOrNull(const char* name)
   return netzoneByNameRecursive(netRoot(), name);
 }
 
+/** @brief Retrieve the netcard of the given name (or nullptr if not found) */
+simgrid::kernel::routing::NetCard* Engine::netcardByNameOrNull(const char* name)
+{
+  return static_cast<simgrid::kernel::routing::NetCard*>(xbt_dict_get_or_null(netcards_dict, name));
+}
 }
 }