+ void **array;
+ int i = 0;
+ xbt_lib_cursor_t cursor;
+ char *key;
+ void **data;
+
+ if (host_lib->count == 0)
+ return NULL;
+ else
+ array = xbt_new0(void *, host_lib->count);
+
+ xbt_lib_foreach(host_lib, cursor, key, data) {
+ if(get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST)
+ array[i++] = data[MSG_HOST_LEVEL];
+ }
+
+ return (m_host_t *)array;