GNUnet  0.20.0
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
38 extern "C"
39 {
40 #if 0 /* keep Emacsens' auto-indent happy */
41 }
42 #endif
43 #endif
44 
48 #define GNUNET_RPS_VERSION 0x00000000
49 
53 struct GNUNET_RPS_Handle;
54 
59 
67 typedef void (*GNUNET_RPS_NotifyReadyCB) (void *cls,
68  uint64_t num_peers,
69  const struct
71 
72 
82 typedef void (*GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls,
83  const struct
85  double probability,
86  uint32_t num_observed);
87 
88 
95 struct GNUNET_RPS_Handle *
97 
98 
105 void
107  const char *shared_value);
108 
109 
116 void
118  const char *shared_value);
119 
120 
136 GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint32_t n,
138  void *cls);
139 
140 
152  void *cls);
153 
154 
162 void
163 GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint32_t n,
164  const struct GNUNET_PeerIdentity *ids);
165 
171 void
173 
174 
180 void
183 
184 
185 #if ENABLE_MALICIOUS
200 void
201 GNUNET_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 
220 void
222  uint32_t num_updates,
224  void *cls);
225 
226 
236  GNUNET_RPS_NotifyReadyCB stream_input_cb,
237  void *cls);
238 
239 
245 void
247 
248 
254 void
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 const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_CONTAINER_MultiPeerMap * ids
GNUNET_PeerIdentity -> CadetPeer.
static struct CadetPeer * peers
Operation to get peer ids.
static unsigned int num_peers
static struct GNUNET_PeerIdentity * target_peer
ID of the targeted peer.
void view_update_cb(void *cls, uint64_t view_size, const struct GNUNET_PeerIdentity *peers)
static struct GNUNET_RPS_Handle * rps_handle
RPS handle.
Definition: gnunet-rps.c:36
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_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
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
void(* GNUNET_RPS_NotifyReadyCB)(void *cls, uint64_t num_peers, const struct GNUNET_PeerIdentity *peers)
Callback called when requested random peers are available.
struct GNUNET_RPS_Handle * GNUNET_RPS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the rps service.
Definition: rps_api.c:843
void GNUNET_RPS_disconnect(struct GNUNET_RPS_Handle *h)
Disconnect from the rps service.
Definition: rps_api.c:1263
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
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.