GNUnet  0.11.x
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--2021 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 "platform.h"
30 #include "gnunet_crypto_lib.h"
31 #include "gnunet_container_lib.h"
33 #include "messenger_api_message.h"
34 
36 
39 
41 {
43 
45 };
46 
48  void *cls,
49  const struct GNUNET_IDENTITY_PublicKey *public_key,
50  struct GNUNET_MESSENGER_MemberSession *session);
51 
58 void
60  struct GNUNET_MESSENGER_SrvRoom *room);
61 
67 void
69 
78 
85 const struct GNUNET_HashCode*
87 
94 void
96  const char *directory);
97 
104 void
106  const char *directory);
107 
118  const struct GNUNET_ShortHashCode *id);
119 
130  const struct GNUNET_MESSENGER_Message *message);
131 
141  const struct GNUNET_ShortHashCode *id);
142 
153 int
156  void* cls);
157 
158 #endif //GNUNET_SERVICE_MESSENGER_MEMBER_STORE_H
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.
int(* GNUNET_MESSENGER_MemberIteratorCallback)(void *cls, const struct GNUNET_IDENTITY_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.
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.
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_ContactStore * get_member_contact_store(struct GNUNET_MESSENGER_MemberStore *store)
Returns the used contact store of a given member store.
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.
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 clear_member_store(struct GNUNET_MESSENGER_MemberStore *store)
Clears a member store, wipes its content and deallocates its memory.
cryptographic primitives for GNUnet
messenger api: client and service implementation of GNUnet MESSENGER service
Internal representation of the hash map.
A 512-bit hashcode.
An identity key as per LSD0001.
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_MemberStore * store
A 256-bit hashcode.