GNUnet 0.26.2-14-ga82e62fdc
 
Loading...
Searching...
No Matches
messenger_api_room.h File Reference
Include dependency graph for messenger_api_room.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_MESSENGER_RoomEncryptionKey
 
struct  GNUNET_MESSENGER_RoomAction
 
struct  GNUNET_MESSENGER_RoomMessageEntry
 
struct  GNUNET_MESSENGER_RoomSubscription
 
struct  GNUNET_MESSENGER_Room
 

Typedefs

typedef void(* GNUNET_MESSENGER_RoomLinkDeletion) (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
 

Functions

struct GNUNET_MESSENGER_Roomcreate_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.
 
void destroy_room (struct GNUNET_MESSENGER_Room *room)
 Destroys a room and frees its memory fully from the client API.
 
const struct GNUNET_HashCodeget_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.
 
const struct GNUNET_CRYPTO_HpkePublicKeyget_room_encryption_key (const struct GNUNET_MESSENGER_Room *room)
 Returns the latest encryption key stored in memory by the current user for a given room.
 
enum GNUNET_GenericReturnValue add_room_encryption_key (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_CRYPTO_HpkePrivateKey *key)
 Adds an encryption key by the current user to memory of a given room and will be placed to the second latest slot in the list if it's not empty.
 
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.
 
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_Handleget_room_handle (struct GNUNET_MESSENGER_Room *room)
 Returns the messenger handle of the room.
 
const struct GNUNET_ShortHashCodeget_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_Epochget_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_Epochget_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_EpochIdentifierget_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_Messageget_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_Contactget_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_Contactget_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_HashCodeget_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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

Typedef Documentation

◆ GNUNET_MESSENGER_RoomLinkDeletion

typedef void(* GNUNET_MESSENGER_RoomLinkDeletion) (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)

Definition at line 119 of file messenger_api_room.h.

Function Documentation

◆ create_room()

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.

Parameters
[in,out]handleHandle
[in]keyKey of room
Returns
New room

Definition at line 51 of file messenger_api_room.c.

53{
54 struct GNUNET_MESSENGER_Room *room;
55
56 GNUNET_assert ((handle) && (key));
57
58 room = GNUNET_new (struct GNUNET_MESSENGER_Room);
59 room->handle = handle;
60
61 GNUNET_memcpy (&(room->key), key, sizeof(*key));
62
63 room->keys_head = NULL;
64 room->keys_tail = NULL;
65
66 memset (&(room->last_message), 0, sizeof(room->last_message));
67 memset (&(room->last_epoch), 0, sizeof(room->last_epoch));
68
69 room->joined = GNUNET_NO;
70 room->opened = GNUNET_NO;
73
74 room->sender_id = NULL;
75
76 init_list_tunnels (&(room->entries));
77
82
86
87 init_queue_messages (&(room->queue));
88 room->queue_task = NULL;
89
90 room->request_task = NULL;
91
92 room->control = create_message_control (room);
93
94 return room;
95}
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition gnunet-vpn.c:35
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
@ GNUNET_YES
@ GNUNET_NO
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void init_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Initializes list of tunnels peer identities as empty list.
struct GNUNET_MESSENGER_MessageControl * create_message_control(struct GNUNET_MESSENGER_Room *room)
Creates and allocates a new message control for a room of the client API.
void init_queue_messages(struct GNUNET_MESSENGER_QueueMessages *messages)
Initializes queue of messages as empty queue.
struct GNUNET_CONTAINER_MultiHashMap * links
struct GNUNET_MESSENGER_RoomEncryptionKey * keys_tail
struct GNUNET_CONTAINER_MultiShortmap * subscriptions
struct GNUNET_MESSENGER_Handle * handle
enum GNUNET_GenericReturnValue opened
union GNUNET_MESSENGER_RoomKey key
enum GNUNET_GenericReturnValue wait_for_sync
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_MessageControl * control
struct GNUNET_SCHEDULER_Task * request_task
struct GNUNET_CONTAINER_MultiHashMap * requests
struct GNUNET_SCHEDULER_Task * queue_task
struct GNUNET_CONTAINER_MultiHashMap * epochs
struct GNUNET_HashCode last_epoch
struct GNUNET_CONTAINER_MultiHashMap * messages
struct GNUNET_CONTAINER_MultiHashMap * actions
enum GNUNET_GenericReturnValue use_handle_name
struct GNUNET_MESSENGER_QueueMessages queue
enum GNUNET_GenericReturnValue joined
struct GNUNET_MESSENGER_ListTunnels entries
struct GNUNET_MESSENGER_RoomEncryptionKey * keys_head
struct GNUNET_ShortHashCode * sender_id
struct GNUNET_HashCode last_message

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::keys_head, GNUNET_MESSENGER_Room::keys_tail, 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 get_handle_room().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_room()

void destroy_room ( struct GNUNET_MESSENGER_Room room)

Destroys a room and frees its memory fully from the client API.

Parameters
[in,out]roomRoom

Definition at line 213 of file messenger_api_room.c.

214{
215 GNUNET_assert (room);
216
218
219 if (room->actions)
220 {
223
225 }
226
227 if (room->request_task)
229
230 if (room->queue_task)
232
233 clear_queue_messages (&(room->queue));
234 clear_list_tunnels (&(room->entries));
235
236 if (room->requests)
238
239 if (room->epochs)
240 {
243 NULL);
244
246 }
247
248 if (room->subscriptions)
249 {
252 NULL);
253
255 }
256
257 if (room->messages)
258 {
261
263 }
264
265 if (room->members)
267
268 if (room->links)
269 {
272
274 }
275
276 if (room->sender_id)
277 GNUNET_free (room->sender_id);
278
279 if (room->keys_head)
281
282 GNUNET_free (room);
283}
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
#define GNUNET_free(ptr)
Wrapper around free.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition scheduler.c:980
void clear_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Clears the list of tunnels peer identities.
void destroy_message_control(struct GNUNET_MESSENGER_MessageControl *control)
Destroys a message control and frees its memory fully from the client API.
void clear_queue_messages(struct GNUNET_MESSENGER_QueueMessages *messages)
Clears the queue of messages.
static void clear_room_encryption_keys(struct GNUNET_MESSENGER_RoomEncryptionKey *head, struct GNUNET_MESSENGER_RoomEncryptionKey *tail)
static enum GNUNET_GenericReturnValue iterate_destroy_epoch(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_action(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_message(void *cls, const struct GNUNET_HashCode *key, void *value)

References GNUNET_MESSENGER_Room::actions, clear_list_tunnels(), clear_queue_messages(), clear_room_encryption_keys(), 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::keys_head, GNUNET_MESSENGER_Room::keys_tail, 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_Room::sender_id, and GNUNET_MESSENGER_Room::subscriptions.

Referenced by close_handle_room(), get_handle_room(), and iterate_destroy_room().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_key()

◆ is_room_public()

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.

Parameters
[in]roomRoom
Returns
GNUNET_YES if the room is public, otherwise GNUNET_NO

Definition at line 296 of file messenger_api_room.c.

297{
298 GNUNET_assert (room);
299
300 return room->key.code.public_bit? GNUNET_YES : GNUNET_NO;
301}
struct GNUNET_MESSENGER_RoomKeyCode code

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().

Here is the caller graph for this function:

◆ get_room_encryption_key()

const struct GNUNET_CRYPTO_HpkePublicKey * get_room_encryption_key ( const struct GNUNET_MESSENGER_Room room)

Returns the latest encryption key stored in memory by the current user for a given room.

Parameters
[in]roomRoom
Returns
Public key for hybrid public key encryption

Definition at line 305 of file messenger_api_room.c.

306{
307 static struct GNUNET_CRYPTO_HpkePublicKey public_key;
308
309 GNUNET_assert (room);
310
311 if (! room->keys_tail)
312 return NULL;
313
315 &(room->keys_tail->key), &public_key));
316
317 return &public_key;
318}
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_sk_get_public(const struct GNUNET_CRYPTO_HpkePrivateKey *privkey, struct GNUNET_CRYPTO_HpkePublicKey *key)
Retrieves the GNUNET_CRYPTO_HpkePublicKey representation of a GNUNET_CRYPTO_HpkePrivateKey.
@ GNUNET_OK
A public key used for encryption.
struct GNUNET_CRYPTO_HpkePrivateKey key

