stuff
[oweals/gnunet.git] / src / transport / transport.h
index 8e1291005904ff8a5c2fe31af3ece3d46a394fa2..603f1bbc1e5d4e9c223175c3f253ba254d981c85 100644 (file)
  * @brief common internal definitions for transport service
  * @author Christian Grothoff
  */
+#ifndef TRANSPORT_H
+#define TRANSPORT_H
+
 #include "gnunet_crypto_lib.h"
 #include "gnunet_time_lib.h"
 #include "gnunet_transport_service.h"
 
-#define DEBUG_TRANSPORT GNUNET_NO
+#define DEBUG_TRANSPORT GNUNET_YES
 
 /**
  * For how long do we allow unused bandwidth
@@ -64,6 +67,11 @@ struct ConnectInfoMessage
    */
   struct GNUNET_TIME_RelativeNBO latency;
 
+  /*
+   * Transport distance metric (i.e. hops for DV)
+   */
+  uint16_t distance;
+
   /**
    * Identity of the new neighbour.
    */
@@ -175,6 +183,11 @@ struct InboundMessage
    */
   struct GNUNET_PeerIdentity peer;
 
+  /*
+   * Distance metric.
+   */
+  uint16_t distance;
+
 };
 
 
@@ -219,9 +232,9 @@ struct OutboundMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * Always zero.
+   * Message priority.
    */
-  uint32_t reserved GNUNET_PACKED;
+  uint32_t priority GNUNET_PACKED;
 
   /**
    * Which peer should receive the message?
@@ -231,8 +244,72 @@ struct OutboundMessage
 };
 
 
+/**
+ * Message from the library to the transport service
+ * asking for converting a transport address to a
+ * human-readable UTF-8 string.
+ */
+struct AddressLookupMessage
+{
+
+  /**
+   * Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Should the conversion use numeric IP addresses (otherwise
+   * a reverse DNS lookup is OK -- if applicable).
+   */
+  int32_t numeric_only GNUNET_PACKED;
+
+  /**
+   * timeout to give up.
+   */
+  struct GNUNET_TIME_AbsoluteNBO timeout;
+
+  /**
+   * Length of the (binary) address in bytes, in big-endian.
+   */
+  uint32_t addrlen GNUNET_PACKED;
+
+  /* followed by 'addrlen' bytes of the actual address, then
+     followed by the 0-terminated name of the transport */
+};
+
+
+
+/**
+ * Change in blacklisting (either request or notification,
+ * depending on which direction it is going).
+ */
+struct BlacklistMessage
+{
 
+  /**
+   * Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST
+   */
+  struct GNUNET_MessageHeader header;
 
+  /**
+   * Reserved (for alignment).
+   */
+  uint32_t reserved GNUNET_PACKED;
+
+  /**
+   * Which peer is being blacklisted (or has seen its
+   * blacklisting expire)?
+   */
+  struct GNUNET_PeerIdentity peer;
+
+  /**
+   * Until what time is this peer blacklisted (zero for
+   * no longer blacklisted).
+   */
+  struct GNUNET_TIME_AbsoluteNBO until;
+
+};
 
 
 /* end of transport.h */
+#endif