#include "messenger_api_room.h"
#include "gnunet_common.h"
#include "gnunet_messenger_service.h"
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
#include "gnunet_util_lib.h"
#include "messenger_api.h"
#include "messenger_api_contact_store.h"
#include "messenger_api_epoch.h"
#include "messenger_api_epoch_announcement.h"
#include "messenger_api_epoch_group.h"
#include "messenger_api_handle.h"
#include "messenger_api_message.h"
#include "messenger_api_message_control.h"
#include "messenger_api_message_kind.h"
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | GNUNET_MESSENGER_RoomCancelAction |
struct | GNUNET_MESSENGER_MemberCall |
struct | GNUNET_MESSENGER_MemberFind |
struct | GNUNET_MESSENGER_RoomLinkDeletionInfo |
Functions | |
struct GNUNET_MESSENGER_Room * | create_room (struct GNUNET_MESSENGER_Handle *handle, const union GNUNET_MESSENGER_RoomKey *key) |
Creates and allocates a new room for a handle with a given key for the client API. | |
static enum GNUNET_GenericReturnValue | iterate_destroy_action (void *cls, const struct GNUNET_HashCode *key, void *value) |
static enum GNUNET_GenericReturnValue | iterate_destroy_message (void *cls, const struct GNUNET_HashCode *key, void *value) |
static enum GNUNET_GenericReturnValue | iterate_destroy_link (void *cls, const struct GNUNET_HashCode *key, void *value) |
static enum GNUNET_GenericReturnValue | iterate_destroy_subscription (void *cls, const struct GNUNET_ShortHashCode *key, void *value) |
static enum GNUNET_GenericReturnValue | iterate_destroy_epoch (void *cls, const struct GNUNET_HashCode *key, void *value) |
void | destroy_room (struct GNUNET_MESSENGER_Room *room) |
Destroys a room and frees its memory fully from the client API. | |
const struct GNUNET_HashCode * | get_room_key (const struct GNUNET_MESSENGER_Room *room) |
Return a the hash representation of a given room. | |
enum GNUNET_GenericReturnValue | is_room_public (const struct GNUNET_MESSENGER_Room *room) |
Returns whether a given room is public or using epoch keys to encrypt private traffic and sync those keys automatically. | |
static enum GNUNET_GenericReturnValue | is_message_entry_recent (const struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static struct GNUNET_MESSENGER_Epoch * | get_room_availble_epoch_entry (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry, const struct GNUNET_MESSENGER_Contact *contact) |
static void | handle_room_delayed_deletion (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_room_delayed_announcement (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_room_delayed_appeal (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_room_delayed_action (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
static void | handle_room_action_task (void *cls) |
void | delay_room_action (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay) |
Enqueues delayed handling of a message in a room under a given hash once a specific delay has timed out. | |
void | cancel_room_action (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Cancels the delayed handling of a message in a room under a given hash in case it has been queued using the function delay_room_action() before and the action has not been fully processed yet. | |
static enum GNUNET_GenericReturnValue | iterate_cancel_action_by (void *cls, const struct GNUNET_HashCode *hash, void *value) |
static enum GNUNET_GenericReturnValue | iterate_cancel_action (void *cls, const struct GNUNET_HashCode *hash, void *value) |
void | cancel_room_actions_by (struct GNUNET_MESSENGER_Room *room, enum GNUNET_MESSENGER_MessageKind kind, const struct GNUNET_HashCode *epoch_hash, const union GNUNET_MESSENGER_EpochIdentifier *identifier, const struct GNUNET_MESSENGER_Contact *contact) |
Searches queued actions to handle messages of a specific message kind in a room with any delay and cancels them using the function cancel_room_action() . | |
enum GNUNET_GenericReturnValue | is_room_available (const struct GNUNET_MESSENGER_Room *room) |
Checks whether a room is available to send messages. | |
struct GNUNET_MESSENGER_Handle * | get_room_handle (struct GNUNET_MESSENGER_Room *room) |
Returns the messenger handle of the room. | |
const struct GNUNET_ShortHashCode * | get_room_sender_id (const struct GNUNET_MESSENGER_Room *room) |
Returns the member id of the room's sender. | |
void | set_room_sender_id (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_ShortHashCode *id) |
Sets the member id of the room's sender to a specific id or NULL. | |
struct GNUNET_MESSENGER_Epoch * | get_room_epoch (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue recent) |
Returns the epoch in a given room from a specific epoch hash that represents the exact message the epoch starts. | |
void | generate_room_epoch_announcement (struct GNUNET_MESSENGER_Room *room, struct GNUNET_MESSENGER_Epoch *epoch, struct GNUNET_MESSENGER_EpochAnnouncement **announcement) |
Generate a new announcement for a given epoch in a room under a random and unique announcement identifier. | |
struct GNUNET_MESSENGER_Epoch * | get_room_message_epoch (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Returns the epoch of a local message with a given hash in a room. | |
const union GNUNET_MESSENGER_EpochIdentifier * | get_room_message_epoch_identifier (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Returns the epoch identifier a local message with a given hash is targeting in a room with its specific operation. | |
const struct GNUNET_MESSENGER_Message * | get_room_message (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Returns a message locally stored from a map for a given hash in a room. | |
enum GNUNET_GenericReturnValue | is_room_message_sent (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Returns whether a message is sent by the handle of the given room itself or another client that is using the same unique key to sign its sent messages. | |
struct GNUNET_MESSENGER_Contact * | get_room_sender (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Returns a messages sender locally stored from a map for a given hash in a room. | |
struct GNUNET_MESSENGER_Contact * | get_room_recipient (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Returns a messages recipient locally stored from a map for a given hash in a room. | |
const struct GNUNET_HashCode * | get_room_epoch_hash (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Returns the messages epoch hash that is locally stored for a message of a given hash in a room. | |
void | delete_room_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay) |
Deletes a message with a given hash inside a room under a specific delay. | |
void | callback_room_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Executes the message callback for a given hash in a room. | |
static enum GNUNET_GenericReturnValue | is_epoch_identifier_upper (const union GNUNET_MESSENGER_EpochIdentifier *identifier, const union GNUNET_MESSENGER_EpochIdentifier *other) |
static enum GNUNET_GenericReturnValue | iterate_room_request (void *cls, const struct GNUNET_HashCode *key, void *value) |
static void | handle_room_request_task (void *cls) |
void | require_message_from_room (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Requires a specific message in a given room which can be identified by its hash. | |
static void | handle_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_join_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static enum GNUNET_GenericReturnValue | iterate_room_epoch_member_invalidation (void *cls, const struct GNUNET_HashCode *key, void *value) |
static void | handle_leave_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_name_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_key_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_id_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_miss_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_merge_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_private_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_delete_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_transcript_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_announcement_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_secret_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_appeal_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_access_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_revolution_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_group_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
static void | handle_authorization_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry) |
void | handle_room_message (struct GNUNET_MESSENGER_Room *room, struct GNUNET_MESSENGER_Contact *sender, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *epoch, enum GNUNET_MESSENGER_MessageFlags flags) |
Handles a message with a given hash in a room for the client API to update members and its information. | |
enum GNUNET_GenericReturnValue | update_room_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash) |
Updates any message with a given hash in a room for the client API to force handling the message again after some changes that might affect it. | |
enum GNUNET_GenericReturnValue | update_room_secret_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_SymmetricSessionKey *key, enum GNUNET_GenericReturnValue update) |
Updates a secret message with a given hash in a room for the client API trying to decrypt it with the given epoch key from an epoch announcement. | |
void | update_room_last_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *epoch) |
Updates the last message hash and its epoch of a room for the client API so that new messages can point to the latest message hash while sending. | |
void | copy_room_last_message (const struct GNUNET_MESSENGER_Room *room, struct GNUNET_HashCode *hash) |
Copies the last message hash of a room into a given hash variable. | |
static enum GNUNET_GenericReturnValue | iterate_local_members (void *cls, const struct GNUNET_ShortHashCode *key, void *value) |
int | iterate_room_members (struct GNUNET_MESSENGER_Room *room, GNUNET_MESSENGER_MemberCallback callback, void *cls) |
Iterates through all members of a given room to forward each of them to a selected callback with a custom closure. | |
static enum GNUNET_GenericReturnValue | iterate_find_member (void *cls, const struct GNUNET_ShortHashCode *key, void *value) |
enum GNUNET_GenericReturnValue | find_room_member (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *contact) |
Checks through all members of a given room if a specific contact is found and returns a result depending on that. | |
static enum GNUNET_GenericReturnValue | find_linked_hash (void *cls, const struct GNUNET_HashCode *key, void *value) |
void | link_room_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *other) |
Links a message identified by its hash inside a given room with another message identified by its other hash. | |
static enum GNUNET_GenericReturnValue | clear_linked_hash (void *cls, const struct GNUNET_HashCode *key, void *value) |
static enum GNUNET_GenericReturnValue | delete_linked_hash (void *cls, const struct GNUNET_HashCode *key, void *value) |
void | link_room_deletion (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay, GNUNET_MESSENGER_RoomLinkDeletion deletion) |
Delete all remaining links to a certain message identified by its hash inside a given room and cause a deletion process to all of the linked messages. | |
struct GNUNET_MESSENGER_Room * create_room | ( | struct GNUNET_MESSENGER_Handle * | handle, |
const union GNUNET_MESSENGER_RoomKey * | key | ||
) |
Creates and allocates a new room for a handle with a given key for the client API.
[in,out] | handle | Handle |
[in] | key | Key of room |
Definition at line 48 of file messenger_api_room.c.
References GNUNET_MESSENGER_Room::actions, GNUNET_MESSENGER_Room::control, create_message_control(), GNUNET_MESSENGER_Room::entries, GNUNET_MESSENGER_Room::epochs, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multishortmap_create(), GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_YES, handle, GNUNET_MESSENGER_Room::handle, init_list_tunnels(), init_queue_messages(), GNUNET_MESSENGER_Room::joined, key, GNUNET_MESSENGER_Room::key, GNUNET_MESSENGER_Room::last_epoch, GNUNET_MESSENGER_Room::last_message, GNUNET_MESSENGER_Room::links, GNUNET_MESSENGER_Room::members, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_Room::opened, GNUNET_MESSENGER_Room::queue, GNUNET_MESSENGER_Room::queue_task, GNUNET_MESSENGER_Room::request_task, GNUNET_MESSENGER_Room::requests, GNUNET_MESSENGER_Room::sender_id, GNUNET_MESSENGER_Room::subscriptions, GNUNET_MESSENGER_Room::use_handle_name, and GNUNET_MESSENGER_Room::wait_for_sync.
Referenced by GNUNET_MESSENGER_enter_room(), and GNUNET_MESSENGER_open_room().
|
static |
Definition at line 93 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_free, GNUNET_SCHEDULER_cancel(), GNUNET_YES, and value.
Referenced by cancel_room_action(), and destroy_room().
|
static |
Definition at line 112 of file messenger_api_room.c.
References destroy_message(), GNUNET_assert, GNUNET_free, GNUNET_YES, GNUNET_MESSENGER_RoomMessageEntry::message, and value.
Referenced by destroy_room().
|
static |
Definition at line 129 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_free, GNUNET_YES, and value.
Referenced by destroy_room().
|
static |
Definition at line 145 of file messenger_api_room.c.
References destroy_message(), GNUNET_assert, GNUNET_free, GNUNET_SCHEDULER_cancel(), GNUNET_YES, GNUNET_MESSENGER_RoomSubscription::message, GNUNET_MESSENGER_RoomSubscription::task, and value.
Referenced by destroy_room().
|
static |
Definition at line 167 of file messenger_api_room.c.
References destroy_epoch(), GNUNET_assert, GNUNET_YES, and value.
Referenced by destroy_room().
void destroy_room | ( | struct GNUNET_MESSENGER_Room * | room | ) |
Destroys a room and frees its memory fully from the client API.
[in,out] | room | Room |
Definition at line 183 of file messenger_api_room.c.
References GNUNET_MESSENGER_Room::actions, clear_list_tunnels(), clear_queue_messages(), GNUNET_MESSENGER_Room::control, destroy_message_control(), GNUNET_MESSENGER_Room::entries, GNUNET_MESSENGER_Room::epochs, GNUNET_assert, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_free, GNUNET_SCHEDULER_cancel(), iterate_destroy_action(), iterate_destroy_epoch(), iterate_destroy_link(), iterate_destroy_message(), iterate_destroy_subscription(), GNUNET_MESSENGER_Room::links, GNUNET_MESSENGER_Room::members, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_Room::queue, GNUNET_MESSENGER_Room::queue_task, GNUNET_MESSENGER_Room::request_task, GNUNET_MESSENGER_Room::requests, GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_Room::sender_id, and GNUNET_MESSENGER_Room::subscriptions.
Referenced by close_handle_room(), GNUNET_MESSENGER_enter_room(), GNUNET_MESSENGER_open_room(), and iterate_destroy_room().
const struct GNUNET_HashCode * get_room_key | ( | const struct GNUNET_MESSENGER_Room * | room | ) |
Return a the hash representation of a given room.
[in] | room | Room |
Definition at line 254 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_MESSENGER_RoomKey::hash, and GNUNET_MESSENGER_Room::key.
Referenced by cb_key_monitor(), get_room_availble_epoch_entry(), GNUNET_MESSENGER_room_get_key(), handle_appeal_message(), handle_epoch_announcement(), handle_id_message(), handle_join_message(), handle_key_message(), handle_name_message(), handle_private_message(), request_message_from_room(), send_close_room(), send_enter_room(), send_message_to_room(), send_message_to_room_with_key(), send_open_room(), send_sync_room(), set_room_sender_id(), write_epoch_announcement_record(), and write_epoch_group_record().
enum GNUNET_GenericReturnValue is_room_public | ( | const struct GNUNET_MESSENGER_Room * | room | ) |
Returns whether a given room is public or using epoch keys to encrypt private traffic and sync those keys automatically.
[in] | room | Room |
Definition at line 263 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomKey::code, GNUNET_assert, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_Room::key, and GNUNET_MESSENGER_RoomKeyCode::public_bit.
Referenced by handle_epoch_announcement_delay(), handle_epoch_group_announcement_delay(), and send_message_to_room().
|
static |
Definition at line 272 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_MESSENGER_FLAG_RECENT, GNUNET_NO, and GNUNET_YES.
Referenced by get_room_availble_epoch_entry(), and get_room_message_epoch().
|
static |
Definition at line 284 of file messenger_api_room.c.
References delay_epoch_message_for_its_members(), GNUNET_MESSENGER_RoomMessageEntry::epoch, get_handle_contact(), get_room_epoch(), get_room_key(), GNUNET_assert, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_Room::handle, GNUNET_MESSENGER_Epoch::hash, is_epoch_member(), is_message_entry_recent(), GNUNET_MESSENGER_Epoch::room, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_access_message(), handle_announcement_message(), handle_appeal_message(), handle_authorization_message(), handle_group_message(), handle_revolution_message(), handle_room_delayed_announcement(), handle_room_delayed_appeal(), and handle_secret_message().
|
static |
Definition at line 318 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, callback_room_message(), delete_room_message(), GNUNET_MESSENGER_MessageBody::deletion, destroy_message(), GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_announcement(), get_message_timeout(), get_room_message_epoch(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_free, GNUNET_MESSENGER_FLAG_DELETE, GNUNET_MESSENGER_FLAG_SENT, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_MessageDeletion::hash, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_MessageHeader::kind, link_room_deletion(), GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, revoke_epoch_announcement_member(), and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_room_delayed_action().
|
static |
Definition at line 389 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_announcement(), get_epoch_group(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_MESSENGER_FLAG_SENT, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, handle_epoch_announcement_delay(), handle_epoch_group_announcement_delay(), GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_EpochAnnouncement::identifier, GNUNET_MESSENGER_EpochGroup::identifier, GNUNET_MESSENGER_RoomMessageEntry::message, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_room_delayed_action().
|
static |
Definition at line 448 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_MessageBody::appeal, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_MESSENGER_MessageAppeal::event, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_announcement(), get_epoch_announcement_key(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_MESSENGER_FLAG_SENT, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, is_epoch_announcement_member(), is_epoch_member(), key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, send_epoch_announcement_access(), and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_room_delayed_action().
|
static |
Definition at line 505 of file messenger_api_room.c.
References callback_room_message(), GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_MESSENGER_FLAG_DELETE, GNUNET_MESSENGER_FLAG_UPDATE, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_MESSENGER_KIND_APPEAL, GNUNET_MESSENGER_KIND_DELETION, handle_room_delayed_announcement(), handle_room_delayed_appeal(), handle_room_delayed_deletion(), GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, and GNUNET_MESSENGER_Room::messages.
Referenced by handle_room_action_task().
|
static |
Definition at line 543 of file messenger_api_room.c.
References GNUNET_MESSENGER_Room::actions, GNUNET_assert, GNUNET_CONTAINER_multihashmap_remove(), GNUNET_free, GNUNET_YES, and handle_room_delayed_action().
Referenced by delay_room_action().
void delay_room_action | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_TIME_Relative | delay | ||
) |
Enqueues delayed handling of a message in a room under a given hash once a specific delay has timed out.
[in,out] | room | Room |
[in] | hash | Hash of message |
[in] | delay | Delay of action |
Definition at line 564 of file messenger_api_room.c.
References GNUNET_MESSENGER_Room::actions, GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_free, GNUNET_memcpy, GNUNET_new, GNUNET_OK, GNUNET_SCHEDULER_add_delayed_with_priority(), GNUNET_SCHEDULER_PRIORITY_HIGH, handle_room_action_task(), GNUNET_MESSENGER_RoomAction::hash, and GNUNET_MESSENGER_RoomAction::room.
Referenced by handle_appeal_message(), handle_delete_message(), handle_epoch_announcement(), handle_epoch_group_announcement(), and handle_message().
void cancel_room_action | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Cancels the delayed handling of a message in a room under a given hash in case it has been queued using the function delay_room_action()
before and the action has not been fully processed yet.
[in,out] | room | Room |
[in] | hash | Hash of message |
Definition at line 597 of file messenger_api_room.c.
References GNUNET_MESSENGER_Room::actions, GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_YES, GNUNET_MESSENGER_RoomAction::hash, iterate_destroy_action(), and GNUNET_MESSENGER_RoomAction::room.
Referenced by handle_access_message(), and iterate_cancel_action().
|
static |
Definition at line 623 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomCancelAction::contact, GNUNET_MESSENGER_RoomCancelAction::epoch_hash, get_room_message(), get_room_message_epoch(), get_room_message_epoch_identifier(), get_room_sender(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE, GNUNET_CRYPTO_hash_cmp(), GNUNET_memcmp, GNUNET_YES, GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_RoomCancelAction::identifier, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomCancelAction::kind, GNUNET_MESSENGER_RoomCancelAction::map, GNUNET_MESSENGER_Epoch::room, and value.
Referenced by cancel_room_actions_by().
|
static |
Definition at line 674 of file messenger_api_room.c.
References cancel_room_action(), GNUNET_assert, and GNUNET_YES.
Referenced by cancel_room_actions_by().
void cancel_room_actions_by | ( | struct GNUNET_MESSENGER_Room * | room, |
enum GNUNET_MESSENGER_MessageKind | kind, | ||
const struct GNUNET_HashCode * | epoch_hash, | ||
const union GNUNET_MESSENGER_EpochIdentifier * | identifier, | ||
const struct GNUNET_MESSENGER_Contact * | contact | ||
) |
Searches queued actions to handle messages of a specific message kind in a room with any delay and cancels them using the function cancel_room_action()
.
The actions that need to be cancelled can be filtered by providing the specific hash of the epoch, identifier of the epoch key or group or even the contact from the sender of the exact message. All these parameters are optional.
[in,out] | room | Room |
[in] | kind | Message kind |
[in] | epoch_hash | Hash of epoch or NULL |
[in] | identifier | Identifier of epoch key/group or NULL |
[in] | contact | Contact of sender or NULL |
Definition at line 690 of file messenger_api_room.c.
References GNUNET_MESSENGER_Room::actions, GNUNET_MESSENGER_RoomCancelAction::contact, GNUNET_MESSENGER_RoomCancelAction::epoch_hash, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_NO, GNUNET_MESSENGER_RoomCancelAction::identifier, iterate_cancel_action(), iterate_cancel_action_by(), GNUNET_MESSENGER_RoomCancelAction::kind, and GNUNET_MESSENGER_RoomCancelAction::map.
Referenced by handle_epoch_announcement().
enum GNUNET_GenericReturnValue is_room_available | ( | const struct GNUNET_MESSENGER_Room * | room | ) |
Checks whether a room is available to send messages.
[in] | room | Room |
Definition at line 724 of file messenger_api_room.c.
References GNUNET_MESSENGER_Room::entries, get_room_sender_id(), GNUNET_assert, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_ListTunnels::head, and GNUNET_MESSENGER_Room::opened.
Referenced by dequeue_message_from_room(), dequeue_messages_from_room(), and enqueue_message_to_room().
struct GNUNET_MESSENGER_Handle * get_room_handle | ( | struct GNUNET_MESSENGER_Room * | room | ) |
Returns the messenger handle of the room.
[in,out] | room | Room |
Definition at line 739 of file messenger_api_room.c.
References GNUNET_assert, and GNUNET_MESSENGER_Room::handle.
Referenced by handle_epoch_announcement(), process_message_control(), task_message_control(), write_epoch_announcement_record(), and write_epoch_group_record().
const struct GNUNET_ShortHashCode * get_room_sender_id | ( | const struct GNUNET_MESSENGER_Room * | room | ) |
Returns the member id of the room's sender.
[in] | room | Room |
Definition at line 748 of file messenger_api_room.c.
References GNUNET_assert, and GNUNET_MESSENGER_Room::sender_id.
Referenced by get_handle_contact(), GNUNET_MESSENGER_get_message(), handle_join_message(), handle_member_id(), handle_miss_message(), handle_room_request_task(), is_room_available(), and send_message_to_room().
void set_room_sender_id | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_ShortHashCode * | id | ||
) |
Sets the member id of the room's sender to a specific id or NULL.
[in,out] | room | Room |
[in] | id | Member id or NULL |
Definition at line 757 of file messenger_api_room.c.
References get_room_key(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_log, GNUNET_memcpy, GNUNET_new, and GNUNET_MESSENGER_Room::sender_id.
Referenced by handle_id_message(), and handle_member_id().
struct GNUNET_MESSENGER_Epoch * get_room_epoch | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash, | ||
enum GNUNET_GenericReturnValue | recent | ||
) |
Returns the epoch in a given room from a specific epoch hash that represents the exact message the epoch starts.
[in,out] | room | Room |
[in] | hash | Hash of epoch |
[in] | recent | Recent flag |
Definition at line 782 of file messenger_api_room.c.
References create_epoch(), create_new_epoch(), destroy_epoch(), GNUNET_MESSENGER_Room::epochs, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_is_zero, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_Epoch::hash, and GNUNET_MESSENGER_Epoch::room.
Referenced by cb_key_monitor(), get_members_of_epoch(), get_room_availble_epoch_entry(), get_room_message_epoch(), handle_message(), invalidate_epoch_announcement(), invalidate_epoch_group(), send_message_to_room(), and setup_following_epochs_of_previous().
void generate_room_epoch_announcement | ( | struct GNUNET_MESSENGER_Room * | room, |
struct GNUNET_MESSENGER_Epoch * | epoch, | ||
struct GNUNET_MESSENGER_EpochAnnouncement ** | announcement | ||
) |
Generate a new announcement for a given epoch in a room under a random and unique announcement identifier.
The function will automatically generate an announcement message and send it to others.
[in,out] | room | Room |
[in,out] | epoch | Epoch |
[out] | announcement | Epoch announcement |
Definition at line 820 of file messenger_api_room.c.
References GNUNET_MESSENGER_Epoch::announcements, create_epoch_announcement(), destroy_epoch_announcement(), GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement_key(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multishortmap_put(), GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_EpochAnnouncement::identifier, send_epoch_announcement(), and set_epoch_announcement_key().
Referenced by send_message_to_room().
struct GNUNET_MESSENGER_Epoch * get_room_message_epoch | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Returns the epoch of a local message with a given hash in a room.
If no matching message is found or no matching epoch for that message is available, NULL gets returned.
[in,out] | room | Room |
[in] | hash | Hash of message |
Definition at line 854 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::epoch, get_room_epoch(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), is_message_entry_recent(), and GNUNET_MESSENGER_Room::messages.
Referenced by get_epoch_previous_announcement(), get_epoch_previous_group(), handle_room_delayed_deletion(), and iterate_cancel_action_by().
const union GNUNET_MESSENGER_EpochIdentifier * get_room_message_epoch_identifier | ( | const struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Returns the epoch identifier a local message with a given hash is targeting in a room with its specific operation.
The function is returning NULL if the given message does not provide any context which can be identified with an epoch identifier or if there's no message available under the given hash.
[in] | room | Room |
[in] | hash | Hash of message |
Definition at line 872 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::access, GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_MessageBody::appeal, GNUNET_MESSENGER_MessageBody::authorization, GNUNET_MESSENGER_Message::body, get_room_message_epoch_identifier(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_MESSENGER_KIND_ACCESS, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_MESSENGER_KIND_APPEAL, GNUNET_MESSENGER_KIND_AUTHORIZATION, GNUNET_MESSENGER_KIND_GROUP, GNUNET_MESSENGER_KIND_REVOLUTION, GNUNET_MESSENGER_KIND_SECRET, GNUNET_MESSENGER_MessageBody::group, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_MessageSecret::identifier, GNUNET_MESSENGER_MessageRevolution::identifier, GNUNET_MESSENGER_MessageGroup::identifier, GNUNET_MESSENGER_MessageAuthorization::identifier, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_MessageBody::revolution, and GNUNET_MESSENGER_MessageBody::secret.
Referenced by get_room_message_epoch_identifier(), and iterate_cancel_action_by().
const struct GNUNET_MESSENGER_Message * get_room_message | ( | const struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Returns a message locally stored from a map for a given hash in a room.
If no matching message is found, NULL gets returned.
[in] | room | Room |
[in] | hash | Hash of message |
Definition at line 911 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::completed, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_YES, GNUNET_MESSENGER_RoomMessageEntry::message, and GNUNET_MESSENGER_Room::messages.
Referenced by get_epoch_previous_announcement(), get_epoch_previous_group(), get_epoch_proposal_group(), get_members_of_epoch(), GNUNET_MESSENGER_delete_message(), GNUNET_MESSENGER_get_message(), handle_epoch_announcement_access(), invalidate_epoch_announcement(), invalidate_epoch_group(), is_epoch_member_in_room_graph(), is_epoch_previous_of_other(), iterate_cancel_action_by(), require_message_from_room(), send_epoch_announcement_access(), send_epoch_announcement_authorization(), send_epoch_group(), send_epoch_group_access(), send_epoch_group_authorization(), set_epoch_proposal_group(), and setup_following_epochs_of_previous().
enum GNUNET_GenericReturnValue is_room_message_sent | ( | const struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Returns whether a message is sent by the handle of the given room itself or another client that is using the same unique key to sign its sent messages.
[in] | room | Room |
[in] | hash | Hash of message |
Definition at line 931 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_MESSENGER_FLAG_SENT, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, and GNUNET_MESSENGER_Room::messages.
Referenced by send_epoch_group(), send_epoch_group_access(), and send_epoch_group_authorization().
struct GNUNET_MESSENGER_Contact * get_room_sender | ( | const struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Returns a messages sender locally stored from a map for a given hash in a room.
If no matching message is found, NULL gets returned.
[in] | room | Room |
[in] | hash | Hash of message |
Definition at line 951 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::completed, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_YES, GNUNET_MESSENGER_Room::messages, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by get_members_of_epoch(), GNUNET_MESSENGER_get_sender(), iterate_cancel_action_by(), and send_epoch_group().
struct GNUNET_MESSENGER_Contact * get_room_recipient | ( | const struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Returns a messages recipient locally stored from a map for a given hash in a room.
If no matching message is found or the message has not been privately received, NULL gets returned.
[in] | room | Room |
[in] | hash | Hash of message |
Definition at line 968 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::completed, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_YES, GNUNET_MESSENGER_Room::messages, and GNUNET_MESSENGER_RoomMessageEntry::recipient.
Referenced by GNUNET_MESSENGER_get_recipient().
const struct GNUNET_HashCode * get_room_epoch_hash | ( | const struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Returns the messages epoch hash that is locally stored for a message of a given hash in a room.
If no matching message is found, NULL gets returned.
[in] | room | Room |
[in] | hash | Hash of message |
Definition at line 985 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::epoch, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), and GNUNET_MESSENGER_Room::messages.
void delete_room_message | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_TIME_Relative | delay | ||
) |
Deletes a message with a given hash inside a room under a specific delay.
[in,out] | room | Room |
[in] | hash | Hash of message |
[in] | delay | Delay of deletion |
Definition at line 1002 of file messenger_api_room.c.
References create_message_deletion(), enqueue_message_to_room(), GNUNET_assert, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, and GNUNET_NO.
Referenced by GNUNET_MESSENGER_delete_message(), and handle_room_delayed_deletion().
void callback_room_message | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Executes the message callback for a given hash in a room.
[in,out] | room | Room |
[in] | hash | Hash of message |
Definition at line 1024 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_MESSENGER_FLAG_UPDATE, handle, GNUNET_MESSENGER_Room::handle, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_RoomMessageEntry::recipient, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_message_control(), handle_room_delayed_action(), and handle_room_delayed_deletion().
|
static |
Definition at line 1054 of file messenger_api_room.c.
References GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_assert, GNUNET_NO, GNUNET_YES, and GNUNET_MESSENGER_EpochIdentifierCode::level_bits.
Referenced by handle_access_message(), and handle_authorization_message().
|
static |
Definition at line 1073 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_YES, key, and request_message_from_room().
Referenced by handle_room_request_task().
|
static |
Definition at line 1089 of file messenger_api_room.c.
References get_room_sender_id(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_clear(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_SCHEDULER_add_delayed_with_priority(), GNUNET_SCHEDULER_PRIORITY_BACKGROUND, GNUNET_TIME_relative_get_millisecond_(), GNUNET_TIME_relative_multiply(), GNUNET_YES, handle_room_request_task(), iterate_room_request(), GNUNET_MESSENGER_Room::joined, GNUNET_MESSENGER_Room::request_task, and GNUNET_MESSENGER_Room::requests.
Referenced by handle_room_request_task(), and require_message_from_room().
void require_message_from_room | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Requires a specific message in a given room which can be identified by its hash.
The required message will be requested asynchronously.
[in] | room | Room |
[in] | hash | Hash of message |
Definition at line 1122 of file messenger_api_room.c.
References get_room_message(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE, GNUNET_is_zero, GNUNET_OK, GNUNET_SCHEDULER_add_with_priority(), GNUNET_SCHEDULER_PRIORITY_BACKGROUND, handle_room_request_task(), GNUNET_MESSENGER_Room::request_task, and GNUNET_MESSENGER_Room::requests.
Referenced by create_epoch(), GNUNET_MESSENGER_get_message(), handle_join_message(), handle_leave_message(), and handle_merge_message().
|
static |
Definition at line 2104 of file messenger_api_room.c.
References delay_room_action(), GNUNET_MESSENGER_RoomMessageEntry::epoch, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_size(), get_room_epoch(), GNUNET_assert, GNUNET_MESSENGER_FLAG_UPDATE, GNUNET_MESSENGER_KIND_ACCESS, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_MESSENGER_KIND_APPEAL, GNUNET_MESSENGER_KIND_AUTHORIZATION, GNUNET_MESSENGER_KIND_DELETION, GNUNET_MESSENGER_KIND_GROUP, GNUNET_MESSENGER_KIND_ID, GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_KIND_KEY, GNUNET_MESSENGER_KIND_LEAVE, GNUNET_MESSENGER_KIND_MERGE, GNUNET_MESSENGER_KIND_MISS, GNUNET_MESSENGER_KIND_NAME, GNUNET_MESSENGER_KIND_PRIVATE, GNUNET_MESSENGER_KIND_REVOLUTION, GNUNET_MESSENGER_KIND_SECRET, GNUNET_MESSENGER_KIND_TRANSCRIPT, GNUNET_NO, GNUNET_TIME_relative_get_zero_(), GNUNET_YES, handle_access_message(), handle_announcement_message(), handle_appeal_message(), handle_authorization_message(), handle_delete_message(), handle_group_message(), handle_id_message(), handle_join_message(), handle_key_message(), handle_leave_message(), handle_merge_message(), handle_miss_message(), handle_name_message(), handle_private_message(), handle_revolution_message(), handle_secret_message(), handle_transcript_message(), GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_Message::header, is_epoch_message(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, reset_epoch_size(), and GNUNET_MESSENGER_Epoch::room.
Referenced by handle_private_message(), handle_room_message(), handle_transcript_message(), update_room_message(), and update_room_secret_message().
|
static |
Definition at line 1156 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, context, GNUNET_MESSENGER_MessageJoin::epoch, get_context_from_member(), get_handle_contact_store(), get_handle_pubkey(), get_room_key(), get_room_sender_id(), get_store_contact(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multishortmap_contains_value(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_memcmp, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_Room::handle, GNUNET_MESSENGER_Message::header, increase_contact_rc(), GNUNET_MESSENGER_MessageBody::join, GNUNET_MESSENGER_Room::joined, GNUNET_MESSENGER_MessageJoin::key, GNUNET_MESSENGER_Room::members, GNUNET_MESSENGER_RoomMessageEntry::message, require_message_from_room(), GNUNET_MESSENGER_RoomMessageEntry::sender, and GNUNET_MESSENGER_MessageHeader::sender_id.
Referenced by handle_message().
|
static |
Definition at line 1198 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_YES, invalidate_epoch_keys_by_member(), and value.
Referenced by handle_leave_message().
|
static |
Definition at line 1216 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, decrease_contact_rc(), GNUNET_MESSENGER_MessageLeave::epoch, GNUNET_MESSENGER_Room::epochs, GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_CONTAINER_multishortmap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSENGER_FLAG_RECENT, GNUNET_YES, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_Message::header, iterate_room_epoch_member_invalidation(), GNUNET_MESSENGER_MessageBody::leave, GNUNET_MESSENGER_Room::members, GNUNET_MESSENGER_RoomMessageEntry::message, require_message_from_room(), GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_RoomMessageEntry::sender, and GNUNET_MESSENGER_MessageHeader::sender_id.
Referenced by handle_message().
|
static |
Definition at line 1243 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_RoomMessageEntry::flags, get_handle_name(), get_room_key(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_MESSENGER_FLAG_SENT, GNUNET_YES, GNUNET_MESSENGER_Room::handle, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_MessageName::name, GNUNET_MESSENGER_MessageBody::name, GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_RoomMessageEntry::sender, set_contact_name(), and GNUNET_MESSENGER_Room::use_handle_name.
Referenced by handle_message().
|
static |
Definition at line 1272 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, context, get_context_from_member(), get_handle_contact_store(), get_room_key(), GNUNET_assert, GNUNET_MESSENGER_Room::handle, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageKey::key, GNUNET_MESSENGER_MessageBody::key, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_RoomMessageEntry::sender, GNUNET_MESSENGER_MessageHeader::sender_id, and update_store_contact().
Referenced by handle_message().
|
static |
Definition at line 1297 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, context, GNUNET_MESSENGER_RoomMessageEntry::flags, get_contact_key(), get_context_from_member(), get_handle_contact_store(), get_room_key(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multishortmap_put(), GNUNET_CONTAINER_multishortmap_remove(), GNUNET_MESSENGER_FLAG_SENT, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_Room::handle, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageId::id, GNUNET_MESSENGER_MessageBody::id, GNUNET_MESSENGER_Room::members, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_RoomMessageEntry::sender, GNUNET_MESSENGER_MessageHeader::sender_id, set_room_sender_id(), and update_store_contact().
Referenced by handle_message().
|
static |
Definition at line 1333 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_Room::entries, find_list_tunnels(), GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_MESSENGER_FLAG_SENT, GNUNET_MESSENGER_ListTunnel::hash, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_MessageBody::miss, GNUNET_MESSENGER_MessageMiss::peer, and remove_from_list_tunnels().
Referenced by handle_message().
|
static |
Definition at line 1355 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_MessageMerge::epochs, GNUNET_assert, GNUNET_MESSENGER_ListTunnel::hash, GNUNET_MESSENGER_MessageBody::merge, GNUNET_MESSENGER_RoomMessageEntry::message, and require_message_from_room().
Referenced by handle_message().
|
static |
Definition at line 1367 of file messenger_api_room.c.
References copy_message(), decrypt_message(), destroy_message(), GNUNET_MESSENGER_RoomMessageEntry::flags, get_handle_contact(), get_handle_key(), get_room_key(), GNUNET_assert, GNUNET_MESSENGER_FLAG_PRIVATE, GNUNET_YES, GNUNET_MESSENGER_Room::handle, handle_message(), GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_RoomMessageEntry::recipient, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_message().
|
static |
Definition at line 1403 of file messenger_api_room.c.
References delay_room_action(), get_message_timeout(), GNUNET_assert, and GNUNET_MESSENGER_RoomMessageEntry::message.
Referenced by handle_message().
|
static |
Definition at line 1418 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_RoomMessageEntry::completed, copy_message(), copy_message_header(), destroy_message(), GNUNET_MESSENGER_RoomMessageEntry::flags, get_handle_contact_store(), get_store_contact(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_free, GNUNET_MESSENGER_FLAG_NONE, GNUNET_MESSENGER_FLAG_PRIVATE, GNUNET_MESSENGER_FLAG_SENT, GNUNET_MESSENGER_FLAG_UPDATE, GNUNET_MESSENGER_KIND_PRIVATE, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_Room::handle, handle_message(), GNUNET_MESSENGER_MessageTranscript::hash, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageTranscript::key, GNUNET_MESSENGER_MessageHeader::kind, link_room_message(), GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, read_transcript_message(), GNUNET_MESSENGER_RoomMessageEntry::recipient, GNUNET_MESSENGER_RoomMessageEntry::sender, and GNUNET_MESSENGER_MessageBody::transcript.
Referenced by handle_message().
|
static |
Definition at line 1502 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_announcement(), get_epoch_group(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multishortmap_contains(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_MESSENGER_FLAG_SENT, GNUNET_NO, GNUNET_sh2s(), GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, handle_epoch_announcement(), handle_epoch_group_announcement(), GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_EpochNonce::hash, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_EpochAnnouncement::identifier, GNUNET_MESSENGER_EpochGroup::identifier, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_MessageAnnouncement::nonce, GNUNET_MESSENGER_Epoch::nonces, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_message().
|
static |
Definition at line 1575 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_MESSENGER_EpochAnnouncement::epoch, get_epoch_announcement(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_NO, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, handle_epoch_announcement_message(), GNUNET_MESSENGER_MessageSecret::identifier, GNUNET_MESSENGER_EpochAnnouncement::identifier, GNUNET_MESSENGER_RoomMessageEntry::message, and GNUNET_MESSENGER_MessageBody::secret.
Referenced by handle_message().
|
static |
Definition at line 1606 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_MessageBody::appeal, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, delay_room_action(), GNUNET_MESSENGER_MessageAppeal::event, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_announcement(), get_epoch_position_factor(), get_handle_contact(), get_message_timeout(), get_room_availble_epoch_entry(), get_room_key(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSENGER_FLAG_SENT, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_NO, GNUNET_sh2s(), GNUNET_TIME_relative_get_zero_(), GNUNET_TIME_relative_is_zero(), GNUNET_TIME_relative_multiply_double(), GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_Room::handle, GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, is_epoch_announcement_member(), is_epoch_member(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_RoomMessageEntry::sender, set_epoch_announcement_appeal(), and timeout.
Referenced by handle_message().
|
static |
Definition at line 1682 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::access, GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, cancel_room_action(), GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_RoomMessageEntry::epoch, GNUNET_MESSENGER_MessageAccess::event, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_announcement(), get_epoch_announcement_key(), get_epoch_announcement_member_hash(), get_epoch_group(), get_epoch_group_member_hash(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CRYPTO_hash_cmp(), GNUNET_MESSENGER_FLAG_RECENT, GNUNET_MESSENGER_FLAG_SENT, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_MESSENGER_KIND_APPEAL, GNUNET_MESSENGER_KIND_GROUP, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_MessageBody::group, handle_epoch_announcement_access(), handle_epoch_group_access(), GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_MessageGroup::identifier, GNUNET_MESSENGER_EpochAnnouncement::identifier, is_epoch_identifier_upper(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_Epoch::main_announcement, GNUNET_MESSENGER_Epoch::main_group, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_MessageGroup::partner, GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_RoomMessageEntry::sender, and verify_message_by_key().
Referenced by handle_message().
|
static |
Definition at line 1837 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, get_epoch_announcement(), get_epoch_announcement_key(), get_epoch_group(), get_epoch_group_key(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multishortmap_contains(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_log, GNUNET_OK, GNUNET_sh2s(), GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_EpochNonce::hash, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_MessageRevolution::identifier, invalidate_epoch_announcement(), invalidate_epoch_group(), key, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_MessageAnnouncement::nonce, GNUNET_MESSENGER_Epoch::nonces, GNUNET_MESSENGER_MessageBody::revolution, GNUNET_MESSENGER_RoomMessageEntry::sender, and verify_message_by_key().
Referenced by handle_message().
|
static |
Definition at line 1912 of file messenger_api_room.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_MESSENGER_RoomMessageEntry::flags, get_epoch_group(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_MESSENGER_FLAG_SENT, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_MessageBody::group, GNUNET_MESSENGER_MessageGroup::identifier, GNUNET_MESSENGER_EpochGroup::identifier, GNUNET_MESSENGER_RoomMessageEntry::message, send_epoch_group_access(), GNUNET_MESSENGER_RoomMessageEntry::sender, set_epoch_group_key(), and set_epoch_proposal_group().
Referenced by handle_message().
|
static |
Definition at line 1941 of file messenger_api_room.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_MessageBody::authorization, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_MESSENGER_EpochAnnouncement::epoch, GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_MESSENGER_MessageAuthorization::event, extract_authorization_message_key(), get_epoch_announcement(), get_epoch_announcement_key(), get_epoch_group(), get_epoch_group_key(), get_epoch_group_level(), get_room_availble_epoch_entry(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_memcmp, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_MESSENGER_KIND_GROUP, GNUNET_NO, GNUNET_OK, GNUNET_YES, GNUNET_MESSENGER_MessageBody::group, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_MessageGroup::identifier, GNUNET_MESSENGER_MessageAuthorization::identifier, GNUNET_MESSENGER_EpochAnnouncement::identifier, GNUNET_MESSENGER_EpochGroup::identifier, GNUNET_MESSENGER_MessageGroup::initiator, is_epoch_identifier_upper(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_MessageGroup::partner, send_epoch_announcement(), send_epoch_group_announcement(), GNUNET_MESSENGER_RoomMessageEntry::sender, set_epoch_announcement_key(), set_epoch_group_key(), GNUNET_MESSENGER_EpochAnnouncement::shared_key, GNUNET_MESSENGER_EpochGroup::shared_key, and verify_message_by_key().
Referenced by handle_message().
void handle_room_message | ( | struct GNUNET_MESSENGER_Room * | room, |
struct GNUNET_MESSENGER_Contact * | sender, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_HashCode * | epoch, | ||
enum GNUNET_MESSENGER_MessageFlags | flags | ||
) |
Handles a message with a given hash in a room for the client API to update members and its information.
The function also stores the message in map locally for access afterwards.
The contact of the message's sender could be updated or even created. It may not be freed or destroyed though! (The contact may still be in use for old messages...)
[in,out] | room | Room |
[in,out] | sender | Contact of sender |
[in] | message | Message |
[in] | hash | Hash of message |
[in] | epoch | Hash of epoch |
[in] | flags | Flags of message |
Definition at line 2185 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::completed, copy_message(), copy_message_header(), GNUNET_MESSENGER_RoomMessageEntry::epoch, GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_free, GNUNET_memcpy, GNUNET_MESSENGER_FLAG_NONE, GNUNET_MESSENGER_FLAG_PRIVATE, GNUNET_MESSENGER_KIND_PRIVATE, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_YES, handle_message(), GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, GNUNET_MESSENGER_RoomMessageEntry::recipient, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_message_control().
enum GNUNET_GenericReturnValue update_room_message | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash | ||
) |
Updates any message with a given hash in a room for the client API to force handling the message again after some changes that might affect it.
[in,out] | room | Room |
[in] | hash | Hash of message |
Definition at line 2244 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_MESSENGER_FLAG_UPDATE, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, handle_message(), GNUNET_MESSENGER_RoomMessageEntry::message, and GNUNET_MESSENGER_Room::messages.
enum GNUNET_GenericReturnValue update_room_secret_message | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_CRYPTO_SymmetricSessionKey * | key, | ||
enum GNUNET_GenericReturnValue | update | ||
) |
Updates a secret message with a given hash in a room for the client API trying to decrypt it with the given epoch key from an epoch announcement.
[in,out] | room | Room |
[in] | hash | Hash of message |
[in] | key | Epoch key |
[in] | update | Flag message as update on success |
Definition at line 2266 of file messenger_api_room.c.
References copy_message(), decrypt_secret_message(), destroy_message(), GNUNET_MESSENGER_RoomMessageEntry::flags, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), GNUNET_MESSENGER_FLAG_SECRET, GNUNET_MESSENGER_FLAG_UPDATE, GNUNET_MESSENGER_KIND_SECRET, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, handle_message(), GNUNET_MESSENGER_Message::header, key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_RoomMessageEntry::message, GNUNET_MESSENGER_Room::messages, and GNUNET_MESSENGER_RoomMessageEntry::sender.
Referenced by handle_secret_message_with_key().
void update_room_last_message | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_HashCode * | epoch | ||
) |
Updates the last message hash and its epoch of a room for the client API so that new messages can point to the latest message hash while sending.
[in,out] | room | Room |
[in] | hash | Hash of message |
[in] | epoch | Hash of epoch |
Definition at line 2312 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_memcpy, GNUNET_MESSENGER_Room::last_epoch, and GNUNET_MESSENGER_Room::last_message.
Referenced by handle_message_control(), handle_room_close(), handle_room_entry(), handle_room_open(), handle_room_sync(), and send_message_to_room().
void copy_room_last_message | ( | const struct GNUNET_MESSENGER_Room * | room, |
struct GNUNET_HashCode * | hash | ||
) |
Copies the last message hash of a room into a given hash variable.
[in] | room | Room |
[out] | hash | Hash of message |
Definition at line 2326 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_memcpy, and GNUNET_MESSENGER_Room::last_message.
Referenced by send_close_room(), send_enter_room(), send_message_to_room(), send_open_room(), and send_sync_room().
|
static |
Definition at line 2343 of file messenger_api_room.c.
References call, GNUNET_assert, and value.
Referenced by iterate_room_members().
int iterate_room_members | ( | struct GNUNET_MESSENGER_Room * | room, |
GNUNET_MESSENGER_MemberCallback | callback, | ||
void * | cls | ||
) |
Iterates through all members of a given room to forward each of them to a selected callback with a custom closure.
[in,out] | room | Room |
[in] | callback | Function called for each member |
[in,out] | cls | Closure |
Definition at line 2360 of file messenger_api_room.c.
References call, GNUNET_MESSENGER_MemberCall::callback, GNUNET_MESSENGER_MemberCall::cls, GNUNET_assert, GNUNET_CONTAINER_multishortmap_iterate(), iterate_local_members(), GNUNET_MESSENGER_Room::members, and GNUNET_MESSENGER_MemberCall::room.
Referenced by GNUNET_MESSENGER_iterate_members().
|
static |
Definition at line 2390 of file messenger_api_room.c.
References GNUNET_MESSENGER_MemberFind::contact, GNUNET_assert, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_MemberFind::result, and value.
Referenced by find_room_member().
enum GNUNET_GenericReturnValue find_room_member | ( | const struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_MESSENGER_Contact * | contact | ||
) |
Checks through all members of a given room if a specific contact is found and returns a result depending on that.
[in] | room | Room |
[in] | contact |
Definition at line 2413 of file messenger_api_room.c.
References GNUNET_MESSENGER_MemberFind::contact, GNUNET_assert, GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_NO, iterate_find_member(), GNUNET_MESSENGER_Room::members, and GNUNET_MESSENGER_MemberFind::result.
Referenced by iterate_find_room().
|
static |
Definition at line 2431 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_CRYPTO_hash_cmp(), GNUNET_NO, GNUNET_YES, result, and value.
Referenced by link_room_message().
void link_room_message | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_HashCode * | other | ||
) |
Links a message identified by its hash inside a given room with another message identified by its other hash.
Linked messages will be deleted automatically, if any linked message to it gets deleted.
[in,out] | room | Room |
[in] | hash | Hash of message |
[in] | other | Hash of other message |
Definition at line 2454 of file messenger_api_room.c.
References find_linked_hash(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_free, GNUNET_memdup, GNUNET_OK, GNUNET_MESSENGER_Room::links, result, and value.
Referenced by dequeue_message_from_room(), and handle_transcript_message().
|
static |
Definition at line 2490 of file messenger_api_room.c.
References GNUNET_assert, GNUNET_CRYPTO_hash_cmp(), GNUNET_NO, GNUNET_YES, and value.
Referenced by delete_linked_hash().
|
static |
Definition at line 2511 of file messenger_api_room.c.
References clear_linked_hash(), GNUNET_assert, GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_free, GNUNET_memcpy, GNUNET_YES, info, key, and value.
Referenced by link_room_deletion().
void link_room_deletion | ( | struct GNUNET_MESSENGER_Room * | room, |
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_TIME_Relative | delay, | ||
GNUNET_MESSENGER_RoomLinkDeletion | deletion | ||
) |
Delete all remaining links to a certain message identified by its hash inside a given room and cause a deletion process to all of the linked messages.
[in,out] | room | Room |
[in] | hash | Hash of message |
[in] | delay | Delay for linked deletion |
[in] | deletion | Function called for each linked deletion |
Definition at line 2545 of file messenger_api_room.c.
References GNUNET_MESSENGER_RoomLinkDeletionInfo::delay, delete_linked_hash(), GNUNET_MESSENGER_RoomLinkDeletionInfo::deletion, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CONTAINER_multihashmap_remove_all(), info, GNUNET_MESSENGER_Room::links, and GNUNET_MESSENGER_RoomLinkDeletionInfo::room.
Referenced by handle_room_delayed_deletion().