diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-14 13:41:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-14 13:41:42 +0000 |
commit | 49dd9ecf767c6ce681a6c5c499ff0ecf70f6ecdb (patch) | |
tree | 380a10b55e7065e2473f93212ba4b5925721d9da /src/include/gnunet_stream_lib.h | |
parent | 6ac444351418f5b15919c827ee418855656f6d14 (diff) | |
download | gnunet-49dd9ecf767c6ce681a6c5c499ff0ecf70f6ecdb.tar.gz gnunet-49dd9ecf767c6ce681a6c5c499ff0ecf70f6ecdb.zip |
-api improvement
Diffstat (limited to 'src/include/gnunet_stream_lib.h')
-rw-r--r-- | src/include/gnunet_stream_lib.h | 26 |
1 files changed, 25 insertions, 1 deletions
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 | |||
@@ -81,6 +81,28 @@ typedef void (*GNUNET_STREAM_OpenCallback) (void *cls, | |||
81 | 81 | ||
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Options for the stream. | ||
85 | */ | ||
86 | enum GNUNET_STREAM_Option | ||
87 | { | ||
88 | /** | ||
89 | * End of the option list. | ||
90 | */ | ||
91 | GNUNET_STREAM_OPTION_END = 0, | ||
92 | |||
93 | /** | ||
94 | * Option to set the initial retransmission timeout (when do we retransmit | ||
95 | * a packet that did not yield an acknowledgement for the first time?). | ||
96 | * Repeated retransmissions will then use an exponential back-off. | ||
97 | * Takes a 'struct GNUNET_TIME_Relative' as the only argument. A value | ||
98 | * of '0' means to use the round-trip time (plus a tiny grace period); | ||
99 | * this is also the default. | ||
100 | */ | ||
101 | GNUNET_STREAM_OPTION_INITIAL_RETRANSMIT_TIMEOUT | ||
102 | }; | ||
103 | |||
104 | |||
105 | /** | ||
84 | * Tries to open a stream to the target peer | 106 | * Tries to open a stream to the target peer |
85 | * | 107 | * |
86 | * @param target the target peer to which the stream has to be opened | 108 | * @param target the target peer to which the stream has to be opened |
@@ -88,6 +110,7 @@ typedef void (*GNUNET_STREAM_OpenCallback) (void *cls, | |||
88 | * stream | 110 | * stream |
89 | * @param open_cb this function will be called after stream has be established | 111 | * @param open_cb this function will be called after stream has be established |
90 | * @param open_cb_cls the closure for open_cb | 112 | * @param open_cb_cls the closure for open_cb |
113 | * @param ... options to the stream, terminated by GNUNET_STREAM_OPTION_END | ||
91 | * @return if successful it returns the stream socket; NULL if stream cannot be | 114 | * @return if successful it returns the stream socket; NULL if stream cannot be |
92 | * opened | 115 | * opened |
93 | */ | 116 | */ |
@@ -95,7 +118,8 @@ struct GNUNET_STREAM_Socket * | |||
95 | GNUNET_STREAM_open (const struct GNUNET_PeerIdentity *target, | 118 | GNUNET_STREAM_open (const struct GNUNET_PeerIdentity *target, |
96 | GNUNET_MESH_ApplicationType app_port, | 119 | GNUNET_MESH_ApplicationType app_port, |
97 | GNUNET_STREAM_OpenCallback open_cb, | 120 | GNUNET_STREAM_OpenCallback open_cb, |
98 | void *open_cb_cls); | 121 | void *open_cb_cls, |
122 | ...); | ||
99 | 123 | ||
100 | 124 | ||
101 | /** | 125 | /** |