-api improvement
authorChristian Grothoff <christian@grothoff.org>
Wed, 14 Dec 2011 13:41:42 +0000 (13:41 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 14 Dec 2011 13:41:42 +0000 (13:41 +0000)
src/include/gnunet_stream_lib.h

index df5739cfe9f956d3b43599de011a4e57ae8603a5..36cfabd7e7a104e860636a018cd8d640e9090a07 100644 (file)
@@ -80,6 +80,28 @@ typedef void (*GNUNET_STREAM_OpenCallback) (void *cls,
                                            struct GNUNET_STREAM_Socket *socket);
 
 
+/**
+ * Options for the stream.
+ */
+enum GNUNET_STREAM_Option
+  {
+    /**
+     * End of the option list.
+     */
+    GNUNET_STREAM_OPTION_END = 0,
+
+    /**
+     * Option to set the initial retransmission timeout (when do we retransmit
+     * a packet that did not yield an acknowledgement for the first time?).  
+     * Repeated retransmissions will then use an exponential back-off.
+     * Takes a 'struct GNUNET_TIME_Relative' as the only argument.  A value
+     * of '0' means to use the round-trip time (plus a tiny grace period);
+     * this is also the default.
+     */
+    GNUNET_STREAM_OPTION_INITIAL_RETRANSMIT_TIMEOUT
+  };
+
+
 /**
  * Tries to open a stream to the target peer
  *
@@ -88,6 +110,7 @@ typedef void (*GNUNET_STREAM_OpenCallback) (void *cls,
  *            stream
  * @param open_cb this function will be called after stream has be established 
  * @param open_cb_cls the closure for open_cb
+ * @param ... options to the stream, terminated by GNUNET_STREAM_OPTION_END
  * @return if successful it returns the stream socket; NULL if stream cannot be
  *         opened 
  */
@@ -95,7 +118,8 @@ struct GNUNET_STREAM_Socket *
 GNUNET_STREAM_open (const struct GNUNET_PeerIdentity *target,
                     GNUNET_MESH_ApplicationType app_port,
                     GNUNET_STREAM_OpenCallback open_cb,
-                   void *open_cb_cls);
+                   void *open_cb_cls,
+                   ...);
 
 
 /**