Globals for gnunet-service-core. More...
#include "gnunet_statistics_service.h"
#include "gnunet_core_service.h"
#include "core.h"
#include "gnunet-service-core_typemap.h"
Go to the source code of this file.
Data Structures | |
struct | GSC_ClientActiveRequest |
Record kept for each request for transmission issued by a client that is still pending. More... | |
Functions | |
void | GSC_CLIENTS_solicit_request (struct GSC_ClientActiveRequest *car) |
Tell a client that we are ready to receive the message. More... | |
void | GSC_CLIENTS_reject_request (struct GSC_ClientActiveRequest *car, int drop_client) |
We will never be ready to transmit the given message in (disconnect or invalid request). More... | |
void | GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, const struct GNUNET_PeerIdentity *neighbour, const struct GSC_TypeMap *tmap_old, const struct GSC_TypeMap *tmap_new) |
Notify a particular client about a change to existing connection to one of our neighbours (check if the client is interested). More... | |
void | GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *msg, uint16_t msize, uint32_t options) |
Deliver P2P message to interested clients. More... | |
void | GSC_CLIENTS_notify_clients_about_neighbour (const struct GNUNET_PeerIdentity *neighbour, const struct GSC_TypeMap *tmap_old, const struct GSC_TypeMap *tmap_new) |
Notify all clients about a change to existing session. More... | |
Variables | |
const struct GNUNET_CONFIGURATION_Handle * | GSC_cfg |
Our configuration. More... | |
struct GNUNET_STATISTICS_Handle * | GSC_stats |
For creating statistics. More... | |
struct GNUNET_PeerIdentity | GSC_my_identity |
Our identity. More... | |
Globals for gnunet-service-core.
Definition in file gnunet-service-core.h.
void GSC_CLIENTS_solicit_request | ( | struct GSC_ClientActiveRequest * | car | ) |
Tell a client that we are ready to receive the message.
car | request that is now ready; the responsibility for the handle remains shared between CLIENTS and SESSIONS after this call. |
Definition at line 262 of file gnunet-service-core.c.
References GSC_ClientActiveRequest::client_handle, GSC_Client::connectmap, GSC_ClientActiveRequest::deadline, env, GNUNET_assert, GNUNET_CONSTANTS_LATENCY_WARN, GNUNET_CONTAINER_multipeermap_contains(), GNUNET_ERROR_TYPE_WARNING, GNUNET_i2s(), GNUNET_log, GNUNET_memcmp, GNUNET_MESSAGE_TYPE_CORE_SEND_READY, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get_duration(), GNUNET_YES, GSC_CLIENTS_reject_request(), GSC_my_identity, GSC_SESSIONS_dequeue_request(), GSC_Client::mq, GSC_ClientActiveRequest::msize, SendMessageReady::peer, GSC_ClientActiveRequest::priority, GSC_ClientActiveRequest::received_time, GNUNET_TIME_Relative::rel_value_us, SendMessageReady::size, SendMessageReady::smr_id, GSC_ClientActiveRequest::smr_id, and GSC_ClientActiveRequest::target.
Referenced by handle_client_send_request(), and solicit_messages().
void GSC_CLIENTS_reject_request | ( | struct GSC_ClientActiveRequest * | car, |
int | drop_client | ||
) |
We will never be ready to transmit the given message in (disconnect or invalid request).
Frees resources associated with car. We don't explicitly tell the client, it'll learn with the disconnect (or violated the protocol).
car | request that now permanently failed; the responsibility for the handle is now returned to CLIENTS (SESSIONS is done with it). |
drop_client | GNUNET_YES if the client violated the protocol and we should thus drop the connection |
Definition at line 240 of file gnunet-service-core.c.
References GSC_Client::client, GSC_ClientActiveRequest::client_handle, GNUNET_assert, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_free, GNUNET_SERVICE_client_drop(), GNUNET_YES, GSC_Client::requests, and GSC_ClientActiveRequest::target.
Referenced by GSC_CLIENTS_solicit_request(), GSC_SESSIONS_end(), and GSC_SESSIONS_queue_request().
void GSC_CLIENTS_notify_client_about_neighbour | ( | struct GSC_Client * | client, |
const struct GNUNET_PeerIdentity * | neighbour, | ||
const struct GSC_TypeMap * | tmap_old, | ||
const struct GSC_TypeMap * | tmap_new | ||
) |
Notify a particular client about a change to existing connection to one of our neighbours (check if the client is interested).
Called from GSC_SESSIONS_notify_client_about_sessions().
client | client to notify |
neighbour | identity of the neighbour that changed status |
tmap_old | previous type map for the neighbour, NULL for connect |
tmap_new | updated type map for the neighbour, NULL for disconnect |
Definition at line 644 of file gnunet-service-core.c.
References GSC_Client::connectmap, env, GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_NO, GNUNET_YES, GSC_Client::got_init, GSC_TYPEMAP_test_match(), GSC_Client::mq, ConnectNotifyMessage::peer, DisconnectNotifyMessage::peer, ConnectNotifyMessage::reserved, DisconnectNotifyMessage::reserved, GSC_Client::tcnt, and GSC_Client::types.
Referenced by GSC_CLIENTS_notify_clients_about_neighbour(), and notify_client_about_session().
void GSC_CLIENTS_deliver_message | ( | const struct GNUNET_PeerIdentity * | sender, |
const struct GNUNET_MessageHeader * | msg, | ||
uint16_t | msize, | ||
uint32_t | options | ||
) |
Deliver P2P message to interested clients.
Caller must have checked that the sending peer actually lists the given message type as one of its types.
sender | peer who sent us the message |
msg | the message |
msize | number of bytes to transmit |
options | options for checking which clients should receive the message |
Definition at line 752 of file gnunet-service-core.c.
References all_client_options, client_head, env, gettext_noop, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CORE_OPTION_SEND_FULL_INBOUND, GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND, GNUNET_CORE_OPTION_SEND_HDR_INBOUND, GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_u32(), GNUNET_ERROR_TYPE_BULK, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND, GNUNET_MQ_get_length(), GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_snprintf(), GNUNET_STATISTICS_update(), GNUNET_YES, GSC_SESSIONS_add_to_typemap(), GSC_stats, HARD_MAX_QUEUE, msg, GSC_Client::next, options, NotifyTrafficMessage::peer, GNUNET_MessageHeader::size, size, SOFT_MAX_QUEUE, GNUNET_MessageHeader::type, and type_match().
Referenced by deliver_message(), and tokenized_cb().
void GSC_CLIENTS_notify_clients_about_neighbour | ( | const struct GNUNET_PeerIdentity * | neighbour, |
const struct GSC_TypeMap * | tmap_old, | ||
const struct GSC_TypeMap * | tmap_new | ||
) |
Notify all clients about a change to existing session.
Called from SESSIONS whenever there is a change in sessions or types processed by the respective peer.
neighbour | identity of the neighbour that changed status |
tmap_old | previous type map for the neighbour, NULL for connect |
tmap_new | updated type map for the neighbour, NULL for disconnect |
Definition at line 725 of file gnunet-service-core.c.
References client_head, GSC_CLIENTS_notify_client_about_neighbour(), and GSC_Client::next.
Referenced by GSC_SESSIONS_add_to_typemap(), GSC_SESSIONS_create(), GSC_SESSIONS_end(), and GSC_SESSIONS_set_typemap().
|
extern |
Our configuration.
Definition at line 122 of file gnunet-service-core.c.
Referenced by GSC_KX_init(), run(), shutdown_task(), and sign_ephemeral_key().
|
extern |
For creating statistics.
Definition at line 127 of file gnunet-service-core.c.
Referenced by broadcast_my_type_map(), deliver_message(), do_decrypt(), do_encrypt(), GSC_CLIENTS_deliver_message(), GSC_SESSIONS_confirm_typemap(), GSC_SESSIONS_create(), GSC_SESSIONS_end(), GSC_TYPEMAP_get_from_message(), handle_client_send(), handle_client_send_request(), handle_encrypted(), handle_ephemeral_key(), handle_ping(), handle_pong(), handle_transport_notify_connect(), handle_transport_notify_disconnect(), run(), send_keep_alive(), send_ping(), shutdown_task(), tokenized_cb(), transmit_typemap_task(), and try_transmission().
|
extern |
Our identity.
Definition at line 117 of file gnunet-service-core.c.
Referenced by derive_session_keys(), GSC_CLIENTS_solicit_request(), GSC_KX_init(), GSC_SESSIONS_add_to_typemap(), GSC_SESSIONS_dequeue_request(), handle_client_init(), handle_client_send_request(), handle_encrypted(), handle_ping(), handle_pong(), handle_transport_notify_connect(), run(), sign_ephemeral_key(), and tokenized_cb().