Go to the source code of this file.
Functions | |
void | GSC_SESSIONS_create (const struct GNUNET_PeerIdentity *peer, struct GSC_KeyExchangeInfo *kx) |
Create a session, a key exchange was just completed. More... | |
void | GSC_SESSIONS_reinit (const struct GNUNET_PeerIdentity *peer) |
The other peer has indicated that it 'lost' the session (KX down), reinitialize the session on our end, in particular this means to restart the typemap transmission. More... | |
void | GSC_SESSIONS_confirm_typemap (const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *msg) |
The other peer has confirmed receiving our type map, check if it is current and if so, stop retransmitting it. More... | |
void | GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid) |
End the session with the given peer (we are no longer connected). More... | |
void | GSC_SESSIONS_solicit (const struct GNUNET_PeerIdentity *pid) |
Traffic is being solicited for the given peer. More... | |
void | GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car) |
Queue a request from a client for transmission to a particular peer. More... | |
void | GSC_SESSIONS_dequeue_request (struct GSC_ClientActiveRequest *car) |
Dequeue a request from a client from transmission to a particular peer. More... | |
void | GSC_SESSIONS_transmit (struct GSC_ClientActiveRequest *car, const struct GNUNET_MessageHeader *msg, enum GNUNET_MQ_PriorityPreferences priority) |
Transmit a message to a particular peer. More... | |
void | GSC_SESSIONS_broadcast_typemap (const struct GNUNET_MessageHeader *msg) |
Broadcast an updated typemap message to all neighbours. More... | |
void | GSC_SESSIONS_notify_client_about_sessions (struct GSC_Client *client) |
We have a new client, notify it about all current sessions. More... | |
void | GSC_SESSIONS_set_typemap (const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *msg) |
We've received a typemap message from a peer, update ours. More... | |
void | GSC_SESSIONS_add_to_typemap (const struct GNUNET_PeerIdentity *peer, uint16_t type) |
The given peer send a message of the specified type. More... | |
void | GSC_SESSIONS_init (void) |
Initialize sessions subsystem. More... | |
void | GSC_SESSIONS_done (void) |
Shutdown sessions subsystem. More... | |
void GSC_SESSIONS_create | ( | const struct GNUNET_PeerIdentity * | peer, |
struct GSC_KeyExchangeInfo * | kx | ||
) |
Create a session, a key exchange was just completed.
peer | peer that is now connected |
kx | key exchange that completed |
Definition at line 318 of file gnunet-service-core_sessions.c.
References gettext_noop, GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_set(), GSC_CLIENTS_notify_clients_about_neighbour(), GSC_stats, GSC_TYPEMAP_create(), Session::kx, Session::peer, sessions, start_typemap_task(), and Session::tmap.
Referenced by handle_pong().
void GSC_SESSIONS_reinit | ( | const struct GNUNET_PeerIdentity * | peer | ) |
The other peer has indicated that it 'lost' the session (KX down), reinitialize the session on our end, in particular this means to restart the typemap transmission.
peer | peer that is now connected |
Definition at line 353 of file gnunet-service-core_sessions.c.
References find_session(), Session::peer, and start_typemap_task().
Referenced by handle_ephemeral_key().
void GSC_SESSIONS_confirm_typemap | ( | const struct GNUNET_PeerIdentity * | peer, |
const struct GNUNET_MessageHeader * | msg | ||
) |
The other peer has confirmed receiving our type map, check if it is current and if so, stop retransmitting it.
peer | peer that confirmed the type map |
msg | confirmation message we received |
Definition at line 376 of file gnunet-service-core_sessions.c.
References find_session(), gettext_noop, GNUNET_break, GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_update(), GNUNET_YES, GSC_stats, GSC_TYPEMAP_check_hash(), msg, Session::peer, GNUNET_MessageHeader::size, TypeMapConfirmationMessage::tm_hash, and Session::typemap_task.
Referenced by deliver_message().
void GSC_SESSIONS_end | ( | const struct GNUNET_PeerIdentity * | pid | ) |
End the session with the given peer (we are no longer connected).
pid | identity of peer to kill session with |
Definition at line 211 of file gnunet-service-core_sessions.c.
References Session::active_client_request_head, Session::active_client_request_tail, Session::cork_task, find_session(), gettext_noop, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_set(), GNUNET_YES, GSC_CLIENTS_notify_clients_about_neighbour(), GSC_CLIENTS_reject_request(), GSC_stats, GSC_TYPEMAP_destroy(), Session::peer, pid, sessions, Session::sme_head, Session::sme_tail, Session::tmap, and Session::typemap_task.
Referenced by free_session_helper(), handle_encrypted(), handle_transport_notify_disconnect(), and send_keep_alive().
void GSC_SESSIONS_solicit | ( | const struct GNUNET_PeerIdentity * | pid | ) |
Traffic is being solicited for the given peer.
This means that the message queue on the transport-level (NEIGHBOURS subsystem) is now empty and it is now OK to transmit another (non-control) message.
pid | identity of peer ready to receive data |
Definition at line 844 of file gnunet-service-core_sessions.c.
References find_session(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, pid, and try_transmission().
void GSC_SESSIONS_queue_request | ( | struct GSC_ClientActiveRequest * | car | ) |
Queue a request from a client for transmission to a particular peer.
car | request to queue; this handle is then shared between the caller (CLIENTS subsystem) and SESSIONS and must not be released by either until either 'GNUNET_SESSIONS_dequeue', or 'GNUNET_CLIENTS_failed' have been invoked on it |
car | request to queue; this handle is then shared between the caller (CLIENTS subsystem) and SESSIONS and must not be released by either until either #GSC_SESSIONS_dequeue(), GSC_SESSIONS_transmit() or #GSC_CLIENTS_failed() have been invoked on it |
Definition at line 483 of file gnunet-service-core_sessions.c.
References Session::active_client_request_head, Session::active_client_request_tail, find_session(), GNUNET_break, GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_YES, GSC_CLIENTS_reject_request(), GSC_ClientActiveRequest::msize, GSC_ClientActiveRequest::target, and try_transmission().
Referenced by handle_client_send_request().
void GSC_SESSIONS_dequeue_request | ( | struct GSC_ClientActiveRequest * | car | ) |
Dequeue a request from a client from transmission to a particular peer.
car | request to dequeue; this handle will then be 'owned' by the caller (CLIENTS sysbsystem) |
Definition at line 518 of file gnunet-service-core_sessions.c.
References Session::active_client_request_head, Session::active_client_request_tail, find_session(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GSC_my_identity, GSC_ClientActiveRequest::target, and try_transmission().
Referenced by destroy_active_client_request(), GSC_CLIENTS_solicit_request(), handle_client_send(), and handle_client_send_request().
void GSC_SESSIONS_transmit | ( | struct GSC_ClientActiveRequest * | car, |
const struct GNUNET_MessageHeader * | msg, | ||
enum GNUNET_MQ_PriorityPreferences | priority | ||
) |
Transmit a message to a particular peer.
car | original request that was queued and then solicited, ownership does not change (dequeue will be called soon). |
msg | message to transmit |
priority | how important is this message |
Definition at line 859 of file gnunet-service-core_sessions.c.
References SessionMessageEntry::deadline, find_session(), GNUNET_CONSTANTS_MAX_CORK_DELAY, GNUNET_CONTAINER_DLL_insert_after, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_MQ_PREF_CORK_ALLOWED, GNUNET_TIME_relative_to_absolute(), msg, SessionMessageEntry::next, SessionMessageEntry::prev, SessionMessageEntry::priority, GNUNET_MessageHeader::size, SessionMessageEntry::size, Session::sme_head, Session::sme_tail, GSC_ClientActiveRequest::target, and try_transmission().
Referenced by tokenized_cb().
void GSC_SESSIONS_broadcast_typemap | ( | const struct GNUNET_MessageHeader * | msg | ) |
Broadcast an updated typemap message to all neighbours.
Restarts the retransmissions until the typemaps are confirmed.
msg | message to transmit |
Definition at line 826 of file gnunet-service-core_sessions.c.
References do_restart_typemap_message(), GNUNET_CONTAINER_multipeermap_iterate(), msg, and sessions.
Referenced by broadcast_my_type_map().
void GSC_SESSIONS_notify_client_about_sessions | ( | struct GSC_Client * | client | ) |
We have a new client, notify it about all current sessions.
client | the new client |
Definition at line 454 of file gnunet-service-core_sessions.c.
References GNUNET_CONTAINER_multipeermap_iterate(), notify_client_about_session(), and sessions.
Referenced by handle_client_init().
void GSC_SESSIONS_set_typemap | ( | const struct GNUNET_PeerIdentity * | peer, |
const struct GNUNET_MessageHeader * | msg | ||
) |
We've received a typemap message from a peer, update ours.
Notifies clients about the session.
peer | peer this is about |
msg | typemap update message |
Definition at line 900 of file gnunet-service-core_sessions.c.
References SessionMessageEntry::deadline, find_session(), GNUNET_break, GNUNET_break_op, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_MESSAGE_TYPE_CORE_CONFIRM_TYPE_MAP, GNUNET_MQ_PRIO_CRITICAL_CONTROL, GNUNET_TIME_absolute_get(), GNUNET_YES, GSC_CLIENTS_notify_clients_about_neighbour(), GSC_TYPEMAP_destroy(), GSC_TYPEMAP_get_from_message(), GSC_TYPEMAP_hash(), TypeMapConfirmationMessage::header, SessionMessageEntry::is_typemap_confirm, msg, SessionMessageEntry::next, Session::peer, SessionMessageEntry::priority, TypeMapConfirmationMessage::reserved, GNUNET_MessageHeader::size, SessionMessageEntry::size, Session::sme_head, Session::sme_tail, TypeMapConfirmationMessage::tm_hash, Session::tmap, try_transmission(), and GNUNET_MessageHeader::type.
Referenced by deliver_message().
void GSC_SESSIONS_add_to_typemap | ( | const struct GNUNET_PeerIdentity * | peer, |
uint16_t | type | ||
) |
The given peer send a message of the specified type.
Make sure the respective bit is set in its type-map and that clients are notified about the session.
peer | peer this is about |
type | type of the message |
Definition at line 961 of file gnunet-service-core_sessions.c.
References find_session(), GNUNET_assert, GNUNET_YES, GSC_CLIENTS_notify_clients_about_neighbour(), GSC_my_identity, GSC_TYPEMAP_destroy(), GSC_TYPEMAP_extend(), GSC_TYPEMAP_test_match(), Session::tmap, and type.
Referenced by GSC_CLIENTS_deliver_message().
void GSC_SESSIONS_init | ( | void | ) |
Initialize sessions subsystem.
Definition at line 984 of file gnunet-service-core_sessions.c.
References GNUNET_CONTAINER_multipeermap_create(), GNUNET_YES, and sessions.
Referenced by run().
void GSC_SESSIONS_done | ( | void | ) |
Shutdown sessions subsystem.
Definition at line 1015 of file gnunet-service-core_sessions.c.
References free_session_helper(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), and sessions.
Referenced by shutdown_task().