* @param target a connected neighbour
* @param ats performance information (unused)
* @param ats_count number of records in ats (unused)
+ * @param transport plugin
+ * @param addr address
+ * @param addrlen address length
*/
static void
transmit_our_hello (void *cls, const struct GNUNET_PeerIdentity *target,
const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count)
+ uint32_t ats_count,
+ const char * transport,
+ const void * addr,
+ size_t addrlen)
{
const struct GNUNET_MessageHeader *hello = cls;
* @param neighbour neighbour's identity
* @param ats performance data
* @param ats_count number of entries in ats (excluding 0-termination)
+ * @param transport plugin
+ * @param addr address
+ * @param addrlen address length
*/
static void
test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour,
const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count)
+ uint32_t ats_count,
+ const char * transport,
+ const void * addr,
+ size_t addrlen)
{
struct TestConnectionContext *tcc = cls;
struct GST_BlacklistCheck *bc;
* @param peer identity of the neighbour
* @param ats performance data
* @param ats_count number of entries in ats (excluding 0-termination)
+ * @param transport plugin
+ * @param addr address
+ * @param addrlen address length
*/
static void
notify_client_about_neighbour (void *cls,
const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_TRANSPORT_ATS_Information
- *ats, uint32_t ats_count)
+ *ats, uint32_t ats_count,
+ const char * transport,
+ const void * addr,
+ size_t addrlen)
{
struct TransportClient *tc = cls;
struct ConnectInfoMessage *cim;
* @param neighbour identity of the neighbour
* @param ats performance data
* @param ats_count number of entries in ats (excluding 0-termination)
+ * @param transport plugin
+ * @param addr address
+ * @param addrlen address length
*/
static void
output_addresses (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count)
+ uint32_t ats_count,
+ const char * transport,
+ const void * addr,
+ size_t addrlen)
{
struct GNUNET_SERVER_TransmitContext *tc = cls;
- struct AddressIterateResponseMessage msg;
+ struct AddressIterateResponseMessage * msg;
size_t size;
size =
- sizeof (struct AddressIterateResponseMessage) -
- sizeof (struct GNUNET_MessageHeader);
- memcpy (&msg.peer, peer, sizeof (struct GNUNET_PeerIdentity));
- msg.addrlen = ntohs (0);
- msg.pluginlen = ntohs (0);
-
- transmit_binary_to_client (tc, &msg, size);
+ (sizeof (struct AddressIterateResponseMessage) + strlen(transport) + 1);
+ msg = GNUNET_malloc (size);
+ memcpy (&msg->peer, peer, sizeof (struct GNUNET_PeerIdentity));
+ memcpy (&msg[0], transport, strlen(transport)+1);
+ msg->addrlen = ntohs (addrlen);
+ msg->pluginlen = ntohs (strlen(transport)+1);
+
+ transmit_binary_to_client (tc, msg, size);
+ GNUNET_free(msg);
}
return GNUNET_OK;
GNUNET_assert (n->ats_count > 0);
- ic->cb (ic->cb_cls, &n->id, n->ats, n->ats_count);
+ ic->cb (ic->cb_cls, &n->id, n->ats, n->ats_count, n->plugin_name, n->addr, n->addrlen);
return GNUNET_OK;
}
* @param neighbour identity of the neighbour
* @param ats performance data
* @param ats_count number of entries in ats (including 0-termination)
+ * @param transport plugin
+ * @param addr address
+ * @param addrlen address length
*/
typedef void (*GST_NeighbourIterator) (void *cls,
const struct GNUNET_PeerIdentity *
neighbour,
const struct
GNUNET_TRANSPORT_ATS_Information * ats,
- uint32_t ats_count);
+ uint32_t ats_count,
+ const char * transport,
+ const void * addr,
+ size_t addrlen);
/**
struct AddressLookupCtx *alucb = cls;
struct AddressIterateResponseMessage *address;
uint16_t size;
-
+ char * transport;
+ size_t transport_len;
+ //void * addr;
+ size_t addrlen;
if (msg == NULL)
{
GNUNET_free (alucb);
return;
}
- if (size != sizeof (struct AddressIterateResponseMessage))
+ if (size < sizeof (struct AddressIterateResponseMessage))
{
/* invalid reply */
GNUNET_break (0);
return;
}
- address = (struct AddressIterateResponseMessage *) msg;
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PEER: %s\n",
- GNUNET_i2s (&address->peer));
+ address = (struct AddressIterateResponseMessage *) &msg[1];
+ transport = (char *) &address[0];
+ transport_len = ntohs(address->pluginlen);
+ addrlen = ntohs(address->addrlen);
/* expect more replies */
GNUNET_CLIENT_receive (alucb->client, &peer_address_response_processor, alucb,
GNUNET_TIME_absolute_get_remaining (alucb->timeout));
- alucb->cb (alucb->cb_cls, &address->peer, NULL, NULL, 0);
+ alucb->cb (alucb->cb_cls, &address->peer, transport, NULL, addrlen);
}