#include "messenger_api_epoch_group.h"
#include "messenger_api_epoch.h"
#include "messenger_api_message.h"
#include "messenger_api_message_kind.h"
#include "messenger_api_room.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_MESSENGER_CheckEpochGroup |
struct | GNUNET_MESSENGER_CheckEpoch |
struct | GNUNET_MESSENGER_CheckEpochAnnouncement |
Functions | |
static void | random_epoch_group_identifier (uint32_t level, union GNUNET_MESSENGER_EpochIdentifier *identifier) |
static enum GNUNET_GenericReturnValue | derive_epoch_group_key (const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_EpochGroup *previous, struct GNUNET_CRYPTO_SymmetricSessionKey *key) |
struct GNUNET_MESSENGER_EpochGroup * | create_epoch_group (struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, uint32_t level, enum GNUNET_GenericReturnValue valid) |
Creates and allocates a new epoch group for a given epoch using a specific group identifier or NULL and a specified level. More... | |
void | destroy_epoch_group (struct GNUNET_MESSENGER_EpochGroup *group) |
Destroys a given epoch group and frees its resources. More... | |
uint32_t | get_epoch_group_level (const struct GNUNET_MESSENGER_EpochGroup *group) |
Returns the group level of a given epoch group. More... | |
uint32_t | get_epoch_group_size (const struct GNUNET_MESSENGER_EpochGroup *group) |
Returns the size of a given epoch group in terms of members. More... | |
uint32_t | get_epoch_group_members_count (const struct GNUNET_MESSENGER_EpochGroup *group) |
Returns the current amount of members of a given epoch group. More... | |
enum GNUNET_GenericReturnValue | is_epoch_group_completed (const struct GNUNET_MESSENGER_EpochGroup *group) |
Returns whether a given epoch group is complete in terms of confirmed announcements from its members. More... | |
enum GNUNET_GenericReturnValue | is_epoch_group_announced (const struct GNUNET_MESSENGER_EpochGroup *group) |
Returns whether the client has announced being part of a given epoch group owning its secret key. More... | |
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. More... | |
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. More... | |
static enum GNUNET_GenericReturnValue | is_epoch_group_key_derived_from (const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_EpochGroup *previous) |
enum GNUNET_GenericReturnValue | confirm_epoch_group_member (struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact, enum GNUNET_GenericReturnValue sent) |
Confirms an announcement message with its hash to a given epoch group as confirmation for a specific contact. More... | |
static uint32_t | get_epoch_group_member_position (const struct GNUNET_MESSENGER_EpochGroup *group) |
enum GNUNET_GenericReturnValue | is_epoch_group_member (const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Contact *contact) |
Returns whether a specific contact is confirmed member of a given epoch group. More... | |
enum GNUNET_GenericReturnValue | it_check_epoch_group_member (void *cls, const struct GNUNET_MESSENGER_Contact *member) |
enum GNUNET_GenericReturnValue | is_epoch_group_subgroup_of (const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_EpochGroup *other) |
Returns whether a given epoch group is subgroup of a specific other group. More... | |
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. More... | |
void | invalidate_epoch_group (struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Contact *contact) |
Invalidates a given epoch group by a specific contact. More... | |
enum GNUNET_GenericReturnValue | is_epoch_group_proposal (const struct GNUNET_MESSENGER_EpochGroup *group) |
Returns whether a given epoch group is the current proposal of the client. More... | |
enum GNUNET_GenericReturnValue | it_check_epoch_member (void *cls, const struct GNUNET_MESSENGER_Contact *member) |
enum GNUNET_GenericReturnValue | is_epoch_group_compatible (const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Epoch *epoch) |
Returns whether a given epoch group is compatible with a specific epoch with its members. More... | |
enum GNUNET_GenericReturnValue | it_check_epoch_announcement_member (void *cls, const struct GNUNET_MESSENGER_Contact *member) |
enum GNUNET_GenericReturnValue | is_epoch_group_missing_announcement (const struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_EpochAnnouncement *announcement) |
Returns whether any member of a given epoch group is missing in a provided epoch announcement. More... | |
double | get_epoch_group_position_factor (const struct GNUNET_MESSENGER_EpochGroup *group) |
Returns a relative member positon of the client inside a given epoch group in relation to its list of members. More... | |
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. More... | |
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 epoch group using its secret key. More... | |
enum GNUNET_GenericReturnValue | send_epoch_group_revolution (struct GNUNET_MESSENGER_EpochGroup *group) |
Tries to send a revolution message by the client for a given epoch group using its secret key. More... | |
enum GNUNET_GenericReturnValue | send_epoch_group (struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_HashCode *initiator_event, const struct GNUNET_HashCode *partner_event, struct GNUNET_TIME_Relative timeout) |
Tries to send a group message by the client for a given epoch group to propose it forming a group out of the subgroups from two previous events and a timeout. More... | |
enum GNUNET_GenericReturnValue | send_epoch_group_authorization (struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_HashCode *event) |
Tries to send an authorization message by the client responding to a previous event in regards to a given epoch group using its secret key. More... | |
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. More... | |
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 after custom delay. More... | |
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. More... | |
static void | cont_write_epoch_group_record (void *cls, enum GNUNET_ErrorCode ec) |
void | write_epoch_group_record (struct GNUNET_MESSENGER_EpochGroup *group, enum GNUNET_GenericReturnValue deleted) |
Writes/Deletes the GNS record of a given epoch group depending on a provided flag that states wether an existing record should be deleted. More... | |
|
static |
Definition at line 34 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_assert, GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CRYPTO_random_block(), GNUNET_MESSENGER_EpochIdentifierCode::group_bit, and GNUNET_MESSENGER_EpochIdentifierCode::level_bits.
Referenced by create_epoch_group().
|
static |
Definition at line 50 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group_key(), GNUNET_assert, GNUNET_CRYPTO_kdf(), GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_EpochGroup::identifier, and key.
Referenced by create_epoch_group(), and is_epoch_group_key_derived_from().
struct GNUNET_MESSENGER_EpochGroup * create_epoch_group | ( | struct GNUNET_MESSENGER_Epoch * | epoch, |
const union GNUNET_MESSENGER_EpochIdentifier * | identifier, | ||
uint32_t | level, | ||
enum GNUNET_GenericReturnValue | valid | ||
) |
Creates and allocates a new epoch group for a given epoch using a specific group identifier or NULL and a specified level.
Additionally a flag specifies whether that group needs to be valid to allow key derivation based on that property.
[in,out] | epoch | Epoch |
[in] | identifier | Group identifier |
[in] | level | Group level |
[in] | valid | Validity flag |
Definition at line 79 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochGroup::announcement_expiration, GNUNET_MESSENGER_EpochIdentifier::code, create_epoch_membership(), derive_epoch_group_key(), GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group_size(), get_epoch_previous_group(), GNUNET_assert, GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_TIME_absolute_get_zero_(), GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_EpochGroup::identifier, key, GNUNET_MESSENGER_EpochGroup::membership, GNUNET_MESSENGER_EpochGroup::query, random_epoch_group_identifier(), set_epoch_group_key(), GNUNET_MESSENGER_EpochGroup::shared_key, GNUNET_MESSENGER_EpochGroup::stored, and GNUNET_MESSENGER_EpochGroup::valid.
Referenced by get_epoch_group(), and propose_epoch_group().
void destroy_epoch_group | ( | struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Destroys a given epoch group and frees its resources.
[in,out] | group | Epoch group |
Definition at line 137 of file messenger_api_epoch_group.c.
References destroy_epoch_membership(), GNUNET_assert, GNUNET_free, GNUNET_NAMESTORE_cancel(), GNUNET_MESSENGER_EpochGroup::membership, GNUNET_MESSENGER_EpochGroup::query, and GNUNET_MESSENGER_EpochGroup::shared_key.
Referenced by get_epoch_group(), iterate_destroy_group(), and propose_epoch_group().
uint32_t get_epoch_group_level | ( | const struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Returns the group level of a given epoch group.
[in] | group | Epoch group |
Definition at line 155 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochIdentifier::code, GNUNET_assert, GNUNET_MESSENGER_EpochGroup::identifier, and GNUNET_MESSENGER_EpochIdentifierCode::level_bits.
Referenced by get_epoch_group_size(), handle_authorization_message(), handle_epoch_group_access(), handle_epoch_group_announcement(), is_epoch_group_subgroup_of(), is_epoch_subgroup_of_any_group(), propose_epoch_group(), and send_epoch_group_authorization().
uint32_t get_epoch_group_size | ( | const struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Returns the size of a given epoch group in terms of members.
[in] | group | Epoch group |
Definition at line 164 of file messenger_api_epoch_group.c.
References get_epoch_group_level(), and GNUNET_assert.
Referenced by create_epoch_group().
uint32_t get_epoch_group_members_count | ( | const struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Returns the current amount of members of a given epoch group.
[in] | group | Epoch group |
Definition at line 173 of file messenger_api_epoch_group.c.
References get_epoch_membership_count(), GNUNET_assert, and GNUNET_MESSENGER_EpochGroup::membership.
Referenced by get_epoch_group_position_factor(), and is_other_epoch_group_better().
enum GNUNET_GenericReturnValue is_epoch_group_completed | ( | const struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Returns whether a given epoch group is complete in terms of confirmed announcements from its members.
[in] | group | Epoch group |
Definition at line 183 of file messenger_api_epoch_group.c.
References GNUNET_assert, is_epoch_membership_completed(), and GNUNET_MESSENGER_EpochGroup::membership.
Referenced by cancel_epoch_proposal_group(), get_epoch_group_position_factor(), handle_epoch_group_announcement(), handle_epoch_group_announcement_delay(), is_epoch_group_compatible(), is_epoch_group_subgroup_of(), propose_epoch_group(), and update_epoch_group().
enum GNUNET_GenericReturnValue is_epoch_group_announced | ( | const struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Returns whether the client has announced being part of a given epoch group owning its secret key.
[in] | group | Epoch group |
Definition at line 192 of file messenger_api_epoch_group.c.
References GNUNET_assert, is_epoch_membership_member(), and GNUNET_MESSENGER_EpochGroup::membership.
Referenced by handle_epoch_group_announcement(), and it_move_epoch_groups_from_previous_epoch().
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.
An additional flag decides whether the shared key has been loaded from storage or whether it should write its record afterwards.
[in,out] | group | Epoch group |
[in] | shared_key | Shared key or NULL |
[in] | write_record | GNUNET_YES if the record should be written, otherwise GNUNET_NO |
Definition at line 201 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_assert, GNUNET_CRYPTO_symmetric_create_session_key(), GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_EpochGroup::shared_key, GNUNET_MESSENGER_EpochGroup::stored, update_epoch_group(), and write_epoch_group_record().
Referenced by cb_key_monitor(), create_epoch_group(), handle_authorization_message(), handle_epoch_group_access(), and handle_group_message().
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.
[in] | group | Epoch group |
Definition at line 232 of file messenger_api_epoch_group.c.
References GNUNET_assert, and GNUNET_MESSENGER_EpochGroup::shared_key.
Referenced by create_new_epoch(), derive_epoch_group_key(), handle_authorization_message(), handle_epoch_group_announcement(), handle_revolution_message(), is_epoch_group_key_derived_from(), it_find_valid_group_with_most_members(), it_move_epoch_groups_from_previous_epoch(), send_epoch_announcement_authorization(), send_epoch_group_access(), send_epoch_group_announcement(), send_epoch_group_authorization(), send_epoch_group_revolution(), and update_epoch_group().
|
static |
Definition at line 241 of file messenger_api_epoch_group.c.
References derive_epoch_group_key(), get_epoch_group_key(), GNUNET_assert, GNUNET_memcmp, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, and key.
Referenced by invalidate_epoch_group().
enum GNUNET_GenericReturnValue confirm_epoch_group_member | ( | struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_HashCode * | hash, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
struct GNUNET_MESSENGER_Contact * | contact, | ||
enum GNUNET_GenericReturnValue | sent | ||
) |
Confirms an announcement message with its hash to a given epoch group as confirmation for a specific contact.
An additional flag specifies whether the message has been sent by the client or not.
[in,out] | group | Epoch group |
[in] | hash | Hash of message |
[in] | message | Message |
[in,out] | contact | Contact |
[in] | sent | Sent flag |
Definition at line 267 of file messenger_api_epoch_group.c.
References confirm_epoch_membership_announcment(), GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_assert, GNUNET_SYSERR, GNUNET_YES, is_epoch_member(), GNUNET_MESSENGER_EpochGroup::membership, result, and update_epoch_group().
Referenced by handle_epoch_group_announcement().
|
static |
Definition at line 295 of file messenger_api_epoch_group.c.
References get_epoch_membership_member_position(), GNUNET_assert, and GNUNET_MESSENGER_EpochGroup::membership.
Referenced by get_epoch_group_position_factor().
enum GNUNET_GenericReturnValue is_epoch_group_member | ( | const struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_MESSENGER_Contact * | contact | ||
) |
Returns whether a specific contact is confirmed member of a given epoch group.
[in] | group | Epoch group |
[in] | contact | Contact |
Definition at line 305 of file messenger_api_epoch_group.c.
References GNUNET_assert, is_epoch_membership_member(), and GNUNET_MESSENGER_EpochGroup::membership.
Referenced by handle_epoch_group_announcement(), is_epoch_member_in_any_group(), and it_check_epoch_group_member().
enum GNUNET_GenericReturnValue it_check_epoch_group_member | ( | void * | cls, |
const struct GNUNET_MESSENGER_Contact * | member | ||
) |
Definition at line 321 of file messenger_api_epoch_group.c.
References GNUNET_assert, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_CheckEpochGroup::group, is_epoch_group_member(), and GNUNET_MESSENGER_CheckEpochGroup::result.
Referenced by is_epoch_group_subgroup_of().
enum GNUNET_GenericReturnValue is_epoch_group_subgroup_of | ( | const struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_MESSENGER_EpochGroup * | other | ||
) |
Returns whether a given epoch group is subgroup of a specific other group.
[in] | group | Epoch group |
[in] | other | Other epoch group |
Definition at line 339 of file messenger_api_epoch_group.c.
References get_epoch_group_level(), GNUNET_assert, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_CheckEpochGroup::group, is_epoch_group_completed(), it_check_epoch_group_member(), iterate_epoch_membership_members(), GNUNET_MESSENGER_EpochGroup::membership, and GNUNET_MESSENGER_CheckEpochGroup::result.
Referenced by is_epoch_subgroup_of_any_group().
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.
Depending on a flag it provides some hash of another member or the clients own announcement.
[in] | group | Epoch group |
[out] | hash | Hash of announcement |
[in] | other | Other flag |
Definition at line 367 of file messenger_api_epoch_group.c.
References get_epoch_membership_member_hash(), GNUNET_assert, GNUNET_MESSENGER_CheckEpochGroup::group, and GNUNET_MESSENGER_EpochGroup::membership.
Referenced by handle_access_message(), and propose_epoch_group().
void invalidate_epoch_group | ( | struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_MESSENGER_Contact * | contact | ||
) |
Invalidates a given epoch group by a specific contact.
[in,out] | group | Epoch group |
[in] | contact | Contact |
Definition at line 378 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_MessageJoin::epoch, GNUNET_MESSENGER_MessageLeave::epoch, GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_MESSENGER_MessageMerge::epochs, get_epoch_group(), get_room_epoch(), get_room_message(), GNUNET_assert, GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_KIND_LEAVE, GNUNET_MESSENGER_KIND_MERGE, GNUNET_NO, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_EpochGroup::identifier, invalidate_epoch_group(), is_epoch_group_key_derived_from(), is_epoch_member(), GNUNET_MESSENGER_MessageBody::join, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MessageBody::leave, GNUNET_MESSENGER_Epoch::main_group, GNUNET_MESSENGER_MessageBody::merge, GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_EpochGroup::valid, and write_epoch_group_record().
Referenced by handle_revolution_message(), invalidate_epoch_group(), and iterate_epoch_group_invalidation().
enum GNUNET_GenericReturnValue is_epoch_group_proposal | ( | const struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Returns whether a given epoch group is the current proposal of the client.
[in] | group | Epoch group |
Definition at line 471 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_proposal_group(), GNUNET_assert, GNUNET_NO, and GNUNET_YES.
Referenced by handle_epoch_group_announcement(), and update_epoch_group().
enum GNUNET_GenericReturnValue it_check_epoch_member | ( | void * | cls, |
const struct GNUNET_MESSENGER_Contact * | member | ||
) |
Definition at line 489 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_CheckEpoch::epoch, GNUNET_assert, GNUNET_NO, GNUNET_YES, GNUNET_MESSENGER_Epoch::members, GNUNET_MESSENGER_Epoch::members_count, and GNUNET_MESSENGER_CheckEpoch::result.
Referenced by is_epoch_group_compatible().
enum GNUNET_GenericReturnValue is_epoch_group_compatible | ( | const struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_MESSENGER_Epoch * | epoch | ||
) |
Returns whether a given epoch group is compatible with a specific epoch with its members.
[in] | group | Epoch group |
[in] | epoch | Epoch |
Definition at line 509 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_CheckEpoch::epoch, GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_assert, GNUNET_NO, GNUNET_YES, is_epoch_group_completed(), it_check_epoch_member(), iterate_epoch_membership_members(), GNUNET_MESSENGER_Epoch::members_count, GNUNET_MESSENGER_EpochGroup::membership, GNUNET_MESSENGER_CheckEpoch::result, and GNUNET_MESSENGER_EpochGroup::valid.
Referenced by create_new_epoch(), handle_epoch_announcement_access(), and it_move_epoch_groups_from_previous_epoch().
enum GNUNET_GenericReturnValue it_check_epoch_announcement_member | ( | void * | cls, |
const struct GNUNET_MESSENGER_Contact * | member | ||
) |
Definition at line 546 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_CheckEpochAnnouncement::announcement, GNUNET_assert, GNUNET_NO, GNUNET_YES, is_epoch_announcement_member(), and GNUNET_MESSENGER_CheckEpochAnnouncement::result.
Referenced by is_epoch_group_missing_announcement().
enum GNUNET_GenericReturnValue is_epoch_group_missing_announcement | ( | const struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_MESSENGER_EpochAnnouncement * | announcement | ||
) |
Returns whether any member of a given epoch group is missing in a provided epoch announcement.
[in] | group | Epoch group |
[in] | announcement | Epoch announcement |
Definition at line 565 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_CheckEpochAnnouncement::announcement, get_epoch_announcement_members_count(), GNUNET_assert, GNUNET_NO, GNUNET_YES, it_check_epoch_announcement_member(), iterate_epoch_membership_members(), GNUNET_MESSENGER_EpochGroup::membership, and GNUNET_MESSENGER_CheckEpochAnnouncement::result.
Referenced by handle_epoch_announcement_access().
double get_epoch_group_position_factor | ( | const struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Returns a relative member positon of the client inside a given epoch group in relation to its list of members.
[in] | group | Epoch group |
Definition at line 590 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group_member_position(), get_epoch_group_members_count(), get_epoch_previous_group(), GNUNET_assert, GNUNET_NO, GNUNET_MESSENGER_EpochGroup::identifier, and is_epoch_group_completed().
Referenced by handle_epoch_announcement().
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.
[in,out] | group | Epoch group |
Definition at line 626 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochGroup::announcement_expiration, create_message_announcement(), GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group_key(), get_epoch_private_key(), get_epoch_private_key_timeout(), GNUNET_assert, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_relative_get_hour_(), GNUNET_TIME_relative_is_zero(), GNUNET_TIME_relative_multiply(), GNUNET_YES, GNUNET_MESSENGER_EpochGroup::identifier, key, send_epoch_message(), and timeout.
Referenced by create_new_epoch(), handle_authorization_message(), handle_epoch_group_access(), and handle_epoch_group_announcement().
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 epoch group using its secret key.
[in,out] | group | Epoch group |
[in] | event | Hash of event message |
Definition at line 675 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, create_message_access(), GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group_key(), get_room_message(), GNUNET_assert, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_MESSENGER_KIND_GROUP, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_MessageBody::group, GNUNET_MESSENGER_Message::header, is_room_message_sent(), key, GNUNET_MESSENGER_MessageAnnouncement::key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_Epoch::room, and send_epoch_message().
Referenced by handle_group_message().
enum GNUNET_GenericReturnValue send_epoch_group_revolution | ( | struct GNUNET_MESSENGER_EpochGroup * | group | ) |
Tries to send a revolution message by the client for a given epoch group using its secret key.
[in,out] | group | Epoch group |
Definition at line 723 of file messenger_api_epoch_group.c.
References create_message_revolution(), GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group_key(), GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, GNUNET_MESSENGER_EpochGroup::identifier, key, and send_epoch_message().
Referenced by handle_epoch_group_announcement().
enum GNUNET_GenericReturnValue send_epoch_group | ( | struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_HashCode * | initiator_event, | ||
const struct GNUNET_HashCode * | partner_event, | ||
struct GNUNET_TIME_Relative | timeout | ||
) |
Tries to send a group message by the client for a given epoch group to propose it forming a group out of the subgroups from two previous events and a timeout.
[in,out] | group | Epoch group |
[in] | initiator_event | Hash of initiator event message |
[in] | partner_event | Hash of partner event message |
[in] | timeout | Timeout for group |
Definition at line 747 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_EpochIdentifierCode::bits, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, create_message_group(), GNUNET_MESSENGER_EpochGroup::epoch, get_room_message(), get_room_sender(), GNUNET_assert, GNUNET_CRYPTO_hash_cmp(), GNUNET_memcmp, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_EpochGroup::identifier, is_room_message_sent(), GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_EpochIdentifierCode::level_bits, GNUNET_MESSENGER_Epoch::room, send_epoch_message(), and timeout.
Referenced by propose_epoch_group().
enum GNUNET_GenericReturnValue send_epoch_group_authorization | ( | struct GNUNET_MESSENGER_EpochGroup * | group, |
const struct GNUNET_HashCode * | event | ||
) |
Tries to send an authorization message by the client responding to a previous event in regards to a given epoch group using its secret key.
[in,out] | group | Epoch group |
[in] | event | Hash of event message |
Definition at line 817 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_MessageBody::announcement, GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_EpochIdentifier::code, create_message_authorization(), GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group(), get_epoch_group_key(), get_epoch_group_level(), get_room_message(), GNUNET_assert, GNUNET_memcmp, GNUNET_MESSENGER_KIND_ANNOUNCEMENT, GNUNET_MESSENGER_KIND_GROUP, GNUNET_OK, GNUNET_SYSERR, GNUNET_YES, GNUNET_MESSENGER_MessageBody::group, GNUNET_MESSENGER_EpochIdentifierCode::group_bit, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageAnnouncement::identifier, GNUNET_MESSENGER_EpochGroup::identifier, GNUNET_MESSENGER_MessageGroup::initiator, is_room_message_sent(), key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MessageGroup::partner, GNUNET_MESSENGER_Epoch::room, and send_epoch_message().
Referenced by handle_epoch_group_access(), and handle_epoch_group_announcement().
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.
[in,out] | group | Epoch group |
[in] | message | Message |
[in] | hash | Hash of message |
[in] | sender | Sender of message |
[in] | sent | Sent flag |
Definition at line 899 of file messenger_api_epoch_group.c.
References cancel_epoch_proposal_group(), confirm_epoch_group_member(), delay_room_action(), GNUNET_MESSENGER_EpochGroup::epoch, get_epoch_group_key(), get_epoch_group_level(), get_epoch_proposal_group(), GNUNET_assert, GNUNET_memcpy, GNUNET_NO, GNUNET_OK, GNUNET_TIME_relative_get_zero_(), GNUNET_YES, is_epoch_group_announced(), is_epoch_group_completed(), is_epoch_group_member(), is_epoch_group_proposal(), key, GNUNET_MESSENGER_Epoch::main_group, GNUNET_MESSENGER_Epoch::proposal_hash, GNUNET_MESSENGER_Epoch::room, send_epoch_group_announcement(), send_epoch_group_authorization(), send_epoch_group_revolution(), timeout, and verify_message_by_key().
Referenced by handle_announcement_message().
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 after custom delay.
[in,out] | group | Epoch group |
[in] | message | Message |
[in] | hash | Hash of message |
[in] | sender | Sender of message |
[in] | sent | Sent flag |
Definition at line 970 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_assert, GNUNET_TIME_relative_get_hour_(), GNUNET_YES, is_epoch_group_completed(), is_room_public(), propose_epoch_group(), GNUNET_MESSENGER_Epoch::room, and GNUNET_MESSENGER_EpochGroup::valid.
Referenced by handle_room_delayed_announcement().
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.
[in,out] | group | Epoch group |
[in] | message | Message |
[in] | hash | Hash of message |
[in] | sender | Sender of message |
[in] | sent | Sent flag |
Definition at line 990 of file messenger_api_epoch_group.c.
References GNUNET_MESSENGER_MessageBody::access, GNUNET_MESSENGER_Message::body, cancel_epoch_proposal_group(), GNUNET_MESSENGER_EpochGroup::epoch, GNUNET_MESSENGER_MessageAccess::event, extract_access_message_key(), get_epoch_group_level(), get_epoch_private_key(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_TIME_relative_get_hour_(), GNUNET_YES, GNUNET_MESSENGER_Epoch::main_group, send_epoch_group_announcement(), send_epoch_group_authorization(), and set_epoch_group_key().
Referenced by handle_access_message().
|
static |
Definition at line 1028 of file messenger_api_epoch_group.c.
References GNUNET_assert, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, and GNUNET_MESSENGER_EpochGroup::query.
Referenced by write_epoch_group_record().
void write_epoch_group_record | ( | struct GNUNET_MESSENGER_EpochGroup * | group, |
enum GNUNET_GenericReturnValue | deleted | ||
) |
Writes/Deletes the GNS record of a given epoch group depending on a provided flag that states wether an existing record should be deleted.
[in,out] | group | Epoch group |
[in] | deleted | Deleted flag |
Definition at line 1046 of file messenger_api_epoch_group.c.
References cont_write_epoch_group_record(), GNUNET_MESSENGER_EpochGroup::epoch, get_room_handle(), get_room_key(), GNUNET_assert, GNUNET_MESSENGER_FLAG_EPOCH_NONE, GNUNET_MESSENGER_FLAG_EPOCH_VALID, GNUNET_YES, handle, GNUNET_MESSENGER_EpochIdentifier::hash, GNUNET_MESSENGER_Epoch::hash, GNUNET_MESSENGER_EpochGroup::identifier, key, GNUNET_MESSENGER_EpochGroup::query, GNUNET_MESSENGER_Epoch::room, GNUNET_MESSENGER_EpochGroup::shared_key, store_handle_epoch_key(), and GNUNET_MESSENGER_EpochGroup::valid.
Referenced by invalidate_epoch_group(), it_group_store_key(), and set_epoch_group_key().