GNUnet 0.22.2
gnunet-service-messenger_member_store.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_STORE_H
27#define GNUNET_SERVICE_MESSENGER_MEMBER_STORE_H
28
29#include "gnunet_util_lib.h"
30
32
34
37
39{
41
43};
44
46 void *cls,
47 const struct GNUNET_CRYPTO_PublicKey *public_key,
48 struct GNUNET_MESSENGER_MemberSession *session);
49
56void
58 struct GNUNET_MESSENGER_SrvRoom *room);
59
65void
67
76
83const struct GNUNET_HashCode*
85
92void
94 const char *directory);
95
102void
104 const char *directory);
105
116 const struct GNUNET_ShortHashCode *id);
117
130 const struct GNUNET_MESSENGER_Message *message);
131
141 const struct GNUNET_ShortHashCode *id);
142
153int
156 void *cls);
157
158#endif //GNUNET_SERVICE_MESSENGER_MEMBER_STORE_H
struct GNUNET_MESSENGER_ContactStore * get_member_contact_store(struct GNUNET_MESSENGER_MemberStore *store)
Returns the used contact store of a given member store.
struct GNUNET_MESSENGER_Member * get_store_member_of(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_MESSENGER_Message *message)
Returns the member of a store using a sender id of a given message.
enum GNUNET_GenericReturnValue(* GNUNET_MESSENGER_MemberIteratorCallback)(void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session)
int iterate_store_members(struct GNUNET_MESSENGER_MemberStore *store, GNUNET_MESSENGER_MemberIteratorCallback it, void *cls)
Iterate through all member sessions currently connected to the members of the given member store and ...
void save_member_store(struct GNUNET_MESSENGER_MemberStore *store, const char *directory)
Saves members from a member store into a directory.
void load_member_store(struct GNUNET_MESSENGER_MemberStore *store, const char *directory)
Loads members from a directory into a member store.
const struct GNUNET_HashCode * get_member_store_key(const struct GNUNET_MESSENGER_MemberStore *store)
Returns the shared secret you need to access a room of the store.
struct GNUNET_MESSENGER_Member * add_store_member(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Adds a member to a store under a specific id and returns it on success.
void init_member_store(struct GNUNET_MESSENGER_MemberStore *store, struct GNUNET_MESSENGER_SrvRoom *room)
Initializes a member store as fully empty connected to a room.
void clear_member_store(struct GNUNET_MESSENGER_MemberStore *store)
Clears a member store, wipes its content and deallocates its memory.
struct GNUNET_MESSENGER_Member * get_store_member(const struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Returns the member in a store identified by a given id.
GNUNET_GenericReturnValue
Named constants for return values.
Internal representation of the hash map.
An identity key as per LSD0001.
A 512-bit hashcode.
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_MemberStore * store
A 256-bit hashcode.