From 49dd9ecf767c6ce681a6c5c499ff0ecf70f6ecdb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 14 Dec 2011 13:41:42 +0000 Subject: [PATCH] -api improvement --- src/include/gnunet_stream_lib.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h index df5739cfe..36cfabd7e 100644 --- a/src/include/gnunet_stream_lib.h +++ b/src/include/gnunet_stream_lib.h @@ -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, + ...); /** -- 2.25.1