GNUnet 0.22.0
gnunet-service-rps_custommap.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C)
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 */
20
26#include "gnunet_util_lib.h"
27#include <inttypes.h>
28
29
53struct CustomPeerMap;
54
55
63struct CustomPeerMap *
64CustomPeerMap_create (unsigned int len);
65
73unsigned int
74CustomPeerMap_size (const struct CustomPeerMap *c_peer_map);
75
85int
86CustomPeerMap_put (const struct CustomPeerMap *c_peer_map,
87 const struct GNUNET_PeerIdentity *peer);
88
98int
99CustomPeerMap_contains_peer (const struct CustomPeerMap *c_peer_map,
100 const struct GNUNET_PeerIdentity *peer);
101
111int
112CustomPeerMap_remove_peer (const struct CustomPeerMap *c_peer_map,
113 const struct GNUNET_PeerIdentity *peer);
114
124struct GNUNET_PeerIdentity *
125CustomPeerMap_get_peer_by_index (const struct CustomPeerMap *c_peer_map,
126 uint32_t index);
127
137int
138CustomPeerMap_remove_peer_by_index (const struct CustomPeerMap *c_peer_map,
139 uint32_t index);
140
148void
149CustomPeerMap_clear (const struct CustomPeerMap *c_peer_map);
150
156void
157CustomPeerMap_destroy (struct CustomPeerMap *c_peer_map);
158
159/* end of gnunet-service-rps_custommap.h */
unsigned int CustomPeerMap_size(const struct CustomPeerMap *c_peer_map)
Get the size of the custom peer map.
int CustomPeerMap_remove_peer_by_index(const struct CustomPeerMap *c_peer_map, uint32_t index)
Remove peer from custom peer map by index.
int CustomPeerMap_contains_peer(const struct CustomPeerMap *c_peer_map, const struct GNUNET_PeerIdentity *peer)
Check whether custom peer map contains a peer.
int CustomPeerMap_put(const struct CustomPeerMap *c_peer_map, const struct GNUNET_PeerIdentity *peer)
Insert peer into the custom peer map.
int CustomPeerMap_remove_peer(const struct CustomPeerMap *c_peer_map, const struct GNUNET_PeerIdentity *peer)
Remove peer from custom peer map.
void CustomPeerMap_destroy(struct CustomPeerMap *c_peer_map)
Destroy peermap.
void CustomPeerMap_clear(const struct CustomPeerMap *c_peer_map)
Clear the custom peer map.
struct CustomPeerMap * CustomPeerMap_create(unsigned int len)
Create an empty peermap.
struct GNUNET_PeerIdentity * CustomPeerMap_get_peer_by_index(const struct CustomPeerMap *c_peer_map, uint32_t index)
Get a peer by index.
Peer map to store peers with specialised use-cases (push_list, pull_list, view, .....
The identity of the host (wraps the signing key of the peer).