GNUnet  0.11.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 * Client-Service Messages
61 ***********************************************************************/
62 
67 {
72 
77 
78  /* Followed by num_peers * GNUNET_PeerIdentity */
79 };
80 
81 #if ENABLE_MALICIOUS
82 
85 struct GNUNET_RPS_CS_ActMaliciousMessage
86 {
90  struct GNUNET_MessageHeader header;
91 
96  struct GNUNET_PeerIdentity attacked_peer;
97 
105  uint32_t type GNUNET_PACKED;
106 
110  uint32_t num_peers GNUNET_PACKED;
111 
112  /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious
113  behaviour is 1 */
114 };
115 #endif /* ENABLE_MALICIOUS */
116 
117 
122 {
127 
132 
136  struct GNUNET_TIME_RelativeNBO round_interval;
137 
141  struct GNUNET_HashCode hash GNUNET_PACKED;
142 };
143 
144 
149 {
154 
158  struct GNUNET_HashCode hash GNUNET_PACKED;
159 };
160 
161 
162 /* Debug messages */
163 
169 {
174 
179  uint32_t num_updates GNUNET_PACKED;
180 };
181 
186 {
191 
195  uint32_t id GNUNET_PACKED;
196 
201 };
202 /* Followed by num_peers * GNUNET_PeerIdentity */
203 
209 {
214 };
215 
220 {
224  struct GNUNET_MessageHeader header;
225 
230 
231  // TODO maybe source of peer (pull/push list, peerinfo, ...)
232 
233  /* Followed by num_peers * GNUNET_PeerIdentity */
234 };
235 
237 
238 /***********************************************************************
239 * Defines from old gnunet-service-rps_peers.h
240 ***********************************************************************/
241 
246 {
251 
252  /* IN_OTHER_GOSSIP_LIST = 0x02, unneeded? */
253  /* IN_OWN_SAMPLER_LIST = 0x04, unneeded? */
254  /* IN_OWN_GOSSIP_LIST = 0x08, unneeded? */
255 
259  Peers_ONLINE = 0x20,
260 
267 };
268 
276 {
281 
287 
292 };
293 
294 
299 {
304 
309 };
310 
317 typedef void (*PeerOp) (void *cls, const struct GNUNET_PeerIdentity *peer);
318 
328 typedef int
329 (*PeersIterator) (void *cls,
330  const struct GNUNET_PeerIdentity *peer);
331 
332 
336 extern struct GNUNET_STATISTICS_Handle *stats;
Peers_ChannelRole
The role of a channel.
Definition: rps.h:298
Message from service to client containing current update of view.
Definition: rps.h:185
Message from client to service indicating that clients wants to get stream of biased peers...
Definition: rps.h:208
We destroyed the channel because the other peer established a second one.
Definition: rps.h:280
struct GNUNET_MessageHeader header
Header including size and type in NBO.
Definition: rps.h:48
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:317
Message from client to service indicating that clients wants to get updates of the view...
Definition: rps.h:168
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:329
Channel is used for receiving.
Definition: rps.h:308
Peers_ChannelFlags
Keep track of the status of a channel.
Definition: rps.h:275
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:245
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:291
#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:66
If we are waiting for a reply from that peer (sent a pull request).
Definition: rps.h:250
Message from client to service telling it to stop a new sub.
Definition: rps.h:148
Channel is used for sending.
Definition: rps.h:303
A 512-bit hashcode.
Message from service to client containing peer from biased stream.
Definition: rps.h:219
Message from client to service telling it to start a new sub.
Definition: rps.h:121
We set this bit when we are going to destroy the channel to this peer.
Definition: rps.h:266
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:286
#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:259