GNUnet 0.22.2
gnunet_rps_service.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
34#ifndef GNUNET_RPS_SERVICE_H
35#define GNUNET_RPS_SERVICE_H
36
37#ifdef __cplusplus
38extern "C"
39{
40#if 0 /* keep Emacsens' auto-indent happy */
41}
42#endif
43#endif
44
48#define GNUNET_RPS_VERSION 0x00000000
49
54
59
67typedef void (*GNUNET_RPS_NotifyReadyCB) (void *cls,
68 uint64_t num_peers,
69 const struct
71
72
82typedef void (*GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls,
83 const struct
85 double probability,
86 uint32_t num_observed);
87
88
95struct GNUNET_RPS_Handle *
97
98
105void
107 const char *shared_value);
108
109
116void
118 const char *shared_value);
119
120
136GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint32_t n,
138 void *cls);
139
140
152 void *cls);
153
154
162void
163GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint32_t n,
164 const struct GNUNET_PeerIdentity *ids);
165
171void
173
174
180void
183
184
185#if ENABLE_MALICIOUS
200void
201GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
202 uint32_t type,
203 uint32_t num_peers,
204 const struct GNUNET_PeerIdentity *ids,
205 const struct GNUNET_PeerIdentity *target_peer);
206
207#endif /* ENABLE_MALICIOUS */
208
209/* Get internals for debugging/profiling purposes */
210
220void
222 uint32_t num_updates,
223 GNUNET_RPS_NotifyReadyCB view_update_cb,
224 void *cls);
225
226
236 GNUNET_RPS_NotifyReadyCB stream_input_cb,
237 void *cls);
238
239
245void
247
248
254void
256
257
258#if 0 /* keep Emacsens' auto-indent happy */
259{
260#endif
261#ifdef __cplusplus
262}
263#endif
264
265#endif
266 /* end of group */
268 /* end of group addition */
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:98
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
static uint32_t type
Type string converted to DNS type value.
static struct GNUNET_RPS_Handle * rps_handle
RPS handle.
Definition: gnunet-rps.c:36
struct GNUNET_CONTAINER_MultiPeerMap * peers
Map from PIDs to struct CadetPeer entries.
static unsigned int num_peers
Number of peers.
void GNUNET_RPS_sub_stop(struct GNUNET_RPS_Handle *h, const char *shared_value)
Stop a sub with the given shared value.
Definition: rps_api.c:927
void GNUNET_RPS_sub_start(struct GNUNET_RPS_Handle *h, const char *shared_value)
Start a sub with the given shared value.
Definition: rps_api.c:904
void GNUNET_RPS_request_cancel(struct GNUNET_RPS_Request_Handle *rh)
Cancel an issued request.
Definition: rps_api.c:1200
void GNUNET_RPS_stream_cancel(struct GNUNET_RPS_StreamRequestHandle *srh)
Cancel a specific request for updates from the biased peer stream.
Definition: rps_api.c:598
void(* GNUNET_RPS_NotifyReadySingleInfoCB)(void *cls, const struct GNUNET_PeerIdentity *peer, double probability, uint32_t num_observed)
Callback called when requested random peer with additional information is available.
struct GNUNET_RPS_Handle * GNUNET_RPS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the rps service.
Definition: rps_api.c:843
struct GNUNET_RPS_StreamRequestHandle * GNUNET_RPS_stream_request(struct GNUNET_RPS_Handle *rps_handle, GNUNET_RPS_NotifyReadyCB stream_input_cb, void *cls)
Request biased stream of peers that are being put into the sampler.
Definition: rps_api.c:503
void GNUNET_RPS_view_request(struct GNUNET_RPS_Handle *rps_handle, uint32_t num_updates, GNUNET_RPS_NotifyReadyCB view_update_cb, void *cls)
Request updates of view.
Definition: rps_api.c:461
void GNUNET_RPS_seed_ids(struct GNUNET_RPS_Handle *h, uint32_t n, const struct GNUNET_PeerIdentity *ids)
Seed rps service with peerIDs.
Definition: rps_api.c:1036
void(* GNUNET_RPS_NotifyReadyCB)(void *cls, uint64_t num_peers, const struct GNUNET_PeerIdentity *peers)
Callback called when requested random peers are available.
void GNUNET_RPS_disconnect(struct GNUNET_RPS_Handle *h)
Disconnect from the rps service.
Definition: rps_api.c:1263
struct GNUNET_RPS_Request_Handle_Single_Info * GNUNET_RPS_request_peer_info(struct GNUNET_RPS_Handle *rps_handle, GNUNET_RPS_NotifyReadySingleInfoCB ready_cb, void *cls)
Request one random peer, getting additional information.
Definition: rps_api.c:995
struct GNUNET_RPS_Request_Handle * GNUNET_RPS_request_peers(struct GNUNET_RPS_Handle *h, uint32_t n, GNUNET_RPS_NotifyReadyCB ready_cb, void *cls)
Request n random peers.
Definition: rps_api.c:950
void GNUNET_RPS_request_single_info_cancel(struct GNUNET_RPS_Request_Handle_Single_Info *rhs)
Cancel an issued single info request.
Definition: rps_api.c:1231
The identity of the host (wraps the signing key of the peer).
Handler to handle requests from a client.
Definition: rps_api.c:79
Handler for a single request from a client.
Definition: rps_api.c:213
GNUNET_RPS_NotifyReadySingleInfoCB ready_cb
The callback to be called when we receive an answer.
Definition: rps_api.c:238
Handler for a single request from a client.
Definition: rps_api.c:160
GNUNET_RPS_NotifyReadyCB ready_cb
The callback to be called when we receive an answer.
Definition: rps_api.c:190
Handle for a request to get peers from biased stream of ids.
Definition: rps_api.c:42