+/**
+ * Function called when a peer reconfigure operation is ready
+ *
+ * @param cls the closure from GNUNET_TESTBED_operation_create_()
+ */
+static void
+opstart_peer_reconfigure (void *cls)
+{
+ struct OperationContext *opc = cls;
+ struct PeerReconfigureData *data = opc->data;
+ struct GNUNET_MQ_Envelope *env;
+ struct GNUNET_TESTBED_PeerReconfigureMessage *msg;
+ char *xconfig;
+ size_t xc_size;
+
+ opc->state = OPC_STATE_STARTED;
+ GNUNET_assert (NULL != data);
+ xc_size = GNUNET_TESTBED_compress_config_ (data->config,
+ data->cfg_size,
+ &xconfig);
+ GNUNET_free (data->config);
+ data->config = NULL;
+ GNUNET_assert (xc_size < UINT16_MAX - sizeof(*msg));
+ env = GNUNET_MQ_msg_extra (msg,
+ xc_size,
+ GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER);
+ msg->peer_id = htonl (data->peer->unique_id);
+ msg->operation_id = GNUNET_htonll (opc->id);
+ msg->config_size = htons (data->cfg_size);
+ GNUNET_memcpy (&msg[1],
+ xconfig,
+ xc_size);
+ GNUNET_free (xconfig);
+ GNUNET_free (data);
+ opc->data = NULL;
+ GNUNET_TESTBED_insert_opc_ (opc->c, opc);
+ GNUNET_MQ_send (opc->c->mq,
+ env);
+}
+
+
+/**
+ * Callback which will be called when a peer reconfigure operation is released
+ *
+ * @param cls the closure from GNUNET_TESTBED_operation_create_()
+ */
+static void
+oprelease_peer_reconfigure (void *cls)
+{
+ struct OperationContext *opc = cls;
+ struct PeerReconfigureData *data = opc->data;
+
+ switch (opc->state)
+ {
+ case OPC_STATE_INIT:
+ GNUNET_free (data->config);
+ GNUNET_free (data);
+ break;
+
+ case OPC_STATE_STARTED:
+ GNUNET_TESTBED_remove_opc_ (opc->c, opc);
+ break;
+
+ case OPC_STATE_FINISHED:
+ break;
+ }
+ GNUNET_free (opc);
+}
+
+