*/
struct GNUNET_ATS_SchedulingHandle *GST_ats;
+/**
+ * DEBUGGING connection counter
+ */
+static int connections;
+
/**
* Transmit our HELLO message to the given (connected) neighbour.
* @param peer (claimed) identity of the other peer
* @param address the address
* @param session session used
- * @param msg the message to process
+ * @param message the message to process
* @param ats performance information
* @param ats_count number of records in ats
* @return how long the plugin should wait until receiving more data
session, GNUNET_i2s (peer));
#endif
if (NULL != session)
- GNUNET_log_from (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK,
+ GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
"transport-ats",
"Telling ATS to destroy session %p from peer %s\n",
session, GNUNET_i2s (peer));
* @param bandwidth_out assigned outbound bandwidth for the connection, 0 to disconnect from peer
* @param bandwidth_in assigned inbound bandwidth for the connection, 0 to disconnect from peer
* @param ats ATS information
- * @param number of ATS elements
+ * @param ats_count number of ATS elements
*/
static void
ats_request_address_change (void *cls,
struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf;
struct GNUNET_ATS_Information *ap;
+ connections++;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "We are now connected to peer `%s' and %u peers in total\n",
+ GNUNET_i2s (peer), connections);
+
connect_msg->header.size = htons (sizeof (buf));
connect_msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
connect_msg->ats_count = htonl (ats_count);
{
struct DisconnectInfoMessage disconnect_msg;
+ connections--;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Peer `%s' disconnected and we are connected to %u peers\n",
+ GNUNET_i2s (peer), connections);
+
disconnect_msg.header.size = htons (sizeof (struct DisconnectInfoMessage));
disconnect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT);
disconnect_msg.reserved = htonl (0);
}
+/**
+ * Function called to notify transport users that a neighbour peer changed its
+ * active address.
+ *
+ * @param cls closure
+ * @param peer peer this update is about (never NULL)
+ * @param address address, NULL on disconnect
+ */
+static void
+neighbours_address_notification (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_HELLO_Address *address)
+{
+ GST_clients_broadcast_address_notification (peer, address);
+}
+
+
/**
* Function called when the service shuts down. Unloads our plugins
* and cancels pending validations.
&plugin_env_address_change_notification,
&plugin_env_session_end,
&plugin_env_address_to_type);
- GST_neighbours_start (NULL, &neighbours_connect_notification,
- &neighbours_disconnect_notification);
+ GST_neighbours_start (NULL,
+ &neighbours_connect_notification,
+ &neighbours_disconnect_notification,
+ &neighbours_address_notification);
GST_clients_start (server);
GST_validation_start ();
}