References GNUNET_assert, GNUNET_CRYPTO_hpke_sk_get_public(), GNUNET_OK, GNUNET_MESSENGER_RoomEncryptionKey::key, and GNUNET_MESSENGER_Room::keys_tail.

Referenced by get_valid_encryption_key_for_room().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_room_encryption_key()

enum GNUNET_GenericReturnValue add_room_encryption_key ( struct GNUNET_MESSENGER_Room room,
const struct GNUNET_CRYPTO_HpkePrivateKey key 
)

Adds an encryption key by the current user to memory of a given room and will be placed to the second latest slot in the list if it's not empty.

If the provided key is NULL, a new key will be generated and placed as latest key to be used for encryption purposes in the active member session.

Parameters
[in]roomRoom
[in]keyPrivate key for hybrid public key encryption or NULL
Returns
GNUNET_SYSERR on error, otherwise GNUNET_OK

Definition at line 340 of file messenger_api_room.c.

342{
343 struct GNUNET_MESSENGER_RoomEncryptionKey *encryption_key;
344
345 GNUNET_assert (room);
346
347 if (key)
348 {
349 encryption_key = room->keys_tail;
350
351 while (encryption_key)
352 {
353 if (0 == GNUNET_memcmp_priv (key, &(encryption_key->key)))
354 return GNUNET_SYSERR;
355
356 encryption_key = encryption_key->prev;
357 }
358 }
359
360 encryption_key = GNUNET_malloc (sizeof(struct
362
363 if (! encryption_key)
364 return GNUNET_SYSERR;
365
366 if (key)
367 GNUNET_memcpy (&(encryption_key->key), key, sizeof (struct
370 GNUNET_CRYPTO_HPKE_KEY_TYPE_X25519, &(encryption_key->key)))
371 {
372 GNUNET_free (encryption_key);
373 return GNUNET_SYSERR;
374 }
375
376 encryption_key->query = NULL;
377
378 encryption_key->prev = NULL;
379 encryption_key->next = NULL;
380
381 if (key)
383 keys_tail, encryption_key);
384 else
385 {
387 get_room_handle (room),
388 get_room_key (room),
389 &(encryption_key->key),
391 encryption_key,
392 &(encryption_key->query));
393
395 encryption_key);
396 }
397
398 return GNUNET_OK;
399}
#define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element)
Insert an element into a DLL before the given other element.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hpke_sk_create(enum GNUNET_CRYPTO_HpkeKeyType type, struct GNUNET_CRYPTO_HpkePrivateKey *pk)
Create a new GNUNET_CRYPTO_HpkePrivateKey of specific type.
#define GNUNET_memcmp_priv(a, b)
Compare memory in a and b in constant time, suitable for private data.
@ GNUNET_SYSERR
@ GNUNET_CRYPTO_HPKE_KEY_TYPE_X25519
Type for X25519 hybrid public key encryption.
#define GNUNET_malloc(size)
Wrapper around malloc.
enum GNUNET_GenericReturnValue store_handle_encryption_key(const struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_CRYPTO_HpkePrivateKey *encryption_key, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls, struct GNUNET_NAMESTORE_QueueEntry **query)
Stores an encryption_key for a given room from a handle identified by its key/i>.
const struct GNUNET_HashCode * get_room_key(const struct GNUNET_MESSENGER_Room *room)
Return a the hash representation of a given room.
struct GNUNET_MESSENGER_Handle * get_room_handle(struct GNUNET_MESSENGER_Room *room)
Returns the messenger handle of the room.
static void cont_write_encryption_key_record(void *cls, enum GNUNET_ErrorCode ec)
A public key used for decryption.
struct GNUNET_NAMESTORE_QueueEntry * query
struct GNUNET_MESSENGER_RoomEncryptionKey * prev
struct GNUNET_MESSENGER_RoomEncryptionKey * next

