code for managing the key exchange (SET_KEY, PING, PONG) with other peers More...
Go to the source code of this file.
Data Structures | |
struct | InitiatorHelloPayload |
struct | InitiatorHello |
TODO. More... | |
struct | ConfirmationAck |
The ACK. More... | |
struct | ResponderHello |
ResponderHello. More... | |
struct | ResponderHelloPayload |
struct | InitiatorDone |
InitiatorDone. More... | |
struct | EncryptedMessage |
EncryptedMessage. More... | |
struct | Heartbeat |
KeyUpdate. More... | |
Enumerations | |
enum | HeartbeatFlags { GSC_HEARTBEAT_KEY_UPDATE_REQUESTED = 1 } |
Heartbeat flags. More... | |
Functions | |
void | GSC_KX_encrypt_and_transmit (struct GSC_KeyExchangeInfo *kx, const void *payload, size_t payload_size) |
Encrypt and transmit a message with the given payload. | |
int | GSC_KX_init (void) |
Initialize KX subsystem. | |
void | GSC_KX_done (void) |
Shutdown KX subsystem. | |
int | GSC_NEIGHBOURS_check_excess_bandwidth (const struct GSC_KeyExchangeInfo *target) |
Check if the given neighbour has excess bandwidth available. | |
unsigned int | GSC_NEIGHBOURS_get_queue_length (const struct GSC_KeyExchangeInfo *target) |
Check how many messages are queued for the given neighbour. | |
void | GSC_KX_handle_client_monitor_peers (struct GNUNET_MQ_Handle *mq) |
Handle GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS request. | |
code for managing the key exchange (SET_KEY, PING, PONG) with other peers
Definition in file gnunet-service-core_kx.h.
enum HeartbeatFlags |
Heartbeat flags.
Enumerator | |
---|---|
GSC_HEARTBEAT_KEY_UPDATE_REQUESTED | A key update is requested. |
Definition at line 225 of file gnunet-service-core_kx.h.
void GSC_KX_encrypt_and_transmit | ( | struct GSC_KeyExchangeInfo * | kx, |
const void * | payload, | ||
size_t | payload_size | ||
) |
Encrypt and transmit a message with the given payload.
kx | key exchange context |
payload | payload of the message |
payload_size | number of bytes in 'payload' |
Encrypt and transmit a message with the given payload.
kx | key exchange info |
payload | the payload |
payload_size | size of the payload |
Definition at line 2741 of file gnunet-service-core_kx.c.
References AEAD_KEY_BYTES, AEAD_NONCE_BYTES, check_rekey(), GSC_KeyExchangeInfo::current_ats, GSC_KeyExchangeInfo::current_epoch, GSC_KeyExchangeInfo::current_sqn, derive_per_message_secrets(), derive_sn(), env, EncryptedMessage::epoch, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_htonll(), GNUNET_log, GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE_CAKE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NO, GNUNET_print_bytes(), GSC_KeyExchangeInfo::mq, payload, ret, EncryptedMessage::sequence_number, and EncryptedMessage::tag.
Referenced by handle_heartbeat(), handle_initiator_done(), send_heartbeat(), and try_transmission().
int GSC_KX_init | ( | void | ) |
Initialize KX subsystem.
Definition at line 2865 of file gnunet-service-core_kx.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE_CAKE, GNUNET_MESSAGE_TYPE_CORE_INITIATOR_DONE, GNUNET_MESSAGE_TYPE_CORE_INITIATOR_HELLO, GNUNET_MESSAGE_TYPE_CORE_RESPONDER_HELLO, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_notification_context_create(), GNUNET_OK, GNUNET_PILS_connect(), GNUNET_SYSERR, GNUNET_TRANSPORT_core_connect(), GNUNET_YES, GSC_cfg, GSC_KX_done(), GSC_my_identity, handle_transport_notify_connect(), handle_transport_notify_disconnect(), handlers, init_phase, nc, peer_id_change_cb(), pils, and transport.
Referenced by run().
void GSC_KX_done | ( | void | ) |
Shutdown KX subsystem.
Definition at line 2928 of file gnunet-service-core_kx.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_notification_context_destroy(), GNUNET_PILS_cancel(), GNUNET_PILS_disconnect(), GNUNET_SCHEDULER_cancel(), GNUNET_TRANSPORT_core_disconnect(), nc, PilsRequest::op, pils, pils_requests_head, pils_requests_tail, rekey_task, and transport.
Referenced by GSC_KX_init(), and shutdown_task().
int GSC_NEIGHBOURS_check_excess_bandwidth | ( | const struct GSC_KeyExchangeInfo * | target | ) |
Check if the given neighbour has excess bandwidth available.
target | neighbour to check |
Definition at line 2977 of file gnunet-service-core_kx.c.
References GSC_KeyExchangeInfo::has_excess_bandwidth.
Referenced by try_transmission().
unsigned int GSC_NEIGHBOURS_get_queue_length | ( | const struct GSC_KeyExchangeInfo * | kxinfo | ) |
Check how many messages are queued for the given neighbour.
target | neighbour to check |
kxinfo | data about neighbour to check |
Definition at line 2970 of file gnunet-service-core_kx.c.
References GNUNET_MQ_get_length(), and GSC_KeyExchangeInfo::mq.
Referenced by try_transmission().
void GSC_KX_handle_client_monitor_peers | ( | struct GNUNET_MQ_Handle * | mq | ) |
Handle GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS request.
For this request type, the client does not have to have transmitted an INIT request. All current peers are returned, regardless of which message types they accept.
mq | message queue to add for monitoring |
Definition at line 2992 of file gnunet-service-core_kx.c.
References env, GNUNET_CORE_KX_ITERATION_FINISHED, GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_notification_context_add(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_UNIT_FOREVER_ABS, kx_head, mq, msg, nc, GSC_KeyExchangeInfo::next, GSC_KeyExchangeInfo::peer, MonitorNotifyMessage::state, GSC_KeyExchangeInfo::status, MonitorNotifyMessage::timeout, and GSC_KeyExchangeInfo::timeout.
Referenced by handle_client_monitor_peers().