diff options
author | Gabor X Toth <*@tg-x.net> | 2013-07-15 07:25:09 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2013-07-15 07:25:09 +0000 |
commit | 00c2318820ac3ee2ea06c173c3fce994bc29eb4e (patch) | |
tree | d825e66cde2d0efdc4491033c32e096937bd9d58 /src/include/gnunet_psycstore_service.h | |
parent | b6791ebdaa0d5299be3cc9fb5fbdcd5356ededf0 (diff) | |
download | gnunet-00c2318820ac3ee2ea06c173c3fce994bc29eb4e.tar.gz gnunet-00c2318820ac3ee2ea06c173c3fce994bc29eb4e.zip |
multicast: message fragmentation
Diffstat (limited to 'src/include/gnunet_psycstore_service.h')
-rw-r--r-- | src/include/gnunet_psycstore_service.h | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index 46034dae6..8b84340fe 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h | |||
@@ -111,7 +111,7 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | |||
111 | 111 | ||
112 | 112 | ||
113 | /** | 113 | /** |
114 | * Test if a peer was a member of the channel when the message with the | 114 | * Test if a peer was a member of the channel when the message fragment with the |
115 | * specified ID was sent to the channel. | 115 | * specified ID was sent to the channel. |
116 | * | 116 | * |
117 | * This is useful in case of retransmissions to check if the peer was authorized | 117 | * This is useful in case of retransmissions to check if the peer was authorized |
@@ -119,7 +119,7 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | |||
119 | * | 119 | * |
120 | * @param h Handle for the PSYCstore. | 120 | * @param h Handle for the PSYCstore. |
121 | * @param channel_id The channel we are interested in. | 121 | * @param channel_id The channel we are interested in. |
122 | * @param message_id Message ID to check. | 122 | * @param fragment_id Message fragment ID to check. |
123 | * @param peer Peer whose membership to check. | 123 | * @param peer Peer whose membership to check. |
124 | * @param ccb Callback to call with the test result. | 124 | * @param ccb Callback to call with the test result. |
125 | * @param ccb_cls Closure for the callback. | 125 | * @param ccb_cls Closure for the callback. |
@@ -129,14 +129,14 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | |||
129 | struct GNUNET_PSYCSTORE_OperationHandle * | 129 | struct GNUNET_PSYCSTORE_OperationHandle * |
130 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | 130 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, |
131 | const struct GNUNET_HashCode *channel_id, | 131 | const struct GNUNET_HashCode *channel_id, |
132 | uint64_t message_id, | 132 | uint64_t fragment_id, |
133 | const struct GNUNET_PeerIdentity *peer, | 133 | const struct GNUNET_PeerIdentity *peer, |
134 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | 134 | GNUNET_PSYCSTORE_ContinuationCallback ccb, |
135 | void *ccb_cls); | 135 | void *ccb_cls); |
136 | 136 | ||
137 | 137 | ||
138 | /** | 138 | /** |
139 | * Store a message sent to a channel. | 139 | * Store a message fragment sent to a channel. |
140 | * | 140 | * |
141 | * @param h Handle for the PSYCstore. | 141 | * @param h Handle for the PSYCstore. |
142 | * @param channel_id The channel the message belongs to. | 142 | * @param channel_id The channel the message belongs to. |
@@ -147,23 +147,43 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | |||
147 | * @return Handle that can be used to cancel the operation. | 147 | * @return Handle that can be used to cancel the operation. |
148 | */ | 148 | */ |
149 | struct GNUNET_PSYCSTORE_OperationHandle * | 149 | struct GNUNET_PSYCSTORE_OperationHandle * |
150 | GNUNET_PSYCSTORE_message_store (struct GNUNET_PSYCSTORE_Handle *h, | 150 | GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h, |
151 | const struct GNUNET_HashCode *channel_id, | 151 | const struct GNUNET_HashCode *channel_id, |
152 | const struct GNUNET_MULTICAST_MessageHeader *message, | 152 | const struct GNUNET_MULTICAST_MessageHeader *message, |
153 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | 153 | GNUNET_PSYCSTORE_ContinuationCallback ccb, |
154 | void *ccb_cls); | 154 | void *ccb_cls); |
155 | 155 | ||
156 | 156 | ||
157 | /** | 157 | /** |
158 | * Function called with the result of a GNUNET_PSYCSTORE_message_get() call. | 158 | * Function called with one message fragment, as the result of a |
159 | * GNUNET_PSYCSTORE_fragment_get() or GNUNET_PSYCSTORE_message_get() call. | ||
159 | * | 160 | * |
160 | * @param cls Closure. | 161 | * @param cls Closure. |
161 | * @param message_id ID of the message. | 162 | * @param message The retrieved message fragment. |
162 | * @param message The retrieved message. | 163 | * @param flags Message flags indicating fragmentation status. |
164 | */ | ||
165 | typedef void (*GNUNET_PSYCSTORE_FragmentResultCallback)(void *cls, | ||
166 | const struct GNUNET_MULTICAST_MessageHeader *message, | ||
167 | enum GNUNET_PSYC_MessageFlags flags); | ||
168 | |||
169 | |||
170 | /** | ||
171 | * Retrieve a message fragment by fragment ID. | ||
172 | * | ||
173 | * @param h Handle for the PSYCstore. | ||
174 | * @param channel_id The channel we are interested in. | ||
175 | * @param fragment_id Fragment ID to check. Use 0 to get the latest message fragment. | ||
176 | * @param rcb Callback to call with the result of the operation. | ||
177 | * @param rcb_cls Closure for the callback. | ||
178 | * | ||
179 | * @return Handle that can be used to cancel the operation. | ||
163 | */ | 180 | */ |
164 | typedef void (*GNUNET_PSYCSTORE_MessageResultCallback)(void *cls, | 181 | struct GNUNET_PSYCSTORE_OperationHandle * |
165 | uint64_t message_id, | 182 | GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, |
166 | const struct GNUNET_MULTICAST_MessageHeader *message); | 183 | const struct GNUNET_HashCode *channel_id, |
184 | uint64_t message_id, | ||
185 | GNUNET_PSYCSTORE_FragmentResultCallback rcb, | ||
186 | void *rcb_cls); | ||
167 | 187 | ||
168 | 188 | ||
169 | /** | 189 | /** |
@@ -181,7 +201,7 @@ struct GNUNET_PSYCSTORE_OperationHandle * | |||
181 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | 201 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, |
182 | const struct GNUNET_HashCode *channel_id, | 202 | const struct GNUNET_HashCode *channel_id, |
183 | uint64_t message_id, | 203 | uint64_t message_id, |
184 | GNUNET_PSYCSTORE_MessageResultCallback rcb, | 204 | GNUNET_PSYCSTORE_FragmentResultCallback rcb, |
185 | void *rcb_cls); | 205 | void *rcb_cls); |
186 | 206 | ||
187 | 207 | ||
@@ -191,7 +211,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
191 | * @param h Handle for the PSYCstore. | 211 | * @param h Handle for the PSYCstore. |
192 | * @param channel_id The channel we are interested in. | 212 | * @param channel_id The channel we are interested in. |
193 | * @param name Name of variable. | 213 | * @param name Name of variable. |
194 | * @param size Size of @a value. | 214 | * @param value_size Size of @a value. |
195 | * @param value Value of variable. | 215 | * @param value Value of variable. |
196 | * @param ccb Callback to call with the result of the operation. | 216 | * @param ccb Callback to call with the result of the operation. |
197 | * @param ccb_cls Closure for the callback. | 217 | * @param ccb_cls Closure for the callback. |
@@ -202,7 +222,7 @@ struct GNUNET_PSYCSTORE_OperationHandle * | |||
202 | GNUNET_PSYCSTORE_state_set (struct GNUNET_PSYCSTORE_Handle *h, | 222 | GNUNET_PSYCSTORE_state_set (struct GNUNET_PSYCSTORE_Handle *h, |
203 | const struct GNUNET_HashCode *channel_id, | 223 | const struct GNUNET_HashCode *channel_id, |
204 | const char *name, | 224 | const char *name, |
205 | size_t size, | 225 | size_t value_size, |
206 | const void *value, | 226 | const void *value, |
207 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | 227 | GNUNET_PSYCSTORE_ContinuationCallback ccb, |
208 | void *ccb_cls); | 228 | void *ccb_cls); |