struct AddressSolverInformation *asi;
struct GNUNET_TIME_Relative active_time;
struct GNUNET_TIME_Relative min_active_time;
- const double *norm_prop_cur;
- const double *norm_prop_best;
double best_delay;
double best_distance;
double cur_delay;
}
/* Now compare ATS information */
- norm_prop_cur = ctx->s->env->get_property (ctx->s->env->cls,
- current);
index = find_property_index (GNUNET_ATS_QUALITY_NET_DISTANCE);
- cur_distance = norm_prop_cur[index];
+ cur_distance = current->atsin[index].norm;
+ best_distance = ctx->best->atsin[index].norm;
index = find_property_index (GNUNET_ATS_QUALITY_NET_DELAY);
- cur_delay = norm_prop_cur[index];
-
- norm_prop_best = ctx->s->env->get_property (ctx->s->env->cls,
- ctx->best);
- index = find_property_index (GNUNET_ATS_QUALITY_NET_DISTANCE);
- best_distance = norm_prop_best[index];
- index = find_property_index (GNUNET_ATS_QUALITY_NET_DELAY);
- best_delay = norm_prop_best[index];
+ cur_delay = current->atsin[index].norm;
+ best_delay = ctx->best->atsin[index].norm;
/* user shorter distance */
if (cur_distance < best_distance)
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);
}
}
static void
GAS_proportional_address_property_changed (void *solver,
struct ATS_Address *address,
- uint32_t type,
+ enum GNUNET_ATS_Property type,
uint32_t abs_value,
double rel_value)
{
GNUNET_assert (NULL != env->cfg);
GNUNET_assert (NULL != env->bandwidth_changed_cb);
GNUNET_assert (NULL != env->get_preferences);
- GNUNET_assert (NULL != env->get_property);
s = GNUNET_new (struct GAS_PROPORTIONAL_Handle);
s->env = env;