Information we track per peer. More...
Go to the source code of this file.
Typedefs | |
typedef int(* | GCP_PathIterator) (void *cls, struct CadetPeerPath *path, unsigned int off) |
Peer path iterator. More... | |
typedef void(* | GCP_MessageQueueNotificationCallback) (void *cls, int available) |
Function to call with updated message queue object. More... | |
Functions | |
const char * | GCP_2s (const struct CadetPeer *peer) |
Get the static string for a peer ID. More... | |
struct CadetPeer * | GCP_get (const struct GNUNET_PeerIdentity *peer_id, int create) |
Retrieve the CadetPeer structure associated with the peer. More... | |
double | GCP_get_desirability_of_path (struct CadetPeer *cp, unsigned int off) |
Calculate how desirable a path is for cp if cp is at offset off in the path. More... | |
const struct GNUNET_PeerIdentity * | GCP_get_id (struct CadetPeer *cp) |
Obtain the peer identity for a struct CadetPeer . More... | |
void | GCP_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls) |
Iterate over all known peers. More... | |
unsigned int | GCP_count_paths (const struct CadetPeer *cp) |
Count the number of known paths toward the peer. More... | |
void | GCP_drop_owned_paths (struct CadetPeer *cp) |
Drop all paths owned by this peer, and do not allow new ones to be added: We are shutting down. More... | |
unsigned int | GCP_iterate_paths (struct CadetPeer *cp, GCP_PathIterator callback, void *callback_cls) |
Iterate over the paths to a peer. More... | |
unsigned int | GCP_iterate_indirect_paths (struct CadetPeer *cp, GCP_PathIterator callback, void *callback_cls) |
Iterate over the paths to a peer without direct link. More... | |
unsigned int | GCP_iterate_paths_at (struct CadetPeer *cp, unsigned int dist, GCP_PathIterator callback, void *callback_cls) |
Iterate over the paths to peer where peer is at distance dist from us. More... | |
void | GCP_path_entry_remove (struct CadetPeer *cp, struct CadetPeerPathEntry *entry, unsigned int off) |
Remove an entry from the DLL of all of the paths that this peer is on. More... | |
void | GCP_path_entry_add (struct CadetPeer *cp, struct CadetPeerPathEntry *entry, unsigned int off) |
Add an entry to the DLL of all of the paths that this peer is on. More... | |
struct CadetTunnel * | GCP_get_tunnel (struct CadetPeer *cp, int create) |
Get the tunnel towards a peer. More... | |
void | GCP_drop_tunnel (struct CadetPeer *cp, struct CadetTunnel *t) |
The tunnel to the given peer no longer exists, remove it from our data structures, and possibly clean up the peer itself. More... | |
struct GNUNET_CONTAINER_HeapNode * | GCP_attach_path (struct CadetPeer *cp, struct CadetPeerPath *path, unsigned int off, int force) |
Try adding a path to this cp. More... | |
void | GCP_detach_path (struct CadetPeer *cp, struct CadetPeerPath *path, struct GNUNET_CONTAINER_HeapNode *hn) |
This peer can no longer own path as the path has been extended and a peer further down the line is now the new owner. More... | |
void | GCP_add_connection (struct CadetPeer *cp, struct CadetConnection *cc) |
Add a connection to this cp. More... | |
void | GCP_remove_connection (struct CadetPeer *cp, struct CadetConnection *cc) |
Remove a connection that went via this cp. More... | |
void | GCP_set_hello (struct CadetPeer *cp, const struct GNUNET_MessageHeader *hello) |
We got a HELLO for a cp, remember it, and possibly trigger adequate actions (like trying to connect). More... | |
void | GCP_destroy_all_peers (void) |
Clean up all entries about all peers. More... | |
struct GCP_MessageQueueManager * | GCP_request_mq (struct CadetPeer *cp, GCP_MessageQueueNotificationCallback cb, void *cb_cls) |
Start message queue change notifications. More... | |
int | GCP_has_core_connection (struct CadetPeer *cp) |
Test if cp has a core-level connection. More... | |
void | GCP_send (struct GCP_MessageQueueManager *mqm, struct GNUNET_MQ_Envelope *env) |
Send the message in env via a mqm. More... | |
void | GCP_send_ooo (struct CadetPeer *cp, struct GNUNET_MQ_Envelope *env) |
Send the message in env to cp, overriding queueing logic. More... | |
void | GCP_request_mq_cancel (struct GCP_MessageQueueManager *mqm, struct GNUNET_MQ_Envelope *last_env) |
Stops message queue change notifications and sends a last message. More... | |
void | GCP_set_mq (struct CadetPeer *cp, struct GNUNET_MQ_Handle *mq) |
Set the message queue to mq for peer cp and notify watchers. More... | |
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. More... | |
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. More... | |
Information we track per peer.
Definition in file gnunet-service-cadet_peer.h.
typedef int(* GCP_PathIterator) (void *cls, struct CadetPeerPath *path, unsigned int off) |
Peer path iterator.
cls | Closure. |
path | Path itself |
off | offset of the target peer in path |
Definition at line 131 of file gnunet-service-cadet_peer.h.
typedef void(* GCP_MessageQueueNotificationCallback) (void *cls, int available) |
Function to call with updated message queue object.
cls | closure |
available | 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 328 of file gnunet-service-cadet_peer.h.
const char * GCP_2s | ( | const struct CadetPeer * | peer | ) |
Get the static string for a peer ID.
peer | Peer. |
Definition at line 234 of file gnunet-service-cadet_peer.c.
References GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_free, GNUNET_is_zero, GNUNET_strlcpy(), GNUNET_YES, CadetPeer::pid, GNUNET_PeerIdentity::public_key, and ret.
Referenced by consider_path_cb(), consider_peer_activate(), destroy_peer(), dht_get_id_handler(), GCC_debug(), GCCH_channel_incoming_new(), GCCH_channel_local_new(), GCP_add_connection(), GCP_attach_path(), GCP_detach_path(), GCP_drop_owned_paths(), GCP_drop_tunnel(), GCP_get(), GCP_iterate_indirect_paths(), GCP_iterate_paths(), GCP_path_entry_add(), GCP_path_entry_remove(), GCP_remove_connection(), GCP_request_mq(), GCP_request_mq_cancel(), GCP_send(), GCP_send_ooo(), GCP_set_hello(), GCP_set_mq(), GSC_bind(), handle_connection_create(), mqm_execute(), mqm_send_done(), route_message(), send_broken(), and timeout_closed_cb().
struct CadetPeer * GCP_get | ( | const struct GNUNET_PeerIdentity * | peer_id, |
int | create | ||
) |
Retrieve the CadetPeer structure associated with the peer.
Optionally create one and insert it in the appropriate structures if the peer is not known yet.
peer_id | Full identity of the peer. |
create | GNUNET_YES if a new peer should be created if unknown. GNUNET_NO to return NULL if peer is unknown. |
Definition at line 1094 of file gnunet-service-cadet_peer.c.
References CadetPeer::connections, create, GCP_2s(), GNUNET_assert, GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multishortmap_create(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_new, GNUNET_NO, GNUNET_YES, LOG, CadetPeer::path_heap, peer_id, peers, and CadetPeer::pid.
Referenced by core_connect_cb(), dht_get_id_handler(), GCCH_bind(), GCPP_get_path_from_route(), GCPP_try_path_from_dht(), got_hello(), handle_channel_create(), handle_connection_create(), and handle_show_path().
double GCP_get_desirability_of_path | ( | struct CadetPeer * | cp, |
unsigned int | off | ||
) |
Calculate how desirable a path is for cp if cp is at offset off in the path.
The 'desirability_table.c' program can be used to compute a list of sample outputs for different scenarios. Basically, we score paths lower if there are many alternatives, and higher if they are shorter than average, and very high if they are much shorter than average and without many alternatives.
cp | a peer reachable via a path |
off | offset of cp in a path |
Definition at line 256 of file gnunet-service-cadet_peer.c.
References GNUNET_assert, CadetPeerPathEntry::next, CadetPeer::num_paths, CadetPeer::off_sum, CadetPeer::path_dll_length, and CadetPeer::path_heads.
Referenced by recalculate_path_desirability().
const struct GNUNET_PeerIdentity * GCP_get_id | ( | struct CadetPeer * | cp | ) |
Obtain the peer identity for a struct CadetPeer
.
cp | our peer handle |
Definition at line 1130 of file gnunet-service-cadet_peer.c.
References CadetPeer::pid.
Referenced by destroy_route(), dir_ready_cb(), GCCH_2s(), GCCH_channel_local_new(), GCPP_2s(), GCT_2s(), GCT_handle_kx(), GCT_handle_kx_auth(), get_next_free_ctn(), GSC_bind(), path_info_iterator(), route_message(), send_create(), and send_kx().
void GCP_iterate_all | ( | GNUNET_CONTAINER_PeerMapIterator | iter, |
void * | cls | ||
) |
Iterate over all known peers.
iter | Iterator. |
cls | Closure for iter . |
Definition at line 1143 of file gnunet-service-cadet_peer.c.
References GNUNET_CONTAINER_multipeermap_iterate(), and peers.
Referenced by handle_get_peers(), handle_info_tunnels(), and shutdown_rest().
unsigned int GCP_count_paths | ( | const struct CadetPeer * | cp | ) |
Count the number of known paths toward the peer.
cp | Peer to get path info. |
Definition at line 1159 of file gnunet-service-cadet_peer.c.
References CadetPeer::num_paths.
Referenced by get_all_peers_iterator().
void GCP_drop_owned_paths | ( | struct CadetPeer * | cp | ) |
Drop all paths owned by this peer, and do not allow new ones to be added: We are shutting down.
cp | peer to drop paths to |
Definition at line 793 of file gnunet-service-cadet_peer.c.
References GCP_2s(), GCPP_release(), GNUNET_CONTAINER_heap_destroy(), GNUNET_CONTAINER_heap_remove_root(), GNUNET_ERROR_TYPE_DEBUG, LOG, and CadetPeer::path_heap.
Referenced by destroy_paths_now().
unsigned int GCP_iterate_paths | ( | struct CadetPeer * | cp, |
GCP_PathIterator | callback, | ||
void * | callback_cls | ||
) |
Iterate over the paths to a peer.
cp | Peer to get path info. |
callback | Function to call for every path. |
callback_cls | Closure for callback. |
Definition at line 1174 of file gnunet-service-cadet_peer.c.
References CadetPeer::core_mq, GCP_2s(), GCPP_get_path_from_route(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_NO, LOG, CadetPeerPathEntry::next, CadetPeer::path_dll_length, CadetPeer::path_heads, CadetPeer::pid, and ret.
Referenced by maintain_connections_cb().
unsigned int GCP_iterate_indirect_paths | ( | struct CadetPeer * | cp, |
GCP_PathIterator | callback, | ||
void * | callback_cls | ||
) |
Iterate over the paths to a peer without direct link.
cp | Peer to get path info. |
callback | Function to call for every path. |
callback_cls | Closure for callback. |
Definition at line 1226 of file gnunet-service-cadet_peer.c.
References GCP_2s(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_NO, LOG, CadetPeerPathEntry::next, CadetPeer::path_dll_length, CadetPeer::path_heads, and ret.
Referenced by handle_show_path().
unsigned int GCP_iterate_paths_at | ( | struct CadetPeer * | cp, |
unsigned int | dist, | ||
GCP_PathIterator | callback, | ||
void * | callback_cls | ||
) |
Iterate over the paths to peer where peer is at distance dist from us.
cp | Peer to get path info. |
dist | desired distance of peer to us on the path |
callback | Function to call for every path. |
callback_cls | Closure for callback. |
Definition at line 1254 of file gnunet-service-cadet_peer.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_NO, LOG, CadetPeerPathEntry::next, CadetPeer::path_dll_length, CadetPeer::path_heads, and ret.
Referenced by GCPP_get_path_from_route(), and GCPP_try_path_from_dht().
void GCP_path_entry_remove | ( | struct CadetPeer * | cp, |
struct CadetPeerPathEntry * | entry, | ||
unsigned int | off | ||
) |
Remove an entry from the DLL of all of the paths that this peer is on.
cp | peer to modify |
entry | an entry on a path |
off | offset of this peer on the path |
Definition at line 876 of file gnunet-service-cadet_peer.c.
References consider_peer_destroy(), CadetPeer::core_mq, DESIRED_CONNECTIONS_PER_TUNNEL, CadetPeer::destroy_task, GCD_search(), GCP_2s(), GCPP_2s(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, LOG, CadetPeer::num_paths, CadetPeer::off_sum, CadetPeerPathEntry::path, CadetPeer::path_heads, CadetPeer::path_tails, CadetPeer::pid, CadetPeer::search_h, and CadetPeer::t.
Referenced by attach_path(), and GCPP_release().
void GCP_path_entry_add | ( | struct CadetPeer * | cp, |
struct CadetPeerPathEntry * | entry, | ||
unsigned int | off | ||
) |
Add an entry to the DLL of all of the paths that this peer is on.
cp | peer to modify |
entry | an entry on a path |
off | offset of this peer on the path |
Definition at line 816 of file gnunet-service-cadet_peer.c.
References consider_peer_destroy(), CadetPeer::destroy_task, GCD_search_stop(), GCP_2s(), GCPP_2s(), GCPP_get_peer_at_offset(), GCT_consider_path(), GNUNET_array_grow, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, LOG, CadetPeer::num_paths, CadetPeer::off_sum, CadetPeerPathEntry::path, CadetPeer::path_dll_length, CadetPeer::path_heads, CadetPeer::path_tails, CadetPeer::search_h, and CadetPeer::t.
Referenced by extend_path(), GCPP_get_path_from_route(), and GCPP_try_path_from_dht().
struct CadetTunnel * GCP_get_tunnel | ( | struct CadetPeer * | cp, |
int | create | ||
) |
Get the tunnel towards a peer.
cp | Peer to get from. |
create | GNUNET_YES to create a tunnel if we do not have one |
Definition at line 1292 of file gnunet-service-cadet_peer.c.
References consider_peer_activate(), create, GCT_create_tunnel(), GNUNET_NO, and CadetPeer::t.
Referenced by destroy_tunnels_now(), GCCH_channel_local_new(), get_all_peers_iterator(), get_all_tunnels_iterator(), handle_connection_create(), and send_create().
void GCP_drop_tunnel | ( | struct CadetPeer * | cp, |
struct CadetTunnel * | t | ||
) |
The tunnel to the given peer no longer exists, remove it from our data structures, and possibly clean up the peer itself.
cp | the peer affected |
t | the dead tunnel |
Definition at line 1364 of file gnunet-service-cadet_peer.c.
References consider_peer_destroy(), GCP_2s(), GCT_2s(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, LOG, t, and CadetPeer::t.
Referenced by destroy_tunnel().
struct GNUNET_CONTAINER_HeapNode * GCP_attach_path | ( | struct CadetPeer * | cp, |
struct CadetPeerPath * | path, | ||
unsigned int | off, | ||
int | force | ||
) |
Try adding a path to this cp.
If the peer already has plenty of paths, return NULL.
cp | peer to which the path leads to |
path | a path looking for an owner; may not be fully initialized yet! |
off | offset of cp in path |
force | force attaching the path |
Definition at line 942 of file gnunet-service-cadet_peer.c.
References DESIRED_CONNECTIONS_PER_TUNNEL, GCP_2s(), GCPP_2s(), GCPP_get_desirability(), GCPP_get_length(), GCPP_get_peer_at_offset(), GNUNET_assert, GNUNET_CONTAINER_heap_get_size(), GNUNET_CONTAINER_heap_insert(), GNUNET_CONTAINER_heap_peek2(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_NO, GNUNET_SCHEDULER_add_now(), CadetPeer::heap_cleanup_task, LOG, CadetPeer::num_paths, CadetPeer::path_heap, and path_heap_cleanup().
Referenced by attach_path(), extend_path(), and GCPP_get_path_from_route().
void GCP_detach_path | ( | struct CadetPeer * | cp, |
struct CadetPeerPath * | path, | ||
struct GNUNET_CONTAINER_HeapNode * | hn | ||
) |
This peer can no longer own path as the path has been extended and a peer further down the line is now the new owner.
cp | old owner of the path |
path | path where the ownership is lost |
hn | note in cp's path heap that must be deleted |
Definition at line 1016 of file gnunet-service-cadet_peer.c.
References GCP_2s(), GCPP_2s(), GNUNET_assert, GNUNET_CONTAINER_heap_remove_node(), GNUNET_ERROR_TYPE_DEBUG, and LOG.
Referenced by extend_path().
void GCP_add_connection | ( | struct CadetPeer * | cp, |
struct CadetConnection * | cc | ||
) |
Add a connection to this cp.
cp | peer via which the connection goes |
cc | the connection to add |
Definition at line 1036 of file gnunet-service-cadet_peer.c.
References CadetPeer::connections, CadetPeer::destroy_task, GCC_2s(), GCC_get_id(), GCP_2s(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multishortmap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_OK, GNUNET_SCHEDULER_cancel(), and LOG.
Referenced by connection_create().
void GCP_remove_connection | ( | struct CadetPeer * | cp, |
struct CadetConnection * | cc | ||
) |
Remove a connection that went via this cp.
cp | peer via which the connection went |
cc | the connection to remove |
Definition at line 1065 of file gnunet-service-cadet_peer.c.
References CadetPeer::connections, consider_peer_destroy(), GCC_2s(), GCC_get_id(), GCP_2s(), GNUNET_assert, GNUNET_CONTAINER_multishortmap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_YES, and LOG.
Referenced by GCC_destroy().
void GCP_set_hello | ( | struct CadetPeer * | cp, |
const struct GNUNET_MessageHeader * | hello | ||
) |
We got a HELLO for a cp, remember it, and possibly trigger adequate actions (like trying to connect).
cp | the peer we got a HELLO for |
hello | the HELLO to remember |
Definition at line 1307 of file gnunet-service-cadet_peer.c.
References CadetPeer::ash, consider_peer_destroy(), GCP_2s(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_HELLO_get_expiration_time_from_msg(), GNUNET_malloc, GNUNET_memcpy, GNUNET_memdup, GNUNET_MQ_PRIO_BEST_EFFORT, GNUNET_TIME_absolute_cmp, GNUNET_TIME_absolute_get(), GNUNET_TRANSPORT_application_suggest(), GNUNET_TRANSPORT_application_suggest_cancel(), CadetPeer::hello, LOG, CadetPeer::pid, GNUNET_MessageHeader::size, size, transport, and GNUNET_BANDWIDTH_Value32NBO::value__.
Referenced by dht_get_id_handler(), and got_hello().
void GCP_destroy_all_peers | ( | void | ) |
Clean up all entries about all peers.
Must only be called after all tunnels, CORE-connections and connections are down.
Definition at line 776 of file gnunet-service-cadet_peer.c.
References destroy_iterator_cb(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_ERROR_TYPE_DEBUG, LOG, and peers.
Referenced by shutdown_rest().
struct GCP_MessageQueueManager * GCP_request_mq | ( | struct CadetPeer * | cp, |
GCP_MessageQueueNotificationCallback | cb, | ||
void * | cb_cls | ||
) |
Start message queue change notifications.
Will create a new slot to manage the message queue to the given cp.
cp | peer to notify for |
cb | function to call if mq becomes available or unavailable |
cb_cls | closure for cb |
cp | peer to notify for |
cb | function to call if mq becomes available or unavailable |
cb_cls | closure for cb |
Definition at line 1399 of file gnunet-service-cadet_peer.c.
References GCP_MessageQueueManager::cb, GCP_MessageQueueManager::cb_cls, CadetPeer::core_mq, GCP_MessageQueueManager::cp, GCP_2s(), GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_new, GNUNET_YES, LOG, CadetPeer::mqm_head, and CadetPeer::mqm_tail.
Referenced by connection_create(), and dir_init().
int GCP_has_core_connection | ( | struct CadetPeer * | cp | ) |
Test if cp has a core-level connection.
cp | peer to test |
Definition at line 1384 of file gnunet-service-cadet_peer.c.
References CadetPeer::core_mq, GNUNET_NO, and GNUNET_YES.
Referenced by handle_connection_create().
void GCP_send | ( | struct GCP_MessageQueueManager * | mqm, |
struct GNUNET_MQ_Envelope * | env | ||
) |
Send the message in env via a mqm.
Must only be called at most once after the respective GCP_MessageQueueNotificationCallback was called with available
set to GNUNET_YES, and not after the callback was called with available
set to GNUNET_NO or GNUNET_SYSERR.
mqm | message queue manager for the transmission |
env | envelope with the message to send; must NOT yet have a GNUNET_MQ_notify_sent() callback attached to it |
Send the message in env via a mqm.
mqm | the message queue manager to use for transmission |
env | envelope with the message to send; must NOT yet have a GNUNET_MQ_notify_sent() callback attached to it |
Definition at line 718 of file gnunet-service-cadet_peer.c.
References CadetPeer::core_mq, GCP_MessageQueueManager::cp, env, GCP_MessageQueueManager::env, GCP_2s(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_get_length(), GNUNET_MQ_notify_sent(), LOG, CadetPeer::mqm_head, CadetPeer::mqm_ready_counter, CadetPeer::mqm_ready_ptr, mqm_send_done(), and send_next_ready().
Referenced by dir_ready_cb(), GCC_transmit(), route_message(), send_create(), and send_create_ack().
void GCP_send_ooo | ( | struct CadetPeer * | cp, |
struct GNUNET_MQ_Envelope * | env | ||
) |
Send the message in env to cp, overriding queueing logic.
This function should only be used to send error messages outside of flow and congestion control, similar to ICMP. Note that the envelope may be silently discarded as well.
cp | peer to send the message to |
env | envelope with the message to send |
Definition at line 1476 of file gnunet-service-cadet_peer.c.
References CadetPeer::core_mq, env, GCP_2s(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_discard(), GNUNET_MQ_get_length(), GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), LOG, MAX_OOO_QUEUE_SIZE, and mqm_send_done().
Referenced by route_message(), and send_broken_without_mqm().
void GCP_request_mq_cancel | ( | struct GCP_MessageQueueManager * | mqm, |
struct GNUNET_MQ_Envelope * | last_env | ||
) |
Stops message queue change notifications and sends a last message.
In practice, this is implemented by sending that last_env message immediately (if any), ignoring queue order.
mqm | handle matching request to cancel |
last_env | final message to transmit, or NULL |
Stops message queue change notifications and sends a last message.
mqm | handle matching request to cancel |
last_env | final message to transmit, or NULL |
Definition at line 1430 of file gnunet-service-cadet_peer.c.
References CadetPeer::core_mq, GCP_MessageQueueManager::cp, GCP_MessageQueueManager::env, GCP_2s(), GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_MQ_discard(), GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), LOG, CadetPeer::mqm_head, CadetPeer::mqm_ready_ptr, mqm_send_done(), CadetPeer::mqm_tail, and GCP_MessageQueueManager::next.
Referenced by destroy_direction(), GCC_destroy(), GCC_destroy_without_tunnel(), and send_broken().
void GCP_set_mq | ( | struct CadetPeer * | cp, |
struct GNUNET_MQ_Handle * | mq | ||
) |
Set the message queue to mq for peer cp and notify watchers.
cp | peer to modify |
mq | message queue to set (can be NULL) |
Definition at line 512 of file gnunet-service-cadet_peer.c.
References consider_peer_activate(), consider_peer_destroy(), CadetPeer::core_mq, GCP_2s(), GCPP_get_path_from_route(), GCT_consider_path(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_discard(), GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, LOG, mq, CadetPeer::mqm_head, CadetPeer::pid, and CadetPeer::t.
Referenced by core_connect_cb(), and core_disconnect_cb().
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.
peer | The peer that signed the monotime value. |
msg | The GNUNET_CADET_ConnectionCreateMessage with the monotime value. |
Definition at line 1531 of file gnunet-service-cadet_peer.c.
References GNUNET_break_op, GNUNET_CRYPTO_eddsa_verify, GNUNET_OK, GNUNET_SIGNATURE_PURPOSE_CADET_CONNECTION_INITIATOR, GNUNET_SYSERR, msg, CadetPeer::pid, GNUNET_PeerIdentity::public_key, GNUNET_CRYPTO_EccSignaturePurpose::purpose, and CadetConnectionCreatePS::purpose.
Referenced by handle_connection_create().
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.
If the time value is newer it will be stored at the peer.
peer | The peer we received a new time value from. |
monotime | Time value we check against the last time value we received from a peer. |
Definition at line 1508 of file gnunet-service-cadet_peer.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_NO, GNUNET_TIME_absolute_ntoh(), GNUNET_YES, and CadetPeer::last_connection_create.
Referenced by handle_connection_create().