/**
* 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
}
-/**
- * Notify ATS about the new address including the network this address is
- * located in.
- *
- * @param address the address
- * @param session the session*
- */
-static void
-add_address (struct GNUNET_HELLO_Address *address,
- void *session)
-{
- struct GNUNET_TRANSPORT_PluginFunctions *papi;
- struct GNUNET_ATS_Information ats;
- uint32_t net;
-
- /* valid new address, let ATS know! */
- if (NULL == address->transport_name)
- {
- GNUNET_break (0);
- return;
- }
- if (NULL == (papi = GST_plugins_find (address->transport_name)))
- {
- /* we don't have the plugin for this address */
- GNUNET_break (0);
- return;
- }
-
- net = papi->get_network (NULL, session);
- ats.type = htonl (GNUNET_ATS_NETWORK_TYPE);
- ats.value = htonl(net);
-// GNUNET_break (0);
-// fprintf (stderr, "NET: %u\n", ntohl(net));
- GNUNET_ATS_address_add (GST_ats,
- address, session, &ats, 1);
-}
-
-
/**
* Initialize the 'struct NeighbourAddress'.
*
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);
break;
case S_CONNECT_RECV_BLACKLIST_INBOUND:
if (GNUNET_OK == result)
- add_address (bcc->na.address, bcc->na.session);
+ 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);
n->primary_address.bandwidth_in,
n->primary_address.bandwidth_out);
/* Tell ATS that the outbound session we created to send CONNECT was successfull */
- add_address (n->primary_address.address, n->primary_address.session);
+ 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->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
GNUNET_break (GNUNET_NO == n->alternative_address.ats_active);
- add_address (n->alternative_address.address, n->alternative_address.session);
+ 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,
n->primary_address.bandwidth_in,
n->primary_address.bandwidth_out);
- add_address (n->primary_address.address, n->primary_address.session);
+ 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;
}