aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_rps_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_rps_service.h')
-rw-r--r--src/include/gnunet_rps_service.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/include/gnunet_rps_service.h b/src/include/gnunet_rps_service.h
new file mode 100644
index 000000000..dc822b8f1
--- /dev/null
+++ b/src/include/gnunet_rps_service.h
@@ -0,0 +1,83 @@
1/*
2 This file is part of GNUnet
3 (C)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 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 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 */
20
21/**
22 * @file include/gnunet_rps_service.h
23 * @brief API to the rps service
24 * @author Julius Bünger
25 */
26#ifndef GNUNET_RPS_SERVICE_H
27#define GNUNET_RPS_SERVICE_H
28
29#ifdef __cplusplus
30extern "C"
31{
32#if 0 /* keep Emacsens' auto-indent happy */
33}
34#endif
35#endif
36
37/**
38 * Version of the rps API.
39 */
40#define GNUNET_RPS_VERSION 0x00000000
41
42typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls, uint64_t num_peers, struct GNUNET_PeerIdentity *peers);
43
44 struct GNUNET_RPS_Request_Handle *
45GNUNET_RPS_request_peers_single_call (const struct GNUNET_CONFIGURATION_Handle *cfg,
46 uint64_t n,
47 GNUNET_RPS_NotifyReadyCB ready_cb,
48 void *cls);
49
50/**
51 * Connect to the rps service
52 */
53 struct GNUNET_RPS_Handle *
54GNUNET_RPS_connect( const struct GNUNET_CONFIGURATION_Handle *cfg );
55
56/**
57 * Request n random peers.
58 */
59 struct GNUNET_RPS_Request_Handle *
60GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint64_t n,
61 GNUNET_RPS_NotifyReadyCB ready_cb,
62 void *cls);
63
64/**
65 * Cancle an issued request.
66 */
67 void
68GNUNET_RPS_request_cancel ( struct GNUNET_RPS_Request_Handle *rh );
69
70/**
71 * Disconnect from the rps service
72 */
73 void
74GNUNET_RPS_disconnect ( struct GNUNET_RPS_Handle *h );
75
76#if 0 /* keep Emacsens' auto-indent happy */
77{
78#endif
79#ifdef __cplusplus
80}
81#endif
82
83#endif