aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/contrib/Makefile.am5
-rw-r--r--src/contrib/cli/Makefile.am2
-rw-r--r--src/contrib/cli/template/.gitignore1
-rw-r--r--src/contrib/cli/template/Makefile.am9
-rw-r--r--src/lib/util/.gitignore3
-rw-r--r--src/lib/util/meson.build128
-rw-r--r--src/lib/util/test_os_network.c7
-rw-r--r--src/meson.build4
-rw-r--r--src/plugin/Makefile.am2
-rw-r--r--src/plugin/datastore/test_defaults.conf10
-rw-r--r--src/plugin/reclaim/meson.build4
-rw-r--r--src/plugin/revocation/meson.build1
-rw-r--r--src/service/cadet/gnunet-service-cadet_dht.c2
-rw-r--r--src/service/core/core_api_cmd_connecting_peers.c3
-rw-r--r--src/service/core/meson.build1
-rw-r--r--src/service/core/test_core_plugin_cmd_just_run.c134
-rw-r--r--src/service/datacache/test_datacache.c2
-rw-r--r--src/service/datacache/test_datacache_quota.c2
-rw-r--r--src/service/meson.build12
-rw-r--r--src/service/messenger/gnunet-service-messenger_message_recv.c2
-rw-r--r--src/service/nat-auto/Makefile.am2
-rw-r--r--src/service/nat/gnunet-service-nat.c2
-rw-r--r--src/service/nse/gnunet-service-nse.c2
-rw-r--r--src/service/peerstore/peerstore_api.c6
-rw-r--r--src/service/regex/gnunet-daemon-regexprofiler.c2
-rw-r--r--src/service/rest/Makefile.am12
-rw-r--r--src/service/testing/meson.build3
-rw-r--r--src/service/testing/testing_api_cmd_netjail_start_cmds_helper.c1
-rw-r--r--src/service/testing/testing_api_cmd_start_peer.c1
-rw-r--r--src/service/testing/testing_api_loop.c6
-rw-r--r--src/service/topology/gnunet-daemon-topology.c2
-rw-r--r--src/service/transport/gnunet-communicator-unix.c2
-rw-r--r--src/service/transport/gnunet-service-transport.c258
-rw-r--r--src/service/transport/meson.build1
-rw-r--r--src/service/transport/transport_api_cmd_connecting_peers.c3
35 files changed, 284 insertions, 353 deletions
diff --git a/src/contrib/Makefile.am b/src/contrib/Makefile.am
index 516fb872c..abaefb409 100644
--- a/src/contrib/Makefile.am
+++ b/src/contrib/Makefile.am
@@ -1,4 +1,3 @@
1SUBDIRS = \ 1SUBDIRS = \
2 #lib \ 2 service \
3 #plugin \ 3 cli
4 service
diff --git a/src/contrib/cli/Makefile.am b/src/contrib/cli/Makefile.am
new file mode 100644
index 000000000..3315e4bbb
--- /dev/null
+++ b/src/contrib/cli/Makefile.am
@@ -0,0 +1,2 @@
1SUBDIRS = \
2 template
diff --git a/src/contrib/cli/template/.gitignore b/src/contrib/cli/template/.gitignore
new file mode 100644
index 000000000..6ace894c0
--- /dev/null
+++ b/src/contrib/cli/template/.gitignore
@@ -0,0 +1 @@
gnunet-template
diff --git a/src/contrib/cli/template/Makefile.am b/src/contrib/cli/template/Makefile.am
index 9f94d0837..b60095d80 100644
--- a/src/contrib/cli/template/Makefile.am
+++ b/src/contrib/cli/template/Makefile.am
@@ -13,8 +13,9 @@ noinst_PROGRAMS = \
13 gnunet-template 13 gnunet-template
14 14
15 15
16gnunet_service_template_SOURCES = \ 16gnunet_template_SOURCES = \
17 gnunet-service-template.c 17 gnunet-template.c
18gnunet_service_template_LDADD = \ 18gnunet_template_LDADD = \
19 $(top_builddir)/src/lib/util/libgnunetutil.la \ 19 $(top_builddir)/src/lib/util/libgnunetutil.la
20gnunet_template_LDFLAGS = \
20 $(GN_LIBINTL) 21 $(GN_LIBINTL)
diff --git a/src/lib/util/.gitignore b/src/lib/util/.gitignore
index bfb947ae6..c6306639c 100644
--- a/src/lib/util/.gitignore
+++ b/src/lib/util/.gitignore
@@ -75,3 +75,6 @@ perf_mq
75perf_scheduler 75perf_scheduler
76test_crypto_cs 76test_crypto_cs
77test_crypto_ecc 77test_crypto_ecc
78test_child_management
79test_scheduler_hogging_cancel
80test_scheduler_hogging_priority
diff --git a/src/lib/util/meson.build b/src/lib/util/meson.build
index 70ff201bc..98d9e981c 100644
--- a/src/lib/util/meson.build
+++ b/src/lib/util/meson.build
@@ -89,11 +89,29 @@ libgnunetutil_dep = declare_dependency(link_with : libgnunetutil)
89pkg.generate(libgnunetutil, url: 'https://www.gnunet.org', 89pkg.generate(libgnunetutil, url: 'https://www.gnunet.org',
90 description : 'Provides miscellaneous utility functions and API for GNUnet') 90 description : 'Provides miscellaneous utility functions and API for GNUnet')
91 91
92executable ('test_common_logging_dummy', 92logging_dummy = executable ('test_common_logging_dummy',
93 ['test_common_logging_dummy.c'], 93 ['test_common_logging_dummy.c'],
94 dependencies: [libgnunetutil_dep], 94 dependencies: [libgnunetutil_dep],
95 include_directories: [incdir, configuration_inc], 95 include_directories: [incdir, configuration_inc],
96 install: false) 96 install: false)
97configure_file(input : 'test_client_data.conf',
98 output : 'test_client_data.conf',
99 copy: true)
100configure_file(input : 'test_speedup_data.conf',
101 output : 'test_speedup_data.conf',
102 copy: true)
103configure_file(input : 'test_program_data.conf',
104 output : 'test_program_data.conf',
105 copy: true)
106configure_file(input : 'test_service_data.conf',
107 output : 'test_service_data.conf',
108 copy: true)
109configure_file(input : 'test_configuration_data.conf',
110 output : 'test_configuration_data.conf',
111 copy: true)
112configure_file(input : 'child_management_test.sh',
113 output : 'child_management_test.sh',
114 copy: true)
97 115
98test_bio = executable ('test_bio', 116test_bio = executable ('test_bio',
99 ['test_bio.c'], 117 ['test_bio.c'],
@@ -101,7 +119,7 @@ test_bio = executable ('test_bio',
101 include_directories: [incdir, configuration_inc], 119 include_directories: [incdir, configuration_inc],
102 install: false) 120 install: false)
103test('test_bio', test_bio, 121test('test_bio', test_bio,
104 workdir: meson.current_source_dir(), 122 workdir: meson.current_build_dir(),
105 suite: ['util', 'util-bio']) 123 suite: ['util', 'util-bio'])
106test_child_management = executable ('test_child_management', 124test_child_management = executable ('test_child_management',
107 ['test_child_management.c'], 125 ['test_child_management.c'],
@@ -109,7 +127,7 @@ test_child_management = executable ('test_child_management',
109 include_directories: [incdir, configuration_inc], 127 include_directories: [incdir, configuration_inc],
110 install: false) 128 install: false)
111test('test_child_management', test_child_management, 129test('test_child_management', test_child_management,
112 workdir: meson.current_source_dir(), 130 workdir: meson.current_build_dir(),
113 suite: ['util', 'util-child']) 131 suite: ['util', 'util-child'])
114 132
115# test_client.nc 133# test_client.nc
@@ -121,7 +139,7 @@ testcommonalloc = executable ('test_common_allocation',
121 include_directories: [incdir, configuration_inc], 139 include_directories: [incdir, configuration_inc],
122 install: false) 140 install: false)
123test('test_common_allocation', testcommonalloc, 141test('test_common_allocation', testcommonalloc,
124 workdir: meson.current_source_dir(), 142 workdir: meson.current_build_dir(),
125 suite: ['util', 'util-common']) 143 suite: ['util', 'util-common'])
126 144
127testcommonlog = executable ('test_common_logging', 145testcommonlog = executable ('test_common_logging',
@@ -131,7 +149,7 @@ testcommonlog = executable ('test_common_logging',
131 include_directories: [incdir, configuration_inc], 149 include_directories: [incdir, configuration_inc],
132 install: false) 150 install: false)
133test('test_common_logging', testcommonlog, 151test('test_common_logging', testcommonlog,
134 workdir: meson.current_source_dir(), 152 workdir: meson.current_build_dir(),
135 suite: ['util', 'util-common']) 153 suite: ['util', 'util-common'])
136testcommonendian = executable ('test_common_endian', 154testcommonendian = executable ('test_common_endian',
137 ['test_common_endian.c'], 155 ['test_common_endian.c'],
@@ -140,7 +158,7 @@ testcommonendian = executable ('test_common_endian',
140 include_directories: [incdir, configuration_inc], 158 include_directories: [incdir, configuration_inc],
141 install: false) 159 install: false)
142test('test_common_endian', testcommonendian, 160test('test_common_endian', testcommonendian,
143 workdir: meson.current_source_dir(), 161 workdir: meson.current_build_dir(),
144 suite: ['util', 'util-common']) 162 suite: ['util', 'util-common'])
145testconf = executable ('test_configuration', 163testconf = executable ('test_configuration',
146 ['test_configuration.c'], 164 ['test_configuration.c'],
@@ -149,7 +167,7 @@ testconf = executable ('test_configuration',
149 include_directories: [incdir, configuration_inc], 167 include_directories: [incdir, configuration_inc],
150 install: false) 168 install: false)
151test('test_configuration', testconf, 169test('test_configuration', testconf,
152 workdir: meson.current_source_dir(), 170 workdir: meson.current_build_dir(),
153 suite: ['util', 'util-configuration']) 171 suite: ['util', 'util-configuration'])
154testcontainerbloom = executable ('test_container_bloomfilter', 172testcontainerbloom = executable ('test_container_bloomfilter',
155 ['test_container_bloomfilter.c'], 173 ['test_container_bloomfilter.c'],
@@ -158,7 +176,7 @@ testcontainerbloom = executable ('test_container_bloomfilter',
158 build_by_default: false, 176 build_by_default: false,
159 install: false) 177 install: false)
160test('test_container_bloomfilter', testcontainerbloom, 178test('test_container_bloomfilter', testcontainerbloom,
161 workdir: meson.current_source_dir(), 179 workdir: meson.current_build_dir(),
162 suite: ['util', 'util-container']) 180 suite: ['util', 'util-container'])
163 181
164testcontainerdll = executable ('test_container_dll', 182testcontainerdll = executable ('test_container_dll',
@@ -168,7 +186,7 @@ testcontainerdll = executable ('test_container_dll',
168 build_by_default: false, 186 build_by_default: false,
169 install: false) 187 install: false)
170test('test_container_dll', testcontainerdll, 188test('test_container_dll', testcontainerdll,
171 workdir: meson.current_source_dir(), 189 workdir: meson.current_build_dir(),
172 suite: ['util', 'util-container']) 190 suite: ['util', 'util-container'])
173 191
174testcontainermhm = executable ('test_container_multihashmap', 192testcontainermhm = executable ('test_container_multihashmap',
@@ -178,7 +196,7 @@ testcontainermhm = executable ('test_container_multihashmap',
178 build_by_default: false, 196 build_by_default: false,
179 install: false) 197 install: false)
180test('test_container_multihashmap', testcontainermhm, 198test('test_container_multihashmap', testcontainermhm,
181 workdir: meson.current_source_dir(), 199 workdir: meson.current_build_dir(),
182 suite: ['util', 'util-container']) 200 suite: ['util', 'util-container'])
183 201
184testcontainermhm32 = executable ('test_container_multihashmap32', 202testcontainermhm32 = executable ('test_container_multihashmap32',
@@ -188,7 +206,7 @@ testcontainermhm32 = executable ('test_container_multihashmap32',
188 build_by_default: false, 206 build_by_default: false,
189 install: false) 207 install: false)
190test('test_container_multihashmap32', testcontainermhm32, 208test('test_container_multihashmap32', testcontainermhm32,
191 workdir: meson.current_source_dir(), 209 workdir: meson.current_build_dir(),
192 suite: ['util', 'util-container']) 210 suite: ['util', 'util-container'])
193 211
194testcontainermpm = executable ('test_container_multipeermap', 212testcontainermpm = executable ('test_container_multipeermap',
@@ -198,7 +216,7 @@ testcontainermpm = executable ('test_container_multipeermap',
198 build_by_default: false, 216 build_by_default: false,
199 install: false) 217 install: false)
200test('test_container_multipeermap', testcontainermpm, 218test('test_container_multipeermap', testcontainermpm,
201 workdir: meson.current_source_dir(), 219 workdir: meson.current_build_dir(),
202 suite: ['util', 'util-container']) 220 suite: ['util', 'util-container'])
203 221
204testcontainerheap = executable ('test_container_heap', 222testcontainerheap = executable ('test_container_heap',
@@ -208,7 +226,7 @@ testcontainerheap = executable ('test_container_heap',
208 build_by_default: false, 226 build_by_default: false,
209 install: false) 227 install: false)
210test('test_container_heap', testcontainerheap, 228test('test_container_heap', testcontainerheap,
211 workdir: meson.current_source_dir(), 229 workdir: meson.current_build_dir(),
212 suite: ['util', 'util-container']) 230 suite: ['util', 'util-container'])
213 231
214testcrypto_symmetric = executable ('test_crypto_symmetric', 232testcrypto_symmetric = executable ('test_crypto_symmetric',
@@ -218,7 +236,7 @@ testcrypto_symmetric = executable ('test_crypto_symmetric',
218 build_by_default: false, 236 build_by_default: false,
219 install: false) 237 install: false)
220test('test_crypto_symmetric', testcrypto_symmetric, 238test('test_crypto_symmetric', testcrypto_symmetric,
221 workdir: meson.current_source_dir(), 239 workdir: meson.current_build_dir(),
222 suite: ['util', 'util-crypto']) 240 suite: ['util', 'util-crypto'])
223 241
224testcrypto_crc = executable ('test_crypto_crc', 242testcrypto_crc = executable ('test_crypto_crc',
@@ -228,7 +246,7 @@ testcrypto_crc = executable ('test_crypto_crc',
228 build_by_default: false, 246 build_by_default: false,
229 install: false) 247 install: false)
230test('test_crypto_crc', testcrypto_crc, 248test('test_crypto_crc', testcrypto_crc,
231 workdir: meson.current_source_dir(), 249 workdir: meson.current_build_dir(),
232 suite: ['util', 'util-crypto']) 250 suite: ['util', 'util-crypto'])
233 251
234testcrypto_cs = executable ('test_crypto_cs', 252testcrypto_cs = executable ('test_crypto_cs',
@@ -238,7 +256,7 @@ testcrypto_cs = executable ('test_crypto_cs',
238 build_by_default: false, 256 build_by_default: false,
239 install: false) 257 install: false)
240test('test_crypto_cs', testcrypto_cs, 258test('test_crypto_cs', testcrypto_cs,
241 workdir: meson.current_source_dir(), 259 workdir: meson.current_build_dir(),
242 suite: ['util', 'util-crypto']) 260 suite: ['util', 'util-crypto'])
243 261
244testcrypto_ecdsa = executable ('test_crypto_ecdsa', 262testcrypto_ecdsa = executable ('test_crypto_ecdsa',
@@ -248,7 +266,7 @@ testcrypto_ecdsa = executable ('test_crypto_ecdsa',
248 build_by_default: false, 266 build_by_default: false,
249 install: false) 267 install: false)
250test('test_crypto_ecdsa', testcrypto_ecdsa, 268test('test_crypto_ecdsa', testcrypto_ecdsa,
251 workdir: meson.current_source_dir(), 269 workdir: meson.current_build_dir(),
252 suite: ['util', 'util-crypto']) 270 suite: ['util', 'util-crypto'])
253 271
254testcrypto_eddsa = executable ('test_crypto_eddsa', 272testcrypto_eddsa = executable ('test_crypto_eddsa',
@@ -258,7 +276,7 @@ testcrypto_eddsa = executable ('test_crypto_eddsa',
258 build_by_default: false, 276 build_by_default: false,
259 install: false) 277 install: false)
260test('test_crypto_eddsa', testcrypto_eddsa, 278test('test_crypto_eddsa', testcrypto_eddsa,
261 workdir: meson.current_source_dir(), 279 workdir: meson.current_build_dir(),
262 suite: ['util', 'util-crypto']) 280 suite: ['util', 'util-crypto'])
263 281
264testcrypto_ecdh_eddsa = executable ('test_crypto_ecdh_eddsa', 282testcrypto_ecdh_eddsa = executable ('test_crypto_ecdh_eddsa',
@@ -268,7 +286,7 @@ testcrypto_ecdh_eddsa = executable ('test_crypto_ecdh_eddsa',
268 build_by_default: false, 286 build_by_default: false,
269 install: false) 287 install: false)
270test('test_crypto_ecdh_eddsa', testcrypto_ecdh_eddsa, 288test('test_crypto_ecdh_eddsa', testcrypto_ecdh_eddsa,
271 workdir: meson.current_source_dir(), 289 workdir: meson.current_build_dir(),
272 suite: ['util', 'util-crypto']) 290 suite: ['util', 'util-crypto'])
273 291
274testcrypto_ecdh_ecdsa = executable ('test_crypto_ecdh_ecdsa', 292testcrypto_ecdh_ecdsa = executable ('test_crypto_ecdh_ecdsa',
@@ -278,7 +296,7 @@ testcrypto_ecdh_ecdsa = executable ('test_crypto_ecdh_ecdsa',
278 build_by_default: false, 296 build_by_default: false,
279 install: false) 297 install: false)
280test('test_crypto_ecdh_ecdsa', testcrypto_ecdh_ecdsa, 298test('test_crypto_ecdh_ecdsa', testcrypto_ecdh_ecdsa,
281 workdir: meson.current_source_dir(), 299 workdir: meson.current_build_dir(),
282 suite: ['util', 'util-crypto']) 300 suite: ['util', 'util-crypto'])
283 301
284testcrypto_edx25519 = executable ('test_crypto_edx25519', 302testcrypto_edx25519 = executable ('test_crypto_edx25519',
@@ -288,7 +306,7 @@ testcrypto_edx25519 = executable ('test_crypto_edx25519',
288 build_by_default: false, 306 build_by_default: false,
289 install: false) 307 install: false)
290test('test_crypto_edx25519', testcrypto_edx25519, 308test('test_crypto_edx25519', testcrypto_edx25519,
291 workdir: meson.current_source_dir(), 309 workdir: meson.current_build_dir(),
292 suite: ['util', 'util-crypto']) 310 suite: ['util', 'util-crypto'])
293 311
294testcrypto_ecc_dlog = executable ('test_crypto_ecc_dlog', 312testcrypto_ecc_dlog = executable ('test_crypto_ecc_dlog',
@@ -298,7 +316,7 @@ testcrypto_ecc_dlog = executable ('test_crypto_ecc_dlog',
298 build_by_default: false, 316 build_by_default: false,
299 install: false) 317 install: false)
300test('test_crypto_ecc_dlog', testcrypto_ecc_dlog, 318test('test_crypto_ecc_dlog', testcrypto_ecc_dlog,
301 workdir: meson.current_source_dir(), 319 workdir: meson.current_build_dir(),
302 suite: ['util', 'util-crypto']) 320 suite: ['util', 'util-crypto'])
303 321
304testcrypto_hash = executable ('test_crypto_hash', 322testcrypto_hash = executable ('test_crypto_hash',
@@ -308,7 +326,7 @@ testcrypto_hash = executable ('test_crypto_hash',
308 build_by_default: false, 326 build_by_default: false,
309 install: false) 327 install: false)
310test('test_crypto_hash', testcrypto_hash, 328test('test_crypto_hash', testcrypto_hash,
311 workdir: meson.current_source_dir(), 329 workdir: meson.current_build_dir(),
312 suite: ['util', 'util-crypto']) 330 suite: ['util', 'util-crypto'])
313 331
314testcrypto_hash_context = executable ('test_crypto_hash_context', 332testcrypto_hash_context = executable ('test_crypto_hash_context',
@@ -318,7 +336,7 @@ testcrypto_hash_context = executable ('test_crypto_hash_context',
318 build_by_default: false, 336 build_by_default: false,
319 install: false) 337 install: false)
320test('test_crypto_hash_context', testcrypto_hash_context, 338test('test_crypto_hash_context', testcrypto_hash_context,
321 workdir: meson.current_source_dir(), 339 workdir: meson.current_build_dir(),
322 suite: ['util', 'util-crypto']) 340 suite: ['util', 'util-crypto'])
323 341
324testcrypto_hkdf = executable ('test_crypto_hkdf', 342testcrypto_hkdf = executable ('test_crypto_hkdf',
@@ -328,7 +346,7 @@ testcrypto_hkdf = executable ('test_crypto_hkdf',
328 build_by_default: false, 346 build_by_default: false,
329 install: false) 347 install: false)
330test('test_crypto_hkdf', testcrypto_hkdf, 348test('test_crypto_hkdf', testcrypto_hkdf,
331 workdir: meson.current_source_dir(), 349 workdir: meson.current_build_dir(),
332 suite: ['util', 'util-crypto']) 350 suite: ['util', 'util-crypto'])
333 351
334testcrypto_kdf = executable ('test_crypto_kdf', 352testcrypto_kdf = executable ('test_crypto_kdf',
@@ -338,7 +356,7 @@ testcrypto_kdf = executable ('test_crypto_kdf',
338 build_by_default: false, 356 build_by_default: false,
339 install: false) 357 install: false)
340test('test_crypto_kdf', testcrypto_kdf, 358test('test_crypto_kdf', testcrypto_kdf,
341 workdir: meson.current_source_dir(), 359 workdir: meson.current_build_dir(),
342 suite: ['util', 'util-crypto']) 360 suite: ['util', 'util-crypto'])
343 361
344testcrypto_paillier = executable ('test_crypto_paillier', 362testcrypto_paillier = executable ('test_crypto_paillier',
@@ -348,7 +366,7 @@ testcrypto_paillier = executable ('test_crypto_paillier',
348 build_by_default: false, 366 build_by_default: false,
349 install: false) 367 install: false)
350test('test_crypto_paillier', testcrypto_paillier, 368test('test_crypto_paillier', testcrypto_paillier,
351 workdir: meson.current_source_dir(), 369 workdir: meson.current_build_dir(),
352 suite: ['util', 'util-crypto']) 370 suite: ['util', 'util-crypto'])
353 371
354testcrypto_random = executable ('test_crypto_random', 372testcrypto_random = executable ('test_crypto_random',
@@ -358,7 +376,7 @@ testcrypto_random = executable ('test_crypto_random',
358 build_by_default: false, 376 build_by_default: false,
359 install: false) 377 install: false)
360test('test_crypto_random', testcrypto_random, 378test('test_crypto_random', testcrypto_random,
361 workdir: meson.current_source_dir(), 379 workdir: meson.current_build_dir(),
362 suite: ['util', 'util-crypto']) 380 suite: ['util', 'util-crypto'])
363 381
364testcrypto_rsa = executable ('test_crypto_rsa', 382testcrypto_rsa = executable ('test_crypto_rsa',
@@ -368,7 +386,7 @@ testcrypto_rsa = executable ('test_crypto_rsa',
368 build_by_default: false, 386 build_by_default: false,
369 install: false) 387 install: false)
370test('test_crypto_rsa', testcrypto_rsa, 388test('test_crypto_rsa', testcrypto_rsa,
371 workdir: meson.current_source_dir(), 389 workdir: meson.current_build_dir(),
372 suite: ['util', 'util-crypto']) 390 suite: ['util', 'util-crypto'])
373 391
374testdisk = executable ('test_disk', 392testdisk = executable ('test_disk',
@@ -378,7 +396,7 @@ testdisk = executable ('test_disk',
378 build_by_default: false, 396 build_by_default: false,
379 install: false) 397 install: false)
380test('test_disk', testdisk, 398test('test_disk', testdisk,
381 workdir: meson.current_source_dir(), 399 workdir: meson.current_build_dir(),
382 suite: ['util', 'util-misc']) 400 suite: ['util', 'util-misc'])
383 401
384testgetopt = executable ('test_getopt', 402testgetopt = executable ('test_getopt',
@@ -388,7 +406,7 @@ testgetopt = executable ('test_getopt',
388 build_by_default: false, 406 build_by_default: false,
389 install: false) 407 install: false)
390test('test_getopt', testgetopt, 408test('test_getopt', testgetopt,
391 workdir: meson.current_source_dir(), 409 workdir: meson.current_build_dir(),
392 suite: ['util', 'util-misc']) 410 suite: ['util', 'util-misc'])
393 411
394testhexcoder = executable ('test_hexcoder', 412testhexcoder = executable ('test_hexcoder',
@@ -398,7 +416,7 @@ testhexcoder = executable ('test_hexcoder',
398 build_by_default: false, 416 build_by_default: false,
399 install: false) 417 install: false)
400test('test_hexcoder', testhexcoder, 418test('test_hexcoder', testhexcoder,
401 workdir: meson.current_source_dir(), 419 workdir: meson.current_build_dir(),
402 suite: ['util', 'util-misc']) 420 suite: ['util', 'util-misc'])
403 421
404testmq = executable ('test_mq', 422testmq = executable ('test_mq',
@@ -408,7 +426,7 @@ testmq = executable ('test_mq',
408 build_by_default: false, 426 build_by_default: false,
409 install: false) 427 install: false)
410test('test_mq', testmq, 428test('test_mq', testmq,
411 workdir: meson.current_source_dir(), 429 workdir: meson.current_build_dir(),
412 suite: ['util', 'util-misc']) 430 suite: ['util', 'util-misc'])
413 431
414testos_network = executable ('test_os_network', 432testos_network = executable ('test_os_network',
@@ -418,7 +436,7 @@ testos_network = executable ('test_os_network',
418 build_by_default: false, 436 build_by_default: false,
419 install: false) 437 install: false)
420test('test_os_network', testos_network, 438test('test_os_network', testos_network,
421 workdir: meson.current_source_dir(), 439 workdir: meson.current_build_dir(),
422 suite: ['util', 'util-os']) 440 suite: ['util', 'util-os'])
423 441
424testpeer = executable ('test_peer', 442testpeer = executable ('test_peer',
@@ -428,9 +446,15 @@ testpeer = executable ('test_peer',
428 build_by_default: false, 446 build_by_default: false,
429 install: false) 447 install: false)
430test('test_peer', testpeer, 448test('test_peer', testpeer,
431 workdir: meson.current_source_dir(), 449 workdir: meson.current_build_dir(),
432 suite: ['util', 'util-misc']) 450 suite: ['util', 'util-misc'])
433 451
452testplugin_plug = shared_module ('gnunet_plugin_utiltest',
453 ['test_plugin_plug.c'],
454 dependencies: [libgnunetutil_dep],
455 include_directories: [incdir, configuration_inc],
456 build_by_default: false,
457 install: false)
434testplugin = executable ('test_plugin', 458testplugin = executable ('test_plugin',
435 ['test_plugin.c'], 459 ['test_plugin.c'],
436 dependencies: [libgnunetutil_dep], 460 dependencies: [libgnunetutil_dep],
@@ -438,7 +462,8 @@ testplugin = executable ('test_plugin',
438 build_by_default: false, 462 build_by_default: false,
439 install: false) 463 install: false)
440test('test_plugin', testplugin, 464test('test_plugin', testplugin,
441 workdir: meson.current_source_dir(), 465 depends: [testplugin_plug],
466 workdir: meson.current_build_dir(),
442 suite: ['util', 'util-misc']) 467 suite: ['util', 'util-misc'])
443 468
444testprogram = executable ('test_program', 469testprogram = executable ('test_program',
@@ -448,7 +473,7 @@ testprogram = executable ('test_program',
448 build_by_default: false, 473 build_by_default: false,
449 install: false) 474 install: false)
450test('test_program', testprogram, 475test('test_program', testprogram,
451 workdir: meson.current_source_dir(), 476 workdir: meson.current_build_dir(),
452 suite: ['util', 'util-misc']) 477 suite: ['util', 'util-misc'])
453 478
454testregex = executable ('test_regex', 479testregex = executable ('test_regex',
@@ -458,7 +483,7 @@ testregex = executable ('test_regex',
458 build_by_default: false, 483 build_by_default: false,
459 install: false) 484 install: false)
460test('test_regex', testregex, 485test('test_regex', testregex,
461 workdir: meson.current_source_dir(), 486 workdir: meson.current_build_dir(),
462 suite: ['util', 'util-misc']) 487 suite: ['util', 'util-misc'])
463 488
464# test_resolver_api.nc 489# test_resolver_api.nc
@@ -470,7 +495,7 @@ testscheduler = executable ('test_scheduler',
470 build_by_default: false, 495 build_by_default: false,
471 install: false) 496 install: false)
472test('test_scheduler', testscheduler, 497test('test_scheduler', testscheduler,
473 workdir: meson.current_source_dir(), 498 workdir: meson.current_build_dir(),
474 suite: ['util', 'util-scheduler']) 499 suite: ['util', 'util-scheduler'])
475 500
476testscheduler_delay = executable ('test_scheduler_delay', 501testscheduler_delay = executable ('test_scheduler_delay',
@@ -480,7 +505,7 @@ testscheduler_delay = executable ('test_scheduler_delay',
480 build_by_default: false, 505 build_by_default: false,
481 install: false) 506 install: false)
482test('test_scheduler_delay', testscheduler_delay, 507test('test_scheduler_delay', testscheduler_delay,
483 workdir: meson.current_source_dir(), 508 workdir: meson.current_build_dir(),
484 suite: ['util', 'util-scheduler']) 509 suite: ['util', 'util-scheduler'])
485 510
486testscheduler_hogging_cancel = executable ('test_scheduler_hogging_cancel', 511testscheduler_hogging_cancel = executable ('test_scheduler_hogging_cancel',
@@ -490,7 +515,7 @@ testscheduler_hogging_cancel = executable ('test_scheduler_hogging_cancel',
490 build_by_default: false, 515 build_by_default: false,
491 install: false) 516 install: false)
492test('test_scheduler_hogging_cancel', testscheduler_hogging_cancel, 517test('test_scheduler_hogging_cancel', testscheduler_hogging_cancel,
493 workdir: meson.current_source_dir(), 518 workdir: meson.current_build_dir(),
494 suite: ['util', 'util-scheduler']) 519 suite: ['util', 'util-scheduler'])
495 520
496testscheduler_hogging_prio = executable ('test_scheduler_hogging_priority', 521testscheduler_hogging_prio = executable ('test_scheduler_hogging_priority',
@@ -500,7 +525,7 @@ testscheduler_hogging_prio = executable ('test_scheduler_hogging_priority',
500 build_by_default: false, 525 build_by_default: false,
501 install: false) 526 install: false)
502test('test_scheduler_hogging_priority', testscheduler_hogging_prio, 527test('test_scheduler_hogging_priority', testscheduler_hogging_prio,
503 workdir: meson.current_source_dir(), 528 workdir: meson.current_build_dir(),
504 suite: ['util', 'util-scheduler']) 529 suite: ['util', 'util-scheduler'])
505 530
506testservice = executable ('test_service', 531testservice = executable ('test_service',
@@ -510,7 +535,7 @@ testservice = executable ('test_service',
510 build_by_default: false, 535 build_by_default: false,
511 install: false) 536 install: false)
512test('test_service', testservice, 537test('test_service', testservice,
513 workdir: meson.current_source_dir(), 538 workdir: meson.current_build_dir(),
514 suite: ['util', 'util-misc']) 539 suite: ['util', 'util-misc'])
515 540
516teststrings = executable ('test_strings', 541teststrings = executable ('test_strings',
@@ -520,7 +545,7 @@ teststrings = executable ('test_strings',
520 build_by_default: false, 545 build_by_default: false,
521 install: false) 546 install: false)
522test('test_strings', teststrings, 547test('test_strings', teststrings,
523 workdir: meson.current_source_dir(), 548 workdir: meson.current_build_dir(),
524 suite: ['util', 'util-strings']) 549 suite: ['util', 'util-strings'])
525 550
526teststrings_todata = executable ('test_strings_to_data', 551teststrings_todata = executable ('test_strings_to_data',
@@ -530,7 +555,7 @@ teststrings_todata = executable ('test_strings_to_data',
530 build_by_default: false, 555 build_by_default: false,
531 install: false) 556 install: false)
532test('test_strings_to_data', teststrings_todata, 557test('test_strings_to_data', teststrings_todata,
533 workdir: meson.current_source_dir(), 558 workdir: meson.current_build_dir(),
534 suite: ['util', 'util-strings']) 559 suite: ['util', 'util-strings'])
535 560
536testspeedup = executable ('test_speedup', 561testspeedup = executable ('test_speedup',
@@ -540,7 +565,7 @@ testspeedup = executable ('test_speedup',
540 build_by_default: false, 565 build_by_default: false,
541 install: false) 566 install: false)
542test('test_speedup', testspeedup, 567test('test_speedup', testspeedup,
543 workdir: meson.current_source_dir(), 568 workdir: meson.current_build_dir(),
544 suite: ['util', 'util-misc']) 569 suite: ['util', 'util-misc'])
545 570
546testtime = executable ('test_time', 571testtime = executable ('test_time',
@@ -550,7 +575,7 @@ testtime = executable ('test_time',
550 build_by_default: false, 575 build_by_default: false,
551 install: false) 576 install: false)
552test('test_time', testtime, 577test('test_time', testtime,
553 workdir: meson.current_source_dir(), 578 workdir: meson.current_build_dir(),
554 suite: ['util', 'util-misc']) 579 suite: ['util', 'util-misc'])
555 580
556testtun = executable ('test_tun', 581testtun = executable ('test_tun',
@@ -560,7 +585,7 @@ testtun = executable ('test_tun',
560 build_by_default: false, 585 build_by_default: false,
561 install: false) 586 install: false)
562test('test_tun', testtun, 587test('test_tun', testtun,
563 workdir: meson.current_source_dir(), 588 workdir: meson.current_build_dir(),
564 suite: ['util', 'util-misc']) 589 suite: ['util', 'util-misc'])
565 590
566testuri = executable ('test_uri', 591testuri = executable ('test_uri',
@@ -570,7 +595,7 @@ testuri = executable ('test_uri',
570 build_by_default: false, 595 build_by_default: false,
571 install: false) 596 install: false)
572test('test_uri', testuri, 597test('test_uri', testuri,
573 workdir: meson.current_source_dir(), 598 workdir: meson.current_build_dir(),
574 suite: ['util', 'util-misc']) 599 suite: ['util', 'util-misc'])
575 600
576# FIXME Benchmarks 601# FIXME Benchmarks
@@ -582,7 +607,7 @@ testos_start_process = executable ('test_os_start_process',
582 build_by_default: false, 607 build_by_default: false,
583 install: false) 608 install: false)
584test('test_os_start_process', testos_start_process, 609test('test_os_start_process', testos_start_process,
585 workdir: meson.current_source_dir(), 610 workdir: meson.current_build_dir(),
586 suite: ['util', 'util-os']) 611 suite: ['util', 'util-os'])
587 612
588testcommon_logging_runtime = executable ('test_common_logging_runtime_loglevels', 613testcommon_logging_runtime = executable ('test_common_logging_runtime_loglevels',
@@ -592,7 +617,8 @@ testcommon_logging_runtime = executable ('test_common_logging_runtime_loglevels'
592 build_by_default: false, 617 build_by_default: false,
593 install: false) 618 install: false)
594test('test_common_logging_runtime_loglevels', testcommon_logging_runtime, 619test('test_common_logging_runtime_loglevels', testcommon_logging_runtime,
595 workdir: meson.current_source_dir(), 620 depends: [logging_dummy],
621 workdir: meson.current_build_dir(),
596 suite: ['util', 'util-common']) 622 suite: ['util', 'util-common'])
597 623
598 624
diff --git a/src/lib/util/test_os_network.c b/src/lib/util/test_os_network.c
index 74e98663b..3bf4e1ba0 100644
--- a/src/lib/util/test_os_network.c
+++ b/src/lib/util/test_os_network.c
@@ -44,22 +44,23 @@ proc (void *cls,
44 char buf[INET6_ADDRSTRLEN]; 44 char buf[INET6_ADDRSTRLEN];
45 const char *protocol; 45 const char *protocol;
46 46
47 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "hiho\n");
47 if (NULL == addr) 48 if (NULL == addr)
48 return GNUNET_OK; 49 return GNUNET_OK;
49 if (addrlen == sizeof(struct sockaddr_in)) 50 if (addrlen == sizeof(struct sockaddr_in))
50 protocol = "IPv4"; 51 protocol = "IPv4";
51 else 52 else
52 protocol = "IPv6"; 53 protocol = "IPv6";
53 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 54 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
54 "%s Address `%s'\n", 55 "%s Address `%s'\n",
55 protocol, 56 protocol,
56 GNUNET_a2s ((const struct sockaddr *) addr, 57 GNUNET_a2s ((const struct sockaddr *) addr,
57 addrlen)); 58 addrlen));
58 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 59 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
59 "Netmask `%s'\n", 60 "Netmask `%s'\n",
60 GNUNET_a2s ((const struct sockaddr *) netmask, 61 GNUNET_a2s ((const struct sockaddr *) netmask,
61 addrlen)); 62 addrlen));
62 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 63 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
63 "`%s'\n", 64 "`%s'\n",
64 GNUNET_a2s ((const struct sockaddr *) broadcast_addr, 65 GNUNET_a2s ((const struct sockaddr *) broadcast_addr,
65 addrlen)); 66 addrlen));
diff --git a/src/meson.build b/src/meson.build
index 8f8342a4d..03b5fd3eb 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,7 +1,3 @@
1if get_option('monolith') == true
2 gnunet_src = []
3endif
4
5subdir('include') 1subdir('include')
6subdir('lib') 2subdir('lib')
7subdir('plugin') 3subdir('plugin')
diff --git a/src/plugin/Makefile.am b/src/plugin/Makefile.am
index 78e06fd63..f74726ea2 100644
--- a/src/plugin/Makefile.am
+++ b/src/plugin/Makefile.am
@@ -8,6 +8,8 @@ SUBDIRS = \
8 namecache \ 8 namecache \
9 namestore \ 9 namestore \
10 dht \ 10 dht \
11 setu \
12 seti \
11 revocation \ 13 revocation \
12 regex \ 14 regex \
13 gns \ 15 gns \
diff --git a/src/plugin/datastore/test_defaults.conf b/src/plugin/datastore/test_defaults.conf
new file mode 100644
index 000000000..1f971de8f
--- /dev/null
+++ b/src/plugin/datastore/test_defaults.conf
@@ -0,0 +1,10 @@
1@inline@ ../../contrib/conf/gnunet/no_autostart_above_core.conf
2@inline@ ../../contrib/conf/gnunet/no_forcestart.conf
3
4[datastore]
5PORT = 22654
6QUOTA = 1 MB
7START_ON_DEMAND = YES
8
9[nse]
10WORKBITS = 1
diff --git a/src/plugin/reclaim/meson.build b/src/plugin/reclaim/meson.build
index df0289ca2..cde9fc726 100644
--- a/src/plugin/reclaim/meson.build
+++ b/src/plugin/reclaim/meson.build
@@ -15,7 +15,9 @@ shared_module('gnunet_plugin_reclaim_attribute_basic',
15 install: true, 15 install: true,
16 install_dir: get_option('libdir') / 'gnunet') 16 install_dir: get_option('libdir') / 'gnunet')
17shared_module('gnunet_plugin_reclaim_credential_jwt', 17shared_module('gnunet_plugin_reclaim_credential_jwt',
18 ['plugin_reclaim_credential_jwt.c'], 18 ['plugin_reclaim_credential_jwt.c',
19 '../../service/reclaim/reclaim_attribute.c',
20 '../../service/reclaim/reclaim_credential.c'],
19 dependencies: [ 21 dependencies: [
20 libgnunetjson_dep, 22 libgnunetjson_dep,
21 libgnunetutil_dep, 23 libgnunetutil_dep,
diff --git a/src/plugin/revocation/meson.build b/src/plugin/revocation/meson.build
index c4405e9b8..0ac8df28d 100644
--- a/src/plugin/revocation/meson.build
+++ b/src/plugin/revocation/meson.build
@@ -1,6 +1,7 @@
1shared_module('gnunet_plugin_block_revocation', 1shared_module('gnunet_plugin_block_revocation',
2 ['plugin_block_revocation.c'], 2 ['plugin_block_revocation.c'],
3 dependencies: [libgnunetutil_dep, 3 dependencies: [libgnunetutil_dep,
4 libgnunetgnsrecord_dep,
4 libgnunetblock_dep], 5 libgnunetblock_dep],
5 include_directories: [incdir, configuration_inc], 6 include_directories: [incdir, configuration_inc],
6 install: true, 7 install: true,
diff --git a/src/service/cadet/gnunet-service-cadet_dht.c b/src/service/cadet/gnunet-service-cadet_dht.c
index 215f6e184..ef5669344 100644
--- a/src/service/cadet/gnunet-service-cadet_dht.c
+++ b/src/service/cadet/gnunet-service-cadet_dht.c
@@ -120,7 +120,7 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
120 const void *data) 120 const void *data)
121{ 121{
122 const struct GNUNET_MessageHeader *hello = data; 122 const struct GNUNET_MessageHeader *hello = data;
123 const struct GNUNET_HELLO_Builder *builder = GNUNET_HELLO_builder_from_msg (hello); 123 struct GNUNET_HELLO_Builder *builder = GNUNET_HELLO_builder_from_msg (hello);
124 124
125 GNUNET_assert (NULL != builder); 125 GNUNET_assert (NULL != builder);
126 (void) trunc_peer; 126 (void) trunc_peer;
diff --git a/src/service/core/core_api_cmd_connecting_peers.c b/src/service/core/core_api_cmd_connecting_peers.c
index 0dde3d61b..5a80ee415 100644
--- a/src/service/core/core_api_cmd_connecting_peers.c
+++ b/src/service/core/core_api_cmd_connecting_peers.c
@@ -134,12 +134,11 @@ connect_peers_run (void *cls,
134 { 134 {
135 char *prefix; 135 char *prefix;
136 char *rest; 136 char *rest;
137 char *rest2;
138 char *address; 137 char *address;
139 138
140 prefix = strtok (addr, "_"); 139 prefix = strtok (addr, "_");
141 rest = strtok (NULL, "_"); 140 rest = strtok (NULL, "_");
142 rest2 = strtok (rest, "-"); 141 strtok (rest, "-");
143 address = strtok (NULL, "-"); 142 address = strtok (NULL, "-");
144 143
145 GNUNET_asprintf (&addr_and_port, 144 GNUNET_asprintf (&addr_and_port,
diff --git a/src/service/core/meson.build b/src/service/core/meson.build
index 6de15cd6d..483aa0a11 100644
--- a/src/service/core/meson.build
+++ b/src/service/core/meson.build
@@ -50,6 +50,7 @@ libgnunetcoretesting_dep = declare_dependency(link_with : libgnunetcoretesting)
50shared_module('gnunet_test_core_plugin_cmd_just_run', 50shared_module('gnunet_test_core_plugin_cmd_just_run',
51 ['test_core_plugin_cmd_just_run.c'], 51 ['test_core_plugin_cmd_just_run.c'],
52 dependencies: [libgnunetutil_dep, 52 dependencies: [libgnunetutil_dep,
53 libgnunettesting_dep,
53 libgnunetcoretesting_dep, 54 libgnunetcoretesting_dep,
54 libgnunettransportcore_dep, 55 libgnunettransportcore_dep,
55 libgnunettransportapplication_dep, 56 libgnunettransportapplication_dep,
diff --git a/src/service/core/test_core_plugin_cmd_just_run.c b/src/service/core/test_core_plugin_cmd_just_run.c
index 04b65607d..edb458577 100644
--- a/src/service/core/test_core_plugin_cmd_just_run.c
+++ b/src/service/core/test_core_plugin_cmd_just_run.c
@@ -56,8 +56,6 @@ static struct GNUNET_TESTING_Command start_peer;
56 56
57static struct GNUNET_TESTING_Interpreter *is; 57static struct GNUNET_TESTING_Interpreter *is;
58 58
59static struct GNUNET_CONTAINER_MultiPeerMap *senders;
60
61struct TestState 59struct TestState
62{ 60{
63 /** 61 /**
@@ -133,16 +131,6 @@ get_waiting_for_barriers ()
133 131
134 132
135/** 133/**
136 * Callback to set the flag indicating all peers started. Will be called via the plugin api.
137 *
138 */
139static void
140all_peers_started ()
141{
142}
143
144
145/**
146 * Function called with the final result of the test. 134 * Function called with the final result of the test.
147 * 135 *
148 * @param cls the `struct MainParams` 136 * @param cls the `struct MainParams`
@@ -166,48 +154,6 @@ handle_result (void *cls,
166} 154}
167 155
168 156
169/**
170 * Callback from start peer cmd for signaling a peer got connected.
171 *
172 *
173static void *
174notify_connect (struct GNUNET_TESTING_Interpreter *is,
175 const struct GNUNET_PeerIdentity *peer)
176{
177 const struct ConnectPeersState *cps;
178 const struct GNUNET_TESTING_Command *cmd;
179
180 cmd = GNUNET_TESTING_interpreter_lookup_command (is,
181 "connect-peers");
182 GNUNET_TRANSPORT_get_trait_connect_peer_state (cmd,
183 &cps);
184 void *ret = NULL;
185
186 cps->notify_connect (is,
187 peer);
188 return ret;
189 }*/
190
191
192/**
193 * Callback to set the flag indicating all peers are prepared to finish. Will be called via the plugin api.
194 */
195static void
196all_local_tests_prepared ()
197{
198 const struct GNUNET_TESTING_LocalPreparedState *lfs;
199
200 GNUNET_TESTING_get_trait_local_prepared_state (&local_prepared,
201 &lfs);
202 GNUNET_assert (NULL != &lfs->ac);
203 if (NULL == lfs->ac.cont)
204 GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) &lfs->ac);
205 else
206 GNUNET_TESTING_async_finish ((struct
207 GNUNET_TESTING_AsyncContext *) &lfs->ac);
208}
209
210
211static void 157static void
212child_completed_callback (void *cls, 158child_completed_callback (void *cls,
213 enum GNUNET_OS_ProcessStatusType type, 159 enum GNUNET_OS_ProcessStatusType type,
@@ -218,82 +164,6 @@ child_completed_callback (void *cls,
218 164
219 165
220/** 166/**
221 * Function called to check a message being
222 * received.
223 *
224 */
225static int
226check_encrypted (void *cls, struct GNUNET_MessageHeader *header)
227{
228 return GNUNET_OK;
229}
230
231
232static void
233core_receive_continue (struct GNUNET_PeerIdentity *peer)
234{
235 const struct GNUNET_TESTING_StartPeerState *sps;
236
237 GNUNET_TESTING_get_trait_state (&start_peer,
238 &sps);
239
240 LOG (GNUNET_ERROR_TYPE_DEBUG,
241 "Executing core receive continue\n");
242
243 GNUNET_TRANSPORT_core_receive_continue (sps->th, peer);
244}
245
246
247/*static void
248handle_core (void *cls, struct GNUNET_MessageHeader *header)
249{
250 struct GNUNET_PeerIdentity *peer = cls;
251
252 core_receive_continue (peer);
253 }*/
254
255
256/**
257 * Function called to handle a message being received.
258 *
259 */
260static void
261handle_encrypted (void *cls, struct GNUNET_MessageHeader *header)
262{
263 struct GNUNET_PeerIdentity *peer = cls;
264
265 core_receive_continue (peer);
266}
267
268
269static void
270handle_ephemeral_key (void *cls, struct GNUNET_MessageHeader *header)
271{
272 struct GNUNET_PeerIdentity *peer = cls;
273
274 core_receive_continue (peer);
275}
276
277
278static void
279handle_ping (void *cls, struct GNUNET_MessageHeader *header)
280{
281 struct GNUNET_PeerIdentity *peer = cls;
282
283 core_receive_continue (peer);
284}
285
286
287static void
288handle_pong (void *cls, struct GNUNET_MessageHeader *header)
289{
290 struct GNUNET_PeerIdentity *peer = cls;
291
292 core_receive_continue (peer);
293}
294
295
296/**
297 * Function to start a local test case. 167 * Function to start a local test case.
298 * 168 *
299 * @param write_message Callback to send a message to the master loop. 169 * @param write_message Callback to send a message to the master loop.
@@ -393,15 +263,11 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
393 263
394 if (1 == m_int) 264 if (1 == m_int)
395 { 265 {
396 LOG (GNUNET_ERROR_TYPE_DEBUG,
397 "m_int %u should be 1\n");
398 GNUNET_asprintf (&ts->cfgname, 266 GNUNET_asprintf (&ts->cfgname,
399 "test_core_just_run_host.conf"); 267 "test_core_just_run_host.conf");
400 } 268 }
401 else 269 else
402 { 270 {
403 LOG (GNUNET_ERROR_TYPE_DEBUG,
404 "m_int %u should not be 1\n");
405 GNUNET_asprintf (&ts->cfgname, 271 GNUNET_asprintf (&ts->cfgname,
406 "test_core_just_run.conf"); 272 "test_core_just_run.conf");
407 } 273 }
diff --git a/src/service/datacache/test_datacache.c b/src/service/datacache/test_datacache.c
index 7b7270609..f06d4ceab 100644
--- a/src/service/datacache/test_datacache.c
+++ b/src/service/datacache/test_datacache.c
@@ -36,7 +36,7 @@ static int ok;
36/** 36/**
37 * Name of plugin under test. 37 * Name of plugin under test.
38 */ 38 */
39static const char *plugin_name; 39static char *plugin_name;
40 40
41 41
42static enum GNUNET_GenericReturnValue 42static enum GNUNET_GenericReturnValue
diff --git a/src/service/datacache/test_datacache_quota.c b/src/service/datacache/test_datacache_quota.c
index e2fc6ae61..6067b79fa 100644
--- a/src/service/datacache/test_datacache_quota.c
+++ b/src/service/datacache/test_datacache_quota.c
@@ -36,7 +36,7 @@ static int ok;
36/** 36/**
37 * Name of plugin under test. 37 * Name of plugin under test.
38 */ 38 */
39static const char *plugin_name; 39static char *plugin_name;
40 40
41/** 41/**
42 * Quota is 1 MB. Each iteration of the test puts in about 1 MB of 42 * Quota is 1 MB. Each iteration of the test puts in about 1 MB of
diff --git a/src/service/meson.build b/src/service/meson.build
index b089c9794..ad2dad394 100644
--- a/src/service/meson.build
+++ b/src/service/meson.build
@@ -1,3 +1,9 @@
1# We collect all sources for the 'big' libgnunet when traversing
2# the subdirectories.
3if get_option('monolith')
4 gnunet_src = []
5endif
6
1subdir('util') 7subdir('util')
2subdir('arm') 8subdir('arm')
3subdir('statistics') 9subdir('statistics')
@@ -35,6 +41,11 @@ subdir('rest')
35if not get_option('monolith') 41if not get_option('monolith')
36 subdir_done() 42 subdir_done()
37endif 43endif
44
45# Compile the 'big' libgnunet shared library.
46# It must be compiled with HAVE_GNUNET_MONOLITH to enable
47# the correct service macros that do not inject main() functions
48# to services.
38libgnunet = library('gnunet', 49libgnunet = library('gnunet',
39 gnunet_src, 50 gnunet_src,
40 dependencies: [gnunetdeps, 51 dependencies: [gnunetdeps,
@@ -47,6 +58,7 @@ libgnunet = library('gnunet',
47 libgnunetgnsrecord_dep, 58 libgnunetgnsrecord_dep,
48 libgnunetgnsrecordjson_dep, 59 libgnunetgnsrecordjson_dep,
49 jose_dep, 60 jose_dep,
61 m_dep,
50 libgnunetcurl_dep], 62 libgnunetcurl_dep],
51 c_args: ['-DHAVE_GNUNET_MONOLITH=1'], 63 c_args: ['-DHAVE_GNUNET_MONOLITH=1'],
52 include_directories: [incdir, configuration_inc, exitdir]) 64 include_directories: [incdir, configuration_inc, exitdir])
diff --git a/src/service/messenger/gnunet-service-messenger_message_recv.c b/src/service/messenger/gnunet-service-messenger_message_recv.c
index ea309f893..d660d0115 100644
--- a/src/service/messenger/gnunet-service-messenger_message_recv.c
+++ b/src/service/messenger/gnunet-service-messenger_message_recv.c
@@ -139,7 +139,7 @@ callback_found_message (void *cls,
139 const struct GNUNET_MESSENGER_Message *message, 139 const struct GNUNET_MESSENGER_Message *message,
140 const struct GNUNET_HashCode *hash) 140 const struct GNUNET_HashCode *hash)
141{ 141{
142 struct GNUNET_MESSENGER_SrvTunnel *tunnel = tunnel; 142 struct GNUNET_MESSENGER_SrvTunnel *tunnel = cls;
143 143
144 if (!message) 144 if (!message)
145 { 145 {
diff --git a/src/service/nat-auto/Makefile.am b/src/service/nat-auto/Makefile.am
index a82afbea2..d34a16761 100644
--- a/src/service/nat-auto/Makefile.am
+++ b/src/service/nat-auto/Makefile.am
@@ -30,7 +30,7 @@ libgnunetnatauto_la_LDFLAGS = \
30 -version-info 0:0:0 30 -version-info 0:0:0
31 31
32gnunet_service_nat_auto_SOURCES = \ 32gnunet_service_nat_auto_SOURCES = \
33 gnunet-service-nat-auto.c 33 gnunet-service-nat-auto.c nat-auto.h
34gnunet_service_nat_auto_LDADD = \ 34gnunet_service_nat_auto_LDADD = \
35 $(top_builddir)/src/lib/util/libgnunetutil.la \ 35 $(top_builddir)/src/lib/util/libgnunetutil.la \
36 $(top_builddir)/src/service/statistics/libgnunetstatistics.la \ 36 $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
diff --git a/src/service/nat/gnunet-service-nat.c b/src/service/nat/gnunet-service-nat.c
index dde269819..08c87d0be 100644
--- a/src/service/nat/gnunet-service-nat.c
+++ b/src/service/nat/gnunet-service-nat.c
@@ -2070,7 +2070,7 @@ GNUNET_SERVICE_MAIN
2070 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 2070 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
2071 */ 2071 */
2072void __attribute__ ((constructor)) 2072void __attribute__ ((constructor))
2073GNUNET_ARM_memory_init () 2073GNUNET_NATM_memory_init ()
2074{ 2074{
2075 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 2075 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
2076 mallopt (M_TOP_PAD, 1 * 1024); 2076 mallopt (M_TOP_PAD, 1 * 1024);
diff --git a/src/service/nse/gnunet-service-nse.c b/src/service/nse/gnunet-service-nse.c
index ee1cb025f..ddb720d26 100644
--- a/src/service/nse/gnunet-service-nse.c
+++ b/src/service/nse/gnunet-service-nse.c
@@ -1573,7 +1573,7 @@ GNUNET_SERVICE_MAIN ("nse",
1573 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1573 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1574 */ 1574 */
1575void __attribute__ ((constructor)) 1575void __attribute__ ((constructor))
1576GNUNET_ARM_memory_init () 1576GNUNET_NSE_memory_init ()
1577{ 1577{
1578 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1578 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1579 mallopt (M_TOP_PAD, 1 * 1024); 1579 mallopt (M_TOP_PAD, 1 * 1024);
diff --git a/src/service/peerstore/peerstore_api.c b/src/service/peerstore/peerstore_api.c
index a774d3baa..d5cb091f9 100644
--- a/src/service/peerstore/peerstore_api.c
+++ b/src/service/peerstore/peerstore_api.c
@@ -1040,19 +1040,17 @@ GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
1040 GNUNET_PEERSTORE_Processor callback, 1040 GNUNET_PEERSTORE_Processor callback,
1041 void *callback_cls) 1041 void *callback_cls)
1042{ 1042{
1043 struct GNUNET_PEERSTORE_IterateContext *ic;
1044 struct GNUNET_PEERSTORE_WatchContext *wc; 1043 struct GNUNET_PEERSTORE_WatchContext *wc;
1045 1044
1046 wc = GNUNET_new (struct GNUNET_PEERSTORE_WatchContext); 1045 wc = GNUNET_new (struct GNUNET_PEERSTORE_WatchContext);
1047 wc->callback = callback; 1046 wc->callback = callback;
1048 wc->callback_cls = callback_cls; 1047 wc->callback_cls = callback_cls;
1049 wc->h = h; 1048 wc->h = h;
1050 wc->ic = ic;
1051 wc->key = key; 1049 wc->key = key;
1052 wc->peer = peer; 1050 wc->peer = peer;
1053 wc->sub_system = sub_system; 1051 wc->sub_system = sub_system;
1054 1052
1055 ic = GNUNET_PEERSTORE_iterate (h, 1053 wc->ic = GNUNET_PEERSTORE_iterate (h,
1056 sub_system, 1054 sub_system,
1057 peer, 1055 peer,
1058 key, 1056 key,
@@ -1075,7 +1073,6 @@ hello_updated (void *cls,
1075{ 1073{
1076 struct GNUNET_PEERSTORE_NotifyContext *nc = cls; 1074 struct GNUNET_PEERSTORE_NotifyContext *nc = cls;
1077 const struct GNUNET_MessageHeader *hello; 1075 const struct GNUNET_MessageHeader *hello;
1078 struct GNUNET_HELLO_Builder *builder;
1079 1076
1080 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1077 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1081 "hello_updated\n"); 1078 "hello_updated\n");
@@ -1090,7 +1087,6 @@ hello_updated (void *cls,
1090 if (NULL == record) 1087 if (NULL == record)
1091 return; 1088 return;
1092 hello = record->value; 1089 hello = record->value;
1093 builder = GNUNET_HELLO_builder_from_msg (hello);
1094 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1090 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1095 "hello_updated with expired %s and size %u for peer %s\n", 1091 "hello_updated with expired %s and size %u for peer %s\n",
1096 GNUNET_STRINGS_absolute_time_to_string (GNUNET_HELLO_builder_get_expiration_time (hello)), 1092 GNUNET_STRINGS_absolute_time_to_string (GNUNET_HELLO_builder_get_expiration_time (hello)),
diff --git a/src/service/regex/gnunet-daemon-regexprofiler.c b/src/service/regex/gnunet-daemon-regexprofiler.c
index 70301338f..8aa2a2a30 100644
--- a/src/service/regex/gnunet-daemon-regexprofiler.c
+++ b/src/service/regex/gnunet-daemon-regexprofiler.c
@@ -393,7 +393,7 @@ main (int argc, char *const *argv)
393 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 393 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
394 */ 394 */
395void __attribute__ ((constructor)) 395void __attribute__ ((constructor))
396GNUNET_ARM_memory_init () 396GNUNET_REGEX_memory_init ()
397{ 397{
398 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 398 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
399 mallopt (M_TOP_PAD, 1 * 1024); 399 mallopt (M_TOP_PAD, 1 * 1024);
diff --git a/src/service/rest/Makefile.am b/src/service/rest/Makefile.am
index 60769e366..69c0235cc 100644
--- a/src/service/rest/Makefile.am
+++ b/src/service/rest/Makefile.am
@@ -27,19 +27,27 @@ EXTRA_DIST = \
27if HAVE_JOSE 27if HAVE_JOSE
28OPENID_PLUGIN = \ 28OPENID_PLUGIN = \
29 openid_plugin.c \ 29 openid_plugin.c \
30 oidc_helper.c 30 openid_plugin.h \
31 oidc_helper.c \
32 oidc_helper.h
31OPENID_JOSE_LIBS = -ljose 33OPENID_JOSE_LIBS = -ljose
32endif 34endif
33 35
34gnunet_rest_server_SOURCES = \ 36gnunet_rest_server_SOURCES = \
35 gnunet-rest-server.c \ 37 gnunet-rest-server.c \
36 config_plugin.c \ 38 config_plugin.c \
39 config_plugin.h \
37 copying_plugin.c \ 40 copying_plugin.c \
41 copying_plugin.h \
38 identity_plugin.c \ 42 identity_plugin.c \
43 identity_plugin.h \
39 namestore_plugin.c \ 44 namestore_plugin.c \
45 namestore_plugin.h \
40 gns_plugin.c \ 46 gns_plugin.c \
47 gns_plugin.h \
41 $(OPENID_PLUGIN) \ 48 $(OPENID_PLUGIN) \
42 reclaim_plugin.c json_reclaim.c 49 reclaim_plugin.c json_reclaim.c \
50 reclaim_plugin.h json_reclaim.h
43gnunet_rest_server_LDADD = \ 51gnunet_rest_server_LDADD = \
44 $(top_builddir)/src/lib/util/libgnunetutil.la \ 52 $(top_builddir)/src/lib/util/libgnunetutil.la \
45 $(top_builddir)/src/lib/json/libgnunetjson.la \ 53 $(top_builddir)/src/lib/json/libgnunetjson.la \
diff --git a/src/service/testing/meson.build b/src/service/testing/meson.build
index 7e2069fb0..5605a2afb 100644
--- a/src/service/testing/meson.build
+++ b/src/service/testing/meson.build
@@ -1,4 +1,7 @@
1libgnunettesting_src = [ 1libgnunettesting_src = [
2 'testing_api_cmd_stop_peer.c',
3 'testing_api_cmd_start_peer.c',
4 'testing_api_cmd_exec_bash_script.c',
2 'testing_api_cmd_barrier.c', 5 'testing_api_cmd_barrier.c',
3 'testing_api_cmd_barrier_reached.c', 6 'testing_api_cmd_barrier_reached.c',
4 'testing_api_cmd_finish.c', 7 'testing_api_cmd_finish.c',
diff --git a/src/service/testing/testing_api_cmd_netjail_start_cmds_helper.c b/src/service/testing/testing_api_cmd_netjail_start_cmds_helper.c
index 51a20dd9b..df6a81cb4 100644
--- a/src/service/testing/testing_api_cmd_netjail_start_cmds_helper.c
+++ b/src/service/testing/testing_api_cmd_netjail_start_cmds_helper.c
@@ -679,6 +679,7 @@ start_helper (struct NetJailState *ns,
679 plugin_name = topology->plugin; 679 plugin_name = topology->plugin;
680 680
681 hkey = GNUNET_new (struct GNUNET_ShortHashCode); 681 hkey = GNUNET_new (struct GNUNET_ShortHashCode);
682 node = NULL;
682 if (0 == n) 683 if (0 == n)
683 { 684 {
684 GNUNET_CRYPTO_hash (&m, sizeof(m), &hc); 685 GNUNET_CRYPTO_hash (&m, sizeof(m), &hc);
diff --git a/src/service/testing/testing_api_cmd_start_peer.c b/src/service/testing/testing_api_cmd_start_peer.c
index e2a2c0fbf..cd4536131 100644
--- a/src/service/testing/testing_api_cmd_start_peer.c
+++ b/src/service/testing/testing_api_cmd_start_peer.c
@@ -279,7 +279,6 @@ GNUNET_TESTING_cmd_start_peer (const char *label,
279 struct GNUNET_TESTING_StartPeerState *sps; 279 struct GNUNET_TESTING_StartPeerState *sps;
280 struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map = 280 struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map =
281 GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO); 281 GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO);
282 unsigned int i;
283 282
284 sps = GNUNET_new (struct GNUNET_TESTING_StartPeerState); 283 sps = GNUNET_new (struct GNUNET_TESTING_StartPeerState);
285 sps->no = no; 284 sps->no = no;
diff --git a/src/service/testing/testing_api_loop.c b/src/service/testing/testing_api_loop.c
index db0a00c22..11cd02ec0 100644
--- a/src/service/testing/testing_api_loop.c
+++ b/src/service/testing/testing_api_loop.c
@@ -738,7 +738,7 @@ GNUNET_TESTING_add_netjail_helper (struct GNUNET_TESTING_Interpreter *is,
738 * @param global_node_number The netjail node to inform. 738 * @param global_node_number The netjail node to inform.
739 * @param header The message to send. 739 * @param header The message to send.
740 */ 740 */
741void 741static void
742send_message_to_netjail (struct GNUNET_TESTING_Interpreter *is, 742send_message_to_netjail (struct GNUNET_TESTING_Interpreter *is,
743 unsigned int global_node_number, 743 unsigned int global_node_number,
744 struct GNUNET_MessageHeader *header) 744 struct GNUNET_MessageHeader *header)
@@ -749,6 +749,10 @@ send_message_to_netjail (struct GNUNET_TESTING_Interpreter *is,
749 "send message of type %u to locals\n", 749 "send message of type %u to locals\n",
750 ntohs (header->type)); 750 ntohs (header->type));
751 helper = is->helper[global_node_number - 1]; 751 helper = is->helper[global_node_number - 1];
752 /**
753 FIXME: This should probably be put into a linked list
754 inside is and cleaned up at some point.
755 */
752 struct GNUNET_HELPER_SendHandle *sh = GNUNET_HELPER_send ( 756 struct GNUNET_HELPER_SendHandle *sh = GNUNET_HELPER_send (
753 (struct GNUNET_HELPER_Handle *) helper, 757 (struct GNUNET_HELPER_Handle *) helper,
754 header, 758 header,
diff --git a/src/service/topology/gnunet-daemon-topology.c b/src/service/topology/gnunet-daemon-topology.c
index ca5435657..0f4b046f8 100644
--- a/src/service/topology/gnunet-daemon-topology.c
+++ b/src/service/topology/gnunet-daemon-topology.c
@@ -1035,7 +1035,7 @@ main (int argc, char *const *argv)
1035 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1035 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1036 */ 1036 */
1037void __attribute__ ((constructor)) 1037void __attribute__ ((constructor))
1038GNUNET_ARM_memory_init () 1038GNUNET_TOPOLOGY_memory_init ()
1039{ 1039{
1040 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1040 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1041 mallopt (M_TOP_PAD, 1 * 1024); 1041 mallopt (M_TOP_PAD, 1 * 1024);
diff --git a/src/service/transport/gnunet-communicator-unix.c b/src/service/transport/gnunet-communicator-unix.c
index 0ff16ab08..1cdc85b8a 100644
--- a/src/service/transport/gnunet-communicator-unix.c
+++ b/src/service/transport/gnunet-communicator-unix.c
@@ -1153,7 +1153,7 @@ main (int argc, char *const *argv)
1153 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1153 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1154 */ 1154 */
1155void __attribute__ ((constructor)) 1155void __attribute__ ((constructor))
1156GNUNET_ARM_memory_init () 1156GNUNET_TRANSPORT_communicator_unix_memory_init ()
1157{ 1157{
1158 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1158 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1159 mallopt (M_TOP_PAD, 1 * 1024); 1159 mallopt (M_TOP_PAD, 1 * 1024);
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index cdd7b5179..a1848fbb1 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -186,20 +186,20 @@
186 * the value chosen here might be too aggressively low! 186 * the value chosen here might be too aggressively low!
187 */ 187 */
188#define DELAY_WARN_THRESHOLD \ 188#define DELAY_WARN_THRESHOLD \
189 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 189 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
190 190
191/** 191/**
192 * If a DVBox could not be forwarded after this number of 192 * If a DVBox could not be forwarded after this number of
193 * seconds we drop it. 193 * seconds we drop it.
194 */ 194 */
195#define DV_FORWARD_TIMEOUT \ 195#define DV_FORWARD_TIMEOUT \
196 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) 196 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
197 197
198/** 198/**
199 * Default value for how long we wait for reliability ack. 199 * Default value for how long we wait for reliability ack.
200 */ 200 */
201#define DEFAULT_ACK_WAIT_DURATION \ 201#define DEFAULT_ACK_WAIT_DURATION \
202 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) 202 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
203 203
204/** 204/**
205 * We only consider queues as "quality" connections when 205 * We only consider queues as "quality" connections when
@@ -207,53 +207,53 @@
207 * the latency of the queue is below this threshold. 207 * the latency of the queue is below this threshold.
208 */ 208 */
209#define DV_QUALITY_RTT_THRESHOLD \ 209#define DV_QUALITY_RTT_THRESHOLD \
210 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) 210 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
211 211
212/** 212/**
213 * How long do we consider a DV path valid if we see no 213 * How long do we consider a DV path valid if we see no
214 * further updates on it? Note: the value chosen here might be too low! 214 * further updates on it? Note: the value chosen here might be too low!
215 */ 215 */
216#define DV_PATH_VALIDITY_TIMEOUT \ 216#define DV_PATH_VALIDITY_TIMEOUT \
217 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) 217 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
218 218
219/** 219/**
220 * How long do we cache backchannel (struct Backtalker) information 220 * How long do we cache backchannel (struct Backtalker) information
221 * after a backchannel goes inactive? 221 * after a backchannel goes inactive?
222 */ 222 */
223#define BACKCHANNEL_INACTIVITY_TIMEOUT \ 223#define BACKCHANNEL_INACTIVITY_TIMEOUT \
224 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) 224 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
225 225
226/** 226/**
227 * How long before paths expire would we like to (re)discover DV paths? Should 227 * How long before paths expire would we like to (re)discover DV paths? Should
228 * be below #DV_PATH_VALIDITY_TIMEOUT. 228 * be below #DV_PATH_VALIDITY_TIMEOUT.
229 */ 229 */
230#define DV_PATH_DISCOVERY_FREQUENCY \ 230#define DV_PATH_DISCOVERY_FREQUENCY \
231 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) 231 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
232 232
233/** 233/**
234 * How long are ephemeral keys valid? 234 * How long are ephemeral keys valid?
235 */ 235 */
236#define EPHEMERAL_VALIDITY \ 236#define EPHEMERAL_VALIDITY \
237 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) 237 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
238 238
239/** 239/**
240 * How long do we keep partially reassembled messages around before giving up? 240 * How long do we keep partially reassembled messages around before giving up?
241 */ 241 */
242#define REASSEMBLY_EXPIRATION \ 242#define REASSEMBLY_EXPIRATION \
243 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) 243 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
244 244
245/** 245/**
246 * What is the fastest rate at which we send challenges *if* we keep learning 246 * What is the fastest rate at which we send challenges *if* we keep learning
247 * an address (gossip, DHT, etc.)? 247 * an address (gossip, DHT, etc.)?
248 */ 248 */
249#define FAST_VALIDATION_CHALLENGE_FREQ \ 249#define FAST_VALIDATION_CHALLENGE_FREQ \
250 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1) 250 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
251 251
252/** 252/**
253 * What is the slowest rate at which we send challenges? 253 * What is the slowest rate at which we send challenges?
254 */ 254 */
255#define MAX_VALIDATION_CHALLENGE_FREQ \ 255#define MAX_VALIDATION_CHALLENGE_FREQ \
256 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1) 256 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1)
257 257
258/** 258/**
259 * How long until we forget about historic accumulators and thus 259 * How long until we forget about historic accumulators and thus
@@ -261,7 +261,7 @@
261 * active connection experiences without an ACK. 261 * active connection experiences without an ACK.
262 */ 262 */
263#define ACK_CUMMULATOR_TIMEOUT \ 263#define ACK_CUMMULATOR_TIMEOUT \
264 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) 264 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
265 265
266/** 266/**
267 * What is the non-randomized base frequency at which we 267 * What is the non-randomized base frequency at which we
@@ -279,13 +279,13 @@
279 * When do we forget an invalid address for sure? 279 * When do we forget an invalid address for sure?
280 */ 280 */
281#define MAX_ADDRESS_VALID_UNTIL \ 281#define MAX_ADDRESS_VALID_UNTIL \
282 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1) 282 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1)
283 283
284/** 284/**
285 * How long do we consider an address valid if we just checked? 285 * How long do we consider an address valid if we just checked?
286 */ 286 */
287#define ADDRESS_VALIDATION_LIFETIME \ 287#define ADDRESS_VALIDATION_LIFETIME \
288 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) 288 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
289 289
290/** 290/**
291 * What is the maximum frequency at which we do address validation? 291 * What is the maximum frequency at which we do address validation?
@@ -2249,7 +2249,7 @@ struct PendingMessage
2249 * UUID we use to identify this message in our logs. 2249 * UUID we use to identify this message in our logs.
2250 * Generated by incrementing the "logging_uuid_gen". 2250 * Generated by incrementing the "logging_uuid_gen".
2251 */ 2251 */
2252 unsigned long long logging_uuid; 2252 uint64_t logging_uuid;
2253 2253
2254 /** 2254 /**
2255 * Type of the pending message. 2255 * Type of the pending message.
@@ -2280,7 +2280,7 @@ struct PendingMessage
2280 /** 2280 /**
2281 * Are we sending fragments at the moment? 2281 * Are we sending fragments at the moment?
2282 */ 2282 */
2283 unsigned int frags_in_flight; 2283 uint32_t frags_in_flight;
2284 2284
2285 /** 2285 /**
2286 * How many fragments do we have? 2286 * How many fragments do we have?
@@ -2377,11 +2377,26 @@ struct AddressListEntry
2377 struct TransportClient *tc; 2377 struct TransportClient *tc;
2378 2378
2379 /** 2379 /**
2380 * Store hello handle
2381 */
2382 struct GNUNET_PEERSTORE_StoreHelloContext *shc;
2383
2384 /**
2380 * The actual address. 2385 * The actual address.
2381 */ 2386 */
2382 const char *address; 2387 const char *address;
2383 2388
2384 /** 2389 /**
2390 * Signed address
2391 */
2392 void *signed_address;
2393
2394 /**
2395 * Signed address length
2396 */
2397 size_t signed_address_len;
2398
2399 /**
2385 * Current context for storing this address in the peerstore. 2400 * Current context for storing this address in the peerstore.
2386 */ 2401 */
2387 struct GNUNET_PEERSTORE_StoreContext *sc; 2402 struct GNUNET_PEERSTORE_StoreContext *sc;
@@ -2889,16 +2904,6 @@ static struct GNUNET_TIME_Absolute hello_mono_time;
2889static int in_shutdown; 2904static int in_shutdown;
2890 2905
2891/** 2906/**
2892 * Head of the linkd list to store the store context for hellos.
2893 */
2894static struct GNUNET_PEERSTORE_StoreHelloContext *shc_head;
2895
2896/**
2897 * Tail of the linkd list to store the store context for hellos.
2898 */
2899static struct GNUNET_PEERSTORE_StoreHelloContext *shc_tail;
2900
2901/**
2902 * Get an offset into the transmission history buffer for `struct 2907 * Get an offset into the transmission history buffer for `struct
2903 * PerformanceData`. Note that the caller must perform the required 2908 * PerformanceData`. Note that the caller must perform the required
2904 * modulo #GOODPUT_AGING_SLOTS operation before indexing into the 2909 * modulo #GOODPUT_AGING_SLOTS operation before indexing into the
@@ -2959,7 +2964,7 @@ free_pending_acknowledgement (struct PendingAcknowledgement *pa)
2959 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2964 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2960 "remove pa from message\n"); 2965 "remove pa from message\n");
2961 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2966 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2962 "remove pa from message %llu\n", 2967 "remove pa from message %" PRIu64 "\n",
2963 pm->logging_uuid); 2968 pm->logging_uuid);
2964 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2969 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2965 "remove pa from message %u\n", 2970 "remove pa from message %u\n",
@@ -3047,7 +3052,7 @@ free_pending_message (struct PendingMessage *pm)
3047 if ((NULL != vl) && (NULL == pm->frag_parent)) 3052 if ((NULL != vl) && (NULL == pm->frag_parent))
3048 { 3053 {
3049 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3054 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3050 "Removing pm %llu\n", 3055 "Removing pm %" PRIu64 "\n",
3051 pm->logging_uuid); 3056 pm->logging_uuid);
3052 GNUNET_CONTAINER_MDLL_remove (vl, 3057 GNUNET_CONTAINER_MDLL_remove (vl,
3053 vl->pending_msg_head, 3058 vl->pending_msg_head,
@@ -4137,7 +4142,7 @@ client_send_response (struct PendingMessage *pm)
4137 env = GNUNET_MQ_msg (so_msg, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK); 4142 env = GNUNET_MQ_msg (so_msg, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK);
4138 so_msg->peer = vl->target; 4143 so_msg->peer = vl->target;
4139 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4140 "Confirming transmission of <%llu> to %s\n", 4145 "Confirming transmission of <%" PRIu64 "> to %s\n",
4141 pm->logging_uuid, 4146 pm->logging_uuid,
4142 GNUNET_i2s (&vl->target)); 4147 GNUNET_i2s (&vl->target));
4143 GNUNET_MQ_send (tc->mq, env); 4148 GNUNET_MQ_send (tc->mq, env);
@@ -4461,7 +4466,8 @@ queue_send_msg (struct Queue *queue,
4461 4466
4462 GNUNET_log ( 4467 GNUNET_log (
4463 GNUNET_ERROR_TYPE_DEBUG, 4468 GNUNET_ERROR_TYPE_DEBUG,
4464 "Queueing %u bytes of payload for transmission <%llu> on queue %llu to %s\n", 4469 "Queueing %u bytes of payload for transmission <%" PRIu64
4470 "> on queue %llu to %s\n",
4465 (unsigned int) payload_size, 4471 (unsigned int) payload_size,
4466 (NULL == pm) ? 0 : pm->logging_uuid, 4472 (NULL == pm) ? 0 : pm->logging_uuid,
4467 (unsigned long long) queue->qid, 4473 (unsigned long long) queue->qid,
@@ -4495,7 +4501,8 @@ queue_send_msg (struct Queue *queue,
4495 if (NULL != pm->qe) 4501 if (NULL != pm->qe)
4496 { 4502 {
4497 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4503 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4498 "Retransmitting message <%llu> remove pm from qe with MID: %llu \n", 4504 "Retransmitting message <%" PRIu64
4505 "> remove pm from qe with MID: %llu \n",
4499 pm->logging_uuid, 4506 pm->logging_uuid,
4500 (unsigned long long) pm->qe->mid); 4507 (unsigned long long) pm->qe->mid);
4501 pm->qe->pm = NULL; 4508 pm->qe->pm = NULL;
@@ -4509,7 +4516,8 @@ queue_send_msg (struct Queue *queue,
4509 // Messages without FC or fragments can get here. 4516 // Messages without FC or fragments can get here.
4510 if (NULL != pm) 4517 if (NULL != pm)
4511 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4518 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4512 "Message %llu (pm type %u) was not send because queue has no capacity.\n", 4519 "Message %" PRIu64
4520 " (pm type %u) was not send because queue has no capacity.\n",
4513 pm->logging_uuid, 4521 pm->logging_uuid,
4514 pm->pmt); 4522 pm->pmt);
4515 GNUNET_free (env); 4523 GNUNET_free (env);
@@ -5179,7 +5187,8 @@ check_vl_transmission (struct VirtualLink *vl)
5179 vl->outbound_fc_window_size) 5187 vl->outbound_fc_window_size)
5180 { 5188 {
5181 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5189 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5182 "Stalled message %llu transmission on VL %s due to flow control: %llu < %llu\n", 5190 "Stalled message %" PRIu64
5191 " transmission on VL %s due to flow control: %llu < %llu\n",
5183 pm->logging_uuid, 5192 pm->logging_uuid,
5184 GNUNET_i2s (&vl->target), 5193 GNUNET_i2s (&vl->target),
5185 (unsigned long long) vl->outbound_fc_window_size, 5194 (unsigned long long) vl->outbound_fc_window_size,
@@ -5237,7 +5246,8 @@ check_vl_transmission (struct VirtualLink *vl)
5237 vl_next_hop->outbound_fc_window_size) 5246 vl_next_hop->outbound_fc_window_size)
5238 { 5247 {
5239 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5248 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5240 "Stalled message %llu transmission on next hop %s due to flow control: %llu < %llu\n", 5249 "Stalled message %" PRIu64
5250 " transmission on next hop %s due to flow control: %llu < %llu\n",
5241 pm->logging_uuid, 5251 pm->logging_uuid,
5242 GNUNET_i2s (&vl_next_hop->target), 5252 GNUNET_i2s (&vl_next_hop->target),
5243 (unsigned long 5253 (unsigned long
@@ -5271,7 +5281,7 @@ check_vl_transmission (struct VirtualLink *vl)
5271 } 5281 }
5272 if (GNUNET_YES == elig) 5282 if (GNUNET_YES == elig)
5273 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5283 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5274 "Eligible message %llu of size %u to %s: %llu/%llu\n", 5284 "Eligible message %" PRIu64 " of size %u to %s: %llu/%llu\n",
5275 pm->logging_uuid, 5285 pm->logging_uuid,
5276 pm->bytes_msg, 5286 pm->bytes_msg,
5277 GNUNET_i2s (&vl->target), 5287 GNUNET_i2s (&vl->target),
@@ -5333,7 +5343,8 @@ handle_client_send (void *cls, const struct OutboundMessage *obm)
5333 pm->bytes_msg = bytes_msg; 5343 pm->bytes_msg = bytes_msg;
5334 memcpy (&pm[1], obmm, bytes_msg); 5344 memcpy (&pm[1], obmm, bytes_msg);
5335 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5345 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5336 "Sending message of type %u with %u bytes as <%llu> to %s\n", 5346 "Sending message of type %u with %u bytes as <%" PRIu64
5347 "> to %s\n",
5337 ntohs (obmm->type), 5348 ntohs (obmm->type),
5338 bytes_msg, 5349 bytes_msg,
5339 pm->logging_uuid, 5350 pm->logging_uuid,
@@ -5482,14 +5493,21 @@ peerstore_store_own_cb (void *cls, int success)
5482static void 5493static void
5483shc_cont (void *cls, int success) 5494shc_cont (void *cls, int success)
5484{ 5495{
5485 (void *) cls; 5496 struct AddressListEntry *ale = cls;
5486 5497 struct GNUNET_TIME_Absolute expiration;
5487 if (GNUNET_YES == success) 5498 expiration = GNUNET_TIME_relative_to_absolute (ale->expiration);
5488 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5499 ale->sc = GNUNET_PEERSTORE_store (peerstore,
5489 "Hello stored successfully!\n"); 5500 "transport",
5490 else 5501 &GST_my_identity,
5491 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5502 GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY,
5492 "Error storing hello!\n"); 5503 ale->signed_address,
5504 ale->signed_address_len,
5505 expiration,
5506 GNUNET_PEERSTORE_STOREOPTION_MULTIPLE,
5507 &peerstore_store_own_cb,
5508 ale);
5509 GNUNET_free (ale->signed_address);
5510 GNUNET_free (ale);
5493} 5511}
5494 5512
5495 5513
@@ -5502,78 +5520,54 @@ static void
5502store_pi (void *cls) 5520store_pi (void *cls)
5503{ 5521{
5504 struct AddressListEntry *ale = cls; 5522 struct AddressListEntry *ale = cls;
5505 struct GNUNET_PEERSTORE_StoreHelloContext *shc;
5506 void *addr;
5507 size_t addr_len;
5508 struct GNUNET_TIME_Absolute expiration;
5509 enum GNUNET_GenericReturnValue add_result;
5510 struct GNUNET_MQ_Envelope *env; 5523 struct GNUNET_MQ_Envelope *env;
5511 const struct GNUNET_MessageHeader *msg; 5524 const struct GNUNET_MessageHeader *msg;
5512 const char *dash; 5525 const char *dash;
5513 char *prefix = GNUNET_HELLO_address_to_prefix (ale->address);
5514 char *address_uri; 5526 char *address_uri;
5527 char *prefix = GNUNET_HELLO_address_to_prefix (ale->address);
5515 5528
5516 dash = strchr (ale->address, '-'); 5529 dash = strchr (ale->address, '-');
5517 dash++; 5530 dash++;
5518 GNUNET_asprintf (&address_uri, 5531 GNUNET_asprintf (&address_uri,
5519 "%s://%s", 5532 "%s://%s",
5520 prefix, 5533 prefix,
5521 dash); 5534 dash);
5535 GNUNET_free (prefix);
5522 ale->st = NULL; 5536 ale->st = NULL;
5523 expiration = GNUNET_TIME_relative_to_absolute (ale->expiration);
5524 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5537 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5525 "Storing our address `%s' in peerstore until %s!\n", 5538 "Storing our address `%s' in peerstore until %s!\n",
5526 ale->address, 5539 ale->address,
5527 GNUNET_STRINGS_absolute_time_to_string (expiration)); 5540 GNUNET_STRINGS_absolute_time_to_string (hello_mono_time));
5528 add_result = GNUNET_HELLO_builder_add_address (GST_my_hello, 5541 if (GNUNET_OK != GNUNET_HELLO_builder_add_address (GST_my_hello,
5529 address_uri); 5542 address_uri))
5543 {
5544 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
5545 "Address `%s' invalid\n",
5546 address_uri);
5547 GNUNET_free (address_uri);
5548 ale->st =
5549 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &store_pi, ale);
5550 return;
5551 }
5552 // FIXME hello_mono_time used here?? What about expiration in ale?
5553 GNUNET_HELLO_sign_address (ale->address,
5554 ale->nt,
5555 hello_mono_time,
5556 GST_my_private_key,
5557 &ale->signed_address,
5558 &ale->signed_address_len);
5559 GNUNET_free (address_uri);
5530 env = GNUNET_HELLO_builder_to_env (GST_my_hello, 5560 env = GNUNET_HELLO_builder_to_env (GST_my_hello,
5531 GST_my_private_key, 5561 GST_my_private_key,
5532 GNUNET_TIME_UNIT_ZERO); 5562 GNUNET_TIME_UNIT_ZERO);
5533 msg = GNUNET_MQ_env_get_msg (env); 5563 msg = GNUNET_MQ_env_get_msg (env);
5534 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5564 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5535 "store_pi 1\n"); 5565 "store_pi 1\n");
5536 if (GNUNET_YES == add_result) 5566 ale->shc = GNUNET_PEERSTORE_hello_add (peerstore,
5537 { 5567 msg,
5538 shc = GNUNET_PEERSTORE_hello_add (peerstore, 5568 shc_cont,
5539 msg, 5569 ale);
5540 shc_cont,
5541 NULL);
5542 GNUNET_CONTAINER_DLL_insert (shc_head, shc_tail, shc);
5543 }
5544 else if (GNUNET_SYSERR == add_result)
5545 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
5546 "Error adding address to peerstore hello!\n");
5547 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5548 "store_pi 2\n");
5549 GNUNET_HELLO_sign_address (ale->address,
5550 ale->nt,
5551 hello_mono_time,
5552 GST_my_private_key,
5553 &addr,
5554 &addr_len);
5555 ale->sc = GNUNET_PEERSTORE_store (peerstore,
5556 "transport",
5557 &GST_my_identity,
5558 GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY,
5559 addr,
5560 addr_len,
5561 expiration,
5562 GNUNET_PEERSTORE_STOREOPTION_MULTIPLE,
5563 &peerstore_store_own_cb,
5564 ale);
5565 GNUNET_free (addr);
5566 GNUNET_free (env); 5570 GNUNET_free (env);
5567 GNUNET_free (prefix);
5568 GNUNET_free (address_uri);
5569 if (NULL == ale->sc)
5570 {
5571 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
5572 "Failed to store our address `%s' with peerstore\n",
5573 ale->address);
5574 ale->st =
5575 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &store_pi, ale);
5576 }
5577} 5571}
5578 5572
5579 5573
@@ -6422,7 +6416,7 @@ completed_pending_message (struct PendingMessage *pm)
6422 struct PendingMessage *pos; 6416 struct PendingMessage *pos;
6423 6417
6424 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 6418 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
6425 "Complete transmission of message %llu %u\n", 6419 "Complete transmission of message %" PRIu64 " %u\n",
6426 pm->logging_uuid, 6420 pm->logging_uuid,
6427 pm->pmt); 6421 pm->pmt);
6428 switch (pm->pmt) 6422 switch (pm->pmt)
@@ -6469,7 +6463,7 @@ completed_pending_message (struct PendingMessage *pm)
6469 6463
6470 case PMT_DV_BOX: 6464 case PMT_DV_BOX:
6471 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 6465 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
6472 "Completed transmission of message %llu (DV Box)\n", 6466 "Completed transmission of message %" PRIu64 " (DV Box)\n",
6473 pm->logging_uuid); 6467 pm->logging_uuid);
6474 if (NULL != pm->frag_parent) 6468 if (NULL != pm->frag_parent)
6475 { 6469 {
@@ -7939,7 +7933,8 @@ forward_dv_box (struct Neighbour *next_hop,
7939 memcpy (buf, msg_buf, msg_size); 7933 memcpy (buf, msg_buf, msg_size);
7940 7934
7941 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 7935 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
7942 "Created pending message %llu for DV Box with next hop %s (%u/%u)\n", 7936 "Created pending message %" PRIu64
7937 " for DV Box with next hop %s (%u/%u)\n",
7943 pm->logging_uuid, 7938 pm->logging_uuid,
7944 GNUNET_i2s (&next_hop->pid), 7939 GNUNET_i2s (&next_hop->pid),
7945 (unsigned int) num_hops, 7940 (unsigned int) num_hops,
@@ -8659,7 +8654,6 @@ handle_hello_for_incoming (void *cls,
8659 const struct GNUNET_MessageHeader *hello, 8654 const struct GNUNET_MessageHeader *hello,
8660 const char *emsg) 8655 const char *emsg)
8661{ 8656{
8662 struct IncomingRequest *ir = cls;
8663 struct GNUNET_HELLO_Builder *builder; 8657 struct GNUNET_HELLO_Builder *builder;
8664 8658
8665 if (NULL != emsg) 8659 if (NULL != emsg)
@@ -8898,7 +8892,8 @@ handle_validation_response (
8898 struct Queue *q; 8892 struct Queue *q;
8899 struct Neighbour *n; 8893 struct Neighbour *n;
8900 struct VirtualLink *vl; 8894 struct VirtualLink *vl;
8901 const struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get_monotonic (GST_cfg); 8895 const struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get_monotonic (
8896 GST_cfg);
8902 8897
8903 /* check this is one of our challenges */ 8898 /* check this is one of our challenges */
8904 (void) GNUNET_CONTAINER_multipeermap_get_multiple (validation_map, 8899 (void) GNUNET_CONTAINER_multipeermap_get_multiple (validation_map,
@@ -9372,7 +9367,7 @@ prepare_pending_acknowledgement (struct Queue *queue,
9372 pa->transmission_time = GNUNET_TIME_absolute_get (); 9367 pa->transmission_time = GNUNET_TIME_absolute_get ();
9373 pa->message_size = pm->bytes_msg; 9368 pa->message_size = pm->bytes_msg;
9374 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9369 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9375 "Waiting for ACKnowledgment `%s' for <%llu>\n", 9370 "Waiting for ACKnowledgment `%s' for <%" PRIu64 ">\n",
9376 GNUNET_uuid2s (&pa->ack_uuid.value), 9371 GNUNET_uuid2s (&pa->ack_uuid.value),
9377 pm->logging_uuid); 9372 pm->logging_uuid);
9378 return pa; 9373 return pa;
@@ -9404,15 +9399,17 @@ fragment_message (struct Queue *queue,
9404 ? UINT16_MAX - sizeof(struct GNUNET_TRANSPORT_SendMessageTo) 9399 ? UINT16_MAX - sizeof(struct GNUNET_TRANSPORT_SendMessageTo)
9405 : queue->mtu; 9400 : queue->mtu;
9406 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9401 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9407 "Fragmenting message <%llu> with size %u to %s for MTU %u\n", 9402 "Fragmenting message <%" PRIu64
9403 "> with size %u to %s for MTU %u\n",
9408 pm->logging_uuid, 9404 pm->logging_uuid,
9409 pm->bytes_msg, 9405 pm->bytes_msg,
9410 GNUNET_i2s (&pm->vl->target), 9406 GNUNET_i2s (&pm->vl->target),
9411 (unsigned int) mtu); 9407 (unsigned int) mtu);
9412 set_pending_message_uuid (pm); 9408 set_pending_message_uuid (pm);
9413 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9409 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9414 "Fragmenting message %llu <%llu> with size %u to %s for MTU %u\n", 9410 "Fragmenting message %" PRIu64 " <%" PRIu64
9415 (unsigned long long) pm->msg_uuid.uuid, 9411 "> with size %u to %s for MTU %u\n",
9412 pm->msg_uuid.uuid,
9416 pm->logging_uuid, 9413 pm->logging_uuid,
9417 pm->bytes_msg, 9414 pm->bytes_msg,
9418 GNUNET_i2s (&pm->vl->target), 9415 GNUNET_i2s (&pm->vl->target),
@@ -9574,7 +9571,8 @@ reliability_box_message (struct Queue *queue,
9574 memcpy (&msg[sizeof(rbox)], &pm[1], pm->bytes_msg); 9571 memcpy (&msg[sizeof(rbox)], &pm[1], pm->bytes_msg);
9575 pm->bpm = bpm; 9572 pm->bpm = bpm;
9576 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9573 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9577 "Preparing reliability box for message <%llu> of size %d (%d) to %s on queue %s\n", 9574 "Preparing reliability box for message <%" PRIu64
9575 "> of size %d (%d) to %s on queue %s\n",
9578 pm->logging_uuid, 9576 pm->logging_uuid,
9579 pm->bytes_msg, 9577 pm->bytes_msg,
9580 ntohs (((const struct GNUNET_MessageHeader *) &pm[1])->size), 9578 ntohs (((const struct GNUNET_MessageHeader *) &pm[1])->size),
@@ -9700,7 +9698,8 @@ update_pm_next_attempt (struct PendingMessage *pm,
9700 } 9698 }
9701 else 9699 else
9702 { 9700 {
9703 double factor = (root->frag_count - 1) / root->frag_count; 9701 double factor = ((double) root->frag_count - 1)
9702 / (double) root->frag_count;
9704 struct GNUNET_TIME_Relative s1; 9703 struct GNUNET_TIME_Relative s1;
9705 struct GNUNET_TIME_Relative s2; 9704 struct GNUNET_TIME_Relative s2;
9706 struct GNUNET_TIME_Relative plus_mean = 9705 struct GNUNET_TIME_Relative plus_mean =
@@ -9818,13 +9817,14 @@ select_best_pending_from_link (struct PendingMessageScoreContext *sc,
9818 { 9817 {
9819 sc->frags_in_flight = GNUNET_YES; 9818 sc->frags_in_flight = GNUNET_YES;
9820 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9819 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9821 "Fragments in flight for message %llu\n", 9820 "Fragments in flight for message %" PRIu64 "\n",
9822 pos->logging_uuid); 9821 pos->logging_uuid);
9823 } 9822 }
9824 else 9823 else
9825 { 9824 {
9826 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9827 "Maybe too early, because message are sorted by next_attempt, if there are no fragments in flight.Checked message %llu\n", 9826 "Maybe too early, because message are sorted by next_attempt, if there are no fragments in flight.Checked message %"
9827 PRIu64 "\n",
9828 pos->logging_uuid); 9828 pos->logging_uuid);
9829 sc->to_early = GNUNET_YES; 9829 sc->to_early = GNUNET_YES;
9830 sc->to_early_retry_delay = GNUNET_TIME_absolute_get_remaining ( 9830 sc->to_early_retry_delay = GNUNET_TIME_absolute_get_remaining (
@@ -9843,7 +9843,7 @@ select_best_pending_from_link (struct PendingMessageScoreContext *sc,
9843 /* determine if we have to fragment, if so add fragmentation 9843 /* determine if we have to fragment, if so add fragmentation
9844 overhead! */ 9844 overhead! */
9845 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9845 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9846 "check %llu for sc->best\n", 9846 "check %" PRIu64 " for sc->best\n",
9847 pos->logging_uuid); 9847 pos->logging_uuid);
9848 frag = GNUNET_NO; 9848 frag = GNUNET_NO;
9849 if (((0 != queue->mtu) && 9849 if (((0 != queue->mtu) &&
@@ -9936,7 +9936,8 @@ select_best_pending_from_link (struct PendingMessageScoreContext *sc,
9936 if (sc_score + time_delta > pm_score) 9936 if (sc_score + time_delta > pm_score)
9937 { 9937 {
9938 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9938 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9939 "sc_score of %llu larger, keep sc->best %llu\n", 9939 "sc_score of %" PRIu64 " larger, keep sc->best %" PRIu64
9940 "\n",
9940 pos->logging_uuid, 9941 pos->logging_uuid,
9941 sc->best->logging_uuid); 9942 sc->best->logging_uuid);
9942 continue; /* sc_score larger, keep sc->best */ 9943 continue; /* sc_score larger, keep sc->best */
@@ -9987,7 +9988,8 @@ extract_box_cb (void *cls,
9987 bpm->frag_parent = pm; 9988 bpm->frag_parent = pm;
9988 set_pending_message_uuid (bpm); 9989 set_pending_message_uuid (bpm);
9989 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 9990 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
9990 "Creating DV Box %llu for original message %llu (next hop is %s)\n", 9991 "Creating DV Box %" PRIu64 " for original message %" PRIu64
9992 " (next hop is %s)\n",
9991 bpm->logging_uuid, 9993 bpm->logging_uuid,
9992 pm->logging_uuid, 9994 pm->logging_uuid,
9993 GNUNET_i2s (&next_hop->pid)); 9995 GNUNET_i2s (&next_hop->pid));
@@ -10067,7 +10069,7 @@ transmit_on_queue (void *cls)
10067 /* Given selection in `sc`, do transmission */ 10069 /* Given selection in `sc`, do transmission */
10068 pm = sc.best; 10070 pm = sc.best;
10069 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 10071 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
10070 "Selected message <%llu>\n", 10072 "Selected message <%" PRIu64 ">\n",
10071 pm->logging_uuid); 10073 pm->logging_uuid);
10072 if (NULL != sc.dvh) 10074 if (NULL != sc.dvh)
10073 { 10075 {
@@ -10113,7 +10115,8 @@ transmit_on_queue (void *cls)
10113 if (NULL == pm) 10115 if (NULL == pm)
10114 { 10116 {
10115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 10117 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
10116 "Fragmentation failed queue %s to %s for <%llu>, trying again\n", 10118 "Fragmentation failed queue %s to %s for <%" PRIu64
10119 ">, trying again\n",
10117 queue->address, 10120 queue->address,
10118 GNUNET_i2s (&n->pid), 10121 GNUNET_i2s (&n->pid),
10119 sc.best->logging_uuid); 10122 sc.best->logging_uuid);
@@ -10131,7 +10134,8 @@ transmit_on_queue (void *cls)
10131 /* Reliability boxing failed, try next message... */ 10134 /* Reliability boxing failed, try next message... */
10132 GNUNET_log ( 10135 GNUNET_log (
10133 GNUNET_ERROR_TYPE_DEBUG, 10136 GNUNET_ERROR_TYPE_DEBUG,
10134 "Reliability boxing failed queue %s to %s for <%llu>, trying again\n", 10137 "Reliability boxing failed queue %s to %s for <%" PRIu64
10138 ">, trying again\n",
10135 queue->address, 10139 queue->address,
10136 GNUNET_i2s (&n->pid), 10140 GNUNET_i2s (&n->pid),
10137 sc.best->logging_uuid); 10141 sc.best->logging_uuid);
@@ -10145,7 +10149,8 @@ transmit_on_queue (void *cls)
10145 /* Pass 'pm' for transission to the communicator */ 10149 /* Pass 'pm' for transission to the communicator */
10146 GNUNET_log ( 10150 GNUNET_log (
10147 GNUNET_ERROR_TYPE_DEBUG, 10151 GNUNET_ERROR_TYPE_DEBUG,
10148 "Passing message <%llu> to queue %s for peer %s (considered %u others)\n", 10152 "Passing message <%" PRIu64
10153 "> to queue %s for peer %s (considered %u others)\n",
10149 pm->logging_uuid, 10154 pm->logging_uuid,
10150 queue->address, 10155 queue->address,
10151 GNUNET_i2s (&n->pid), 10156 GNUNET_i2s (&n->pid),
@@ -10198,9 +10203,10 @@ transmit_on_queue (void *cls)
10198 root = root->frag_parent; 10203 root = root->frag_parent;
10199 10204
10200 root->frag_count++; 10205 root->frag_count++;
10201 wait_multiplier = (unsigned int) ceil (root->bytes_msg 10206 wait_multiplier = (unsigned int) ceil ((double) root->bytes_msg
10202 / (root->frag_off 10207 / ((double) root->frag_off
10203 / root->frag_count)) * 4; 10208 / (double) root->frag_count))
10209 * 4;
10204 } 10210 }
10205 else 10211 else
10206 { 10212 {
@@ -10364,7 +10370,7 @@ handle_send_message_ack (void *cls,
10364 // Update: Maybe QueueEntry was accidentally freed during freeing PendingMessage. 10370 // Update: Maybe QueueEntry was accidentally freed during freeing PendingMessage.
10365 /* this should never happen */ 10371 /* this should never happen */
10366 GNUNET_break (0); 10372 GNUNET_break (0);
10367 //GNUNET_SERVICE_client_drop (tc->client); 10373 // GNUNET_SERVICE_client_drop (tc->client);
10368 GNUNET_SERVICE_client_continue (tc->client); 10374 GNUNET_SERVICE_client_continue (tc->client);
10369 return; 10375 return;
10370 } 10376 }
@@ -11242,7 +11248,7 @@ handle_suggest_cancel (void *cls, const struct ExpressPreferenceMessage *msg)
11242 11248
11243static void 11249static void
11244hello_for_client_cb (void *cls, 11250hello_for_client_cb (void *cls,
11245 const char *uri) 11251 const char *uri)
11246{ 11252{
11247 const struct GNUNET_PeerIdentity *peer = cls; 11253 const struct GNUNET_PeerIdentity *peer = cls;
11248 int pfx_len; 11254 int pfx_len;
@@ -11282,7 +11288,6 @@ handle_hello_for_client (void *cls,
11282 const char *emsg) 11288 const char *emsg)
11283{ 11289{
11284 (void) cls; 11290 (void) cls;
11285 const char *val;
11286 struct GNUNET_HELLO_Builder *builder; 11291 struct GNUNET_HELLO_Builder *builder;
11287 11292
11288 if (NULL != emsg) 11293 if (NULL != emsg)
@@ -11514,16 +11519,9 @@ static void
11514do_shutdown (void *cls) 11519do_shutdown (void *cls)
11515{ 11520{
11516 struct LearnLaunchEntry *lle; 11521 struct LearnLaunchEntry *lle;
11517 struct GNUNET_PEERSTORE_StoreHelloContext *pos;
11518 11522
11519 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 11523 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
11520 "shutdown logic\n"); 11524 "shutdown logic\n");
11521 while (NULL != (pos = shc_head))
11522 {
11523 GNUNET_CONTAINER_DLL_remove (shc_head, shc_tail, pos);
11524 GNUNET_PEERSTORE_hello_add_cancel (pos);
11525 }
11526
11527 (void) cls; 11525 (void) cls;
11528 GNUNET_CONTAINER_multipeermap_iterate (neighbours, 11526 GNUNET_CONTAINER_multipeermap_iterate (neighbours,
11529 &free_neighbour_cb, NULL); 11527 &free_neighbour_cb, NULL);
diff --git a/src/service/transport/meson.build b/src/service/transport/meson.build
index 4f8b592fd..3cacc53f6 100644
--- a/src/service/transport/meson.build
+++ b/src/service/transport/meson.build
@@ -111,6 +111,7 @@ executable ('gnunet-service-transport',
111 libgnunethello_dep, 111 libgnunethello_dep,
112 libgnunetnat_dep, 112 libgnunetnat_dep,
113 gcrypt_dep, 113 gcrypt_dep,
114 m_dep,
114 libgnunetutil_dep], 115 libgnunetutil_dep],
115 include_directories: [incdir, configuration_inc], 116 include_directories: [incdir, configuration_inc],
116 install: true, 117 install: true,
diff --git a/src/service/transport/transport_api_cmd_connecting_peers.c b/src/service/transport/transport_api_cmd_connecting_peers.c
index c3f63d920..e38d5b860 100644
--- a/src/service/transport/transport_api_cmd_connecting_peers.c
+++ b/src/service/transport/transport_api_cmd_connecting_peers.c
@@ -134,12 +134,11 @@ connect_peers_run (void *cls,
134 { 134 {
135 char *prefix; 135 char *prefix;
136 char *rest; 136 char *rest;
137 char *rest2;
138 char *address; 137 char *address;
139 138
140 prefix = strtok (addr, "_"); 139 prefix = strtok (addr, "_");
141 rest = strtok (NULL, "_"); 140 rest = strtok (NULL, "_");
142 rest2 = strtok (rest, "-"); 141 strtok (rest, "-");
143 address = strtok (NULL, "-"); 142 address = strtok (NULL, "-");
144 143
145 GNUNET_asprintf (&addr_and_port, 144 GNUNET_asprintf (&addr_and_port,