#include "gnunet-service-messenger_message_send.h"
#include "gnunet-service-messenger_handle.h"
#include "gnunet-service-messenger_member.h"
#include "gnunet-service-messenger_member_session.h"
#include "gnunet-service-messenger_message_kind.h"
#include "gnunet-service-messenger_operation.h"
#include "gnunet-service-messenger_room.h"
#include "gnunet_common.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_MESSENGER_MemberNotify |
Functions | |
static void | notify_about_members (struct GNUNET_MESSENGER_MemberNotify *notify, struct GNUNET_MESSENGER_MemberSession *session, struct GNUNET_CONTAINER_MultiHashMap *map, enum GNUNET_GenericReturnValue check_permission) |
static enum GNUNET_GenericReturnValue | iterate_notify_about_members (void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session) |
void | send_message_join (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a sent join message to ensure growth of the decentralized room structure. More... | |
void | send_message_key (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a sent key message to ensure changes to the public key of the sending handle. More... | |
void | send_message_peer (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a sent peer message to update the rooms peer message of this service. More... | |
void | send_message_id (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a sent id message to update the handles member id in the room. More... | |
void | send_message_request (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Handles a sent request message to trigger the request operation for this service. More... | |
|
static |
Definition at line 44 of file gnunet-service-messenger_message_send.c.
References check_member_session_history(), get_member_session_id(), get_srv_room_message_store(), get_store_message(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_sh2s(), GNUNET_YES, GNUNET_MESSENGER_MemberNotify::handle, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, is_peer_message(), map, GNUNET_MESSENGER_SenderSession::member, GNUNET_MESSENGER_MemberSession::messages, GNUNET_MESSENGER_ListMessage::next, notify_about_members(), notify_srv_handle_message(), GNUNET_MESSENGER_MemberSession::prev, GNUNET_MESSENGER_MemberNotify::room, and GNUNET_MESSENGER_MemberNotify::session.
Referenced by iterate_notify_about_members(), and notify_about_members().
|
static |
Definition at line 110 of file gnunet-service-messenger_message_send.c.
References get_member_session_id(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_sh2s(), GNUNET_YES, is_member_session_completed(), map, notify_about_members(), and GNUNET_MESSENGER_MemberNotify::session.
Referenced by send_message_join().
void send_message_join | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a sent join message to ensure growth of the decentralized room structure.
(if the service provides a peer message for this room currently, it will be forwarded)
[in,out] | room | Room of the message |
[in,out] | handle | Sending handle |
[in] | message | JOIN-Message |
[in] | hash | Hash of the message |
Definition at line 143 of file gnunet-service-messenger_message_send.c.
References add_store_member(), GNUNET_MESSENGER_Message::body, check_srv_room_peer_status(), get_member_session_id(), get_member_session_of(), get_srv_room_member_store(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_sh2s(), handle, GNUNET_MESSENGER_MemberNotify::handle, GNUNET_MESSENGER_Message::header, iterate_notify_about_members(), iterate_store_members(), GNUNET_MESSENGER_MessageBody::join, GNUNET_MESSENGER_MessageJoin::key, GNUNET_MESSENGER_MemberSession::member, GNUNET_MESSENGER_MemberNotify::room, GNUNET_MESSENGER_MessageHeader::sender_id, GNUNET_MESSENGER_MemberNotify::session, and set_srv_handle_key().
Referenced by send_srv_room_message().
void send_message_key | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a sent key message to ensure changes to the public key of the sending handle.
[in,out] | room | Room of the message |
[in,out] | handle | Sending handle |
[in] | message | KEY-Message |
[in] | hash | Hash of the message |
Definition at line 196 of file gnunet-service-messenger_message_send.c.
References GNUNET_MESSENGER_Message::body, handle, GNUNET_MESSENGER_MessageKey::key, GNUNET_MESSENGER_MessageBody::key, and set_srv_handle_key().
Referenced by send_srv_room_message().
void send_message_peer | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a sent peer message to update the rooms peer message of this service.
(a set peer message indicates this service being a part of the decentralized room structure)
[in,out] | room | Room of the message |
[in,out] | handle | Sending handle |
[in] | message | PEER-Message |
[in] | hash | Hash of the message |
Definition at line 206 of file gnunet-service-messenger_message_send.c.
References create_message_connection(), GNUNET_memcpy, GNUNET_new, GNUNET_MESSENGER_SrvRoom::host, GNUNET_MESSENGER_SrvRoom::peer_message, GNUNET_MESSENGER_MemberNotify::room, and send_srv_room_message().
Referenced by send_srv_room_message().
void send_message_id | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a sent id message to update the handles member id in the room.
(changing member id is useful to prevent collisions)
[in,out] | room | Room of the message |
[in,out] | handle | Sending handle |
[in] | message | ID-Message |
[in] | hash | Hash of the message |
Definition at line 221 of file gnunet-service-messenger_message_send.c.
References GNUNET_MESSENGER_Message::body, change_srv_handle_member_id(), get_srv_room_key(), handle, GNUNET_MESSENGER_MessageId::id, GNUNET_MESSENGER_MessageBody::id, and GNUNET_MESSENGER_MemberNotify::room.
Referenced by send_srv_room_message().
void send_message_request | ( | struct GNUNET_MESSENGER_SrvRoom * | room, |
struct GNUNET_MESSENGER_SrvHandle * | handle, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Handles a sent request message to trigger the request operation for this service.
(the request operation will deactivate the possibility of spamming requests)
[in,out] | room | Room of the message |
[in,out] | handle | Sending handle |
[in] | message | REQUEST-Message |
[in] | hash | Hash of the message |
Definition at line 232 of file gnunet-service-messenger_message_send.c.
References GNUNET_MESSENGER_Message::body, get_srv_room_operation_store(), GNUNET_MESSENGER_OP_REQUEST, GNUNET_MESSENGER_REQUEST_DELAY, GNUNET_MESSENGER_MessageRequest::hash, GNUNET_MESSENGER_MessageBody::request, GNUNET_MESSENGER_OperationStore::room, and use_store_operation().
Referenced by send_srv_room_message().