dbg-only
[oweals/gnunet.git] / src / core / core.h
index f9117ef4c975ac61f9ac995dfaff2a9f97ca0f00..3a313a292c46eb8103d6c0d7079796a0b5c0892e 100644 (file)
 /**
  * General core debugging.
  */
-#define DEBUG_CORE GNUNET_YES
+#define DEBUG_CORE GNUNET_NO
 
 /**
  * Debugging interaction core-clients.
  */
-#define DEBUG_CORE_CLIENT GNUNET_YES
+#define DEBUG_CORE_CLIENT GNUNET_NO
 
 /**
  * Definition of bits in the InitMessage's options field that specify
@@ -110,6 +110,36 @@ struct ConnectNotifyMessage
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Distance to the peer.
+   */
+  uint32_t distance GNUNET_PACKED;
+
+  /**
+   * Currently observed latency.
+   */
+  struct GNUNET_TIME_RelativeNBO latency;
+
+  /**
+   * Identity of the connecting peer.
+   */
+  struct GNUNET_PeerIdentity peer;
+
+};
+
+
+
+/**
+ * Message sent by the service to clients to notify them
+ * about a peer disconnecting.
+ */
+struct DisconnectNotifyMessage
+{
+  /**
+   * Header with type GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT.
+   */
+  struct GNUNET_MessageHeader header;
+
   /**
    * Always zero.
    */
@@ -142,9 +172,14 @@ struct NotifyTrafficMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * Always zero.
+   * Distance to the peer.
    */
-  uint32_t reserved GNUNET_PACKED;
+  uint32_t distance GNUNET_PACKED;
+
+  /**
+   * Currently observed latency.
+   */
+  struct GNUNET_TIME_RelativeNBO latency;
 
   /**
    * Identity of the receiver or sender.
@@ -175,7 +210,7 @@ struct RequestInfoMessage
    * peer to at most the specified amount (naturally, the
    * amount is also limited by the receiving peer).
    */
-  uint32_t limit_outbound_bpm GNUNET_PACKED;
+  struct GNUNET_BANDWIDTH_Value32NBO limit_outbound;
 
   /**
    * Number of bytes of inbound traffic to reserve, can
@@ -217,22 +252,16 @@ struct ConfigurationInfoMessage
   int32_t reserved_amount GNUNET_PACKED;
 
   /**
-   * Available bandwidth in (in bytes per minute) for this peer.
+   * Available bandwidth in for this peer.
    * 0 if we have been disconnected.
    */
-  uint32_t bpm_in GNUNET_PACKED;
+  struct GNUNET_BANDWIDTH_Value32NBO bw_in;
 
   /**
-   * Available bandwidth out (in bytes per minute) for this peer,
+   * Available bandwidth out for this peer,
    * 0 if we have been disconnected.
    */
-  uint32_t bpm_out GNUNET_PACKED;
-
-  /**
-   * Latest transport latency estimate for the peer.
-   * FOREVER if we have been disconnected.
-   */
-  struct GNUNET_TIME_RelativeNBO latency;
+  struct GNUNET_BANDWIDTH_Value32NBO bw_out;
 
   /**
    * Current traffic preference for the peer.
@@ -278,4 +307,36 @@ struct SendMessage
 };
 
 
+/**
+ * Client asking core to connect to a particular target.  There is no
+ * response from the core to this type of request (however, if an
+ * actual connection is created or destroyed, be it because of this
+ * type request or not, the core generally needs to notify the
+ * clients).
+ */
+struct ConnectMessage
+{
+  /**
+   * Header with type GNUNET_MESSAGE_TYPE_REQUEST_CONNECT or
+   * GNUNET_MESSAGE_TYPE_REQUEST_DISCONNECT.
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * For alignment.
+   */
+  uint32_t reserved GNUNET_PACKED;
+
+  /**
+   * When to time out.
+   */
+  struct GNUNET_TIME_RelativeNBO timeout;
+
+  /**
+   * Identity of the other peer.
+   */
+  struct GNUNET_PeerIdentity peer;
+
+};
+
 /* end of core.h */