XBT_PUBLIC(int) simcall_file_stat(smx_file_t fd, s_file_stat_t *buf);
XBT_PUBLIC(int) simcall_file_unlink(smx_file_t fd);
+/************************** AS router **********************************/
+XBT_PUBLIC(xbt_dict_t) SIMIX_asr_get_properties(const char *name);
+/************************** AS router simcalls ***************************/
+XBT_PUBLIC(xbt_dict_t) simcall_asr_get_properties(const char *name);
+
SG_END_DECL()
#endif /* _SIMIX_SIMIX_H */
*/
xbt_dict_t MSG_as_router_get_properties(const char* asr)
{
- // FIXME do this function with a simcall
- return xbt_lib_get_or_null(as_router_lib, asr, ROUTING_PROP_ASR_LEVEL);
+ return (simcall_asr_get_properties(asr));
}
/**
memset(action, 0, sizeof(s_smx_action_t));
((smx_action_t) action)->simcalls = fifo;
}
+
+xbt_dict_t SIMIX_asr_get_properties(const char *name)
+{
+ return xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL);
+}
+
SIMIX_pre_file_unlink(simcall);
break;
+ case SIMCALL_ASR_GET_PROPERTIES:
+ simcall->asr_get_properties.result =
+ SIMIX_asr_get_properties(simcall->asr_get_properties.name);
+ SIMIX_simcall_answer(simcall);
+ break;
+
case SIMCALL_NONE:
THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
SIMIX_process_get_name(simcall->issuer),
SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_OPEN),\
SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_CLOSE),\
SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_STAT), \
-SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_UNLINK)
+SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_UNLINK),\
+SIMCALL_ENUM_ELEMENT(SIMCALL_ASR_GET_PROPERTIES)
/* SIMCALL_COMM_IS_LATENCY_BOUNDED and SIMCALL_SET_CATEGORY make things complicated
int result;
} file_unlink;
+ struct {
+ const char* name;
+ xbt_dict_t result;
+ } asr_get_properties;
+
};
} s_smx_simcall_t, *smx_simcall_t;
return simcall->host_get_properties.result;
}
+/**
+ * \ingroup simix_host_management
+ * \brief Returns a dict of the properties assigned to a router or AS.
+ *
+ * \param asr name of the router or AS
+ * \return The properties
+ */
+xbt_dict_t simcall_asr_get_properties(const char *name)
+{
+ smx_simcall_t simcall = SIMIX_simcall_mine();
+
+ simcall->call = SIMCALL_ASR_GET_PROPERTIES;
+ simcall->asr_get_properties.name = name;
+ if(MC_IS_ENABLED) /* Initialize result to NULL for snapshot comparison done during simcall */
+ simcall->asr_get_properties.result = NULL;
+ SIMIX_simcall_push(simcall->issuer);
+ return simcall->asr_get_properties.result;
+}
+
+
/**
* \ingroup simix_host_management
* \brief Returns the speed of the processor.