153 subscription =
value;
155 if (subscription->
task)
310 room_epoch, contact? contact : entry->
sender))
380 room->
messages, target_hash, target))
471 room, hash, event_entry, entry->
sender);
514 if ((! entry) || (! entry->
message))
519 goto skip_delayed_handling;
536skip_delayed_handling:
556 room->
actions, &(action->hash), action))
831 if (! epoch_announcement)
835 &(epoch_announcement->
847 *announcement = epoch_announcement;
881 if ((! entry) || (! entry->
message))
997 return &(entry->
epoch);
1015 "Sending deletion aborted: Message creation failed!\n");
1040 if (
handle->msg_callback)
1058 uint32_t level, other_level;
1065 if (level > other_level)
1236 "A contact does not share any room with you anymore!\n");
1251 const char *handle_name;
1254 "Set rule for using handle name in room: %s\n",
1259 if ((handle_name) && (0 == strcmp (handle_name,
1377 if (! private_message)
1384 private_message = NULL;
1387 if (! private_message)
1394 entry->
message = private_message;
1436 goto read_transcript;
1451 room->
messages, original_hash, original,
1461 if (! original_message)
1488 original->
message = original_message;
1524 "Unsafe announcement: Nonce (%s) has already been used in this epoch! [%s]\n",
1601 announcement, entry->
message, hash);
1629 room, hash, event_entry, entry->
sender);
1655 "Appealing contact is already member of epoch announcement! [%s]\n",
1660 if (contact == event_entry->
sender)
1715 body.appeal.event));
1765 if ((
epoch->main_announcement) &&
1772 if ((
epoch->main_group) &&
1781 body.group.initiator));
1783 if ((! init_entry) || (event_entry->
sender != init_entry->
sender))
1812 main_announcement, &
1858 "Unsafe revolution: Nonce (%s) has already been used in this epoch! [%s]\n",
1988 uint32_t next_level;
2044 uint32_t next_level;
2087 entry->
message, group_key, &shared_key))
2253 if ((! entry) || (! entry->
message))
2278 if ((! entry) || (! entry->
message) ||
2284 if (! secret_message)
2290 secret_message = NULL;
2293 if (! secret_message)
2298 entry->
message = secret_message;
2355 return call->callback (
call->cls,
call->room, contact);
2527 linked = &key_value;
2531 if ((linked != &key_value) &&
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
static struct GNUNET_CONVERSATION_Call * call
Call handle (for active outgoing call).
struct GNUNET_HashCode key
The key used in the DHT.
static pa_context * context
Pulseaudio context.
static char * value
Value of the record to add/remove.
static int result
Global testing status.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
API to schedule computations using continuation passing style.
Functions related to time.
int GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
Compare function for HashCodes, producing a total ordering of all hashcodes.
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.
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_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
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).
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 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.
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.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
int GNUNET_CONTAINER_multishortmap_contains_value(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Check if the map contains the given value under the given key.
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
unsigned int GNUNET_CONTAINER_multihashmap_clear(struct GNUNET_CONTAINER_MultiHashMap *map)
Remove all entries 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.
int GNUNET_CONTAINER_multishortmap_remove(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Remove the given key-value pair from the map.
int GNUNET_CONTAINER_multishortmap_contains(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE
If a value with the given key exists, replace it.
#define GNUNET_is_zero(a)
Check that memory in a is all zeros.
#define GNUNET_log(kind,...)
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_SCHEDULER_PRIORITY_HIGH
Run with high priority (important requests).
@ GNUNET_SCHEDULER_PRIORITY_BACKGROUND
Run as background job (higher than idle, lower than default).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_memdup(buf, size)
Allocate and initialize a block of memory.
GNUNET_MESSENGER_MessageKind
Enum for the different supported kinds of messages.
GNUNET_MESSENGER_MessageFlags
Enum for the different supported flags used by message handling.
enum GNUNET_GenericReturnValue(* GNUNET_MESSENGER_MemberCallback)(void *cls, struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *contact)
Method called for each member in a room during iteration.
@ GNUNET_MESSENGER_KIND_MISS
The miss kind.
@ GNUNET_MESSENGER_KIND_AUTHORIZATION
The authorization kind.
@ GNUNET_MESSENGER_KIND_ANNOUNCEMENT
The announcement kind.
@ GNUNET_MESSENGER_KIND_PRIVATE
The private kind.
@ GNUNET_MESSENGER_KIND_APPEAL
The appeal kind.
@ GNUNET_MESSENGER_KIND_NAME
The name kind.
@ GNUNET_MESSENGER_KIND_ACCESS
The access kind.
@ GNUNET_MESSENGER_KIND_LEAVE
The leave kind.
@ GNUNET_MESSENGER_KIND_REVOLUTION
The revolution kind.
@ GNUNET_MESSENGER_KIND_TRANSCRIPT
The transcript kind.
@ GNUNET_MESSENGER_KIND_KEY
The key kind.
@ GNUNET_MESSENGER_KIND_SECRET
The secret kind.
@ GNUNET_MESSENGER_KIND_JOIN
The join kind.
@ GNUNET_MESSENGER_KIND_DELETION
The deletion kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
@ GNUNET_MESSENGER_KIND_GROUP
The group kind.
@ GNUNET_MESSENGER_KIND_ID
The id kind.
@ GNUNET_MESSENGER_FLAG_SECRET
The secret flag.
@ GNUNET_MESSENGER_FLAG_PRIVATE
The private flag.
@ GNUNET_MESSENGER_FLAG_SENT
The sent flag.
@ GNUNET_MESSENGER_FLAG_UPDATE
The update flag.
@ GNUNET_MESSENGER_FLAG_NONE
The none flag.
@ GNUNET_MESSENGER_FLAG_DELETE
The delete flag.
@ GNUNET_MESSENGER_FLAG_RECENT
The recent flag.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
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.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified priority.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero_(void)
Return relative time of 0ms.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_millisecond_(void)
Return relative time of 1ms.
bool GNUNET_TIME_relative_is_zero(struct GNUNET_TIME_Relative rel)
Test if rel is zero.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply_double(struct GNUNET_TIME_Relative rel, double factor)
Multiply relative time by a given factor.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
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.
void request_message_from_room(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Requests a specific message from a given room which can be identified by its hash.
void invalidate_epoch_keys_by_member(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact)
Invalidates all announced epoch and group keys by a specific contact inside a given epoch.
uint32_t get_epoch_size(const struct GNUNET_MESSENGER_Epoch *epoch)
Returns the amount of members by a given epoch or zero as long as it's not fully initialized yet.
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.
struct GNUNET_MESSENGER_EpochGroup * get_epoch_group(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
Returns the epoch group of a given epoch using a specific unique identifier or NULL.
enum GNUNET_GenericReturnValue delay_epoch_message_for_its_members(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_HashCode *hash)
Adds a message with a given hash to a list that can be delayed in processing for the members of a spe...
enum GNUNET_GenericReturnValue is_epoch_member(const struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is member of a given epoch.
void set_epoch_proposal_group(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_HashCode *hash)
Sets the current group of proposal for a given epoch to the group specified by a message identified b...
void destroy_epoch(struct GNUNET_MESSENGER_Epoch *epoch)
Destroys an epoch and frees its memory fully from the client API.
struct GNUNET_MESSENGER_EpochAnnouncement * get_epoch_announcement(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
Returns the epoch announcement of a given epoch using a specific unique identifier or NULL.
void reset_epoch_size(struct GNUNET_MESSENGER_Epoch *epoch)
Resets the amount of members by a given epoch to recalculate the exact amount.
double get_epoch_position_factor(const struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact, const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns a relative member positon of a specific contact inside a given epoch in relation to its list ...
enum GNUNET_GenericReturnValue send_epoch_announcement_access(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *event)
Tries to send an access message by the client responding to a previous event in regards to a given ep...
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...
enum GNUNET_GenericReturnValue get_epoch_announcement_member_hash(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue other)
Provides an announcement hash of a member from a given epoch announcement.
void set_epoch_announcement_appeal(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, struct GNUNET_TIME_Relative timeout)
Sets a specified timeout for a given epoch announcement of the client for its own appeal of the annou...
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.
enum GNUNET_GenericReturnValue revoke_epoch_announcement_member(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact)
Revokes an announcement message with its hash from a given epoch announcement removing the caused con...
void destroy_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Destroys a given epoch announcement and frees its resources.
enum GNUNET_GenericReturnValue is_epoch_announcement_member(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is confirmed member of a given epoch announcement.
void handle_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch announcement as first ...
void invalidate_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
Invalidates a given epoch announcement by a specific contact.
void handle_epoch_announcement_access(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles an access message with hash from its sender inside a given epoch announcement.
void handle_epoch_announcement_message(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles an encrypted message with hash by a given epoch announcement using its secret key for decrypt...
void handle_epoch_announcement_delay(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch announcement as second...
enum GNUNET_GenericReturnValue send_epoch_group_announcement(struct GNUNET_MESSENGER_EpochGroup *group)
Tries to send an announcement message by the client for a given epoch group using its secret key.
void handle_epoch_group_announcement_delay(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch group as second stage ...
void invalidate_epoch_group(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Contact *contact)
Invalidates a given epoch group by a specific contact.
void handle_epoch_group_access(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles an access message with hash from its sender inside a given epoch group.
enum GNUNET_GenericReturnValue send_epoch_group_access(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_HashCode *event)
Tries to send an access message by the client responding to a previous event in regards to a given ep...
uint32_t get_epoch_group_level(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the group level of a given epoch group.
void set_epoch_group_key(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, enum GNUNET_GenericReturnValue write_record)
Sets the secret key of a given epoch group to a shared key.
void handle_epoch_group_announcement(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch group as first stage.
const struct GNUNET_CRYPTO_SymmetricSessionKey * get_epoch_group_key(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the secret key of a given epoch group or NULL.
enum GNUNET_GenericReturnValue get_epoch_group_member_hash(const struct GNUNET_MESSENGER_EpochGroup *group, struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue other)
Provides an announcement hash of a member from a given epoch group.
struct GNUNET_MESSENGER_ContactStore * get_handle_contact_store(struct GNUNET_MESSENGER_Handle *handle)
Returns the used contact store of a given handle.
struct GNUNET_MESSENGER_Contact * get_handle_contact(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Returns the contact of a given handle in a room identified by a given key.
const char * get_handle_name(const struct GNUNET_MESSENGER_Handle *handle)
Returns the current name of a given handle or NULL if no valid name was assigned yet.
const struct GNUNET_CRYPTO_PrivateKey * get_handle_key(const struct GNUNET_MESSENGER_Handle *handle)
Returns the private key of a given handle.
const struct GNUNET_CRYPTO_PublicKey * get_handle_pubkey(const struct GNUNET_MESSENGER_Handle *handle)
Returns the public key of a given handle.
void init_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Initializes list of tunnels peer identities as empty list.
struct GNUNET_MESSENGER_ListTunnel * find_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer, size_t *index)
Searches linearly through the list of tunnels peer identities for matching a specific peer identity a...
void clear_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Clears the list of tunnels peer identities.
struct GNUNET_MESSENGER_ListTunnel * remove_from_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, struct GNUNET_MESSENGER_ListTunnel *element)
Removes a specific element from the list of tunnels peer identities and returns the next element in t...
struct GNUNET_TIME_Relative get_message_timeout(const struct GNUNET_MESSENGER_Message *message)
Return the relative timeout of the content from a given message that controls when a delayed handling...
enum GNUNET_GenericReturnValue verify_message_by_key(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Verifies the hmac of a given message body with a specific shared key.
struct GNUNET_MESSENGER_Message * copy_message(const struct GNUNET_MESSENGER_Message *message)
Creates and allocates a copy of a given message.
enum GNUNET_GenericReturnValue extract_authorization_message_key(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key, struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key)
Extracts the shared epoch or group key from an authorization message using a previously exchanged sha...
enum GNUNET_GenericReturnValue is_epoch_message(const struct GNUNET_MESSENGER_Message *message)
Returns whether a certain kind of message from storage contains some specific details that might be r...
enum GNUNET_GenericReturnValue decrypt_message(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_PrivateKey *key)
Decrypts a private message using a given private key and replaces its body and kind with the inner en...
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 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.
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
enum GNUNET_GenericReturnValue read_transcript_message(struct GNUNET_MESSENGER_Message *message)
Read the original message from a transcript message and replaces its body and kind with the inner enc...
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 destroy_message_control(struct GNUNET_MESSENGER_MessageControl *control)
Destroys a message control and frees its memory fully from the client API.
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...
void init_queue_messages(struct GNUNET_MESSENGER_QueueMessages *messages)
Initializes queue of messages as empty queue.
void clear_queue_messages(struct GNUNET_MESSENGER_QueueMessages *messages)
Clears the queue of messages.
static enum GNUNET_GenericReturnValue is_epoch_identifier_upper(const union GNUNET_MESSENGER_EpochIdentifier *identifier, const union GNUNET_MESSENGER_EpochIdentifier *other)
static void handle_name_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue iterate_room_request(void *cls, const struct GNUNET_HashCode *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 depend...
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.
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 identi...
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.
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_destroy_epoch(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 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 ca...
static void handle_appeal_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)
static void handle_id_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
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.
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.
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 informatio...
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 ...
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 usi...
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 us...
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.
static void handle_secret_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
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...
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...
static enum GNUNET_GenericReturnValue iterate_destroy_subscription(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
static enum GNUNET_GenericReturnValue iterate_cancel_action_by(void *cls, const struct GNUNET_HashCode *hash, void *value)
static void handle_announcement_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
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 agai...
static void handle_access_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_room_request_task(void *cls)
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 ...
static void handle_group_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue iterate_destroy_action(void *cls, const struct GNUNET_HashCode *key, void *value)
static enum GNUNET_GenericReturnValue iterate_find_member(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
static void handle_room_delayed_announcement(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry)
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 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 poi...
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_revolution_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
enum GNUNET_GenericReturnValue is_room_available(const struct GNUNET_MESSENGER_Room *room)
Checks whether a room is available to send messages.
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.
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...
static void handle_join_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_room_action_task(void *cls)
static void handle_leave_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_transcript_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue iterate_destroy_link(void *cls, const struct GNUNET_HashCode *key, void *value)
static enum GNUNET_GenericReturnValue is_message_entry_recent(const 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 enum GNUNET_GenericReturnValue iterate_room_epoch_member_invalidation(void *cls, const struct GNUNET_HashCode *key, void *value)
static void handle_delete_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
const struct GNUNET_HashCode * get_room_key(const struct GNUNET_MESSENGER_Room *room)
Return a the hash representation of a given room.
static enum GNUNET_GenericReturnValue iterate_cancel_action(void *cls, const struct GNUNET_HashCode *hash, void *value)
static enum GNUNET_GenericReturnValue iterate_destroy_message(void *cls, const struct GNUNET_HashCode *key, void *value)
struct GNUNET_MESSENGER_Handle * get_room_handle(struct GNUNET_MESSENGER_Room *room)
Returns the messenger handle of the room.
static void handle_room_delayed_appeal(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry)
const struct GNUNET_ShortHashCode * get_room_sender_id(const struct GNUNET_MESSENGER_Room *room)
Returns the member id of the room's sender.
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_action(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
static void handle_merge_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue clear_linked_hash(void *cls, const struct GNUNET_HashCode *key, void *value)
static enum GNUNET_GenericReturnValue iterate_local_members(void *cls, const struct GNUNET_ShortHashCode *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 oth...
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 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 o...
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 cu...
void destroy_room(struct GNUNET_MESSENGER_Room *room)
Destroys a room and frees its memory fully from the client API.
static enum GNUNET_GenericReturnValue find_linked_hash(void *cls, const struct GNUNET_HashCode *key, void *value)
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.
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.
void(* GNUNET_MESSENGER_RoomLinkDeletion)(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Internal representation of the hash map.
struct GNUNET_MESSENGER_Epoch * epoch
struct GNUNET_CRYPTO_SymmetricSessionKey * shared_key
union GNUNET_MESSENGER_EpochIdentifier identifier
struct GNUNET_CRYPTO_SymmetricSessionKey * shared_key
struct GNUNET_MESSENGER_Epoch * epoch
union GNUNET_MESSENGER_EpochIdentifier identifier
struct GNUNET_MESSENGER_Room * room
struct GNUNET_CONTAINER_MultiShortmap * announcements
struct GNUNET_MESSENGER_EpochGroup * main_group
struct GNUNET_CONTAINER_MultiShortmap * nonces
struct GNUNET_MESSENGER_EpochAnnouncement * main_announcement
struct GNUNET_HashCode hash
struct GNUNET_HashCode * hash
struct GNUNET_MESSENGER_ListTunnel * head
GNUNET_MESSENGER_MemberCallback callback
struct GNUNET_MESSENGER_Room * room
const struct GNUNET_MESSENGER_Contact * contact
enum GNUNET_GenericReturnValue result
struct GNUNET_HashCode event
The hash of the linked announcement or group message event.
union GNUNET_MESSENGER_EpochNonce nonce
The nonce of the announcement.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
struct GNUNET_HashCode event
The hash of the linked announcement message event.
struct GNUNET_HashCode event
The hash of the linked group message event.
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_MessageDeletion deletion
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_MESSENGER_MessageId id
struct GNUNET_MESSENGER_MessageName name
struct GNUNET_MESSENGER_MessageLeave leave
struct GNUNET_MESSENGER_MessageTranscript transcript
struct GNUNET_MESSENGER_MessageRevolution revolution
struct GNUNET_MESSENGER_MessageKey key
struct GNUNET_MESSENGER_MessageAccess access
struct GNUNET_MESSENGER_MessageAuthorization authorization
struct GNUNET_MESSENGER_MessageAppeal appeal
struct GNUNET_MESSENGER_MessageMiss miss
struct GNUNET_MESSENGER_MessageJoin join
struct GNUNET_HashCode hash
The hash of the message to delete.
struct GNUNET_HashCode initiator
The hash of the initiator group announcement.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the group in an epoch.
struct GNUNET_HashCode partner
The hash of the partner group announcement.
struct GNUNET_ShortHashCode id
The new id which will replace the senders id in a room.
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_CRYPTO_PublicKey key
The senders public key to verify its signatures.
struct GNUNET_CRYPTO_PublicKey key
The new public key which replaces the current senders public key.
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_HashCode epochs[2]
The previous epochs the message was sent from.
struct GNUNET_PeerIdentity peer
The peer identity of a disconnected door to a room.
char * name
The new name which replaces the current senders name.
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_HashCode hash
The hash of the original message.
struct GNUNET_CRYPTO_PublicKey key
The key from the recipient of the original message.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_HashCode hash
struct GNUNET_MESSENGER_Room * room
const struct GNUNET_HashCode * epoch_hash
const struct GNUNET_MESSENGER_Contact * contact
enum GNUNET_MESSENGER_MessageKind kind
const union GNUNET_MESSENGER_EpochIdentifier * identifier
struct GNUNET_CONTAINER_MultiHashMap * map
struct GNUNET_TIME_Relative delay
struct GNUNET_MESSENGER_Room * room
GNUNET_MESSENGER_RoomLinkDeletion deletion
struct GNUNET_MESSENGER_Contact * recipient
enum GNUNET_MESSENGER_MessageFlags flags
struct GNUNET_MESSENGER_Message * message
struct GNUNET_HashCode epoch
struct GNUNET_MESSENGER_Contact * sender
enum GNUNET_GenericReturnValue completed
struct GNUNET_SCHEDULER_Task * task
struct GNUNET_MESSENGER_Message * message
struct GNUNET_CONTAINER_MultiHashMap * links
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_ShortHashCode * sender_id
struct GNUNET_HashCode last_message
Time for relative time used by GNUnet, in microseconds.
An epoch identifier unifies an epoch identifier code and its 256bit hash representation.
struct GNUNET_ShortHashCode hash
struct GNUNET_MESSENGER_EpochIdentifierCode code
An epoch nonce unifies the epoch nonce data and its 256bit hash representation.
struct GNUNET_ShortHashCode hash
A room key unifies a room key code and its 512bit hash representation.
struct GNUNET_MESSENGER_RoomKeyCode code
struct GNUNET_HashCode hash