GNUnet 0.22.2
gnunet-service-rps_view.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
29struct View;
30
37struct View *
38View_create (unsigned int len);
39
40
49void
50View_change_len (struct View *view,
51 unsigned int len);
52
58const struct GNUNET_PeerIdentity *
59View_get_as_array (const struct View *view);
60
61
68unsigned int
69View_size (const struct View *view);
70
71
81int
82View_put (struct View *view,
83 const struct GNUNET_PeerIdentity *peer);
84
85
95int
96View_contains_peer (const struct View *view,
97 const struct GNUNET_PeerIdentity *peer);
98
99
109int
110View_remove_peer (struct View *view,
111 const struct GNUNET_PeerIdentity *peer);
112
113
123const struct GNUNET_PeerIdentity *
124View_get_peer_by_index (const struct View *view,
125 uint32_t index);
126
127
133void
134View_clear (struct View *view);
135
136
142void
143View_destroy (struct View *view);
144
145/* end of gnunet-service-rps_view.h */
void View_clear(struct View *view)
Clear the view.
int View_contains_peer(const struct View *view, const struct GNUNET_PeerIdentity *peer)
Check whether view contains a peer.
void View_change_len(struct View *view, unsigned int len)
Change length of view.
int View_put(struct View *view, const struct GNUNET_PeerIdentity *peer)
Insert peer into the view.
struct View * View_create(unsigned int len)
Create an empty view.
const struct GNUNET_PeerIdentity * View_get_as_array(const struct View *view)
Get the view as an array.
unsigned int View_size(const struct View *view)
Get the size of the view.
void View_destroy(struct View *view)
Destroy view.
int View_remove_peer(struct View *view, const struct GNUNET_PeerIdentity *peer)
Remove peer from view.
const struct GNUNET_PeerIdentity * View_get_peer_by_index(const struct View *view, uint32_t index)
Get a peer by index.
The identity of the host (wraps the signing key of the peer).