gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35152 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r35152 - gnunet/src/ats
Date: Sun, 8 Feb 2015 14:19:14 +0100

Author: grothoff
Date: 2015-02-08 14:19:14 +0100 (Sun, 08 Feb 2015)
New Revision: 35152

Modified:
   gnunet/src/ats/gnunet-ats-solver-eval.c
   gnunet/src/ats/gnunet-service-ats.c
   gnunet/src/ats/gnunet-service-ats_addresses.c
   gnunet/src/ats/gnunet-service-ats_feedback.c
   gnunet/src/ats/gnunet-service-ats_feedback.h
   gnunet/src/ats/gnunet-service-ats_normalization.c
   gnunet/src/ats/gnunet-service-ats_normalization.h
   gnunet/src/ats/gnunet-service-ats_plugins.c
   gnunet/src/ats/gnunet-service-ats_plugins.h
   gnunet/src/ats/gnunet-service-ats_preferences.c
   gnunet/src/ats/gnunet-service-ats_preferences.h
   gnunet/src/ats/perf_ats_solver.c
   gnunet/src/ats/plugin_ats_mlp.c
   gnunet/src/ats/plugin_ats_proportional.c
   gnunet/src/ats/plugin_ats_ril.c
Log:
-rename for naming consistency

Modified: gnunet/src/ats/gnunet-ats-solver-eval.c
===================================================================
--- gnunet/src/ats/gnunet-ats-solver-eval.c     2015-02-08 13:05:58 UTC (rev 
35151)
+++ gnunet/src/ats/gnunet-ats-solver-eval.c     2015-02-08 13:19:14 UTC (rev 
35152)
@@ -639,7 +639,7 @@
         pg->ats_property, prop_value, prop_value);
   }
   else
-    GAS_normalization_normalize_property (pg->test_address->ats_addr, &atsi, 
1);
+    GAS_normalization_update_property (pg->test_address->ats_addr, &atsi, 1);
   sh->sf->s_bulk_stop (sh->sf->cls);
 
   pg->set_task = GNUNET_SCHEDULER_add_delayed (pg->frequency,
@@ -3010,7 +3010,7 @@
     return p->pref_abs;
   }
   else
-    return GAS_normalization_get_preferences_by_peer (NULL,
+    return GAS_preference_get_by_peer (NULL,
                                                      id);
 }
 

Modified: gnunet/src/ats/gnunet-service-ats.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats.c 2015-02-08 13:05:58 UTC (rev 35151)
+++ gnunet/src/ats/gnunet-service-ats.c 2015-02-08 13:19:14 UTC (rev 35152)
@@ -111,7 +111,7 @@
     return;
   GAS_scheduling_remove_client (client);
   GAS_connectivity_remove_client (client);
-  GAS_normalization_preference_client_disconnect (client);
+  GAS_preference_client_disconnect (client);
 }
 
 
@@ -127,7 +127,7 @@
 {
   GAS_addresses_done ();
   GAS_connectivity_done ();
-  GAS_plugins_done ();
+  GAS_plugin_done ();
   GAS_normalization_stop ();
   GAS_scheduling_done ();
   GAS_performance_done ();
@@ -181,7 +181,7 @@
      sizeof (struct ReservationRequestMessage)},
     {&GAS_handle_preference_change, NULL,
      GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
-    {&GAS_handle_preference_feedback, NULL,
+    {&GAS_handle_feedback, NULL,
      GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_FEEDBACK, 0},
     {NULL, NULL, 0, 0}
   };
@@ -193,7 +193,7 @@
   GAS_normalization_start ();
   GAS_addresses_init (server);
   if (GNUNET_OK !=
-      GAS_plugins_init (cfg))
+      GAS_plugin_init (cfg))
   {
     GNUNET_break (0);
     GAS_addresses_done ();

Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c       2015-02-08 13:05:58 UTC 
(rev 35151)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c       2015-02-08 13:19:14 UTC 
(rev 35152)
@@ -646,7 +646,7 @@
                                        GNUNET_BANDWIDTH_value_init 
(aa->assigned_bw_out),
                                        GNUNET_BANDWIDTH_value_init 
(aa->assigned_bw_in));
 
