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
*/
/**
/* Row indices quality metrics */
int r_q[RQ_QUALITY_METRIC_COUNT];
/* Row indices ATS network quotas */
- int r_quota[GNUNET_ATS_NetworkTypeCount];
+ int r_quota[GNUNET_NT_COUNT];
/* Column index Diversity (D) column */
int c_d;
/* Quotas */
/* Array mapping array index to ATS network */
- int quota_index[GNUNET_ATS_NetworkTypeCount];
+ int quota_index[GNUNET_NT_COUNT];
/* Outbound quotas */
- unsigned long long quota_out[GNUNET_ATS_NetworkTypeCount];
+ unsigned long long quota_out[GNUNET_NT_COUNT];
/* Inbound quotas */
- unsigned long long quota_in[GNUNET_ATS_NetworkTypeCount];
+ unsigned long long quota_in[GNUNET_NT_COUNT];
/* ATS ressource costs
* array with GNUNET_ATS_QualityPropertiesCount elements
mlp->p.r_c9 = MLP_UNDEFINED;
for (c = 0; c < RQ_QUALITY_METRIC_COUNT ; c ++)
mlp->p.r_q[c] = MLP_UNDEFINED;
- for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c ++)
+ for (c = 0; c < GNUNET_NT_COUNT; c ++)
mlp->p.r_quota[c] = MLP_UNDEFINED;
mlp->p.ci = MLP_UNDEFINED;
}
addr_net = address->properties.scope;
- for (addr_net_index = 0; addr_net_index < GNUNET_ATS_NetworkTypeCount; addr_net_index++)
+ for (addr_net_index = 0; addr_net_index < GNUNET_NT_COUNT; addr_net_index++)
{
if (mlp->pv.quota_index[addr_net_index] == addr_net)
break;
}
- if (addr_net_index >= GNUNET_ATS_NetworkTypeCount)
+ if (addr_net_index >= GNUNET_NT_COUNT)
{
GNUNET_break (0);
return GNUNET_OK;
}
max_quota = 0;
- for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++)
+ for (c = 0; c < GNUNET_NT_COUNT; c++)
{
if (mlp->pv.quota_out[c] > max_quota)
max_quota = mlp->pv.quota_out[c];
p->r_c4 = mlp_create_problem_create_constraint (p, "c4", GLP_LO, (mlp->pv.n_min > p->num_peers) ? p->num_peers : mlp->pv.n_min, 0.0);
/* Rows for c 10) Enforce network quotas */
- for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++)
+ for (c = 0; c < GNUNET_NT_COUNT; c++)
{
char * text;
GNUNET_asprintf(&text, "c10_quota_ats_%s",
- GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]));
+ GNUNET_NT_to_string(mlp->pv.quota_index[c]));
p->r_quota[c] = mlp_create_problem_create_constraint (p, text, GLP_DB, 0.0, mlp->pv.quota_out[c]);
GNUNET_free (text);
}
mlpi->b_in = mlp_bw_in;
address->assigned_bw_out = mlp_bw_out;
mlpi->b_out = mlp_bw_out;
- if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer))))
+ if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer)))
mlp->env->bandwidth_changed_cb (mlp->env->cls, address);
return GNUNET_OK;
}
mlpi->b_in = mlp_bw_in;
address->assigned_bw_out = mlp_bw_out;
mlpi->b_out = mlp_bw_out;
- if ((NULL == mlp->exclude_peer) || (0 != memcmp (&address->peer, mlp->exclude_peer, sizeof (address->peer))))
+ if ((NULL == mlp->exclude_peer) || (0 != GNUNET_memcmp (&address->peer, mlp->exclude_peer)))
mlp->env->bandwidth_changed_cb (mlp->env->cls, address);
return GNUNET_OK;
}
{
struct GAS_MLP_Handle *mlp = solver;
- if (GNUNET_ATS_NetworkTypeCount <= network)
+ if (GNUNET_NT_COUNT <= network)
{
GNUNET_break (0);
return;
n_min = MLP_DEFAULT_MIN_CONNECTIONS;
/* Init network quotas */
- for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++)
+ for (c = 0; c < GNUNET_NT_COUNT; c++)
{
mlp->pv.quota_index[c] = c;
mlp->pv.quota_out[c] = env->out_quota[c];
LOG (GNUNET_ERROR_TYPE_INFO,
"Quota for network `%s' (in/out) %llu/%llu\n",
- GNUNET_ATS_print_network_type (c),
+ GNUNET_NT_to_string (c),
mlp->pv.quota_out[c],
mlp->pv.quota_in[c]);
/* Check if defined quota could make problem unsolvable */
{
LOG (GNUNET_ERROR_TYPE_INFO,
_("Adjusting inconsistent outbound quota configuration for network `%s', is %llu must be at least %llu\n"),
- GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]),
+ GNUNET_NT_to_string(mlp->pv.quota_index[c]),
mlp->pv.quota_out[c],
(n_min * b_min));
mlp->pv.quota_out[c] = (n_min * b_min);
{
LOG (GNUNET_ERROR_TYPE_INFO,
_("Adjusting inconsistent inbound quota configuration for network `%s', is %llu must be at least %llu\n"),
- GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]),
+ GNUNET_NT_to_string(mlp->pv.quota_index[c]),
mlp->pv.quota_in[c],
(n_min * b_min));
mlp->pv.quota_in[c] = (n_min * b_min);
{
LOG (GNUNET_ERROR_TYPE_INFO,
_("Adjusting outbound quota configuration for network `%s'from %llu to %.0f\n"),
- GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]),
+ GNUNET_NT_to_string(mlp->pv.quota_index[c]),
mlp->pv.quota_out[c],
mlp->pv.BIG_M);
mlp->pv.quota_out[c] = mlp->pv.BIG_M ;
{
LOG (GNUNET_ERROR_TYPE_INFO,
_("Adjusting inbound quota configuration for network `%s' from %llu to %.0f\n"),
- GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]),
+ GNUNET_NT_to_string(mlp->pv.quota_index[c]),
mlp->pv.quota_in[c],
mlp->pv.BIG_M);
mlp->pv.quota_in[c] = mlp->pv.BIG_M ;