social cli
[oweals/gnunet.git] / src / rps / rps.h
index 0fbd2fb60462c6473d617b4198fa1431a50d6287..3037e219035e6847d6ec2409f1b2e8ce26c9bfe0 100644 (file)
@@ -1,6 +1,6 @@
 /*
       This file is part of GNUnet
-      Copyright (C) 2012-2013 Christian Grothoff (and other contributing authors)
+      Copyright (C) 2012-2013 GNUnet e.V.
 
       GNUnet is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
       You should have received a copy of the GNU General Public License
       along with GNUnet; see the file COPYING.  If not, write to the
-      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-      Boston, MA 02111-1307, USA.
+      Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+      Boston, MA 02110-1301, USA.
  */
 /**
  * @file rps/rps.h
@@ -24,7 +24,6 @@
  */
 
 #include "gnunet_rps_service.h"
-//#define ENABLE_MALICIOUS 1
 
 /**
  * Mesh port used by RPS.
@@ -75,7 +74,7 @@ struct GNUNET_RPS_CS_RequestMessage
   /**
    * Identifyer of the message.
    */
-  uint64_t n GNUNET_PACKED;
+  uint32_t id GNUNET_PACKED;
 
   /**
    * Number of random peer requested
@@ -96,7 +95,7 @@ struct GNUNET_RPS_CS_ReplyMessage
   /**
    * Identifyer of the message.
    */
-  uint64_t n GNUNET_PACKED;
+  uint32_t id GNUNET_PACKED;
 
   /**
    * Number of random peer replied
@@ -106,6 +105,22 @@ struct GNUNET_RPS_CS_ReplyMessage
   /* Followed by num_peers * GNUNET_PeerIdentity */
 };
 
+/**
+ * Message from client to RPS service to cancel request.
+ */
+struct GNUNET_RPS_CS_RequestCancelMessage
+{
+  /**
+   * Header including size and type in NBO
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Identifyer of the message.
+   */
+  uint32_t id GNUNET_PACKED;
+};
+
 /**
  * Message from client to service with seed of peers.
  */
@@ -124,7 +139,7 @@ struct GNUNET_RPS_CS_SeedMessage
   /* Followed by num_peers * GNUNET_PeerIdentity */
 };
 
-#if ENABLE_MALICIOUS
+#ifdef ENABLE_MALICIOUS
 /**
  * Message from client to service to turn service malicious.
  */
@@ -135,6 +150,12 @@ struct GNUNET_RPS_CS_ActMaliciousMessage
    */
   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.
    *
@@ -149,7 +170,8 @@ struct GNUNET_RPS_CS_ActMaliciousMessage
    */
   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 */