Go to the source code of this file.
Functions | |
void | GSC_SESSIONS_create (const struct GNUNET_PeerIdentity *peer, struct GSC_KeyExchangeInfo *kx, enum GNUNET_CORE_PeerClass class) |
Create a session, a key exchange was just completed. | |
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. | |
void | GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid) |
End the session with the given peer (we are no longer connected). | |
void | GSC_SESSIONS_solicit (const struct GNUNET_PeerIdentity *pid) |
Traffic is being solicited for the given peer. | |
void | GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car) |
Queue a request from a client for transmission to a particular peer. | |
void | GSC_SESSIONS_dequeue_request (struct GSC_ClientActiveRequest *car) |
Dequeue a request from a client from transmission to a particular peer. | |
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. | |
void | GSC_SESSIONS_notify_client_about_sessions (struct GSC_Client *client) |
We have a new client, notify it about all current sessions. | |
void | GSC_SESSIONS_init (void) |
Initialize sessions subsystem. | |
void | GSC_SESSIONS_done (void) |
Shutdown sessions subsystem. | |
void GSC_SESSIONS_create | ( | const struct GNUNET_PeerIdentity * | peer, |
struct GSC_KeyExchangeInfo * | kx, | ||
enum GNUNET_CORE_PeerClass | class | ||
) |
Create a session, a key exchange was just completed.
peer | peer that is now connected |
kx | key exchange that completed |
peer | peer that is now connected |
kx | key exchange that completed |
class | the class of the now connected peer |
Definition at line 219 of file gnunet-service-core_sessions.c.
References Session::class, 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, Session::kx, Session::peer, and sessions.
Referenced by check_if_ack_or_heartbeat(), and handle_initiator_done().
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.
XXX the typemap does not exist anymore
peer | peer that is now connected |
XXX typemap does not exist anymore
peer | peer that is now connected |
Definition at line 259 of file gnunet-service-core_sessions.c.
References find_session(), and Session::peer.
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 159 of file gnunet-service-core_sessions.c.
References Session::active_client_request_head, Session::active_client_request_tail, Session::class, 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, Session::peer, pid, sessions, Session::sme_head, and Session::sme_tail.
Referenced by free_session_helper(), handle_encrypted_message(), handle_transport_notify_disconnect(), and send_heartbeat().
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 632 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 334 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 369 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 647 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_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 305 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_init | ( | void | ) |
Initialize sessions subsystem.
Definition at line 691 of file gnunet-service-core_sessions.c.
References GNUNET_CONTAINER_multipeermap_create(), GNUNET_YES, and sessions.
Referenced by GSC_complete_initialization_cb().
void GSC_SESSIONS_done | ( | void | ) |
Shutdown sessions subsystem.
Definition at line 722 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().