X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aa3595ed3c903167f52eeeab8e636bec96b258dd..a9786d0c1612118b9fc2304ea7aa36b67b232267:/src/s4u/s4u_engine.cpp diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index 682932fa0b..6e37df00eb 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -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,19 @@ 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(xbt_dict_get_or_null(netcards_dict, name)); +} +void Engine::netcardList(std::vector* list) +{ + xbt_lib_cursor_t cursor = nullptr; + char* key; + void* data; + xbt_dict_foreach (netcards_dict, cursor, key, data) { + list->push_back(static_cast(data)); + } +} } }