/**
* Public key of the sender.
*/
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key;
+ struct GNUNET_CRYPTO_EccPublicKey public_key;
/**
* Signature of the peer that sends us the disconnect. Only
disconnect_msg.reserved = htonl (0);
disconnect_msg.purpose.size =
htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
- sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) +
+ sizeof (struct GNUNET_CRYPTO_EccPublicKey) +
sizeof (struct GNUNET_TIME_AbsoluteNBO));
disconnect_msg.purpose.purpose =
htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT);
else
latency = n->latency.rel_value;
ats.value = htonl (latency);
- GST_update_ats_metrics (&n->id,
+ GST_ats_update_metrics (&n->id,
n->primary_address.address,
n->primary_address.session,
&ats, 1);
struct NeighbourMapEntry *n;
if (NULL == neighbours)
- return; /* during shutdown, do nothing */
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Asked to connect to peer `%s' during shutdown\n",
+ GNUNET_i2s (target));
+ return; /* during shutdown, do nothing */
+ }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asked to connect to peer `%s'\n",
GNUNET_i2s (target));
- if (0 ==
- memcmp (target, &GST_my_identity, sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == memcmp (target, &GST_my_identity, sizeof (struct GNUNET_PeerIdentity)))
{
/* refuse to connect to myself */
/* FIXME: can this happen? Is this not an API violation? */
break;
case S_CONNECT_RECV_BLACKLIST_INBOUND:
if (GNUNET_OK == result)
- {
- /* valid new address, let ATS know! */
- GNUNET_ATS_address_add (GST_ats,
- bcc->na.address,
- bcc->na.session,
- NULL, 0);
- }
+ GST_ats_add_address (bcc->na.address, bcc->na.session);
+
n->state = S_CONNECT_RECV_ATS;
n->timeout = GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT);
GNUNET_ATS_reset_backoff (GST_ats, peer);
* @param address address of the other peer, NULL if other peer
* connected to us
* @param session session to use (or NULL)
- * @param ats performance data
- * @param ats_count number of entries in ats (excluding 0-termination)
*/
static void
check_blacklist (const struct GNUNET_PeerIdentity *peer,
* @param address address of the other peer, NULL if other peer
* connected to us
* @param session session to use (or NULL)
- * @param ats performance data
- * @param ats_count number of entries in ats (excluding 0-termination)
*/
void
GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
* @param address address of the other peer, NULL if other peer
* connected to us
* @param session session to use (or NULL)
- * @param ats performance data
- * @param ats_count number of entries in ats
*/
void
GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
n->primary_address.bandwidth_in,
n->primary_address.bandwidth_out);
/* Tell ATS that the outbound session we created to send CONNECT was successfull */
- GNUNET_ATS_address_add (GST_ats,
- n->primary_address.address,
- n->primary_address.session,
- NULL, 0);
+ GST_ats_add_address (n->primary_address.address, n->primary_address.session);
set_address (&n->primary_address,
n->primary_address.address,
n->primary_address.session,
n->state = S_CONNECTED;
n->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
GNUNET_break (GNUNET_NO == n->alternative_address.ats_active);
- GNUNET_ATS_address_add(GST_ats,
- n->alternative_address.address,
- n->alternative_address.session,
- NULL, 0);
+
+ GST_ats_add_address (n->alternative_address.address, n->alternative_address.session);
set_address (&n->primary_address,
n->alternative_address.address,
n->alternative_address.session,
connect_notify_cb (callback_cls, &n->id,
n->primary_address.bandwidth_in,
n->primary_address.bandwidth_out);
- GNUNET_ATS_address_add(GST_ats,
- n->primary_address.address,
- n->primary_address.session,
- NULL, 0);
+
+ GST_ats_add_address (n->primary_address.address, n->primary_address.session);
set_address (&n->primary_address,
n->primary_address.address,
n->primary_address.session,
return;
}
GNUNET_CRYPTO_hash (&sdm->public_key,
- sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
+ sizeof (struct GNUNET_CRYPTO_EccPublicKey),
&hc);
if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity)))
{
}
if (ntohl (sdm->purpose.size) !=
sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
- sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) +
+ sizeof (struct GNUNET_CRYPTO_EccPublicKey) +
sizeof (struct GNUNET_TIME_AbsoluteNBO))
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "%s message from peer `%s' has invalid size \n",
+ "DISCONNECT",
+ GNUNET_i2s (peer));
GNUNET_break_op (0);
return;
}
(GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT, &sdm->purpose,
&sdm->signature, &sdm->public_key))
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "%s message from peer `%s' cannot be verified \n",
+ "DISCONNECT",
+ GNUNET_i2s (peer));
GNUNET_break_op (0);
return;
}