hxing
[oweals/gnunet.git] / src / core / core.h
index a8d90b81a6b50ce13671d48e06d0c7cca2d96550..a1854ccb40b32a906399043f98db0c6ae80aff70 100644 (file)
  * @file core/core.h
  * @brief common internal definitions for core service
  * @author Christian Grothoff
- *
- * TODO:
- * - bound message queue size
- * - on disconnect from core, signal disconnect for all peers
- *   and clean up peer records
- * - create / destroy peer records on connect/disconnect events
- * - implement iterator API
- * - implement re-configure API
- * - check on peer-related events that connection is known
- *   (if not, GNUNET_break + reconnect)
- * - handle atsi records
  */
 #include "gnunet_bandwidth_lib.h"
 #include "gnunet_crypto_lib.h"
 /**
  * General core debugging.
  */
-#define DEBUG_CORE GNUNET_NO
+#define DEBUG_CORE GNUNET_EXTRA_LOGGING
 
 /**
  * Debugging interaction core-clients.
  */
-#define DEBUG_CORE_CLIENT GNUNET_NO
+#define DEBUG_CORE_CLIENT GNUNET_EXTRA_LOGGING
 
 /**
  * Definition of bits in the InitMessage's options field that specify
@@ -106,7 +95,7 @@ struct InitReplyMessage
   /**
    * Public key of the local peer.
    */
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey;
+  struct GNUNET_PeerIdentity my_identity;
 
 };
 
@@ -128,11 +117,6 @@ struct ConnectNotifyMessage
    */
   uint32_t ats_count GNUNET_PACKED;
 
-  /**
-   * Currently observed latency.
-   */
-  struct GNUNET_TIME_RelativeNBO latency;
-
   /**
    * Identity of the connecting peer.
    */
@@ -240,11 +224,6 @@ struct NotifyTrafficMessage
    */
   uint32_t ats_count GNUNET_PACKED;
 
-  /**
-   * Currently observed latency.
-   */
-  struct GNUNET_TIME_RelativeNBO latency;
-
   /**
    * Identity of the receiver or sender.
    */
@@ -321,6 +300,13 @@ struct ConfigurationInfoMessage
    */
   int32_t reserved_amount GNUNET_PACKED;
 
+  /**
+   * If the reservation request could not be satisfied (reserved_amount
+   * was zero), how long should the client wait until retrying? 0 if
+   * bandwidth was reserved.
+   */
+  struct GNUNET_TIME_RelativeNBO reserve_delay;
+
   /**
    * Unique request ID.
    */
@@ -392,7 +378,7 @@ struct SendMessageRequest
 
 
 /**
- * Core notifying client that it is allowed to now 
+ * Core notifying client that it is allowed to now
  * transmit a message to the given target
  * (response to GNUNET_MESSAGE_TYPE_CORE_SEND_REQUEST).
  */
@@ -404,9 +390,9 @@ struct SendMessageReady
   struct GNUNET_MessageHeader header;
 
   /**
-   * How many bytes are allowed for transmission? 
+   * How many bytes are allowed for transmission?
    * Guaranteed to be at least as big as the requested size,
-   * or ZERO if the request is rejected (will timeout, 
+   * or ZERO if the request is rejected (will timeout,
    * peer disconnected, queue full, etc.).
    */
   uint16_t size GNUNET_PACKED;
@@ -426,7 +412,7 @@ struct SendMessageReady
 
 /**
  * Client asking core to transmit a particular message to a particular
- * target (responsde to GNUNET_MESSAGE_TYPE_CORE_SEND_READY).
+ * target (response to GNUNET_MESSAGE_TYPE_CORE_SEND_READY).
  */
 struct SendMessage
 {
@@ -451,6 +437,16 @@ struct SendMessage
    */
   struct GNUNET_PeerIdentity peer;
 
+  /**
+   * GNUNET_YES if corking is allowed, GNUNET_NO if not.
+   */
+  uint32_t cork GNUNET_PACKED;
+
+  /**
+   * Always 0.
+   */
+  uint64_t reserved GNUNET_PACKED;
+
 };
 
 
@@ -474,11 +470,6 @@ struct ConnectMessage
    */
   uint32_t reserved GNUNET_PACKED;
 
-  /**
-   * When to time out.
-   */
-  struct GNUNET_TIME_RelativeNBO timeout;
-
   /**
    * Identity of the other peer.
    */