- /* Call to manipulation to manipulate ATS information */
- GNUNET_assert (NULL != GST_ats);
- if ((NULL == ats) || (0 == ats_count))
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Updated latency for peer `%s' to %s\n",
+ GNUNET_i2s (&address->peer),
+ GNUNET_STRINGS_relative_time_to_string (delay,
+ GNUNET_YES));
+ ai->properties.delay = delay;
+ /* Give manipulation its chance to change metrics */
+ GST_manipulation_manipulate_metrics (address,
+ ai->session,
+ &ai->properties);
+ /* Address may be blocked, only give ATS if address is
+ currently active. */
+ if (NULL != ai->ar)
+ GNUNET_ATS_address_update (ai->ar,
+ &ai->properties);
+}
+
+
+/**
+ * Notify ATS about utilization changes to an @a address.
+ * Does nothing if the @a address is not known to us.
+ *
+ * @param address our information about the address
+ * @param bps_in new utilization inbound
+ * @param bps_out new utilization outbound
+ */
+void
+GST_ats_update_utilization (const struct GNUNET_HELLO_Address *address,
+ uint32_t bps_in,
+ uint32_t bps_out)
+{
+ struct AddressInfo *ai;
+
+ ai = find_ai_no_session (address);
+ if (NULL == ai)
+ {
+ /* We do not know about this address, do nothing. */