This file is part of GNUnet.
Copyright (C) 2010-2013 GNUnet e.V.
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Affero General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
* @file ats-tests/ats-testing-experiment.c
{
struct TestPeer *cur;
for (cur = peer_head; NULL != cur; cur = cur->next)
- if (0 == memcmp (&cur->peer_id, pid, sizeof (struct GNUNET_PeerIdentity)))
+ if (0 == GNUNET_memcmp (&cur->peer_id, pid))
return cur;
return NULL;
}
GNUNET_STRINGS_utf8_toupper (op_network,op_network);
if (0 == strcmp(op_network, "UNSPECIFIED"))
{
- o->address_network = GNUNET_ATS_NET_UNSPECIFIED;
+ o->address_network = GNUNET_NT_UNSPECIFIED;
}
else if (0 == strcmp(op_network, "LOOPBACK"))
{
- o->address_network = GNUNET_ATS_NET_LOOPBACK;
+ o->address_network = GNUNET_NT_LOOPBACK;
}
else if (0 == strcmp(op_network, "LAN"))
{
- o->address_network = GNUNET_ATS_NET_LAN;
+ o->address_network = GNUNET_NT_LAN;
}
else if (0 == strcmp(op_network, "WAN"))
{
- o->address_network = GNUNET_ATS_NET_WAN;
+ o->address_network = GNUNET_NT_WAN;
}
else if (0 == strcmp(op_network, "WLAN"))
{
- o->address_network = GNUNET_ATS_NET_WLAN;
+ o->address_network = GNUNET_NT_WLAN;
}
else if (0 == strcmp(op_network, "BT"))
{
- o->address_network = GNUNET_ATS_NET_BT;
+ o->address_network = GNUNET_NT_BT;
}
else
{
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Adding address %u for peer %u in network `%s'\n",
- op->address_id, op->peer_id, GNUNET_ATS_print_network_type(a->network));
+ op->address_id, op->peer_id, GNUNET_NT_to_string(a->network));
sh->sf->s_add (sh->sf->cls, a->ats_addr, op->address_network);
int c;
int res;
- for (c = 0; (c < GNUNET_ATS_NetworkTypeCount) && (c < dest_length); c++)
+ for (c = 0; (c < GNUNET_NT_COUNT) && (c < dest_length); c++)
{
in_dest[c] = 0;
out_dest[c] = 0;
GNUNET_asprintf (&entry_out,
"%s_QUOTA_OUT",
- GNUNET_ATS_print_network_type (c));
+ GNUNET_NT_to_string (c));
GNUNET_asprintf (&entry_in,
"%s_QUOTA_IN",
- GNUNET_ATS_print_network_type (c));
+ GNUNET_NT_to_string (c));
/* quota out */
if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_out, "a_out_str))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"),
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
quota_out_str,
GNUNET_ATS_DefaultBandwidth);
out_dest[c] = GNUNET_ATS_DefaultBandwidth;
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Outbound quota configure for network `%s' is %llu\n",
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
out_dest[c]);
}
GNUNET_free (quota_out_str);
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("No outbound quota configured for network `%s', assigning default bandwidth %llu\n"),
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
GNUNET_ATS_DefaultBandwidth);
out_dest[c] = GNUNET_ATS_DefaultBandwidth;
}
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"),
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
quota_in_str,
GNUNET_ATS_DefaultBandwidth);
in_dest[c] = GNUNET_ATS_DefaultBandwidth;
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Inbound quota configured for network `%s' is %llu\n",
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
in_dest[c]);
}
GNUNET_free (quota_in_str);
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("No outbound quota configure for network `%s', assigning default bandwidth %llu\n"),
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
GNUNET_ATS_DefaultBandwidth);
out_dest[c] = GNUNET_ATS_DefaultBandwidth;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Loaded quota for network `%s' (in/out): %llu %llu\n",
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
in_dest[c],
out_dest[c]);
GNUNET_free (entry_out);
GNUNET_free (entry_in);
}
- return GNUNET_ATS_NetworkTypeCount;
+ return GNUNET_NT_COUNT;
}
sh->env.addresses = sh->addresses;
sh->env.bandwidth_changed_cb = &solver_bandwidth_changed_cb;
sh->env.get_preferences = &get_preferences_cb;
- sh->env.network_count = GNUNET_ATS_NetworkTypeCount;
+ sh->env.network_count = GNUNET_NT_COUNT;
sh->env.info_cb = &solver_info_cb;
- sh->env.network_count = GNUNET_ATS_NetworkTypeCount;
+ sh->env.network_count = GNUNET_NT_COUNT;
/* start normalization */
GAS_normalization_start ();
/* load quotas */
- if (GNUNET_ATS_NetworkTypeCount != GNUNET_ATS_solvers_load_quotas (e->cfg,
- sh->env.out_quota, sh->env.in_quota, GNUNET_ATS_NetworkTypeCount))
+ if (GNUNET_NT_COUNT != GNUNET_ATS_solvers_load_quotas (e->cfg,
+ sh->env.out_quota, sh->env.in_quota, GNUNET_NT_COUNT))
{
GNUNET_break(0);
GNUNET_free (sh->plugin);
static struct GNUNET_GETOPT_CommandLineOption options[] =
{
- GNUNET_GETOPT_OPTION_STRING ('s',
+ GNUNET_GETOPT_option_string ('s',
"solver",
gettext_noop ("solver to use"),
&opt_solver),
- GNUNET_GETOPT_OPTION_STRING ('e',
+ GNUNET_GETOPT_option_string ('e',
"experiment"
gettext_noop ("experiment to use"),
&opt_exp_file),
- GNUNET_GETOPT_OPTION_VERBOSE (&opt_verbose),
+ GNUNET_GETOPT_option_verbose (&opt_verbose),
- GNUNET_GETOPT_OPTION_SET_ONE ('p',
+ GNUNET_GETOPT_option_flag ('p',
"print",
gettext_noop ("print logging"),
&opt_print),
- GNUNET_GETOPT_OPTION_SET_ONE ('f',
+ GNUNET_GETOPT_option_flag ('f',
"file",
gettext_noop ("save logging to disk"),
&opt_save),
- GNUNET_GETOPT_OPTION_SET_ONE ('d',
+ GNUNET_GETOPT_option_flag ('d',
"dn",
gettext_noop ("disable normalization"),
&opt_disable_normalization),