-    GAS_normalization_normalize_property (aa,
+    GAS_normalization_update_property (aa,
                                           atsi,
                                           atsi_count);
   }

Modified: gnunet/src/ats/gnunet-service-ats_feedback.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_feedback.c        2015-02-08 13:05:58 UTC 
(rev 35151)
+++ gnunet/src/ats/gnunet-service-ats_feedback.c        2015-02-08 13:19:14 UTC 
(rev 35152)
@@ -48,7 +48,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received PREFERENCE FEEDBACK for peer `%s'\n",
               GNUNET_i2s (peer));
-  GAS_plugin_preference_feedback (application,
+  GAS_plugin_notify_feedback (application,
                                  peer,
                                  scope,
                                  kind,
@@ -64,7 +64,7 @@
  * @param message the request message
  */
 void
-GAS_handle_preference_feedback (void *cls,
+GAS_handle_feedback (void *cls,
                                struct GNUNET_SERVER_Client *client,
                                const struct GNUNET_MessageHeader *message)
 {

Modified: gnunet/src/ats/gnunet-service-ats_feedback.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_feedback.h        2015-02-08 13:05:58 UTC 
(rev 35151)
+++ gnunet/src/ats/gnunet-service-ats_feedback.h        2015-02-08 13:19:14 UTC 
(rev 35152)
@@ -36,7 +36,7 @@
  * @param message the request message
  */
 void
-GAS_handle_preference_feedback (void *cls,
+GAS_handle_feedback (void *cls,
                                 struct GNUNET_SERVER_Client *client,
                                 const struct GNUNET_MessageHeader *message);
 

Modified: gnunet/src/ats/gnunet-service-ats_normalization.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_normalization.c   2015-02-08 13:05:58 UTC 
(rev 35151)
+++ gnunet/src/ats/gnunet-service-ats_normalization.c   2015-02-08 13:19:14 UTC 
(rev 35152)
@@ -23,8 +23,6 @@
  * @brief ats service address: management of ATS properties and preferences 
normalization
  * @author Matthias Wachs
  * @author Christian Grothoff
- *
- * FIXME: rename to 'properties'!? merge with addresses!?
  */
 #include "platform.h"
 #include <float.h>
@@ -221,7 +219,7 @@
   struct Property *p = cls;
   struct ATS_Address *address = value;
 
-  GAS_normalized_property_changed (address,
+  GAS_plugin_notify_property_changed (address,
                                   p->atsi_type,
                                   address->atsin[p->prop_type].norm);
   return GNUNET_OK;
@@ -236,7 +234,7 @@
  * @param atsi_count the number of atsi information in the array
  */
 void
-GAS_normalization_normalize_property (struct ATS_Address *address,
+GAS_normalization_update_property (struct ATS_Address *address,
                                       const struct GNUNET_ATS_Information 
*atsi,
                                       uint32_t atsi_count)
 {

Modified: gnunet/src/ats/gnunet-service-ats_normalization.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_normalization.h   2015-02-08 13:05:58 UTC 
(rev 35151)
+++ gnunet/src/ats/gnunet-service-ats_normalization.h   2015-02-08 13:19:14 UTC 
(rev 35152)
@@ -42,7 +42,7 @@
  * @param atsi_count the number of atsi information in the array
  */
 void
-GAS_normalization_normalize_property (struct ATS_Address *address,
+GAS_normalization_update_property (struct ATS_Address *address,
                                      const struct GNUNET_ATS_Information *atsi,
                                      uint32_t atsi_count);
 

Modified: gnunet/src/ats/gnunet-service-ats_plugins.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_plugins.c 2015-02-08 13:05:58 UTC (rev 
35151)
+++ gnunet/src/ats/gnunet-service-ats_plugins.c 2015-02-08 13:19:14 UTC (rev 
35152)
@@ -58,9 +58,9 @@
  * @param pref_rel the new relative preference value
  */
 void
-GAS_normalized_preference_changed (const struct GNUNET_PeerIdentity *peer,
-                                  enum GNUNET_ATS_PreferenceKind kind,
-                                  double pref_rel)
+GAS_plugin_notify_preference_changed (const struct GNUNET_PeerIdentity *peer,
+                                      enum GNUNET_ATS_PreferenceKind kind,
+                                      double pref_rel)
 {
   sf->s_pref (sf->cls,
               peer,
@@ -77,15 +77,10 @@
  * @param prop_rel the new relative preference value
  */
 void
-GAS_normalized_property_changed (struct ATS_Address *address,
-                                enum GNUNET_ATS_Property type,
-                                double prop_rel)
+GAS_plugin_notify_property_changed (struct ATS_Address *address,
+                                    enum GNUNET_ATS_Property type,
+                                    double prop_rel)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Normalized property %s for peer `%s' changed to %.3f \n",
-             GNUNET_ATS_print_property_type (type),
-             GNUNET_i2s (&address->peer),
-             prop_rel);
   sf->s_address_update_property (sf->cls,
                                  address,
                                  type,
@@ -413,7 +408,7 @@
  *         solver plugin)
  */
 int
