diff options
Diffstat (limited to 'src/rps/rps.h')
-rw-r--r-- | src/rps/rps.h | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/src/rps/rps.h b/src/rps/rps.h new file mode 100644 index 000000000..46c8ab0bb --- /dev/null +++ b/src/rps/rps.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | (C) 2012-2013 Christian Grothoff (and other contributing authors) | ||
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 | * @file rps/rps.h | ||
22 | * @brief example IPC messages between RPS API and GNS service | ||
23 | * @author Julius Bünger | ||
24 | */ | ||
25 | |||
26 | #include "gnunet_rps_service.h" | ||
27 | |||
28 | /** | ||
29 | * Mesh port used by RPS. | ||
30 | */ | ||
31 | #define GNUNET_RPS_CADET_PORT 31337 | ||
32 | |||
33 | |||
34 | GNUNET_NETWORK_STRUCT_BEGIN | ||
35 | |||
36 | /*********************************************************************** | ||
37 | * P2P Messages | ||
38 | ***********************************************************************/ | ||
39 | |||
40 | /** | ||
41 | * P2P Message to push own ID to other peer. | ||
42 | */ | ||
43 | struct GNUNET_RPS_P2P_PushMessage | ||
44 | { | ||
45 | /** | ||
46 | * Header including size and type in NBO | ||
47 | */ | ||
48 | struct GNUNET_MessageHeader header; | ||
49 | |||
50 | /** | ||
51 | * TODO Proof of work | ||
52 | */ | ||
53 | uint64_t placeholder; | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * P2P Message to request PeerIDs from other peer. | ||
58 | */ | ||
59 | struct GNUNET_RPS_P2P_PullRequestMessage | ||
60 | { | ||
61 | /** | ||
62 | * Header including size and type in NBO | ||
63 | */ | ||
64 | struct GNUNET_MessageHeader header; | ||
65 | |||
66 | /* This probably stays empty as we just | ||
67 | * infrom the peer of our existence */ | ||
68 | uint64_t placeholder; | ||
69 | }; | ||
70 | |||
71 | /** | ||
72 | * P2P Message to send PeerIDs to other peer. | ||
73 | */ | ||
74 | struct GNUNET_RPS_P2P_PullReplyMessage | ||
75 | { | ||
76 | /** | ||
77 | * Header including size and type in NBO | ||
78 | */ | ||
79 | struct GNUNET_MessageHeader header; | ||
80 | |||
81 | /** | ||
82 | * Number of PeerIDs sent | ||
83 | */ | ||
84 | uint64_t num_peers GNUNET_PACKED; | ||
85 | |||
86 | /* Followed by num_peers * GNUNET_PeerIdentity */ | ||
87 | }; | ||
88 | |||
89 | |||
90 | |||
91 | /*********************************************************************** | ||
92 | * Client-Service Messages | ||
93 | ***********************************************************************/ | ||
94 | |||
95 | /** | ||
96 | * Message from client to RPS service to request random peer(s). | ||
97 | */ | ||
98 | struct GNUNET_RPS_CS_RequestMessage | ||
99 | { | ||
100 | /** | ||
101 | * Header including size and type in NBO | ||
102 | */ | ||
103 | struct GNUNET_MessageHeader header; | ||
104 | |||
105 | /** | ||
106 | * Identifyer of the message. | ||
107 | */ | ||
108 | uint64_t n; | ||
109 | |||
110 | /** | ||
111 | * Number of random peer requested | ||
112 | */ | ||
113 | uint64_t num_peers GNUNET_PACKED; | ||
114 | }; | ||
115 | |||
116 | /** | ||
117 | * Message from RPS service to client to reply with random peer(s). | ||
118 | */ | ||
119 | struct GNUNET_RPS_CS_ReplyMessage | ||
120 | { | ||
121 | /** | ||
122 | * Header including size and type in NBO | ||
123 | */ | ||
124 | struct GNUNET_MessageHeader header; | ||
125 | |||
126 | /** | ||
127 | * Identifyer of the message. | ||
128 | */ | ||
129 | uint64_t n; | ||
130 | |||
131 | /** | ||
132 | * Number of random peer replied | ||
133 | */ | ||
134 | uint64_t num_peers GNUNET_PACKED; | ||
135 | |||
136 | /* Followed by num_peers * GNUNET_PeerIdentity */ | ||
137 | }; | ||
138 | |||
139 | GNUNET_NETWORK_STRUCT_END | ||