aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-17 18:13:55 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-17 18:13:55 +0100
commit17d34d5e094c2f8a90717b07e3a711d6e2c15903 (patch)
tree777b5323145a5f4d1f044da29a682799008a11d4 /src/include
parent3391977e3f92a2ebcafc14ea6374aecd580df873 (diff)
downloadgnunet-17d34d5e094c2f8a90717b07e3a711d6e2c15903.tar.gz
gnunet-17d34d5e094c2f8a90717b07e3a711d6e2c15903.zip
more renamings relating to 'new' service now just being the 'normal' service
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_bandwidth_lib.h14
-rw-r--r--src/include/gnunet_constants.h2
-rw-r--r--src/include/gnunet_service_lib.h80
-rw-r--r--src/include/gnunet_util_lib.h15
4 files changed, 31 insertions, 80 deletions
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h
index 178ddaaac..967d50dea 100644
--- a/src/include/gnunet_bandwidth_lib.h
+++ b/src/include/gnunet_bandwidth_lib.h
@@ -133,7 +133,7 @@ struct GNUNET_BANDWIDTH_Tracker
133 /** 133 /**
134 * Maximum number of seconds over which bandwidth may "accumulate". 134 * Maximum number of seconds over which bandwidth may "accumulate".
135 * Note that additionally, we also always allow at least 135 * Note that additionally, we also always allow at least
136 * #GNUNET_SERVER_MAX_MESSAGE_SIZE to accumulate. 136 * #GNUNET_MAX_MESSAGE_SIZE to accumulate.
137 */ 137 */
138 uint32_t max_carry_s__; 138 uint32_t max_carry_s__;
139}; 139};
@@ -214,10 +214,10 @@ GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1,
214/** 214/**
215 * Initialize bandwidth tracker. Note that in addition to the 215 * Initialize bandwidth tracker. Note that in addition to the
216 * 'max_carry_s' limit, we also always allow at least 216 * 'max_carry_s' limit, we also always allow at least
217 * #GNUNET_SERVER_MAX_MESSAGE_SIZE to accumulate. So if the 217 * #GNUNET_MAX_MESSAGE_SIZE to accumulate. So if the
218 * bytes-per-second limit is so small that within 'max_carry_s' not 218 * bytes-per-second limit is so small that within 'max_carry_s' not
219 * even #GNUNET_SERVER_MAX_MESSAGE_SIZE is allowed to accumulate, it is 219 * even #GNUNET_MAX_MESSAGE_SIZE is allowed to accumulate, it is
220 * ignored and replaced by #GNUNET_SERVER_MAX_MESSAGE_SIZE (which is in 220 * ignored and replaced by #GNUNET_MAX_MESSAGE_SIZE (which is in
221 * bytes). 221 * bytes).
222 * 222 *
223 * @param av tracker to initialize 223 * @param av tracker to initialize
@@ -238,10 +238,10 @@ GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av,
238/** 238/**
239 * Initialize bandwidth tracker. Note that in addition to the 239 * Initialize bandwidth tracker. Note that in addition to the
240 * 'max_carry_s' limit, we also always allow at least 240 * 'max_carry_s' limit, we also always allow at least
241 * GNUNET_SERVER_MAX_MESSAGE_SIZE to accumulate. So if the 241 * GNUNET_MAX_MESSAGE_SIZE to accumulate. So if the
242 * bytes-per-second limit is so small that within 'max_carry_s' not 242 * bytes-per-second limit is so small that within 'max_carry_s' not
243 * even GNUNET_SERVER_MAX_MESSAGE_SIZE is allowed to accumulate, it is 243 * even GNUNET_MAX_MESSAGE_SIZE is allowed to accumulate, it is
244 * ignored and replaced by GNUNET_SERVER_MAX_MESSAGE_SIZE (which is in 244 * ignored and replaced by GNUNET_MAX_MESSAGE_SIZE (which is in
245 * bytes). 245 * bytes).
246 * 246 *
247 * @param av tracker to initialize 247 * @param av tracker to initialize
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index 1d0232cea..1c48298a0 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -40,6 +40,8 @@ extern "C"
40#endif 40#endif
41#endif 41#endif
42 42
43
44
43/** 45/**
44 * Bandwidth (in/out) to assume initially (before either peer has 46 * Bandwidth (in/out) to assume initially (before either peer has
45 * communicated any particular preference). Should be rather low; set 47 * communicated any particular preference). Should be rather low; set
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index c506fc6fa..aacafe956 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009-2013, 2016 GNUnet e.V. 3 Copyright (C) 2009-2013, 2016, 2017 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -46,27 +46,6 @@ extern "C"
46#include "gnunet_configuration_lib.h" 46#include "gnunet_configuration_lib.h"
47#include "gnunet_mq_lib.h" 47#include "gnunet_mq_lib.h"
48 48
49/**
50 * Largest supported message (to be precise, one byte more
51 * than the largest possible message, so tests involving
52 * this value should check for messages being smaller than
53 * this value). NOTE: legacy name.
54 */
55#define GNUNET_SERVER_MAX_MESSAGE_SIZE 65536
56
57/**
58 * Smallest supported message. NOTE: legacy name.
59 */
60#define GNUNET_SERVER_MIN_BUFFER_SIZE sizeof (struct GNUNET_MessageHeader)
61
62/**
63 * Timeout we use on TCP connect before trying another
64 * result from the DNS resolver. Actual value used
65 * is this value divided by the number of address families.
66 * Default is 5s. NOTE: legacy name.
67 */
68#define GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
69
70 49
71/** 50/**
72 * Options for the service (bitmask). 51 * Options for the service (bitmask).
@@ -95,51 +74,6 @@ enum GNUNET_SERVICE_Options
95 74
96 75
97 76
98
99/**
100 * Opaque handle for a service.
101 */
102struct GNUNET_SERVICE_Context;
103
104
105/**
106 * Run a service startup sequence within an existing
107 * initialized system.
108 *
109 * @param service_name our service name
110 * @param cfg configuration to use
111 * @param options service options
112 * @return NULL on error, service handle
113 * @deprecated
114 */
115struct GNUNET_SERVICE_Context *
116GNUNET_SERVICE_start (const char *service_name,
117 const struct GNUNET_CONFIGURATION_Handle *cfg,
118 enum GNUNET_SERVICE_Options options);
119
120
121/**
122 * Get the NULL-terminated array of listen sockets for this service.
123 *
124 * @param ctx service context to query
125 * @return NULL if there are no listen sockets, otherwise NULL-terminated
126 * array of listen sockets.
127 * @deprecated
128 */
129struct GNUNET_NETWORK_Handle *const *
130GNUNET_SERVICE_get_listen_sockets (struct GNUNET_SERVICE_Context *ctx);
131
132
133/**
134 * Stop a service that was started with #GNUNET_SERVICE_start.
135 *
136 * @param sctx the service context returned from the start function
137 * @deprecated
138 */
139void
140GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx);
141
142
143/* **************** NEW SERVICE API ********************** */ 77/* **************** NEW SERVICE API ********************** */
144 78
145/** 79/**
@@ -218,7 +152,7 @@ typedef void
218 * dropped. Additionally, clients can be dropped at any time using 152 * dropped. Additionally, clients can be dropped at any time using
219 * #GNUNET_SERVICE_client_drop(). 153 * #GNUNET_SERVICE_client_drop().
220 * 154 *
221 * The service must be stopped using #GNUNET_SERVICE_stoP(). 155 * The service must be stopped using #GNUNET_SERVICE_stop().
222 * 156 *
223 * @param service_name name of the service to run 157 * @param service_name name of the service to run
224 * @param cfg configuration to use 158 * @param cfg configuration to use
@@ -231,7 +165,7 @@ typedef void
231 * @return NULL on error 165 * @return NULL on error
232 */ 166 */
233struct GNUNET_SERVICE_Handle * 167struct GNUNET_SERVICE_Handle *
234GNUNET_SERVICE_starT (const char *service_name, 168GNUNET_SERVICE_start (const char *service_name,
235 const struct GNUNET_CONFIGURATION_Handle *cfg, 169 const struct GNUNET_CONFIGURATION_Handle *cfg,
236 GNUNET_SERVICE_ConnectHandler connect_cb, 170 GNUNET_SERVICE_ConnectHandler connect_cb,
237 GNUNET_SERVICE_DisconnectHandler disconnect_cb, 171 GNUNET_SERVICE_DisconnectHandler disconnect_cb,
@@ -240,12 +174,12 @@ GNUNET_SERVICE_starT (const char *service_name,
240 174
241 175
242/** 176/**
243 * Stops a service that was started with #GNUNET_SERVICE_starT(). 177 * Stops a service that was started with #GNUNET_SERVICE_start().
244 * 178 *
245 * @param srv service to stop 179 * @param srv service to stop
246 */ 180 */
247void 181void
248GNUNET_SERVICE_stoP (struct GNUNET_SERVICE_Handle *srv); 182GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv);
249 183
250 184
251/** 185/**
@@ -290,7 +224,7 @@ GNUNET_SERVICE_stoP (struct GNUNET_SERVICE_Handle *srv);
290 * @return 0 on success, non-zero on error 224 * @return 0 on success, non-zero on error
291 */ 225 */
292int 226int
293GNUNET_SERVICE_ruN_ (int argc, 227GNUNET_SERVICE_run_ (int argc,
294 char *const *argv, 228 char *const *argv,
295 const char *service_name, 229 const char *service_name,
296 enum GNUNET_SERVICE_Options options, 230 enum GNUNET_SERVICE_Options options,
@@ -366,7 +300,7 @@ GNUNET_SERVICE_ruN_ (int argc,
366 struct GNUNET_MQ_MessageHandler mh[] = { \ 300 struct GNUNET_MQ_MessageHandler mh[] = { \
367 __VA_ARGS__ \ 301 __VA_ARGS__ \
368 }; \ 302 }; \
369 return GNUNET_SERVICE_ruN_ (argc, \ 303 return GNUNET_SERVICE_run_ (argc, \
370 argv, \ 304 argv, \
371 service_name, \ 305 service_name, \
372 service_options, \ 306 service_options, \
diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h
index b42751d2a..a9bd6c33f 100644
--- a/src/include/gnunet_util_lib.h
+++ b/src/include/gnunet_util_lib.h
@@ -38,6 +38,21 @@ extern "C"
38#endif 38#endif
39#endif 39#endif
40 40
41
42/**
43 * Largest supported message (to be precise, one byte more
44 * than the largest possible message, so tests involving
45 * this value should check for messages being smaller than
46 * this value).
47 */
48#define GNUNET_MAX_MESSAGE_SIZE 65536
49
50/**
51 * Smallest supported message.
52 */
53#define GNUNET_MIN_MESSAGE_SIZE sizeof (struct GNUNET_MessageHeader)
54
55
41#include "gnunet_crypto_lib.h" 56#include "gnunet_crypto_lib.h"
42#include "gnunet_bandwidth_lib.h" 57#include "gnunet_bandwidth_lib.h"
43#include "gnunet_bio_lib.h" 58#include "gnunet_bio_lib.h"