/*
This file is part of GNUnet.
- (C) 2010,2011 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010,2011 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
static void
create_address (struct ATS_Address *addr, char * plugin, int ats_count, struct GNUNET_ATS_Information *ats)
{
- addr->mlp_information = NULL;
+ addr->solver_information = NULL;
addr->next = NULL;
addr->prev = NULL;
addr->plugin = GNUNET_strdup (plugin);
{
in_dest[c] = UINT32_MAX;
}
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Loaded quota: %s %u, %s %u\n", entry_in, in_dest[c], entry_out, out_dest[c]);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Loaded quota: %s %u, %s %u\n", entry_in, in_dest[c], entry_out, out_dest[c]);
}
return GNUNET_ATS_NetworkTypeCount;
return;
#endif
struct ATS_Address addr[10];
- struct ATS_PreferedAddress *res[10];
+ struct ATS_Address *res[10];
int quotas[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkType;
unsigned long long quotas_in[GNUNET_ATS_NetworkTypeCount];
unsigned long long quotas_out[GNUNET_ATS_NetworkTypeCount];
// mlpi = addr[0].mlp_information;
GNUNET_assert (mlp != NULL);
- GNUNET_assert (mlp->addr_in_problem == 1);
+ GNUNET_assert (mlp->addresses_in_problem == 1);
/* Update an peer 1 address 1 */
set_ats (&a1_ats[1], GNUNET_ATS_QUALITY_NET_DELAY, 20);
GAS_mlp_address_update (mlp, addresses, &addr[0]);
- GNUNET_assert (mlp->addr_in_problem == 1);
+ GNUNET_assert (mlp->addresses_in_problem == 1);
/* Update an peer 1 address 1 */
set_ats (&a1_ats[1], GNUNET_ATS_QUALITY_NET_DELAY, 10);
GAS_mlp_address_update (mlp, addresses, &addr[0]);
- GNUNET_assert (mlp->addr_in_problem == 1);
+ GNUNET_assert (mlp->addresses_in_problem == 1);
/* Update an peer 1 address 1 */
set_ats (&a1_ats[1], GNUNET_ATS_QUALITY_NET_DELAY, 10);
GAS_mlp_address_update (mlp, addresses, &addr[0]);
- GNUNET_assert (mlp->addr_in_problem == 1);
+ GNUNET_assert (mlp->addresses_in_problem == 1);
/* Update an peer 1 address 1 */
set_ats (&a1_ats[1], GNUNET_ATS_QUALITY_NET_DELAY, 30);
GAS_mlp_address_update (mlp, addresses, &addr[0]);
- GNUNET_assert (mlp->addr_in_problem == 1);
+ GNUNET_assert (mlp->addresses_in_problem == 1);
GNUNET_assert (GNUNET_OK == GAS_mlp_solve_problem(mlp, &ctx));
GNUNET_assert (GNUNET_OK == ctx.mlp_result);
res[0] = GAS_mlp_get_preferred_address(mlp, addresses, &p[0]);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Preferred address `%s' outbound bandwidth: %u Bps\n",res[0]->address->plugin, res[0]->bandwidth_out);
- GNUNET_free (res[0]);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Preferred address `%s' outbound bandwidth: %u Bps\n",
+ res[0]->plugin,
+ (unsigned int) ntohl (res[0]->assigned_bw_out.value__));
/* Delete an address */
GNUNET_CONTAINER_multihashmap_remove (addresses, &addr[0].peer.hashPubKey, &addr[0]);
GAS_mlp_address_delete (mlp, addresses, &addr[0]);
- GNUNET_assert (mlp->addr_in_problem == 0);
+ GNUNET_assert (mlp->addresses_in_problem == 0);
GAS_mlp_done (mlp);
GNUNET_STATISTICS_destroy(stats, GNUNET_NO);
ret = 0;
- return;
}