GNUnet 0.22.2
gnunet-service-messenger_peer_store.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2023--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_PEER_STORE_H
27#define GNUNET_SERVICE_MESSENGER_PEER_STORE_H
28
29#include "gnunet_util_lib.h"
30
33
35{
38};
39
46void
49
55void
57
64void
66 const char *path);
67
74void
76 const char *path);
77
91 const struct GNUNET_MESSENGER_Message *message,
92 const struct GNUNET_HashCode *hash);
93
103void
105 const struct GNUNET_PeerIdentity *peer,
106 enum GNUNET_GenericReturnValue active);
107
108#endif //GNUNET_SERVICE_MESSENGER_PEER_STORE_H
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
void update_store_peer(struct GNUNET_MESSENGER_PeerStore *store, const struct GNUNET_PeerIdentity *peer, enum GNUNET_GenericReturnValue active)
Adds a peer identity to the store if necessary.
struct GNUNET_PeerIdentity * get_store_peer_of(struct GNUNET_MESSENGER_PeerStore *store, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Returns the peer identity inside the store which verifies the signature of a given message as valid.
void load_peer_store(struct GNUNET_MESSENGER_PeerStore *store, const char *path)
Loads peer identities from a file into a peer store.
void clear_peer_store(struct GNUNET_MESSENGER_PeerStore *store)
Clears a peer store, wipes its content and deallocates its memory.
void save_peer_store(const struct GNUNET_MESSENGER_PeerStore *store, const char *path)
Saves peer identities from a peer store into a file.
void init_peer_store(struct GNUNET_MESSENGER_PeerStore *store, struct GNUNET_MESSENGER_Service *service)
Initializes a peer store as fully empty.
GNUNET_GenericReturnValue
Named constants for return values.
Internal representation of the hash map.
A 512-bit hashcode.
struct GNUNET_MESSENGER_Service * service
struct GNUNET_CONTAINER_MultiShortmap * peers
The identity of the host (wraps the signing key of the peer).