-version bumping
[oweals/gnunet.git] / src / include / gnunet_transport_plugin.h
index 6bf365243c80ecf1545e3fe940e348d16e927c92..62c8f16380897824c0bdf0b7df2ddb0386e9d0c7 100644 (file)
@@ -74,14 +74,13 @@ struct SessionHeader
  *
  * @param cls closure
  * @param peer which peer was the session for
- * @param session which session is being destoyed
+ * @param session which session is being destroyed
  */
 typedef void
 (*GNUNET_TRANSPORT_SessionEnd) (void *cls,
                                 const struct GNUNET_PeerIdentity *peer,
                                 struct Session *session);
 
-
 /**
  * Function that will be called whenever the plugin internally
  * creates a new session and hence transport need to tell ATS.
@@ -107,7 +106,6 @@ typedef void
                                   const struct GNUNET_ATS_Information *ats,
                                   uint32_t ats_count);
 
-
 /**
  * Function called by the transport for each received message.
  * This function should also be called with "NULL" for the
@@ -390,6 +388,17 @@ typedef int
 (*GNUNET_TRANSPORT_DisconnectSessionFunction) (void *cls,
                                                struct Session *session);
 
+/**
+ * Function that is called to get the keepalive factor.
+ * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to
+ * calculate the interval between keepalive packets.
+ *
+ * @param cls closure with the `struct Plugin`
+ * @return keepalive factor
+ */
+typedef unsigned int
+(*GNUNET_TRANSPORT_QueryKeepaliveFactorFunction) (void *cls);
+
 
 /**
  * Function that can be called to force a disconnect from the
@@ -480,6 +489,20 @@ typedef struct Session *
                                    const struct GNUNET_HELLO_Address *address);
 
 
+/**
+ * Function that will be called whenever the transport service wants to
+ * notify the plugin that a session is still active and in use and
+ * therefore the session timeout for this session has to be updated
+ *
+ * @param cls closure
+ * @param peer which peer was the session for
+ * @param session which session is being updated
+ */
+typedef void
+(*GNUNET_TRANSPORT_UpdateSessionTimeout) (void *cls,
+                                          const struct GNUNET_PeerIdentity *peer,
+                                          struct Session *session);
+
 /**
  * Function called for a quick conversion of the binary address to
  * a numeric address.  Note that the caller must not free the
@@ -564,6 +587,20 @@ struct GNUNET_TRANSPORT_PluginFunctions
    */
   GNUNET_TRANSPORT_DisconnectSessionFunction disconnect_session;
 
+  /**
+   * Function that will be called whenever the transport service wants to
+   * notify the plugin that a session is still active and in use and
+   * therefore the session timeout for this session has to be updated
+   */
+  GNUNET_TRANSPORT_UpdateSessionTimeout update_session_timeout;
+
+  /**
+   * Function that is used to query keepalive factor.
+   * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to
+   * calculate the interval between keepalive packets.
+   */
+  GNUNET_TRANSPORT_QueryKeepaliveFactorFunction query_keepalive_factor;
+
   /**
    * Function to pretty-print addresses.  NOTE: this function is not
    * yet used by transport-service, but will be used in the future