-makefile for new test_stream_local (commented)
[oweals/gnunet.git] / src / transport / transport.h
index f3c4329a90214204e15307189c75e29a1dc52922..0277202717729ce2c00f365ffc90f58081b1c68b 100644 (file)
@@ -61,6 +61,8 @@
  */
 #define CONNECTED_LATENCY_EVALUATION_MAX_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message from the transport service to the library
  * asking to check if both processes agree about this
@@ -75,9 +77,11 @@ struct StartMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * Should the 'self' field be checked?
+   * 0: no options
+   * 1: The 'self' field should be checked
+   * 2: this client is interested in payload traffic
    */
-  uint32_t do_check;
+  uint32_t options;
 
   /**
    * Identity we think we have.  If it does not match, the
@@ -110,12 +114,6 @@ struct ConnectInfoMessage
    * Identity of the new neighbour.
    */
   struct GNUNET_PeerIdentity id;
-
-  /**
-   * First of the ATS information blocks (we must have at least
-   * one due to the 0-termination requirement).
-   */
-  struct GNUNET_ATS_Information ats;
 };
 
 
@@ -216,11 +214,6 @@ struct InboundMessage
    */
   struct GNUNET_PeerIdentity peer;
 
-  /**
-   * First of the ATS information blocks (we must have at least
-   * one due to the 0-termination requirement).
-   */
-  struct GNUNET_ATS_Information ats;
 };
 
 
@@ -296,7 +289,7 @@ struct AddressLookupMessage
 {
 
   /**
-   * Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP
+   * Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING
    */
   struct GNUNET_MessageHeader header;
 
@@ -304,17 +297,17 @@ struct AddressLookupMessage
    * Should the conversion use numeric IP addresses (otherwise
    * a reverse DNS lookup is OK -- if applicable).
    */
-  int32_t numeric_only GNUNET_PACKED;
+  int16_t numeric_only GNUNET_PACKED;
 
   /**
-   * timeout to give up.
+   * Length of the (binary) address in bytes, in big-endian.
    */
-  struct GNUNET_TIME_RelativeNBO timeout;
+  uint16_t addrlen GNUNET_PACKED;
 
   /**
-   * Length of the (binary) address in bytes, in big-endian.
+   * timeout to give up.
    */
-  uint32_t addrlen GNUNET_PACKED;
+  struct GNUNET_TIME_RelativeNBO timeout;
 
   /* followed by 'addrlen' bytes of the actual address, then
    * followed by the 0-terminated name of the transport */
@@ -361,24 +354,33 @@ struct AddressIterateMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * For alignment.
+   * One shot call or continous replies?
    */
-  uint32_t reserved;
+  uint32_t one_shot;
 
   /**
    * timeout to give up.  FIXME: remove in the future
    */
   struct GNUNET_TIME_AbsoluteNBO timeout;
+
+  /**
+   * The identity of the peer to look up.
+   */
+  struct GNUNET_PeerIdentity peer;
+
 };
 
+
 /**
- * Message from the library to the transport service
- * asking for human readable addresses known for a peer.
+ * Message from the transport service to the library
+ * containing binary addresses known for a peer.
+ * Memory layout:
+ * [AddressIterateResponseMessage][address[addrlen]][transportname[pluginlen]]
  */
 struct AddressIterateResponseMessage
 {
   /**
-   * Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_REPLY
+   * Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_ITERATE_RESPONSE
    */
   struct GNUNET_MessageHeader header;
 
@@ -387,7 +389,7 @@ struct AddressIterateResponseMessage
    */
   uint32_t reserved;
 
-  /**
+    /**
    * Peer identity
    */
   struct GNUNET_PeerIdentity peer;
@@ -401,6 +403,7 @@ struct AddressIterateResponseMessage
    * length of the plugin name
    */
   uint32_t pluginlen GNUNET_PACKED;
+
 };
 
 
@@ -429,7 +432,7 @@ struct BlacklistMessage
   struct GNUNET_PeerIdentity peer;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /* end of transport.h */
 #endif