References cont_write_encryption_key_record(), get_room_handle(), get_room_key(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert_before, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_HPKE_KEY_TYPE_X25519, GNUNET_CRYPTO_hpke_sk_create(), GNUNET_free, GNUNET_malloc, GNUNET_memcmp_priv, GNUNET_memcpy, GNUNET_OK, GNUNET_SYSERR, key, GNUNET_MESSENGER_RoomEncryptionKey::key, GNUNET_MESSENGER_Room::keys_head, GNUNET_MESSENGER_Room::keys_tail, GNUNET_MESSENGER_RoomEncryptionKey::next, GNUNET_MESSENGER_RoomEncryptionKey::prev, GNUNET_MESSENGER_RoomEncryptionKey::query, and store_handle_encryption_key().

Referenced by get_valid_encryption_key_for_room(), iterate_send_key_to_room(), and read_handle_encryption_key().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
[in,out]roomRoom
[in]hashHash of message
[in]delayDelay of action

Definition at line 695 of file messenger_api_room.c.

698{
700
701 GNUNET_assert ((room) && (hash));
702
704
705 if (! action)
706 return;
707
709 room->actions, hash, action,
711 {
712 GNUNET_free (action);
713 return;
714 }
715
716 GNUNET_memcpy (&(action->hash), hash, sizeof(action->hash));
717
718 action->room = room;
720 delay,
723 action);
724}
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_SCHEDULER_PRIORITY_HIGH
Run with high priority (important requests).
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed_with_priority(struct GNUNET_TIME_Relative delay, enum GNUNET_SCHEDULER_Priority priority, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition scheduler.c:1207
static void handle_room_action_task(void *cls)
struct GNUNET_HashCode hash
struct GNUNET_MESSENGER_Room * room

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cancel_room_action()

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.

Parameters
[in,out]roomRoom
[in]hashHash of message

Definition at line 728 of file messenger_api_room.c.

730{
731 GNUNET_assert ((room) && (hash));
732
734 )
735 return;
736
740}
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
int GNUNET_CONTAINER_multihashmap_remove_all(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Remove all entries for the given key from the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
[in,out]roomRoom
[in]kindMessage kind
[in]epoch_hashHash of epoch or NULL
[in]identifierIdentifier of epoch key/group or NULL
[in]contactContact of sender or NULL

Definition at line 821 of file messenger_api_room.c.

827{
829
830 GNUNET_assert (room);
831
832 cancel.kind = kind;
833 cancel.epoch_hash = epoch_hash;
834 cancel.identifier = identifier;
835 cancel.contact = contact;
836
838
839 if (! cancel.map)
840 return;
841
844 &cancel);
845
848 room);
849
851}
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)
const struct GNUNET_HashCode * epoch_hash
const struct GNUNET_MESSENGER_Contact * contact
enum GNUNET_MESSENGER_MessageKind kind
const union GNUNET_MESSENGER_EpochIdentifier * identifier

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_room_available()

