You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
* @file rps/rps.h
***********************************************************************/
/**
- * Message from client to RPS service to request random peer(s).
+ * Message from client to service with seed of peers.
*/
-struct GNUNET_RPS_CS_RequestMessage
+struct GNUNET_RPS_CS_SeedMessage
{
/**
* Header including size and type in NBO
struct GNUNET_MessageHeader header;
/**
- * Identifyer of the message.
- */
- uint32_t id GNUNET_PACKED;
-
- /**
- * Number of random peer requested
+ * Number of peers
*/
uint32_t num_peers GNUNET_PACKED;
+
+ /* Followed by num_peers * GNUNET_PeerIdentity */
};
+#if ENABLE_MALICIOUS
/**
- * Message from RPS service to client to reply with random peer(s).
+ * Message from client to service to turn service malicious.
*/
-struct GNUNET_RPS_CS_ReplyMessage
+struct GNUNET_RPS_CS_ActMaliciousMessage
{
/**
- * Type is #GNUNET_MESSAGE_TYPE_RPS_CS_REPLY.
+ * Header including size and type in NBO
*/
struct GNUNET_MessageHeader header;
/**
- * Identifyer of the message.
+ * If the type is 2 this is the attacked peer,
+ * empty otherwise.
*/
- uint32_t id GNUNET_PACKED;
+ struct GNUNET_PeerIdentity attacked_peer;
+
+ /**
+ * Type of malicious behaviour.
+ *
+ * 0 No malicious bahaviour at all
+ * 1 Try to maximise representation
+ * 2 Try to partition the network
+ */
+ uint32_t type GNUNET_PACKED;
/**
- * Number of random peer replied
+ * Number of peers
*/
uint32_t num_peers GNUNET_PACKED;
- /* Followed by num_peers * GNUNET_PeerIdentity */
+ /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious
+ behaviour is 1 */
};
+#endif /* ENABLE_MALICIOUS */
+
/**
- * Message from client to RPS service to cancel request.
+ * Message from client to service telling it to start a new sub
*/
-struct GNUNET_RPS_CS_RequestCancelMessage
+struct GNUNET_RPS_CS_SubStartMessage
{
/**
* Header including size and type in NBO
struct GNUNET_MessageHeader header;
/**
- * Identifyer of the message.
+ * For alignment.
*/
- uint32_t id GNUNET_PACKED;
-};
+ uint32_t reserved GNUNET_PACKED;
-/**
- * Message from client to service with seed of peers.
- */
-struct GNUNET_RPS_CS_SeedMessage
-{
/**
- * Header including size and type in NBO
+ * Mean interval between two rounds
*/
- struct GNUNET_MessageHeader header;
+ struct GNUNET_TIME_RelativeNBO round_interval;
/**
- * Number of peers
+ * Length of the shared value represented as string.
*/
- uint32_t num_peers GNUNET_PACKED;
-
- /* Followed by num_peers * GNUNET_PeerIdentity */
+ struct GNUNET_HashCode hash GNUNET_PACKED;
};
-#ifdef ENABLE_MALICIOUS
+
/**
- * Message from client to service to turn service malicious.
+ * Message from client to service telling it to stop a new sub
*/
-struct GNUNET_RPS_CS_ActMaliciousMessage
+struct GNUNET_RPS_CS_SubStopMessage
{
/**
* Header including size and type in NBO
struct GNUNET_MessageHeader header;
/**
- * If the type is 2 this is the attacked peer,
- * empty otherwise.
- */
- struct GNUNET_PeerIdentity attacked_peer;
-
- /**
- * Type of malicious behaviour.
- *
- * 0 No malicious bahaviour at all
- * 1 Try to maximise representation
- * 2 Try to partition the network
- */
- uint32_t type GNUNET_PACKED;
-
- /**
- * Number of peers
+ * Length of the shared value represented as string.
*/
- uint32_t num_peers GNUNET_PACKED;
-
- /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious
- behaviour is 1 */
+ struct GNUNET_HashCode hash GNUNET_PACKED;
};
-#endif /* ENABLE_MALICIOUS */
/* Debug messages */