aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_normalization.h
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-06-24 15:06:45 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-06-24 15:06:45 +0000
commit7ba01a86dfa31c8e4b97e099437fbbfba32d191b (patch)
tree9cba59bb369223f840dbc55cd68f1095c10ad92f /src/ats/gnunet-service-ats_normalization.h
parent1e007a89197769e4e0f5ad36b583689a27f33cac (diff)
downloadgnunet-7ba01a86dfa31c8e4b97e099437fbbfba32d191b.tar.gz
gnunet-7ba01a86dfa31c8e4b97e099437fbbfba32d191b.zip
implemented ats property normalization with callback to address
to do: recalculate min/max to prevent outdated max values have an impact on normalization
Diffstat (limited to 'src/ats/gnunet-service-ats_normalization.h')
-rw-r--r--src/ats/gnunet-service-ats_normalization.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ats/gnunet-service-ats_normalization.h b/src/ats/gnunet-service-ats_normalization.h
index 24b6b5051..75158ac72 100644
--- a/src/ats/gnunet-service-ats_normalization.h
+++ b/src/ats/gnunet-service-ats_normalization.h
@@ -41,6 +41,12 @@ typedef void
41 enum GNUNET_ATS_PreferenceKind kind, 41 enum GNUNET_ATS_PreferenceKind kind,
42 double pref_rel); 42 double pref_rel);
43 43
44typedef void
45(*GAS_Normalization_property_changed_cb) (void *cls,
46 const struct ATS_Address *peer,
47 uint32_t type,
48 double prop_rel);
49
44/** 50/**
45 * Get the normalized preference values for a specific peer 51 * Get the normalized preference values for a specific peer
46 * 52 *
@@ -59,12 +65,19 @@ GAS_normalization_get_preferences (const struct GNUNET_PeerIdentity *id);
59 * @param kind the kind to change the preference 65 * @param kind the kind to change the preference
60 * @param score_abs the normalized score 66 * @param score_abs the normalized score
61 */ 67 */
62float 68void
63GAS_normalization_normalize_preference (void *src, 69GAS_normalization_normalize_preference (void *src,
64 const struct GNUNET_PeerIdentity *peer, 70 const struct GNUNET_PeerIdentity *peer,
65 enum GNUNET_ATS_PreferenceKind kind, 71 enum GNUNET_ATS_PreferenceKind kind,
66 float score_abs); 72 float score_abs);
67 73
74/**
75 * Update and normalize a atsi performance information
76 *
77 * @param address the address to update
78 * @param atsi the array of performance information
79 * @param atsi_count the number of atsi information in the array
80 */
68void 81void
69GAS_normalization_normalize_property (struct ATS_Address *address, 82GAS_normalization_normalize_property (struct ATS_Address *address,
70 const struct GNUNET_ATS_Information *atsi, 83 const struct GNUNET_ATS_Information *atsi,
@@ -77,7 +90,10 @@ GAS_normalization_normalize_property (struct ATS_Address *address,
77 * @param pref_ch_cb_cls cls for the callback 90 * @param pref_ch_cb_cls cls for the callback
78 */ 91 */
79void 92void
80GAS_normalization_start (GAS_Normalization_preference_changed_cb pref_ch_cb, void *pref_ch_cb_cls); 93GAS_normalization_start (GAS_Normalization_preference_changed_cb pref_ch_cb,
94 void *pref_ch_cb_cls,
95 GAS_Normalization_property_changed_cb property_ch_ch_cls,
96 void *property_ch_cb_cls);
81 97
82 98
83/** 99/**