/**
 * Function called when a peer get information operation is ready
 *
 * @param cls the closure from GNUNET_TESTBED_operation_create_()
 */
static void
opstart_peer_getinfo (void *cls)
{
  struct OperationContext *opc = cls;
  struct PeerInfoData *data;
  struct GNUNET_TESTBED_PeerGetConfigurationMessage *msg;

  data = opc->data;
  GNUNET_assert (NULL != data);
  opc->state = OPC_STATE_STARTED;
  msg =
      GNUNET_TESTBED_generate_peergetconfig_msg_ (data->peer->unique_id,
                                                  opc->id);
  GNUNET_CONTAINER_DLL_insert_tail (opc->c->ocq_head, opc->c->ocq_tail, opc);
  GNUNET_TESTBED_queue_message_ (opc->c, &msg->header);
}
示例#2
0
/**
 * Function called when a service connect operation is ready
 *
 * @param cls the closure from GNUNET_TESTBED_operation_create_()
 */
static void
opstart_service_connect (void *cls)
{
  struct ServiceConnectData *data = cls;
  struct GNUNET_TESTBED_PeerGetConfigurationMessage *msg;
  struct GNUNET_TESTBED_Controller *c;
  uint64_t op_id;

  GNUNET_assert (NULL != data);
  GNUNET_assert (NULL != data->peer);
  c = data->peer->controller;
  op_id = GNUNET_TESTBED_get_next_op_id (c);
  msg =
      GNUNET_TESTBED_generate_peergetconfig_msg_ (data->peer->unique_id, op_id);
  data->opc =
      GNUNET_TESTBED_forward_operation_msg_ (c, op_id, &msg->header,
                                             &configuration_receiver, data);
  GNUNET_free (msg);
  data->state = CFG_REQUEST_QUEUED;
}