aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorxrs <xrs@mail36.net>2018-06-25 16:53:01 +0200
committerxrs <xrs@mail36.net>2018-06-25 16:53:01 +0200
commitb96052f1d3b8bb05f1868bd809fcb6e4f6569a4c (patch)
treed70c5939cc99d43e29ce63a4faa9ef334de0c81d /src
parent8405df1e1968b92d38e8bcebeee1471444410d97 (diff)
parent1c9e2fc460acce152ab6374b14b1e231ac455f57 (diff)
downloadgnunet-b96052f1d3b8bb05f1868bd809fcb6e4f6569a4c.tar.gz
gnunet-b96052f1d3b8bb05f1868bd809fcb6e4f6569a4c.zip
Merge branch 'master' of ssh://gnunet.org/gnunet
Diffstat (limited to 'src')
-rw-r--r--src/arm/test_arm_api_data.conf2
-rw-r--r--src/ats/ats_api_performance.c8
-rw-r--r--src/ats/plugin_ats_mlp.c1
-rw-r--r--src/ats/plugin_ats_proportional.c2
-rw-r--r--src/cadet/cadet_test_lib.c5
-rw-r--r--src/cadet/gnunet-cadet.c5
-rw-r--r--src/core/test_core_api_data.conf2
-rw-r--r--src/core/test_core_api_send_to_self.conf2
-rw-r--r--src/datastore/plugin_datastore_sqlite.c3
-rw-r--r--src/dv/test_transport_blacklist_data.conf2
-rw-r--r--src/dv/test_transport_dv_data.conf2
-rw-r--r--src/fs/fs_api.c2
-rw-r--r--src/fs/gnunet-service-fs_pr.c2
-rw-r--r--src/fs/test_fs_defaults.conf2
-rw-r--r--src/gns/gnunet-gns-proxy.c2
-rw-r--r--src/gns/gnunet-service-gns_interceptor.c2
-rw-r--r--src/gns/nss/nss_gns.c2
-rw-r--r--src/gnsrecord/gnsrecord_serialization.c35
-rw-r--r--src/include/gnunet_common.h6
-rw-r--r--src/multicast/gnunet-service-multicast.c6
-rw-r--r--src/namecache/gnunet-service-namecache.c19
-rw-r--r--src/namecache/namecache_api.c8
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow.c2
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow_filter.c2
-rw-r--r--src/namestore/test_namestore_api_sqlite.conf1
-rw-r--r--src/nat/test_nat_test_data.conf2
-rw-r--r--src/rps/gnunet-rps-profiler.c27
-rw-r--r--src/rps/gnunet-rps.c12
-rw-r--r--src/rps/rps-test_util.c5
-rw-r--r--src/rps/test_rps.conf23
-rw-r--r--src/template/template.conf6
-rw-r--r--src/testbed/test_testbed_api_statistics.conf2
-rw-r--r--src/testbed/testbed_api_topology.c4
-rw-r--r--src/testing/test_testing_sharedservices.conf2
-rw-r--r--src/transport/test_plugin_transport_data.conf18
-rw-r--r--src/transport/test_quota_compliance_data.conf12
-rw-r--r--src/transport/test_quota_compliance_http_asymmetric_peer1.conf10
-rw-r--r--src/transport/test_quota_compliance_http_asymmetric_peer2.conf12
-rw-r--r--src/transport/test_quota_compliance_http_peer1.conf10
-rw-r--r--src/transport/test_quota_compliance_http_peer2.conf12
-rw-r--r--src/transport/test_quota_compliance_https_asymmetric_peer1.conf10
-rw-r--r--src/transport/test_quota_compliance_https_asymmetric_peer2.conf12
-rw-r--r--src/transport/test_quota_compliance_https_peer1.conf10
-rw-r--r--src/transport/test_quota_compliance_https_peer2.conf12
-rw-r--r--src/transport/test_quota_compliance_tcp_asymmetric_peer1.conf14
-rw-r--r--src/transport/test_quota_compliance_tcp_peer1.conf14
-rw-r--r--src/transport/test_quota_compliance_udp_peer1.conf12
-rw-r--r--src/transport/test_quota_compliance_udp_peer2.conf12
-rw-r--r--src/transport/test_quota_compliance_unix_asymmetric_peer1.conf12
-rw-r--r--src/transport/test_quota_compliance_unix_asymmetric_peer2.conf12
-rw-r--r--src/transport/test_quota_compliance_unix_peer1.conf10
-rw-r--r--src/transport/test_quota_compliance_unix_peer2.conf12
-rw-r--r--src/transport/test_transport_api_data.conf4
-rw-r--r--src/transport/test_transport_api_reliability_tcp_nat_peer1.conf2
-rw-r--r--src/transport/test_transport_api_tcp_nat_peer1.conf2
-rw-r--r--src/util/Makefile.am3
-rw-r--r--src/util/common_logging.c4
-rw-r--r--src/util/disk.c21
-rw-r--r--src/util/gnunet-service-resolver.c269
-rw-r--r--src/util/resolver.h27
-rw-r--r--src/util/resolver_api.c37
-rw-r--r--src/util/test_resolver_api.c2
62 files changed, 569 insertions, 226 deletions
diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf
index 276b313b7..fef6cfb40 100644
--- a/src/arm/test_arm_api_data.conf
+++ b/src/arm/test_arm_api_data.conf
@@ -16,7 +16,7 @@ PORT = 23355
16 16
17[do-nothing] 17[do-nothing]
18START_ON_DEMAND = NO 18START_ON_DEMAND = NO
19PORT = 2223 19PORT = 48223
20HOSTNAME = localhost 20HOSTNAME = localhost
21BINARY = /will/be/overwritten/by/test_exponential_backoff 21BINARY = /will/be/overwritten/by/test_exponential_backoff
22ACCEPT_FROM = 127.0.0.1; 22ACCEPT_FROM = 127.0.0.1;
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index caa1da034..0c196ea43 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -849,7 +849,7 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p
849 count = 0; 849 count = 0;
850 va_start(ap, peer); 850 va_start(ap, peer);
851 while (GNUNET_ATS_PREFERENCE_END != 851 while (GNUNET_ATS_PREFERENCE_END !=
852 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 852 (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
853 { 853 {
854 switch (kind) 854 switch (kind)
855 { 855 {
@@ -875,7 +875,7 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p
875 count = 0; 875 count = 0;
876 va_start(ap, peer); 876 va_start(ap, peer);
877 while (GNUNET_ATS_PREFERENCE_END != (kind = 877 while (GNUNET_ATS_PREFERENCE_END != (kind =
878 va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 878 GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
879 { 879 {
880 pi[count].preference_kind = htonl (kind); 880 pi[count].preference_kind = htonl (kind);
881 switch (kind) 881 switch (kind)
@@ -927,7 +927,7 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
927 count = 0; 927 count = 0;
928 va_start(ap, scope); 928 va_start(ap, scope);
929 while (GNUNET_ATS_PREFERENCE_END != 929 while (GNUNET_ATS_PREFERENCE_END !=
930 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 930 (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
931 { 931 {
932 switch (kind) 932 switch (kind)
933 { 933 {
@@ -954,7 +954,7 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
954 count = 0; 954 count = 0;
955 va_start(ap, scope); 955 va_start(ap, scope);
956 while (GNUNET_ATS_PREFERENCE_END != (kind = 956 while (GNUNET_ATS_PREFERENCE_END != (kind =
957 va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 957 GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
958 { 958 {
959 pi[count].preference_kind = htonl (kind); 959 pi[count].preference_kind = htonl (kind);
960 switch (kind) 960 switch (kind)
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c
index 7e7594f90..544b8d97f 100644
--- a/src/ats/plugin_ats_mlp.c
+++ b/src/ats/plugin_ats_mlp.c
@@ -1554,6 +1554,7 @@ GAS_mlp_solve_problem (void *solver)
1554 struct GNUNET_TIME_Relative dur_mlp; 1554 struct GNUNET_TIME_Relative dur_mlp;
1555 1555
1556 GNUNET_assert(NULL != solver); 1556 GNUNET_assert(NULL != solver);
1557 dur_lp = GNUNET_TIME_UNIT_ZERO;
1557 1558
1558 if (GNUNET_YES == mlp->stat_bulk_lock) 1559 if (GNUNET_YES == mlp->stat_bulk_lock)
1559 { 1560 {
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c
index b4ca70dc7..08fb7a9a7 100644
--- a/src/ats/plugin_ats_proportional.c
+++ b/src/ats/plugin_ats_proportional.c
@@ -1005,7 +1005,7 @@ GAS_proportional_address_property_changed (void *solver,
1005static void 1005static void
1006GAS_proportional_address_add (void *solver, 1006GAS_proportional_address_add (void *solver,
1007 struct ATS_Address *address, 1007 struct ATS_Address *address,
1008 enum GNUNET_ATS_Network_Type network) 1008 uint32_t network)
1009{ 1009{
1010 struct GAS_PROPORTIONAL_Handle *s = solver; 1010 struct GAS_PROPORTIONAL_Handle *s = solver;
1011 struct Network *net; 1011 struct Network *net;
diff --git a/src/cadet/cadet_test_lib.c b/src/cadet/cadet_test_lib.c
index 760378c89..1a1c15f48 100644
--- a/src/cadet/cadet_test_lib.c
+++ b/src/cadet/cadet_test_lib.c
@@ -135,6 +135,11 @@ cadet_connect_adapter (void *cls,
135 struct GNUNET_CADET_Handle *h; 135 struct GNUNET_CADET_Handle *h;
136 136
137 h = GNUNET_CADET_connect (cfg); 137 h = GNUNET_CADET_connect (cfg);
138 if (NULL == h)
139 {
140 GNUNET_break(0);
141 return NULL;
142 }
138 if (NULL == ctx->ports) 143 if (NULL == ctx->ports)
139 return h; 144 return h;
140 actx->ports = GNUNET_new_array (ctx->port_count, 145 actx->ports = GNUNET_new_array (ctx->port_count,
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index 04a595a7b..ed297196e 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -196,6 +196,11 @@ shutdown_task (void *cls)
196{ 196{
197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
198 "Shutdown\n"); 198 "Shutdown\n");
199 if (NULL != lp)
200 {
201 GNUNET_CADET_close_port (lp);
202 lp = NULL;
203 }
199 if (NULL != ch) 204 if (NULL != ch)
200 { 205 {
201 GNUNET_CADET_channel_destroy (ch); 206 GNUNET_CADET_channel_destroy (ch);
diff --git a/src/core/test_core_api_data.conf b/src/core/test_core_api_data.conf
index a13cc8706..420849ba9 100644
--- a/src/core/test_core_api_data.conf
+++ b/src/core/test_core_api_data.conf
@@ -6,6 +6,6 @@ WAN_QUOTA_IN = 64 kiB
6WAN_QUOTA_OUT = 64 kiB 6WAN_QUOTA_OUT = 64 kiB
7 7
8[core] 8[core]
9PORT = 2092 9PORT = 52092
10UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-core.sock 10UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-core.sock
11 11
diff --git a/src/core/test_core_api_send_to_self.conf b/src/core/test_core_api_send_to_self.conf
index ad6d4dc60..c2a459bb9 100644
--- a/src/core/test_core_api_send_to_self.conf
+++ b/src/core/test_core_api_send_to_self.conf
@@ -8,7 +8,7 @@ WAN_QUOTA_OUT = 104757600
8 8
9[test-sts] 9[test-sts]
10IMMEDIATE_START = YES 10IMMEDIATE_START = YES
11PORT = 9252 11PORT = 59252
12HOSTNAME = localhost 12HOSTNAME = localhost
13BINARY = test_core_api_send_to_self 13BINARY = test_core_api_send_to_self
14ACCEPT_FROM = 127.0.0.1; 14ACCEPT_FROM = 127.0.0.1;
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index 80960c676..fc1706400 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -855,9 +855,10 @@ sqlite_plugin_get_zero_anonymity (void *cls,
855 void *proc_cls) 855 void *proc_cls)
856{ 856{
857 struct Plugin *plugin = cls; 857 struct Plugin *plugin = cls;
858 uint32_t type32 = type;
858 struct GNUNET_SQ_QueryParam params[] = { 859 struct GNUNET_SQ_QueryParam params[] = {
859 GNUNET_SQ_query_param_uint64 (&next_uid), 860 GNUNET_SQ_query_param_uint64 (&next_uid),
860 GNUNET_SQ_query_param_uint32 (&type), 861 GNUNET_SQ_query_param_uint32 (&type32),
861 GNUNET_SQ_query_param_end 862 GNUNET_SQ_query_param_end
862 }; 863 };
863 864
diff --git a/src/dv/test_transport_blacklist_data.conf b/src/dv/test_transport_blacklist_data.conf
index 534a61849..ea55a196b 100644
--- a/src/dv/test_transport_blacklist_data.conf
+++ b/src/dv/test_transport_blacklist_data.conf
@@ -1,5 +1,5 @@
1@INLINE@ template_dv.conf 1@INLINE@ template_dv.conf
2 2
3[transport] 3[transport]
4PORT = 2565 4PORT = 52565
5PLUGINS = tcp 5PLUGINS = tcp
diff --git a/src/dv/test_transport_dv_data.conf b/src/dv/test_transport_dv_data.conf
index 307921ac4..a21fba8a7 100644
--- a/src/dv/test_transport_dv_data.conf
+++ b/src/dv/test_transport_dv_data.conf
@@ -1,7 +1,7 @@
1@INLINE@ template_dv.conf 1@INLINE@ template_dv.conf
2 2
3[transport] 3[transport]
4PORT = 2565 4PORT = 52565
5PLUGINS = tcp dv 5PLUGINS = tcp dv
6#PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high 6#PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high
7 7
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 0857110b1..9b783ba93 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -3112,7 +3112,7 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
3112 ret->max_parallel_requests = DEFAULT_MAX_PARALLEL_REQUESTS; 3112 ret->max_parallel_requests = DEFAULT_MAX_PARALLEL_REQUESTS;
3113 ret->avg_block_latency = GNUNET_TIME_UNIT_MINUTES; /* conservative starting point */ 3113 ret->avg_block_latency = GNUNET_TIME_UNIT_MINUTES; /* conservative starting point */
3114 va_start (ap, flags); 3114 va_start (ap, flags);
3115 while (GNUNET_FS_OPTIONS_END != (opt = va_arg (ap, enum GNUNET_FS_OPTIONS))) 3115 while (GNUNET_FS_OPTIONS_END != (opt = GNUNET_VA_ARG_ENUM (ap,GNUNET_FS_OPTIONS)))
3116 { 3116 {
3117 switch (opt) 3117 switch (opt)
3118 { 3118 {
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 8c431532f..f1a115cb6 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1601,7 +1601,7 @@ called_from_on_demand:
1601 GNUNET_BLOCK_get_key (GSF_block_ctx, type, data, size, &query)) 1601 GNUNET_BLOCK_get_key (GSF_block_ctx, type, data, size, &query))
1602 { 1602 {
1603 GNUNET_break (0); 1603 GNUNET_break (0);
1604 GNUNET_DATASTORE_remove (GSF_dsh, key, size, data, -1, -1, 1604 GNUNET_DATASTORE_remove (GSF_dsh, key, size, data, UINT_MAX, UINT_MAX,
1605 NULL, NULL); 1605 NULL, NULL);
1606 start_local_query (pr, 1606 start_local_query (pr,
1607 uid + 1 /* next_uid */, 1607 uid + 1 /* next_uid */,
diff --git a/src/fs/test_fs_defaults.conf b/src/fs/test_fs_defaults.conf
index 42661b25d..6ead78257 100644
--- a/src/fs/test_fs_defaults.conf
+++ b/src/fs/test_fs_defaults.conf
@@ -21,7 +21,7 @@ QUOTA = 100 MB
21 21
22[transport-tcp] 22[transport-tcp]
23BINDTO = 127.0.0.1 23BINDTO = 127.0.0.1
24PORT = 4368 24PORT = 54368
25 25
26[peerinfo] 26[peerinfo]
27NO_IO = YES 27NO_IO = YES
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 08450d995..d66f5c658 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1948,7 +1948,7 @@ create_response (void *cls,
1948 s5r); 1948 s5r);
1949 { 1949 {
1950 const char *us; 1950 const char *us;
1951 long upload_size; 1951 long upload_size = 0;
1952 1952
1953 us = MHD_lookup_connection_value (con, 1953 us = MHD_lookup_connection_value (con,
1954 MHD_HEADER_KIND, 1954 MHD_HEADER_KIND,
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c
index ecf4d59f5..42f3e1514 100644
--- a/src/gns/gnunet-service-gns_interceptor.c
+++ b/src/gns/gnunet-service-gns_interceptor.c
@@ -103,7 +103,7 @@ reply_to_dns (void *cls, uint32_t rd_count,
103 unsigned int num_answers; 103 unsigned int num_answers;
104 unsigned int skip_answers; 104 unsigned int skip_answers;
105 unsigned int skip_additional; 105 unsigned int skip_additional;
106 size_t off; 106 size_t off = 0;
107 107
108 /* Put records in the DNS packet */ 108 /* Put records in the DNS packet */
109 num_answers = 0; 109 num_answers = 0;
diff --git a/src/gns/nss/nss_gns.c b/src/gns/nss/nss_gns.c
index 03ac6e09c..9c9233d35 100644
--- a/src/gns/nss/nss_gns.c
+++ b/src/gns/nss/nss_gns.c
@@ -157,7 +157,7 @@ _nss_gns_gethostbyname2_r(
157 * correctly */ 157 * correctly */
158 idx += l; 158 idx += l;
159 159
160 /* Address array address_lenght is always a multiple of 32bits */ 160 /* Address array address_length is always a multiple of 32bits */
161 for (i = 0; i < u.count; i++) 161 for (i = 0; i < u.count; i++)
162 ((char**) (buffer+idx))[i] = buffer+astart+address_length*i; 162 ((char**) (buffer+idx))[i] = buffer+astart+address_length*i;
163 ((char**) (buffer+idx))[i] = NULL; 163 ((char**) (buffer+idx))[i] = NULL;
diff --git a/src/gnsrecord/gnsrecord_serialization.c b/src/gnsrecord/gnsrecord_serialization.c
index adbf02755..934d36102 100644
--- a/src/gnsrecord/gnsrecord_serialization.c
+++ b/src/gnsrecord/gnsrecord_serialization.c
@@ -90,6 +90,9 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
90{ 90{
91 size_t ret; 91 size_t ret;
92 92
93 if (0 == rd_count)
94 return 0;
95
93 ret = sizeof (struct NetworkRecord) * rd_count; 96 ret = sizeof (struct NetworkRecord) * rd_count;
94 for (unsigned int i=0;i<rd_count;i++) 97 for (unsigned int i=0;i<rd_count;i++)
95 { 98 {
@@ -120,6 +123,21 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
120 GNUNET_break (0); 123 GNUNET_break (0);
121 return -1; 124 return -1;
122 } 125 }
126 //Do not pad PKEY
127 if (GNUNET_GNSRECORD_TYPE_PKEY == rd->record_type)
128 return ret;
129 /**
130 * Efficiently round up to the next
131 * power of 2 for padding
132 * https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
133 */
134 ret--;
135 ret |= ret >> 1;
136 ret |= ret >> 2;
137 ret |= ret >> 4;
138 ret |= ret >> 8;
139 ret |= ret >> 16;
140 ret++;
123 return (ssize_t) ret; 141 return (ssize_t) ret;
124} 142}
125 143
@@ -135,9 +153,9 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
135 */ 153 */
136ssize_t 154ssize_t
137GNUNET_GNSRECORD_records_serialize (unsigned int rd_count, 155GNUNET_GNSRECORD_records_serialize (unsigned int rd_count,
138 const struct GNUNET_GNSRECORD_Data *rd, 156 const struct GNUNET_GNSRECORD_Data *rd,
139 size_t dest_size, 157 size_t dest_size,
140 char *dest) 158 char *dest)
141{ 159{
142 struct NetworkRecord rec; 160 struct NetworkRecord rec;
143 size_t off; 161 size_t off;
@@ -190,7 +208,10 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count,
190 } 208 }
191#endif 209#endif
192 } 210 }
193 return off; 211 memset (&dest[off],
212 0,
213 dest_size-off);
214 return dest_size;
194} 215}
195 216
196 217
@@ -205,9 +226,9 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count,
205 */ 226 */
206int 227int
207GNUNET_GNSRECORD_records_deserialize (size_t len, 228GNUNET_GNSRECORD_records_deserialize (size_t len,
208 const char *src, 229 const char *src,
209 unsigned int rd_count, 230 unsigned int rd_count,
210 struct GNUNET_GNSRECORD_Data *dest) 231 struct GNUNET_GNSRECORD_Data *dest)
211{ 232{
212 struct NetworkRecord rec; 233 struct NetworkRecord rec;
213 size_t off; 234 size_t off;
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index ec91b35ad..b4bf5b0aa 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -24,6 +24,7 @@
24 * 24 *
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 * @author Nils Durner 26 * @author Nils Durner
27 * @author Martin Schanzenbach
27 * 28 *
28 * @defgroup logging Logging 29 * @defgroup logging Logging
29 * @see [Documentation](https://gnunet.org/logging) 30 * @see [Documentation](https://gnunet.org/logging)
@@ -112,6 +113,11 @@ extern "C"
112#endif 113#endif
113 114
114/** 115/**
116 * wrap va_arg for enums
117 */
118#define GNUNET_VA_ARG_ENUM(va,X) ((enum X) va_arg (va, int))
119
120/**
115 * @ingroup logging 121 * @ingroup logging
116 * define #GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source 122 * define #GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source
117 * tree where gnunet_config.h is unavailable 123 * tree where gnunet_config.h is unavailable
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index cf7dde913..20d29b906 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -1448,6 +1448,12 @@ check_client_member_join (void *cls,
1448 uint16_t msg_size = ntohs (msg->header.size); 1448 uint16_t msg_size = ntohs (msg->header.size);
1449 struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1]; 1449 struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1];
1450 uint32_t relay_count = ntohl (msg->relay_count); 1450 uint32_t relay_count = ntohl (msg->relay_count);
1451
1452 if (0 == relay_count)
1453 {
1454 GNUNET_break (0);
1455 return GNUNET_SYSERR;
1456 }
1451 if (UINT32_MAX / relay_count < sizeof (*relays)){ 1457 if (UINT32_MAX / relay_count < sizeof (*relays)){
1452 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1458 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1453 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", 1459 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n",
diff --git a/src/namecache/gnunet-service-namecache.c b/src/namecache/gnunet-service-namecache.c
index cda1267e8..c852aaacc 100644
--- a/src/namecache/gnunet-service-namecache.c
+++ b/src/namecache/gnunet-service-namecache.c
@@ -148,7 +148,11 @@ struct LookupBlockContext
148 * Operation id for the name lookup 148 * Operation id for the name lookup
149 */ 149 */
150 uint32_t request_id; 150 uint32_t request_id;
151 151
152 /**
153 * Lookup status
154 */
155 int status;
152}; 156};
153 157
154 158
@@ -166,7 +170,17 @@ handle_lookup_block_it (void *cls,
166 struct GNUNET_MQ_Envelope *env; 170 struct GNUNET_MQ_Envelope *env;
167 struct LookupBlockResponseMessage *r; 171 struct LookupBlockResponseMessage *r;
168 size_t esize; 172 size_t esize;
173 size_t bsize;
169 174
175 bsize = ntohl (block->purpose.size);
176 if (bsize <
177 (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO)))
178 {
179 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
180 "Malformed block.");
181 lnc->status = GNUNET_SYSERR;
182 return;
183 }
170 esize = ntohl (block->purpose.size) 184 esize = ntohl (block->purpose.size)
171 - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) 185 - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)
172 - sizeof (struct GNUNET_TIME_AbsoluteNBO); 186 - sizeof (struct GNUNET_TIME_AbsoluteNBO);
@@ -209,6 +223,7 @@ handle_lookup_block (void *cls,
209 223
210 lnc.request_id = ntohl (ln_msg->gns_header.r_id); 224 lnc.request_id = ntohl (ln_msg->gns_header.r_id);
211 lnc.nc = nc; 225 lnc.nc = nc;
226 lnc.status = GNUNET_OK;
212 if (GNUNET_SYSERR == 227 if (GNUNET_SYSERR ==
213 (ret = GSN_database->lookup_block (GSN_database->cls, 228 (ret = GSN_database->lookup_block (GSN_database->cls,
214 &ln_msg->query, 229 &ln_msg->query,
@@ -222,7 +237,7 @@ handle_lookup_block (void *cls,
222 GNUNET_SERVICE_client_drop (nc->client); 237 GNUNET_SERVICE_client_drop (nc->client);
223 return; 238 return;
224 } 239 }
225 if (0 == ret) 240 if ((0 == ret) || (GNUNET_SYSERR == lnc.status))
226 { 241 {
227 /* no records match at all, generate empty response */ 242 /* no records match at all, generate empty response */
228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 243 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c
index 2bb233da1..2a60a2813 100644
--- a/src/namecache/namecache_api.c
+++ b/src/namecache/namecache_api.c
@@ -483,9 +483,11 @@ GNUNET_NAMECACHE_block_cache (struct GNUNET_NAMECACHE_Handle *h,
483 483
484 if (NULL == h->mq) 484 if (NULL == h->mq)
485 return NULL; 485 return NULL;
486 blen = ntohl (block->purpose.size) 486 blen = ntohl (block->purpose.size);
487 - sizeof (struct GNUNET_TIME_AbsoluteNBO) 487 GNUNET_assert (blen > (sizeof (struct GNUNET_TIME_AbsoluteNBO) +
488 - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose); 488 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)));
489 blen -= (sizeof (struct GNUNET_TIME_AbsoluteNBO) +
490 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose));
489 rid = get_op_id (h); 491 rid = get_op_id (h);
490 qe = GNUNET_new (struct GNUNET_NAMECACHE_QueueEntry); 492 qe = GNUNET_new (struct GNUNET_NAMECACHE_QueueEntry);
491 qe->nsh = h; 493 qe->nsh = h;
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c
index ecfd03735..08977712b 100644
--- a/src/namestore/test_namestore_api_lookup_shadow.c
+++ b/src/namestore/test_namestore_api_lookup_shadow.c
@@ -277,9 +277,9 @@ main (int argc, char *argv[])
277 { 277 {
278 res = 1; 278 res = 1;
279 } 279 }
280 GNUNET_free (cfg_name);
281 GNUNET_DISK_purge_cfg_dir (cfg_name, 280 GNUNET_DISK_purge_cfg_dir (cfg_name,
282 "GNUNET_TEST_HOME"); 281 "GNUNET_TEST_HOME");
282 GNUNET_free (cfg_name);
283 return res; 283 return res;
284} 284}
285 285
diff --git a/src/namestore/test_namestore_api_lookup_shadow_filter.c b/src/namestore/test_namestore_api_lookup_shadow_filter.c
index b751ff703..7555f51e7 100644
--- a/src/namestore/test_namestore_api_lookup_shadow_filter.c
+++ b/src/namestore/test_namestore_api_lookup_shadow_filter.c
@@ -352,9 +352,9 @@ main (int argc, char *argv[])
352 { 352 {
353 res = 1; 353 res = 1;
354 } 354 }
355 GNUNET_free (cfg_name);
356 GNUNET_DISK_purge_cfg_dir (cfg_name, 355 GNUNET_DISK_purge_cfg_dir (cfg_name,
357 "GNUNET_TEST_HOME"); 356 "GNUNET_TEST_HOME");
357 GNUNET_free (cfg_name);
358 return res; 358 return res;
359} 359}
360 360
diff --git a/src/namestore/test_namestore_api_sqlite.conf b/src/namestore/test_namestore_api_sqlite.conf
index 82663400a..8c0e557e7 100644
--- a/src/namestore/test_namestore_api_sqlite.conf
+++ b/src/namestore/test_namestore_api_sqlite.conf
@@ -2,6 +2,7 @@
2 2
3[namestore] 3[namestore]
4DATABASE = sqlite 4DATABASE = sqlite
5PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/v_log
5 6
6[namestore-sqlite] 7[namestore-sqlite]
7FILENAME = $GNUNET_TEST_HOME/namestore/sqlite_test.db 8FILENAME = $GNUNET_TEST_HOME/namestore/sqlite_test.db
diff --git a/src/nat/test_nat_test_data.conf b/src/nat/test_nat_test_data.conf
index 84de6159e..03850ec06 100644
--- a/src/nat/test_nat_test_data.conf
+++ b/src/nat/test_nat_test_data.conf
@@ -6,7 +6,7 @@ GNUNET_TEST_HOME = $GNUNET_TMP/nat-test
6 6
7[gnunet-nat-server] 7[gnunet-nat-server]
8HOSTNAME = localhost 8HOSTNAME = localhost
9PORT = 12345 9PORT = 57315
10 10
11[nat] 11[nat]
12# Are we behind NAT? 12# Are we behind NAT?
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index a0e79e565..16f23e86c 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -1951,9 +1951,13 @@ static void compute_probabilities (uint32_t peer_idx)
1951 if ((GNUNET_YES == is_in_view (i, peer_idx)) && 1951 if ((GNUNET_YES == is_in_view (i, peer_idx)) &&
1952 (1 <= (0.45 * view_size))) 1952 (1 <= (0.45 * view_size)))
1953 { 1953 {
1954 prob_push = 1.0 * binom (0.45 * view_size, 1) 1954 if (0 == binom (view_size, 0.45 * view_size)) prob_push = 0;
1955 / 1955 else
1956 binom (view_size, 0.45 * view_size); 1956 {
1957 prob_push = 1.0 * binom (0.45 * view_size, 1)
1958 /
1959 binom (view_size, 0.45 * view_size);
1960 }
1957 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1961 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1958 "\t\t%" PRIu32 " is in %" PRIu32 "'s view, prob: %f\n", 1962 "\t\t%" PRIu32 " is in %" PRIu32 "'s view, prob: %f\n",
1959 peer_idx, 1963 peer_idx,
@@ -2318,6 +2322,7 @@ post_test_shutdown_ready_cb (void *cls,
2318 rps_peer->index); 2322 rps_peer->index);
2319 GNUNET_free (stat_cls); 2323 GNUNET_free (stat_cls);
2320 GNUNET_break (0); 2324 GNUNET_break (0);
2325 return;
2321 } 2326 }
2322 2327
2323 if (NULL != rps_peer->stat_op && 2328 if (NULL != rps_peer->stat_op &&
@@ -2494,7 +2499,6 @@ test_run (void *cls,
2494 struct OpListEntry *entry; 2499 struct OpListEntry *entry;
2495 2500
2496 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n"); 2501 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
2497 printf ("test 1\n");
2498 2502
2499 /* Check whether we timed out */ 2503 /* Check whether we timed out */
2500 if (n_peers != num_peers || 2504 if (n_peers != num_peers ||
@@ -2578,7 +2582,6 @@ test_run (void *cls,
2578 * 2582 *
2579 * @param argc unused 2583 * @param argc unused
2580 * @param argv unused 2584 * @param argv unused
2581 * @return 0 on success
2582 */ 2585 */
2583static void 2586static void
2584run (void *cls, 2587run (void *cls,
@@ -2635,12 +2638,12 @@ run (void *cls,
2635 } 2638 }
2636 2639
2637 /* Compute number of bits for representing largest peer id */ 2640 /* Compute number of bits for representing largest peer id */
2638 for (bits_needed = 1; (bits_needed << 1) < num_peers - 1; bits_needed++) 2641 for (bits_needed = 1; (1 << bits_needed) < num_peers; bits_needed++)
2639 ; 2642 ;
2640 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2643 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2641 "Need %u bits to represent largest peer id %" PRIu32 "\n", 2644 "Need %u bits to represent %" PRIu32 " peers\n",
2642 bits_needed, 2645 bits_needed,
2643 num_peers - 1); 2646 num_peers);
2644 2647
2645 rps_peers = GNUNET_new_array (num_peers, struct RPSPeer); 2648 rps_peers = GNUNET_new_array (num_peers, struct RPSPeer);
2646 peer_map = GNUNET_CONTAINER_multipeermap_create (num_peers, GNUNET_NO); 2649 peer_map = GNUNET_CONTAINER_multipeermap_create (num_peers, GNUNET_NO);
@@ -2654,8 +2657,6 @@ run (void *cls,
2654 with the malicious portion */ 2657 with the malicious portion */
2655 2658
2656 ok = 1; 2659 ok = 1;
2657 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2658 "before _run()\n");
2659 GNUNET_TESTBED_run (NULL, 2660 GNUNET_TESTBED_run (NULL,
2660 cfg, 2661 cfg,
2661 num_peers, 2662 num_peers,
@@ -2664,10 +2665,6 @@ run (void *cls,
2664 NULL, 2665 NULL,
2665 &test_run, 2666 &test_run,
2666 NULL); 2667 NULL);
2667 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2668 "after _run()\n");
2669 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2670 "gnunet-rps-profiler returned.\n");
2671} 2668}
2672 2669
2673/** 2670/**
@@ -2691,7 +2688,7 @@ main (int argc, char *argv[])
2691 GNUNET_GETOPT_option_relative_time ('t', 2688 GNUNET_GETOPT_option_relative_time ('t',
2692 "timeout", 2689 "timeout",
2693 "TIMEOUT", 2690 "TIMEOUT",
2694 gettext_noop ("timeout for DHT PUT and GET requests (default: 1 min)"), 2691 gettext_noop ("timeout for the profiling"),
2695 &timeout), 2692 &timeout),
2696 2693
2697 GNUNET_GETOPT_option_uint ('r', 2694 GNUNET_GETOPT_option_uint ('r',
diff --git a/src/rps/gnunet-rps.c b/src/rps/gnunet-rps.c
index e09277589..739f71dac 100644
--- a/src/rps/gnunet-rps.c
+++ b/src/rps/gnunet-rps.c
@@ -155,7 +155,11 @@ run (void *cls,
155 (!view_update)) 155 (!view_update))
156 { /* Request n PeerIDs */ 156 { /* Request n PeerIDs */
157 /* If number was specified use it, else request single peer. */ 157 /* If number was specified use it, else request single peer. */
158 num_peers = (NULL == args[0]) ? 1 : atoi (args[0]); 158 if (NULL == args[0] ||
159 0 == sscanf (args[0], "%lu", &num_peers))
160 {
161 num_peers = 1;
162 }
159 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 163 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
160 "Requesting %" PRIu64 " PeerIDs\n", num_peers); 164 "Requesting %" PRIu64 " PeerIDs\n", num_peers);
161 req_handle = GNUNET_RPS_request_peers (rps_handle, num_peers, reply_handle, NULL); 165 req_handle = GNUNET_RPS_request_peers (rps_handle, num_peers, reply_handle, NULL);
@@ -163,7 +167,11 @@ run (void *cls,
163 } else if (view_update) 167 } else if (view_update)
164 { 168 {
165 /* Get updates of view */ 169 /* Get updates of view */
166 num_view_updates = (NULL == args[0]) ? 0 : atoi (args[0]); 170 if (NULL == args[0] ||
171 0 == sscanf (args[0], "%lu", &num_view_updates))
172 {
173 num_view_updates = 0;
174 }
167 GNUNET_RPS_view_request (rps_handle, num_view_updates, view_update_handle, NULL); 175 GNUNET_RPS_view_request (rps_handle, num_view_updates, view_update_handle, NULL);
168 if (0 != num_view_updates) 176 if (0 != num_view_updates)
169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c
index 9a1dfe0d8..0ee290e67 100644
--- a/src/rps/rps-test_util.c
+++ b/src/rps/rps-test_util.c
@@ -155,6 +155,9 @@ to_file_raw (const char *file_name, const char *buf, size_t size_buf)
155 155
156 return; 156 return;
157 } 157 }
158 if (GNUNET_YES != GNUNET_DISK_file_close (f))
159 LOG (GNUNET_ERROR_TYPE_WARNING,
160 "Unable to close file\n");
158} 161}
159 162
160void 163void
@@ -384,7 +387,7 @@ store_prefix_file_name (const struct GNUNET_PeerIdentity *peer,
384 const char *prefix) 387 const char *prefix)
385{ 388{
386 unsigned int len_file_name; 389 unsigned int len_file_name;
387 unsigned int out_size; 390 int out_size;
388 char *file_name; 391 char *file_name;
389 const char *pid_long; 392 const char *pid_long;
390 393
diff --git a/src/rps/test_rps.conf b/src/rps/test_rps.conf
index 77a0df2c5..05bb9f444 100644
--- a/src/rps/test_rps.conf
+++ b/src/rps/test_rps.conf
@@ -21,17 +21,24 @@ FILENAME_VALID_PEERS = $GNUNET_DATA_HOME/rps/valid_peers.txt
21# So, 50 is enough for a network of size 50^3 = 125000 21# So, 50 is enough for a network of size 50^3 = 125000
22MINSIZE = 4 22MINSIZE = 4
23 23
24
25
24[testbed] 26[testbed]
25HOSTNAME = localhost 27HOSTNAME = localhost
26 28
27# OPERATION_TIMEOUT = 60 s
28
29# MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 100 29# MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 100
30OVERLAY_TOPOLOGY = CLIQUE
31#OVERLAY_TOPOLOGY = SMALL_WORLD
32#SCALE_FREE_TOPOLOGY_CAP =
33 30
34# OVERLAY_RANDOM_LINKS = 25 31#OVERLAY_TOPOLOGY = CLIQUE
32
33OVERLAY_TOPOLOGY = SCALE_FREE
34SCALE_FREE_TOPOLOGY_CAP = 100
35SCALE_FREE_TOPOLOGY_M = 2
36
37#OVERLAY_TOPOLOGY = RANDOM
38#OVERLAY_RANDOM_LINKS = 25
39
40#OVERLAY_TOPOLOGY = SMALL_WORLD
41#OVERLAY_RANDOM_LINKS = 25
35 42
36SETUP_TIMEOUT = 2 m 43SETUP_TIMEOUT = 2 m
37 44
@@ -41,12 +48,13 @@ WORKBITS = 0
41[nat] 48[nat]
42# Use addresses from the local network interfaces (inluding loopback, but also others) 49# Use addresses from the local network interfaces (inluding loopback, but also others)
43USE_LOCALADDR = YES 50USE_LOCALADDR = YES
51ENABLE_UPNP = NO
44 52
45# Do we use addresses from localhost address ranges? (::1, 127.0.0.0/8) 53# Do we use addresses from localhost address ranges? (::1, 127.0.0.0/8)
46RETURN_LOCAL_ADDRESSES = YES 54RETURN_LOCAL_ADDRESSES = YES
47 55
48[transport] 56[transport]
49PLUGINS = udp 57PLUGINS = unix
50 58
51[ats] 59[ats]
52# Network specific inbound/outbound quotas 60# Network specific inbound/outbound quotas
@@ -72,7 +80,6 @@ BLUETOOTH_QUOTA_OUT = unlimited
72DISABLE_TRY_CONNECT = YES 80DISABLE_TRY_CONNECT = YES
73 81
74[cadet] 82[cadet]
75DISABLE_TRY_CONNECT = YES
76#OPTIONS=-l /tmp/rps_profiler_logs/cadet-[]-%Y-%m-%d.log 83#OPTIONS=-l /tmp/rps_profiler_logs/cadet-[]-%Y-%m-%d.log
77#PREFIX = valgrind 84#PREFIX = valgrind
78 85
diff --git a/src/template/template.conf b/src/template/template.conf
index e5f675a5d..24b123390 100644
--- a/src/template/template.conf
+++ b/src/template/template.conf
@@ -1,6 +1,10 @@
1[template] 1[template]
2START_ON_DEMAND = NO 2START_ON_DEMAND = NO
3PORT = 9999 3# for tests please come up with numbers that are
4# unlikely to be in use by anyone. we typically
5# use five digit numbers < 65536 with no "beauty"
6# (no repetitions, no sequences, no popularity).
7PORT = 99999
4HOSTNAME = localhost 8HOSTNAME = localhost
5BINARY = gnunet-service-template 9BINARY = gnunet-service-template
6ACCEPT_FROM = 127.0.0.1; 10ACCEPT_FROM = 127.0.0.1;
diff --git a/src/testbed/test_testbed_api_statistics.conf b/src/testbed/test_testbed_api_statistics.conf
index 50d3f2c04..edb2e2057 100644
--- a/src/testbed/test_testbed_api_statistics.conf
+++ b/src/testbed/test_testbed_api_statistics.conf
@@ -6,4 +6,4 @@ MAX_PARALLEL_SERVICE_CONNECTIONS = 2
6 6
7[statistics] 7[statistics]
8START_ON_DEMAND = YES 8START_ON_DEMAND = YES
9PORT = 30 9PORT = 59530
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c
index 51a8b979a..114055a07 100644
--- a/src/testbed/testbed_api_topology.c
+++ b/src/testbed/testbed_api_topology.c
@@ -1391,7 +1391,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls,
1391 } 1391 }
1392 do 1392 do
1393 { 1393 {
1394 secondary_option = va_arg (va, enum GNUNET_TESTBED_TopologyOption); 1394 secondary_option = GNUNET_VA_ARG_ENUM (va, GNUNET_TESTBED_TopologyOption);
1395 1395
1396 switch (secondary_option) 1396 switch (secondary_option)
1397 { 1397 {
@@ -1552,7 +1552,7 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers,
1552 tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY; 1552 tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY;
1553 underlay = &tc.u.underlay; 1553 underlay = &tc.u.underlay;
1554 va_start (vargs, cls); 1554 va_start (vargs, cls);
1555 topology = va_arg (vargs, enum GNUNET_TESTBED_TopologyOption); 1555 topology = GNUNET_VA_ARG_ENUM (vargs, GNUNET_TESTBED_TopologyOption);
1556 switch (topology) 1556 switch (topology)
1557 { 1557 {
1558 case GNUNET_TESTBED_TOPOLOGY_LINE: 1558 case GNUNET_TESTBED_TOPOLOGY_LINE:
diff --git a/src/testing/test_testing_sharedservices.conf b/src/testing/test_testing_sharedservices.conf
index e41e2863c..24ce1b358 100644
--- a/src/testing/test_testing_sharedservices.conf
+++ b/src/testing/test_testing_sharedservices.conf
@@ -2,7 +2,7 @@
2GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-testing/ 2GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-testing/
3 3
4[testbed-logger] 4[testbed-logger]
5PORT = 15000 5PORT = 59132
6UNIXPATH = $GNUNET_RUNTIME_DIR/testbed-logger.sock 6UNIXPATH = $GNUNET_RUNTIME_DIR/testbed-logger.sock
7DIR = $GNUNET_TMP/testbed-logger 7DIR = $GNUNET_TMP/testbed-logger
8 8
diff --git a/src/transport/test_plugin_transport_data.conf b/src/transport/test_plugin_transport_data.conf
index cbecc56ed..b667a4854 100644
--- a/src/transport/test_plugin_transport_data.conf
+++ b/src/transport/test_plugin_transport_data.conf
@@ -3,10 +3,10 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunetd-plugin-transport/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunetd-plugin-transport/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 2400 6PORT = 52400
7 7
8[transport-udp] 8[transport-udp]
9PORT = 2401 9PORT = 52401
10 10
11[transport-wlan] 11[transport-wlan]
12INTERFACE = mon0 12INTERFACE = mon0
@@ -17,29 +17,29 @@ INTERFACE = hci0
17TESTMODE = 1 17TESTMODE = 1
18 18
19[transport-http_server] 19[transport-http_server]
20PORT = 2402 20PORT = 52402
21 21
22[transport-https_server] 22[transport-https_server]
23PORT = 2403 23PORT = 52403
24 24
25[arm] 25[arm]
26PORT = 2360 26PORT = 52360
27UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-arm.sock 27UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-arm.sock
28 28
29[statistics] 29[statistics]
30PORT = 2361 30PORT = 52361
31UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-statistics.sock 31UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-statistics.sock
32 32
33[resolver] 33[resolver]
34PORT = 2362 34PORT = 52362
35UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-resolver.sock 35UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-resolver.sock
36 36
37[peerinfo] 37[peerinfo]
38PORT = 2363 38PORT = 52363
39UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-peerinfo.sock 39UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-peerinfo.sock
40 40
41[transport] 41[transport]
42PORT = 2364 42PORT = 52364
43UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-transport.sock 43UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-transport.sock
44 44
45[nat] 45[nat]
diff --git a/src/transport/test_quota_compliance_data.conf b/src/transport/test_quota_compliance_data.conf
index 47c523bcf..1bc607770 100644
--- a/src/transport/test_quota_compliance_data.conf
+++ b/src/transport/test_quota_compliance_data.conf
@@ -3,22 +3,22 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunetd-plugin-transport/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunetd-plugin-transport/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 2368 6PORT = 52368
7TIMEOUT = 5 s 7TIMEOUT = 5 s
8 8
9[arm] 9[arm]
10PORT = 2366 10PORT = 52366
11 11
12[statistics] 12[statistics]
13PORT = 2367 13PORT = 52367
14 14
15[resolver] 15[resolver]
16PORT = 2364 16PORT = 52364
17 17
18[peerinfo] 18[peerinfo]
19PORT = 2369 19PORT = 52369
20 20
21[transport] 21[transport]
22PORT = 2365 22PORT = 52365
23 23
24 24
diff --git a/src/transport/test_quota_compliance_http_asymmetric_peer1.conf b/src/transport/test_quota_compliance_http_asymmetric_peer1.conf
index 201bafd01..b2ff1913f 100644
--- a/src/transport/test_quota_compliance_http_asymmetric_peer1.conf
+++ b/src/transport/test_quota_compliance_http_asymmetric_peer1.conf
@@ -5,23 +5,23 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1
5[transport-http_client] 5[transport-http_client]
6 6
7[arm] 7[arm]
8PORT = 4015 8PORT = 54015
9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer1.sock 9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer1.sock
10 10
11[statistics] 11[statistics]
12PORT = 4014 12PORT = 54014
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer1.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer1.sock
14 14
15[resolver] 15[resolver]
16PORT = 4013 16PORT = 54013
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer1.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer1.sock
18 18
19[peerinfo] 19[peerinfo]
20PORT = 4012 20PORT = 54012
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer1.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer1.sock
22 22
23[transport] 23[transport]
24PORT = 4011 24PORT = 54011
25PLUGINS = http_client 25PLUGINS = http_client
26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer1.sock 26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer1.sock
27 27
diff --git a/src/transport/test_quota_compliance_http_asymmetric_peer2.conf b/src/transport/test_quota_compliance_http_asymmetric_peer2.conf
index cdc10516b..3408d9f2e 100644
--- a/src/transport/test_quota_compliance_http_asymmetric_peer2.conf
+++ b/src/transport/test_quota_compliance_http_asymmetric_peer2.conf
@@ -3,29 +3,29 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2
4 4
5[transport-http_server] 5[transport-http_server]
6PORT = 3010 6PORT = 53010
7USE_IPv6 = NO 7USE_IPv6 = NO
8BINDTO = 127.0.0.1 8BINDTO = 127.0.0.1
9 9
10 10
11[arm] 11[arm]
12PORT = 3015 12PORT = 53015
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer2.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer2.sock
14 14
15[statistics] 15[statistics]
16PORT = 3014 16PORT = 53014
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer2.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer2.sock
18 18
19[resolver] 19[resolver]
20PORT = 3013 20PORT = 53013
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer2.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer2.sock
22 22
23[peerinfo] 23[peerinfo]
24PORT = 3012 24PORT = 53012
25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer2.sock 25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer2.sock
26 26
27[transport] 27[transport]
28PORT = 3011 28PORT = 53011
29PLUGINS = http_server 29PLUGINS = http_server
30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer2.sock 30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer2.sock
31 31
diff --git a/src/transport/test_quota_compliance_http_peer1.conf b/src/transport/test_quota_compliance_http_peer1.conf
index 201bafd01..b2ff1913f 100644
--- a/src/transport/test_quota_compliance_http_peer1.conf
+++ b/src/transport/test_quota_compliance_http_peer1.conf
@@ -5,23 +5,23 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1
5[transport-http_client] 5[transport-http_client]
6 6
7[arm] 7[arm]
8PORT = 4015 8PORT = 54015
9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer1.sock 9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer1.sock
10 10
11[statistics] 11[statistics]
12PORT = 4014 12PORT = 54014
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer1.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer1.sock
14 14
15[resolver] 15[resolver]
16PORT = 4013 16PORT = 54013
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer1.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer1.sock
18 18
19[peerinfo] 19[peerinfo]
20PORT = 4012 20PORT = 54012
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer1.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer1.sock
22 22
23[transport] 23[transport]
24PORT = 4011 24PORT = 54011
25PLUGINS = http_client 25PLUGINS = http_client
26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer1.sock 26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer1.sock
27 27
diff --git a/src/transport/test_quota_compliance_http_peer2.conf b/src/transport/test_quota_compliance_http_peer2.conf
index cdc10516b..3408d9f2e 100644
--- a/src/transport/test_quota_compliance_http_peer2.conf
+++ b/src/transport/test_quota_compliance_http_peer2.conf
@@ -3,29 +3,29 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2
4 4
5[transport-http_server] 5[transport-http_server]
6PORT = 3010 6PORT = 53010
7USE_IPv6 = NO 7USE_IPv6 = NO
8BINDTO = 127.0.0.1 8BINDTO = 127.0.0.1
9 9
10 10
11[arm] 11[arm]
12PORT = 3015 12PORT = 53015
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer2.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_arm_peer2.sock
14 14
15[statistics] 15[statistics]
16PORT = 3014 16PORT = 53014
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer2.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_statistics_peer2.sock
18 18
19[resolver] 19[resolver]
20PORT = 3013 20PORT = 53013
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer2.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_resolver_peer2.sock
22 22
23[peerinfo] 23[peerinfo]
24PORT = 3012 24PORT = 53012
25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer2.sock 25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_peerinfo_peer2.sock
26 26
27[transport] 27[transport]
28PORT = 3011 28PORT = 53011
29PLUGINS = http_server 29PLUGINS = http_server
30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer2.sock 30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_http_transport_peer2.sock
31 31
diff --git a/src/transport/test_quota_compliance_https_asymmetric_peer1.conf b/src/transport/test_quota_compliance_https_asymmetric_peer1.conf
index 3e8895665..94aa534ef 100644
--- a/src/transport/test_quota_compliance_https_asymmetric_peer1.conf
+++ b/src/transport/test_quota_compliance_https_asymmetric_peer1.conf
@@ -5,23 +5,23 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1/
5[transport-https_client] 5[transport-https_client]
6 6
7[arm] 7[arm]
8PORT = 4006 8PORT = 54006
9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer1.sock 9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer1.sock
10 10
11[statistics] 11[statistics]
12PORT = 4005 12PORT = 54005
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer1.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer1.sock
14 14
15[resolver] 15[resolver]
16PORT = 4004 16PORT = 54004
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer1.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer1.sock
18 18
19[peerinfo] 19[peerinfo]
20PORT = 4003 20PORT = 54003
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer1.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer1.sock
22 22
23[transport] 23[transport]
24PORT = 4002 24PORT = 54002
25PLUGINS = https_client 25PLUGINS = https_client
26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_transport_peer1.sock 26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_transport_peer1.sock
27 27
diff --git a/src/transport/test_quota_compliance_https_asymmetric_peer2.conf b/src/transport/test_quota_compliance_https_asymmetric_peer2.conf
index e0ff8da9f..8fb8861cd 100644
--- a/src/transport/test_quota_compliance_https_asymmetric_peer2.conf
+++ b/src/transport/test_quota_compliance_https_asymmetric_peer2.conf
@@ -3,28 +3,28 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2
4 4
5[transport-https_server] 5[transport-https_server]
6PORT = 3001 6PORT = 53001
7KEY_FILE = https_key_quota_p2.key 7KEY_FILE = https_key_quota_p2.key
8CERT_FILE = https_cert_qutoa_p2.crt 8CERT_FILE = https_cert_qutoa_p2.crt
9 9
10[arm] 10[arm]
11PORT = 3006 11PORT = 53006
12UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer2.sock 12UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer2.sock
13 13
14[statistics] 14[statistics]
15PORT = 3005 15PORT = 53005
16UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer2.sock 16UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer2.sock
17 17
18[resolver] 18[resolver]
19PORT = 3004 19PORT = 53004
20UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer2.sock 20UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer2.sock
21 21
22[peerinfo] 22[peerinfo]
23PORT = 3003 23PORT = 53003
24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer2.sock 24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer2.sock
25 25
26[transport] 26[transport]
27PORT = 3002 27PORT = 53002
28PLUGINS = https_server 28PLUGINS = https_server
29UNIXPATH = $GNUNET_RUNTIME_DIR/https_transport_peer2.sock 29UNIXPATH = $GNUNET_RUNTIME_DIR/https_transport_peer2.sock
30 30
diff --git a/src/transport/test_quota_compliance_https_peer1.conf b/src/transport/test_quota_compliance_https_peer1.conf
index 3e8895665..94aa534ef 100644
--- a/src/transport/test_quota_compliance_https_peer1.conf
+++ b/src/transport/test_quota_compliance_https_peer1.conf
@@ -5,23 +5,23 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1/
5[transport-https_client] 5[transport-https_client]
6 6
7[arm] 7[arm]
8PORT = 4006 8PORT = 54006
9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer1.sock 9UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer1.sock
10 10
11[statistics] 11[statistics]
12PORT = 4005 12PORT = 54005
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer1.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer1.sock
14 14
15[resolver] 15[resolver]
16PORT = 4004 16PORT = 54004
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer1.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer1.sock
18 18
19[peerinfo] 19[peerinfo]
20PORT = 4003 20PORT = 54003
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer1.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer1.sock
22 22
23[transport] 23[transport]
24PORT = 4002 24PORT = 54002
25PLUGINS = https_client 25PLUGINS = https_client
26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_transport_peer1.sock 26UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_transport_peer1.sock
27 27
diff --git a/src/transport/test_quota_compliance_https_peer2.conf b/src/transport/test_quota_compliance_https_peer2.conf
index e0ff8da9f..8fb8861cd 100644
--- a/src/transport/test_quota_compliance_https_peer2.conf
+++ b/src/transport/test_quota_compliance_https_peer2.conf
@@ -3,28 +3,28 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2
4 4
5[transport-https_server] 5[transport-https_server]
6PORT = 3001 6PORT = 53001
7KEY_FILE = https_key_quota_p2.key 7KEY_FILE = https_key_quota_p2.key
8CERT_FILE = https_cert_qutoa_p2.crt 8CERT_FILE = https_cert_qutoa_p2.crt
9 9
10[arm] 10[arm]
11PORT = 3006 11PORT = 53006
12UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer2.sock 12UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_arm_peer2.sock
13 13
14[statistics] 14[statistics]
15PORT = 3005 15PORT = 53005
16UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer2.sock 16UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_statistics_peer2.sock
17 17
18[resolver] 18[resolver]
19PORT = 3004 19PORT = 53004
20UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer2.sock 20UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_resolver_peer2.sock
21 21
22[peerinfo] 22[peerinfo]
23PORT = 3003 23PORT = 53003
24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer2.sock 24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_https_peerinfo_peer2.sock
25 25
26[transport] 26[transport]
27PORT = 3002 27PORT = 53002
28PLUGINS = https_server 28PLUGINS = https_server
29UNIXPATH = $GNUNET_RUNTIME_DIR/https_transport_peer2.sock 29UNIXPATH = $GNUNET_RUNTIME_DIR/https_transport_peer2.sock
30 30
diff --git a/src/transport/test_quota_compliance_tcp_asymmetric_peer1.conf b/src/transport/test_quota_compliance_tcp_asymmetric_peer1.conf
index 59fbbff5b..0e0cbff24 100644
--- a/src/transport/test_quota_compliance_tcp_asymmetric_peer1.conf
+++ b/src/transport/test_quota_compliance_tcp_asymmetric_peer1.conf
@@ -3,29 +3,29 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/quota-tcp-p1/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/quota-tcp-p1/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 4094 6PORT = 54094
7 7
8[transport-udp] 8[transport-udp]
9PORT = 4094 9PORT = 54094
10 10
11[arm] 11[arm]
12PORT = 4087 12PORT = 54087
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_arm_peer1.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_arm_peer1.sock
14 14
15[statistics] 15[statistics]
16PORT = 4088 16PORT = 54088
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_statistics_peer1.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_statistics_peer1.sock
18 18
19[resolver] 19[resolver]
20PORT = 4089 20PORT = 54089
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_resolver_peer1.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_resolver_peer1.sock
22 22
23[peerinfo] 23[peerinfo]
24PORT = 4090 24PORT = 54090
25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_peerinfo_peer1.sock 25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_peerinfo_peer1.sock
26 26
27[transport] 27[transport]
28PORT = 4091 28PORT = 54091
29PLUGINS = tcp 29PLUGINS = tcp
30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_transport_peer1.sock 30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_transport_peer1.sock
31 31
diff --git a/src/transport/test_quota_compliance_tcp_peer1.conf b/src/transport/test_quota_compliance_tcp_peer1.conf
index 59fbbff5b..0e0cbff24 100644
--- a/src/transport/test_quota_compliance_tcp_peer1.conf
+++ b/src/transport/test_quota_compliance_tcp_peer1.conf
@@ -3,29 +3,29 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/quota-tcp-p1/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/quota-tcp-p1/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 4094 6PORT = 54094
7 7
8[transport-udp] 8[transport-udp]
9PORT = 4094 9PORT = 54094
10 10
11[arm] 11[arm]
12PORT = 4087 12PORT = 54087
13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_arm_peer1.sock 13UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_arm_peer1.sock
14 14
15[statistics] 15[statistics]
16PORT = 4088 16PORT = 54088
17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_statistics_peer1.sock 17UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_statistics_peer1.sock
18 18
19[resolver] 19[resolver]
20PORT = 4089 20PORT = 54089
21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_resolver_peer1.sock 21UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_resolver_peer1.sock
22 22
23[peerinfo] 23[peerinfo]
24PORT = 4090 24PORT = 54090
25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_peerinfo_peer1.sock 25UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_peerinfo_peer1.sock
26 26
27[transport] 27[transport]
28PORT = 4091 28PORT = 54091
29PLUGINS = tcp 29PLUGINS = tcp
30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_transport_peer1.sock 30UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_tcp_transport_peer1.sock
31 31
diff --git a/src/transport/test_quota_compliance_udp_peer1.conf b/src/transport/test_quota_compliance_udp_peer1.conf
index b7c3159b8..bba75c168 100644
--- a/src/transport/test_quota_compliance_udp_peer1.conf
+++ b/src/transport/test_quota_compliance_udp_peer1.conf
@@ -3,27 +3,27 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1/
4 4
5[transport-udp] 5[transport-udp]
6PORT = 4368 6PORT = 54368
7MAX_BPS = 50000000 7MAX_BPS = 50000000
8 8
9[arm] 9[arm]
10PORT = 4087 10PORT = 54087
11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_arm_peer1.sock 11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_arm_peer1.sock
12 12
13[statistics] 13[statistics]
14PORT = 4088 14PORT = 54088
15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_statistics_peer1.sock 15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_statistics_peer1.sock
16 16
17[resolver] 17[resolver]
18PORT = 4089 18PORT = 54089
19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_resolver_peer1.sock 19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_resolver_peer1.sock
20 20
21[peerinfo] 21[peerinfo]
22PORT = 4090 22PORT = 54090
23UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_peerinfo_peer1.sock 23UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_peerinfo_peer1.sock
24 24
25[transport] 25[transport]
26PORT = 4091 26PORT = 54091
27PLUGINS = udp 27PLUGINS = udp
28UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_transport_peer1.sock 28UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_transport_peer1.sock
29 29
diff --git a/src/transport/test_quota_compliance_udp_peer2.conf b/src/transport/test_quota_compliance_udp_peer2.conf
index 70e61db05..1cb04038c 100644
--- a/src/transport/test_quota_compliance_udp_peer2.conf
+++ b/src/transport/test_quota_compliance_udp_peer2.conf
@@ -3,27 +3,27 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2
4 4
5[transport-udp] 5[transport-udp]
6PORT = 3368 6PORT = 53368
7MAX_BPS = 50000000 7MAX_BPS = 50000000
8 8
9[arm] 9[arm]
10PORT = 3087 10PORT = 53087
11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_arm_peer2.sock 11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_arm_peer2.sock
12 12
13[statistics] 13[statistics]
14PORT = 3088 14PORT = 53088
15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_statistics_peer2.sock 15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_statistics_peer2.sock
16 16
17[resolver] 17[resolver]
18PORT = 3089 18PORT = 53089
19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_resolver_peer2.sock 19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_resolver_peer2.sock
20 20
21[peerinfo] 21[peerinfo]
22PORT = 3090 22PORT = 53090
23UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_peerinfo_peer2.sock 23UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_peerinfo_peer2.sock
24 24
25[transport] 25[transport]
26PORT = 3091 26PORT = 53091
27PLUGINS = udp 27PLUGINS = udp
28UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_transport_peer2.sock 28UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_udp_transport_peer2.sock
29 29
diff --git a/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf b/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf
index 8d6073b67..a8ee6d77a 100644
--- a/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf
+++ b/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf
@@ -3,26 +3,26 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1/
4 4
5[arm] 5[arm]
6PORT = 4087 6PORT = 54087
7UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer1.sock 7UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer1.sock
8 8
9[statistics] 9[statistics]
10PORT = 4088 10PORT = 54088
11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer1.sock 11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer1.sock
12 12
13[resolver] 13[resolver]
14PORT = 4089 14PORT = 54089
15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer1.sock 15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer1.sock
16 16
17[peerinfo] 17[peerinfo]
18PORT = 4090 18PORT = 54090
19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer1.sock 19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer1.sock
20 20
21[transport] 21[transport]
22PORT = 4091 22PORT = 54091
23PLUGINS = unix 23PLUGINS = unix
24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer1.sock 24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer1.sock
25 25
26[transport-unix] 26[transport-unix]
27PORT = 4092 27PORT = 54092
28 28
diff --git a/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf b/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf
index a3a42f739..6edbcac9f 100644
--- a/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf
+++ b/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf
@@ -3,26 +3,26 @@
3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2 3GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2
4 4
5[arm] 5[arm]
6PORT = 3087 6PORT = 53087
7UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer2.sock 7UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer2.sock
8 8
9[statistics] 9[statistics]
10PORT = 3088 10PORT = 53088
11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer2.sock 11UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer2.sock
12 12
13[resolver] 13[resolver]
14PORT = 3089 14PORT = 53089
15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer2.sock 15UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer2.sock
16 16
17[peerinfo] 17[peerinfo]
18PORT = 3090 18PORT = 53090
19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer2.sock 19UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer2.sock
20 20
21[transport] 21[transport]
22PORT = 3091 22PORT = 53091
23PLUGINS = unix 23PLUGINS = unix
24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer2.sock 24UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer2.sock
25 25
26[transport-unix] 26[transport-unix]
27PORT = 3368 27PORT = 53368
28 28
diff --git a/src/transport/test_quota_compliance_unix_peer1.conf b/src/transport/test_quota_compliance_unix_peer1.conf
index d9255705c..59c8d6d9e 100644
--- a/src/transport/test_quota_compliance_unix_peer1.conf
+++ b/src/transport/test_quota_compliance_unix_peer1.conf
@@ -6,22 +6,22 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer1/
6PORT = 12120 6PORT = 12120
7 7
8[arm] 8[arm]
9PORT = 4087 9PORT = 54087
10UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer1.sock 10UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer1.sock
11 11
12[statistics] 12[statistics]
13PORT = 4088 13PORT = 54088
14UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer1.sock 14UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer1.sock
15 15
16[resolver] 16[resolver]
17PORT = 4089 17PORT = 54089
18UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer1.sock 18UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer1.sock
19 19
20[peerinfo] 20[peerinfo]
21PORT = 4090 21PORT = 54090
22UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer1.sock 22UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer1.sock
23 23
24[transport] 24[transport]
25PORT = 4091 25PORT = 54091
26PLUGINS = unix 26PLUGINS = unix
27UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer1.sock 27UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer1.sock
diff --git a/src/transport/test_quota_compliance_unix_peer2.conf b/src/transport/test_quota_compliance_unix_peer2.conf
index b7ba15d86..8c2f9989e 100644
--- a/src/transport/test_quota_compliance_unix_peer2.conf
+++ b/src/transport/test_quota_compliance_unix_peer2.conf
@@ -6,26 +6,26 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test_quota_compliance_peer2
6PORT = 12136 6PORT = 12136
7 7
8[arm] 8[arm]
9PORT = 3087 9PORT = 53087
10UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer2.sock 10UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_arm_peer2.sock
11 11
12[statistics] 12[statistics]
13PORT = 3088 13PORT = 53088
14UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer2.sock 14UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_statistics_peer2.sock
15 15
16[resolver] 16[resolver]
17PORT = 3089 17PORT = 53089
18UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer2.sock 18UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_resolver_peer2.sock
19 19
20[peerinfo] 20[peerinfo]
21PORT = 3090 21PORT = 53090
22UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer2.sock 22UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_peerinfo_peer2.sock
23 23
24[transport] 24[transport]
25PORT = 3091 25PORT = 53091
26PLUGINS = unix 26PLUGINS = unix
27UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer2.sock 27UNIXPATH = $GNUNET_RUNTIME_DIR/test_quota_compliance_unix_transport_peer2.sock
28 28
29[transport-unix] 29[transport-unix]
30PORT = 3368 30PORT = 53368
31 31
diff --git a/src/transport/test_transport_api_data.conf b/src/transport/test_transport_api_data.conf
index 58b8e17b0..c06235a0a 100644
--- a/src/transport/test_transport_api_data.conf
+++ b/src/transport/test_transport_api_data.conf
@@ -2,8 +2,8 @@
2[PATHS] 2[PATHS]
3 3
4[transport-tcp] 4[transport-tcp]
5PORT = 2094 5PORT = 52094
6 6
7[transport-udp] 7[transport-udp]
8PORT = 2094 8PORT = 52094
9 9
diff --git a/src/transport/test_transport_api_reliability_tcp_nat_peer1.conf b/src/transport/test_transport_api_reliability_tcp_nat_peer1.conf
index 6aa9dbf22..6a2029b09 100644
--- a/src/transport/test_transport_api_reliability_tcp_nat_peer1.conf
+++ b/src/transport/test_transport_api_reliability_tcp_nat_peer1.conf
@@ -12,7 +12,7 @@ PORT = 0
12TIMEOUT = 5 s 12TIMEOUT = 5 s
13 13
14[arm] 14[arm]
15PORT = 1204 15PORT = 51204
16UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-arm.sock 16UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-arm.sock
17 17
18[statistics] 18[statistics]
diff --git a/src/transport/test_transport_api_tcp_nat_peer1.conf b/src/transport/test_transport_api_tcp_nat_peer1.conf
index b8d83ce29..fb2fcecc6 100644
--- a/src/transport/test_transport_api_tcp_nat_peer1.conf
+++ b/src/transport/test_transport_api_tcp_nat_peer1.conf
@@ -12,7 +12,7 @@ PORT = 0
12TIMEOUT = 5 s 12TIMEOUT = 5 s
13 13
14[arm] 14[arm]
15PORT = 1204 15PORT = 51204
16UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-arm.sock 16UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-arm.sock
17 17
18[statistics] 18[statistics]
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 208cab07b..4296199db 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -199,6 +199,9 @@ gnunet_service_resolver_SOURCES = \
199gnunet_service_resolver_LDADD = \ 199gnunet_service_resolver_LDADD = \
200 libgnunetutil.la \ 200 libgnunetutil.la \
201 $(GN_LIBINTL) 201 $(GN_LIBINTL)
202if HAVE_GETADDRINFO_A
203gnunet_service_resolver_LDADD += -lanl
204endif
202 205
203 206
204gnunet_resolver_SOURCES = \ 207gnunet_resolver_SOURCES = \
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 85e17248b..f875d165d 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -626,6 +626,9 @@ parse_definitions (const char *constname, int force)
626 to_line = INT_MAX; 626 to_line = INT_MAX;
627 } 627 }
628 break; 628 break;
629 default:
630 fprintf(stderr, "ERROR: Unable to parse log defintion: Syntax error.\n");
631 break;
629 } 632 }
630 start = p + 1; 633 start = p + 1;
631 state++; 634 state++;
@@ -652,6 +655,7 @@ parse_definitions (const char *constname, int force)
652 start = p + 1; 655 start = p + 1;
653 break; 656 break;
654 default: 657 default:
658 fprintf(stderr, "ERROR: Unable to parse log defintion: Syntax error.\n");
655 break; 659 break;
656 } 660 }
657 default: 661 default:
diff --git a/src/util/disk.c b/src/util/disk.c
index 31e8f12c6..e0227be70 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -830,6 +830,12 @@ GNUNET_DISK_directory_create_for_file (const char *filename)
830 errno = EINVAL; 830 errno = EINVAL;
831 return GNUNET_SYSERR; 831 return GNUNET_SYSERR;
832 } 832 }
833 if (0 == ACCESS (rdir, W_OK))
834 {
835 GNUNET_free (rdir);
836 return GNUNET_OK;
837 }
838
833 len = strlen (rdir); 839 len = strlen (rdir);
834 while ((len > 0) && (rdir[len] != DIR_SEPARATOR)) 840 while ((len > 0) && (rdir[len] != DIR_SEPARATOR))
835 len--; 841 len--;
@@ -1686,16 +1692,19 @@ GNUNET_DISK_file_open (const char *fn,
1686 return NULL; 1692 return NULL;
1687 } 1693 }
1688 if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS) 1694 if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)
1689 oflags |= (O_CREAT | O_EXCL); 1695 oflags |= (O_CREAT | O_EXCL);
1690 if (flags & GNUNET_DISK_OPEN_TRUNCATE) 1696 if (flags & GNUNET_DISK_OPEN_TRUNCATE)
1691 oflags |= O_TRUNC; 1697 oflags |= O_TRUNC;
1692 if (flags & GNUNET_DISK_OPEN_APPEND) 1698 if (flags & GNUNET_DISK_OPEN_APPEND)
1693 oflags |= O_APPEND; 1699 oflags |= O_APPEND;
1694 if (flags & GNUNET_DISK_OPEN_CREATE) 1700 if(GNUNET_NO == GNUNET_DISK_file_test(fn))
1695 { 1701 {
1696 (void) GNUNET_DISK_directory_create_for_file (expfn); 1702 if (flags & GNUNET_DISK_OPEN_CREATE )
1697 oflags |= O_CREAT; 1703 {
1698 mode = translate_unix_perms (perm); 1704 (void) GNUNET_DISK_directory_create_for_file (expfn);
1705 oflags |= O_CREAT;
1706 mode = translate_unix_perms (perm);
1707 }
1699 } 1708 }
1700 1709
1701 fd = open (expfn, oflags 1710 fd = open (expfn, oflags
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c
index d26ec659f..d90d8ec10 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -84,6 +84,16 @@ static struct IPCache *cache_head;
84 */ 84 */
85static struct IPCache *cache_tail; 85static struct IPCache *cache_tail;
86 86
87/**
88 * Pipe for asynchronously notifying about resolve result
89 */
90static struct GNUNET_DISK_PipeHandle *resolve_result_pipe;
91
92/**
93 * Task for reading from resolve_result_pipe
94 */
95static struct GNUNET_SCHEDULER_Task *resolve_result_pipe_task;
96
87 97
88#if HAVE_GETNAMEINFO 98#if HAVE_GETNAMEINFO
89/** 99/**
@@ -223,14 +233,15 @@ notify_service_client_done (void *cls)
223static void 233static void
224get_ip_as_string (struct GNUNET_SERVICE_Client *client, 234get_ip_as_string (struct GNUNET_SERVICE_Client *client,
225 int af, 235 int af,
226 const void *ip) 236 const void *ip,
237 uint32_t request_id)
227{ 238{
228 struct IPCache *pos; 239 struct IPCache *pos;
229 struct IPCache *next; 240 struct IPCache *next;
230 struct GNUNET_TIME_Absolute now; 241 struct GNUNET_TIME_Absolute now;
231 struct GNUNET_MQ_Envelope *env; 242 struct GNUNET_MQ_Envelope *env;
232 struct GNUNET_MQ_Handle *mq; 243 struct GNUNET_MQ_Handle *mq;
233 struct GNUNET_MessageHeader *msg; 244 struct GNUNET_RESOLVER_ResponseMessage *msg;
234 size_t ip_len; 245 size_t ip_len;
235 struct in6_addr ix; 246 struct in6_addr ix;
236 size_t alen; 247 size_t alen;
@@ -304,13 +315,16 @@ get_ip_as_string (struct GNUNET_SERVICE_Client *client,
304 env = GNUNET_MQ_msg_extra (msg, 315 env = GNUNET_MQ_msg_extra (msg,
305 alen, 316 alen,
306 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 317 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
318 msg->id = request_id;
307 GNUNET_memcpy (&msg[1], 319 GNUNET_memcpy (&msg[1],
308 pos->addr, 320 pos->addr,
309 alen); 321 alen);
310 GNUNET_MQ_send (mq, 322 GNUNET_MQ_send (mq,
311 env); 323 env);
324 // send end message
312 env = GNUNET_MQ_msg (msg, 325 env = GNUNET_MQ_msg (msg,
313 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 326 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
327 msg->id = request_id;
314 GNUNET_MQ_notify_sent (env, 328 GNUNET_MQ_notify_sent (env,
315 &notify_service_client_done, 329 &notify_service_client_done,
316 client); 330 client);
@@ -319,17 +333,152 @@ get_ip_as_string (struct GNUNET_SERVICE_Client *client,
319} 333}
320 334
321 335
322#if HAVE_GETADDRINFO 336#if HAVE_GETADDRINFO_A
337struct AsyncCls
338{
339 struct gaicb *host;
340 struct sigevent *sig;
341 struct GNUNET_MQ_Handle *mq;
342 uint32_t request_id;
343};
344
345
346static void
347resolve_result_pipe_cb (void *cls)
348{
349 struct AsyncCls *async_cls;
350 struct gaicb *host;
351 struct GNUNET_RESOLVER_ResponseMessage *msg;
352 struct GNUNET_MQ_Envelope *env;
353
354 GNUNET_DISK_file_read (GNUNET_DISK_pipe_handle (resolve_result_pipe,
355 GNUNET_DISK_PIPE_END_READ),
356 &async_cls,
357 sizeof (struct AsyncCls *));
358 resolve_result_pipe_task =
359 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
360 GNUNET_DISK_pipe_handle (resolve_result_pipe,
361 GNUNET_DISK_PIPE_END_READ),
362 &resolve_result_pipe_cb,
363 NULL);
364 host = async_cls->host;
365 for (struct addrinfo *pos = host->ar_result; pos != NULL; pos = pos->ai_next)
366 {
367 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
368 "Lookup result for hostname %s: %s (request ID %u)\n",
369 host->ar_name,
370 GNUNET_a2s (pos->ai_addr, pos->ai_addrlen),
371 async_cls->request_id);
372 switch (pos->ai_family)
373 {
374 case AF_INET:
375 env = GNUNET_MQ_msg_extra (msg,
376 sizeof (struct in_addr),
377 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
378 msg->id = async_cls->request_id;
379 GNUNET_memcpy (&msg[1],
380 &((struct sockaddr_in*) pos->ai_addr)->sin_addr,
381 sizeof (struct in_addr));
382 GNUNET_MQ_send (async_cls->mq,
383 env);
384 break;
385 case AF_INET6:
386 env = GNUNET_MQ_msg_extra (msg,
387 sizeof (struct in6_addr),
388 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
389 msg->id = async_cls->request_id;
390 GNUNET_memcpy (&msg[1],
391 &((struct sockaddr_in6*) pos->ai_addr)->sin6_addr,
392 sizeof (struct in6_addr));
393 GNUNET_MQ_send (async_cls->mq,
394 env);
395 break;
396 default:
397 /* unsupported, skip */
398 break;
399 }
400 }
401 // send end message
402 env = GNUNET_MQ_msg (msg,
403 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
404 msg->id = async_cls->request_id;
405 GNUNET_MQ_send (async_cls->mq,
406 env);
407 freeaddrinfo (host->ar_result);
408 GNUNET_free ((struct gaicb *)host->ar_request); // free hints
409 GNUNET_free (host);
410 GNUNET_free (async_cls->sig);
411 GNUNET_free (async_cls);
412}
413
414
415static void
416handle_async_result (union sigval val)
417{
418 GNUNET_DISK_file_write (GNUNET_DISK_pipe_handle (resolve_result_pipe,
419 GNUNET_DISK_PIPE_END_WRITE),
420 &val.sival_ptr,
421 sizeof (val.sival_ptr));
422}
423
424
425static int
426getaddrinfo_a_resolve (struct GNUNET_MQ_Handle *mq,
427 const char *hostname,
428 int af,
429 uint32_t request_id)
430{
431 int ret;
432 struct gaicb *host;
433 struct addrinfo *hints;
434 struct sigevent *sig;
435 struct AsyncCls *async_cls;
436
437 host = GNUNET_new (struct gaicb);
438 hints = GNUNET_new (struct addrinfo);
439 sig = GNUNET_new (struct sigevent);
440 async_cls = GNUNET_new (struct AsyncCls);
441 memset (hints,
442 0,
443 sizeof (struct addrinfo));
444 memset (sig,
445 0,
446 sizeof (struct sigevent));
447 hints->ai_family = af;
448 hints->ai_socktype = SOCK_STREAM; /* go for TCP */
449 host->ar_name = hostname;
450 host->ar_service = NULL;
451 host->ar_request = hints;
452 host->ar_result = NULL;
453 sig->sigev_notify = SIGEV_THREAD;
454 sig->sigev_value.sival_ptr = async_cls;
455 sig->sigev_notify_function = &handle_async_result;
456 async_cls->host = host;
457 async_cls->sig = sig;
458 async_cls->mq = mq;
459 async_cls->request_id = request_id;
460 ret = getaddrinfo_a (GAI_NOWAIT,
461 &host,
462 1,
463 sig);
464 if (0 != ret)
465 return GNUNET_SYSERR;
466 return GNUNET_OK;
467}
468
469
470#elif HAVE_GETADDRINFO
323static int 471static int
324getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq, 472getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq,
325 const char *hostname, 473 const char *hostname,
326 int af) 474 int af,
475 uint32_t request_id)
327{ 476{
328 int s; 477 int s;
329 struct addrinfo hints; 478 struct addrinfo hints;
330 struct addrinfo *result; 479 struct addrinfo *result;
331 struct addrinfo *pos; 480 struct addrinfo *pos;
332 struct GNUNET_MessageHeader *msg; 481 struct GNUNET_RESOLVER_ResponseMessage *msg;
333 struct GNUNET_MQ_Envelope *env; 482 struct GNUNET_MQ_Envelope *env;
334 483
335#ifdef WINDOWS 484#ifdef WINDOWS
@@ -340,10 +489,12 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq,
340 int ret2; 489 int ret2;
341 ret1 = getaddrinfo_resolve (mq, 490 ret1 = getaddrinfo_resolve (mq,
342 hostname, 491 hostname,
343 AF_INET); 492 AF_INET,
493 request_id);
344 ret2 = getaddrinfo_resolve (mq, 494 ret2 = getaddrinfo_resolve (mq,
345 hostname, 495 hostname,
346 AF_INET6); 496 AF_INET6,
497 request_id);
347 if ( (ret1 == GNUNET_OK) || 498 if ( (ret1 == GNUNET_OK) ||
348 (ret2 == GNUNET_OK) ) 499 (ret2 == GNUNET_OK) )
349 return GNUNET_OK; 500 return GNUNET_OK;
@@ -389,6 +540,7 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq,
389 env = GNUNET_MQ_msg_extra (msg, 540 env = GNUNET_MQ_msg_extra (msg,
390 sizeof (struct in_addr), 541 sizeof (struct in_addr),
391 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 542 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
543 msg->id = request_id;
392 GNUNET_memcpy (&msg[1], 544 GNUNET_memcpy (&msg[1],
393 &((struct sockaddr_in*) pos->ai_addr)->sin_addr, 545 &((struct sockaddr_in*) pos->ai_addr)->sin_addr,
394 sizeof (struct in_addr)); 546 sizeof (struct in_addr));
@@ -399,6 +551,7 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq,
399 env = GNUNET_MQ_msg_extra (msg, 551 env = GNUNET_MQ_msg_extra (msg,
400 sizeof (struct in6_addr), 552 sizeof (struct in6_addr),
401 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 553 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
554 msg->id = request_id;
402 GNUNET_memcpy (&msg[1], 555 GNUNET_memcpy (&msg[1],
403 &((struct sockaddr_in6*) pos->ai_addr)->sin6_addr, 556 &((struct sockaddr_in6*) pos->ai_addr)->sin6_addr,
404 sizeof (struct in6_addr)); 557 sizeof (struct in6_addr));
@@ -421,13 +574,14 @@ getaddrinfo_resolve (struct GNUNET_MQ_Handle *mq,
421static int 574static int
422gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq, 575gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq,
423 const char *hostname, 576 const char *hostname,
424 int af) 577 int af,
578 uint32_t request_id)
425{ 579{
426 struct hostent *hp; 580 struct hostent *hp;
427 int ret1; 581 int ret1;
428 int ret2; 582 int ret2;
429 struct GNUNET_MQ_Envelope *env; 583 struct GNUNET_MQ_Envelope *env;
430 struct GNUNET_MessageHeader *msg; 584 struct GNUNET_RESOLVER_ResponseMessage *msg;
431 585
432#ifdef WINDOWS 586#ifdef WINDOWS
433 /* gethostbyname2() in plibc is a compat dummy that calls gethostbyname(). */ 587 /* gethostbyname2() in plibc is a compat dummy that calls gethostbyname(). */
@@ -438,10 +592,12 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq,
438 { 592 {
439 ret1 = gethostbyname2_resolve (mq, 593 ret1 = gethostbyname2_resolve (mq,
440 hostname, 594 hostname,
441 AF_INET); 595 AF_INET,
596 request_id);
442 ret2 = gethostbyname2_resolve (mq, 597 ret2 = gethostbyname2_resolve (mq,
443 hostname, 598 hostname,
444 AF_INET6); 599 AF_INET6,
600 request_id);
445 if ( (ret1 == GNUNET_OK) || 601 if ( (ret1 == GNUNET_OK) ||
446 (ret2 == GNUNET_OK) ) 602 (ret2 == GNUNET_OK) )
447 return GNUNET_OK; 603 return GNUNET_OK;
@@ -468,6 +624,7 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq,
468 env = GNUNET_MQ_msg_extra (msg, 624 env = GNUNET_MQ_msg_extra (msg,
469 hp->h_length, 625 hp->h_length,
470 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 626 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
627 msg->id = request_id;
471 GNUNET_memcpy (&msg[1], 628 GNUNET_memcpy (&msg[1],
472 hp->h_addr_list[0], 629 hp->h_addr_list[0],
473 hp->h_length); 630 hp->h_length);
@@ -479,6 +636,7 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq,
479 env = GNUNET_MQ_msg_extra (msg, 636 env = GNUNET_MQ_msg_extra (msg,
480 hp->h_length, 637 hp->h_length,
481 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 638 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
639 msg->id = request_id;
482 GNUNET_memcpy (&msg[1], 640 GNUNET_memcpy (&msg[1],
483 hp->h_addr_list[0], 641 hp->h_addr_list[0],
484 hp->h_length); 642 hp->h_length);
@@ -497,10 +655,11 @@ gethostbyname2_resolve (struct GNUNET_MQ_Handle *mq,
497 655
498static int 656static int
499gethostbyname_resolve (struct GNUNET_MQ_Handle *mq, 657gethostbyname_resolve (struct GNUNET_MQ_Handle *mq,
500 const char *hostname) 658 const char *hostname,
659 uint32_t request_id)
501{ 660{
502 struct hostent *hp; 661 struct hostent *hp;
503 struct GNUNET_MessageHeader *msg; 662 struct GNUNET_RESOLVER_ResponseMessage *msg;
504 struct GNUNET_MQ_Envelope *env; 663 struct GNUNET_MQ_Envelope *env;
505 664
506 hp = GETHOSTBYNAME (hostname); 665 hp = GETHOSTBYNAME (hostname);
@@ -521,6 +680,7 @@ gethostbyname_resolve (struct GNUNET_MQ_Handle *mq,
521 env = GNUNET_MQ_msg_extra (msg, 680 env = GNUNET_MQ_msg_extra (msg,
522 hp->h_length, 681 hp->h_length,
523 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 682 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
683 msg->id = request_id;
524 GNUNET_memcpy (&msg[1], 684 GNUNET_memcpy (&msg[1],
525 hp->h_addr_list[0], 685 hp->h_addr_list[0],
526 hp->h_length); 686 hp->h_length);
@@ -541,34 +701,42 @@ gethostbyname_resolve (struct GNUNET_MQ_Handle *mq,
541static void 701static void
542get_ip_from_hostname (struct GNUNET_SERVICE_Client *client, 702get_ip_from_hostname (struct GNUNET_SERVICE_Client *client,
543 const char *hostname, 703 const char *hostname,
544 int af) 704 int af,
705 uint32_t request_id)
545{ 706{
546 int ret;
547 struct GNUNET_MQ_Handle *mq;
548 struct GNUNET_MQ_Envelope *env; 707 struct GNUNET_MQ_Envelope *env;
549 struct GNUNET_MessageHeader *msg; 708 struct GNUNET_RESOLVER_ResponseMessage *msg;
709 struct GNUNET_MQ_Handle *mq;
550 710
551 mq = GNUNET_SERVICE_client_get_mq (client); 711 mq = GNUNET_SERVICE_client_get_mq (client);
552 ret = GNUNET_NO; 712#if HAVE_GETADDRINFO_A
553#if HAVE_GETADDRINFO 713 getaddrinfo_a_resolve (mq,
554 if (ret == GNUNET_NO) 714 hostname,
555 ret = getaddrinfo_resolve (mq, 715 af,
556 hostname, 716 request_id);
557 af); 717 GNUNET_SERVICE_client_continue (client);
718 return;
719#elif HAVE_GETADDRINFO
720 getaddrinfo_resolve (mq,
721 hostname,
722 af,
723 request_id);
558#elif HAVE_GETHOSTBYNAME2 724#elif HAVE_GETHOSTBYNAME2
559 if (ret == GNUNET_NO) 725 gethostbyname2_resolve (mq,
560 ret = gethostbyname2_resolve (mq, 726 hostname,
561 hostname, 727 af,
562 af); 728 request_id);
563#elif HAVE_GETHOSTBYNAME 729#elif HAVE_GETHOSTBYNAME
564 if ( (ret == GNUNET_NO) && 730 if ( ( (af == AF_UNSPEC) ||
565 ( (af == AF_UNSPEC) ||
566 (af == PF_INET) ) ) 731 (af == PF_INET) ) )
567 gethostbyname_resolve (mq, 732 gethostbyname_resolve (mq,
568 hostname); 733 hostname,
734 request_id);
569#endif 735#endif
736 // send end message
570 env = GNUNET_MQ_msg (msg, 737 env = GNUNET_MQ_msg (msg,
571 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE); 738 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
739 msg->id = request_id;
572 GNUNET_MQ_notify_sent (env, 740 GNUNET_MQ_notify_sent (env,
573 &notify_service_client_done, 741 &notify_service_client_done,
574 client); 742 client);
@@ -647,21 +815,21 @@ handle_get (void *cls,
647 const void *ip; 815 const void *ip;
648 int direction; 816 int direction;
649 int af; 817 int af;
818 uint32_t id;
650 819
651 direction = ntohl (msg->direction); 820 direction = ntohl (msg->direction);
652 af = ntohl (msg->af); 821 af = ntohl (msg->af);
822 id = ntohl (msg->id);
653 if (GNUNET_NO == direction) 823 if (GNUNET_NO == direction)
654 { 824 {
655 /* IP from hostname */ 825 /* IP from hostname */
656 const char *hostname; 826 const char *hostname;
657 827
658 hostname = (const char *) &msg[1]; 828 hostname = (const char *) &msg[1];
659 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
660 "Resolver asked to look up `%s'.\n",
661 hostname);
662 get_ip_from_hostname (client, 829 get_ip_from_hostname (client,
663 hostname, 830 hostname,
664 af); 831 af,
832 id);
665 return; 833 return;
666 } 834 }
667 ip = &msg[1]; 835 ip = &msg[1];
@@ -671,16 +839,18 @@ handle_get (void *cls,
671 char buf[INET6_ADDRSTRLEN]; 839 char buf[INET6_ADDRSTRLEN];
672 840
673 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 841 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
674 "Resolver asked to look up IP address `%s'.\n", 842 "Resolver asked to look up IP address `%s (request ID %u)'.\n",
675 inet_ntop (af, 843 inet_ntop (af,
676 ip, 844 ip,
677 buf, 845 buf,
678 sizeof (buf))); 846 sizeof (buf)),
847 id);
679 } 848 }
680#endif 849#endif
681 get_ip_as_string (client, 850 get_ip_as_string (client,
682 af, 851 af,
683 ip); 852 ip,
853 id);
684} 854}
685 855
686 856
@@ -700,6 +870,19 @@ connect_cb (void *cls,
700 (void) cls; 870 (void) cls;
701 (void) mq; 871 (void) mq;
702 872
873#if HAVE_GETADDRINFO_A
874 resolve_result_pipe = GNUNET_DISK_pipe (GNUNET_NO,
875 GNUNET_NO,
876 GNUNET_NO,
877 GNUNET_NO);
878 GNUNET_assert (NULL != resolve_result_pipe);
879 resolve_result_pipe_task =
880 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
881 GNUNET_DISK_pipe_handle (resolve_result_pipe,
882 GNUNET_DISK_PIPE_END_READ),
883 &resolve_result_pipe_cb,
884 NULL);
885#endif
703 return c; 886 return c;
704} 887}
705 888
@@ -718,6 +901,18 @@ disconnect_cb (void *cls,
718{ 901{
719 (void) cls; 902 (void) cls;
720 903
904#if HAVE_GETADDRINFO_A
905 if (NULL != resolve_result_pipe_task)
906 {
907 GNUNET_SCHEDULER_cancel (resolve_result_pipe_task);
908 resolve_result_pipe_task = NULL;
909 }
910 if (NULL != resolve_result_pipe)
911 {
912 GNUNET_DISK_pipe_close (resolve_result_pipe);
913 resolve_result_pipe = NULL;
914 }
915#endif
721 GNUNET_assert (c == internal_cls); 916 GNUNET_assert (c == internal_cls);
722} 917}
723 918
diff --git a/src/util/resolver.h b/src/util/resolver.h
index 0b137f085..a0f105afa 100644
--- a/src/util/resolver.h
+++ b/src/util/resolver.h
@@ -56,10 +56,37 @@ struct GNUNET_RESOLVER_GetMessage
56 */ 56 */
57 int32_t af GNUNET_PACKED; 57 int32_t af GNUNET_PACKED;
58 58
59 /**
60 * identifies the request and is contained in the response message. The
61 * client has to match response to request by this identifier.
62 */
63 uint32_t id GNUNET_PACKED;
64
59 /* followed by 0-terminated string for A/AAAA-lookup or 65 /* followed by 0-terminated string for A/AAAA-lookup or
60 by 'struct in_addr' / 'struct in6_addr' for reverse lookup */ 66 by 'struct in_addr' / 'struct in6_addr' for reverse lookup */
61 67
62}; 68};
69
70
71struct GNUNET_RESOLVER_ResponseMessage
72{
73 /**
74 * Type: GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE
75 */
76 struct GNUNET_MessageHeader header;
77
78 /**
79 * identifies the request this message responds to. The client
80 * has to match response to request by this identifier.
81 */
82 uint32_t id GNUNET_PACKED;
83
84 /* followed by 0-terminated string for response to a reverse lookup
85 * or by 'struct in_addr' / 'struct in6_addr' for response to
86 * A/AAAA-lookup
87 */
88};
89
63GNUNET_NETWORK_STRUCT_END 90GNUNET_NETWORK_STRUCT_END
64 91
65#endif 92#endif
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c
index afebabf08..b94819f06 100644
--- a/src/util/resolver_api.c
+++ b/src/util/resolver_api.c
@@ -69,6 +69,11 @@ static struct GNUNET_RESOLVER_RequestHandle *req_head;
69static struct GNUNET_RESOLVER_RequestHandle *req_tail; 69static struct GNUNET_RESOLVER_RequestHandle *req_tail;
70 70
71/** 71/**
72 * ID of the last request we sent to the service
73 */
74static uint32_t last_request_id;
75
76/**
72 * How long should we wait to reconnect? 77 * How long should we wait to reconnect?
73 */ 78 */
74static struct GNUNET_TIME_Relative backoff; 79static struct GNUNET_TIME_Relative backoff;
@@ -137,6 +142,11 @@ struct GNUNET_RESOLVER_RequestHandle
137 int af; 142 int af;
138 143
139 /** 144 /**
145 * Identifies the request. The response will contain this id.
146 */
147 uint32_t id;
148
149 /**
140 * Has this request been transmitted to the service? 150 * Has this request been transmitted to the service?
141 * #GNUNET_YES if transmitted 151 * #GNUNET_YES if transmitted
142 * #GNUNET_YES if not transmitted 152 * #GNUNET_YES if not transmitted
@@ -435,11 +445,13 @@ process_requests ()
435 GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST); 445 GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST);
436 msg->direction = htonl (rh->direction); 446 msg->direction = htonl (rh->direction);
437 msg->af = htonl (rh->af); 447 msg->af = htonl (rh->af);
448 msg->id = htonl (rh->id);
438 GNUNET_memcpy (&msg[1], 449 GNUNET_memcpy (&msg[1],
439 &rh[1], 450 &rh[1],
440 rh->data_len); 451 rh->data_len);
441 LOG (GNUNET_ERROR_TYPE_DEBUG, 452 LOG (GNUNET_ERROR_TYPE_DEBUG,
442 "Transmitting DNS resolution request to DNS service\n"); 453 "Transmitting DNS resolution request (ID %u) to DNS service\n",
454 rh->id);
443 GNUNET_MQ_send (mq, 455 GNUNET_MQ_send (mq,
444 env); 456 env);
445 rh->was_transmitted = GNUNET_YES; 457 rh->was_transmitted = GNUNET_YES;
@@ -454,7 +466,7 @@ process_requests ()
454 */ 466 */
455static int 467static int
456check_response (void *cls, 468check_response (void *cls,
457 const struct GNUNET_MessageHeader *msg) 469 const struct GNUNET_RESOLVER_ResponseMessage *msg)
458{ 470{
459 (void) cls; 471 (void) cls;
460 (void) msg; 472 (void) msg;
@@ -474,11 +486,18 @@ check_response (void *cls,
474 */ 486 */
475static void 487static void
476handle_response (void *cls, 488handle_response (void *cls,
477 const struct GNUNET_MessageHeader *msg) 489 const struct GNUNET_RESOLVER_ResponseMessage *msg)
478{ 490{
479 struct GNUNET_RESOLVER_RequestHandle *rh = req_head; 491 struct GNUNET_RESOLVER_RequestHandle *rh = req_head;
480 uint16_t size; 492 uint16_t size;
481 char *nret; 493 char *nret;
494 uint32_t request_id = msg->id;
495
496 for (; rh != NULL; rh = rh->next)
497 {
498 if (rh->id == request_id)
499 break;
500 }
482 501
483 (void) cls; 502 (void) cls;
484 if (NULL == rh) 503 if (NULL == rh)
@@ -490,8 +509,8 @@ handle_response (void *cls,
490 reconnect (); 509 reconnect ();
491 return; 510 return;
492 } 511 }
493 size = ntohs (msg->size); 512 size = ntohs (msg->header.size);
494 if (size == sizeof (struct GNUNET_MessageHeader)) 513 if (size == sizeof (struct GNUNET_RESOLVER_ResponseMessage))
495 { 514 {
496 LOG (GNUNET_ERROR_TYPE_DEBUG, 515 LOG (GNUNET_ERROR_TYPE_DEBUG,
497 "Received empty response from DNS service\n"); 516 "Received empty response from DNS service\n");
@@ -532,7 +551,7 @@ handle_response (void *cls,
532 const char *hostname; 551 const char *hostname;
533 552
534 hostname = (const char *) &msg[1]; 553 hostname = (const char *) &msg[1];
535 if (hostname[size - sizeof (struct GNUNET_MessageHeader) - 1] != '\0') 554 if (hostname[size - sizeof (struct GNUNET_RESOLVER_ResponseMessage) - 1] != '\0')
536 { 555 {
537 GNUNET_break (0); 556 GNUNET_break (0);
538 if (GNUNET_SYSERR != rh->was_transmitted) 557 if (GNUNET_SYSERR != rh->was_transmitted)
@@ -566,7 +585,7 @@ handle_response (void *cls,
566 size_t ip_len; 585 size_t ip_len;
567 586
568 ip = &msg[1]; 587 ip = &msg[1];
569 ip_len = size - sizeof (struct GNUNET_MessageHeader); 588 ip_len = size - sizeof (struct GNUNET_RESOLVER_ResponseMessage);
570 if (ip_len == sizeof (struct in_addr)) 589 if (ip_len == sizeof (struct in_addr))
571 { 590 {
572 memset (&v4, 0, sizeof (v4)); 591 memset (&v4, 0, sizeof (v4));
@@ -763,7 +782,7 @@ reconnect_task (void *cls)
763 struct GNUNET_MQ_MessageHandler handlers[] = { 782 struct GNUNET_MQ_MessageHandler handlers[] = {
764 GNUNET_MQ_hd_var_size (response, 783 GNUNET_MQ_hd_var_size (response,
765 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE, 784 GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE,
766 struct GNUNET_MessageHeader, 785 struct GNUNET_RESOLVER_ResponseMessage,
767 NULL), 786 NULL),
768 GNUNET_MQ_handler_end () 787 GNUNET_MQ_handler_end ()
769 }; 788 };
@@ -926,6 +945,7 @@ GNUNET_RESOLVER_ip_get (const char *hostname,
926 hostname); 945 hostname);
927 rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + slen); 946 rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + slen);
928 rh->af = af; 947 rh->af = af;
948 rh->id = ++last_request_id;
929 rh->addr_callback = callback; 949 rh->addr_callback = callback;
930 rh->cls = callback_cls; 950 rh->cls = callback_cls;
931 GNUNET_memcpy (&rh[1], 951 GNUNET_memcpy (&rh[1],
@@ -1072,6 +1092,7 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa,
1072 rh->name_callback = callback; 1092 rh->name_callback = callback;
1073 rh->cls = cls; 1093 rh->cls = cls;
1074 rh->af = sa->sa_family; 1094 rh->af = sa->sa_family;
1095 rh->id = ++last_request_id;
1075 rh->timeout = GNUNET_TIME_relative_to_absolute (timeout); 1096 rh->timeout = GNUNET_TIME_relative_to_absolute (timeout);
1076 GNUNET_memcpy (&rh[1], 1097 GNUNET_memcpy (&rh[1],
1077 ip, 1098 ip,
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c
index c89fad865..5a8f95093 100644
--- a/src/util/test_resolver_api.c
+++ b/src/util/test_resolver_api.c
@@ -258,6 +258,8 @@ run (void *cls, char *const *args, const char *cfgfile,
258 /* Resolve the same using GNUNET */ 258 /* Resolve the same using GNUNET */
259 GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout, 259 GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout,
260 &check_rootserver_ip, cls); 260 &check_rootserver_ip, cls);
261 GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout,
262 &check_rootserver_ip, cls);
261 263
262 /* 264 /*
263 * Success: forward lookups work as expected 265 * Success: forward lookups work as expected