aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_mq_lib.h8
-rw-r--r--src/include/gnunet_scheduler_lib.h2
-rw-r--r--src/include/gnunet_service_lib.h36
3 files changed, 41 insertions, 5 deletions
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index 86144abca..999ee4134 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -171,7 +171,13 @@ enum GNUNET_MQ_Error
171 * We received a message that was malformed and thus 171 * We received a message that was malformed and thus
172 * could not be passed to its handler. 172 * could not be passed to its handler.
173 */ 173 */
174 GNUNET_MQ_ERROR_MALFORMED = 8 174 GNUNET_MQ_ERROR_MALFORMED = 8,
175
176 /**
177 * We received a message for which we have no matching
178 * handler.
179 */
180 GNUNET_MQ_ERROR_NO_MATCH = 16
175}; 181};
176 182
177 183
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index 87cb3b6f1..1a0438bed 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -346,7 +346,7 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
346 * scheduled for execution once either the delay has expired or the 346 * scheduled for execution once either the delay has expired or the
347 * socket operation is ready. It will be run with the DEFAULT priority. 347 * socket operation is ready. It will be run with the DEFAULT priority.
348 * 348 *
349 * * @param delay when should this operation time out? 349 * @param delay when should this operation time out?
350 * @param rfd read file-descriptor 350 * @param rfd read file-descriptor
351 * @param task main function of the task 351 * @param task main function of the task
352 * @param task_cls closure of @a task 352 * @param task_cls closure of @a task
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index 797857ed8..9c7009ef4 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -336,16 +336,36 @@ GNUNET_SERVICE_ruN_ (int argc,
336 * @param connect_cb function to call whenever a client connects 336 * @param connect_cb function to call whenever a client connects
337 * @param disconnect_cb function to call whenever a client disconnects 337 * @param disconnect_cb function to call whenever a client disconnects
338 * @param cls closure argument for @a service_init_cb, @a connect_cb and @a disconnect_cb 338 * @param cls closure argument for @a service_init_cb, @a connect_cb and @a disconnect_cb
339 * @param handlers NULL-terminated array of message handlers for the service, 339 * @param ... array of message handlers for the service, terminated
340 * by #GNUNET_MQ_handler_end();
340 * the closure will be set to the value returned by 341 * the closure will be set to the value returned by
341 * the @a connect_cb for the respective connection 342 * the @a connect_cb for the respective connection
342 * @return 0 on success, non-zero on error 343 * @return 0 on success, non-zero on error
344 *
345 * Sample invocation:
346 * <code>
347 * GNUNET_SERVICE_MAIN
348 * ("resolver",
349 * GNUNET_SERVICE_OPTION_NONE,
350 * &init_cb,
351 * &connect_cb,
352 * &disconnect_cb,
353 * closure_for_cb,
354 * GNUNET_MQ_hd_var_size (get,
355 * GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST,
356 * struct GNUNET_RESOLVER_GetMessage,
357 * NULL),
358 * GNUNET_MQ_handler_end ());
359 * </code>
343 */ 360 */
344#define GNUNET_SERVICE_MAIN(service_name,service_options,init_cb,connect_cb,disconnect_cb,cls,handlers) \ 361#define GNUNET_SERVICE_MAIN(service_name,service_options,init_cb,connect_cb,disconnect_cb,cls,...) \
345 int \ 362 int \
346 main (int argc,\ 363 main (int argc,\
347 char *const *argv)\ 364 char *const *argv)\
348 { \ 365 { \
366 struct GNUNET_MQ_MessageHandler mh[] = { \
367 __VA_ARGS__ \
368 }; \
349 return GNUNET_SERVICE_ruN_ (argc, \ 369 return GNUNET_SERVICE_ruN_ (argc, \
350 argv, \ 370 argv, \
351 service_name, \ 371 service_name, \
@@ -354,7 +374,7 @@ GNUNET_SERVICE_ruN_ (int argc,
354 connect_cb, \ 374 connect_cb, \
355 disconnect_cb, \ 375 disconnect_cb, \
356 cls, \ 376 cls, \
357 handlers); \ 377 mh); \
358 } 378 }
359 379
360 380
@@ -388,6 +408,16 @@ GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c);
388 408
389 409
390/** 410/**
411 * Obtain the message queue of @a c. Convenience function.
412 *
413 * @param c the client to continue receiving from
414 * @return the message queue of @a c
415 */
416struct GNUNET_MQ_Handle *
417GNUNET_SERVICE_client_get_mq (struct GNUNET_SERVICE_Client *c);
418
419
420/**
391 * Disable the warning the server issues if a message is not 421 * Disable the warning the server issues if a message is not
392 * acknowledged in a timely fashion. Use this call if a client is 422 * acknowledged in a timely fashion. Use this call if a client is
393 * intentionally delayed for a while. Only applies to the current 423 * intentionally delayed for a while. Only applies to the current