enum GNUNET_GenericReturnValue is_room_available ( const struct GNUNET_MESSENGER_Room room)

Checks whether a room is available to send messages.

Parameters
[in]roomRoom
Returns
GNUNET_YES if the room is available, otherwise GNUNET_NO

Definition at line 855 of file messenger_api_room.c.

856{
857 GNUNET_assert (room);
858
859 if (! get_room_sender_id (room))
860 return GNUNET_NO;
861
862 if ((GNUNET_YES == room->opened) || (room->entries.head))
863 return GNUNET_YES;
864 else
865 return GNUNET_NO;
866}
const struct GNUNET_ShortHashCode * get_room_sender_id(const struct GNUNET_MESSENGER_Room *room)
Returns the member id of the room's sender.
struct GNUNET_MESSENGER_ListTunnel * head

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_handle()

struct GNUNET_MESSENGER_Handle * get_room_handle ( struct GNUNET_MESSENGER_Room room)

Returns the messenger handle of the room.

Parameters
[in,out]roomRoom
Returns
Messenger handle or NULL

Definition at line 870 of file messenger_api_room.c.

871{
872 GNUNET_assert (room);
873
874 return room->handle;
875}

References GNUNET_assert, and GNUNET_MESSENGER_Room::handle.

Referenced by add_room_encryption_key(), handle_epoch_announcement(), process_message_control(), task_message_control(), write_epoch_announcement_record(), and write_epoch_group_record().

Here is the caller graph for this function:

◆ get_room_sender_id()

const struct GNUNET_ShortHashCode * get_room_sender_id ( const struct GNUNET_MESSENGER_Room room)

Returns the member id of the room's sender.

Parameters
[in]roomRoom
Returns
Member id or NULL

Definition at line 879 of file messenger_api_room.c.

880{
881 GNUNET_assert (room);
882
883 return room->sender_id;
884}

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().

Here is the caller graph for this function:

◆ set_room_sender_id()

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.

Parameters
[in,out]roomRoom
[in]idMember id or NULL

Definition at line 888 of file messenger_api_room.c.

890{
891 GNUNET_assert (room);
892
893 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Set member id for room: %s\n",
894 GNUNET_h2s (get_room_key (room)));
895
896 if (! id)
897 {
898 if (room->sender_id)
899 GNUNET_free (room->sender_id);
900
901 room->sender_id = NULL;
902 return;
903 }
904
905 if (! room->sender_id)
907
908 GNUNET_memcpy (room->sender_id, id, sizeof(struct GNUNET_ShortHashCode));
909}
#define GNUNET_log(kind,...)
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_DEBUG
A 256-bit hashcode.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_epoch()

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.

Parameters
[in,out]roomRoom
[in]hashHash of epoch
[in]recentRecent flag
Returns
Epoch or NULL

