+ &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. */
+ return;
+ }
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Updating utilization for peer `%s' address %s: %u/%u\n",
+ GNUNET_i2s (&address->peer),
+ GST_plugins_a2s (address),
+ (unsigned int) bps_in,
+ (unsigned int) bps_out);
+ ai->properties.utilization_in = bps_in;
+ ai->properties.utilization_out = bps_out;
+ /* 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);