GNUnet 0.22.2
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
33{
36
39};
40
42 void *cls,
43 const struct GNUNET_ShortHashCode *discourse,
44 struct GNUNET_MESSENGER_Subscription *subscribtion);
45
58 const struct GNUNET_ShortHashCode *id);
59
65void
67
74const struct GNUNET_ShortHashCode*
75get_member_id (const struct GNUNET_MESSENGER_Member *member);
76
85void
87 const char *directory);
88
96void
98 const char *directory);
99
107void
109 const char *directory);
110
117void
119
130 const struct GNUNET_CRYPTO_PublicKey *public_key);
131
144 const struct GNUNET_MESSENGER_Message *message,
145 const struct GNUNET_HashCode *hash);
146
153void
155 struct GNUNET_MESSENGER_MemberSession *session);
156
163void
165 struct GNUNET_MESSENGER_MemberSession *session);
166
177int
180 void *cls);
181
188void
190 struct GNUNET_MESSENGER_Subscription *subscription);
191
198void
200 struct GNUNET_MESSENGER_Subscription *subscription);
201
212 const struct GNUNET_ShortHashCode *discourse);
213
224int
227 void *cls);
228
229#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...
enum GNUNET_GenericReturnValue(* GNUNET_MESSENGER_SubscriptionIteratorCallback)(void *cls, const struct GNUNET_ShortHashCode *discourse, struct GNUNET_MESSENGER_Subscription *subscribtion)
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.
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
struct GNUNET_ShortHashCode id
A 256-bit hashcode.