GNUnet debian-0.24.3-23-g589b01d60
messenger_api_epoch_announcement.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_ANNOUNCEMENT_H
27#define GNUNET_MESSENGER_API_EPOCH_ANNOUNCEMENT_H
28
29#include "gnunet_common.h"
30#include "gnunet_time_lib.h"
31#include "gnunet_util_lib.h"
32
34
37
39{
43
45
48
51
53
56};
57
74
80void
82 announcement);
83
91uint32_t
93 announcement);
94
102uint32_t
105 announcement);
106
117 announcement);
118
129 announcement);
130
138void
140 announcement,
142
153 announcement);
154
164void
166 announcement,
169 enum GNUNET_GenericReturnValue write_record);
170
179 announcement);
180
189void
191 announcement,
192 const struct GNUNET_MESSENGER_Message *
193 message,
194 const struct GNUNET_HashCode *hash);
195
211 announcement,
212 const struct GNUNET_HashCode *hash,
213 const struct GNUNET_MESSENGER_Message *
214 message,
215 struct GNUNET_MESSENGER_Contact *contact,
216 enum GNUNET_GenericReturnValue sent);
217
232 announcement,
233 const struct GNUNET_HashCode *hash,
234 const struct GNUNET_MESSENGER_Message *
235 message,
236 struct GNUNET_MESSENGER_Contact *contact);
237
248 announcement,
249 const struct GNUNET_MESSENGER_Contact *contact);
250
264 announcement,
265 struct GNUNET_HashCode *hash,
266 enum GNUNET_GenericReturnValue other);
267
275void
277 announcement,
278 const struct GNUNET_MESSENGER_Contact *
279 contact);
280
290 announcement);
291
303 announcement,
304 const struct GNUNET_HashCode *event);
305
317 announcement,
318 const struct GNUNET_HashCode *event);
319
329 announcement);
330
344 announcement,
345 const struct
347 const struct GNUNET_HashCode *event);
348
359void
361 announcement,
362 const struct GNUNET_MESSENGER_Message *message,
363 const struct GNUNET_HashCode *hash,
364 struct GNUNET_MESSENGER_Contact *sender,
365 enum GNUNET_GenericReturnValue sent);
366
377void
379 announcement,
380 const struct GNUNET_MESSENGER_Message *
381 message,
382 const struct GNUNET_HashCode *hash,
383 struct GNUNET_MESSENGER_Contact *sender,
384 enum GNUNET_GenericReturnValue sent);
385
396void
398 announcement,
399 const struct GNUNET_MESSENGER_Message *
400 message,
401 const struct GNUNET_HashCode *hash);
402
411void
413 announcement,
414 enum GNUNET_GenericReturnValue deleted);
415
416#endif // GNUNET_MESSENGER_API_EPOCH_ANNOUNCEMENT_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.
enum GNUNET_GenericReturnValue send_epoch_announcement_appeal(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *event)
Tries to send an appeal message by the client responding to a previous event in regards to a given ep...
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 is_epoch_announcement_appealed(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns whether a given epoch announcement of the client is currently appealing for its secret key fr...
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...
uint32_t get_epoch_announcement_size(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns the size of a given epoch announcement in terms of members.
enum GNUNET_GenericReturnValue send_epoch_announcement_authorization(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const 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 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.
enum GNUNET_GenericReturnValue is_epoch_announcement_completed(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns whether a given epoch announcement is complete in terms of confirmed announcements from its m...
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.
enum GNUNET_GenericReturnValue send_epoch_announcement_revolution(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Tries to send a revolution message by the client for a given epoch announcement using its secret key.
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...
void write_epoch_announcement_record(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, enum GNUNET_GenericReturnValue deleted)
Writes/Deletes the GNS record of a given epoch announcement depending on a provided flag that states ...
enum GNUNET_GenericReturnValue confirm_epoch_announcement_member(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, 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 announcement as confirmation for a sp...
enum GNUNET_GenericReturnValue is_epoch_announcement_announced(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns whether the client has announced being part of a given epoch announcement owning its secret k...
uint32_t get_epoch_announcement_members_count(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns the current amount of members of a given epoch announcement.
Internal representation of the hash map.
A 512-bit hashcode.
struct GNUNET_NAMESTORE_QueueEntry * query
struct GNUNET_MESSENGER_EpochMembership * membership
struct GNUNET_CRYPTO_SymmetricSessionKey * shared_key
struct GNUNET_CONTAINER_MultiHashMap * messages
union GNUNET_MESSENGER_EpochIdentifier identifier
An QueueEntry used to store information for a pending NAMESTORE record operation.
Definition: namestore_api.c:49
Entry in list of pending tasks.
Definition: scheduler.c:136
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.