+ host->extension_set(SIMIX_HOST_LEVEL, nullptr);
+}
+
+// =========== user-level functions ===============
+// ================================================
+
+double sg_host_get_available_speed(sg_host_t host){
+ return surf_host_get_available_speed(host);
+}
+/** @brief Returns the state of a host.
+ * @return 1 if the host is active or 0 if it has crashed.
+ */
+int sg_host_is_on(sg_host_t host) {
+ return host->p_cpu->isOn();
+}
+
+/** @brief Returns the total energy consumed by the host (in Joules).
+ *
+ * See also @ref SURF_plugin_energy.
+ */
+double sg_host_get_consumed_energy(sg_host_t host) {
+ return surf_host_get_consumed_energy(host);
+}
+
+/** @brief Returns the number of power states for a host.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
+int sg_host_get_nb_pstates(sg_host_t host) {
+ return host->p_cpu->getNbPStates();
+}
+
+/** @brief Gets the pstate at which that host currently runs.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
+int sg_host_get_pstate(sg_host_t host) {
+ return host->getPState();
+}
+/** @brief Sets the pstate at which that host should run.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
+void sg_host_set_pstate(sg_host_t host,int pstate) {
+ host->setPState(pstate);
+}
+
+namespace simgrid {
+
+Host::Host(std::string const& id)
+ : name_(id)
+{
+}
+
+Host::~Host()
+{
+}
+
+/** Start the host if it is off */
+void Host::turnOn()
+{
+ simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
+}
+
+/** Stop the host if it is on */
+void Host::turnOff()
+{
+ /* Go to that function to follow the code flow through the simcall barrier */
+ if (0) simcall_HANDLER_host_off(&SIMIX_process_self()->simcall, this);
+ simgrid::simix::simcall<void>(SIMCALL_HOST_OFF, this);
+}
+
+bool Host::isOn() {
+ return p_cpu->isOn();
+}
+bool Host::isOff() {
+ return ! p_cpu->isOn();
+}
+
+
+/** Get the properties assigned to a host */
+xbt_dict_t Host::getProperties()
+{
+ return simgrid::simix::kernel(std::bind(SIMIX_host_get_properties, this));
+}
+
+/** Get the processes attached to the host */
+xbt_swag_t Host::getProcessList()
+{
+ return simgrid::simix::kernel(std::bind(SIMIX_host_get_process_list, this));