+/**
+ * Method called whenever a given peer connects. Wrapper to call both client's and server's functions
+ *
+ * @param cls closure
+ * @param peer peer identity this notification is about
+ * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
+ */
+static void
+connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_ATS_Information *atsi,
+ unsigned int atsi_count)
+{
+ if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity)))
+ return;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "A new peer connected, notifying client and server\n");
+ if (NULL != client_ch)
+ (*client_ch) (cls, peer, atsi, atsi_count);
+#if HAVE_MHD
+ if (NULL != server_ch)
+ (*server_ch) (cls, peer, atsi, atsi_count);
+#endif
+}
+
+/**
+ * Method called whenever a given peer disconnects. Wrapper to call both client's and server's functions
+ *
+ * @param cls closure
+ * @param peer peer identity this notification is about
+ */
+static void
+disconnect_handler (void *cls, const struct GNUNET_PeerIdentity *peer)
+{
+ if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity)))
+ return;
+ /* call hostlist client disconnect handler */
+ if (NULL != client_dh)
+ (*client_dh) (cls, peer);
+#if HAVE_MHD
+ /* call hostlist server disconnect handler */
+ if (NULL != server_dh)
+ (*server_dh) (cls, peer);
+#endif
+}
+