42 #define LOG(level, ...) GNUNET_log_from (level, "cadet-cor", __VA_ARGS__) 296 while (NULL != (dir = tail->
rd_head))
299 "Queue full due new message on connection %s, dropping old message\n",
302 "# messages dropped due to full buffer",
340 "Failed to route message of type %u from %s on connection %s: no route\n",
344 switch (ntohs (msg->
type))
363 "Routing message of type %u from %s to %s on connection %s\n",
386 if ((hdr->
size == msg->
size) && (0 == memcmp (hdr, msg, ntohs (msg->
size))))
389 "Received duplicate of message already in buffer, dropping\n");
391 "# messages dropped due to duplicate in buffer",
402 if (NULL != rung->
next)
411 "Queue full due new message on connection %s, dropping old message\n",
414 "# messages dropped due to full buffer",
437 "Queueing new message of type %u from %s to %s on connection %s\n",
444 if ((0 != (priority & GNUNET_MQ_PREF_LOW_LATENCY)) &&
448 & GNUNET_MQ_PREF_LOW_LATENCY)))
455 if ((NULL == rung->
rd_head) && (rung != rung_head))
496 while (NULL != (env = dir->
env_head))
499 "# messages dropped due to route destruction",
504 if (NULL != dir->
mqm)
522 "Destroying route from %s to %s of connection %s\n",
559 if (NULL == target->
mqm)
562 "Notifying %s about BROKEN route at %s-%s of connection %s\n",
605 "Sending BROKEN due to timeout (%s was last use, %s linger)\n",
651 odir = (dir == &route->
next) ? &route->
prev : &route->
next;
701 if (NULL != failure_at)
702 bm->
peer2 = *failure_at;
724 unsigned int path_length;
729 if (0 == path_length)
732 "Dropping CADET_CONNECTION_CREATE with empty path\n");
737 "Handling CADET_CONNECTION_CREATE from %s for CID %s with %u hops\n",
747 for (
unsigned int i = 0; i < path_length; i++)
750 "CADET_CONNECTION_CREATE has peer %s at offset %u\n",
762 "Dropping CADET_CONNECTION_CREATE with cyclic path\n");
770 for (off = 1; off < path_length; off++)
773 if (off == path_length)
776 "Dropping CADET_CONNECTION_CREATE without us in the path\n");
784 "Dropping CADET_CONNECTION_CREATE without sender at previous hop in the path\n");
793 "Passing on duplicate CADET_CONNECTION_CREATE message on connection %s\n",
802 if (off == path_length - 1)
813 "Received duplicate CADET_CONNECTION_CREATE message on connection %s\n",
821 "I am destination for CADET_CONNECTION_CREATE message from %s for connection %s, building inverse path\n",
844 "Received CADET_CONNECTION_CREATE from %s for %s, but %s already has a connection. Sending BROKEN\n",
859 "Received CADET_CONNECTION_CREATE from %s for %s. Next hop %s:%u is down. Sending BROKEN\n",
870 "Received CADET_CONNECTION_CREATE from %s for %s. We have reached our route limit. Sending BROKEN\n",
879 "Received CADET_CONNECTION_CREATE from %s for %s. Next hop %s:%u is up. Creating route\n",
902 if (NULL == timeout_task)
946 "Received CONNECTION_CREATE_ACK for connection %s.\n",
991 "Received CONNECTION_BROKEN for connection %s. Destroying it.\n",
1041 "Received CONNECTION_DESTROY for connection %s. Destroying connection.\n",
1050 "Received CONNECTION_DESTROY for connection %s. Destroying route.\n",
1077 "Routing KX with ephemeral %s on CID %s\n",
1213 if (NULL == my_identity)
1236 "CORE connection to peer %s was established.\n",
1258 "CORE connection to peer %s went down.\n",
1340 if (NULL != timeout_task)
1343 timeout_task = NULL;
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
void GNUNET_MQ_dll_insert_tail(struct GNUNET_MQ_Envelope **env_head, struct GNUNET_MQ_Envelope **env_tail, struct GNUNET_MQ_Envelope *env)
Insert env into the envelope DLL starting at env_head Note that env must not be in any MQ while this ...
Axolotl-encrypted tunnel message with application payload.
struct GNUNET_TIME_AbsoluteNBO monotime
This monotonic time is set, if a peer likes to trigger a KX, but is not the peer that should start th...
#define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED
Axolotl encrypted data.
void GNUNET_MQ_dll_insert_head(struct GNUNET_MQ_Envelope **env_head, struct GNUNET_MQ_Envelope **env_tail, struct GNUNET_MQ_Envelope *env)
Insert env into the envelope DLL starting at env_head Note that env must not be in any MQ while this ...
static char * dir
Set to the directory where runtime files are stored.
static void handle_tunnel_kx(void *cls, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg)
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX.
static unsigned long long max_buffers
Maximum number of envelopes we will buffer at this peer.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
void GNUNET_CONTAINER_heap_update_cost(struct GNUNET_CONTAINER_HeapNode *node, GNUNET_CONTAINER_HeapCostType new_cost)
Updates the cost of any node in the tree.
unsigned int num_routes
Total number of route directions in this rung.
static void dir_init(struct RouteDirection *dir, struct CadetRoute *route, struct CadetPeer *hop)
Initialize one of the directions of a route.
struct GNUNET_MQ_Envelope * GNUNET_MQ_msg_copy(const struct GNUNET_MessageHeader *hdr)
Create a new envelope by copying an existing message.
const char * GNUNET_i2s2(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env_head
Head of DLL of envelopes we have in the buffer for this direction.
struct RouteDirection * next
DLL of other route directions within the same struct Rung.
Low-level connection to a destination.
const struct GNUNET_MessageHeader * GNUNET_MQ_env_get_msg(const struct GNUNET_MQ_Envelope *env)
Obtain message contained in envelope.
Message to destroy a connection.
enum CadetTunnelEState GCT_get_estate(struct CadetTunnel *t)
Get the encryption state of a tunnel.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
struct CadetTunnel * GCP_get_tunnel(struct CadetPeer *cp, int create)
Get the tunnel towards a peer.
unsigned int GNUNET_CONTAINER_multishortmap_size(const struct GNUNET_CONTAINER_MultiShortmap *map)
Get the number of key-value pairs in the map.
Context for the core service connection.
struct GNUNET_CONTAINER_HeapNode * GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap, void *element, GNUNET_CONTAINER_HeapCostType cost)
Inserts a new element into the heap.
static void handle_tunnel_kx_auth(void *cls, const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg)
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH.
Information we keep per direction for a route.
A connection is a live end-to-end messaging mechanism where the peers are identified by a path and kn...
struct GNUNET_CONTAINER_HeapNode * hn
Position of this route in the route_heap.
static unsigned long long max_routes
Maximum number of concurrent routes this peer will support.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE.
Data structure used to track whom we have to notify about changes to our message queue.
struct GNUNET_CADET_TunnelKeyExchangeMessage kx
Message header with key material.
static void core_disconnect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, void *peer_cls)
Method called whenever a peer disconnects.
struct GNUNET_PeerIdentity my_full_id
Local peer own ID.
void GCC_destroy_without_core(struct CadetConnection *cc)
Destroy a connection, called when the CORE layer is already done (i.e.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
Message for ack'ing a connection.
static unsigned long long cur_buffers
Current number of envelopes we have buffered at this peer.
void GCC_handle_kx(struct CadetConnection *cc, const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg)
Handle KX message.
void GNUNET_MQ_env_set_options(struct GNUNET_MQ_Envelope *env, enum GNUNET_MQ_PriorityPreferences pp)
Set application-specific options for this envelope.
int GNUNET_CONTAINER_multishortmap_remove(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Remove the given key-value pair from the map.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
static struct CadetConnection * connection_create(struct CadetPeer *destination, struct CadetPeerPath *path, unsigned int off, struct CadetTConnection *ct, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, enum CadetConnectionState init_state, GCC_ReadyCallback ready_cb, void *ready_cb_cls)
Create a connection to destination via path and notify cb whenever we are ready for more data...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
void GCC_handle_connection_create_ack(struct CadetConnection *cc)
A GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK was received for this connection, implying that the end-to-end connection is up.
struct GNUNET_PeerIdentity peer2
ID of the endpoint.
void GCP_set_mq(struct CadetPeer *cp, struct GNUNET_MQ_Handle *mq)
Set the message queue to mq for peer cp and notify watchers.
GNUNET_MQ_PriorityPreferences
Per envelope preferences and priorities.
Information we track per tunnel.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Relative duration)
Add a given relative duration to the given start time.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void GCP_send(struct GCP_MessageQueueManager *mqm, struct GNUNET_MQ_Envelope *env)
Send the message in env to cp.
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
static struct GNUNET_SCHEDULER_Task * t
Main task.
static void * core_connect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
Method called whenever a given peer connects.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
Set of CadetRoutes that have exactly the same number of messages in their buffer. ...
struct Rung * prev
Rung of RouteDirections with one less buffer entry each.
static int check_tunnel_encrypted(void *cls, const struct GNUNET_CADET_TunnelEncryptedMessage *msg)
Check if the encrypted message has the appropriate size.
uint64_t abs_value_us
The actual value.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
const struct GNUNET_MQ_Envelope * GNUNET_MQ_env_next(const struct GNUNET_MQ_Envelope *env)
Return next envelope in queue.
struct Rung * next
Rung of RouteDirections with one more buffer entry each.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
int GCP_check_monotime_sig(struct CadetPeer *peer, const struct GNUNET_CADET_ConnectionCreateMessage *msg)
Checking the signature for a monotime of a GNUNET_CADET_ConnectionCreateMessage.
static void destroy_direction(struct RouteDirection *dir)
Free internal data of a route direction.
static struct GNUNET_CONTAINER_MultiPeerMap * map
Handle to the map used to store old latency values for peers.
const char * GCP_2s(const struct CadetPeer *cp)
Get the static string for a peer ID.
static void handle_connection_create_ack(void *cls, const struct GNUNET_CADET_ConnectionCreateAckMessage *msg)
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK.
Flag to indicate that low latency is important.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
Unique identifier for the connection that uses this route.
enum GNUNET_MQ_PriorityPreferences GNUNET_MQ_env_get_options(struct GNUNET_MQ_Envelope *env)
Get performance preferences set for this envelope.
Best-effort traffic (i.e.
struct CadetRoute * my_route
Route this direction is part of.
const char * GCPP_2s(struct CadetPeerPath *path)
Convert a path to a human-readable string.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK.
struct RouteDirection * rd_head
DLL of route directions with a number of buffer entries matching this rung.
static void destroy_route(struct CadetRoute *route)
Destroy our state for route.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
static struct CadetRoute * get_route(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
Get the route corresponding to a hash.
Information we track per peer.
static struct Rung rung_zero
Rung zero (always pointed to by rung_head).
struct CadetPeerPath * GCPP_get_path_from_route(unsigned int path_length, const struct GNUNET_PeerIdentity *pids)
We got an incoming connection, obtain the corresponding path.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED.
struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
int GCT_add_inbound_connection(struct CadetTunnel *t, const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid, struct CadetPeerPath *path)
Add a connection to the tunnel.
Message for a Key eXchange for a tunnel, with authentication.
struct RouteDirection prev
Information about the previous hop on this route.
void * GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap)
Get element stored at the root of heap.
void GCP_send_ooo(struct CadetPeer *cp, struct GNUNET_MQ_Envelope *env)
Send the message in env to cp, overriding queueing logic.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Description of a segment of a struct CadetConnection at the intermediate peers.
struct CadetPeer * hop
Target peer.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
struct GNUNET_TIME_Absolute last_use
When was this route last in use?
static struct Rung * rung_head
DLL of rungs, with the head always point to a rung of route directions with no messages in the queue...
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
int GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE
Request the creation of a connection.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
#define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element)
Insert an element into a DLL after the given other element.
Message for notifying a disconnection in a path.
Handle to a node in a heap.
static void dir_ready_cb(void *cls, int ready)
Function called when the message queue to the previous hop becomes available/unavailable.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK
Send origin an ACK that the connection is complete.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
Internal representation of the hash map.
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
Heap with the minimum cost at the root.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
struct RouteDirection next
Information about the next hop on this route.
void GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap)
Destroys the heap.
Message handler for a specific message type.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
int has_monotime
This flag indicates the peer sending the connection create meassage likes to trigger a KX handshake...
void GNUNET_MQ_dll_remove(struct GNUNET_MQ_Envelope **env_head, struct GNUNET_MQ_Envelope **env_tail, struct GNUNET_MQ_Envelope *env)
Remove env from the envelope DLL starting at env_head.
static void lower_rung(struct RouteDirection *dir)
Lower the rung in which dir is by 1.
void GCC_handle_duplicate_create(struct CadetConnection *cc)
We got a GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE for a connection that we already have...
void GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm)
Discard the message queue message, free all allocated resources.
Struct containing all information regarding a tunnel to a peer.
void GCO_shutdown()
Shut down the CORE subsystem.
There must only be one value per key; storing a value should fail if a value under the same key alrea...
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
Internal representation of the hash map.
struct RouteDirection * rd_tail
DLL of route directions with a number of buffer entries matching this rung.
static unsigned int size
Size of the "table".
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).
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.
unsigned int rung_off
Number of messages route directions at this rung have in their buffer.
struct GNUNET_CORE_Handle * GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_CORE_StartupCallback init, GNUNET_CORE_ConnectEventHandler connects, GNUNET_CORE_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Connect to the core service.
struct GNUNET_PeerIdentity peer1
ID of the endpoint.
void GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle)
Disconnect from the core service.
struct GNUNET_MQ_Envelope * env
Handshake completed: session key available.
struct CadetPeerPath * GCC_get_path(struct CadetConnection *cc, unsigned int *off)
Obtain the path used by this connection.
struct GCP_MessageQueueManager * mqm
Message queue manager for hop.
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_Heap * GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order)
Create a new heap.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
P2P messages used by CADET.
int GCP_has_core_connection(struct CadetPeer *cp)
Test if cp has a core-level connection.
void GCT_change_estate(struct CadetTunnel *t, enum CadetTunnelEState state)
Change the tunnel encryption state.
Handle to a message queue.
struct CadetConnection * GCC_lookup(const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
Lookup a connection by its identifier.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
static void handle_tunnel_encrypted(void *cls, const struct GNUNET_CADET_TunnelEncryptedMessage *msg)
Handle for GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED.
The identity of the host (wraps the signing key of the peer).
Hash uniquely identifying a connection below a tunnel.
static struct GNUNET_CONTAINER_Heap * route_heap
Heap of routes, MIN-sorted by last activity.
static struct GNUNET_SCHEDULER_Task * timeout_task
Task to timeout routes.
void * GNUNET_CONTAINER_multishortmap_get(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Given a key find a value in the map matching the key.
void GCC_handle_encrypted(struct CadetConnection *cc, const struct GNUNET_CADET_TunnelEncryptedMessage *msg)
Handle encrypted message.
struct CadetPeer * GCP_get(const struct GNUNET_PeerIdentity *peer_id, int create)
Retrieve the CadetPeer stucture associated with the peer.
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY
Request the destruction of a connection.
int GCP_check_and_update_monotime(struct CadetPeer *peer, struct GNUNET_TIME_AbsoluteNBO monotime)
Checking if a monotime value is newer than the last monotime value received from a peer...
void GCP_request_mq_cancel(struct GCP_MessageQueueManager *mqm, struct GNUNET_MQ_Envelope *last_env)
Stops message queue change notifications.
Message for a Key eXchange for a tunnel.
static void handle_connection_create(void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg)
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX or GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH as part of stru...
struct GNUNET_MQ_Handle * mq
#define GNUNET_log(kind,...)
Entry in list of pending tasks.
Flag to indicate that out-of-order delivery is OK.
static void handle_connection_broken(void *cls, const struct GNUNET_CADET_ConnectionBrokenMessage *msg)
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN.
static struct PendingResolutions * tail
Tail of list of pending resolution requests.
struct CadetPeer * GCPP_get_peer_at_offset(struct CadetPeerPath *path, unsigned int off)
Obtain the peer at offset off in path.
struct GNUNET_TIME_Relative keepalive_period
How frequently do we send KEEPALIVE messages on idle connections?
Uninitialized status, we need to send KX.
struct Rung * rung
Rung of this route direction (matches length of the buffer DLL).
#define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX_AUTH
Axolotl key exchange response with authentication.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
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.
void GCC_handle_kx_auth(struct CadetConnection *cc, const struct GNUNET_CADET_TunnelKeyExchangeAuthMessage *msg)
Handle KX_AUTH message.
Time for absolute times used by GNUnet, in microseconds.
void GCO_init(const struct GNUNET_CONFIGURATION_Handle *c)
Initialize the CORE subsystem.
int is_ready
Is mqm currently ready for transmission?
Flag to indicate that unreliable delivery is acceptable.
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.
static void timeout_cb(void *cls)
Function called to check if any routes have timed out, and if so, to clean them up.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key
Sender's ephemeral public ECC key encoded in a format suitable for network transmission, as created using 'gcry_sexp_sprint'.
Highest priority, control traffic (i.e.
const char * GNUNET_e2s(const struct GNUNET_CRYPTO_EcdhePublicKey *p)
Convert a public key value to a string (for printing debug messages).
static void discard_all_from_rung_tail()
Discard all messages from the highest rung, to make space.
static int check_connection_create(void *cls, const struct GNUNET_CADET_ConnectionCreateMessage *msg)
Check if the create_connection message has the appropriate size.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_at(struct GNUNET_TIME_Absolute at, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run at the specified time.
cadet service; interaction with CORE service
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.
struct RouteDirection * prev
DLL of other route directions within the same struct Rung.
Information regarding a possible path to reach a peer.
struct GNUNET_ShortHashCode connection_of_tunnel
void * GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node)
Removes a node from the heap.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
static void handle_connection_destroy(void *cls, const struct GNUNET_CADET_ConnectionDestroyMessage *msg)
Handle for GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY.
struct GNUNET_CADET_ConnectionTunnelIdentifier cid
ID of the connection.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN.
static struct Rung * rung_tail
Tail of the rung_head DLL.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN
Notify that a connection is no longer valid.
Message for cadet connection creation.
struct GNUNET_MQ_Envelope * env_tail
Tail of DLL of envelopes we have in the buffer for this direction.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
static struct GNUNET_CORE_Handle * core
Handle to the CORE service.
#define GNUNET_MESSAGE_TYPE_CADET_TUNNEL_KX
Axolotl key exchange.
#define GNUNET_free(ptr)
Wrapper around free.
const struct GNUNET_PeerIdentity * GCP_get_id(struct CadetPeer *cp)
Obtain the peer identity for a struct CadetPeer.
Time for relative time used by GNUnet, in microseconds.
struct GCP_MessageQueueManager * GCP_request_mq(struct CadetPeer *cp, GCP_MessageQueueNotificationCallback cb, void *cb_cls)
Start message queue change notifications.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY.
static struct GNUNET_CONTAINER_MultiShortmap * routes
Routes on which this peer is an intermediate.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.