(no commit message)
[oweals/gnunet.git] / src / transport / gnunet-service-transport.c
index d6be384bdbe5d8b7150dcbd46ec687d9278edd4f..dc86a69e649c0a98ed5adf697ff4358da2412705 100644 (file)
@@ -70,7 +70,7 @@ static struct GNUNET_SERVER_Handle *GST_server;
 /**
  * Our private key.
  */
-struct GNUNET_CRYPTO_EccPrivateKey *GST_my_private_key;
+struct GNUNET_CRYPTO_EddsaPrivateKey *GST_my_private_key;
 
 /**
  * ATS handle.
@@ -228,6 +228,7 @@ GST_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
                         gettext_noop
                         ("# bytes total received"),
                             ntohs (message->size), GNUNET_NO);
+  GST_neighbours_notify_data_recv (peer, &address, session, message);
 
   switch (type)
   {
@@ -275,6 +276,7 @@ GST_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
                               gettext_noop
                               ("# bytes payload received"),
                               ntohs (message->size), GNUNET_NO);
+    GST_neighbours_notify_payload_recv (peer, &address, session, message);
     ret = process_payload (peer, &address, session, message);
     break;
   }
@@ -460,22 +462,25 @@ GST_ats_update_metrics (const struct GNUNET_PeerIdentity *peer,
        struct GNUNET_ATS_Information *ats_new;
 
   if (GNUNET_NO == GNUNET_ATS_session_known (GST_ats, address, session))
-       return;
+    return;
 
-       /* Call to manipulation to manipulate ATS information */
-       ats_new = GST_manipulation_manipulate_metrics (peer, address, session, ats, ats_count);
-       if (NULL == ats_new)
-       {
-                       GNUNET_break (0);
-                       return;
-       }
-  if (GNUNET_NO == GNUNET_ATS_address_update (GST_ats, address, session, ats_new, ats_count))
+  /* Call to manipulation to manipulate ATS information */
+  ats_new = GST_manipulation_manipulate_metrics (peer, address, session, ats,
+      ats_count);
+  if (NULL == ats_new)
+  {
+    GNUNET_break(0);
+    return;
+  }
+  if (GNUNET_NO == GNUNET_ATS_address_update (GST_ats,
+      address, session, ats_new, ats_count))
   {
-       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                       _("Address or session unknown: failed to update properties for peer `%s' plugin `%s' address `%s' session %p\n"),
-                       GNUNET_i2s (peer), address->transport_name, GST_plugins_a2s (address), session);
+    GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
+        _("Address or session unknown: failed to update properties for peer `%s' plugin `%s' address `%s' session %p\n"),
+        GNUNET_i2s (peer), address->transport_name, GST_plugins_a2s (address),
+        session);
   }
-  GNUNET_free (ats_new);
+  GNUNET_free(ats_new);
 }
 
 
@@ -738,7 +743,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   char *keyfile;
-  struct GNUNET_CRYPTO_EccPrivateKey *pk;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
   long long unsigned int max_fd_cfg;
   int max_fd_rlimit;
   int max_fd;
@@ -763,14 +768,14 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
     hello_expiration = GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION;
   }
   GST_server = server;
-  pk = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
+  pk = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile);
   GNUNET_free (keyfile);
   GNUNET_assert (NULL != pk);
   GST_my_private_key = pk;
 
   GST_stats = GNUNET_STATISTICS_create ("transport", GST_cfg);
   GST_peerinfo = GNUNET_PEERINFO_connect (GST_cfg);
-  GNUNET_CRYPTO_ecc_key_get_public_for_signature (GST_my_private_key,
+  GNUNET_CRYPTO_eddsa_key_get_public (GST_my_private_key,
                                                  &GST_my_identity.public_key);
   GNUNET_assert (NULL != GST_my_private_key);