aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am4
-rw-r--r--src/arm/arm_api.c8
-rw-r--r--src/arm/gnunet-arm.c3
-rw-r--r--src/arm/gnunet-service-arm.c6
-rw-r--r--src/arm/test_arm_api.c5
-rw-r--r--src/core/core_api.c4
-rw-r--r--src/core/gnunet-service-core.c8
-rw-r--r--src/core/test_core_api.c5
-rw-r--r--src/core/test_core_api_start_only.c5
-rw-r--r--src/datacache/datacache_api.c4
-rw-r--r--src/datacache/perf_datacache_api.c3
-rw-r--r--src/datacache/plugin_datacache.h2
-rw-r--r--src/datacache/test_datacache_api.c3
-rw-r--r--src/datacache/test_datacache_api_quota.c3
-rw-r--r--src/datastore/datastore_api.c4
-rw-r--r--src/datastore/gnunet-service-datastore.c4
-rw-r--r--src/datastore/perf_datastore_api.c5
-rw-r--r--src/datastore/perf_plugin_datastore.c8
-rw-r--r--src/datastore/plugin_datastore.h2
-rw-r--r--src/datastore/plugin_datastore_sqlite.c2
-rw-r--r--src/datastore/test_datastore_api.c5
-rw-r--r--src/datastore/test_datastore_api_management.c5
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c2
-rw-r--r--src/hostlist/hostlist-client.c4
-rw-r--r--src/hostlist/hostlist-client.h2
-rw-r--r--src/hostlist/hostlist-server.c4
-rw-r--r--src/hostlist/hostlist-server.h2
-rw-r--r--src/include/gnunet_arm_service.h4
-rw-r--r--src/include/gnunet_client_lib.h4
-rw-r--r--src/include/gnunet_configuration_lib.h20
-rw-r--r--src/include/gnunet_core_service.h2
-rw-r--r--src/include/gnunet_datacache_lib.h2
-rw-r--r--src/include/gnunet_datastore_service.h2
-rw-r--r--src/include/gnunet_disk_lib.h2
-rw-r--r--src/include/gnunet_fs_service.h2
-rw-r--r--src/include/gnunet_getopt_lib.h7
-rw-r--r--src/include/gnunet_os_lib.h5
-rw-r--r--src/include/gnunet_peerinfo_service.h4
-rw-r--r--src/include/gnunet_program_lib.h2
-rw-r--r--src/include/gnunet_pseudonym_lib.h12
-rw-r--r--src/include/gnunet_resolver_service.h6
-rw-r--r--src/include/gnunet_service_lib.h6
-rw-r--r--src/include/gnunet_statistics_service.h2
-rw-r--r--src/include/gnunet_testing_lib.h39
-rw-r--r--src/include/gnunet_transport_service.h2
-rw-r--r--src/peerinfo/gnunet-peerinfo.c3
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c2
-rw-r--r--src/peerinfo/peerinfo_api.c4
-rw-r--r--src/peerinfo/test_peerinfo_api.c3
-rw-r--r--src/resolver/gnunet-service-resolver.c2
-rw-r--r--src/resolver/resolver_api.c6
-rw-r--r--src/resolver/test_resolver_api.c3
-rw-r--r--src/statistics/gnunet-service-statistics.c7
-rw-r--r--src/statistics/gnunet-statistics.c3
-rw-r--r--src/statistics/statistics_api.c4
-rw-r--r--src/statistics/test_statistics_api.c6
-rw-r--r--src/template/gnunet-service-template.c5
-rw-r--r--src/template/gnunet-template.c3
-rw-r--r--src/topology/gnunet-daemon-topology.c6
-rw-r--r--src/transport/gnunet-service-transport.c8
-rw-r--r--src/transport/plugin_transport.h2
-rw-r--r--src/transport/test_plugin_transport.c7
-rw-r--r--src/transport/test_transport_api.c5
-rw-r--r--src/transport/transport_api.c4
-rw-r--r--src/util/client.c4
-rw-r--r--src/util/configuration.c24
-rw-r--r--src/util/disk.c3
-rw-r--r--src/util/getopt.c2
-rw-r--r--src/util/os_load.c6
-rw-r--r--src/util/program.c12
-rw-r--r--src/util/pseudonym.c20
-rw-r--r--src/util/service.c16
-rw-r--r--src/util/test_getopt.c40
-rw-r--r--src/util/test_program.c3
-rw-r--r--src/util/test_service.c18
75 files changed, 243 insertions, 223 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 42a668c75..d533b758c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,13 +11,13 @@ SUBDIRS = \
11 include $(INTLEMU_SUBDIRS) \ 11 include $(INTLEMU_SUBDIRS) \
12 util \ 12 util \
13 arm \ 13 arm \
14 datacache \
15 datastore \
16 fragmentation \ 14 fragmentation \
17 hello \ 15 hello \
18 peerinfo \ 16 peerinfo \
19 resolver \ 17 resolver \
20 statistics \ 18 statistics \
19 datacache \
20 datastore \
21 template \ 21 template \
22 transport \ 22 transport \
23 core \ 23 core \
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 7f120e6a6..7ae3e9513 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -39,7 +39,7 @@ struct ArmContext
39 void *cls; 39 void *cls;
40 char *service_name; 40 char *service_name;
41 struct GNUNET_CLIENT_Connection *client; 41 struct GNUNET_CLIENT_Connection *client;
42 struct GNUNET_CONFIGURATION_Handle *cfg; 42 const struct GNUNET_CONFIGURATION_Handle *cfg;
43 struct GNUNET_TIME_Absolute timeout; 43 struct GNUNET_TIME_Absolute timeout;
44 uint16_t type; 44 uint16_t type;
45}; 45};
@@ -195,7 +195,7 @@ send_service_msg (void *cls, size_t size, void *buf)
195 */ 195 */
196static void 196static void
197change_service (const char *service_name, 197change_service (const char *service_name,
198 struct GNUNET_CONFIGURATION_Handle *cfg, 198 const struct GNUNET_CONFIGURATION_Handle *cfg,
199 struct GNUNET_SCHEDULER_Handle *sched, 199 struct GNUNET_SCHEDULER_Handle *sched,
200 struct GNUNET_TIME_Relative timeout, 200 struct GNUNET_TIME_Relative timeout,
201 GNUNET_ARM_Callback cb, void *cb_cls, uint16_t type) 201 GNUNET_ARM_Callback cb, void *cb_cls, uint16_t type)
@@ -266,7 +266,7 @@ change_service (const char *service_name,
266 */ 266 */
267void 267void
268GNUNET_ARM_start_service (const char *service_name, 268GNUNET_ARM_start_service (const char *service_name,
269 struct GNUNET_CONFIGURATION_Handle *cfg, 269 const struct GNUNET_CONFIGURATION_Handle *cfg,
270 struct GNUNET_SCHEDULER_Handle *sched, 270 struct GNUNET_SCHEDULER_Handle *sched,
271 struct GNUNET_TIME_Relative timeout, 271 struct GNUNET_TIME_Relative timeout,
272 GNUNET_ARM_Callback cb, void *cb_cls) 272 GNUNET_ARM_Callback cb, void *cb_cls)
@@ -308,7 +308,7 @@ GNUNET_ARM_start_service (const char *service_name,
308 */ 308 */
309void 309void
310GNUNET_ARM_stop_service (const char *service_name, 310GNUNET_ARM_stop_service (const char *service_name,
311 struct GNUNET_CONFIGURATION_Handle *cfg, 311 const struct GNUNET_CONFIGURATION_Handle *cfg,
312 struct GNUNET_SCHEDULER_Handle *sched, 312 struct GNUNET_SCHEDULER_Handle *sched,
313 struct GNUNET_TIME_Relative timeout, 313 struct GNUNET_TIME_Relative timeout,
314 GNUNET_ARM_Callback cb, void *cb_cls) 314 GNUNET_ARM_Callback cb, void *cb_cls)
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index f8f5bc20f..740fd2533 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -111,7 +111,8 @@ static void
111run (void *cls, 111run (void *cls,
112 struct GNUNET_SCHEDULER_Handle *sched, 112 struct GNUNET_SCHEDULER_Handle *sched,
113 char *const *args, 113 char *const *args,
114 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 114 const char *cfgfile,
115 const struct GNUNET_CONFIGURATION_Handle *cfg)
115{ 116{
116 if (term != NULL) 117 if (term != NULL)
117 { 118 {
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index a84445271..32674117c 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -124,7 +124,7 @@ static struct ServiceList *running;
124/** 124/**
125 * Our configuration 125 * Our configuration
126 */ 126 */
127static struct GNUNET_CONFIGURATION_Handle *cfg; 127static const struct GNUNET_CONFIGURATION_Handle *cfg;
128 128
129/** 129/**
130 * Our scheduler. 130 * Our scheduler.
@@ -562,7 +562,7 @@ maint (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
562 GNUNET_YES, 562 GNUNET_YES,
563 GNUNET_SCHEDULER_PRIORITY_IDLE, 563 GNUNET_SCHEDULER_PRIORITY_IDLE,
564 GNUNET_SCHEDULER_NO_TASK, 564 GNUNET_SCHEDULER_NO_TASK,
565 MAINT_FREQUENCY, &maint, cfg); 565 MAINT_FREQUENCY, &maint, NULL);
566 566
567 /* check for services that died (WAITPID) */ 567 /* check for services that died (WAITPID) */
568 prev = NULL; 568 prev = NULL;
@@ -675,7 +675,7 @@ static void
675run (void *cls, 675run (void *cls,
676 struct GNUNET_SCHEDULER_Handle *s, 676 struct GNUNET_SCHEDULER_Handle *s,
677 struct GNUNET_SERVER_Handle *server, 677 struct GNUNET_SERVER_Handle *server,
678 struct GNUNET_CONFIGURATION_Handle *c) 678 const struct GNUNET_CONFIGURATION_Handle *c)
679{ 679{
680 char *defaultservices; 680 char *defaultservices;
681 char *pos; 681 char *pos;
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c
index 89f63d3ec..fbd90583e 100644
--- a/src/arm/test_arm_api.c
+++ b/src/arm/test_arm_api.c
@@ -38,7 +38,7 @@
38 38
39static struct GNUNET_SCHEDULER_Handle *sched; 39static struct GNUNET_SCHEDULER_Handle *sched;
40 40
41static struct GNUNET_CONFIGURATION_Handle *cfg; 41static const struct GNUNET_CONFIGURATION_Handle *cfg;
42 42
43static int ok = 1; 43static int ok = 1;
44 44
@@ -84,7 +84,8 @@ static void
84task (void *cls, 84task (void *cls,
85 struct GNUNET_SCHEDULER_Handle *s, 85 struct GNUNET_SCHEDULER_Handle *s,
86 char *const *args, 86 char *const *args,
87 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *c) 87 const char *cfgfile,
88 const struct GNUNET_CONFIGURATION_Handle *c)
88{ 89{
89 cfg = c; 90 cfg = c;
90 sched = s; 91 sched = s;
diff --git a/src/core/core_api.c b/src/core/core_api.c
index 67b21ca26..f3e30eb9a 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -43,7 +43,7 @@ struct GNUNET_CORE_Handle
43 /** 43 /**
44 * Configuration we're using. 44 * Configuration we're using.
45 */ 45 */
46 struct GNUNET_CONFIGURATION_Handle *cfg; 46 const struct GNUNET_CONFIGURATION_Handle *cfg;
47 47
48 /** 48 /**
49 * Closure for the various callbacks. 49 * Closure for the various callbacks.
@@ -777,7 +777,7 @@ transmit_start (void *cls, size_t size, void *buf)
777 */ 777 */
778void 778void
779GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched, 779GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched,
780 struct GNUNET_CONFIGURATION_Handle *cfg, 780 const struct GNUNET_CONFIGURATION_Handle *cfg,
781 struct GNUNET_TIME_Relative timeout, 781 struct GNUNET_TIME_Relative timeout,
782 void *cls, 782 void *cls,
783 GNUNET_CORE_StartupCallback init, 783 GNUNET_CORE_StartupCallback init,
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 0a96d8288..6f6129f77 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -617,7 +617,7 @@ struct GNUNET_SCHEDULER_Handle *sched;
617/** 617/**
618 * Our configuration. 618 * Our configuration.
619 */ 619 */
620struct GNUNET_CONFIGURATION_Handle *cfg; 620const struct GNUNET_CONFIGURATION_Handle *cfg;
621 621
622/** 622/**
623 * Our server. 623 * Our server.
@@ -3121,7 +3121,8 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
3121static void 3121static void
3122run (void *cls, 3122run (void *cls,
3123 struct GNUNET_SCHEDULER_Handle *s, 3123 struct GNUNET_SCHEDULER_Handle *s,
3124 struct GNUNET_SERVER_Handle *serv, struct GNUNET_CONFIGURATION_Handle *c) 3124 struct GNUNET_SERVER_Handle *serv,
3125 const struct GNUNET_CONFIGURATION_Handle *c)
3125{ 3126{
3126#if 0 3127#if 0
3127 unsigned long long qin; 3128 unsigned long long qin;
@@ -3206,7 +3207,8 @@ run (void *cls,
3206 * Function called during shutdown. Clean up our state. 3207 * Function called during shutdown. Clean up our state.
3207 */ 3208 */
3208static void 3209static void
3209cleanup (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg) 3210cleanup (void *cls,
3211 const struct GNUNET_CONFIGURATION_Handle *cfg)
3210{ 3212{
3211 if (my_private_key != NULL) 3213 if (my_private_key != NULL)
3212 GNUNET_CRYPTO_rsa_key_free (my_private_key); 3214 GNUNET_CRYPTO_rsa_key_free (my_private_key);
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index f2095025f..89aa9b13e 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -48,7 +48,7 @@
48 48
49struct PeerContext 49struct PeerContext
50{ 50{
51 struct GNUNET_CONFIGURATION_Handle *cfg; 51 const struct GNUNET_CONFIGURATION_Handle *cfg;
52 struct GNUNET_CORE_Handle *ch; 52 struct GNUNET_CORE_Handle *ch;
53 struct GNUNET_PeerIdentity id; 53 struct GNUNET_PeerIdentity id;
54 struct GNUNET_TRANSPORT_Handle *th; 54 struct GNUNET_TRANSPORT_Handle *th;
@@ -313,7 +313,8 @@ static void
313run (void *cls, 313run (void *cls,
314 struct GNUNET_SCHEDULER_Handle *s, 314 struct GNUNET_SCHEDULER_Handle *s,
315 char *const *args, 315 char *const *args,
316 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 316 const char *cfgfile,
317 const struct GNUNET_CONFIGURATION_Handle *cfg)
317{ 318{
318 GNUNET_assert (ok == 1); 319 GNUNET_assert (ok == 1);
319 OKPP; 320 OKPP;
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index c3ea85593..f1993325c 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -45,7 +45,7 @@
45 45
46struct PeerContext 46struct PeerContext
47{ 47{
48 struct GNUNET_CONFIGURATION_Handle *cfg; 48 const struct GNUNET_CONFIGURATION_Handle *cfg;
49 struct GNUNET_CORE_Handle *ch; 49 struct GNUNET_CORE_Handle *ch;
50 struct GNUNET_PeerIdentity id; 50 struct GNUNET_PeerIdentity id;
51#if START_ARM 51#if START_ARM
@@ -176,7 +176,8 @@ static void
176run (void *cls, 176run (void *cls,
177 struct GNUNET_SCHEDULER_Handle *s, 177 struct GNUNET_SCHEDULER_Handle *s,
178 char *const *args, 178 char *const *args,
179 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 179 const char *cfgfile,
180 const struct GNUNET_CONFIGURATION_Handle *cfg)
180{ 181{
181 GNUNET_assert (ok == 1); 182 GNUNET_assert (ok == 1);
182 OKPP; 183 OKPP;
diff --git a/src/datacache/datacache_api.c b/src/datacache/datacache_api.c
index 0958c1d2c..421acac0f 100644
--- a/src/datacache/datacache_api.c
+++ b/src/datacache/datacache_api.c
@@ -47,7 +47,7 @@ struct GNUNET_DATACACHE_Handle
47 /** 47 /**
48 * Our configuration. 48 * Our configuration.
49 */ 49 */
50 struct GNUNET_CONFIGURATION_Handle *cfg; 50 const struct GNUNET_CONFIGURATION_Handle *cfg;
51 51
52 /** 52 /**
53 * Configuration section to use. 53 * Configuration section to use.
@@ -118,7 +118,7 @@ env_delete_notify (void *cls,
118 */ 118 */
119struct GNUNET_DATACACHE_Handle * 119struct GNUNET_DATACACHE_Handle *
120GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched, 120GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched,
121 struct GNUNET_CONFIGURATION_Handle *cfg, 121 const struct GNUNET_CONFIGURATION_Handle *cfg,
122 const char *section) 122 const char *section)
123{ 123{
124 int fd; 124 int fd;
diff --git a/src/datacache/perf_datacache_api.c b/src/datacache/perf_datacache_api.c
index b1c8d4ba6..aa008a332 100644
--- a/src/datacache/perf_datacache_api.c
+++ b/src/datacache/perf_datacache_api.c
@@ -54,7 +54,8 @@ static void
54run (void *cls, 54run (void *cls,
55 struct GNUNET_SCHEDULER_Handle *sched, 55 struct GNUNET_SCHEDULER_Handle *sched,
56 char *const *args, 56 char *const *args,
57 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 57 const char *cfgfile,
58 const struct GNUNET_CONFIGURATION_Handle *cfg)
58{ 59{
59 struct GNUNET_DATACACHE_Handle *h; 60 struct GNUNET_DATACACHE_Handle *h;
60 GNUNET_HashCode k; 61 GNUNET_HashCode k;
diff --git a/src/datacache/plugin_datacache.h b/src/datacache/plugin_datacache.h
index e099cd31d..39119339d 100644
--- a/src/datacache/plugin_datacache.h
+++ b/src/datacache/plugin_datacache.h
@@ -66,7 +66,7 @@ struct GNUNET_DATACACHE_PluginEnvironment
66 /** 66 /**
67 * Configuration to use. 67 * Configuration to use.
68 */ 68 */
69 struct GNUNET_CONFIGURATION_Handle *cfg; 69 const struct GNUNET_CONFIGURATION_Handle *cfg;
70 70
71 /** 71 /**
72 * Configuration section to use. 72 * Configuration section to use.
diff --git a/src/datacache/test_datacache_api.c b/src/datacache/test_datacache_api.c
index 0b36e0ef2..5207fa2a5 100644
--- a/src/datacache/test_datacache_api.c
+++ b/src/datacache/test_datacache_api.c
@@ -58,7 +58,8 @@ static void
58run (void *cls, 58run (void *cls,
59 struct GNUNET_SCHEDULER_Handle *sched, 59 struct GNUNET_SCHEDULER_Handle *sched,
60 char *const *args, 60 char *const *args,
61 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 61 const char *cfgfile,
62 const struct GNUNET_CONFIGURATION_Handle *cfg)
62{ 63{
63 struct GNUNET_DATACACHE_Handle *h; 64 struct GNUNET_DATACACHE_Handle *h;
64 GNUNET_HashCode k; 65 GNUNET_HashCode k;
diff --git a/src/datacache/test_datacache_api_quota.c b/src/datacache/test_datacache_api_quota.c
index fda5d425b..c912c4927 100644
--- a/src/datacache/test_datacache_api_quota.c
+++ b/src/datacache/test_datacache_api_quota.c
@@ -42,7 +42,8 @@ static void
42run (void *cls, 42run (void *cls,
43 struct GNUNET_SCHEDULER_Handle *sched, 43 struct GNUNET_SCHEDULER_Handle *sched,
44 char *const *args, 44 char *const *args,
45 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 45 const char *cfgfile,
46 const struct GNUNET_CONFIGURATION_Handle *cfg)
46{ 47{
47 struct GNUNET_DATACACHE_Handle *h; 48 struct GNUNET_DATACACHE_Handle *h;
48 GNUNET_HashCode k; 49 GNUNET_HashCode k;
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index 361f76e4a..73783cfb8 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -37,7 +37,7 @@ struct GNUNET_DATASTORE_Handle
37 /** 37 /**
38 * Our configuration. 38 * Our configuration.
39 */ 39 */
40 struct GNUNET_CONFIGURATION_Handle *cfg; 40 const struct GNUNET_CONFIGURATION_Handle *cfg;
41 41
42 /** 42 /**
43 * Our scheduler. 43 * Our scheduler.
@@ -82,7 +82,7 @@ struct GNUNET_DATASTORE_Handle
82 * @param sched scheduler to use 82 * @param sched scheduler to use
83 * @return handle to use to access the service 83 * @return handle to use to access the service
84 */ 84 */
85struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (struct 85struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct
86 GNUNET_CONFIGURATION_Handle 86 GNUNET_CONFIGURATION_Handle
87 *cfg, 87 *cfg,
88 struct 88 struct
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index b0719b69b..26e894bf4 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -156,7 +156,7 @@ static GNUNET_SCHEDULER_TaskIdentifier expired_kill_task;
156/** 156/**
157 * Our configuration. 157 * Our configuration.
158 */ 158 */
159struct GNUNET_CONFIGURATION_Handle *cfg; 159const struct GNUNET_CONFIGURATION_Handle *cfg;
160 160
161/** 161/**
162 * Our scheduler. 162 * Our scheduler.
@@ -1248,7 +1248,7 @@ static void
1248run (void *cls, 1248run (void *cls,
1249 struct GNUNET_SCHEDULER_Handle *s, 1249 struct GNUNET_SCHEDULER_Handle *s,
1250 struct GNUNET_SERVER_Handle *server, 1250 struct GNUNET_SERVER_Handle *server,
1251 struct GNUNET_CONFIGURATION_Handle *c) 1251 const struct GNUNET_CONFIGURATION_Handle *c)
1252{ 1252{
1253 char *fn; 1253 char *fn;
1254 unsigned int bf_size; 1254 unsigned int bf_size;
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index 5a966358d..5fdf74f22 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -93,7 +93,7 @@ enum RunPhase
93struct CpsRunContext 93struct CpsRunContext
94{ 94{
95 struct GNUNET_SCHEDULER_Handle *sched; 95 struct GNUNET_SCHEDULER_Handle *sched;
96 struct GNUNET_CONFIGURATION_Handle *cfg; 96 const struct GNUNET_CONFIGURATION_Handle *cfg;
97 enum RunPhase phase; 97 enum RunPhase phase;
98 int j; 98 int j;
99 unsigned long long size; 99 unsigned long long size;
@@ -318,7 +318,8 @@ static void
318run (void *cls, 318run (void *cls,
319 struct GNUNET_SCHEDULER_Handle *sched, 319 struct GNUNET_SCHEDULER_Handle *sched,
320 char *const *args, 320 char *const *args,
321 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 321 const char *cfgfile,
322 const struct GNUNET_CONFIGURATION_Handle *cfg)
322{ 323{
323 struct CpsRunContext *crc; 324 struct CpsRunContext *crc;
324 325
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c
index dae8e7432..26299830a 100644
--- a/src/datastore/perf_plugin_datastore.c
+++ b/src/datastore/perf_plugin_datastore.c
@@ -71,7 +71,7 @@ struct CpsRunContext
71 struct GNUNET_TIME_Absolute start; 71 struct GNUNET_TIME_Absolute start;
72 struct GNUNET_TIME_Absolute end; 72 struct GNUNET_TIME_Absolute end;
73 struct GNUNET_SCHEDULER_Handle *sched; 73 struct GNUNET_SCHEDULER_Handle *sched;
74 struct GNUNET_CONFIGURATION_Handle *cfg; 74 const struct GNUNET_CONFIGURATION_Handle *cfg;
75 struct GNUNET_DATASTORE_PluginFunctions * api; 75 struct GNUNET_DATASTORE_PluginFunctions * api;
76 const char *msg; 76 const char *msg;
77 enum RunPhase phase; 77 enum RunPhase phase;
@@ -195,7 +195,7 @@ iterateDummy (void *cls,
195 */ 195 */
196static void 196static void
197unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api, 197unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api,
198 struct GNUNET_CONFIGURATION_Handle *cfg) 198 const struct GNUNET_CONFIGURATION_Handle *cfg)
199{ 199{
200 char *name; 200 char *name;
201 char *libname; 201 char *libname;
@@ -315,7 +315,7 @@ test (void *cls,
315 * Load the datastore plugin. 315 * Load the datastore plugin.
316 */ 316 */
317static struct GNUNET_DATASTORE_PluginFunctions * 317static struct GNUNET_DATASTORE_PluginFunctions *
318load_plugin (struct GNUNET_CONFIGURATION_Handle *cfg, 318load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg,
319 struct GNUNET_SCHEDULER_Handle *sched) 319 struct GNUNET_SCHEDULER_Handle *sched)
320{ 320{
321 static struct GNUNET_DATASTORE_PluginEnvironment env; 321 static struct GNUNET_DATASTORE_PluginEnvironment env;
@@ -350,7 +350,7 @@ run (void *cls,
350 struct GNUNET_SCHEDULER_Handle *s, 350 struct GNUNET_SCHEDULER_Handle *s,
351 char *const *args, 351 char *const *args,
352 const char *cfgfile, 352 const char *cfgfile,
353 struct GNUNET_CONFIGURATION_Handle *c) 353 const struct GNUNET_CONFIGURATION_Handle *c)
354{ 354{
355 struct GNUNET_DATASTORE_PluginFunctions *api; 355 struct GNUNET_DATASTORE_PluginFunctions *api;
356 struct CpsRunContext *crc; 356 struct CpsRunContext *crc;
diff --git a/src/datastore/plugin_datastore.h b/src/datastore/plugin_datastore.h
index 849188ce1..2fefa2eca 100644
--- a/src/datastore/plugin_datastore.h
+++ b/src/datastore/plugin_datastore.h
@@ -52,7 +52,7 @@ struct GNUNET_DATASTORE_PluginEnvironment
52 /** 52 /**
53 * Configuration to use. 53 * Configuration to use.
54 */ 54 */
55 struct GNUNET_CONFIGURATION_Handle *cfg; 55 const struct GNUNET_CONFIGURATION_Handle *cfg;
56 56
57 /** 57 /**
58 * Scheduler to use. 58 * Scheduler to use.
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index af4dcc322..e76b21cb2 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -208,7 +208,7 @@ create_indices (sqlite3 * dbh)
208 * @return GNUNET_OK on success 208 * @return GNUNET_OK on success
209 */ 209 */
210static int 210static int
211database_setup (struct GNUNET_CONFIGURATION_Handle *cfg, 211database_setup (const struct GNUNET_CONFIGURATION_Handle *cfg,
212 struct Plugin *plugin) 212 struct Plugin *plugin)
213{ 213{
214 sqlite3_stmt *stmt; 214 sqlite3_stmt *stmt;
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 005c11a58..3a9f8a235 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -120,7 +120,7 @@ struct CpsRunContext
120 int rid; 120 int rid;
121 int *iptr; 121 int *iptr;
122 struct GNUNET_SCHEDULER_Handle *sched; 122 struct GNUNET_SCHEDULER_Handle *sched;
123 struct GNUNET_CONFIGURATION_Handle *cfg; 123 const struct GNUNET_CONFIGURATION_Handle *cfg;
124 void *data; 124 void *data;
125 size_t size; 125 size_t size;
126 enum RunPhase phase; 126 enum RunPhase phase;
@@ -527,7 +527,8 @@ static void
527run (void *cls, 527run (void *cls,
528 struct GNUNET_SCHEDULER_Handle *sched, 528 struct GNUNET_SCHEDULER_Handle *sched,
529 char *const *args, 529 char *const *args,
530 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 530 const char *cfgfile,
531 const struct GNUNET_CONFIGURATION_Handle *cfg)
531{ 532{
532 struct CpsRunContext *crc; 533 struct CpsRunContext *crc;
533 534
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c
index f5dfa8a07..cbefe9d09 100644
--- a/src/datastore/test_datastore_api_management.c
+++ b/src/datastore/test_datastore_api_management.c
@@ -109,7 +109,7 @@ struct CpsRunContext
109 int i; 109 int i;
110 int found; 110 int found;
111 struct GNUNET_SCHEDULER_Handle *sched; 111 struct GNUNET_SCHEDULER_Handle *sched;
112 struct GNUNET_CONFIGURATION_Handle *cfg; 112 const struct GNUNET_CONFIGURATION_Handle *cfg;
113 void *data; 113 void *data;
114 size_t size; 114 size_t size;
115 enum RunPhase phase; 115 enum RunPhase phase;
@@ -298,7 +298,8 @@ static void
298run (void *cls, 298run (void *cls,
299 struct GNUNET_SCHEDULER_Handle *sched, 299 struct GNUNET_SCHEDULER_Handle *sched,
300 char *const *args, 300 char *const *args,
301 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 301 const char *cfgfile,
302 const struct GNUNET_CONFIGURATION_Handle *cfg)
302{ 303{
303 struct CpsRunContext *crc; 304 struct CpsRunContext *crc;
304 305
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 281459b75..7d075cf80 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -135,7 +135,7 @@ run (void *cls,
135 struct GNUNET_SCHEDULER_Handle * sched, 135 struct GNUNET_SCHEDULER_Handle * sched,
136 char *const *args, 136 char *const *args,
137 const char *cfgfile, 137 const char *cfgfile,
138 struct GNUNET_CONFIGURATION_Handle * cfg) 138 const struct GNUNET_CONFIGURATION_Handle * cfg)
139{ 139{
140 GNUNET_CORE_ClientEventHandler ch = NULL; 140 GNUNET_CORE_ClientEventHandler ch = NULL;
141 GNUNET_CORE_ClientEventHandler dh = NULL; 141 GNUNET_CORE_ClientEventHandler dh = NULL;
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c
index 785e189ab..bc98a2bcf 100644
--- a/src/hostlist/hostlist-client.c
+++ b/src/hostlist/hostlist-client.c
@@ -40,7 +40,7 @@
40/** 40/**
41 * Our configuration. 41 * Our configuration.
42 */ 42 */
43static struct GNUNET_CONFIGURATION_Handle *cfg; 43static const struct GNUNET_CONFIGURATION_Handle *cfg;
44 44
45/** 45/**
46 * Our scheduler. 46 * Our scheduler.
@@ -611,7 +611,7 @@ process_stat (void *cls,
611 * Start downloading hostlists from hostlist servers as necessary. 611 * Start downloading hostlists from hostlist servers as necessary.
612 */ 612 */
613int 613int
614GNUNET_HOSTLIST_client_start (struct GNUNET_CONFIGURATION_Handle *c, 614GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
615 struct GNUNET_SCHEDULER_Handle *s, 615 struct GNUNET_SCHEDULER_Handle *s,
616 struct GNUNET_STATISTICS_Handle *st, 616 struct GNUNET_STATISTICS_Handle *st,
617 GNUNET_CORE_ClientEventHandler *ch, 617 GNUNET_CORE_ClientEventHandler *ch,
diff --git a/src/hostlist/hostlist-client.h b/src/hostlist/hostlist-client.h
index a17e1383f..8adf67af9 100644
--- a/src/hostlist/hostlist-client.h
+++ b/src/hostlist/hostlist-client.h
@@ -40,7 +40,7 @@
40 * @return GNUNET_OK on success 40 * @return GNUNET_OK on success
41 */ 41 */
42int 42int
43GNUNET_HOSTLIST_client_start (struct GNUNET_CONFIGURATION_Handle *c, 43GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
44 struct GNUNET_SCHEDULER_Handle *s, 44 struct GNUNET_SCHEDULER_Handle *s,
45 struct GNUNET_STATISTICS_Handle *st, 45 struct GNUNET_STATISTICS_Handle *st,
46 GNUNET_CORE_ClientEventHandler *ch, 46 GNUNET_CORE_ClientEventHandler *ch,
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c
index 6139283ed..34e9310e4 100644
--- a/src/hostlist/hostlist-server.c
+++ b/src/hostlist/hostlist-server.c
@@ -43,7 +43,7 @@ static struct MHD_Daemon *daemon_handle;
43/** 43/**
44 * Our configuration. 44 * Our configuration.
45 */ 45 */
46static struct GNUNET_CONFIGURATION_Handle *cfg; 46static const struct GNUNET_CONFIGURATION_Handle *cfg;
47 47
48/** 48/**
49 * Our scheduler. 49 * Our scheduler.
@@ -259,7 +259,7 @@ prepare_daemon ()
259 * @return GNUNET_OK on success 259 * @return GNUNET_OK on success
260 */ 260 */
261int 261int
262GNUNET_HOSTLIST_server_start (struct GNUNET_CONFIGURATION_Handle *c, 262GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
263 struct GNUNET_SCHEDULER_Handle *s, 263 struct GNUNET_SCHEDULER_Handle *s,
264 struct GNUNET_STATISTICS_Handle *st) 264 struct GNUNET_STATISTICS_Handle *st)
265{ 265{
diff --git a/src/hostlist/hostlist-server.h b/src/hostlist/hostlist-server.h
index 16f6848a5..c6c6337e7 100644
--- a/src/hostlist/hostlist-server.h
+++ b/src/hostlist/hostlist-server.h
@@ -38,7 +38,7 @@
38 * @return GNUNET_OK on success 38 * @return GNUNET_OK on success
39 */ 39 */
40int 40int
41GNUNET_HOSTLIST_server_start (struct GNUNET_CONFIGURATION_Handle *c, 41GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
42 struct GNUNET_SCHEDULER_Handle *s, 42 struct GNUNET_SCHEDULER_Handle *s,
43 struct GNUNET_STATISTICS_Handle *st); 43 struct GNUNET_STATISTICS_Handle *st);
44 44
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h
index 5a929a37e..bbb8cb0f6 100644
--- a/src/include/gnunet_arm_service.h
+++ b/src/include/gnunet_arm_service.h
@@ -71,7 +71,7 @@ typedef void (*GNUNET_ARM_Callback) (void *cls, int success);
71 */ 71 */
72void 72void
73GNUNET_ARM_start_service (const char *service_name, 73GNUNET_ARM_start_service (const char *service_name,
74 struct GNUNET_CONFIGURATION_Handle *cfg, 74 const struct GNUNET_CONFIGURATION_Handle *cfg,
75 struct GNUNET_SCHEDULER_Handle *sched, 75 struct GNUNET_SCHEDULER_Handle *sched,
76 struct GNUNET_TIME_Relative timeout, 76 struct GNUNET_TIME_Relative timeout,
77 GNUNET_ARM_Callback cb, void *cb_cls); 77 GNUNET_ARM_Callback cb, void *cb_cls);
@@ -91,7 +91,7 @@ GNUNET_ARM_start_service (const char *service_name,
91 */ 91 */
92void 92void
93GNUNET_ARM_stop_service (const char *service_name, 93GNUNET_ARM_stop_service (const char *service_name,
94 struct GNUNET_CONFIGURATION_Handle *cfg, 94 const struct GNUNET_CONFIGURATION_Handle *cfg,
95 struct GNUNET_SCHEDULER_Handle *sched, 95 struct GNUNET_SCHEDULER_Handle *sched,
96 struct GNUNET_TIME_Relative timeout, 96 struct GNUNET_TIME_Relative timeout,
97 GNUNET_ARM_Callback cb, void *cb_cls); 97 GNUNET_ARM_Callback cb, void *cb_cls);
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h
index 6a77aa391..eb8e1d127 100644
--- a/src/include/gnunet_client_lib.h
+++ b/src/include/gnunet_client_lib.h
@@ -59,7 +59,7 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (struct
59 *sched, 59 *sched,
60 const char 60 const char
61 *service_name, 61 *service_name,
62 struct 62 const struct
63 GNUNET_CONFIGURATION_Handle 63 GNUNET_CONFIGURATION_Handle
64 *cfg); 64 *cfg);
65 65
@@ -143,7 +143,7 @@ void GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock);
143 */ 143 */
144void GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched, 144void GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched,
145 const char *service, 145 const char *service,
146 struct GNUNET_CONFIGURATION_Handle *cfg, 146 const struct GNUNET_CONFIGURATION_Handle *cfg,
147 struct GNUNET_TIME_Relative timeout, 147 struct GNUNET_TIME_Relative timeout,
148 GNUNET_SCHEDULER_Task task, void *task_cls); 148 GNUNET_SCHEDULER_Task task, void *task_cls);
149 149
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 3f7d099ce..abbfe2eec 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -88,13 +88,13 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
88 * changed since the last save. 88 * changed since the last save.
89 * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) 89 * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed)
90 */ 90 */
91int GNUNET_CONFIGURATION_is_dirty (struct GNUNET_CONFIGURATION_Handle *cfg); 91int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg);
92 92
93/** 93/**
94 * Get a configuration value that should be a number. 94 * Get a configuration value that should be a number.
95 * @return GNUNET_OK on success, GNUNET_SYSERR on error 95 * @return GNUNET_OK on success, GNUNET_SYSERR on error
96 */ 96 */
97int GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle 97int GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
98 *cfg, const char *section, 98 *cfg, const char *section,
99 const char *option, 99 const char *option,
100 unsigned long long *number); 100 unsigned long long *number);
@@ -105,7 +105,7 @@ int GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle
105 * @param time set to the time value stored in the configuration 105 * @param time set to the time value stored in the configuration
106 * @return GNUNET_OK on success, GNUNET_SYSERR on error 106 * @return GNUNET_OK on success, GNUNET_SYSERR on error
107 */ 107 */
108int GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle 108int GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
109 *cfg, const char *section, 109 *cfg, const char *section,
110 const char *option, 110 const char *option,
111 struct GNUNET_TIME_Relative *time); 111 struct GNUNET_TIME_Relative *time);
@@ -114,7 +114,7 @@ int GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
114 * Test if we have a value for a particular option 114 * Test if we have a value for a particular option
115 * @return GNUNET_YES if so, GNUNET_NO if not. 115 * @return GNUNET_YES if so, GNUNET_NO if not.
116 */ 116 */
117int GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg, 117int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
118 const char *section, const char *option); 118 const char *section, const char *option);
119 119
120/** 120/**
@@ -123,7 +123,7 @@ int GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg,
123 * value, or NULL if option is not specified 123 * value, or NULL if option is not specified
124 * @return GNUNET_OK on success, GNUNET_SYSERR on error 124 * @return GNUNET_OK on success, GNUNET_SYSERR on error
125 */ 125 */
126int GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle 126int GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
127 *cfg, const char *section, 127 *cfg, const char *section,
128 const char *option, char **value); 128 const char *option, char **value);
129 129
@@ -135,7 +135,7 @@ int GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle
135 * value, or NULL if option is not specified 135 * value, or NULL if option is not specified
136 * @return GNUNET_OK on success, GNUNET_SYSERR on error 136 * @return GNUNET_OK on success, GNUNET_SYSERR on error
137 */ 137 */
138int GNUNET_CONFIGURATION_get_value_filename (struct 138int GNUNET_CONFIGURATION_get_value_filename (const struct
139 GNUNET_CONFIGURATION_Handle *cfg, 139 GNUNET_CONFIGURATION_Handle *cfg,
140 const char *section, 140 const char *section,
141 const char *option, 141 const char *option,
@@ -146,7 +146,7 @@ int GNUNET_CONFIGURATION_get_value_filename (struct
146 * 146 *
147 * @return number of filenames iterated over, -1 on error 147 * @return number of filenames iterated over, -1 on error
148 */ 148 */
149int GNUNET_CONFIGURATION_iterate_value_filenames (struct 149int GNUNET_CONFIGURATION_iterate_value_filenames (const struct
150 GNUNET_CONFIGURATION_Handle 150 GNUNET_CONFIGURATION_Handle
151 *cfg, 151 *cfg,
152 const char *section, 152 const char *section,
@@ -163,7 +163,7 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (struct
163 * or NULL if option is not specified and no default given 163 * or NULL if option is not specified and no default given
164 * @return GNUNET_OK on success, GNUNET_SYSERR on error 164 * @return GNUNET_OK on success, GNUNET_SYSERR on error
165 */ 165 */
166int GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle 166int GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
167 *cfg, const char *section, 167 *cfg, const char *section,
168 const char *option, 168 const char *option,
169 const char **choices, 169 const char **choices,
@@ -175,7 +175,7 @@ int GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle
175 * 175 *
176 * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR 176 * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR
177 */ 177 */
178int GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle 178int GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
179 *cfg, const char *section, 179 *cfg, const char *section,
180 const char *option); 180 const char *option);
181 181
@@ -187,7 +187,7 @@ int GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle
187 * @param old string to $-expand (will be freed!) 187 * @param old string to $-expand (will be freed!)
188 * @return $-expanded string 188 * @return $-expanded string
189 */ 189 */
190char *GNUNET_CONFIGURATION_expand_dollar (struct GNUNET_CONFIGURATION_Handle 190char *GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle
191 *cfg, char *old); 191 *cfg, char *old);
192 192
193/** 193/**
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h
index a096569ef..a77281336 100644
--- a/src/include/gnunet_core_service.h
+++ b/src/include/gnunet_core_service.h
@@ -171,7 +171,7 @@ typedef void
171 */ 171 */
172void 172void
173GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched, 173GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched,
174 struct GNUNET_CONFIGURATION_Handle *cfg, 174 const struct GNUNET_CONFIGURATION_Handle *cfg,
175 struct GNUNET_TIME_Relative timeout, 175 struct GNUNET_TIME_Relative timeout,
176 void *cls, 176 void *cls,
177 GNUNET_CORE_StartupCallback init, 177 GNUNET_CORE_StartupCallback init,
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h
index c913a6462..8eb724bfa 100644
--- a/src/include/gnunet_datacache_lib.h
+++ b/src/include/gnunet_datacache_lib.h
@@ -58,7 +58,7 @@ struct GNUNET_DATACACHE_Handle;
58 */ 58 */
59struct GNUNET_DATACACHE_Handle * 59struct GNUNET_DATACACHE_Handle *
60GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched, 60GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched,
61 struct GNUNET_CONFIGURATION_Handle *cfg, 61 const struct GNUNET_CONFIGURATION_Handle *cfg,
62 const char *section); 62 const char *section);
63 63
64 64
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h
index ccbe4e076..28419126f 100644
--- a/src/include/gnunet_datastore_service.h
+++ b/src/include/gnunet_datastore_service.h
@@ -55,7 +55,7 @@ struct GNUNET_DATASTORE_Handle;
55 * @param sched scheduler to use 55 * @param sched scheduler to use
56 * @return handle to use to access the service 56 * @return handle to use to access the service
57 */ 57 */
58struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (struct 58struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct
59 GNUNET_CONFIGURATION_Handle 59 GNUNET_CONFIGURATION_Handle
60 *cfg, 60 *cfg,
61 struct 61 struct
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h
index a8a51ab78..7f463b83e 100644
--- a/src/include/gnunet_disk_lib.h
+++ b/src/include/gnunet_disk_lib.h
@@ -359,7 +359,7 @@ int GNUNET_DISK_file_change_owner (const char *filename, const char *user);
359 * private directory name. 359 * private directory name.
360 * @return the constructed filename 360 * @return the constructed filename
361 */ 361 */
362char *GNUNET_DISK_get_home_filename (struct GNUNET_CONFIGURATION_Handle *cfg, 362char *GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
363 const char *serviceName, ...); 363 const char *serviceName, ...);
364 364
365 365
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 0f61bc764..e45a46ef4 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -1368,7 +1368,7 @@ struct GNUNET_FS_Handle;
1368 */ 1368 */
1369struct GNUNET_FS_Handle * 1369struct GNUNET_FS_Handle *
1370GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched, 1370GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched,
1371 struct GNUNET_CONFIGURATION_Handle *cfg, 1371 const struct GNUNET_CONFIGURATION_Handle *cfg,
1372 const char *client_name, 1372 const char *client_name,
1373 GNUNET_FS_ProgressCallback upcb, 1373 GNUNET_FS_ProgressCallback upcb,
1374 void *upcb_cls); 1374 void *upcb_cls);
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h
index 722155568..e7063d3d0 100644
--- a/src/include/gnunet_getopt_lib.h
+++ b/src/include/gnunet_getopt_lib.h
@@ -60,11 +60,6 @@ struct GNUNET_GETOPT_CommandLineProcessorContext
60 const struct GNUNET_GETOPT_CommandLineOption *allOptions; 60 const struct GNUNET_GETOPT_CommandLineOption *allOptions;
61 61
62 /** 62 /**
63 * For configuration
64 */
65 struct GNUNET_CONFIGURATION_Handle *cfg;
66
67 /**
68 * Original command line 63 * Original command line
69 */ 64 */
70 char *const *argv; 65 char *const *argv;
@@ -192,7 +187,6 @@ struct GNUNET_GETOPT_CommandLineOption
192 * Parse the command line. 187 * Parse the command line.
193 * 188 *
194 * @param binaryName name of the binary / application with options 189 * @param binaryName name of the binary / application with options
195 * @param cfg for storing/accessing configuration data
196 * @param allOptions defined options and handlers 190 * @param allOptions defined options and handlers
197 * @param argc number of arguments 191 * @param argc number of arguments
198 * @param argv actual arguments 192 * @param argv actual arguments
@@ -200,7 +194,6 @@ struct GNUNET_GETOPT_CommandLineOption
200 * argument, or GNUNET_SYSERR on error 194 * argument, or GNUNET_SYSERR on error
201 */ 195 */
202int GNUNET_GETOPT_run (const char *binaryName, 196int GNUNET_GETOPT_run (const char *binaryName,
203 struct GNUNET_CONFIGURATION_Handle *cfg,
204 const struct GNUNET_GETOPT_CommandLineOption 197 const struct GNUNET_GETOPT_CommandLineOption
205 *allOptions, unsigned int argc, char *const *argv); 198 *allOptions, unsigned int argc, char *const *argv);
206 199
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 1d4d47441..cce805ba0 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -115,7 +115,8 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor
115 * @return -1 on error, otherwise load value (between 0 and 100, 115 * @return -1 on error, otherwise load value (between 0 and 100,
116 * (100 is equivalent to full load for one CPU) 116 * (100 is equivalent to full load for one CPU)
117 */ 117 */
118int GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg); 118int GNUNET_OS_load_cpu_get (const struct GNUNET_CONFIGURATION_Handle *cfg);
119
119 120
120/** 121/**
121 * Get the current IO load. 122 * Get the current IO load.
@@ -125,7 +126,7 @@ int GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg);
125 * 100 means that we spend all of our cycles waiting for 126 * 100 means that we spend all of our cycles waiting for
126 * the disk) 127 * the disk)
127 */ 128 */
128int GNUNET_OS_load_disk_get (struct GNUNET_CONFIGURATION_Handle *cfg); 129int GNUNET_OS_load_disk_get (const struct GNUNET_CONFIGURATION_Handle *cfg);
129 130
130 131
131/** 132/**
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h
index 45c52c447..54fc68033 100644
--- a/src/include/gnunet_peerinfo_service.h
+++ b/src/include/gnunet_peerinfo_service.h
@@ -51,7 +51,7 @@ extern "C"
51 * @param hello the verified (!) HELLO message 51 * @param hello the verified (!) HELLO message
52 */ 52 */
53void 53void
54GNUNET_PEERINFO_add_peer (struct GNUNET_CONFIGURATION_Handle *cfg, 54GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg,
55 struct GNUNET_SCHEDULER_Handle *sched, 55 struct GNUNET_SCHEDULER_Handle *sched,
56 const struct GNUNET_PeerIdentity *peer, 56 const struct GNUNET_PeerIdentity *peer,
57 const struct GNUNET_HELLO_Message *hello); 57 const struct GNUNET_HELLO_Message *hello);
@@ -90,7 +90,7 @@ typedef void
90 * @param callback_cls closure for callback 90 * @param callback_cls closure for callback
91 */ 91 */
92void 92void
93GNUNET_PEERINFO_for_all (struct GNUNET_CONFIGURATION_Handle *cfg, 93GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
94 struct GNUNET_SCHEDULER_Handle *sched, 94 struct GNUNET_SCHEDULER_Handle *sched,
95 const struct GNUNET_PeerIdentity *peer, 95 const struct GNUNET_PeerIdentity *peer,
96 int trust_delta, 96 int trust_delta,
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h
index fcd00b8ef..a44f4f11e 100644
--- a/src/include/gnunet_program_lib.h
+++ b/src/include/gnunet_program_lib.h
@@ -52,7 +52,7 @@ typedef void (*GNUNET_PROGRAM_Main) (void *cls,
52 struct GNUNET_SCHEDULER_Handle * sched, 52 struct GNUNET_SCHEDULER_Handle * sched,
53 char *const *args, 53 char *const *args,
54 const char *cfgfile, 54 const char *cfgfile,
55 struct GNUNET_CONFIGURATION_Handle * 55 const struct GNUNET_CONFIGURATION_Handle *
56 cfg); 56 cfg);
57 57
58 58
diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h
index 0ee9ce7ac..ced9bf387 100644
--- a/src/include/gnunet_pseudonym_lib.h
+++ b/src/include/gnunet_pseudonym_lib.h
@@ -59,7 +59,7 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls,
59 * @param delta by how much should the rating be changed? 59 * @param delta by how much should the rating be changed?
60 * @return new rating of the namespace 60 * @return new rating of the namespace
61 */ 61 */
62int GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg, 62int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
63 const GNUNET_HashCode * pseudonym, int delta); 63 const GNUNET_HashCode * pseudonym, int delta);
64 64
65/** 65/**
@@ -67,7 +67,7 @@ int GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg,
67 * 67 *
68 * @param pseudonym the pseudonym's identifier 68 * @param pseudonym the pseudonym's identifier
69 */ 69 */
70void GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg, 70void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
71 const GNUNET_HashCode * pseudo, 71 const GNUNET_HashCode * pseudo,
72 const struct GNUNET_CONTAINER_MetaData *meta); 72 const struct GNUNET_CONTAINER_MetaData *meta);
73 73
@@ -75,7 +75,7 @@ void GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg,
75/** 75/**
76 * List all known pseudonyms. 76 * List all known pseudonyms.
77 */ 77 */
78int GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg, 78int GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
79 GNUNET_PSEUDONYM_Iterator iterator, 79 GNUNET_PSEUDONYM_Iterator iterator,
80 void *closure); 80 void *closure);
81 81
@@ -83,7 +83,7 @@ int GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg,
83 * Register callback to be invoked whenever we discover 83 * Register callback to be invoked whenever we discover
84 * a new pseudonym. 84 * a new pseudonym.
85 */ 85 */
86int GNUNET_PSEUDONYM_discovery_callback_register (struct 86int GNUNET_PSEUDONYM_discovery_callback_register (const struct
87 GNUNET_CONFIGURATION_Handle 87 GNUNET_CONFIGURATION_Handle
88 *cfg, 88 *cfg,
89 GNUNET_PSEUDONYM_Iterator 89 GNUNET_PSEUDONYM_Iterator
@@ -101,7 +101,7 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
101 * 101 *
102 * @return NULL on failure (should never happen) 102 * @return NULL on failure (should never happen)
103 */ 103 */
104char *GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg, 104char *GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg,
105 const GNUNET_HashCode * pseudo); 105 const GNUNET_HashCode * pseudo);
106 106
107/** 107/**
@@ -109,7 +109,7 @@ char *GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg,
109 * 109 *
110 * @return GNUNET_OK on success 110 * @return GNUNET_OK on success
111 */ 111 */
112int GNUNET_PSEUDONYM_name_to_id (struct GNUNET_CONFIGURATION_Handle *cfg, 112int GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
113 const char *hname, GNUNET_HashCode * psid); 113 const char *hname, GNUNET_HashCode * psid);
114 114
115 115
diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h
index ac7aebcc7..6d96cc56f 100644
--- a/src/include/gnunet_resolver_service.h
+++ b/src/include/gnunet_resolver_service.h
@@ -65,7 +65,7 @@ typedef void (*GNUNET_RESOLVER_AddressCallback) (void *cls,
65 */ 65 */
66void 66void
67GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched, 67GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched,
68 struct GNUNET_CONFIGURATION_Handle *cfg, 68 const struct GNUNET_CONFIGURATION_Handle *cfg,
69 const char *hostname, 69 const char *hostname,
70 int domain, 70 int domain,
71 struct GNUNET_TIME_Relative timeout, 71 struct GNUNET_TIME_Relative timeout,
@@ -84,7 +84,7 @@ GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched,
84 */ 84 */
85void 85void
86GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched, 86GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched,
87 struct GNUNET_CONFIGURATION_Handle *cfg, 87 const struct GNUNET_CONFIGURATION_Handle *cfg,
88 int domain, 88 int domain,
89 struct GNUNET_TIME_Relative timeout, 89 struct GNUNET_TIME_Relative timeout,
90 GNUNET_RESOLVER_AddressCallback callback, 90 GNUNET_RESOLVER_AddressCallback callback,
@@ -115,7 +115,7 @@ typedef void (*GNUNET_RESOLVER_HostnameCallback) (void *cls,
115 * @param cls closure for callback 115 * @param cls closure for callback
116 */ 116 */
117void GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, 117void GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched,
118 struct GNUNET_CONFIGURATION_Handle *cfg, 118 const struct GNUNET_CONFIGURATION_Handle *cfg,
119 const struct sockaddr *sa, 119 const struct sockaddr *sa,
120 socklen_t salen, 120 socklen_t salen,
121 int do_resolve, 121 int do_resolve,
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index dbfb2588b..4d0eefb98 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -50,7 +50,7 @@ extern "C"
50typedef void (*GNUNET_SERVICE_Main) (void *cls, 50typedef void (*GNUNET_SERVICE_Main) (void *cls,
51 struct GNUNET_SCHEDULER_Handle * sched, 51 struct GNUNET_SCHEDULER_Handle * sched,
52 struct GNUNET_SERVER_Handle * server, 52 struct GNUNET_SERVER_Handle * server,
53 struct GNUNET_CONFIGURATION_Handle * 53 const struct GNUNET_CONFIGURATION_Handle *
54 cfg); 54 cfg);
55 55
56 56
@@ -62,7 +62,7 @@ typedef void (*GNUNET_SERVICE_Main) (void *cls,
62 * @param cfg configuration to use 62 * @param cfg configuration to use
63 */ 63 */
64typedef void (*GNUNET_SERVICE_Term) (void *cls, 64typedef void (*GNUNET_SERVICE_Term) (void *cls,
65 struct GNUNET_CONFIGURATION_Handle * 65 const struct GNUNET_CONFIGURATION_Handle *
66 cfg); 66 cfg);
67 67
68 68
@@ -103,7 +103,7 @@ struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName,
103 struct 103 struct
104 GNUNET_SCHEDULER_Handle 104 GNUNET_SCHEDULER_Handle
105 *sched, 105 *sched,
106 struct 106 const struct
107 GNUNET_CONFIGURATION_Handle 107 GNUNET_CONFIGURATION_Handle
108 *cfg); 108 *cfg);
109 109
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h
index 8dd11094c..2496f4091 100644
--- a/src/include/gnunet_statistics_service.h
+++ b/src/include/gnunet_statistics_service.h
@@ -78,7 +78,7 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls,
78struct GNUNET_STATISTICS_Handle 78struct GNUNET_STATISTICS_Handle
79 *GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched, 79 *GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched,
80 const char *subsystem, 80 const char *subsystem,
81 struct GNUNET_CONFIGURATION_Handle *cfg); 81 const struct GNUNET_CONFIGURATION_Handle *cfg);
82 82
83 83
84/** 84/**
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 41dc21f75..3a18a17c3 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -58,16 +58,21 @@ struct GNUNET_TESTING_Daemon;
58 * 58 *
59 * @param cls closure 59 * @param cls closure
60 * @param id identifier for the daemon, NULL on error 60 * @param id identifier for the daemon, NULL on error
61 * @param d handle to the daemon, NULL if starting the daemon failed 61 * @param d handle for the daemon
62 * @param emsg error message (NULL on success)
62 */ 63 */
63typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, 64typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls,
64 const struct GNUNET_PeerIdentity *id, 65 const struct GNUNET_PeerIdentity *id,
65 struct GNUNET_TESTING_Daemon *d); 66 const struct GNUNET_CONFIGURATION_Handle *cfg,
67 struct GNUNET_TESTING_Daemon *d,
68 const char *emsg);
66 69
67 70
68/** 71/**
69 * Starts a GNUnet daemon. 72 * Starts a GNUnet daemon.
70 * 73 *
74 * @param sched scheduler to use
75 * @param cfg configuration to use
71 * @param service_home directory to use as the service home directory 76 * @param service_home directory to use as the service home directory
72 * @param transports transport services that should be loaded 77 * @param transports transport services that should be loaded
73 * @param applications application services and daemons that should be started 78 * @param applications application services and daemons that should be started
@@ -76,8 +81,9 @@ typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls,
76 * (use NULL for localhost). 81 * (use NULL for localhost).
77 * @param cb function to call with the result 82 * @param cb function to call with the result
78 * @param cb_cls closure for cb 83 * @param cb_cls closure for cb
84 * @return handle to the daemon (actual start will be completed asynchronously)
79 */ 85 */
80void 86struct GNUNET_TESTING_Daemon *
81GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched, 87GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched,
82 struct GNUNET_CONFIGURATION_Handle *cfg, 88 struct GNUNET_CONFIGURATION_Handle *cfg,
83 const char *service_home, 89 const char *service_home,
@@ -94,10 +100,10 @@ GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched,
94 * particular operation was completed the testing library. 100 * particular operation was completed the testing library.
95 * 101 *
96 * @param cls closure 102 * @param cls closure
97 * @param success GNUNET_YES on success 103 * @param emsg NULL on success
98 */ 104 */
99typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls, 105typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls,
100 int success); 106 const char *emsg);
101 107
102 108
103/** 109/**
@@ -112,17 +118,34 @@ void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
112 void * cb_cls); 118 void * cb_cls);
113 119
114 120
121/**
122 * Changes the configuration of a GNUnet daemon.
123 *
124 * @param d the daemon that should be modified
125 * @param cfg the new configuration for the daemon
126 * @param cb function called once the configuration was changed
127 * @param cb_cls closure for cb
128 */
129void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
130 struct GNUNET_CONFIGURATION_Handle *cfg,
131 GNUNET_TESTING_NotifyCompletion cb,
132 void * cb_cls);
133
134
115 135
116/** 136/**
117 * Establish a connection between two GNUnet daemons. 137 * Establish a connection between two GNUnet daemons.
118 * 138 *
119 * @param d1 handle for the first daemon 139 * @param d1 handle for the first daemon
120 * @param d2 handle for the second daemon 140 * @param d2 handle for the second daemon
141 * @param timeout how long is the connection attempt
142 * allowed to take?
121 * @param cb function to call at the end 143 * @param cb function to call at the end
122 * @param cb_cls closure for cb 144 * @param cb_cls closure for cb
123 */ 145 */
124void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, 146void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
125 struct GNUNET_TESTING_Daemon *d2, 147 struct GNUNET_TESTING_Daemon *d2,
148 struct GNUNET_TIME_Relative timeout,
126 GNUNET_TESTING_NotifyCompletion cb, 149 GNUNET_TESTING_NotifyCompletion cb,
127 void *cb_cls); 150 void *cb_cls);
128 151
@@ -134,11 +157,13 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
134 * be computed by adding delta each time (zero 157 * be computed by adding delta each time (zero
135 * times for the first peer). 158 * times for the first peer).
136 * 159 *
160 * @param sched scheduler to use
161 * @param cfg configuration to use
137 * @param total number of daemons to start 162 * @param total number of daemons to start
138 * @param service_home_prefix path to use as the prefix for the home of the services 163 * @param service_home_prefix path to use as the prefix for the home of the services;
164 * a number will be added for the different peers
139 * @param transports which transports should all peers use 165 * @param transports which transports should all peers use
140 * @param applications which applications should be used? 166 * @param applications which applications should be used?
141 * @param timeout how long is this allowed to take?
142 * @param cb function to call on each daemon that was started 167 * @param cb function to call on each daemon that was started
143 * @param cb_cls closure for cb 168 * @param cb_cls closure for cb
144 * @param cbe function to call at the end 169 * @param cbe function to call at the end
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 391a87e9d..037a247a2 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -111,7 +111,7 @@ typedef void
111struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct 111struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct
112 GNUNET_SCHEDULER_Handle 112 GNUNET_SCHEDULER_Handle
113 *sched, 113 *sched,
114 struct 114 const struct
115 GNUNET_CONFIGURATION_Handle 115 GNUNET_CONFIGURATION_Handle
116 *cfg, void *cls, 116 *cfg, void *cls,
117 GNUNET_TRANSPORT_ReceiveCallback 117 GNUNET_TRANSPORT_ReceiveCallback
diff --git a/src/peerinfo/gnunet-peerinfo.c b/src/peerinfo/gnunet-peerinfo.c
index 6c737c88a..3ade1468f 100644
--- a/src/peerinfo/gnunet-peerinfo.c
+++ b/src/peerinfo/gnunet-peerinfo.c
@@ -70,7 +70,8 @@ static void
70run (void *cls, 70run (void *cls,
71 struct GNUNET_SCHEDULER_Handle *sched, 71 struct GNUNET_SCHEDULER_Handle *sched,
72 char *const *args, 72 char *const *args,
73 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 73 const char *cfgfile,
74 const struct GNUNET_CONFIGURATION_Handle *cfg)
74{ 75{
75 struct GNUNET_CRYPTO_RsaPrivateKey *priv; 76 struct GNUNET_CRYPTO_RsaPrivateKey *priv;
76 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub; 77 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub;
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 6b709e84a..3a6030fda 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -652,7 +652,7 @@ static void
652run (void *cls, 652run (void *cls,
653 struct GNUNET_SCHEDULER_Handle *sched, 653 struct GNUNET_SCHEDULER_Handle *sched,
654 struct GNUNET_SERVER_Handle *server, 654 struct GNUNET_SERVER_Handle *server,
655 struct GNUNET_CONFIGURATION_Handle *cfg) 655 const struct GNUNET_CONFIGURATION_Handle *cfg)
656{ 656{
657 GNUNET_assert (GNUNET_OK == 657 GNUNET_assert (GNUNET_OK ==
658 GNUNET_CONFIGURATION_get_value_filename (cfg, 658 GNUNET_CONFIGURATION_get_value_filename (cfg,
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index ba5ade199..28865edc6 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -79,7 +79,7 @@ copy_and_free (void *cls, size_t size, void *buf)
79 * @param expiration when the HELLO will expire 79 * @param expiration when the HELLO will expire
80 */ 80 */
81void 81void
82GNUNET_PEERINFO_add_peer (struct GNUNET_CONFIGURATION_Handle *cfg, 82GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg,
83 struct GNUNET_SCHEDULER_Handle *sched, 83 struct GNUNET_SCHEDULER_Handle *sched,
84 const struct GNUNET_PeerIdentity *peer, 84 const struct GNUNET_PeerIdentity *peer,
85 const struct GNUNET_HELLO_Message *hello) 85 const struct GNUNET_HELLO_Message *hello)
@@ -251,7 +251,7 @@ copy_then_receive (void *cls, size_t size, void *buf)
251 * @param callback_cls closure for callback 251 * @param callback_cls closure for callback
252 */ 252 */
253void 253void
254GNUNET_PEERINFO_for_all (struct GNUNET_CONFIGURATION_Handle *cfg, 254GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
255 struct GNUNET_SCHEDULER_Handle *sched, 255 struct GNUNET_SCHEDULER_Handle *sched,
256 const struct GNUNET_PeerIdentity *peer, 256 const struct GNUNET_PeerIdentity *peer,
257 int trust_delta, 257 int trust_delta,
diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c
index c0b6847b6..b91241979 100644
--- a/src/peerinfo/test_peerinfo_api.c
+++ b/src/peerinfo/test_peerinfo_api.c
@@ -103,7 +103,8 @@ static void
103run (void *cls, 103run (void *cls,
104 struct GNUNET_SCHEDULER_Handle *sched, 104 struct GNUNET_SCHEDULER_Handle *sched,
105 char *const *args, 105 char *const *args,
106 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 106 const char *cfgfile,
107 const struct GNUNET_CONFIGURATION_Handle *cfg)
107{ 108{
108 struct GNUNET_HELLO_Message *hello; 109 struct GNUNET_HELLO_Message *hello;
109 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; 110 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey;
diff --git a/src/resolver/gnunet-service-resolver.c b/src/resolver/gnunet-service-resolver.c
index ad62424a5..ed7cbbe8f 100644
--- a/src/resolver/gnunet-service-resolver.c
+++ b/src/resolver/gnunet-service-resolver.c
@@ -450,7 +450,7 @@ static void
450run (void *cls, 450run (void *cls,
451 struct GNUNET_SCHEDULER_Handle *sched, 451 struct GNUNET_SCHEDULER_Handle *sched,
452 struct GNUNET_SERVER_Handle *server, 452 struct GNUNET_SERVER_Handle *server,
453 struct GNUNET_CONFIGURATION_Handle *cfg) 453 const struct GNUNET_CONFIGURATION_Handle *cfg)
454{ 454{
455 GNUNET_SERVER_add_handlers (server, handlers); 455 GNUNET_SERVER_add_handlers (server, handlers);
456} 456}
diff --git a/src/resolver/resolver_api.c b/src/resolver/resolver_api.c
index 27358996a..16debff6a 100644
--- a/src/resolver/resolver_api.c
+++ b/src/resolver/resolver_api.c
@@ -187,7 +187,7 @@ transmit_get_ip (void *cls, size_t size, void *buf)
187 */ 187 */
188void 188void
189GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched, 189GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched,
190 struct GNUNET_CONFIGURATION_Handle *cfg, 190 const struct GNUNET_CONFIGURATION_Handle *cfg,
191 const char *hostname, 191 const char *hostname,
192 int domain, 192 int domain,
193 struct GNUNET_TIME_Relative timeout, 193 struct GNUNET_TIME_Relative timeout,
@@ -349,7 +349,7 @@ transmit_get_hostname (void *cls, size_t size, void *buf)
349 */ 349 */
350void 350void
351GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, 351GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched,
352 struct GNUNET_CONFIGURATION_Handle *cfg, 352 const struct GNUNET_CONFIGURATION_Handle *cfg,
353 const struct sockaddr *sa, 353 const struct sockaddr *sa,
354 socklen_t salen, 354 socklen_t salen,
355 int do_resolve, 355 int do_resolve,
@@ -439,7 +439,7 @@ GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched,
439 */ 439 */
440void 440void
441GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched, 441GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched,
442 struct GNUNET_CONFIGURATION_Handle *cfg, 442 const struct GNUNET_CONFIGURATION_Handle *cfg,
443 int domain, 443 int domain,
444 struct GNUNET_TIME_Relative timeout, 444 struct GNUNET_TIME_Relative timeout,
445 GNUNET_RESOLVER_AddressCallback callback, 445 GNUNET_RESOLVER_AddressCallback callback,
diff --git a/src/resolver/test_resolver_api.c b/src/resolver/test_resolver_api.c
index b28dd0ca4..295217c30 100644
--- a/src/resolver/test_resolver_api.c
+++ b/src/resolver/test_resolver_api.c
@@ -126,7 +126,8 @@ static void
126run (void *cls, 126run (void *cls,
127 struct GNUNET_SCHEDULER_Handle *sched, 127 struct GNUNET_SCHEDULER_Handle *sched,
128 char *const *args, 128 char *const *args,
129 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 129 const char *cfgfile,
130 const struct GNUNET_CONFIGURATION_Handle *cfg)
130{ 131{
131 struct sockaddr_in sa; 132 struct sockaddr_in sa;
132 struct GNUNET_TIME_Relative timeout = 133 struct GNUNET_TIME_Relative timeout =
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index 1c0981b80..e4c3fe040 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -96,7 +96,7 @@ static uint32_t uidgen;
96 */ 96 */
97static void 97static void
98load (struct GNUNET_SERVER_Handle *server, 98load (struct GNUNET_SERVER_Handle *server,
99 struct GNUNET_CONFIGURATION_Handle *cfg) 99 const struct GNUNET_CONFIGURATION_Handle *cfg)
100{ 100{
101 char *fn; 101 char *fn;
102 struct GNUNET_DISK_FileHandle *fh; 102 struct GNUNET_DISK_FileHandle *fh;
@@ -157,7 +157,8 @@ load (struct GNUNET_SERVER_Handle *server,
157 * @param cfg configuration to use 157 * @param cfg configuration to use
158 */ 158 */
159static void 159static void
160save (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg) 160save (void *cls,
161 const struct GNUNET_CONFIGURATION_Handle *cfg)
161{ 162{
162 struct StatsEntry *pos; 163 struct StatsEntry *pos;
163 char *fn; 164 char *fn;
@@ -441,7 +442,7 @@ static void
441run (void *cls, 442run (void *cls,
442 struct GNUNET_SCHEDULER_Handle *sched, 443 struct GNUNET_SCHEDULER_Handle *sched,
443 struct GNUNET_SERVER_Handle *server, 444 struct GNUNET_SERVER_Handle *server,
444 struct GNUNET_CONFIGURATION_Handle *cfg) 445 const struct GNUNET_CONFIGURATION_Handle *cfg)
445{ 446{
446 GNUNET_SERVER_add_handlers (server, handlers); 447 GNUNET_SERVER_add_handlers (server, handlers);
447 load (server, cfg); 448 load (server, cfg);
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c
index bafb77c66..fe75f93aa 100644
--- a/src/statistics/gnunet-statistics.c
+++ b/src/statistics/gnunet-statistics.c
@@ -106,7 +106,8 @@ static void
106run (void *cls, 106run (void *cls,
107 struct GNUNET_SCHEDULER_Handle *sched, 107 struct GNUNET_SCHEDULER_Handle *sched,
108 char *const *args, 108 char *const *args,
109 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 109 const char *cfgfile,
110 const struct GNUNET_CONFIGURATION_Handle *cfg)
110{ 111{
111 struct GNUNET_STATISTICS_Handle *h; 112 struct GNUNET_STATISTICS_Handle *h;
112 unsigned long long val; 113 unsigned long long val;
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 5cbbfc9b6..26e2425e6 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -131,7 +131,7 @@ struct GNUNET_STATISTICS_Handle
131 /** 131 /**
132 * Configuration to use. 132 * Configuration to use.
133 */ 133 */
134 struct GNUNET_CONFIGURATION_Handle *cfg; 134 const struct GNUNET_CONFIGURATION_Handle *cfg;
135 135
136 /** 136 /**
137 * Socket (if available). 137 * Socket (if available).
@@ -208,7 +208,7 @@ free_action_item (struct ActionItem *ai)
208struct GNUNET_STATISTICS_Handle * 208struct GNUNET_STATISTICS_Handle *
209GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched, 209GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched,
210 const char *subsystem, 210 const char *subsystem,
211 struct GNUNET_CONFIGURATION_Handle *cfg) 211 const struct GNUNET_CONFIGURATION_Handle *cfg)
212{ 212{
213 struct GNUNET_STATISTICS_Handle *ret; 213 struct GNUNET_STATISTICS_Handle *ret;
214 214
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c
index b9f81d652..97e2f59c7 100644
--- a/src/statistics/test_statistics_api.c
+++ b/src/statistics/test_statistics_api.c
@@ -91,7 +91,8 @@ static void
91run (void *cls, 91run (void *cls,
92 struct GNUNET_SCHEDULER_Handle *sched, 92 struct GNUNET_SCHEDULER_Handle *sched,
93 char *const *args, 93 char *const *args,
94 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 94 const char *cfgfile,
95 const struct GNUNET_CONFIGURATION_Handle *cfg)
95{ 96{
96 97
97 h = GNUNET_STATISTICS_create (sched, "test-statistics-api", cfg); 98 h = GNUNET_STATISTICS_create (sched, "test-statistics-api", cfg);
@@ -107,7 +108,8 @@ static void
107run_more (void *cls, 108run_more (void *cls,
108 struct GNUNET_SCHEDULER_Handle *sched, 109 struct GNUNET_SCHEDULER_Handle *sched,
109 char *const *args, 110 char *const *args,
110 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 111 const char *cfgfile,
112 const struct GNUNET_CONFIGURATION_Handle *cfg)
111{ 113{
112 h = GNUNET_STATISTICS_create (sched, "test-statistics-api", cfg); 114 h = GNUNET_STATISTICS_create (sched, "test-statistics-api", cfg);
113 GNUNET_STATISTICS_get (h, NULL, "test-3", 115 GNUNET_STATISTICS_get (h, NULL, "test-3",
diff --git a/src/template/gnunet-service-template.c b/src/template/gnunet-service-template.c
index c43d681d7..3ab7d3dcc 100644
--- a/src/template/gnunet-service-template.c
+++ b/src/template/gnunet-service-template.c
@@ -34,7 +34,8 @@
34 * @param cfg configuration to use 34 * @param cfg configuration to use
35 */ 35 */
36static void 36static void
37finish (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg) 37finish (void *cls,
38 const struct GNUNET_CONFIGURATION_Handle *cfg)
38{ 39{
39 /* FIXME */ 40 /* FIXME */
40} 41}
@@ -61,7 +62,7 @@ static void
61run (void *cls, 62run (void *cls,
62 struct GNUNET_SCHEDULER_Handle *sched, 63 struct GNUNET_SCHEDULER_Handle *sched,
63 struct GNUNET_SERVER_Handle *server, 64 struct GNUNET_SERVER_Handle *server,
64 struct GNUNET_CONFIGURATION_Handle *cfg) 65 const struct GNUNET_CONFIGURATION_Handle *cfg)
65{ 66{
66 /* FIXME: do setup here */ 67 /* FIXME: do setup here */
67 GNUNET_SERVER_add_handlers (server, handlers); 68 GNUNET_SERVER_add_handlers (server, handlers);
diff --git a/src/template/gnunet-template.c b/src/template/gnunet-template.c
index ea47c7f45..ad0da8159 100644
--- a/src/template/gnunet-template.c
+++ b/src/template/gnunet-template.c
@@ -46,7 +46,8 @@ static void
46run (void *cls, 46run (void *cls,
47 struct GNUNET_SCHEDULER_Handle *sched, 47 struct GNUNET_SCHEDULER_Handle *sched,
48 char *const *args, 48 char *const *args,
49 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 49 const char *cfgfile,
50 const struct GNUNET_CONFIGURATION_Handle *cfg)
50{ 51{
51 /* main code here */ 52 /* main code here */
52} 53}
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 04d9d8801..a67023542 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -151,7 +151,7 @@ static struct GNUNET_SCHEDULER_Handle * sched;
151/** 151/**
152 * Our configuration. 152 * Our configuration.
153 */ 153 */
154static struct GNUNET_CONFIGURATION_Handle * cfg; 154static const struct GNUNET_CONFIGURATION_Handle * cfg;
155 155
156/** 156/**
157 * Handle to the core API. 157 * Handle to the core API.
@@ -725,7 +725,7 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
725 * Read the friends file. 725 * Read the friends file.
726 */ 726 */
727static void 727static void
728read_friends_file (struct GNUNET_CONFIGURATION_Handle *cfg) 728read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
729{ 729{
730 char *fn; 730 char *fn;
731 char *data; 731 char *data;
@@ -998,7 +998,7 @@ run (void *cls,
998 struct GNUNET_SCHEDULER_Handle * s, 998 struct GNUNET_SCHEDULER_Handle * s,
999 char *const *args, 999 char *const *args,
1000 const char *cfgfile, 1000 const char *cfgfile,
1001 struct GNUNET_CONFIGURATION_Handle * c) 1001 const struct GNUNET_CONFIGURATION_Handle * c)
1002{ 1002{
1003 struct GNUNET_CORE_MessageHandler handlers[] = 1003 struct GNUNET_CORE_MessageHandler handlers[] =
1004 { 1004 {
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 96d2001aa..d97cb15eb 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -547,7 +547,7 @@ struct GNUNET_SCHEDULER_Handle *sched;
547/** 547/**
548 * Our configuration. 548 * Our configuration.
549 */ 549 */
550struct GNUNET_CONFIGURATION_Handle *cfg; 550const struct GNUNET_CONFIGURATION_Handle *cfg;
551 551
552/** 552/**
553 * Linked list of all clients to this service. 553 * Linked list of all clients to this service.
@@ -2553,7 +2553,8 @@ client_disconnect_notification (void *cls,
2553static void 2553static void
2554run (void *cls, 2554run (void *cls,
2555 struct GNUNET_SCHEDULER_Handle *s, 2555 struct GNUNET_SCHEDULER_Handle *s,
2556 struct GNUNET_SERVER_Handle *serv, struct GNUNET_CONFIGURATION_Handle *c) 2556 struct GNUNET_SERVER_Handle *serv,
2557 const struct GNUNET_CONFIGURATION_Handle *c)
2557{ 2558{
2558 char *plugs; 2559 char *plugs;
2559 char *pos; 2560 char *pos;
@@ -2634,7 +2635,8 @@ run (void *cls,
2634 * @param cfg configuration to use 2635 * @param cfg configuration to use
2635 */ 2636 */
2636static void 2637static void
2637unload_plugins (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg) 2638unload_plugins (void *cls,
2639 const struct GNUNET_CONFIGURATION_Handle *cfg)
2638{ 2640{
2639 struct TransportPlugin *plug; 2641 struct TransportPlugin *plug;
2640 struct AddressList *al; 2642 struct AddressList *al;
diff --git a/src/transport/plugin_transport.h b/src/transport/plugin_transport.h
index 2a2e90d2a..1c545480d 100644
--- a/src/transport/plugin_transport.h
+++ b/src/transport/plugin_transport.h
@@ -177,7 +177,7 @@ struct GNUNET_TRANSPORT_PluginEnvironment
177 /** 177 /**
178 * Configuration to use. 178 * Configuration to use.
179 */ 179 */
180 struct GNUNET_CONFIGURATION_Handle *cfg; 180 const struct GNUNET_CONFIGURATION_Handle *cfg;
181 181
182 /** 182 /**
183 * Scheduler to use. 183 * Scheduler to use.
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index ef6c8a76a..981ce142a 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -67,7 +67,7 @@ struct GNUNET_SCHEDULER_Handle *sched;
67/** 67/**
68 * Our configuration. 68 * Our configuration.
69 */ 69 */
70struct GNUNET_CONFIGURATION_Handle *cfg; 70const struct GNUNET_CONFIGURATION_Handle *cfg;
71 71
72/** 72/**
73 * Number of neighbours we'd like to have. 73 * Number of neighbours we'd like to have.
@@ -135,7 +135,8 @@ void lookup (void *cls,
135 * @param cfg configuration to use 135 * @param cfg configuration to use
136 */ 136 */
137static void 137static void
138unload_plugins (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg) 138unload_plugins (void *cls,
139 const struct GNUNET_CONFIGURATION_Handle *cfg)
139{ 140{
140 GNUNET_assert (NULL == GNUNET_PLUGIN_unload ("libgnunet_plugin_transport_tcp",api)); 141 GNUNET_assert (NULL == GNUNET_PLUGIN_unload ("libgnunet_plugin_transport_tcp",api));
141 if (my_private_key != NULL) 142 if (my_private_key != NULL)
@@ -256,7 +257,7 @@ run (void *cls,
256 struct GNUNET_SCHEDULER_Handle *s, 257 struct GNUNET_SCHEDULER_Handle *s,
257 char *const *args, 258 char *const *args,
258 const char *cfgfile, 259 const char *cfgfile,
259 struct GNUNET_CONFIGURATION_Handle *c) 260 const struct GNUNET_CONFIGURATION_Handle *c)
260{ 261{
261 unsigned long long tneigh; 262 unsigned long long tneigh;
262 char *keyfile; 263 char *keyfile;
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index fb8cfe302..f96710c38 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -44,7 +44,7 @@
44 44
45struct PeerContext 45struct PeerContext
46{ 46{
47 struct GNUNET_CONFIGURATION_Handle *cfg; 47 const struct GNUNET_CONFIGURATION_Handle *cfg;
48 struct GNUNET_TRANSPORT_Handle *th; 48 struct GNUNET_TRANSPORT_Handle *th;
49 struct GNUNET_PeerIdentity id; 49 struct GNUNET_PeerIdentity id;
50#if START_ARM 50#if START_ARM
@@ -232,7 +232,8 @@ static void
232run (void *cls, 232run (void *cls,
233 struct GNUNET_SCHEDULER_Handle *s, 233 struct GNUNET_SCHEDULER_Handle *s,
234 char *const *args, 234 char *const *args,
235 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 235 const char *cfgfile,
236 const struct GNUNET_CONFIGURATION_Handle *cfg)
236{ 237{
237 GNUNET_assert (ok == 1); 238 GNUNET_assert (ok == 1);
238 OKPP; 239 OKPP;
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index eef0ede5e..3a5c8e0f5 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -313,7 +313,7 @@ struct GNUNET_TRANSPORT_Handle
313 /** 313 /**
314 * My configuration. 314 * My configuration.
315 */ 315 */
316 struct GNUNET_CONFIGURATION_Handle *cfg; 316 const struct GNUNET_CONFIGURATION_Handle *cfg;
317 317
318 /** 318 /**
319 * Linked list of the current neighbours of this peer. 319 * Linked list of the current neighbours of this peer.
@@ -1430,7 +1430,7 @@ add_neighbour (struct GNUNET_TRANSPORT_Handle *h,
1430 */ 1430 */
1431struct GNUNET_TRANSPORT_Handle * 1431struct GNUNET_TRANSPORT_Handle *
1432GNUNET_TRANSPORT_connect (struct GNUNET_SCHEDULER_Handle *sched, 1432GNUNET_TRANSPORT_connect (struct GNUNET_SCHEDULER_Handle *sched,
1433 struct GNUNET_CONFIGURATION_Handle *cfg, 1433 const struct GNUNET_CONFIGURATION_Handle *cfg,
1434 void *cls, 1434 void *cls,
1435 GNUNET_TRANSPORT_ReceiveCallback rec, 1435 GNUNET_TRANSPORT_ReceiveCallback rec,
1436 GNUNET_TRANSPORT_NotifyConnect nc, 1436 GNUNET_TRANSPORT_NotifyConnect nc,
diff --git a/src/util/client.c b/src/util/client.c
index 7d380fa5c..ab50d9d4d 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -124,7 +124,7 @@ struct GNUNET_CLIENT_Connection
124struct GNUNET_CLIENT_Connection * 124struct GNUNET_CLIENT_Connection *
125GNUNET_CLIENT_connect (struct GNUNET_SCHEDULER_Handle *sched, 125GNUNET_CLIENT_connect (struct GNUNET_SCHEDULER_Handle *sched,
126 const char *service_name, 126 const char *service_name,
127 struct GNUNET_CONFIGURATION_Handle *cfg) 127 const struct GNUNET_CONFIGURATION_Handle *cfg)
128{ 128{
129 struct GNUNET_CLIENT_Connection *ret; 129 struct GNUNET_CLIENT_Connection *ret;
130 struct GNUNET_NETWORK_SocketHandle *sock; 130 struct GNUNET_NETWORK_SocketHandle *sock;
@@ -455,7 +455,7 @@ write_test (void *cls, size_t size, void *buf)
455void 455void
456GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched, 456GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched,
457 const char *service, 457 const char *service,
458 struct GNUNET_CONFIGURATION_Handle *cfg, 458 const struct GNUNET_CONFIGURATION_Handle *cfg,
459 struct GNUNET_TIME_Relative timeout, 459 struct GNUNET_TIME_Relative timeout,
460 GNUNET_SCHEDULER_Task task, void *task_cls) 460 GNUNET_SCHEDULER_Task task, void *task_cls)
461{ 461{
diff --git a/src/util/configuration.c b/src/util/configuration.c
index eacbdbf05..769d2aadc 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -235,7 +235,7 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
235} 235}
236 236
237int 237int
238GNUNET_CONFIGURATION_test_dirty (struct GNUNET_CONFIGURATION_Handle *cfg) 238GNUNET_CONFIGURATION_test_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg)
239{ 239{
240 return cfg->dirty; 240 return cfg->dirty;
241} 241}
@@ -316,7 +316,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *data,
316 316
317 317
318static struct ConfigSection * 318static struct ConfigSection *
319findSection (struct GNUNET_CONFIGURATION_Handle *data, const char *section) 319findSection (const struct GNUNET_CONFIGURATION_Handle *data, const char *section)
320{ 320{
321 struct ConfigSection *pos; 321 struct ConfigSection *pos;
322 322
@@ -328,7 +328,7 @@ findSection (struct GNUNET_CONFIGURATION_Handle *data, const char *section)
328 328
329 329
330static struct ConfigEntry * 330static struct ConfigEntry *
331findEntry (struct GNUNET_CONFIGURATION_Handle *data, 331findEntry (const struct GNUNET_CONFIGURATION_Handle *data,
332 const char *section, const char *key) 332 const char *section, const char *key)
333{ 333{
334 struct ConfigSection *sec; 334 struct ConfigSection *sec;
@@ -386,7 +386,7 @@ GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle
386} 386}
387 387
388int 388int
389GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle 389GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
390 *cfg, const char *section, 390 *cfg, const char *section,
391 const char *option, 391 const char *option,
392 unsigned long long *number) 392 unsigned long long *number)
@@ -402,7 +402,7 @@ GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle
402} 402}
403 403
404int 404int
405GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle 405GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
406 *cfg, const char *section, 406 *cfg, const char *section,
407 const char *option, 407 const char *option,
408 struct GNUNET_TIME_Relative *time) 408 struct GNUNET_TIME_Relative *time)
@@ -420,7 +420,7 @@ GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
420} 420}
421 421
422int 422int
423GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle 423GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
424 *cfg, const char *section, 424 *cfg, const char *section,
425 const char *option, char **value) 425 const char *option, char **value)
426{ 426{
@@ -437,7 +437,7 @@ GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle
437} 437}
438 438
439int 439int
440GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle 440GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
441 *cfg, const char *section, 441 *cfg, const char *section,
442 const char *option, 442 const char *option,
443 const char **choices, 443 const char **choices,
@@ -473,7 +473,7 @@ GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle
473 * @return GNUNET_YES if so, GNUNET_NO if not. 473 * @return GNUNET_YES if so, GNUNET_NO if not.
474 */ 474 */
475int 475int
476GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg, 476GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
477 const char *section, const char *option) 477 const char *section, const char *option)
478{ 478{
479 struct ConfigEntry *e; 479 struct ConfigEntry *e;
@@ -491,7 +491,7 @@ GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg,
491 * @return $-expanded string 491 * @return $-expanded string
492 */ 492 */
493char * 493char *
494GNUNET_CONFIGURATION_expand_dollar (struct GNUNET_CONFIGURATION_Handle *cfg, 494GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg,
495 char *orig) 495 char *orig)
496{ 496{
497 int i; 497 int i;
@@ -543,7 +543,7 @@ GNUNET_CONFIGURATION_expand_dollar (struct GNUNET_CONFIGURATION_Handle *cfg,
543 * @return GNUNET_OK on success, GNUNET_SYSERR on error 543 * @return GNUNET_OK on success, GNUNET_SYSERR on error
544 */ 544 */
545int 545int
546GNUNET_CONFIGURATION_get_value_filename (struct GNUNET_CONFIGURATION_Handle 546GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle
547 *data, const char *section, 547 *data, const char *section,
548 const char *option, char **value) 548 const char *option, char **value)
549{ 549{
@@ -574,7 +574,7 @@ GNUNET_CONFIGURATION_get_value_filename (struct GNUNET_CONFIGURATION_Handle
574 * @return GNUNET_YES, GNUNET_NO or GNUNET_SYSERR 574 * @return GNUNET_YES, GNUNET_NO or GNUNET_SYSERR
575 */ 575 */
576int 576int
577GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle *cfg, 577GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *cfg,
578 const char *section, const char *option) 578 const char *section, const char *option)
579{ 579{
580 static const char *yesno[] = { "YES", "NO", NULL }; 580 static const char *yesno[] = { "YES", "NO", NULL };
@@ -597,7 +597,7 @@ GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle *cfg,
597 * @return number of filenames iterated over, -1 on error 597 * @return number of filenames iterated over, -1 on error
598 */ 598 */
599int 599int
600GNUNET_CONFIGURATION_iterate_value_filenames (struct 600GNUNET_CONFIGURATION_iterate_value_filenames (const struct
601 GNUNET_CONFIGURATION_Handle 601 GNUNET_CONFIGURATION_Handle
602 *cfg, const char *section, 602 *cfg, const char *section,
603 const char *option, 603 const char *option,
diff --git a/src/util/disk.c b/src/util/disk.c
index b0f92c7f2..ff4aff1f7 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1132,6 +1132,7 @@ GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h)
1132 * a directory, end the last argument in '/' (or pass 1132 * a directory, end the last argument in '/' (or pass
1133 * DIR_SEPARATOR_STR as the last argument before NULL). 1133 * DIR_SEPARATOR_STR as the last argument before NULL).
1134 * 1134 *
1135 * @param cfg configuration to use (determines HOME)
1135 * @param serviceName name of the service 1136 * @param serviceName name of the service
1136 * @param varargs is NULL-terminated list of 1137 * @param varargs is NULL-terminated list of
1137 * path components to append to the 1138 * path components to append to the
@@ -1139,7 +1140,7 @@ GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h)
1139 * @return the constructed filename 1140 * @return the constructed filename
1140 */ 1141 */
1141char * 1142char *
1142GNUNET_DISK_get_home_filename (struct GNUNET_CONFIGURATION_Handle *cfg, 1143GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
1143 const char *serviceName, ...) 1144 const char *serviceName, ...)
1144{ 1145{
1145 const char *c; 1146 const char *c;
diff --git a/src/util/getopt.c b/src/util/getopt.c
index e069e76f7..799146e77 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -997,7 +997,6 @@ GNgetopt_long (int argc,
997 */ 997 */
998int 998int
999GNUNET_GETOPT_run (const char *binaryOptions, 999GNUNET_GETOPT_run (const char *binaryOptions,
1000 struct GNUNET_CONFIGURATION_Handle *cfg,
1001 const struct GNUNET_GETOPT_CommandLineOption *allOptions, 1000 const struct GNUNET_GETOPT_CommandLineOption *allOptions,
1002 unsigned int argc, char *const *argv) 1001 unsigned int argc, char *const *argv)
1003{ 1002{
@@ -1017,7 +1016,6 @@ GNUNET_GETOPT_run (const char *binaryOptions,
1017 clpc.allOptions = allOptions; 1016 clpc.allOptions = allOptions;
1018 clpc.argv = argv; 1017 clpc.argv = argv;
1019 clpc.argc = argc; 1018 clpc.argc = argc;
1020 clpc.cfg = cfg;
1021 count = 0; 1019 count = 0;
1022 while (allOptions[count].name != NULL) 1020 while (allOptions[count].name != NULL)
1023 count++; 1021 count++;
diff --git a/src/util/os_load.c b/src/util/os_load.c
index d1115e33f..21e74eb49 100644
--- a/src/util/os_load.c
+++ b/src/util/os_load.c
@@ -517,7 +517,7 @@ updateUsage ()
517 * that lock has already been obtained. 517 * that lock has already been obtained.
518 */ 518 */
519static void 519static void
520updateAgedLoad (struct GNUNET_CONFIGURATION_Handle *cfg) 520updateAgedLoad (const struct GNUNET_CONFIGURATION_Handle *cfg)
521{ 521{
522 static struct GNUNET_TIME_Absolute lastCall; 522 static struct GNUNET_TIME_Absolute lastCall;
523 523
@@ -573,7 +573,7 @@ updateAgedLoad (struct GNUNET_CONFIGURATION_Handle *cfg)
573 * (100 is equivalent to full load) 573 * (100 is equivalent to full load)
574 */ 574 */
575int 575int
576GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg) 576GNUNET_OS_load_cpu_get (const struct GNUNET_CONFIGURATION_Handle *cfg)
577{ 577{
578 unsigned long long maxCPULoad; 578 unsigned long long maxCPULoad;
579 int ret; 579 int ret;
@@ -596,7 +596,7 @@ GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg)
596 * (100 is equivalent to full load) 596 * (100 is equivalent to full load)
597 */ 597 */
598int 598int
599GNUNET_OS_load_disk_get (struct GNUNET_CONFIGURATION_Handle *cfg) 599GNUNET_OS_load_disk_get (const struct GNUNET_CONFIGURATION_Handle *cfg)
600{ 600{
601 unsigned long long maxIOLoad; 601 unsigned long long maxIOLoad;
602 int ret; 602 int ret;
diff --git a/src/util/program.c b/src/util/program.c
index c8ebfc4eb..0cff324f8 100644
--- a/src/util/program.c
+++ b/src/util/program.c
@@ -63,7 +63,7 @@ struct CommandContext
63 /** 63 /**
64 * Configuration to use. 64 * Configuration to use.
65 */ 65 */
66 struct GNUNET_CONFIGURATION_Handle *cfg; 66 const struct GNUNET_CONFIGURATION_Handle *cfg;
67 67
68}; 68};
69 69
@@ -127,6 +127,7 @@ GNUNET_PROGRAM_run (int argc,
127 char *loglev; 127 char *loglev;
128 int ret; 128 int ret;
129 unsigned int cnt; 129 unsigned int cnt;
130 struct GNUNET_CONFIGURATION_Handle *cfg;
130 struct GNUNET_GETOPT_CommandLineOption defoptions[] = { 131 struct GNUNET_GETOPT_CommandLineOption defoptions[] = {
131 GNUNET_GETOPT_OPTION_CFG_FILE (&cc.cfgfile), 132 GNUNET_GETOPT_OPTION_CFG_FILE (&cc.cfgfile),
132 GNUNET_GETOPT_OPTION_HELP (binaryHelp), 133 GNUNET_GETOPT_OPTION_HELP (binaryHelp),
@@ -139,7 +140,7 @@ GNUNET_PROGRAM_run (int argc,
139 loglev = NULL; 140 loglev = NULL;
140 cc.task = task; 141 cc.task = task;
141 cc.task_cls = task_cls; 142 cc.task_cls = task_cls;
142 cc.cfg = GNUNET_CONFIGURATION_create (); 143 cc.cfg = cfg = GNUNET_CONFIGURATION_create ();
143 144
144 /* prepare */ 145 /* prepare */
145#if ENABLE_NLS 146#if ENABLE_NLS
@@ -169,15 +170,14 @@ GNUNET_PROGRAM_run (int argc,
169 qsort (allopts, cnt, sizeof (struct GNUNET_GETOPT_CommandLineOption), 170 qsort (allopts, cnt, sizeof (struct GNUNET_GETOPT_CommandLineOption),
170 &cmd_sorter); 171 &cmd_sorter);
171 loglev = GNUNET_strdup ("WARNING"); 172 loglev = GNUNET_strdup ("WARNING");
172 if ((-1 == (ret = GNUNET_GETOPT_run (binaryName, 173 if ((-1 == (ret = GNUNET_GETOPT_run (binaryName,
173 cc.cfg,
174 allopts, 174 allopts,
175 (unsigned int) argc, argv))) || 175 (unsigned int) argc, argv))) ||
176 ((GNUNET_OK != 176 ((GNUNET_OK !=
177 GNUNET_log_setup (binaryName, 177 GNUNET_log_setup (binaryName,
178 loglev, 178 loglev,
179 NULL)) || 179 NULL)) ||
180 (GNUNET_OK != GNUNET_CONFIGURATION_load (cc.cfg, cc.cfgfile)))) 180 (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cc.cfgfile))))
181 181
182 { 182 {
183 GNUNET_free_non_null (cc.cfgfile); 183 GNUNET_free_non_null (cc.cfgfile);
@@ -192,7 +192,7 @@ GNUNET_PROGRAM_run (int argc,
192 GNUNET_SCHEDULER_run (&program_main, &cc); 192 GNUNET_SCHEDULER_run (&program_main, &cc);
193 193
194 /* clean up */ 194 /* clean up */
195 GNUNET_CONFIGURATION_destroy (cc.cfg); 195 GNUNET_CONFIGURATION_destroy (cfg);
196 GNUNET_free_non_null (cc.cfgfile); 196 GNUNET_free_non_null (cc.cfgfile);
197 GNUNET_free (loglev); 197 GNUNET_free (loglev);
198 return GNUNET_OK; 198 return GNUNET_OK;
diff --git a/src/util/pseudonym.c b/src/util/pseudonym.c
index 52351c2c8..5bf336060 100644
--- a/src/util/pseudonym.c
+++ b/src/util/pseudonym.c
@@ -64,7 +64,7 @@ internal_notify (const GNUNET_HashCode * id,
64 * a new pseudonym. 64 * a new pseudonym.
65 */ 65 */
66int 66int
67GNUNET_PSEUDONYM_discovery_callback_register (struct 67GNUNET_PSEUDONYM_discovery_callback_register (const struct
68 GNUNET_CONFIGURATION_Handle 68 GNUNET_CONFIGURATION_Handle
69 *cfg, 69 *cfg,
70 GNUNET_PSEUDONYM_Iterator 70 GNUNET_PSEUDONYM_Iterator
@@ -115,7 +115,7 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
115 * pseudonym identifier and directory prefix. 115 * pseudonym identifier and directory prefix.
116 */ 116 */
117static char * 117static char *
118get_data_filename (struct GNUNET_CONFIGURATION_Handle 118get_data_filename (const struct GNUNET_CONFIGURATION_Handle
119 *cfg, const char *prefix, const GNUNET_HashCode * psid) 119 *cfg, const char *prefix, const GNUNET_HashCode * psid)
120{ 120{
121 struct GNUNET_CRYPTO_HashAsciiEncoded enc; 121 struct GNUNET_CRYPTO_HashAsciiEncoded enc;
@@ -131,7 +131,7 @@ get_data_filename (struct GNUNET_CONFIGURATION_Handle
131} 131}
132 132
133static void 133static void
134write_pseudonym_info (struct GNUNET_CONFIGURATION_Handle *cfg, 134write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
135 const GNUNET_HashCode * nsid, 135 const GNUNET_HashCode * nsid,
136 const struct GNUNET_CONTAINER_MetaData *meta, 136 const struct GNUNET_CONTAINER_MetaData *meta,
137 int32_t ranking, const char *ns_name) 137 int32_t ranking, const char *ns_name)
@@ -179,7 +179,7 @@ write_pseudonym_info (struct GNUNET_CONFIGURATION_Handle *cfg,
179} 179}
180 180
181static int 181static int
182read_info (struct GNUNET_CONFIGURATION_Handle *cfg, 182read_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
183 const GNUNET_HashCode * nsid, 183 const GNUNET_HashCode * nsid,
184 struct GNUNET_CONTAINER_MetaData **meta, 184 struct GNUNET_CONTAINER_MetaData **meta,
185 int32_t * ranking, char **ns_name) 185 int32_t * ranking, char **ns_name)
@@ -273,7 +273,7 @@ read_info (struct GNUNET_CONFIGURATION_Handle *cfg,
273 * @return NULL on failure (should never happen) 273 * @return NULL on failure (should never happen)
274 */ 274 */
275char * 275char *
276GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg, 276GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg,
277 const GNUNET_HashCode * nsid) 277 const GNUNET_HashCode * nsid)
278{ 278{
279 struct GNUNET_CONTAINER_MetaData *meta; 279 struct GNUNET_CONTAINER_MetaData *meta;
@@ -356,7 +356,7 @@ GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg,
356 * @return GNUNET_OK on success 356 * @return GNUNET_OK on success
357 */ 357 */
358int 358int
359GNUNET_PSEUDONYM_name_to_id (struct GNUNET_CONFIGURATION_Handle *cfg, 359GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
360 const char *ns_uname, GNUNET_HashCode * nsid) 360 const char *ns_uname, GNUNET_HashCode * nsid)
361{ 361{
362 size_t slen; 362 size_t slen;
@@ -408,7 +408,7 @@ struct ListPseudonymClosure
408{ 408{
409 GNUNET_PSEUDONYM_Iterator iterator; 409 GNUNET_PSEUDONYM_Iterator iterator;
410 void *closure; 410 void *closure;
411 struct GNUNET_CONFIGURATION_Handle *cfg; 411 const struct GNUNET_CONFIGURATION_Handle *cfg;
412}; 412};
413 413
414static int 414static int
@@ -443,7 +443,7 @@ list_pseudonym_helper (void *cls, const char *fullname)
443 * List all available pseudonyms. 443 * List all available pseudonyms.
444 */ 444 */
445int 445int
446GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg, 446GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
447 GNUNET_PSEUDONYM_Iterator iterator, void *closure) 447 GNUNET_PSEUDONYM_Iterator iterator, void *closure)
448{ 448{
449 struct ListPseudonymClosure cls; 449 struct ListPseudonymClosure cls;
@@ -470,7 +470,7 @@ GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg,
470 * @return new rating of the pseudonym 470 * @return new rating of the pseudonym
471 */ 471 */
472int 472int
473GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg, 473GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
474 const GNUNET_HashCode * nsid, int delta) 474 const GNUNET_HashCode * nsid, int delta)
475{ 475{
476 struct GNUNET_CONTAINER_MetaData *meta; 476 struct GNUNET_CONTAINER_MetaData *meta;
@@ -513,7 +513,7 @@ merge_meta_helper (EXTRACTOR_KeywordType type, const char *data, void *cls)
513 * @param id the pseudonym identifier 513 * @param id the pseudonym identifier
514 */ 514 */
515void 515void
516GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg, 516GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
517 const GNUNET_HashCode * id, 517 const GNUNET_HashCode * id,
518 const struct GNUNET_CONTAINER_MetaData *meta) 518 const struct GNUNET_CONTAINER_MetaData *meta)
519{ 519{
diff --git a/src/util/service.c b/src/util/service.c
index 0569a0fde..a976fab78 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -420,7 +420,7 @@ struct GNUNET_SERVICE_Context
420 /** 420 /**
421 * Our configuration. 421 * Our configuration.
422 */ 422 */
423 struct GNUNET_CONFIGURATION_Handle *cfg; 423 const struct GNUNET_CONFIGURATION_Handle *cfg;
424 424
425 /** 425 /**
426 * Handle for the server. 426 * Handle for the server.
@@ -1264,6 +1264,7 @@ GNUNET_SERVICE_run (int argc,
1264 char *logfile; 1264 char *logfile;
1265 int do_daemonize; 1265 int do_daemonize;
1266 struct GNUNET_SERVICE_Context sctx; 1266 struct GNUNET_SERVICE_Context sctx;
1267 struct GNUNET_CONFIGURATION_Handle *cfg;
1267 struct GNUNET_GETOPT_CommandLineOption service_options[] = { 1268 struct GNUNET_GETOPT_CommandLineOption service_options[] = {
1268 GNUNET_GETOPT_OPTION_CFG_FILE (&cfg_fn), 1269 GNUNET_GETOPT_OPTION_CFG_FILE (&cfg_fn),
1269 {'d', "daemonize", NULL, 1270 {'d', "daemonize", NULL,
@@ -1286,18 +1287,17 @@ GNUNET_SERVICE_run (int argc,
1286 sctx.maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE; 1287 sctx.maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE;
1287 sctx.task = task; 1288 sctx.task = task;
1288 sctx.serviceName = serviceName; 1289 sctx.serviceName = serviceName;
1289 sctx.cfg = GNUNET_CONFIGURATION_create (); 1290 sctx.cfg = cfg = GNUNET_CONFIGURATION_create ();
1290 /* setup subsystems */ 1291 /* setup subsystems */
1291 if ((GNUNET_SYSERR == 1292 if ((GNUNET_SYSERR ==
1292 GNUNET_GETOPT_run (serviceName, 1293 GNUNET_GETOPT_run (serviceName,
1293 sctx.cfg,
1294 service_options, 1294 service_options,
1295 argc, 1295 argc,
1296 argv)) || 1296 argv)) ||
1297 (GNUNET_OK != 1297 (GNUNET_OK !=
1298 GNUNET_log_setup (serviceName, loglev, logfile)) || 1298 GNUNET_log_setup (serviceName, loglev, logfile)) ||
1299 (GNUNET_OK != 1299 (GNUNET_OK !=
1300 GNUNET_CONFIGURATION_load (sctx.cfg, cfg_fn)) || 1300 GNUNET_CONFIGURATION_load (cfg, cfg_fn)) ||
1301 (GNUNET_OK != 1301 (GNUNET_OK !=
1302 setup_service (&sctx)) || 1302 setup_service (&sctx)) ||
1303 ((do_daemonize == 1) && 1303 ((do_daemonize == 1) &&
@@ -1310,7 +1310,7 @@ GNUNET_SERVICE_run (int argc,
1310 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "write"); 1310 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "write");
1311 GNUNET_break (0 == CLOSE (sctx.ready_confirm_fd)); 1311 GNUNET_break (0 == CLOSE (sctx.ready_confirm_fd));
1312 } 1312 }
1313 GNUNET_CONFIGURATION_destroy (sctx.cfg); 1313 GNUNET_CONFIGURATION_destroy (cfg);
1314 GNUNET_free_non_null (sctx.addr); 1314 GNUNET_free_non_null (sctx.addr);
1315 GNUNET_free_non_null (logfile); 1315 GNUNET_free_non_null (logfile);
1316 GNUNET_free (loglev); 1316 GNUNET_free (loglev);
@@ -1339,7 +1339,7 @@ GNUNET_SERVICE_run (int argc,
1339 if (sctx.server != NULL) 1339 if (sctx.server != NULL)
1340 GNUNET_SERVER_destroy (sctx.server); 1340 GNUNET_SERVER_destroy (sctx.server);
1341 GNUNET_free_non_null (sctx.my_handlers); 1341 GNUNET_free_non_null (sctx.my_handlers);
1342 GNUNET_CONFIGURATION_destroy (sctx.cfg); 1342 GNUNET_CONFIGURATION_destroy (cfg);
1343 GNUNET_free_non_null (sctx.addr); 1343 GNUNET_free_non_null (sctx.addr);
1344 GNUNET_free_non_null (logfile); 1344 GNUNET_free_non_null (logfile);
1345 GNUNET_free (loglev); 1345 GNUNET_free (loglev);
@@ -1364,7 +1364,7 @@ GNUNET_SERVICE_run (int argc,
1364struct GNUNET_SERVICE_Context * 1364struct GNUNET_SERVICE_Context *
1365GNUNET_SERVICE_start (const char *serviceName, 1365GNUNET_SERVICE_start (const char *serviceName,
1366 struct GNUNET_SCHEDULER_Handle *sched, 1366 struct GNUNET_SCHEDULER_Handle *sched,
1367 struct GNUNET_CONFIGURATION_Handle *cfg) 1367 const struct GNUNET_CONFIGURATION_Handle *cfg)
1368{ 1368{
1369 int i; 1369 int i;
1370 struct GNUNET_SERVICE_Context *sctx; 1370 struct GNUNET_SERVICE_Context *sctx;
diff --git a/src/util/test_getopt.c b/src/util/test_getopt.c
index 89e7be863..7168dd8c1 100644
--- a/src/util/test_getopt.c
+++ b/src/util/test_getopt.c
@@ -31,7 +31,6 @@
31static int 31static int
32testMinimal () 32testMinimal ()
33{ 33{
34 struct GNUNET_CONFIGURATION_Handle *cfg;
35 char *const emptyargv[] = { 34 char *const emptyargv[] = {
36 "test", 35 "test",
37 NULL 36 NULL
@@ -40,13 +39,8 @@ testMinimal ()
40 GNUNET_GETOPT_OPTION_END 39 GNUNET_GETOPT_OPTION_END
41 }; 40 };
42 41
43 cfg = GNUNET_CONFIGURATION_create (); 42 if (1 != GNUNET_GETOPT_run ("test", emptyoptionlist, 1, emptyargv))
44 if (1 != GNUNET_GETOPT_run ("test", cfg, emptyoptionlist, 1, emptyargv)) 43 return 1;
45 {
46 GNUNET_CONFIGURATION_destroy (cfg);
47 return 1;
48 }
49 GNUNET_CONFIGURATION_destroy (cfg);
50 44
51 return 0; 45 return 0;
52} 46}
@@ -54,7 +48,6 @@ testMinimal ()
54static int 48static int
55testVerbose () 49testVerbose ()
56{ 50{
57 struct GNUNET_CONFIGURATION_Handle *cfg;
58 char *const myargv[] = { 51 char *const myargv[] = {
59 "test", 52 "test",
60 "-V", 53 "-V",
@@ -68,14 +61,11 @@ testVerbose ()
68 GNUNET_GETOPT_OPTION_END 61 GNUNET_GETOPT_OPTION_END
69 }; 62 };
70 63
71 cfg = GNUNET_CONFIGURATION_create (); 64 if (3 != GNUNET_GETOPT_run ("test", verboseoptionlist, 4, myargv))
72 if (3 != GNUNET_GETOPT_run ("test", cfg, verboseoptionlist, 4, myargv))
73 { 65 {
74 GNUNET_break (0); 66 GNUNET_break (0);
75 GNUNET_CONFIGURATION_destroy (cfg);
76 return 1; 67 return 1;
77 } 68 }
78 GNUNET_CONFIGURATION_destroy (cfg);
79 if (vflags != 2) 69 if (vflags != 2)
80 { 70 {
81 GNUNET_break (0); 71 GNUNET_break (0);
@@ -87,7 +77,6 @@ testVerbose ()
87static int 77static int
88testVersion () 78testVersion ()
89{ 79{
90 struct GNUNET_CONFIGURATION_Handle *cfg;
91 char *const myargv[] = { 80 char *const myargv[] = {
92 "test_getopt", 81 "test_getopt",
93 "-v", 82 "-v",
@@ -98,22 +87,18 @@ testVersion ()
98 GNUNET_GETOPT_OPTION_END 87 GNUNET_GETOPT_OPTION_END
99 }; 88 };
100 89
101 cfg = GNUNET_CONFIGURATION_create ();
102 if (-1 != GNUNET_GETOPT_run ("test_getopt", 90 if (-1 != GNUNET_GETOPT_run ("test_getopt",
103 cfg, versionoptionlist, 2, myargv)) 91 versionoptionlist, 2, myargv))
104 { 92 {
105 GNUNET_break (0); 93 GNUNET_break (0);
106 GNUNET_CONFIGURATION_destroy (cfg);
107 return 1; 94 return 1;
108 } 95 }
109 GNUNET_CONFIGURATION_destroy (cfg);
110 return 0; 96 return 0;
111} 97}
112 98
113static int 99static int
114testAbout () 100testAbout ()
115{ 101{
116 struct GNUNET_CONFIGURATION_Handle *cfg;
117 char *const myargv[] = { 102 char *const myargv[] = {
118 "test_getopt", 103 "test_getopt",
119 "-h", 104 "-h",
@@ -124,22 +109,18 @@ testAbout ()
124 GNUNET_GETOPT_OPTION_END 109 GNUNET_GETOPT_OPTION_END
125 }; 110 };
126 111
127 cfg = GNUNET_CONFIGURATION_create ();
128 if (-1 != GNUNET_GETOPT_run ("test_getopt", 112 if (-1 != GNUNET_GETOPT_run ("test_getopt",
129 cfg, aboutoptionlist, 2, myargv)) 113 aboutoptionlist, 2, myargv))
130 { 114 {
131 GNUNET_break (0); 115 GNUNET_break (0);
132 GNUNET_CONFIGURATION_destroy (cfg);
133 return 1; 116 return 1;
134 } 117 }
135 GNUNET_CONFIGURATION_destroy (cfg);
136 return 0; 118 return 0;
137} 119}
138 120
139static int 121static int
140testLogOpts () 122testLogOpts ()
141{ 123{
142 struct GNUNET_CONFIGURATION_Handle *cfg;
143 char *const myargv[] = { 124 char *const myargv[] = {
144 "test_getopt", 125 "test_getopt",
145 "-l", "filename", 126 "-l", "filename",
@@ -154,15 +135,12 @@ testLogOpts ()
154 GNUNET_GETOPT_OPTION_END 135 GNUNET_GETOPT_OPTION_END
155 }; 136 };
156 137
157 cfg = GNUNET_CONFIGURATION_create (); 138 if (5 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 5, myargv))
158 if (5 != GNUNET_GETOPT_run ("test_getopt", cfg, logoptionlist, 5, myargv))
159 { 139 {
160 GNUNET_break (0); 140 GNUNET_break (0);
161 GNUNET_CONFIGURATION_destroy (cfg);
162 return 1; 141 return 1;
163 } 142 }
164 GNUNET_assert (fn != NULL); 143 GNUNET_assert (fn != NULL);
165 GNUNET_CONFIGURATION_destroy (cfg);
166 if ((0 != strcmp (level, "WARNING")) || (0 != strcmp (fn, "filename"))) 144 if ((0 != strcmp (level, "WARNING")) || (0 != strcmp (fn, "filename")))
167 { 145 {
168 GNUNET_break (0); 146 GNUNET_break (0);
@@ -178,7 +156,6 @@ testLogOpts ()
178static int 156static int
179testFlagNum () 157testFlagNum ()
180{ 158{
181 struct GNUNET_CONFIGURATION_Handle *cfg;
182 char *const myargv[] = { 159 char *const myargv[] = {
183 "test_getopt", 160 "test_getopt",
184 "-f", 161 "-f",
@@ -199,14 +176,11 @@ testFlagNum ()
199 GNUNET_GETOPT_OPTION_END 176 GNUNET_GETOPT_OPTION_END
200 }; 177 };
201 178
202 cfg = GNUNET_CONFIGURATION_create (); 179 if (6 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 6, myargv))
203 if (6 != GNUNET_GETOPT_run ("test_getopt", cfg, logoptionlist, 6, myargv))
204 { 180 {
205 GNUNET_break (0); 181 GNUNET_break (0);
206 GNUNET_CONFIGURATION_destroy (cfg);
207 return 1; 182 return 1;
208 } 183 }
209 GNUNET_CONFIGURATION_destroy (cfg);
210 if ((1 != flag) || (42 != num) || (42 != lnum)) 184 if ((1 != flag) || (42 != num) || (42 != lnum))
211 { 185 {
212 GNUNET_break (0); 186 GNUNET_break (0);
diff --git a/src/util/test_program.c b/src/util/test_program.c
index dee602e2a..5c58123b5 100644
--- a/src/util/test_program.c
+++ b/src/util/test_program.c
@@ -41,7 +41,8 @@ static void
41runner (void *cls, 41runner (void *cls,
42 struct GNUNET_SCHEDULER_Handle *sched, 42 struct GNUNET_SCHEDULER_Handle *sched,
43 char *const *args, 43 char *const *args,
44 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 44 const char *cfgfile,
45 const struct GNUNET_CONFIGURATION_Handle *cfg)
45{ 46{
46 int *ok = cls; 47 int *ok = cls;
47 GNUNET_assert (setme == 1); 48 GNUNET_assert (setme == 1);
diff --git a/src/util/test_service.c b/src/util/test_service.c
index 233c23ccf..e8e3f8741 100644
--- a/src/util/test_service.c
+++ b/src/util/test_service.c
@@ -74,7 +74,7 @@ build_msg (void *cls, size_t size, void *buf)
74static void 74static void
75ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 75ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
76{ 76{
77 struct GNUNET_CONFIGURATION_Handle *cfg = cls; 77 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
78 struct GNUNET_CLIENT_Connection *client; 78 struct GNUNET_CLIENT_Connection *client;
79 79
80 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service confirmed running\n"); 80 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service confirmed running\n");
@@ -108,17 +108,18 @@ static void
108runner (void *cls, 108runner (void *cls,
109 struct GNUNET_SCHEDULER_Handle *sched, 109 struct GNUNET_SCHEDULER_Handle *sched,
110 struct GNUNET_SERVER_Handle *server, 110 struct GNUNET_SERVER_Handle *server,
111 struct GNUNET_CONFIGURATION_Handle *cfg) 111 const struct GNUNET_CONFIGURATION_Handle *cfg)
112{ 112{
113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service initializing\n"); 113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service initializing\n");
114 GNUNET_SERVER_add_handlers (server, myhandlers); 114 GNUNET_SERVER_add_handlers (server, myhandlers);
115 GNUNET_CLIENT_service_test (sched, 115 GNUNET_CLIENT_service_test (sched,
116 "test_service", 116 "test_service",
117 cfg, GNUNET_TIME_UNIT_SECONDS, &ready, cfg); 117 cfg, GNUNET_TIME_UNIT_SECONDS, &ready, (void*) cfg);
118} 118}
119 119
120static void 120static void
121term (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg) 121term (void *cls,
122 const struct GNUNET_CONFIGURATION_Handle *cfg)
122{ 123{
123 int *ok = cls; 124 int *ok = cls;
124 *ok = 0; 125 *ok = 0;
@@ -157,7 +158,7 @@ check ()
157static void 158static void
158ready6 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 159ready6 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
159{ 160{
160 struct GNUNET_CONFIGURATION_Handle *cfg = cls; 161 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
161 struct GNUNET_CLIENT_Connection *client; 162 struct GNUNET_CLIENT_Connection *client;
162 163
163 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "V6 ready\n"); 164 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "V6 ready\n");
@@ -176,13 +177,13 @@ static void
176runner6 (void *cls, 177runner6 (void *cls,
177 struct GNUNET_SCHEDULER_Handle *sched, 178 struct GNUNET_SCHEDULER_Handle *sched,
178 struct GNUNET_SERVER_Handle *server, 179 struct GNUNET_SERVER_Handle *server,
179 struct GNUNET_CONFIGURATION_Handle *cfg) 180 const struct GNUNET_CONFIGURATION_Handle *cfg)
180{ 181{
181 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Initializing v6 service\n"); 182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Initializing v6 service\n");
182 GNUNET_SERVER_add_handlers (server, myhandlers); 183 GNUNET_SERVER_add_handlers (server, myhandlers);
183 GNUNET_CLIENT_service_test (sched, 184 GNUNET_CLIENT_service_test (sched,
184 "test_service6", 185 "test_service6",
185 cfg, GNUNET_TIME_UNIT_SECONDS, &ready6, cfg); 186 cfg, GNUNET_TIME_UNIT_SECONDS, &ready6, (void*) cfg);
186} 187}
187 188
188/** 189/**
@@ -252,7 +253,8 @@ static void
252start_stop_main (void *cls, 253start_stop_main (void *cls,
253 struct GNUNET_SCHEDULER_Handle *sched, 254 struct GNUNET_SCHEDULER_Handle *sched,
254 char *const *args, 255 char *const *args,
255 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) 256 const char *cfgfile,
257 const struct GNUNET_CONFIGURATION_Handle *cfg)
256{ 258{
257 int *ret = cls; 259 int *ret = cls;
258 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 260 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,