-int gtnets_run_until_next_flow_completion(void ***metadata, int *number_of_flows){
- return gtnets_sim->run_until_next_flow_completion(metadata, number_of_flows);
+double gtnets_run_until_next_flow_completion(void ***metadata, int *number_of_flows){
+ ofstream file;
+ streambuf* sbuf;
+ double value;
+
+ if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
+ file.open ("/dev/null");
+ sbuf = cout.rdbuf();
+ cout.rdbuf(file.rdbuf());
+ XBT_DEBUG("Enable GTNetS library quite mode");
+ }else {
+ XBT_DEBUG("Disable GTNetS library quite mode");
+ }
+
+ value = gtnets_sim->run_until_next_flow_completion(metadata, number_of_flows);
+
+ if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
+ cout.rdbuf(sbuf);
+ file.close();
+ }
+ return (double) value;
+}
+
+// get the total received in bytes using the TCPServer object totRx field
+double gtnets_get_flow_rx(void *metadata){
+ return gtnets_sim->gtnets_get_flow_rx(metadata);