cadet service; interaction with CORE service More...
#include "platform.h"
#include "gnunet-service-cadet_core.h"
#include "gnunet-service-cadet_paths.h"
#include "gnunet-service-cadet_peer.h"
#include "gnunet-service-cadet_connection.h"
#include "gnunet-service-cadet_tunnels.h"
#include "gnunet_core_service.h"
#include "gnunet_statistics_service.h"
#include "cadet_protocol.h"
Go to the source code of this file.
Data Structures | |
struct | Rung |
Set of CadetRoutes that have exactly the same number of messages in their buffer. More... | |
struct | RouteDirection |
Information we keep per direction for a route. More... | |
struct | CadetRoute |
Macros | |
#define | LOG(level, ...) GNUNET_log_from (level, "cadet-cor", __VA_ARGS__) |
Functions | |
static struct CadetRoute * | get_route (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid) |
Get the route corresponding to a hash. More... | |
static void | lower_rung (struct RouteDirection *dir) |
Lower the rung in which dir is by 1. More... | |
static void | discard_buffer (struct RouteDirection *dir, struct GNUNET_MQ_Envelope *env) |
Discard the buffer env from the route direction dir and move dir down a rung. More... | |
static void | discard_all_from_rung_tail () |
Discard all messages from the highest rung, to make space. More... | |
static void | route_message (struct CadetPeer *prev, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, const struct GNUNET_MessageHeader *msg, const enum GNUNET_MQ_PriorityPreferences priority) |
We message msg from prev. More... | |
static int | check_connection_create (void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg) |
Check if the create_connection message has the appropriate size. More... | |
static void | destroy_direction (struct RouteDirection *dir) |
Free internal data of a route direction. More... | |
static void | destroy_route (struct CadetRoute *route) |
Destroy our state for route. More... | |
static void | send_broken (struct RouteDirection *target, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, const struct GNUNET_PeerIdentity *peer1, const struct GNUNET_PeerIdentity *peer2) |
Send message that a route is broken between peer1 and peer2. More... | |
static void | timeout_cb (void *cls) |
Function called to check if any routes have timed out, and if so, to clean them up. More... | |
static void | dir_ready_cb (void *cls, int ready) |
Function called when the message queue to the previous hop becomes available/unavailable. More... | |
static void | dir_init (struct RouteDirection *dir, struct CadetRoute *route, struct CadetPeer *hop) |
Initialize one of the directions of a route. More... | |
static void | send_broken_without_mqm (struct CadetPeer *target, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, const struct GNUNET_PeerIdentity *failure_at) |
We could not create the desired route. More... | |
static void | handle_connection_create (void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg) |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE. More... | |
static void | handle_connection_create_ack (void *cls, const struct GNUNET_CADET_ConnectionCreateAckMessage *msg) |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK. More... | |
static void | handle_connection_broken (void *cls, const struct GNUNET_CADET_ConnectionBrokenMessage *msg) |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN. More... | |
static void | handle_connection_destroy (void *cls, const struct GNUNET_CADET_ConnectionDestroyMessage *msg) |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY. More... | |
static void | handle_tunnel_kx (void *cls, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg) |
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX. More... | |
static void | handle_tunnel_kx_auth (void *cls, const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg) |
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH. More... | |
static int | check_tunnel_encrypted (void *cls, const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
Check if the encrypted message has the appropriate size. More... | |
static void | handle_tunnel_encrypted (void *cls, const struct GNUNET_CADET_TunnelEncryptedMessage *msg) |
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED. More... | |
static void | core_init_cb (void *cls, const struct GNUNET_PeerIdentity *my_identity) |
Function called after GNUNET_CORE_connect has succeeded (or failed for good). More... | |
static void * | core_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq) |
Method called whenever a given peer connects. More... | |
static void | core_disconnect_cb (void *cls, const struct GNUNET_PeerIdentity *peer, void *peer_cls) |
Method called whenever a peer disconnects. More... | |
void | GCO_init (const struct GNUNET_CONFIGURATION_Handle *c) |
Initialize the CORE subsystem. More... | |
void | GCO_shutdown () |
Shut down the CORE subsystem. More... | |
Variables | |
static struct GNUNET_CORE_Handle * | core |
Handle to the CORE service. More... | |
static struct GNUNET_CONTAINER_MultiShortmap * | routes |
Routes on which this peer is an intermediate. More... | |
static struct GNUNET_CONTAINER_Heap * | route_heap |
Heap of routes, MIN-sorted by last activity. More... | |
static struct Rung | rung_zero |
Rung zero (always pointed to by rung_head). More... | |
static struct Rung * | rung_head = &rung_zero |
DLL of rungs, with the head always point to a rung of route directions with no messages in the queue. More... | |
static struct Rung * | rung_tail = &rung_zero |
Tail of the rung_head DLL. More... | |
static unsigned long long | max_routes |
Maximum number of concurrent routes this peer will support. More... | |
static unsigned long long | max_buffers |
Maximum number of envelopes we will buffer at this peer. More... | |
static unsigned long long | cur_buffers |
Current number of envelopes we have buffered at this peer. More... | |
static struct GNUNET_SCHEDULER_Task * | timeout_task |
Task to timeout routes. More... | |
cadet service; interaction with CORE service
All functions in this file should use the prefix GCO (Gnunet Cadet cOre (bottom))
TODO:
Definition in file gnunet-service-cadet_core.c.
#define LOG | ( | level, | |
... | |||
) | GNUNET_log_from (level, "cadet-cor", __VA_ARGS__) |
Definition at line 42 of file gnunet-service-cadet_core.c.
|
static |
Get the route corresponding to a hash.
cid | hash generated from the connection identifier |
Definition at line 228 of file gnunet-service-cadet_core.c.
References CadetRoute::cid, GNUNET_CADET_ConnectionTunnelIdentifier::connection_of_tunnel, GNUNET_CONTAINER_multishortmap_get(), and routes.
Referenced by handle_connection_broken(), handle_connection_create(), handle_connection_destroy(), and route_message().
|
static |
Lower the rung in which dir is by 1.
dir | direction to lower in rung. |
Definition at line 241 of file gnunet-service-cadet_core.c.
References dir, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_DLL_insert_after, GNUNET_CONTAINER_DLL_remove, GNUNET_new, Rung::prev, Rung::rd_head, Rung::rd_tail, rung_head, Rung::rung_off, and rung_tail.
Referenced by dir_ready_cb(), and discard_buffer().
|
static |
Discard the buffer env from the route direction dir and move dir down a rung.
dir | direction that contains the env in the buffer |
env | envelope to discard |
Definition at line 269 of file gnunet-service-cadet_core.c.
References cur_buffers, dir, env, GNUNET_MQ_discard(), GNUNET_MQ_dll_remove(), GNUNET_NO, GNUNET_STATISTICS_set(), lower_rung(), and stats.
Referenced by destroy_direction(), discard_all_from_rung_tail(), and route_message().
|
static |
Discard all messages from the highest rung, to make space.
Definition at line 283 of file gnunet-service-cadet_core.c.
References dir, discard_buffer(), GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_NO, GNUNET_sh2s(), GNUNET_STATISTICS_update(), LOG, Rung::rd_head, rung_head, rung_tail, and stats.
Referenced by route_message().
|
static |
We message msg from prev.
Find its route by cid and forward to the next hop. Drop and signal broken route if we do not have a route.
prev | previous hop (sender) |
cid | connection identifier, tells us which route to use |
msg | the message to forward |
Definition at line 314 of file gnunet-service-cadet_core.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_CADET_ConnectionBrokenMessage::cid, GNUNET_CADET_ConnectionTunnelIdentifier::connection_of_tunnel, cur_buffers, dir, discard_all_from_rung_tail(), discard_buffer(), env, GCP_2s(), GCP_get_id(), GCP_send(), GCP_send_ooo(), get_route(), GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_DLL_insert_after, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_heap_update_cost(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, GNUNET_MQ_dll_insert_head(), GNUNET_MQ_dll_insert_tail(), GNUNET_MQ_env_get_msg(), GNUNET_MQ_env_get_options(), GNUNET_MQ_env_next(), GNUNET_MQ_env_set_options(), GNUNET_MQ_msg, GNUNET_MQ_msg_copy(), GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PREF_OUT_OF_ORDER, GNUNET_MQ_PREF_UNRELIABLE, GNUNET_new, GNUNET_NO, GNUNET_sh2s(), GNUNET_STATISTICS_set(), GNUNET_STATISTICS_update(), GNUNET_TIME_absolute_get(), GNUNET_YES, CadetRoute::hn, RouteDirection::hop, CadetRoute::last_use, LOG, max_buffers, msg, my_full_id, Rung::next, CadetRoute::next, GNUNET_CADET_ConnectionBrokenMessage::peer1, CadetRoute::prev, Rung::rd_head, Rung::rd_tail, rung_head, Rung::rung_off, rung_tail, GNUNET_MessageHeader::size, stats, and GNUNET_MessageHeader::type.
Referenced by handle_connection_broken(), handle_connection_create(), handle_connection_create_ack(), handle_connection_destroy(), handle_tunnel_encrypted(), handle_tunnel_kx(), and handle_tunnel_kx_auth().
|
static |
Check if the create_connection message has the appropriate size.
cls | Closure (unused). |
msg | Message to check. |
Definition at line 464 of file gnunet-service-cadet_core.c.
References GNUNET_break_op, GNUNET_NO, GNUNET_YES, msg, GNUNET_MessageHeader::size, and size.
|
static |
Free internal data of a route direction.
dir | direction to destroy (do NOT free memory of 'dir' itself) |
Definition at line 484 of file gnunet-service-cadet_core.c.
References dir, discard_buffer(), env, GCP_request_mq_cancel(), GNUNET_CONTAINER_DLL_remove, GNUNET_NO, GNUNET_STATISTICS_update(), Rung::rd_head, Rung::rd_tail, rung_head, and stats.
Referenced by destroy_route().
|
static |
Destroy our state for route.
route | route to destroy |
Definition at line 511 of file gnunet-service-cadet_core.c.
References CadetRoute::cid, GNUNET_CADET_ConnectionTunnelIdentifier::connection_of_tunnel, destroy_direction(), GCP_get_id(), GNUNET_assert, GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_multishortmap_remove(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_i2s2(), GNUNET_NO, GNUNET_sh2s(), GNUNET_STATISTICS_set(), GNUNET_YES, CadetRoute::hn, RouteDirection::hop, LOG, CadetRoute::next, CadetRoute::prev, routes, and stats.
Referenced by dir_ready_cb(), handle_connection_broken(), handle_connection_destroy(), and timeout_cb().
|
static |
Send message that a route is broken between peer1 and peer2.
target | where to send the message |
cid | connection identifier to use |
peer1 | one of the peers where a link is broken |
peer2 | another one of the peers where a link is broken |
Definition at line 543 of file gnunet-service-cadet_core.c.
References GNUNET_CADET_ConnectionBrokenMessage::cid, GNUNET_CADET_ConnectionTunnelIdentifier::connection_of_tunnel, env, GCP_2s(), GCP_request_mq_cancel(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_i2s2(), GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, GNUNET_MQ_msg, GNUNET_sh2s(), RouteDirection::hop, LOG, RouteDirection::mqm, GNUNET_CADET_ConnectionBrokenMessage::peer1, and GNUNET_CADET_ConnectionBrokenMessage::peer2.
Referenced by dir_ready_cb(), and timeout_cb().
|
static |
Function called to check if any routes have timed out, and if so, to clean them up.
Finally, schedules itself again at the earliest time where there might be more work.
cls | NULL |
Definition at line 579 of file gnunet-service-cadet_core.c.
References CadetRoute::cid, destroy_route(), GNUNET_CONTAINER_heap_peek(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_SCHEDULER_add_at(), GNUNET_STRINGS_absolute_time_to_string(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_relative_multiply(), GNUNET_YES, keepalive_period, CadetRoute::last_use, CadetRoute::next, CadetRoute::prev, route_heap, send_broken(), timeout_cb(), and timeout_task.
Referenced by handle_connection_create(), and timeout_cb().
|
static |
Function called when the message queue to the previous hop becomes available/unavailable.
We expect this function to be called immediately when we register, and then again later if the connection ever goes down.
cls | the struct RouteDirection |
ready | GNUNET_YES if sending is now possible, GNUNET_NO if sending is no longer possible GNUNET_SYSERR if sending is no longer possible and the last envelope was discarded |
Definition at line 621 of file gnunet-service-cadet_core.c.
References CadetRoute::cid, cur_buffers, destroy_route(), dir, env, GCP_get_id(), GCP_send(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MQ_dll_remove(), GNUNET_NO, GNUNET_STATISTICS_set(), GNUNET_YES, RouteDirection::hop, lower_rung(), my_full_id, CadetRoute::next, CadetRoute::prev, send_broken(), and stats.
Referenced by dir_init().
|
static |
Initialize one of the directions of a route.
route | route the direction belongs to |
dir | direction to initialize |
hop | next hop on in the dir |
Definition at line 658 of file gnunet-service-cadet_core.c.
References dir, dir_ready_cb(), GCP_request_mq(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_YES, Rung::rd_head, Rung::rd_tail, and rung_head.
Referenced by handle_connection_create().
|
static |
We could not create the desired route.
Send a GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN message to target.
target | who should receive the message |
cid | identifier of the connection/route that failed |
failure_at | neighbour with which we failed to route, or NULL. |
Definition at line 682 of file gnunet-service-cadet_core.c.
References GNUNET_CADET_ConnectionBrokenMessage::cid, env, GCP_send_ooo(), GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, GNUNET_MQ_msg, my_full_id, GNUNET_CADET_ConnectionBrokenMessage::peer1, and GNUNET_CADET_ConnectionBrokenMessage::peer2.
Referenced by handle_connection_create().
|
static |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE.
cls | Closure (CadetPeer for neighbor that sent the message). |
msg | Message itself. |
Definition at line 706 of file gnunet-service-cadet_core.c.
References GNUNET_TIME_Absolute::abs_value_us, CADET_TUNNEL_KEY_OK, CADET_TUNNEL_KEY_UNINITIALIZED, CadetRoute::cid, GNUNET_CADET_ConnectionTunnelIdentifier::connection_of_tunnel, dir_init(), GCC_handle_duplicate_create(), GCC_lookup(), GCP_2s(), GCP_check_and_update_monotime(), GCP_check_monotime_sig(), GCP_get(), GCP_get_tunnel(), GCP_has_core_connection(), GCPP_2s(), GCPP_get_path_from_route(), GCT_add_inbound_connection(), GCT_change_estate(), GCT_get_estate(), get_route(), GNUNET_assert, GNUNET_break_op, GNUNET_CONTAINER_heap_insert(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_create(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_memcmp, GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PRIO_CRITICAL_CONTROL, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_sh2s(), GNUNET_STATISTICS_set(), GNUNET_SYSERR, GNUNET_TIME_absolute_get(), GNUNET_TIME_relative_multiply(), GNUNET_YES, CadetRoute::hn, keepalive_period, CadetRoute::last_use, LOG, map, max_routes, msg, my_full_id, CadetRoute::next, origin, CadetRoute::prev, route_heap, route_message(), routes, send_broken_without_mqm(), GNUNET_MessageHeader::size, size, stats, t, timeout_cb(), and timeout_task.
|
static |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK.
cls | Closure (CadetPeer for neighbor that sent the message). |
msg | Message itself. |
Definition at line 916 of file gnunet-service-cadet_core.c.
References GCC_get_path(), GCC_handle_connection_create_ack(), GCC_lookup(), GCPP_get_peer_at_offset(), GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PRIO_CRITICAL_CONTROL, GNUNET_sh2s(), LOG, msg, and route_message().
|
static |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN.
cls | Closure (CadetPeer for neighbor that sent the message). |
msg | Message itself. |
Definition at line 960 of file gnunet-service-cadet_core.c.
References destroy_route(), GCC_destroy_without_core(), GCC_get_path(), GCC_lookup(), GCPP_get_peer_at_offset(), get_route(), GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PRIO_CRITICAL_CONTROL, GNUNET_sh2s(), LOG, msg, and route_message().
|
static |
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY.
cls | Closure (CadetPeer for neighbor that sent the message). |
msg | Message itself. |
Definition at line 1010 of file gnunet-service-cadet_core.c.
References destroy_route(), GCC_destroy_without_core(), GCC_get_path(), GCC_lookup(), GCPP_get_peer_at_offset(), get_route(), GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PRIO_CRITICAL_CONTROL, GNUNET_sh2s(), LOG, msg, and route_message().
|
static |
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX.
cls | Closure (CadetPeer for neighbor that sent the message). |
msg | Message itself. |
Definition at line 1061 of file gnunet-service-cadet_core.c.
References GCC_get_path(), GCC_handle_kx(), GCC_lookup(), GCPP_get_peer_at_offset(), GNUNET_break_op, GNUNET_e2s(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PRIO_CRITICAL_CONTROL, GNUNET_sh2s(), LOG, msg, and route_message().
|
static |
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH.
cls | Closure (CadetPeer for neighbor that sent the message). |
msg | Message itself. |
Definition at line 1106 of file gnunet-service-cadet_core.c.
References GCC_get_path(), GCC_handle_kx_auth(), GCC_lookup(), GCPP_get_peer_at_offset(), GNUNET_break_op, GNUNET_MQ_PREF_LOW_LATENCY, GNUNET_MQ_PRIO_CRITICAL_CONTROL, msg, and route_message().
|
static |
Check if the encrypted message has the appropriate size.
cls | Closure (unused). |
msg | Message to check. |
Definition at line 1148 of file gnunet-service-cadet_core.c.
References GNUNET_YES.
|
static |
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED.
cls | Closure (CadetPeer for neighbor that sent the message). |
msg | Message itself. |
Definition at line 1162 of file gnunet-service-cadet_core.c.
References GCC_get_path(), GCC_handle_encrypted(), GCC_lookup(), GCPP_get_peer_at_offset(), GNUNET_break_op, GNUNET_MQ_PRIO_BEST_EFFORT, msg, and route_message().
|
static |
Function called after GNUNET_CORE_connect has succeeded (or failed for good).
Note that the private key of the peer is intentionally not exposed here; if you need it, your process should try to read the private key file directly (which should work if you are authorized...). Implementations of this function must not call GNUNET_CORE_disconnect (other than by scheduling a new task to do this later).
cls | closure |
my_identity | ID of this peer, NULL if we failed |
Definition at line 1203 of file gnunet-service-cadet_core.c.
References GNUNET_break, GNUNET_memcmp, my_full_id, and my_identity.
Referenced by GCO_init().
|
static |
Method called whenever a given peer connects.
cls | closure |
peer | peer identity this notification is about |
Definition at line 1221 of file gnunet-service-cadet_core.c.
References GCP_get(), GCP_set_mq(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_YES, LOG, and mq.
Referenced by GCO_init().
|
static |
Method called whenever a peer disconnects.
cls | closure |
peer | peer identity this notification is about |
Definition at line 1243 of file gnunet-service-cadet_core.c.
References GCP_set_mq(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), and LOG.
Referenced by GCO_init().
void GCO_init | ( | const struct GNUNET_CONFIGURATION_Handle * | c | ) |
Initialize the CORE subsystem.
c | Configuration. |
Definition at line 1262 of file gnunet-service-cadet_core.c.
References connection_create(), connection_destroy(), core, core_connect_cb(), core_disconnect_cb(), core_init_cb(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_CONTAINER_multishortmap_create(), GNUNET_CORE_connect(), GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK, GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY, GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED, GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX, GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_NO, GNUNET_OK, handlers, max_buffers, max_routes, route_heap, and routes.
Referenced by run().
void GCO_shutdown | ( | void | ) |
Shut down the CORE subsystem.
Definition at line 1317 of file gnunet-service-cadet_core.c.
References core, GNUNET_assert, GNUNET_CONTAINER_heap_destroy(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_size(), GNUNET_CORE_disconnect(), GNUNET_SCHEDULER_cancel(), route_heap, routes, and timeout_task.
Referenced by shutdown_task().
|
static |
Handle to the CORE service.
Definition at line 174 of file gnunet-service-cadet_core.c.
Referenced by GCO_init(), and GCO_shutdown().
|
static |
Routes on which this peer is an intermediate.
Definition at line 179 of file gnunet-service-cadet_core.c.
Referenced by destroy_route(), GCO_init(), GCO_shutdown(), get_route(), and handle_connection_create().
|
static |
Heap of routes, MIN-sorted by last activity.
Definition at line 184 of file gnunet-service-cadet_core.c.
Referenced by GCO_init(), GCO_shutdown(), handle_connection_create(), and timeout_cb().
|
static |
Rung zero (always pointed to by rung_head).
Definition at line 189 of file gnunet-service-cadet_core.c.
DLL of rungs, with the head always point to a rung of route directions with no messages in the queue.
Definition at line 195 of file gnunet-service-cadet_core.c.
Referenced by destroy_direction(), dir_init(), discard_all_from_rung_tail(), lower_rung(), and route_message().
Tail of the rung_head DLL.
Definition at line 200 of file gnunet-service-cadet_core.c.
Referenced by discard_all_from_rung_tail(), lower_rung(), and route_message().
|
static |
Maximum number of concurrent routes this peer will support.
Definition at line 205 of file gnunet-service-cadet_core.c.
Referenced by GCO_init(), and handle_connection_create().
|
static |
Maximum number of envelopes we will buffer at this peer.
Definition at line 210 of file gnunet-service-cadet_core.c.
Referenced by GCO_init(), and route_message().
|
static |
Current number of envelopes we have buffered at this peer.
Definition at line 215 of file gnunet-service-cadet_core.c.
Referenced by dir_ready_cb(), discard_buffer(), and route_message().
|
static |
Task to timeout routes.
Definition at line 220 of file gnunet-service-cadet_core.c.
Referenced by GCO_shutdown(), handle_connection_create(), and timeout_cb().