GNUnet debian-0.24.3-23-g589b01d60
messenger_api_epoch_membership.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 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_MEMBERSHIP_H
27#define GNUNET_MESSENGER_API_EPOCH_MEMBERSHIP_H
28
29#include "gnunet_common.h"
30#include "gnunet_time_lib.h"
31#include "gnunet_util_lib.h"
32
34
36{
37 uint32_t size;
38 uint32_t count;
39
42};
43
45 (void *cls, const struct GNUNET_MESSENGER_Contact *member);
46
56
62void
64
71uint32_t
73 membership);
74
82uint32_t
84 membership);
85
95 membership);
96
107 membership,
108 const struct GNUNET_MESSENGER_Contact *contact);
109
123 struct GNUNET_HashCode *hash,
124 enum GNUNET_GenericReturnValue other);
125
134uint32_t
137 membership);
138
153 membership,
154 const struct GNUNET_HashCode *hash,
155 const struct GNUNET_MESSENGER_Message *
156 message,
157 struct GNUNET_MESSENGER_Contact *contact,
158 enum GNUNET_GenericReturnValue sent);
159
171 membership,
172 const struct GNUNET_HashCode *hash,
173 struct GNUNET_MESSENGER_Contact *contact);
174
184int
188 void *cls);
189
190#endif // GNUNET_MESSENGER_API_EPOCH_MEMBERSHIP_H
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 is_epoch_membership_member(const struct GNUNET_MESSENGER_EpochMembership *membership, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is announced member of a given epoch membership.
enum GNUNET_GenericReturnValue revoke_epoch_membership_announcement(struct GNUNET_MESSENGER_EpochMembership *membership, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *contact)
Drops an announcement message with a provided hash from a given epoch membership to revoke the confir...
enum GNUNET_GenericReturnValue confirm_epoch_membership_announcment(struct GNUNET_MESSENGER_EpochMembership *membership, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact, enum GNUNET_GenericReturnValue sent)
Adds an announcement message with its hash to a given epoch membership as confirmation for a specific...
int iterate_epoch_membership_members(const struct GNUNET_MESSENGER_EpochMembership *membership, GNUNET_MESSENGER_MembershipCallback callback, void *cls)
Iterate through all confirmed members of a given epoch membership and pass them through a provided ca...
uint32_t get_epoch_membership_size(const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns the size of a given epoch membership.
enum GNUNET_GenericReturnValue is_epoch_membership_completed(const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns whether a given epoch membership is complete, meaning that all of its intended members have p...
enum GNUNET_GenericReturnValue(* GNUNET_MESSENGER_MembershipCallback)(void *cls, const struct GNUNET_MESSENGER_Contact *member)
struct GNUNET_MESSENGER_EpochMembership * create_epoch_membership(uint32_t size)
Creates and allocates a new membership for subgroups of an epoch with specified size.
enum GNUNET_GenericReturnValue get_epoch_membership_member_hash(const struct GNUNET_MESSENGER_EpochMembership *membership, struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue other)
Provides an announcement hash of a member from a given epoch membership.
uint32_t get_epoch_membership_member_position(const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns the index position of the client inside a given epoch in relation to its list of members.
void destroy_epoch_membership(struct GNUNET_MESSENGER_EpochMembership *membership)
Destroys and frees resources of a given membership.
uint32_t get_epoch_membership_count(const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns the current amount of individual members inside a given epoch membership.
static unsigned int size
Size of the "table".
Definition: peer.c:68
Internal representation of the hash map.
A 512-bit hashcode.
struct GNUNET_CONTAINER_MultiHashMap * members