diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-17 07:57:10 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-17 07:57:10 +0000 |
commit | e9bf1ce50673a6876bc21d347f9dc089e04b585f (patch) | |
tree | 74788c486314d0390803d7c98116225846697786 /src/ats | |
parent | f2a6d23481773c7a3b4422f3a346706e5f014543 (diff) | |
download | gnunet-e9bf1ce50673a6876bc21d347f9dc089e04b585f.tar.gz gnunet-e9bf1ce50673a6876bc21d347f9dc089e04b585f.zip |
- update
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/Makefile.am | 2 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 2 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_mlp.c | 4 | ||||
-rw-r--r-- | src/ats/perf_ats_mlp.c | 37 |
4 files changed, 32 insertions, 13 deletions
diff --git a/src/ats/Makefile.am b/src/ats/Makefile.am index f4056fa66..d8c7e8688 100644 --- a/src/ats/Makefile.am +++ b/src/ats/Makefile.am | |||
@@ -87,7 +87,7 @@ perf_ats_mlp_SOURCES = \ | |||
87 | perf_ats_mlp_LDADD = \ | 87 | perf_ats_mlp_LDADD = \ |
88 | $(GN_LIBGLPK) \ | 88 | $(GN_LIBGLPK) \ |
89 | $(top_builddir)/src/util/libgnunetutil.la \ | 89 | $(top_builddir)/src/util/libgnunetutil.la \ |
90 | $(top_builddir)/src/statistics/libgnunetstatistics.la | 90 | $(top_builddir)/src/statistics/libgnunetstatistics.la |
91 | endif | 91 | endif |
92 | 92 | ||
93 | test_ats_api_scheduling_SOURCES = \ | 93 | test_ats_api_scheduling_SOURCES = \ |
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index 6ed625bf4..ca161d6b9 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -748,7 +748,7 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
748 | 748 | ||
749 | 749 | ||
750 | mode = GNUNET_CONFIGURATION_get_value_yesno (cfg, "ats", "MLP"); | 750 | mode = GNUNET_CONFIGURATION_get_value_yesno (cfg, "ats", "MLP"); |
751 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "MLP mode %u", mode); | 751 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MLP mode %u", mode); |
752 | switch (mode) | 752 | switch (mode) |
753 | { | 753 | { |
754 | /* MLP = YES */ | 754 | /* MLP = YES */ |
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.c b/src/ats/gnunet-service-ats_addresses_mlp.c index e111dae95..21604edad 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.c +++ b/src/ats/gnunet-service-ats_addresses_mlp.c | |||
@@ -1341,7 +1341,11 @@ update_quality (struct GAS_MLP_Handle *mlp, struct ATS_Address * address) | |||
1341 | { | 1341 | { |
1342 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating quality metrics for peer `%s'\n", | 1342 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating quality metrics for peer `%s'\n", |
1343 | GNUNET_i2s (&address->peer)); | 1343 | GNUNET_i2s (&address->peer)); |
1344 | |||
1345 | GNUNET_assert (NULL != address); | ||
1346 | GNUNET_assert (NULL != address->mlp_information); | ||
1344 | GNUNET_assert (NULL != address->ats); | 1347 | GNUNET_assert (NULL != address->ats); |
1348 | |||
1345 | struct MLP_information *mlpi = address->mlp_information; | 1349 | struct MLP_information *mlpi = address->mlp_information; |
1346 | struct GNUNET_ATS_Information *ats = address->ats; | 1350 | struct GNUNET_ATS_Information *ats = address->ats; |
1347 | GNUNET_assert (mlpi != NULL); | 1351 | GNUNET_assert (mlpi != NULL); |
diff --git a/src/ats/perf_ats_mlp.c b/src/ats/perf_ats_mlp.c index 0d261374b..b87bf21f0 100644 --- a/src/ats/perf_ats_mlp.c +++ b/src/ats/perf_ats_mlp.c | |||
@@ -100,31 +100,46 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
100 | mlp->auto_solve = GNUNET_NO; | 100 | mlp->auto_solve = GNUNET_NO; |
101 | for (c=0; c < peers; c++) | 101 | for (c=0; c < peers; c++) |
102 | { | 102 | { |
103 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Setting up peer %u\n", c); | ||
103 | GNUNET_CRYPTO_hash_create_random(GNUNET_CRYPTO_QUALITY_WEAK, &p[c].id.hashPubKey); | 104 | GNUNET_CRYPTO_hash_create_random(GNUNET_CRYPTO_QUALITY_WEAK, &p[c].id.hashPubKey); |
104 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "peer %s\n", GNUNET_h2s_full(&p[c].id.hashPubKey)); | ||
105 | 105 | ||
106 | for (c2=0; c2 < addresses; c2++) | 106 | for (c2=0; c2 < addresses; c2++) |
107 | { | 107 | { |
108 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Setting up address %u for peer %u\n", c2, c); | ||
109 | a[ca].mlp_information = NULL; | ||
108 | a[ca].peer = p[c].id; | 110 | a[ca].peer = p[c].id; |
109 | a[ca].plugin = strdup("test"); | 111 | a[ca].plugin = strdup("test"); |
110 | a[ca].addr = GNUNET_HELLO_address_allocate(&a[ca].peer, a[ca].plugin, NULL, 0); | 112 | //a[ca].addr = GNUNET_HELLO_address_allocate(&a[ca].peer, a[ca].plugin, NULL, 0); |
111 | a[ca].addr_len = GNUNET_HELLO_address_get_size(a[ca].addr); | 113 | //a[ca].addr_len = GNUNET_HELLO_address_get_size(a[ca].addr); |
112 | a[ca].ats = NULL; | 114 | a[ca].ats = GNUNET_malloc (2 * sizeof (struct GNUNET_ATS_Information)); |
115 | a[ca].ats[0].type = GNUNET_ATS_QUALITY_NET_DELAY; | ||
116 | a[ca].ats[0].value = 20; | ||
117 | a[ca].ats[1].type = GNUNET_ATS_QUALITY_NET_DISTANCE; | ||
118 | a[ca].ats[1].value = 2; | ||
119 | a[ca].ats_count = 2; | ||
120 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Setting up address %u\n", ca); | ||
113 | ca++; | 121 | ca++; |
114 | GAS_mlp_address_update(mlp, amap, &a[c2]); | 122 | /* |
123 | GNUNET_CONTAINER_multihashmap_put (amap, &a[ca].peer.hashPubKey, &a[ca], GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | ||
124 | GAS_mlp_address_update(mlp, amap, &a[ca]); | ||
125 | */ | ||
115 | } | 126 | } |
127 | |||
116 | } | 128 | } |
117 | 129 | ||
118 | GAS_mlp_solve_problem(mlp); | 130 | |
131 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Problem contains %u peers and %u adresses\n", mlp->c_p, mlp->addr_in_problem); | ||
132 | /* Solving the problem */ | ||
133 | //GAS_mlp_solve_problem(mlp); | ||
119 | 134 | ||
120 | 135 | ||
121 | GAS_mlp_done (mlp); | 136 | //GAS_mlp_done (mlp); |
122 | 137 | ||
123 | for (c2=0; c2 < (peers * addresses); c2++) | 138 | for (ca=0; ca < (peers * addresses); ca++) |
124 | { | 139 | { |
125 | GNUNET_free (a[c2].plugin); | 140 | GNUNET_free (a[ca].plugin); |
126 | GNUNET_free (a[c2].addr); | 141 | GNUNET_free (a[ca].ats); |
127 | // GAS_mlp_address_update(mlp, amap, &a[c2]); | 142 | // GNUNET_free ((void *) a[c2].addr); |
128 | } | 143 | } |
129 | 144 | ||
130 | ret = 0; | 145 | ret = 0; |