GNUnet debian-0.24.3-23-g589b01d60
messenger_api_epoch_group.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2024--2025 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
26#ifndef GNUNET_MESSENGER_API_EPOCH_GROUP_H
27#define GNUNET_MESSENGER_API_EPOCH_GROUP_H
28
29#include "gnunet_common.h"
30#include "gnunet_time_lib.h"
31#include "gnunet_util_lib.h"
32
34
36
39
41{
44
47
50
53};
54
71 uint32_t level,
73
79void
81
88uint32_t
90
97uint32_t
99
106uint32_t
108 group);
109
119
129
139void
142 enum GNUNET_GenericReturnValue write_record);
143
152
168 const struct GNUNET_HashCode *hash,
169 const struct GNUNET_MESSENGER_Message *message,
170 struct GNUNET_MESSENGER_Contact *contact,
171 enum GNUNET_GenericReturnValue sent);
172
183 const struct GNUNET_MESSENGER_Contact *contact);
184
195 const struct GNUNET_MESSENGER_EpochGroup *other);
196
209 struct GNUNET_HashCode *hash,
210 enum GNUNET_GenericReturnValue other);
211
218void
220 const struct GNUNET_MESSENGER_Contact *contact);
221
231
242 const struct GNUNET_MESSENGER_Epoch *epoch);
243
254 group,
255 const struct
257 announcement);
258
266double
268 group);
269
279
291 const struct GNUNET_HashCode *event);
292
302
316 const struct GNUNET_HashCode *initiator_event,
317 const struct GNUNET_HashCode *partner_event,
319
331 const struct GNUNET_HashCode *event);
332
343void
345 const struct GNUNET_MESSENGER_Message *message,
346 const struct GNUNET_HashCode *hash,
347 struct GNUNET_MESSENGER_Contact *sender,
348 enum GNUNET_GenericReturnValue sent);
349
360void
362 group,
363 const struct GNUNET_MESSENGER_Message *
364 message,
365 const struct GNUNET_HashCode *hash,
366 struct GNUNET_MESSENGER_Contact *sender,
367 enum GNUNET_GenericReturnValue sent);
368
379void
381 const struct GNUNET_MESSENGER_Message *message,
382 const struct GNUNET_HashCode *hash);
383
392void
394 enum GNUNET_GenericReturnValue deleted);
395
396#endif // GNUNET_MESSENGER_API_EPOCH_GROUP_H
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
Definition: gnunet-arm.c:118
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Functions related to time.
GNUNET_GenericReturnValue
Named constants for return values.
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 ...
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.
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.
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.
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.
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.
uint32_t get_epoch_group_members_count(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the current amount of members of a given 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 g...
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.
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...
uint32_t get_epoch_group_size(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the size of a given epoch group in terms of members.
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 a...
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...
void destroy_epoch_group(struct GNUNET_MESSENGER_EpochGroup *group)
Destroys a given epoch group and frees its resources.
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.
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 ...
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 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.
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...
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.
uint32_t get_epoch_group_level(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the group level of a given epoch group.
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.
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.
A 512-bit hashcode.
enum GNUNET_GenericReturnValue valid
enum GNUNET_GenericReturnValue stored
struct GNUNET_CRYPTO_SymmetricSessionKey * shared_key
struct GNUNET_NAMESTORE_QueueEntry * query
struct GNUNET_MESSENGER_Epoch * epoch
struct GNUNET_MESSENGER_EpochMembership * membership
struct GNUNET_TIME_Absolute announcement_expiration
union GNUNET_MESSENGER_EpochIdentifier identifier
An QueueEntry used to store information for a pending NAMESTORE record operation.
Definition: namestore_api.c:49
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
An epoch identifier unifies an epoch identifier code and its 256bit hash representation.