GNUnet  0.10.x
rps.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2012-2013 GNUnet e.V.
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  */
26 #include "gnunet_rps_service.h"
27 
31 #define GNUNET_RPS_CADET_PORT 31337
32 
33 
35 
36 /***********************************************************************
37  * P2P Messages
38 ***********************************************************************/
39 
44 {
49 
54 
55  /* Followed by num_peers * GNUNET_PeerIdentity */
56 };
57 
58 
59 
60 /***********************************************************************
61  * Client-Service Messages
62 ***********************************************************************/
63 
68 {
73 
78 
79  /* Followed by num_peers * GNUNET_PeerIdentity */
80 };
81 
82 #if ENABLE_MALICIOUS
83 
86 struct GNUNET_RPS_CS_ActMaliciousMessage
87 {
91  struct GNUNET_MessageHeader header;
92 
97  struct GNUNET_PeerIdentity attacked_peer;
98 
106  uint32_t type GNUNET_PACKED;
107 
111  uint32_t num_peers GNUNET_PACKED;
112 
113  /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious
114  behaviour is 1 */
115 };
116 #endif /* ENABLE_MALICIOUS */
117 
118 
123 {
128 
133 
137  struct GNUNET_TIME_RelativeNBO round_interval;
138 
142  struct GNUNET_HashCode hash GNUNET_PACKED;
143 };
144 
145 
150 {
155 
159  struct GNUNET_HashCode hash GNUNET_PACKED;
160 };
161 
162 
163 /* Debug messages */
164 
170 {
175 
180  uint32_t num_updates GNUNET_PACKED;
181 };
182 
187 {
192 
196  uint32_t id GNUNET_PACKED;
197 
202 };
203  /* Followed by num_peers * GNUNET_PeerIdentity */
204 
210 {
215 };
216 
221 {
225  struct GNUNET_MessageHeader header;
226 
231 
232  // TODO maybe source of peer (pull/push list, peerinfo, ...)
233 
234  /* Followed by num_peers * GNUNET_PeerIdentity */
235 };
236 
238 
239 /***********************************************************************
240  * Defines from old gnunet-service-rps_peers.h
241 ***********************************************************************/
242 
247 {
252 
253  /* IN_OTHER_GOSSIP_LIST = 0x02, unneeded? */
254  /* IN_OWN_SAMPLER_LIST = 0x04, unneeded? */
255  /* IN_OWN_GOSSIP_LIST = 0x08, unneeded? */
256 
260  Peers_ONLINE = 0x20,
261 
268 };
269 
277 {
282 
288 
293 };
294 
295 
300 {
305 
310 };
311 
318 typedef void (* PeerOp) (void *cls, const struct GNUNET_PeerIdentity *peer);
319 
329 typedef int
330 (*PeersIterator) (void *cls,
331  const struct GNUNET_PeerIdentity *peer);
332 
333 
337 extern struct GNUNET_STATISTICS_Handle *stats;
338 
Peers_ChannelRole
The role of a channel.
Definition: rps.h:299
Message from service to client containing current update of view.
Definition: rps.h:186
Message from client to service indicating that clients wants to get stream of biased peers...
Definition: rps.h:209
We destroyed the channel because the other peer established a second one.
Definition: rps.h:281
struct GNUNET_MessageHeader header
Header including size and type in NBO.
Definition: rps.h:48
Message from client to service indicating that clients wants to get updates of the view...
Definition: rps.h:169
P2P Message to send PeerIDs to other peer.
Definition: rps.h:43
int(* PeersIterator)(void *cls, const struct GNUNET_PeerIdentity *peer)
Iterator over valid peers.
Definition: rps.h:330
Channel is used for receiving.
Definition: rps.h:309
Peers_ChannelFlags
Keep track of the status of a channel.
Definition: rps.h:276
uint32_t num_peers
Number of PeerIDs sent.
Definition: rps.h:53
Peers_PeerFlags
Different flags indicating the status of another peer.
Definition: rps.h:246
Time for relative time used by GNUnet, in microseconds and in network byte order. ...
Handle for the service.
We destroyed the channel because the other peer established a second one.
Definition: rps.h:292
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
Message from client to service with seed of peers.
Definition: rps.h:67
If we are waiting for a reply from that peer (sent a pull request).
Definition: rps.h:251
void(* PeerOp)(void *cls, const struct GNUNET_PeerIdentity *peer)
Functions of this type can be used to be stored at a peer for later execution.
Definition: rps.h:318
Message from client to service telling it to stop a new sub.
Definition: rps.h:149
Channel is used for sending.
Definition: rps.h:304
A 512-bit hashcode.
Message from service to client containing peer from biased stream.
Definition: rps.h:220
Message from client to service telling it to start a new sub.
Definition: rps.h:122
We set this bit when we are going to destroy the channel to this peer.
Definition: rps.h:267
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
The channel was removed because it was not needed any more.
Definition: rps.h:287
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
#define GNUNET_PACKED
gcc-ism to get packed structs.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Header for all communications.
static unsigned long long reserved
How much space have we currently reserved?
We set this bit when we know the peer is online.
Definition: rps.h:260