aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2020-06-01 16:39:35 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2020-06-01 16:39:35 +0200
commit198c09654354d09a9b33f27cf095e0295f70826c (patch)
tree07aa088c8e9664dc76915cc6b664654da59359f4 /src/include
parenta325c3eaa8450d325fe57959eac29da5496cfd6d (diff)
downloadgnunet-198c09654354d09a9b33f27cf095e0295f70826c.tar.gz
gnunet-198c09654354d09a9b33f27cf095e0295f70826c.zip
tng: more UDP communicator backchannels
Added a new message for queue updates to indicate queue length. Queues now may also have a priority parameter.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_protocols.h4
-rw-r--r--src/include/gnunet_transport_communication_service.h24
2 files changed, 28 insertions, 0 deletions
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 282bb53d1..a9cd7466a 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -3161,6 +3161,10 @@ extern "C" {
3161 */ 3161 */
3162#define GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL 1221 3162#define GNUNET_MESSAGE_TYPE_TRANSPORT_FLOW_CONTROL 1221
3163 3163
3164/**
3165 * @brief inform transport that a queue was updated
3166 */
3167#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_UPDATE 1222
3164 3168
3165/** 3169/**
3166 * Message sent to indicate to the transport that a monitor 3170 * Message sent to indicate to the transport that a monitor
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h
index 3ead03536..ea6b95e2d 100644
--- a/src/include/gnunet_transport_communication_service.h
+++ b/src/include/gnunet_transport_communication_service.h
@@ -50,6 +50,10 @@ extern "C" {
50 */ 50 */
51#define GNUNET_TRANSPORT_COMMUNICATION_VERSION 0x00000000 51#define GNUNET_TRANSPORT_COMMUNICATION_VERSION 0x00000000
52 52
53/**
54 * Queue length
55 */
56#define GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED UINT64_MAX
53 57
54/** 58/**
55 * Function called by the transport service to initialize a 59 * Function called by the transport service to initialize a
@@ -252,6 +256,9 @@ enum GNUNET_TRANSPORT_ConnectionStatus
252 * @param address address in human-readable format, 0-terminated, UTF-8 256 * @param address address in human-readable format, 0-terminated, UTF-8
253 * @param mtu maximum message size supported by queue, 0 if 257 * @param mtu maximum message size supported by queue, 0 if
254 * sending is not supported, SIZE_MAX for no MTU 258 * sending is not supported, SIZE_MAX for no MTU
259 * @param q_len number of messages that can be send through this queue
260 * @param priority queue priority. Queues with highest priority should be
261 * used
255 * @param nt which network type does the @a address belong to? 262 * @param nt which network type does the @a address belong to?
256 * @param cs what is the connection status of the queue? 263 * @param cs what is the connection status of the queue?
257 * @param mq message queue of the @a peer 264 * @param mq message queue of the @a peer
@@ -263,10 +270,27 @@ GNUNET_TRANSPORT_communicator_mq_add (
263 const struct GNUNET_PeerIdentity *peer, 270 const struct GNUNET_PeerIdentity *peer,
264 const char *address, 271 const char *address,
265 uint32_t mtu, 272 uint32_t mtu,
273 uint64_t q_len,
274 uint32_t priority,
266 enum GNUNET_NetworkType nt, 275 enum GNUNET_NetworkType nt,
267 enum GNUNET_TRANSPORT_ConnectionStatus cs, 276 enum GNUNET_TRANSPORT_ConnectionStatus cs,
268 struct GNUNET_MQ_Handle *mq); 277 struct GNUNET_MQ_Handle *mq);
269 278
279/**
280 * Notify transport service that an MQ was updated
281 *
282 * @param ch connection to transport service
283 * @param qh the queue to update
284 * @param q_len number of messages that can be send through this queue
285 * @param priority queue priority. Queues with highest priority should be
286 * used
287 */
288void
289GNUNET_TRANSPORT_communicator_mq_update (
290 struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
291 const struct GNUNET_TRANSPORT_QueueHandle *u_qh,
292 uint64_t q_len,
293 uint32_t priority);
270 294
271/** 295/**
272 * Notify transport service that an MQ became unavailable due to a 296 * Notify transport service that an MQ became unavailable due to a