-GAS_plugins_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
+GAS_plugin_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   char *mode_str;
 
@@ -431,7 +426,7 @@
   env.cls = NULL;
   env.info_cb = &solver_info_cb;
   env.bandwidth_changed_cb = &bandwidth_changed_cb;
-  env.get_preferences = &GAS_normalization_get_preferences_by_peer;
+  env.get_preferences = &GAS_preference_get_by_peer;
   env.cfg = cfg;
   env.stats = GSA_stats;
   env.addresses = GSA_addresses;
@@ -462,7 +457,7 @@
  * Shutdown address subsystem.
  */
 void
-GAS_plugins_done ()
+GAS_plugin_done ()
 {
   GNUNET_PLUGIN_unload (plugin,
                         sf);
@@ -491,7 +486,7 @@
              new_address,
              addr_net);
   sf->s_bulk_start (sf->cls);
-  GAS_normalization_normalize_property (new_address,
+  GAS_normalization_update_property (new_address,
                                        atsi,
                                        atsi_count);
   sf->s_bulk_stop (sf->cls);
@@ -524,11 +519,11 @@
  * @param score_abs degree of the appreciation
  */
 void
-GAS_plugin_preference_feedback (struct GNUNET_SERVER_Client *application,
-                               const struct GNUNET_PeerIdentity *peer,
-                               const struct GNUNET_TIME_Relative scope,
-                               enum GNUNET_ATS_PreferenceKind kind,
-                               float score_abs)
+GAS_plugin_notify_feedback (struct GNUNET_SERVER_Client *application,
+                            const struct GNUNET_PeerIdentity *peer,
+                            const struct GNUNET_TIME_Relative scope,
+                            enum GNUNET_ATS_PreferenceKind kind,
+                            float score_abs)
 {
   sf->s_feedback (sf->cls,
                   application,

Modified: gnunet/src/ats/gnunet-service-ats_plugins.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_plugins.h 2015-02-08 13:05:58 UTC (rev 
35151)
+++ gnunet/src/ats/gnunet-service-ats_plugins.h 2015-02-08 13:19:14 UTC (rev 
35152)
@@ -41,14 +41,14 @@
  *         solver plugin)
  */
 int
-GAS_plugins_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
+GAS_plugin_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
 /**
  * Shutdown address subsystem.
  */
 void
-GAS_plugins_done (void);
+GAS_plugin_done (void);
 
 
 /**
@@ -59,9 +59,9 @@
  * @param pref_rel the new relative preference value
  */
 void
-GAS_normalized_preference_changed (const struct GNUNET_PeerIdentity *peer,
-                                  enum GNUNET_ATS_PreferenceKind kind,
-                                  double pref_rel);
+GAS_plugin_notify_preference_changed (const struct GNUNET_PeerIdentity *peer,
+                                      enum GNUNET_ATS_PreferenceKind kind,
+                                      double pref_rel);
 
 
 /**
@@ -69,12 +69,12 @@
  *
  * @param address the peer
  * @param type the ATS type
- * @param prop_rel the new relative preference value
+ * @param prop_rel the new relative property value
  */
 void
-GAS_normalized_property_changed (struct ATS_Address *address,
-                                enum GNUNET_ATS_Property type,
-                                double prop_rel);
+GAS_plugin_notify_property_changed (struct ATS_Address *address,
+                                    enum GNUNET_ATS_Property type,
+                                    double prop_rel);
 
 
 /**
@@ -114,15 +114,13 @@
  * @param score_abs degree of the appreciation
  */
 void
-GAS_plugin_preference_feedback (struct GNUNET_SERVER_Client *application,
-                               const struct GNUNET_PeerIdentity *peer,
-                               const struct GNUNET_TIME_Relative scope,
-                               enum GNUNET_ATS_PreferenceKind kind,
-                               float score_abs);
+GAS_plugin_notify_feedback (struct GNUNET_SERVER_Client *application,
+                            const struct GNUNET_PeerIdentity *peer,
+                            const struct GNUNET_TIME_Relative scope,
+                            enum GNUNET_ATS_PreferenceKind kind,
+                            float score_abs);
 
 
-
-
 /**
  * Stop instant solving, there are many state updates
  * happening in bulk right now.

Modified: gnunet/src/ats/gnunet-service-ats_preferences.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_preferences.c     2015-02-08 13:05:58 UTC 
(rev 35151)
+++ gnunet/src/ats/gnunet-service-ats_preferences.c     2015-02-08 13:19:14 UTC 
(rev 35152)
@@ -238,7 +238,7 @@
       rp->f_rel[kind] = DEFAULT_REL_PREFERENCE;
     }
     if (backup != rp->f_rel[kind])
-      GAS_normalized_preference_changed (&rp->id, kind,
+      GAS_plugin_notify_preference_changed (&rp->id, kind,
                                          rp->f_rel[kind]);
   }
 }
@@ -714,8 +714,8 @@
  * default preferences if peer does not exist
  */
 const double *
-GAS_normalization_get_preferences_by_peer (void *cls,
-                                          const struct GNUNET_PeerIdentity *id)
+GAS_preference_get_by_peer (void *cls,
+                            const struct GNUNET_PeerIdentity *id)
 {
   struct PeerRelative *rp;
 
@@ -735,7 +735,7 @@
  * @param client the client
  */
 void
-GAS_normalization_preference_client_disconnect (struct GNUNET_SERVER_Client 
*client)
+GAS_preference_client_disconnect (struct GNUNET_SERVER_Client *client)
 {
   struct PreferenceClient *c_cur;
 

Modified: gnunet/src/ats/gnunet-service-ats_preferences.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_preferences.h     2015-02-08 13:05:58 UTC 
(rev 35151)
+++ gnunet/src/ats/gnunet-service-ats_preferences.h     2015-02-08 13:19:14 UTC 
(rev 35152)
@@ -74,7 +74,7 @@
  *  with GNUNET_ATS_PreferenceKind, NULL if peer does not exist
  */
 const double *
-GAS_normalization_get_preferences_by_peer (void *cls,
+GAS_preference_get_by_peer (void *cls,
                                           const struct GNUNET_PeerIdentity 
*id);
 
 
@@ -84,7 +84,7 @@
  * @param client the disconnecting client
  */
 void
-GAS_normalization_preference_client_disconnect (struct GNUNET_SERVER_Client 
*client);
+GAS_preference_client_disconnect (struct GNUNET_SERVER_Client *client);
 
 
 #endif

Modified: gnunet/src/ats/perf_ats_solver.c
===================================================================
--- gnunet/src/ats/perf_ats_solver.c    2015-02-08 13:05:58 UTC (rev 35151)
+++ gnunet/src/ats/perf_ats_solver.c    2015-02-08 13:19:14 UTC (rev 35152)
@@ -418,7 +418,7 @@
 static const double *
 get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id)
 {
-  return GAS_normalization_get_preferences_by_peer (NULL, id);
+  return GAS_preference_get_by_peer (NULL, id);
 }
 
 

Modified: gnunet/src/ats/plugin_ats_mlp.c
===================================================================
--- gnunet/src/ats/plugin_ats_mlp.c     2015-02-08 13:05:58 UTC (rev 35151)
+++ gnunet/src/ats/plugin_ats_mlp.c     2015-02-08 13:19:14 UTC (rev 35152)
@@ -1477,8 +1477,10 @@
        enum GAS_Solver_Status stat,
        enum GAS_Solver_Additional_Information add)
 {
-  if (NULL != mlp->env->info_cb)
-    mlp->env->info_cb (mlp->env->cls, op, stat, add);
+  mlp->env->info_cb (mlp->env->cls,
+                     op,
+                     stat,
+                     add);
 }
 
 

Modified: gnunet/src/ats/plugin_ats_proportional.c
===================================================================
--- gnunet/src/ats/plugin_ats_proportional.c    2015-02-08 13:05:58 UTC (rev 
35151)
+++ gnunet/src/ats/plugin_ats_proportional.c    2015-02-08 13:19:14 UTC (rev 
35152)
@@ -1097,53 +1097,61 @@
         GNUNET_ATS_print_network_type(n->type),
         n->active_addresses, n->total_addresses);
 
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_START,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_SINGLE);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_START,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_SINGLE);
 
     /* Distribute  */
     distribute_bandwidth(s, n);
 
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_STOP,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_SINGLE);
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_UPDATE_NOTIFICATION_START,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_SINGLE);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_STOP,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_SINGLE);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_UPDATE_NOTIFICATION_START,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_SINGLE);
 
     /* Do propagation */
     propagate_bandwidth (s, n);
 
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_SINGLE);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_SINGLE);
   }
   else
   {
     int i;
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_START,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_ALL);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_START,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_ALL);
     for (i = 0; i < s->network_count; i++)
     {
       /* Distribute */
       distribute_bandwidth(s, &s->network_entries[i]);
     }
 
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_STOP,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_ALL);
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_UPDATE_NOTIFICATION_START,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_ALL);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_STOP,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_ALL);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_UPDATE_NOTIFICATION_START,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_ALL);
     for (i = 0; i < s->network_count; i++)
     {
       /* Do propagation */
       propagate_bandwidth(s, &s->network_entries[i]);
     }
-    if (NULL != s->env->info_cb)
-      s->env->info_cb(s->env->cls, GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP,
-          GAS_STAT_SUCCESS, GAS_INFO_PROP_ALL);
+    s->env->info_cb (s->env->cls,
+                     GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP,
+                     GAS_STAT_SUCCESS,
+                     GAS_INFO_PROP_ALL);
   }
 }
 

Modified: gnunet/src/ats/plugin_ats_ril.c
===================================================================
--- gnunet/src/ats/plugin_ats_ril.c     2015-02-08 13:05:58 UTC (rev 35151)
+++ gnunet/src/ats/plugin_ats_ril.c     2015-02-08 13:19:14 UTC (rev 35152)
@@ -783,8 +783,10 @@
             enum GAS_Solver_Operation op,
             enum GAS_Solver_Status stat)
 {
-  if (NULL != solver->env->info_cb)
-    solver->env->info_cb (solver->env->cls, op, stat, GAS_INFO_NONE);
+  solver->env->info_cb (solver->env->cls,
+                        op,
+                        stat,
+                        GAS_INFO_NONE);
 }
 
 /**




reply via email to

[Prev in Thread] Current Thread [Next in Thread]