aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-12-05 14:07:11 +0000
committerBart Polot <bart@net.in.tum.de>2014-12-05 14:07:11 +0000
commit6cd1fc3aa29926ce0326d07ba684e1b65a1a0db7 (patch)
treeb201a08dda53a39a1572a18d8e08d0359896ea74 /src/include
parentf78293457b6e5d922d199a0c1f28a544ba943e7a (diff)
downloadgnunet-6cd1fc3aa29926ce0326d07ba684e1b65a1a0db7.tar.gz
gnunet-6cd1fc3aa29926ce0326d07ba684e1b65a1a0db7.zip
Import RPS
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_protocols.h39
-rw-r--r--src/include/gnunet_rps_service.h83
2 files changed, 121 insertions, 1 deletions
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 5a2b644be..747a252ff 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2630,10 +2630,47 @@ extern "C"
2630#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_ACT_MALICIOUS_OK 894 2630#define GNUNET_MESSAGE_TYPE_DHT_CLIENT_ACT_MALICIOUS_OK 894
2631 2631
2632#endif 2632#endif
2633
2634/*******************************************************************************
2635 * RPS messages
2636 ******************************************************************************/
2637
2638/* P2P Messages */
2639
2640/**
2641 * RPS PUSH message to push own ID to another peer
2642 */
2643#define GNUNET_MESSAGE_TYPE_RPS_PP_PUSH 950
2644
2645/**
2646 * RPS PULL REQUEST message to request the local view of another peer
2647 */
2648#define GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST 951
2649
2650/**
2651 * RPS PULL REPLY message which contains the view of the other peer
2652 */
2653#define GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY 952
2654
2655
2656
2657/* Client-Service Messages */
2658
2659/**
2660 * RPS CS REQUEST Message for the Client to request (a) random peer(s)
2661 */
2662#define GNUNET_MESSAGE_TYPE_RPS_CS_REQUEST 953
2663
2664/**
2665 * RPS CS REPLY Message for the Server to send (a) random peer(s)
2666 */
2667#define GNUNET_MESSAGE_TYPE_RPS_CS_REPLY 954
2668
2669
2633/*******************************************************************************/ 2670/*******************************************************************************/
2634 2671
2635/** 2672/**
2636 * Next available: 904 2673 * Next available: 960
2637 */ 2674 */
2638 2675
2639/** 2676/**
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