client_manager: add API for async operations
[oweals/gnunet.git] / src / include / gnunet_transport_plugin.h
index 90d6ed2c6c430b724eeca844b84e1f91a58c9d01..f8394ebc5fed3ab703b6c29942db2eac6ab93166 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet
-     (C) 2009-2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009-2014 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
@@ -80,15 +80,14 @@ typedef void
  * @param cls unused
  * @param address the address
  * @param session the new session
- * @param ats ats information
- * @param ats_count number of @a ats information
+ * @param net network information
  */
 typedef void
 (*GNUNET_TRANSPORT_SessionStart) (void *cls,
-                                  struct GNUNET_HELLO_Address *address,
+                                  const struct GNUNET_HELLO_Address *address,
                                   struct Session *session,
-                                  const struct GNUNET_ATS_Information *ats,
-                                  uint32_t ats_count);
+                                  enum GNUNET_ATS_Network_Type net);
+
 
 /**
  * Function called by the transport for each received message.
@@ -120,8 +119,9 @@ typedef struct GNUNET_TIME_Relative
 
 
 /**
- * Function that will be called to figure if an address is an
- * loopback, LAN, WAN etc. address
+ * Function that can be called by plugins to figure if an address is
+ * an loopback, LAN or WAN address.   Ultimately invokes
+ * #GNUNET_ATS_address_get_type().
  *
  * @param cls closure
  * @param addr binary address
@@ -135,22 +135,17 @@ typedef enum GNUNET_ATS_Network_Type
 
 
 /**
- * Function called when quality properties of an address change.
+ * Function called when distance of an address changes.
  *
  * @param cls closure
  * @param peer peer
- * @param address address
- * @param address_len length of the @a address
- * @param session session
- * @param ats ATS information
- * @param ats_count number entries in the @a ats array
+ * @param distance new distance
  */
 typedef void
-(*GNUNET_TRANSPORT_UpdateAddressMetrics) (void *cls,
-                                         const struct GNUNET_HELLO_Address *address,
-                                         struct Session *session,
-                                         const struct GNUNET_ATS_Information *ats,
-                                         uint32_t ats_count);
+(*GNUNET_TRANSPORT_UpdateAddressDistance) (void *cls,
+                                           const struct GNUNET_HELLO_Address *address,
+                                           uint32_t distance);
+
 
 /**
  * Function that will be called for each address the transport
@@ -189,38 +184,6 @@ typedef struct GNUNET_TIME_Relative
                                    size_t amount_recved);
 
 
-/**
- * Function to be called by the plugin to be notified about changes to the quota
- * for a specific peer, plugin and session
- *
- * @param cls closure
- * @param peer the peer to be notified about
- * @param plugin the plugin to be notified about
- * @param session the session for include in the notification
- *
- */
-typedef void
-(*GNUNET_TRANSPORT_RegisterQuotaNotification) (void *cls,
-                                               const struct GNUNET_PeerIdentity *peer,
-                                               const char *plugin,
-                                               struct Session *session);
-
-
-/**
- * Function to be called by the plugin to stop notification about changes to the quota
- * for a specific peer, plugin and session
- *
- * @param cls closure
- * @param peer the peer to be notified about
- * @param plugin the plugin to be notified about
- * @param session the session for include in the notification
- */
-typedef void
-(*GNUNET_TRANSPORT_UnregisterQuotaNotification) (void *cls,
-                                                 const struct GNUNET_PeerIdentity *peer,
-                                                 const char *plugin,
-                                                 struct Session *session);
-
 /**
  * Function that returns a HELLO message.
  *
@@ -298,20 +261,10 @@ struct GNUNET_TRANSPORT_PluginEnvironment
   GNUNET_TRANSPORT_AddressToType get_address_type;
 
   /**
-   * Function that will be called to figure if an address is an loopback,
-   * LAN, WAN etc. address
+   * Function that will be called by DV to update distance for
+   * an address.
    */
-  GNUNET_TRANSPORT_UpdateAddressMetrics update_address_metrics;
-
-  /**
-   * FIXME: document!
-   */
-  GNUNET_TRANSPORT_RegisterQuotaNotification register_quota_notification;
-
-  /**
-   * FIXME: document!
-   */
-  GNUNET_TRANSPORT_UnregisterQuotaNotification unregister_quota_notification;
+  GNUNET_TRANSPORT_UpdateAddressDistance update_address_distance;
 
   /**
    * What is the maximum number of connections that this transport
@@ -530,7 +483,6 @@ typedef void
                                           struct Session *session);
 
 
-
 /**
  * Function that will be called whenever the transport service wants to
  * notify the plugin that the inbound quota changed and that the plugin
@@ -587,7 +539,7 @@ typedef int
 /**
  * Function to obtain the network type for a session
  *
- * @param cls closure ('struct Plugin*')
+ * @param cls closure (`struct Plugin *`)
  * @param session the session
  * @return the network type
  */
@@ -718,7 +670,7 @@ struct GNUNET_TRANSPORT_PluginFunctions
 
   /**
    * Function that will be called tell the plugin to create a session
-   * object
+   * object.
    */
   GNUNET_TRANSPORT_CreateSession get_session;