From d2ed51b63d955a590a461e911a3d6fa6a9248fe5 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Mon, 24 Jun 2019 11:47:25 +0200 Subject: removed GNUNET_CADET_ChannelOption --- src/cadet/cadet_api.c | 31 +------------------ src/cadet/gnunet-cadet.c | 3 -- src/cadet/gnunet-service-cadet_channel.c | 21 ------------- src/cadet/gnunet-service-cadet_connection.c | 15 --------- src/cadet/gnunet-service-cadet_connection.h | 5 --- src/cadet/gnunet-service-cadet_core.c | 7 ++--- src/cadet/gnunet-service-cadet_tunnels.h | 2 -- src/include/gnunet_cadet_service.h | 47 ----------------------------- 8 files changed, 3 insertions(+), 128 deletions(-) diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index b0016d2a8..8638be27d 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c @@ -134,11 +134,6 @@ struct GNUNET_CADET_Channel */ struct GNUNET_CADET_ClientChannelNumber ccn; - /** - * Channel options: reliability, etc. - */ - enum GNUNET_CADET_ChannelOption options; - /** * How many messages are we allowed to send to the service right now? */ @@ -592,7 +587,6 @@ handle_channel_created (void *cls, &ccn); ch->peer = msg->peer; ch->incoming_port = port; - ch->options = ntohl (msg->opt); LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating incoming channel %X [%s] %p\n", ntohl (ccn.channel_of_client), @@ -982,29 +976,9 @@ GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel) */ const union GNUNET_CADET_ChannelInfo * GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, - enum GNUNET_CADET_ChannelOption option, ...) { - static int bool_flag; - - switch (option) - { - case GNUNET_CADET_OPTION_NOBUFFER: - case GNUNET_CADET_OPTION_RELIABLE: - case GNUNET_CADET_OPTION_OUT_OF_ORDER: - if (0 != (option & channel->options)) - bool_flag = GNUNET_YES; - else - bool_flag = GNUNET_NO; - return (const union GNUNET_CADET_ChannelInfo *) &bool_flag; - break; - case GNUNET_CADET_OPTION_PEER: - return (const union GNUNET_CADET_ChannelInfo *) &channel->peer; - break; - default: - GNUNET_break (0); - return NULL; - } + return (const union GNUNET_CADET_ChannelInfo *) &channel->peer; } @@ -1140,7 +1114,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, void *channel_cls, const struct GNUNET_PeerIdentity *destination, const struct GNUNET_HashCode *port, - enum GNUNET_CADET_ChannelOption options, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers) @@ -1158,7 +1131,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, NULL); ch->ctx = channel_cls; ch->peer = *destination; - ch->options = options; ch->window_changes = window_changes; ch->disconnects = disconnects; @@ -1179,7 +1151,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, msg->ccn = ch->ccn; msg->port = *port; msg->peer = *destination; - msg->opt = htonl (options); GNUNET_MQ_send (h->mq, env); return ch; diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c index 932d069a1..262cdf64d 100644 --- a/src/cadet/gnunet-cadet.c +++ b/src/cadet/gnunet-cadet.c @@ -784,7 +784,6 @@ run (void *cls, if (NULL != target_id) { struct GNUNET_PeerIdentity pid; - enum GNUNET_CADET_ChannelOption opt; if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (target_id, @@ -801,7 +800,6 @@ run (void *cls, "Connecting to `%s:%s'\n", target_id, target_port); - opt = GNUNET_CADET_OPTION_DEFAULT | GNUNET_CADET_OPTION_RELIABLE; GNUNET_CRYPTO_hash (target_port, strlen(target_port), &porthash); @@ -809,7 +807,6 @@ run (void *cls, NULL, &pid, &porthash, - opt, NULL /* window changes */, &channel_ended, handlers); diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index a1f6e37c2..4136dd5dd 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c @@ -591,22 +591,13 @@ send_channel_open (void *cls) { struct CadetChannel *ch = cls; struct GNUNET_CADET_ChannelOpenMessage msgcc; - uint32_t options; ch->retry_control_task = NULL; LOG (GNUNET_ERROR_TYPE_DEBUG, "Sending CHANNEL_OPEN message for %s\n", GCCH_2s (ch)); - options = 0; - if (ch->nobuffer) - options |= GNUNET_CADET_OPTION_NOBUFFER; - if (ch->reliable) - options |= GNUNET_CADET_OPTION_RELIABLE; - if (ch->out_of_order) - options |= GNUNET_CADET_OPTION_OUT_OF_ORDER; msgcc.header.size = htons (sizeof (msgcc)); msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN); - msgcc.opt = htonl (options); msgcc.h_port = ch->h_port; msgcc.ctn = ch->ctn; ch->state = CADET_CHANNEL_OPEN_SENT; @@ -670,9 +661,6 @@ GCCH_channel_local_new (struct CadetClient *owner, ch = GNUNET_new (struct CadetChannel); ch->mid_recv.mid = htonl (1); /* The OPEN_ACK counts as message 0! */ - ch->nobuffer = (0 != (options & GNUNET_CADET_OPTION_NOBUFFER)); - ch->reliable = (0 != (options & GNUNET_CADET_OPTION_RELIABLE)); - ch->out_of_order = (0 != (options & GNUNET_CADET_OPTION_OUT_OF_ORDER)); ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */ ch->owner = ccco; ch->port = *port; @@ -771,9 +759,6 @@ GCCH_channel_incoming_new (struct CadetTunnel *t, ch->t = t; ch->ctn = ctn; ch->retry_time = CADET_INITIAL_RETRANSMIT_TIME; - ch->nobuffer = (0 != (options & GNUNET_CADET_OPTION_NOBUFFER)); - ch->reliable = (0 != (options & GNUNET_CADET_OPTION_RELIABLE)); - ch->out_of_order = (0 != (options & GNUNET_CADET_OPTION_OUT_OF_ORDER)); ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */ GNUNET_STATISTICS_update (stats, "# channels", @@ -998,12 +983,6 @@ GCCH_bind (struct CadetChannel *ch, ch->retry_control_task = NULL; } options = 0; - if (ch->nobuffer) - options |= GNUNET_CADET_OPTION_NOBUFFER; - if (ch->reliable) - options |= GNUNET_CADET_OPTION_RELIABLE; - if (ch->out_of_order) - options |= GNUNET_CADET_OPTION_OUT_OF_ORDER; cccd = GNUNET_new (struct CadetChannelClient); GNUNET_assert (NULL == ch->dest); ch->dest = cccd; diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 1f7e86d60..7b3a0b975 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -160,11 +160,6 @@ struct CadetConnection */ enum CadetConnectionState state; - /** - * Options for the route, control buffering. - */ - enum GNUNET_CADET_ChannelOption options; - /** * How many latency observations did we make for this connection? */ @@ -635,7 +630,6 @@ send_create (void *cls) env = GNUNET_MQ_msg_extra (create_msg, (2 + cc->off) * sizeof (struct GNUNET_PeerIdentity), GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE); - create_msg->options = htonl ((uint32_t) cc->options); create_msg->cid = cc->cid; pids = (struct GNUNET_PeerIdentity *) &create_msg[1]; pids[0] = my_full_id; @@ -825,7 +819,6 @@ manage_first_hop_mq (void *cls, * @param destination where to go * @param path which path to take (may not be the full path) * @param off offset of @a destination on @a path - * @param options options for the connection * @param ct which tunnel uses this connection * @param init_state initial state for the connection * @param ready_cb function to call when ready to transmit @@ -836,7 +829,6 @@ static struct CadetConnection * connection_create (struct CadetPeer *destination, struct CadetPeerPath *path, unsigned int off, - enum GNUNET_CADET_ChannelOption options, struct CadetTConnection *ct, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, enum CadetConnectionState init_state, @@ -847,7 +839,6 @@ connection_create (struct CadetPeer *destination, struct CadetPeer *first_hop; cc = GNUNET_new (struct CadetConnection); - cc->options = options; cc->state = init_state; cc->ct = ct; cc->cid = *cid; @@ -890,7 +881,6 @@ connection_create (struct CadetPeer *destination, * * @param destination where to go * @param path which path to take (may not be the full path) - * @param options options for the connection * @param ct which tunnel uses this connection * @param ready_cb function to call when ready to transmit * @param ready_cb_cls closure for @a cb @@ -900,7 +890,6 @@ connection_create (struct CadetPeer *destination, struct CadetConnection * GCC_create_inbound (struct CadetPeer *destination, struct CadetPeerPath *path, - enum GNUNET_CADET_ChannelOption options, struct CadetTConnection *ct, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, GCC_ReadyCallback ready_cb, @@ -956,7 +945,6 @@ GCC_create_inbound (struct CadetPeer *destination, return connection_create (destination, path, off, - options, ct, cid, CADET_CONNECTION_CREATE_RECEIVED, @@ -972,7 +960,6 @@ GCC_create_inbound (struct CadetPeer *destination, * @param destination where to go * @param path which path to take (may not be the full path) * @param off offset of @a destination on @a path - * @param options options for the connection * @param ct tunnel that uses the connection * @param ready_cb function to call when ready to transmit * @param ready_cb_cls closure for @a cb @@ -982,7 +969,6 @@ struct CadetConnection * GCC_create (struct CadetPeer *destination, struct CadetPeerPath *path, unsigned int off, - enum GNUNET_CADET_ChannelOption options, struct CadetTConnection *ct, GCC_ReadyCallback ready_cb, void *ready_cb_cls) @@ -995,7 +981,6 @@ GCC_create (struct CadetPeer *destination, return connection_create (destination, path, off, - options, ct, &cid, CADET_CONNECTION_NEW, diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h index 7cdbc9dee..d3de3347c 100644 --- a/src/cadet/gnunet-service-cadet_connection.h +++ b/src/cadet/gnunet-service-cadet_connection.h @@ -1,4 +1,3 @@ - /* This file is part of GNUnet. Copyright (C) 2001-2017 GNUnet e.V. @@ -89,7 +88,6 @@ GCC_lookup (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid); * @param destination where to go * @param path which path to take (may not be the full path) * @param off offset of @a destination on @a path - * @param options options for the connection * @param ct which tunnel uses this connection * @param ready_cb function to call when ready to transmit * @param ready_cb_cls closure for @a cb @@ -99,7 +97,6 @@ struct CadetConnection * GCC_create (struct CadetPeer *destination, struct CadetPeerPath *path, unsigned int off, - enum GNUNET_CADET_ChannelOption options, struct CadetTConnection *ct, GCC_ReadyCallback ready_cb, void *ready_cb_cls); @@ -112,7 +109,6 @@ GCC_create (struct CadetPeer *destination, * * @param destination where to go * @param path which path to take (may not be the full path) - * @param options options for the connection * @param ct which tunnel uses this connection * @param ready_cb function to call when ready to transmit * @param ready_cb_cls closure for @a cb @@ -122,7 +118,6 @@ GCC_create (struct CadetPeer *destination, struct CadetConnection * GCC_create_inbound (struct CadetPeer *destination, struct CadetPeerPath *path, - enum GNUNET_CADET_ChannelOption options, struct CadetTConnection *ct, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, GCC_ReadyCallback ready_cb, diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c index 879230d29..c5d2f195a 100644 --- a/src/cadet/gnunet-service-cadet_core.c +++ b/src/cadet/gnunet-service-cadet_core.c @@ -180,10 +180,7 @@ struct CadetRoute */ struct GNUNET_CONTAINER_HeapNode *hn; - /** - * Options for the route, control buffering. - */ - enum GNUNET_CADET_ChannelOption options; + }; @@ -899,7 +896,7 @@ handle_connection_create (void *cls, GCP_2s (origin), GNUNET_sh2s (&msg->cid.connection_of_tunnel)); path = GCPP_get_path_from_route (path_length - 1, - pids); + pids); if (GNUNET_OK != GCT_add_inbound_connection (GCP_get_tunnel (origin, GNUNET_YES), diff --git a/src/cadet/gnunet-service-cadet_tunnels.h b/src/cadet/gnunet-service-cadet_tunnels.h index c1bf2fcd5..47d9f98bf 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.h +++ b/src/cadet/gnunet-service-cadet_tunnels.h @@ -119,7 +119,6 @@ GCT_destroy_tunnel_now (struct CadetTunnel *t); * * @param t a tunnel * @param cid connection identifer to use for the connection - * @param options options for the connection * @param path path to use for the connection * @return #GNUNET_OK on success, * #GNUNET_SYSERR on failure (duplicate connection) @@ -127,7 +126,6 @@ GCT_destroy_tunnel_now (struct CadetTunnel *t); int GCT_add_inbound_connection (struct CadetTunnel *t, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, - enum GNUNET_CADET_ChannelOption options, struct CadetPeerPath *path); diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h index a11c5f3cb..fd591924a 100644 --- a/src/include/gnunet_cadet_service.h +++ b/src/include/gnunet_cadet_service.h @@ -93,49 +93,6 @@ struct GNUNET_CADET_ChannelTunnelNumber uint32_t cn GNUNET_PACKED; }; - -/** - * Channel options. Second line indicates filed in the - * CadetChannelInfo union carrying the answer. - * - * @deprecated we should replace channel options with per-envelope - * options, and then re-use the options from `enum GNUNET_MQ_PriorityPreferences`. - */ -enum GNUNET_CADET_ChannelOption -{ - /** - * Default options: unreliable, default buffering, not out of order. - */ - GNUNET_CADET_OPTION_DEFAULT = 0x0, - - /** - * Disable buffering on intermediate nodes (for minimum latency). - * Yes/No. - */ - GNUNET_CADET_OPTION_NOBUFFER = 0x1, - - /** - * Enable channel reliability, lost messages will be retransmitted. - * Yes/No. - */ - GNUNET_CADET_OPTION_RELIABLE = 0x2, - - /** - * Enable out of order delivery of messages. - * Set bit for out-of-order delivery. - */ - GNUNET_CADET_OPTION_OUT_OF_ORDER = 0x4, - - /** - * Who is the peer at the other end of the channel. - * Only for use in @c GNUNET_CADET_channel_get_info - * struct GNUNET_PeerIdentity *peer - */ - GNUNET_CADET_OPTION_PEER = 0x8 - -}; - - /** * Method called whenever a peer connects to a port in MQ-based CADET. * @@ -259,7 +216,6 @@ GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p); * - Each message type callback in @a handlers * @param destination Peer identity the channel should go to. * @param port Identification of the destination port. - * @param options CadetOption flag field, with all desired option bits set to 1. * @param window_changes Function called when the transmit window size changes. * Can be NULL if this data is of no interest. * TODO Not yet implemented. @@ -272,7 +228,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, void *channel_cls, const struct GNUNET_PeerIdentity *destination, const struct GNUNET_HashCode *port, - enum GNUNET_CADET_ChannelOption options, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers); @@ -347,13 +302,11 @@ union GNUNET_CADET_ChannelInfo * Get information about a channel. * * @param channel Channel handle. - * @param option Query type GNUNET_CADET_OPTION_* * @param ... dependant on option, currently not used * @return Union with an answer to the query. */ const union GNUNET_CADET_ChannelInfo * GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, - enum GNUNET_CADET_ChannelOption option, ...); -- cgit v1.2.3 From f606540bcb19245aabd2f645cd9567260659ee4c Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Tue, 25 Jun 2019 18:06:44 +0200 Subject: added per message GNUNET_MQ_PriorityPreferences --- src/cadet/gnunet-service-cadet_core.c | 39 ++++++++++++---------- src/cadet/gnunet-service-cadet_tunnels.c | 3 -- src/fs/gnunet-service-fs_cadet_client.c | 4 +-- src/include/gnunet_mq_lib.h | 17 +++++++++- src/pt/gnunet-daemon-pt.c | 1 - .../gnunet-service-scalarproduct-ecc_alice.c | 5 ++- .../gnunet-service-scalarproduct_alice.c | 5 ++- src/set/gnunet-service-set.c | 3 +- src/vpn/gnunet-service-vpn.c | 3 +- 9 files changed, 51 insertions(+), 29 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c index c5d2f195a..220a2b3cd 100644 --- a/src/cadet/gnunet-service-cadet_core.c +++ b/src/cadet/gnunet-service-cadet_core.c @@ -39,7 +39,6 @@ #include "gnunet_statistics_service.h" #include "cadet_protocol.h" - #define LOG(level, ...) GNUNET_log_from(level,"cadet-cor",__VA_ARGS__) /** @@ -47,7 +46,6 @@ */ struct RouteDirection; - /** * Set of CadetRoutes that have exactly the same number of messages * in their buffer. Used so we can efficiently find all of those @@ -346,7 +344,8 @@ discard_all_from_rung_tail () static void route_message (struct CadetPeer *prev, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, - const struct GNUNET_MessageHeader *msg) + const struct GNUNET_MessageHeader *msg, + const enum GNUNET_MQ_PriorityPreferences priority) { struct CadetRoute *route; struct RouteDirection *dir; @@ -399,7 +398,7 @@ route_message (struct CadetPeer *prev, } /* Check if buffering is disallowed, and if so, make sure we only queue one message per direction. */ - if ( (0 != (route->options & GNUNET_CADET_OPTION_NOBUFFER)) && + if ( (0 != (priority & GNUNET_MQ_PREF_NO_BUFFER)) && (NULL != dir->env_head) ) discard_buffer (dir, dir->env_head); @@ -793,9 +792,7 @@ handle_connection_create (void *cls, uint16_t size = ntohs (msg->header.size) - sizeof (*msg); unsigned int path_length; unsigned int off; - enum GNUNET_CADET_ChannelOption options; - options = (enum GNUNET_CADET_ChannelOption) ntohl (msg->options); path_length = size / sizeof (struct GNUNET_PeerIdentity); if (0 == path_length) { @@ -869,7 +866,8 @@ handle_connection_create (void *cls, GNUNET_sh2s (&msg->cid.connection_of_tunnel)); route_message (sender, &msg->cid, - &msg->header); + &msg->header, + GNUNET_MQ_PRIO_CRITICAL_CONTROL); return; } if (off == path_length - 1) @@ -901,7 +899,6 @@ handle_connection_create (void *cls, GCT_add_inbound_connection (GCP_get_tunnel (origin, GNUNET_YES), &msg->cid, - (enum GNUNET_CADET_ChannelOption) ntohl (msg->options), path)) { /* Send back BROKEN: duplicate connection on the same path, @@ -956,7 +953,6 @@ handle_connection_create (void *cls, GNUNET_i2s (&pids[off + 1]), off + 1); route = GNUNET_new (struct CadetRoute); - route->options = options; route->cid = msg->cid; route->last_use = GNUNET_TIME_absolute_get (); dir_init (&route->prev, @@ -985,7 +981,8 @@ handle_connection_create (void *cls, /* also pass CREATE message along to next hop */ route_message (sender, &msg->cid, - &msg->header); + &msg->header, + GNUNET_MQ_PRIO_CRITICAL_CONTROL); } @@ -1029,7 +1026,8 @@ handle_connection_create_ack (void *cls, /* We're just an intermediary peer, route the message along its path */ route_message (peer, &msg->cid, - &msg->header); + &msg->header, + GNUNET_MQ_PRIO_CRITICAL_CONTROL); } @@ -1077,7 +1075,8 @@ handle_connection_broken (void *cls, /* We're just an intermediary peer, route the message along its path */ route_message (peer, &msg->cid, - &msg->header); + &msg->header, + GNUNET_MQ_PREF_NO_BUFFER); route = get_route (&msg->cid); if (NULL != route) destroy_route (route); @@ -1130,7 +1129,8 @@ handle_connection_destroy (void *cls, GNUNET_sh2s (&msg->cid.connection_of_tunnel)); route_message (peer, &msg->cid, - &msg->header); + &msg->header, + GNUNET_MQ_PREF_NO_BUFFER); route = get_route (&msg->cid); if (NULL != route) destroy_route (route); @@ -1181,7 +1181,8 @@ handle_tunnel_kx (void *cls, /* We're just an intermediary peer, route the message along its path */ route_message (peer, &msg->cid, - &msg->header); + &msg->header, + GNUNET_MQ_PRIO_CRITICAL_CONTROL); } @@ -1223,7 +1224,8 @@ handle_tunnel_kx_auth (void *cls, /* We're just an intermediary peer, route the message along its path */ route_message (peer, &msg->kx.cid, - &msg->kx.header); + &msg->kx.header, + GNUNET_MQ_PRIO_CRITICAL_CONTROL); } @@ -1280,7 +1282,8 @@ handle_tunnel_encrypted (void *cls, /* We're just an intermediary peer, route the message along its path */ route_message (peer, &msg->cid, - &msg->header); + &msg->header, + GNUNET_MQ_PRIO_CRITICAL_CONTROL); } @@ -1401,13 +1404,13 @@ GCO_init (const struct GNUNET_CONFIGURATION_Handle *c) "CADET", "MAX_ROUTES", &max_routes)) - max_routes = 5000; + max_routes = 5000; if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (c, "CADET", "MAX_MSGS_QUEUE", &max_buffers)) - max_buffers = 10000; + max_buffers = 10000; routes = GNUNET_CONTAINER_multishortmap_create (1024, GNUNET_NO); route_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c index a2a493ebd..11be2bce0 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.c +++ b/src/cadet/gnunet-service-cadet_tunnels.c @@ -2731,7 +2731,6 @@ consider_path_cb (void *cls, ct->cc = GCC_create (t->destination, path, off, - GNUNET_CADET_OPTION_DEFAULT, /* FIXME: set based on what channels want/need! */ ct, &connection_ready_cb, ct); @@ -3204,7 +3203,6 @@ GCT_create_tunnel (struct CadetPeer *destination) int GCT_add_inbound_connection (struct CadetTunnel *t, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, - enum GNUNET_CADET_ChannelOption options, struct CadetPeerPath *path) { struct CadetTConnection *ct; @@ -3214,7 +3212,6 @@ GCT_add_inbound_connection (struct CadetTunnel *t, ct->t = t; ct->cc = GCC_create_inbound (t->destination, path, - options, ct, cid, &connection_ready_cb, diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c index 9ba250dfa..9f654849d 100644 --- a/src/fs/gnunet-service-fs_cadet_client.c +++ b/src/fs/gnunet-service-fs_cadet_client.c @@ -494,7 +494,6 @@ reset_cadet (struct CadetHandle *mh) mh, &mh->target, &port, - GNUNET_CADET_OPTION_RELIABLE, &window_change_cb, &disconnect_cb, handlers); @@ -572,6 +571,8 @@ transmit_pending (void *cls) GNUNET_i2s (&mh->target)); env = GNUNET_MQ_msg (sqm, GNUNET_MESSAGE_TYPE_FS_CADET_QUERY); + GNUNET_MQ_env_set_options(env, + GNUNET_MQ_PREF_RELIABLE); sqm->type = htonl (sr->type); sqm->query = sr->query; GNUNET_MQ_notify_sent (env, @@ -634,7 +635,6 @@ get_cadet (const struct GNUNET_PeerIdentity *target) mh, &mh->target, &port, - GNUNET_CADET_OPTION_RELIABLE, &window_change_cb, &disconnect_cb, handlers); diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index 81100d7d8..d3f4c9717 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h @@ -296,7 +296,22 @@ enum GNUNET_MQ_PriorityPreferences /** * Flag to indicate that out-of-order delivery is OK. */ - GNUNET_MQ_PREF_OUT_OF_ORDER = 256 + GNUNET_MQ_PREF_OUT_OF_ORDER = 256, + + /** + * Flag to indicate no buffering. + */ + GNUNET_MQ_PREF_NO_BUFFER = 512, + + /** + * Flag to indicate default + */ + GNUNET_MQ_PREF_DEFAULT = 1024, + + /** + * Flag to indicate reliable + */ + GNUNET_MQ_PREF_RELIABLE = 2048 }; diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c index cd17c2b7b..99cbfebf8 100644 --- a/src/pt/gnunet-daemon-pt.c +++ b/src/pt/gnunet-daemon-pt.c @@ -1088,7 +1088,6 @@ try_open_exit () pos, &pos->peer, &port, - GNUNET_CADET_OPTION_DEFAULT, &channel_idle_notify_cb, &cadet_channel_end_cb, cadet_handlers); diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c index 4b1a09e50..123a02188 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c +++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c @@ -634,6 +634,8 @@ send_alices_cryptodata_message (struct AliceServiceSession *s) e = GNUNET_MQ_msg_extra (msg, todo_count * 2 * sizeof (struct GNUNET_CRYPTO_EccPoint), GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_ALICE_CRYPTODATA); + GNUNET_MQ_env_set_options(e, + GNUNET_MQ_PREF_RELIABLE); msg->contained_element_count = htonl (todo_count); payload = (struct GNUNET_CRYPTO_EccPoint *) &msg[1]; r_ia = gcry_mpi_new (0); @@ -837,7 +839,6 @@ client_request_complete_alice (struct AliceServiceSession *s) s, &s->peer, &s->session_id, - GNUNET_CADET_OPTION_RELIABLE, NULL, &cb_channel_destruction, cadet_handlers); @@ -865,6 +866,8 @@ client_request_complete_alice (struct AliceServiceSession *s) e = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_SESSION_INITIALIZATION); + GNUNET_MQ_env_set_options(e, + GNUNET_MQ_PREF_RELIABLE); msg->session_id = s->session_id; GNUNET_MQ_send (s->cadet_mq, e); diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c index 393a1951b..18c5cc49a 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c +++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c @@ -893,6 +893,8 @@ send_alices_cryptodata_message (struct AliceServiceSession *s) e = GNUNET_MQ_msg_extra (msg, todo_count * sizeof (struct GNUNET_CRYPTO_PaillierCiphertext), GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ALICE_CRYPTODATA); + GNUNET_MQ_env_set_options(e, + GNUNET_MQ_PREF_RELIABLE); msg->contained_element_count = htonl (todo_count); payload = (struct GNUNET_CRYPTO_PaillierCiphertext *) &msg[1]; a = gcry_mpi_new (0); @@ -1073,7 +1075,6 @@ client_request_complete_alice (struct AliceServiceSession *s) s, &s->peer, &s->session_id, - GNUNET_CADET_OPTION_RELIABLE, NULL, &cb_channel_destruction, cadet_handlers); @@ -1101,6 +1102,8 @@ client_request_complete_alice (struct AliceServiceSession *s) e = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_SESSION_INITIALIZATION); + GNUNET_MQ_env_set_options(e, + GNUNET_MQ_PREF_RELIABLE); msg->session_id = s->session_id; msg->public_key = my_pubkey; GNUNET_MQ_send (s->cadet_mq, diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c index 71f74594f..f1d94bef7 100644 --- a/src/set/gnunet-service-set.c +++ b/src/set/gnunet-service-set.c @@ -741,6 +741,8 @@ handle_incoming_msg (void *cls, env = GNUNET_MQ_msg_nested_mh (cmsg, GNUNET_MESSAGE_TYPE_SET_REQUEST, op->context_msg); + GNUNET_MQ_env_set_options(env, + GNUNET_MQ_PREF_RELIABLE); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Suggesting incoming request with accept id %u to listener %p of client %p\n", op->suggest_id, @@ -1628,7 +1630,6 @@ handle_client_evaluate (void *cls, op, &msg->target_peer, &msg->app_id, - GNUNET_CADET_OPTION_RELIABLE, &channel_window_cb, &channel_end_cb, cadet_handlers); diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 91bc13fd8..7bd26798e 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c @@ -589,6 +589,8 @@ send_to_channel (struct ChannelState *ts, GNUNET_assert (NULL != ts->channel); mq = GNUNET_CADET_get_mq (ts->channel); + GNUNET_MQ_env_set_options(env, + GNUNET_MQ_PREF_DEFAULT); GNUNET_MQ_send (mq, env); if (GNUNET_MQ_get_length (mq) > MAX_MESSAGE_QUEUE_SIZE) @@ -1388,7 +1390,6 @@ create_channel (struct ChannelState *ts, ts, target, port, - GNUNET_CADET_OPTION_DEFAULT, NULL, &channel_cleaner, cadet_handlers); -- cgit v1.2.3