-improve UDP logging
[oweals/gnunet.git] / src / rps / rps.h
index 46c8ab0bb67d05091f75128808fc593f71d44900..3f76326a3664ebd58e032933b600e74262089edd 100644 (file)
@@ -1,6 +1,6 @@
 /*
       This file is part of GNUnet
-      (C) 2012-2013 Christian Grothoff (and other contributing authors)
+      Copyright (C) 2012-2013 Christian Grothoff (and other contributing authors)
 
       GNUnet is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published
@@ -37,37 +37,6 @@ GNUNET_NETWORK_STRUCT_BEGIN
  * P2P Messages
 ***********************************************************************/
 
-/**
- * P2P Message to push own ID to other peer.
- */
-struct GNUNET_RPS_P2P_PushMessage
-{
-  /**
-   * Header including size and type in NBO
-   */
-  struct GNUNET_MessageHeader header;
-
-  /** 
-   * TODO Proof of work
-   */
-  uint64_t placeholder;
-};
-
-/**
- * P2P Message to request PeerIDs from other peer.
- */
-struct GNUNET_RPS_P2P_PullRequestMessage
-{
-  /**
-   * Header including size and type in NBO
-   */
-  struct GNUNET_MessageHeader header;
-
-  /* This probably stays empty as we just
-   * infrom the peer of our existence */
-  uint64_t placeholder;
-};
-
 /**
  * P2P Message to send PeerIDs to other peer.
  */
@@ -81,7 +50,7 @@ struct GNUNET_RPS_P2P_PullReplyMessage
   /**
    * Number of PeerIDs sent
    */
-  uint64_t num_peers GNUNET_PACKED;
+  uint32_t num_peers GNUNET_PACKED;
 
   /* Followed by num_peers * GNUNET_PeerIdentity */
 };
@@ -103,14 +72,15 @@ struct GNUNET_RPS_CS_RequestMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * Identifyer of the message.
+   * Number of random peer requested
    */
-  uint64_t n;
+  uint32_t num_peers GNUNET_PACKED; 
 
   /**
-   * Number of random peer requested
+   * Identifyer of the message.
    */
-  uint64_t num_peers GNUNET_PACKED;
+  uint64_t n GNUNET_PACKED;
+
 };
 
 /**
@@ -119,7 +89,7 @@ struct GNUNET_RPS_CS_RequestMessage
 struct GNUNET_RPS_CS_ReplyMessage
 {
   /**
-   * Header including size and type in NBO
+   * Type is #GNUNET_MESSAGE_TYPE_RPS_CS_REPLY.
    */
   struct GNUNET_MessageHeader header;
 
@@ -136,4 +106,22 @@ struct GNUNET_RPS_CS_ReplyMessage
   /* Followed by num_peers * GNUNET_PeerIdentity */
 };
 
+/**
+ * Message from client to service with seed of peers
+ */
+struct GNUNET_RPS_CS_SeedMessage
+{
+  /**
+   * Header including size and type in NBO
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Number of peers
+   */
+  uint64_t num_peers;
+
+  /* Followed by num_peers * GNUNET_PeerIdentity */
+};
+
 GNUNET_NETWORK_STRUCT_END