GNUnet debian-0.24.3-29-g453fda2cf
 
Loading...
Searching...
No Matches
gnunet-service-messenger_member.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2024 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_SERVICE_MESSENGER_MEMBER_H
27#define GNUNET_SERVICE_MESSENGER_MEMBER_H
28
31
40
41typedef enum GNUNET_GenericReturnValue (*
43(
44 void *cls,
45 const struct GNUNET_ShortHashCode *discourse,
46 struct GNUNET_MESSENGER_Subscription *subscription);
47
60 const struct GNUNET_ShortHashCode *id);
61
67void
69
76const struct GNUNET_ShortHashCode*
77get_member_id (const struct GNUNET_MESSENGER_Member *member);
78
87void
89 const char *directory);
90
98void
100 const char *directory);
101
109void
111 const char *directory);
112
119void
121
132 const struct GNUNET_CRYPTO_PublicKey *public_key);
133
146 const struct GNUNET_MESSENGER_Message *message,
147 const struct GNUNET_HashCode *hash);
148
155void
157 struct GNUNET_MESSENGER_MemberSession *session);
158
165void
167 struct GNUNET_MESSENGER_MemberSession *session);
168
179int
182 void *cls);
183
190void
192 struct GNUNET_MESSENGER_Subscription *subscription);
193
200void
202 struct GNUNET_MESSENGER_Subscription *subscription);
203
214 const struct GNUNET_ShortHashCode *discourse);
215
226int
229 void *cls);
230
231#endif // GNUNET_SERVICE_MESSENGER_MEMBER_H
void add_member_subscription(struct GNUNET_MESSENGER_Member *member, struct GNUNET_MESSENGER_Subscription *subscription)
Adds a given subscription to a member.
const struct GNUNET_ShortHashCode * get_member_id(const struct GNUNET_MESSENGER_Member *member)
Returns the current id of a given member.
void remove_member_session(struct GNUNET_MESSENGER_Member *member, struct GNUNET_MESSENGER_MemberSession *session)
Removes a given member session from its member.
struct GNUNET_MESSENGER_MemberSession * get_member_session_of(struct GNUNET_MESSENGER_Member *member, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Returns the member session of a member using a public key which can verify the signature of a given m...
void save_member(struct GNUNET_MESSENGER_Member *member, const char *directory)
Saves data from a member into a directory which can be load to restore the member completely.
void destroy_member(struct GNUNET_MESSENGER_Member *member)
Destroys a member and frees its memory fully.
struct GNUNET_MESSENGER_MemberSession * get_member_session(const struct GNUNET_MESSENGER_Member *member, const struct GNUNET_CRYPTO_PublicKey *public_key)
Returns the member session of a member identified by a given public key.
struct GNUNET_MESSENGER_Subscription * get_member_subscription(struct GNUNET_MESSENGER_Member *member, const struct GNUNET_ShortHashCode *discourse)
Returns the active subscription of a given member to a selected discourse.
enum GNUNET_GenericReturnValue(* GNUNET_MESSENGER_SubscriptionIteratorCallback)(void *cls, const struct GNUNET_ShortHashCode *discourse, struct GNUNET_MESSENGER_Subscription *subscription)
struct GNUNET_MESSENGER_Member * create_member(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Creates and allocates a new member of a room with an optionally defined or random id.
void remove_member_subscription(struct GNUNET_MESSENGER_Member *member, struct GNUNET_MESSENGER_Subscription *subscription)
Removes a given subscription from a member.
void load_member_next_sessions(const struct GNUNET_MESSENGER_Member *member, const char *directory)
Loads data about next sessions from a directory into an empty loaded member which does not contain a ...
void add_member_session(struct GNUNET_MESSENGER_Member *member, struct GNUNET_MESSENGER_MemberSession *session)
Adds a given member session to its member.
void sync_member_contacts(struct GNUNET_MESSENGER_Member *member)
Synchronizes contacts between all sessions from a given member and other sessions which are linked to...
int iterate_member_subscriptions(struct GNUNET_MESSENGER_Member *member, GNUNET_MESSENGER_SubscriptionIteratorCallback it, void *cls)
Iterate through all subscriptions of a given member and call the provided iterator callback with a se...
int iterate_member_sessions(struct GNUNET_MESSENGER_Member *member, GNUNET_MESSENGER_MemberIteratorCallback it, void *cls)
Iterate through all member sessions currently connected to a given member and call the provided itera...
void load_member(struct GNUNET_MESSENGER_MemberStore *store, const char *directory)
Loads data from a directory into a new allocated and created member of a store if the required inform...
enum GNUNET_GenericReturnValue(* GNUNET_MESSENGER_MemberIteratorCallback)(void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session)
GNUNET_GenericReturnValue
Named constants for return values.
Internal representation of the hash map.
Internal representation of the hash map.
An identity key as per LSD0001.
A 512-bit hashcode.
struct GNUNET_CONTAINER_MultiHashMap * sessions
struct GNUNET_CONTAINER_MultiShortmap * subscriptions
struct GNUNET_MESSENGER_MemberStore * store
A 256-bit hashcode.