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 
48 
53 
54  /* Followed by num_peers * GNUNET_PeerIdentity */
55 };
56 
57 
58 
59 /***********************************************************************
60 * Client-Service Messages
61 ***********************************************************************/
62 
71 
76 
77  /* Followed by num_peers * GNUNET_PeerIdentity */
78 };
79 
80 #if ENABLE_MALICIOUS
81 
84 struct GNUNET_RPS_CS_ActMaliciousMessage {
88  struct GNUNET_MessageHeader header;
89 
94  struct GNUNET_PeerIdentity attacked_peer;
95 
103  uint32_t type GNUNET_PACKED;
104 
108  uint32_t num_peers GNUNET_PACKED;
109 
110  /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious
111  behaviour is 1 */
112 };
113 #endif /* ENABLE_MALICIOUS */
114 
115 
124 
129 
133  struct GNUNET_TIME_RelativeNBO round_interval;
134 
138  struct GNUNET_HashCode hash GNUNET_PACKED;
139 };
140 
141 
150 
154  struct GNUNET_HashCode hash GNUNET_PACKED;
155 };
156 
157 
158 /* Debug messages */
159 
169 
174  uint32_t num_updates GNUNET_PACKED;
175 };
176 
185 
189  uint32_t id GNUNET_PACKED;
190 
195 };
196 /* Followed by num_peers * GNUNET_PeerIdentity */
197 
207 };
208 
216  struct GNUNET_MessageHeader header;
217 
222 
223  // TODO maybe source of peer (pull/push list, peerinfo, ...)
224 
225  /* Followed by num_peers * GNUNET_PeerIdentity */
226 };
227 
229 
230 /***********************************************************************
231 * Defines from old gnunet-service-rps_peers.h
232 ***********************************************************************/
233 
242 
243  /* IN_OTHER_GOSSIP_LIST = 0x02, unneeded? */
244  /* IN_OWN_SAMPLER_LIST = 0x04, unneeded? */
245  /* IN_OWN_GOSSIP_LIST = 0x08, unneeded? */
246 
250  Peers_ONLINE = 0x20,
251 
258 };
259 
271 
277 
282 };
283 
284 
293 
298 };
299 
306 typedef void (* PeerOp) (void *cls, const struct GNUNET_PeerIdentity *peer);
307 
317 typedef int
318 (*PeersIterator) (void *cls,
319  const struct GNUNET_PeerIdentity *peer);
320 
321 
325 extern struct GNUNET_STATISTICS_Handle *stats;
326 
Peers_ChannelRole
The role of a channel.
Definition: rps.h:288
Message from service to client containing current update of view.
Definition: rps.h:180
Message from client to service indicating that clients wants to get stream of biased peers...
Definition: rps.h:202
We destroyed the channel because the other peer established a second one.
Definition: rps.h:270
struct GNUNET_MessageHeader header
Header including size and type in NBO.
Definition: rps.h:47
Message from client to service indicating that clients wants to get updates of the view...
Definition: rps.h:164
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:318
Channel is used for receiving.
Definition: rps.h:297
Peers_ChannelFlags
Keep track of the status of a channel.
Definition: rps.h:266
uint32_t num_peers
Number of PeerIDs sent.
Definition: rps.h:52
Peers_PeerFlags
Different flags indicating the status of another peer.
Definition: rps.h:237
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:281
#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:241
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:306
Message from client to service telling it to stop a new sub.
Definition: rps.h:145
Channel is used for sending.
Definition: rps.h:292
A 512-bit hashcode.
Message from service to client containing peer from biased stream.
Definition: rps.h:212
Message from client to service telling it to start a new sub.
Definition: rps.h:119
We set this bit when we are going to destroy the channel to this peer.
Definition: rps.h:257
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:276
#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:250