#include "gnunet-service-testbed.h"
#include "gnunet-service-testbed_connectionpool.h"
#include "testbed_api_operations.h"
+#include "gnunet_transport_core_service.h"
/**
* Redefine LOG with a changed log component string
/**
* The transport handle to the peer corresponding to this entry; can be NULL
*/
- struct GNUNET_TRANSPORT_Handle *handle_transport;
+ struct GNUNET_TRANSPORT_CoreHandle *handle_transport;
/**
* The core handle to the peer corresponding to this entry; can be NULL
*
* @param cls the #PooledConnection object
* @param peer the peer that connected
+ * @param mq queue for sending data to @a peer
+ * @return NULL
*/
-static void
+static void *
transport_peer_connect_notify_cb (void *cls,
- const struct GNUNET_PeerIdentity *peer)
+ const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_MQ_Handle *mq)
{
struct PooledConnection *entry = cls;
peer_connect_notify_cb (entry,
peer,
GST_CONNECTIONPOOL_SERVICE_TRANSPORT);
+ return NULL;
}
LOG_DEBUG ("Opening a transport connection to peer %u\n",
entry->index);
entry->handle_transport =
- GNUNET_TRANSPORT_connect (entry->cfg,
- NULL,
- entry,
- NULL,
- &transport_peer_connect_notify_cb,
- NULL);
+ GNUNET_TRANSPORT_core_connect (entry->cfg,
+ NULL,
+ NULL,
+ entry,
+ &transport_peer_connect_notify_cb,
+ NULL,
+ NULL);
if (NULL == entry->handle_transport)
{
GNUNET_break (0);
if (NULL == entry->handle_transport)
return;
- GNUNET_TRANSPORT_disconnect (entry->handle_transport);
+ GNUNET_TRANSPORT_core_disconnect (entry->handle_transport);
entry->handle_transport = NULL;
}
* @param peer peer identity this notification is about
*/
static void
-core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer)
+core_peer_connect_cb (void *cls,
+ const struct GNUNET_PeerIdentity *peer)
{
struct PooledConnection *entry = cls;
}
GNUNET_assert (NULL == entry->peer_identity);
entry->peer_identity = GNUNET_new (struct GNUNET_PeerIdentity);
- GNUNET_memcpy (entry->peer_identity,
- my_identity,
- sizeof (struct GNUNET_PeerIdentity));
+ *entry->peer_identity = *my_identity;
if (0 == entry->demand)
return;
if (NULL != entry->notify_task)
/**
* The transport handle obtained from cache. Do NOT close/disconnect.
*/
- struct GNUNET_TRANSPORT_Handle *th_;
+ struct GNUNET_TRANSPORT_CoreHandle *th_;
/**
* Configuration of the peer from cache. Do not free!
* Transport handle of the first peer obtained from cache to get its HELLO. Do
* NOT close/disconnect.
*/
- struct GNUNET_TRANSPORT_Handle *p1th_;
+ struct GNUNET_TRANSPORT_CoreHandle *p1th_;
/**
* The #GST_ConnectionPool_GetHandle for the peer1's transport handle
static void
occ_cache_get_handle_ats_occ_cb (void *cls,
struct GNUNET_CORE_Handle *ch,
- struct GNUNET_TRANSPORT_Handle *th,
+ struct GNUNET_TRANSPORT_CoreHandle *th,
struct GNUNET_ATS_ConnectivityHandle *ac,
const struct GNUNET_PeerIdentity *my_identity,
const struct GNUNET_CONFIGURATION_Handle *cfg)
static void
occ_cache_get_handle_ats_rocc_cb (void *cls,
struct GNUNET_CORE_Handle *ch,
- struct GNUNET_TRANSPORT_Handle *th,
+ struct GNUNET_TRANSPORT_CoreHandle *th,
struct GNUNET_ATS_ConnectivityHandle *ac,
const struct GNUNET_PeerIdentity *my_identity,
const struct GNUNET_CONFIGURATION_Handle *cfg)
static void
p2_transport_connect_cache_callback (void *cls,
struct GNUNET_CORE_Handle *ch,
- struct GNUNET_TRANSPORT_Handle *th,
+ struct GNUNET_TRANSPORT_CoreHandle *th,
struct GNUNET_ATS_ConnectivityHandle *ac,
const struct GNUNET_PeerIdentity *ignore_,
const struct GNUNET_CONFIGURATION_Handle *cfg)
static void
p1_transport_connect_cache_callback (void *cls,
struct GNUNET_CORE_Handle *ch,
- struct GNUNET_TRANSPORT_Handle *th,
+ struct GNUNET_TRANSPORT_CoreHandle *th,
struct GNUNET_ATS_ConnectivityHandle *ac,
const struct GNUNET_PeerIdentity *ignore_,
const struct GNUNET_CONFIGURATION_Handle *cfg)
static void
occ_cache_get_handle_core_cb (void *cls,
struct GNUNET_CORE_Handle *ch,
- struct GNUNET_TRANSPORT_Handle *th,
+ struct GNUNET_TRANSPORT_CoreHandle *th,
struct GNUNET_ATS_ConnectivityHandle *ac,
const struct GNUNET_PeerIdentity *my_identity,
const struct GNUNET_CONFIGURATION_Handle *cfg)
static void
rocc_cache_get_handle_transport_cb (void *cls,
struct GNUNET_CORE_Handle *ch,
- struct GNUNET_TRANSPORT_Handle *th,
+ struct GNUNET_TRANSPORT_CoreHandle *th,
struct GNUNET_ATS_ConnectivityHandle *ac,
const struct GNUNET_PeerIdentity *ignore_,
const struct GNUNET_CONFIGURATION_Handle *cfg)
}
rocc->tcc.th_ = th;
rocc->tcc.cfg = cfg;
- if (GNUNET_YES ==
- GNUNET_TRANSPORT_check_peer_connected (rocc->tcc.th_,
- &rocc->a_id))
+ if (NULL !=
+ GNUNET_TRANSPORT_core_get_mq (rocc->tcc.th_,
+ &rocc->a_id))
{
LOG_DEBUG ("0x%llx: Target peer %s already connected to local peer: %u\n",
rocc->op_id,