gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r28900 - gnunet/src/ats
Date: Thu, 29 Aug 2013 17:47:47 +0200

Author: wachs
Date: 2013-08-29 17:47:47 +0200 (Thu, 29 Aug 2013)
New Revision: 28900

Modified:
   gnunet/src/ats/gnunet-service-ats-solver_mlp.c
   gnunet/src/ats/gnunet-service-ats-solver_mlp.h
   gnunet/src/ats/gnunet-service-ats-solver_proportional.c
   gnunet/src/ats/gnunet-service-ats-solver_proportional.h
   gnunet/src/ats/gnunet-service-ats_addresses.c
Log:
ATS service calls solver with feedback


Modified: gnunet/src/ats/gnunet-service-ats-solver_mlp.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_mlp.c      2013-08-29 15:36:21 UTC 
(rev 28899)
+++ gnunet/src/ats/gnunet-service-ats-solver_mlp.c      2013-08-29 15:47:47 UTC 
(rev 28900)
@@ -1651,6 +1651,30 @@
 }
 
 
+/**
+ * Get application feedback for a peer
+ *
+ * @param solver the solver handle
+ * @param application the application
+ * @param peer the peer to change the preference for
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_mlp_address_preference_feedback (void *solver,
+                                                                               
        void *application,
+                                                                               
        const struct GNUNET_PeerIdentity *peer,
+                                                                               
        enum GNUNET_ATS_PreferenceKind kind,
+                                                                               
        double score)
+{
+  struct GAS_PROPORTIONAL_Handle *s = solver;
+  GNUNET_assert (NULL != solver);
+  GNUNET_assert (NULL != peer);
+
+  GNUNET_assert (NULL != s);
+}
+
+
 static int
 mlp_free_peers (void *cls, const struct GNUNET_HashCode *key, void *value)
 {

Modified: gnunet/src/ats/gnunet-service-ats-solver_mlp.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_mlp.h      2013-08-29 15:36:21 UTC 
(rev 28899)
+++ gnunet/src/ats/gnunet-service-ats-solver_mlp.h      2013-08-29 15:47:47 UTC 
(rev 28900)
@@ -501,6 +501,24 @@
 
 
 /**
+ * Get application feedback for a peer
+ *
+ * @param solver the solver handle
+ * @param application the application
+ * @param peer the peer to change the preference for
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_mlp_address_preference_feedback (void *solver,
+                                                                               
        void *application,
+                                                                               
        const struct GNUNET_PeerIdentity *peer,
+                                                                               
        enum GNUNET_ATS_PreferenceKind kind,
+                                                                               
        double score);
+
+
+
+/**
  * Start a bulk operation
  *
  * @param solver the solver

Modified: gnunet/src/ats/gnunet-service-ats-solver_proportional.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_proportional.c     2013-08-29 
15:36:21 UTC (rev 28899)
+++ gnunet/src/ats/gnunet-service-ats-solver_proportional.c     2013-08-29 
15:47:47 UTC (rev 28900)
@@ -887,6 +887,31 @@
 
 
 /**
+ * Get application feedback for a peer
+ *
+ * @param solver the solver handle
+ * @param application the application
+ * @param peer the peer to change the preference for
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_proportional_address_preference_feedback (void *solver,
+                                                                               
        void *application,
+                                                                               
        const struct GNUNET_PeerIdentity *peer,
+                                                                               
        enum GNUNET_ATS_PreferenceKind kind,
+                                                                               
        double score)
+{
+  struct GAS_PROPORTIONAL_Handle *s = solver;
+  GNUNET_assert (NULL != solver);
+  GNUNET_assert (NULL != peer);
+
+  GNUNET_assert (NULL != s);
+  GNUNET_break (0);
+}
+
+
+/**
  * Get the preferred address for a specific peer
  *
  * @param solver the solver handle

Modified: gnunet/src/ats/gnunet-service-ats-solver_proportional.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_proportional.h     2013-08-29 
15:36:21 UTC (rev 28899)
+++ gnunet/src/ats/gnunet-service-ats-solver_proportional.h     2013-08-29 
15:47:47 UTC (rev 28900)
@@ -50,6 +50,23 @@
 
 
 /**
+ * Get application feedback for a peer
+ *
+ * @param solver the solver handle
+ * @param application the application
+ * @param peer the peer to change the preference for
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_proportional_address_preference_feedback (void *solver,
+                                                                               
        void *application,
+                                                                               
        const struct GNUNET_PeerIdentity *peer,
+                                                                               
        enum GNUNET_ATS_PreferenceKind kind,
+                                                                               
        double score);
+
+
+/**
  * Init the proportional problem solver
  *
  * Quotas:

Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c       2013-08-29 15:36:21 UTC 
(rev 28899)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c       2013-08-29 15:47:47 UTC 
(rev 28900)
@@ -1520,12 +1520,7 @@
       return;
   }
 
-  GNUNET_break (0);
-
-  //handle->s_bulk_start (handle->solver);
-  /* Tell normalization about change, normalization will call callback if 
preference changed */
-  //GAS_normalization_normalize_preference (client, peer, kind, score_abs);
-  //handle->s_bulk_stop (handle->solver);
+  handle->s_feedback (handle->solver, application, peer, kind, score_abs);
 }
 
 
@@ -1759,6 +1754,7 @@
       ah->s_get = &GAS_mlp_get_preferred_address;
       ah->s_get_stop = &GAS_mlp_stop_get_preferred_address;
       ah->s_pref = &GAS_mlp_address_change_preference;
+      ah->s_feedback = &GAS_mlp_address_preference_feedback;
       ah->s_del =  &GAS_mlp_address_delete;
       ah->s_bulk_start = &GAS_mlp_bulk_start;
       ah->s_bulk_stop = &GAS_mlp_bulk_stop;
@@ -1780,7 +1776,7 @@
       ah->s_get = &GAS_proportional_get_preferred_address;
       ah->s_get_stop = &GAS_proportional_stop_get_preferred_address;
       ah->s_pref = &GAS_proportional_address_change_preference;
-      ah->s_pref = &GAS_proportional_address_change_preference;
+      ah->s_feedback = &GAS_proportional_address_preference_feedback;
       ah->s_del  = &GAS_proportional_address_delete;
       ah->s_bulk_start = &GAS_proportional_bulk_start;
       ah->s_bulk_stop = &GAS_proportional_bulk_stop;
@@ -1801,6 +1797,7 @@
   GNUNET_assert (NULL != ah->s_get);
   GNUNET_assert (NULL != ah->s_get_stop);
   GNUNET_assert (NULL != ah->s_pref);
+  GNUNET_assert (NULL != ah->s_feedback);
   GNUNET_assert (NULL != ah->s_del);
   GNUNET_assert (NULL != ah->s_done);
   GNUNET_assert (NULL != ah->s_bulk_start);




reply via email to

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