#include "gnunet_statistics_service.h"
#include "gnunet-service-ats_addresses_mlp.h"
-#define VERBOSE GNUNET_YES
-#define VERBOSE_ARM GNUNET_NO
-
#define MLP_MAX_EXEC_DURATION GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3)
#define MLP_MAX_ITERATIONS INT_MAX
static int start;
static int end;
-struct PeerContext *p;
+struct ATS_Peer *p;
struct ATS_Address *a;
static int ret;
-struct GNUNET_CONTAINER_MultiHashMap * amap;
+static struct GNUNET_CONTAINER_MultiHashMap * amap;
-struct GAS_MLP_Handle *mlp;
+static struct GAS_MLP_Handle *mlp;
u_types[0] = 0;
u_types[1] = 0;
+ for (cur = 0; cur < addrs; cur ++)
+ {
+ updated[cur] = 0;
+ }
+ cur = 0;
+
while (updates < ua)
{
cur = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, addrs);
a[cur].ats[u_type].value = u_val;
updated[cur] = 1;
+ GAS_mlp_address_update(mlp, amap, &a[cur]);
updates++;
}
}
static void
check (void *cls, char *const *args, const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *cfg)
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
unsigned int c = 0;
unsigned int c2 = 0;
if ((update_percentage >= 0) && (update_percentage <= 100))
{
update = GNUNET_YES;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Benchmarking with existing presolution and %u \% updated addresses\n", update_percentage);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Benchmarking with existing presolution and %u%% updated addresses\n", update_percentage);
}
else if ((update_percentage > 100) && (update_percentage != UINT_MAX))
{
/* Setting address */
a[ca].peer = p[c].id;
- a[ca].plugin = strdup("test");
+ a[ca].plugin = GNUNET_strdup("test");
a[ca].atsp_network_type = GNUNET_ATS_NET_LOOPBACK;
a[ca].ats = GNUNET_malloc (DEF_ATS_VALUES * sizeof (struct GNUNET_ATS_Information));
GNUNET_assert (GNUNET_OK == ctx.lp_result);
GNUNET_assert (GNUNET_OK == ctx.mlp_result);
if (GNUNET_YES == numeric)
- printf ("%u;%u;%llu;%llu\n",mlp->c_p, mlp->addr_in_problem, (long long unsigned int) ctx.lp_duration.rel_value, (long long unsigned int) ctx.mlp_duration.rel_value);
+ printf ("%u;%u;%llu;%llu\n",mlp->c_p, mlp->addr_in_problem, (unsigned long long) ctx.lp_duration.rel_value, (unsigned long long) ctx.mlp_duration.rel_value);
else
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Problem solved for %u peers with %u address successfully (LP: %llu ms / MLP: %llu ms)\n",
mlp->c_p, mlp->addr_in_problem, ctx.lp_duration.rel_value, ctx.mlp_duration.rel_value);
GNUNET_assert (GNUNET_OK == uctx.mlp_result);
if (GNUNET_YES == numeric)
printf ("%u;%u;%llu;%llu;%llu;%llu\n",mlp->c_p, mlp->addr_in_problem,
- (long long unsigned int) ctx.lp_duration.rel_value, (long long unsigned int) ctx.mlp_duration.rel_value,
- (long long unsigned int) uctx.lp_duration.rel_value, (long long unsigned int) uctx.mlp_duration.rel_value);
+ (unsigned long long) ctx.lp_duration.rel_value, (unsigned long long) ctx.mlp_duration.rel_value,
+ (unsigned long long) uctx.lp_duration.rel_value, (unsigned long long) uctx.mlp_duration.rel_value);
else
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Updated Problem solved for %u peers with %u address successfully (Initial: LP/MLP: %llu/%llu ms, Update: %llu/%llu ms)\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Updated problem solved for %u peers with %u address successfully (Initial: LP/MLP: %llu/%llu ms, Update: %llu/%llu ms)\n",
mlp->c_p, mlp->addr_in_problem,
- (long long unsigned int) ctx.lp_duration.rel_value, (long long unsigned int) ctx.mlp_duration.rel_value,
- (long long unsigned int) uctx.lp_duration.rel_value, (long long unsigned int) uctx.mlp_duration.rel_value);
+ (unsigned long long) ctx.lp_duration.rel_value, (unsigned long long) ctx.mlp_duration.rel_value,
+ (unsigned long long) uctx.lp_duration.rel_value, (unsigned long long) uctx.mlp_duration.rel_value);
}
else
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Solving updated problem with %u peers and %u addresses failed\n", c, c2);