aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_normalization.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-11-19 14:48:18 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-11-19 14:48:18 +0000
commitb49684305e14208fa5bffb817a0677df33611878 (patch)
treebc3c83bb298edc39879d9a0c7bcc7cb761e25d66 /src/ats/gnunet-service-ats_normalization.c
parent77d5149378781178d0b216ef7898ff9ea562209e (diff)
downloadgnunet-b49684305e14208fa5bffb817a0677df33611878.tar.gz
gnunet-b49684305e14208fa5bffb817a0677df33611878.zip
get normalized pref per client
Diffstat (limited to 'src/ats/gnunet-service-ats_normalization.c')
-rw-r--r--src/ats/gnunet-service-ats_normalization.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c
index 96936332a..9a4e72665 100644
--- a/src/ats/gnunet-service-ats_normalization.c
+++ b/src/ats/gnunet-service-ats_normalization.c
@@ -519,6 +519,30 @@ GAS_normalization_get_preferences_by_peer (const struct GNUNET_PeerIdentity *id)
519} 519}
520 520
521/** 521/**
522 * Get the normalized preference values for a specific peer or
523 * the default values if
524 *
525 * @param id the peer
526 * @return pointer to the values, can be indexed with GNUNET_ATS_PreferenceKind,
527 * default preferences if peer does not exist
528 */
529const double
530GAS_normalization_get_preferences_by_client (const void *client, enum GNUNET_ATS_PreferenceKind pref)
531{
532 struct PreferenceClient *c_cur;
533 /* Find preference client */
534 for (c_cur = pc_head; NULL != c_cur; c_cur = c_cur->next)
535 {
536 if (client == c_cur->client)
537 break;
538 }
539 if (NULL == c_cur)
540 return -1;
541
542 return 1.0;
543}
544
545/**
522 * Get the normalized properties values for a specific peer or 546 * Get the normalized properties values for a specific peer or
523 * the default values if 547 * the default values if
524 * 548 *
@@ -922,8 +946,6 @@ GAS_normalization_stop ()
922{ 946{
923 struct PreferenceClient *pc; 947 struct PreferenceClient *pc;
924 struct PreferenceClient *next_pc; 948 struct PreferenceClient *next_pc;
925 struct PreferencePeer *p;
926 struct PreferencePeer *next_p;
927 949
928 if (GNUNET_SCHEDULER_NO_TASK != aging_task) 950 if (GNUNET_SCHEDULER_NO_TASK != aging_task)
929 { 951 {