Definition at line 913 of file messenger_api_room.c.

916{
917 struct GNUNET_MESSENGER_Epoch *epoch;
918
919 GNUNET_assert ((room) && (hash));
920
921 if (GNUNET_is_zero (hash))
922 return NULL;
923
925
926 if (epoch)
927 return epoch;
928
929 if (GNUNET_YES == recent)
930 epoch = create_new_epoch (room, hash);
931 else
932 epoch = create_epoch (room, hash);
933
934 if (! epoch)
935 return NULL;
936
938 hash,
939 epoch,
941 {
942 destroy_epoch (epoch);
943 return NULL;
944 }
945
946 return epoch;
947}
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
#define GNUNET_is_zero(a)
Check that memory in a is all zeros.
struct GNUNET_MESSENGER_Epoch * create_new_epoch(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Creates and allocates a new epoch in a given room which can be identified by a specific hash.
struct GNUNET_MESSENGER_Epoch * create_epoch(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Creates and allocates an epoch in a given room which can be identified by a specific hash.
void destroy_epoch(struct GNUNET_MESSENGER_Epoch *epoch)
Destroys an epoch and frees its memory fully from the client API.
struct GNUNET_MESSENGER_Room * room
struct GNUNET_HashCode hash

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 get_members_of_epoch(), get_room_availble_epoch_entry(), get_room_message_epoch(), handle_message(), invalidate_epoch_announcement(), invalidate_epoch_group(), read_handle_epoch_key(), send_message_to_room(), and setup_following_epochs_of_previous().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_room_epoch_announcement()

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.

Parameters
[in,out]roomRoom
[in,out]epochEpoch
[out]announcementEpoch announcement

Definition at line 951 of file messenger_api_room.c.

955{
956 struct GNUNET_MESSENGER_EpochAnnouncement *epoch_announcement;
957
958 GNUNET_assert ((room) && (epoch) && (announcement) && (! (*announcement)));
959
960 epoch_announcement = create_epoch_announcement (epoch, NULL, GNUNET_YES);
961
962 if (! epoch_announcement)
963 return;
964
966 &(epoch_announcement->
968 epoch_announcement,
970 {
971 destroy_epoch_announcement (epoch_announcement);
972 return;
973 }
974
975 if (! get_epoch_announcement_key (epoch_announcement))
976 set_epoch_announcement_key (epoch_announcement, NULL, GNUNET_YES);
977
978 *announcement = epoch_announcement;
979
980 send_epoch_announcement (epoch_announcement);
981}
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue send_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Tries to send an announcement message by the client for a given epoch announcement using its secret k...
struct GNUNET_MESSENGER_EpochAnnouncement * create_epoch_announcement(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
Creates and allocates a new epoch announcement for a given epoch using a specific announcement identi...
const struct GNUNET_CRYPTO_SymmetricSessionKey * get_epoch_announcement_key(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns the secret key of a given epoch announcement or NULL.
void set_epoch_announcement_key(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, enum GNUNET_GenericReturnValue write_record)
Sets the secret key of a given epoch announcement to a shared key.
void destroy_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Destroys a given epoch announcement and frees its resources.
union GNUNET_MESSENGER_EpochIdentifier identifier
struct GNUNET_CONTAINER_MultiShortmap * announcements

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_message_epoch()

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.

Parameters
[in,out]roomRoom
[in]hashHash of message
Returns
Epoch or NULL

Definition at line 985 of file messenger_api_room.c.

987{
989
990 GNUNET_assert ((room) && (hash));
991
992 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
993
994 if (! entry)
995 return NULL;
996
997 return get_room_epoch (room, &(entry->epoch),
999}
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 ep...
static enum GNUNET_GenericReturnValue is_message_entry_recent(const struct GNUNET_MESSENGER_RoomMessageEntry *entry)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_message_epoch_identifier()

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.

Parameters
[in]roomRoom
[in]hashHash of message
Returns
Epoch identifier or NULL

Definition at line 1003 of file messenger_api_room.c.

1005{
1007
1008 GNUNET_assert ((room) && (hash));
1009
1010 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1011
1012 if ((! entry) || (! entry->message))
1013 return NULL;
1014
1015 switch (entry->message->header.kind)
1016 {
1018 return &(entry->message->body.announcement.identifier);
1020 return &(entry->message->body.secret.identifier);
1023 &(entry->message->body.appeal.
1024 event));
1027 &(entry->message->body.access.
1028 event));
1030 return &(entry->message->body.revolution.identifier);
1032 return &(entry->message->body.group.identifier);
1034 return &(entry->message->body.authorization.identifier);
1035 default:
1036 return NULL;
1037 }
1038}
@ GNUNET_MESSENGER_KIND_AUTHORIZATION
The authorization kind.
@ GNUNET_MESSENGER_KIND_ANNOUNCEMENT
The announcement kind.
@ GNUNET_MESSENGER_KIND_APPEAL
The appeal kind.
@ GNUNET_MESSENGER_KIND_ACCESS
The access kind.
@ GNUNET_MESSENGER_KIND_REVOLUTION
The revolution kind.
@ GNUNET_MESSENGER_KIND_SECRET
The secret kind.
@ GNUNET_MESSENGER_KIND_GROUP
The group kind.
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 specif...
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the group in an epoch.
struct GNUNET_MESSENGER_MessageAnnouncement announcement
struct GNUNET_MESSENGER_MessageGroup group
struct GNUNET_MESSENGER_MessageSecret secret
struct GNUNET_MESSENGER_MessageRevolution revolution
struct GNUNET_MESSENGER_MessageAccess access
struct GNUNET_MESSENGER_MessageAuthorization authorization
struct GNUNET_MESSENGER_MessageAppeal appeal
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the group in an epoch.
enum GNUNET_MESSENGER_MessageKind kind
The kind of the message.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_MESSENGER_Message * message

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_message()

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.

Parameters
[in]roomRoom
[in]hashHash of message
Returns
Message or NULL

Definition at line 1042 of file messenger_api_room.c.

1044{
1046
1047 GNUNET_assert ((room) && (hash));
1048
1049 if (! (room->messages))
1050 return NULL;
1051
1052 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1053
1054 if ((! entry) || (GNUNET_YES != entry->completed))
1055 return NULL;
1056
1057 return entry->message;
1058}
enum GNUNET_GenericReturnValue completed

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_room_message_sent()

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.

Parameters
[in]roomRoom
[in]hashHash of message
Returns
GNUNET_YES if it has been sent, GNUNET_SYSERR on failure, otherwise GNUNET_NO

Definition at line 1062 of file messenger_api_room.c.

1064{
1066
1067 GNUNET_assert ((room) && (hash));
1068
1069 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1070
1071 if (! entry)
1072 return GNUNET_SYSERR;
1073
1074 if (GNUNET_MESSENGER_FLAG_SENT & entry->flags)
1075 return GNUNET_YES;
1076 else
1077 return GNUNET_NO;
1078}
@ GNUNET_MESSENGER_FLAG_SENT
The sent flag.
enum GNUNET_MESSENGER_MessageFlags flags

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_sender()

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.

Parameters
[in]roomRoom
[in]hashHash of message
Returns
Contact of sender or NULL

Definition at line 1082 of file messenger_api_room.c.

1084{
1086
1087 GNUNET_assert ((room) && (hash));
1088
1089 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1090
1091 if ((! entry) || (GNUNET_YES != entry->completed))
1092 return NULL;
1093
1094 return entry->sender;
1095}
struct GNUNET_MESSENGER_Contact * sender

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_recipient()

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.

Parameters
[in]roomRoom
[in]hashHash of message
Returns
Contact of recipient or NULL

Definition at line 1099 of file messenger_api_room.c.

1101{
1103
1104 GNUNET_assert ((room) && (hash));
1105
1106 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1107
1108 if ((! entry) || (GNUNET_YES != entry->completed))
1109 return NULL;
1110
1111 return entry->recipient;
1112}
struct GNUNET_MESSENGER_Contact * recipient

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_room_epoch_hash()

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.

Parameters
[in]roomRoom
[in]hashHash of message
Returns
Hash of epoch or NULL

Definition at line 1116 of file messenger_api_room.c.

1118{
1120
1121 GNUNET_assert ((room) && (hash));
1122
1123 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1124
1125 if (! entry)
1126 return NULL;
1127
1128 return &(entry->epoch);
1129}

References GNUNET_MESSENGER_RoomMessageEntry::epoch, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), and GNUNET_MESSENGER_Room::messages.

Here is the call graph for this function:

◆ delete_room_message()

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.

Parameters
[in,out]roomRoom
[in]hashHash of message
[in]delayDelay of deletion

Definition at line 1133 of file messenger_api_room.c.

1136{
1137 struct GNUNET_MESSENGER_Message *message;
1138
1139 GNUNET_assert ((room) && (hash));
1140
1141 message = create_message_deletion (hash, delay);
1142
1143 if (! message)
1144 {
1146 "Sending deletion aborted: Message creation failed!\n");
1147 return;
1148 }
1149
1150 enqueue_message_to_room (room, NULL, message, NULL, GNUNET_NO);
1151}
@ GNUNET_ERROR_TYPE_WARNING
void enqueue_message_to_room(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *epoch, struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Message *transcript, enum GNUNET_GenericReturnValue sync)
Enqueus a message and its optional transcript for sending it to a given room and epoch.
struct GNUNET_MESSENGER_Message * create_message_deletion(const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Creates and allocates a new deletion message containing the hash of a message to delete after a speci...

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ callback_room_message()

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.

Parameters
[in,out]roomRoom
[in]hashHash of message

Definition at line 1155 of file messenger_api_room.c.

1157{
1160
1161 GNUNET_assert ((room) && (hash));
1162
1163 handle = room->handle;
1164 if (! handle)
1165 return;
1166
1167 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1168 if (! entry)
1169 return;
1170
1171 if (handle->msg_callback)
1172 handle->msg_callback (handle->msg_cls, room,
1173 entry->sender,
1174 entry->recipient,
1175 entry->message,
1176 hash,
1177 entry->flags);
1178
1181}
@ GNUNET_MESSENGER_FLAG_UPDATE
The update flag.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_room_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...)

Parameters
[in,out]roomRoom
[in,out]senderContact of sender
[in]messageMessage
[in]hashHash of message
[in]epochHash of epoch
[in]flagsFlags of message

Definition at line 2338 of file messenger_api_room.c.

2344{
2346
2347 GNUNET_assert ((room) && (message) && (hash));
2348
2349 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
2350
2351 if (entry)
2352 goto update_entry;
2353
2355
2356 if (! entry)
2357 return;
2358
2359 entry->sender = NULL;
2360 entry->recipient = NULL;
2361
2362 entry->message = NULL;
2363
2364 GNUNET_memcpy (&(entry->epoch), epoch, sizeof (entry->epoch));
2365
2367 entry->completed = GNUNET_NO;
2368
2370 room->messages, hash, entry,
2372 {
2373 GNUNET_free (entry);
2374 return;
2375 }
2376
2377update_entry:
2378 entry->sender = sender;
2379 entry->flags = flags;
2380
2381 if (entry->message)
2382 {
2385
2387 }
2388 else
2389 entry->message = copy_message (message);
2390
2391 entry->completed = GNUNET_YES;
2392 handle_message (room, hash, entry);
2393}
@ GNUNET_MESSENGER_KIND_PRIVATE
The private kind.
@ GNUNET_MESSENGER_FLAG_PRIVATE
The private flag.
@ GNUNET_MESSENGER_FLAG_NONE
The none flag.
struct GNUNET_MESSENGER_Message * copy_message(const struct GNUNET_MESSENGER_Message *message)
Creates and allocates a copy of a given message.
void copy_message_header(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_MESSENGER_MessageHeader *header)
Copy message header details from another message to a given message.
static void handle_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_room_message()

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.

Parameters
[in,out]roomRoom
[in]hashHash of message
Returns
GNUNET_YES if successful, GNUNET_NO on failure and otherwise GNUNET_SYSERR

Definition at line 2397 of file messenger_api_room.c.

2399{
2401
2402 GNUNET_assert ((room) && (hash));
2403
2404 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
2405
2406 if ((! entry) || (! entry->message))
2407 return GNUNET_SYSERR;
2408
2410 return GNUNET_NO;
2411
2413 handle_message (room, hash, entry);
2414 return GNUNET_YES;
2415}

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.

Here is the call graph for this function:

◆ update_room_secret_message()

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.

Parameters
[in,out]roomRoom
[in]hashHash of message
[in]keyEpoch key
[in]updateFlag message as update on success
Returns
GNUNET_YES if successful, GNUNET_NO on failure and otherwise GNUNET_SYSERR

Definition at line 2419 of file messenger_api_room.c.

2423{
2425 struct GNUNET_MESSENGER_Message *secret_message;
2426
2427 GNUNET_assert ((room) && (hash) && (key));
2428
2429 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
2430
2431 if ((! entry) || (! entry->message) ||
2433 return GNUNET_SYSERR;
2434
2435 secret_message = copy_message (entry->message);
2436
2437 if (! secret_message)
2438 return GNUNET_NO;
2439
2440 if (GNUNET_YES != decrypt_secret_message (secret_message, key))
2441 {
2442 destroy_message (secret_message);
2443 secret_message = NULL;
2444 }
2445
2446 if (! secret_message)
2447 return GNUNET_NO;
2448
2449 destroy_message (entry->message);
2450
2451 entry->message = secret_message;
2453
2454 if (GNUNET_YES == update)
2456
2457 if (entry->sender)
2458 handle_message (room, hash, entry);
2459
2460 return GNUNET_YES;
2461}
@ GNUNET_MESSENGER_FLAG_SECRET
The secret flag.
enum GNUNET_GenericReturnValue decrypt_secret_message(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Decrypts a secret message using a given shared key and replaces its body and kind with the inner encr...
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_room_last_message()

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.

Parameters
[in,out]roomRoom
[in]hashHash of message
[in]epochHash of epoch

Definition at line 2465 of file messenger_api_room.c.

2468{
2469 GNUNET_assert ((room) && (hash) && (epoch));
2470
2471 GNUNET_memcpy (&(room->last_message), hash, sizeof(room->last_message));
2472
2473 if (epoch)
2474 GNUNET_memcpy (&(room->last_epoch), epoch, sizeof(room->last_epoch));
2475}

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().

Here is the caller graph for this function:

◆ copy_room_last_message()

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.

Parameters
[in]roomRoom
[out]hashHash of message

Definition at line 2479 of file messenger_api_room.c.

2481{
2482 GNUNET_assert (room);
2483
2484 GNUNET_memcpy (hash, &(room->last_message), sizeof(room->last_message));
2485}

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().

Here is the caller graph for this function:

◆ 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.

Parameters
[in,out]roomRoom
[in]callbackFunction called for each member
[in,out]clsClosure
Returns
Amount of members iterated

Definition at line 2513 of file messenger_api_room.c.

2516{
2518
2520
2521 if (! callback)
2523
2524 call.room = room;
2525 call.callback = callback;
2526 call.cls = cls;
2527
2529
2532 &call);
2533}
static struct GNUNET_CONVERSATION_Call * call
Call handle (for active outgoing call).
static enum GNUNET_GenericReturnValue iterate_local_members(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
GNUNET_MESSENGER_MemberCallback callback
struct GNUNET_MESSENGER_Room * room

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
[in]roomRoom
[in]contact
Returns
GNUNET_YES if found, otherwise GNUNET_NO

Definition at line 2566 of file messenger_api_room.c.

2568{
2569 struct GNUNET_MESSENGER_MemberFind find;
2570
2571 GNUNET_assert (room);
2572
2573 find.contact = contact;
2574 find.result = GNUNET_NO;
2575
2577 room->members, iterate_find_member, &find);
2578
2579 return find.result;
2580}
static enum GNUNET_GenericReturnValue iterate_find_member(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
const struct GNUNET_MESSENGER_Contact * contact

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
[in,out]roomRoom
[in]hashHash of message
[in]otherHash of other message

Definition at line 2607 of file messenger_api_room.c.

2610{
2611 const struct GNUNET_HashCode **result;
2612 struct GNUNET_HashCode *value;
2613
2614 GNUNET_assert ((room) && (hash) && (other));
2615
2616 result = &other;
2619
2620 if (! *result)
2621 return;
2622
2623 value = GNUNET_memdup (other, sizeof(struct GNUNET_HashCode));
2624 if (! value)
2625 return;
2626
2628 room->links, hash, value,
2631}
static char * value
Value of the record to add/remove.
static int result
Global testing status.
#define GNUNET_memdup(buf, size)
Allocate and initialize a block of memory.
static enum GNUNET_GenericReturnValue find_linked_hash(void *cls, const struct GNUNET_HashCode *key, void *value)
A 512-bit hashcode.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
[in,out]roomRoom
[in]hashHash of message
[in]delayDelay for linked deletion
[in]deletionFunction called for each linked deletion

Definition at line 2698 of file messenger_api_room.c.

2702{
2704
2705 GNUNET_assert ((room) && (hash));
2706
2707 info.room = room;
2708 info.delay = delay;
2709 info.deletion = deletion;
2710
2714}
#define info
static enum GNUNET_GenericReturnValue delete_linked_hash(void *cls, const struct GNUNET_HashCode *key, void *value)
struct GNUNET_MESSENGER_Room * room
GNUNET_MESSENGER_RoomLinkDeletion deletion

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().

Here is the call graph for this function:
Here is the caller graph for this function: