diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-30 22:27:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-30 22:27:18 +0000 |
commit | c4f4203aaff577fdbe60a7a0976e913dbb77f03e (patch) | |
tree | 2fca5cb9cdc7b8c8d046c81453313c275d7dd5cd /src/include/gnunet_mq_lib.h | |
parent | e9dbabbabb9edd41bb7d7cb907826abdd8edb257 (diff) | |
download | gnunet-c4f4203aaff577fdbe60a7a0976e913dbb77f03e.tar.gz gnunet-c4f4203aaff577fdbe60a7a0976e913dbb77f03e.zip |
enable setting per-envelope or per-queue transmission options with MQ API
Diffstat (limited to 'src/include/gnunet_mq_lib.h')
-rw-r--r-- | src/include/gnunet_mq_lib.h | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index 43cefca9f..35313263d 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h | |||
@@ -106,7 +106,7 @@ | |||
106 | 106 | ||
107 | 107 | ||
108 | /** | 108 | /** |
109 | * Implementation of the GNUNET_MQ_extract_nexted_mh macro. | 109 | * Implementation of the #GNUNET_MQ_extract_nexted_mh macro. |
110 | * | 110 | * |
111 | * @param mh message header to extract nested message header from | 111 | * @param mh message header to extract nested message header from |
112 | * @param base_size size of the message before the nested message's header appears | 112 | * @param base_size size of the message before the nested message's header appears |
@@ -305,7 +305,7 @@ struct GNUNET_MQ_MessageHandler | |||
305 | /** | 305 | /** |
306 | * End-marker for the handlers array | 306 | * End-marker for the handlers array |
307 | */ | 307 | */ |
308 | #define GNUNET_MQ_handler_end() {NULL, NULL, NULL, 0, 0} | 308 | #define GNUNET_MQ_handler_end() { NULL, NULL, NULL, 0, 0 } |
309 | 309 | ||
310 | 310 | ||
311 | /** | 311 | /** |
@@ -434,6 +434,57 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm); | |||
434 | 434 | ||
435 | 435 | ||
436 | /** | 436 | /** |
437 | * Function to obtain the current envelope from | ||
438 | * within #GNUNET_MQ_SendImpl implementations. | ||
439 | * | ||
440 | * @param mq message queue to interrogate | ||
441 | * @return the current envelope | ||
442 | */ | ||
443 | struct GNUNET_MQ_Envelope * | ||
444 | GNUNET_MQ_get_current_envelope (struct GNUNET_MQ_Handle *mq); | ||
445 | |||
446 | |||
447 | /** | ||
448 | * Set application-specific options for this envelope. | ||
449 | * Overrides the options set for the queue with | ||
450 | * #GNUNET_MQ_set_options() for this message only. | ||
451 | * | ||
452 | * @param env message to set options for | ||
453 | * @param flags flags to use (meaning is queue-specific) | ||
454 | * @param extra additional buffer for further data (also queue-specific) | ||
455 | */ | ||
456 | void | ||
457 | GNUNET_MQ_env_set_options (struct GNUNET_MQ_Envelope *env, | ||
458 | uint64_t flags, | ||
459 | const void *extra); | ||
460 | |||
461 | |||
462 | /** | ||
463 | * Get application-specific options for this envelope. | ||
464 | * | ||
465 | * @param env message to set options for | ||
466 | * @param[out] flags set to flags to use (meaning is queue-specific) | ||
467 | * @return extra additional buffer for further data (also queue-specific) | ||
468 | */ | ||
469 | const void * | ||
470 | GNUNET_MQ_env_get_options (struct GNUNET_MQ_Envelope *env, | ||
471 | uint64_t *flags); | ||
472 | |||
473 | |||
474 | /** | ||
475 | * Set application-specific options for this queue. | ||
476 | * | ||
477 | * @param mq message queue to set options for | ||
478 | * @param flags flags to use (meaning is queue-specific) | ||
479 | * @param extra additional buffer for further data (also queue-specific) | ||
480 | */ | ||
481 | void | ||
482 | GNUNET_MQ_set_options (struct GNUNET_MQ_Handle *mq, | ||
483 | uint64_t flags, | ||
484 | const void *extra); | ||
485 | |||
486 | |||
487 | /** | ||
437 | * Obtain the current length of the message queue. | 488 | * Obtain the current length of the message queue. |
438 | * | 489 | * |
439 | * @param mq queue to inspect | 490 | * @param mq queue to inspect |