gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r25312 - gnunet/src/ats
Date: Fri, 7 Dec 2012 16:39:41 +0100

Author: wachs
Date: 2012-12-07 16:39:40 +0100 (Fri, 07 Dec 2012)
New Revision: 25312

Modified:
   gnunet/src/ats/gnunet-service-ats_addresses.c
   gnunet/src/ats/gnunet-service-ats_addresses.h
   gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
   gnunet/src/ats/gnunet-service-ats_addresses_mlp.h
   gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c
   gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h
Log:
mod

Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c       2012-12-07 15:32:46 UTC 
(rev 25311)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c       2012-12-07 15:39:40 UTC 
(rev 25312)
@@ -124,6 +124,11 @@
   GAS_solver_init s_init;
 
   /**
+   * Add an address to the solver
+   */
+  GAS_solver_address_add s_add;
+
+  /**
    * Update address in solver
    */
   GAS_solver_address_update s_update;
@@ -478,7 +483,7 @@
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added new address for peer `%s' 
session id %u, %p\n",
                 GNUNET_i2s (peer), session_id, aa);
     /* Tell solver about update */
-    handle->s_update (handle->solver, handle->addresses, aa);
+    handle->s_add (handle->solver, handle->addresses, aa);
     return;
   }
 
@@ -505,7 +510,7 @@
   }
   GNUNET_free (aa->plugin);
   GNUNET_free (aa);
-  handle->s_update (handle->solver, handle->addresses, old);
+  handle->s_add (handle->solver, handle->addresses, old);
 }
 
 
@@ -997,6 +1002,7 @@
 #if HAVE_LIBGLPK
       ah->ats_mode = MODE_MLP;
       ah->s_init = &GAS_mlp_init;
+      ah->s_add = &GAS_mlp_address_add;
       ah->s_update = &GAS_mlp_address_update;
       ah->s_get = &GAS_mlp_get_preferred_address;
       ah->s_pref = &GAS_mlp_address_change_preference;
@@ -1011,6 +1017,7 @@
       /* Init the simplistic solver with default values */
       ah->ats_mode = MODE_SIMPLISTIC;
       ah->s_init = &GAS_simplistic_init;
+      ah->s_add = &GAS_simplistic_address_add;
       ah->s_update = &GAS_simplistic_address_update;
       ah->s_get = &GAS_simplistic_get_preferred_address;
       ah->s_pref = &GAS_simplistic_address_change_preference;
@@ -1024,6 +1031,7 @@
   }
 
   GNUNET_assert (NULL != ah->s_init);
+  GNUNET_assert (NULL != ah->s_add);
   GNUNET_assert (NULL != ah->s_update);
   GNUNET_assert (NULL != ah->s_get);
   GNUNET_assert (NULL != ah->s_pref);

Modified: gnunet/src/ats/gnunet-service-ats_addresses.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.h       2012-12-07 15:32:46 UTC 
(rev 25311)
+++ gnunet/src/ats/gnunet-service-ats_addresses.h       2012-12-07 15:39:40 UTC 
(rev 25312)
@@ -176,13 +176,28 @@
                      unsigned long long *in_quota,
                      int dest_length);
 
+
 typedef void
 (*GAS_solver_address_change_preference) (void *solver,
                                          const struct GNUNET_PeerIdentity 
*peer,
                                          enum GNUNET_ATS_PreferenceKind kind,
                                          float score);
 
+/**
+ * Add a single address to the solver
+ *
+ * @param solver the solver Handle
+ * @param addresses the address hashmap containing all addresses
+ * @param address the address to add
+ */
 typedef void
+(*GAS_solver_address_add) (void *solver,
+                           struct GNUNET_CONTAINER_MultiHashMap * addresses,
+                           struct ATS_Address *address);
+
+
+
+typedef void
  (*GAS_solver_address_delete) (void *solver,
                                struct GNUNET_CONTAINER_MultiHashMap *addresses,
                                struct ATS_Address *address);

Modified: gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_mlp.c   2012-12-07 15:32:46 UTC 
(rev 25311)
+++ gnunet/src/ats/gnunet-service-ats_addresses_mlp.c   2012-12-07 15:39:40 UTC 
(rev 25312)
@@ -1517,7 +1517,21 @@
   }
 }
 
+
 /**
+ * Add a single address to the solve
+ *
+ * @param solver the solver Handle
+ * @param addresses the address hashmap containing all addresses
+ * @param address the address to add
+ */
+void
+GAS_mlp_address_add (void *solver, struct GNUNET_CONTAINER_MultiHashMap * 
addresses, struct ATS_Address *address)
+{
+
+}
+
+/**
  * Updates a single address in the MLP problem
  *
  * If the address did not exist before in the problem:

Modified: gnunet/src/ats/gnunet-service-ats_addresses_mlp.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_mlp.h   2012-12-07 15:32:46 UTC 
(rev 25311)
+++ gnunet/src/ats/gnunet-service-ats_addresses_mlp.h   2012-12-07 15:39:40 UTC 
(rev 25312)
@@ -326,6 +326,16 @@
 
 
 /**
+ * Add a single address to the solve
+ *
+ * @param solver the solver Handle
+ * @param addresses the address hashmap containing all addresses
+ * @param address the address to add
+ */
+void
+GAS_mlp_address_add (void *solver, struct GNUNET_CONTAINER_MultiHashMap * 
addresses, struct ATS_Address *address);
+
+/**
  * Updates a single address in the MLP problem
  *
  * If the address did not exist before in the problem:

Modified: gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c    2012-12-07 
15:32:46 UTC (rev 25311)
+++ gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c    2012-12-07 
15:39:40 UTC (rev 25312)
@@ -39,6 +39,8 @@
 
   unsigned int active_addresses;
 
+  unsigned int networks;
+
   /**
    * Network type array
    *
@@ -96,6 +98,8 @@
 {
   struct GAS_SIMPLISTIC_Handle *solver = GNUNET_malloc (sizeof (struct 
GAS_SIMPLISTIC_Handle));
 
+  solver->networks = dest_length;
+
   solver->quota_net = GNUNET_malloc (dest_length * sizeof (int));
   memcpy (solver->quota_net, network, dest_length * sizeof (int));
 
@@ -129,6 +133,22 @@
 }
 
 /**
+ * Add a single address to the solve
+ *
+ * @param solver the solver Handle
+ * @param addresses the address hashmap containing all addresses
+ * @param address the address to add
+ */
+void
+GAS_simplistic_address_add (void *solver, struct GNUNET_CONTAINER_MultiHashMap 
* addresses, struct ATS_Address *address)
+{
+
+
+}
+
+
+
+/**
  * Updates a single address in the solve
  *
  * @param solver the solver Handle
@@ -139,6 +159,7 @@
 GAS_simplistic_address_update (void *solver, struct 
GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address)
 {
 
+
 }
 
 

Modified: gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h    2012-12-07 
15:32:46 UTC (rev 25311)
+++ gnunet/src/ats/gnunet-service-ats_addresses_simplistic.h    2012-12-07 
15:39:40 UTC (rev 25312)
@@ -67,7 +67,17 @@
 void
 GAS_simplistic_done (void * solver);
 
+/**
+ * Add a single address to the solve
+ *
+ * @param solver the solver Handle
+ * @param addresses the address hashmap containing all addresses
+ * @param address the address to add
+ */
+void
+GAS_simplistic_address_add (void *solver, struct GNUNET_CONTAINER_MultiHashMap 
* addresses, struct ATS_Address *address);
 
+
 /**
  * Updates a single address in the solve
  *




reply via email to

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