diff options
-rw-r--r-- | src/include/gnunet_multicast_service.h | 416 | ||||
-rw-r--r-- | src/include/gnunet_psyc_service.h | 506 | ||||
-rw-r--r-- | src/include/gnunet_psycstore_service.h | 134 | ||||
-rw-r--r-- | src/include/gnunet_social_service.h | 107 |
4 files changed, 642 insertions, 521 deletions
diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h index da0e09e2f..f58d38bab 100644 --- a/src/include/gnunet_multicast_service.h +++ b/src/include/gnunet_multicast_service.h | |||
@@ -18,7 +18,7 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_multicast_service.h | 22 | * @file include/gnunet_multicast_service.h |
23 | * @brief multicast service; establish tunnels to distant peers | 23 | * @brief multicast service; establish tunnels to distant peers |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
@@ -38,35 +38,35 @@ extern "C" | |||
38 | #include "gnunet_util_lib.h" | 38 | #include "gnunet_util_lib.h" |
39 | #include "gnunet_transport_service.h" | 39 | #include "gnunet_transport_service.h" |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Version number of GNUnet-multicast API. | 42 | * Version number of GNUnet-multicast API. |
43 | */ | 43 | */ |
44 | #define GNUNET_MULTICAST_VERSION 0x00000000 | 44 | #define GNUNET_MULTICAST_VERSION 0x00000000 |
45 | 45 | ||
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Opaque handle for a multicast group member. | 48 | * Opaque handle for a multicast group member. |
49 | */ | 49 | */ |
50 | struct GNUNET_MULTICAST_Member; | 50 | struct GNUNET_MULTICAST_Member; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * Handle for the origin of a multicast group. | 53 | * Handle for the origin of a multicast group. |
54 | */ | 54 | */ |
55 | struct GNUNET_MULTICAST_Origin; | 55 | struct GNUNET_MULTICAST_Origin; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Group membership policies. | 58 | * Group membership policies. |
59 | */ | 59 | */ |
60 | enum GNUNET_MULTICAST_JoinPolicy | 60 | enum GNUNET_MULTICAST_JoinPolicy |
61 | { | 61 | { |
62 | /** | 62 | /** |
63 | * Anyone can join the group, without announcing his presence; all | 63 | * Anyone can join the group, without announcing his presence; |
64 | * messages are always public and can be distributed freely. Joins | 64 | * all messages are always public and can be distributed freely. |
65 | * may be announced, but this is not required. | 65 | * Joins may be announced, but this is not required. |
66 | */ | 66 | */ |
67 | GNUNET_MULTICAST_JP_ANONYMOUS = 0, | 67 | GNUNET_MULTICAST_JP_ANONYMOUS = 0, |
68 | 68 | ||
69 | /** | 69 | /** |
70 | * Origin must approve membership to the group, messages must only be | 70 | * Origin must approve membership to the group, messages must only be |
71 | * distributed to current group members. This includes the group | 71 | * distributed to current group members. This includes the group |
72 | * state as well as transient messages. | 72 | * state as well as transient messages. |
@@ -74,13 +74,13 @@ enum GNUNET_MULTICAST_JoinPolicy | |||
74 | GNUNET_MULTICAST_JP_PRIVATE = 1 | 74 | GNUNET_MULTICAST_JP_PRIVATE = 1 |
75 | 75 | ||
76 | #if IDEAS_FOR_FUTURE | 76 | #if IDEAS_FOR_FUTURE |
77 | /** | 77 | /** |
78 | * Anyone can freely join the group (no approval required); however, | 78 | * Anyone can freely join the group (no approval required); however, |
79 | * transient messages must only be distributed to current group | 79 | * transient messages must only be distributed to current group |
80 | * members, so the origin must still acknowledge that the member | 80 | * members, so the origin must still acknowledge that the member |
81 | * joined before transient messages are delivered. As approval is | 81 | * joined before transient messages are delivered. As approval is |
82 | * guaranteed, the presistent group state can de synchronized freely | 82 | * guaranteed, the presistent group state can be synchronized freely |
83 | * immediately, prior to origin confirmation | 83 | * immediately, prior to origin confirmation. |
84 | */ | 84 | */ |
85 | GNUNET_MULTICAST_JP_OPEN = 2 | 85 | GNUNET_MULTICAST_JP_OPEN = 2 |
86 | #endif | 86 | #endif |
@@ -88,45 +88,46 @@ enum GNUNET_MULTICAST_JoinPolicy | |||
88 | }; | 88 | }; |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
92 | * Opaque handle to a replay request from the multicast service. | 92 | * Opaque handle to a replay request from the multicast service. |
93 | */ | 93 | */ |
94 | struct GNUNET_MULTICAST_ReplayHandle; | 94 | struct GNUNET_MULTICAST_ReplayHandle; |
95 | 95 | ||
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Functions with this signature are called whenever the multicast | 98 | * Functions with this signature are called whenever the multicast |
99 | * service needs a message to be replayed. Implementations of this | 99 | * service needs a message to be replayed. Implementations of this |
100 | * function MUST call 'GNUNET_MULTICAST_replay' ONCE (with a message | 100 | * function MUST call GNUNET_MULTICAST_replay() ONCE (with a message |
101 | * or an error); however, if the origin is destroyed or the group is | 101 | * or an error); however, if the origin is destroyed or the group is |
102 | * left, the replay handle must no longer be used. | 102 | * left, the replay handle must no longer be used. |
103 | * | 103 | * |
104 | * @param cls closure (set from GNUNET_MULTICAST_origin_start/join) | 104 | * @param cls Closure (set from GNUNET_MULTICAST_origin_start() |
105 | * @param message_id which message should be replayed | 105 | * or GNUNET_MULTICAST_member_join()). |
106 | * @param rh handle to pass to message transmit function | 106 | * @param message_id Which message should be replayed. |
107 | * @param rh Handle to pass to message transmit function. | ||
107 | */ | 108 | */ |
108 | typedef void (*GNUNET_MULTICAST_ReplayCallback) (void *cls, | 109 | typedef void (*GNUNET_MULTICAST_ReplayCallback) (void *cls, |
109 | uint64_t message_id, | 110 | uint64_t message_id, |
110 | struct GNUNET_MULTICAST_ReplayHandle *rh); | 111 | struct GNUNET_MULTICAST_ReplayHandle *rh); |
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
114 | * Possible error codes during replay. | 115 | * Possible error codes during replay. |
115 | */ | 116 | */ |
116 | enum GNUNET_MULTICAST_ReplayErrorCode | 117 | enum GNUNET_MULTICAST_ReplayErrorCode |
117 | { | 118 | { |
118 | 119 | ||
119 | /** | 120 | /** |
120 | * Everything is fine. | 121 | * Everything is fine. |
121 | */ | 122 | */ |
122 | GNUNET_MULTICAST_REC_OK = 0, | 123 | GNUNET_MULTICAST_REC_OK = 0, |
123 | 124 | ||
124 | /** | 125 | /** |
125 | * Message has been discarded (likely transient message that was too old). | 126 | * Message has been discarded (likely transient message that was too old). |
126 | */ | 127 | */ |
127 | GNUNET_MULTICAST_REC_TRANSIENT_LOST = 1, | 128 | GNUNET_MULTICAST_REC_TRANSIENT_LOST = 1, |
128 | 129 | ||
129 | /** | 130 | /** |
130 | * Message ID counter was larger than the highest counter this | 131 | * Message ID counter was larger than the highest counter this |
131 | * replay function has ever encountered; thus it is likely the | 132 | * replay function has ever encountered; thus it is likely the |
132 | * origin never sent it and we're at the HEAD of the multicast | 133 | * origin never sent it and we're at the HEAD of the multicast |
@@ -134,7 +135,7 @@ enum GNUNET_MULTICAST_ReplayErrorCode | |||
134 | */ | 135 | */ |
135 | GNUNET_MULTICAST_REC_PAST_HEAD = 2, | 136 | GNUNET_MULTICAST_REC_PAST_HEAD = 2, |
136 | 137 | ||
137 | /** | 138 | /** |
138 | * Internal error (i.e. database error). Try some other peer. | 139 | * Internal error (i.e. database error). Try some other peer. |
139 | */ | 140 | */ |
140 | GNUNET_MULTICAST_REC_INTERNAL_ERROR = 3 | 141 | GNUNET_MULTICAST_REC_INTERNAL_ERROR = 3 |
@@ -144,80 +145,81 @@ enum GNUNET_MULTICAST_ReplayErrorCode | |||
144 | 145 | ||
145 | GNUNET_NETWORK_STRUCT_BEGIN | 146 | GNUNET_NETWORK_STRUCT_BEGIN |
146 | 147 | ||
147 | /** | 148 | /** |
148 | * Header of a multicast message. This format is public as the replay | 149 | * Header of a multicast message. |
149 | * mechanism must replay messages using the same format. This is | 150 | * |
150 | * needed as we want to integrity-check messages within the multicast | 151 | * This format is public as the replay mechanism must replay messages using the |
151 | * layer to avoid multicasting mal-formed messages. | 152 | * same format. This is needed as we want to integrity-check messages within |
153 | * the multicast layer to avoid multicasting mal-formed messages. | ||
152 | */ | 154 | */ |
153 | struct GNUNET_MULTICAST_MessageHeader | 155 | struct GNUNET_MULTICAST_MessageHeader |
154 | { | 156 | { |
155 | 157 | ||
156 | /** | 158 | /** |
157 | * Header for all multicast messages from the origin. | 159 | * Header for all multicast messages from the origin. |
158 | */ | 160 | */ |
159 | struct GNUNET_MessageHeader header; | 161 | struct GNUNET_MessageHeader header; |
160 | 162 | ||
161 | /** | 163 | /** |
162 | * How many hops has this message taken since the origin? | 164 | * Number of hops this message has taken since the origin. |
163 | * (helpful to determine shortest paths to the origin for responses | 165 | * |
164 | * among honest peers; updated at each hop and thus not signed | 166 | * Helpful to determine shortest paths to the origin for responses among |
165 | * and not secure) | 167 | * honest peers; updated at each hop and thus not signed and not secure. |
166 | */ | 168 | */ |
167 | uint32_t hop_counter GNUNET_PACKED; | 169 | uint32_t hop_counter GNUNET_PACKED; |
168 | 170 | ||
169 | /** | 171 | /** |
170 | * ECC signature of the message. Signature must match the public | 172 | * ECC signature of the message. |
171 | * key of the multicast group. | 173 | * |
174 | * Signature must match the public key of the multicast group. | ||
172 | */ | 175 | */ |
173 | struct GNUNET_CRYPTO_EccSignature signature; | 176 | struct GNUNET_CRYPTO_EccSignature signature; |
174 | 177 | ||
175 | /** | 178 | /** |
176 | * Signature of the multicast message. | 179 | * Signature of the multicast message. |
177 | */ | 180 | */ |
178 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | 181 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
179 | 182 | ||
180 | /** | 183 | /** |
181 | * Number of the message, monotonically increasing. | 184 | * Number of the message, monotonically increasing. |
182 | */ | 185 | */ |
183 | uint64_t message_id GNUNET_PACKED; | 186 | uint64_t message_id GNUNET_PACKED; |
184 | 187 | ||
185 | /** | 188 | /** |
186 | * Counter that monotonically increases whenever a member | 189 | * Counter that monotonically increases whenever a member leaves the group. |
187 | * leaves the group. | ||
188 | */ | 190 | */ |
189 | uint64_t group_generation GNUNET_PACKED; | 191 | uint64_t group_generation GNUNET_PACKED; |
190 | 192 | ||
191 | /** | 193 | /** |
192 | * Difference between the current message_id and the message_id of | 194 | * Difference between the current @a message_id and the @a message_id of the |
193 | * the preceeding non-transient message. Zero for transient | 195 | * preceeding non-transient message. |
194 | * messages, UINT64_MAX for the first message, or any other message | 196 | * |
195 | * creating a full state reset by the origin. By subtracting | 197 | * Zero for transient messages, @c UINT64_MAX for the first message, or any |
196 | * 'state_delta' from 'message_id', it is possible to calculate the | 198 | * other message creating a full state reset by the origin. By subtracting |
197 | * message ID of the preceeding non-transient message and thus | 199 | * @a state_delta from @a message_id, it is possible to calculate the message |
198 | * quickly traverse all state changes up to the last full state | 200 | * ID of the preceeding non-transient message and thus quickly traverse all |
199 | * reset by the origin. This is useful as it allows joining clients | 201 | * state changes up to the last full state reset by the origin. This is |
200 | * to quickly reassemble the state while skipping over transient | 202 | * useful as it allows joining clients to quickly reassemble the state while |
201 | * messages (and doing so without having to trust intermediaries to | 203 | * skipping over transient messages (and doing so without having to trust |
202 | * do it right, as the indices in the chain are signed). If the | 204 | * intermediaries to do it right, as the indices in the chain are signed). If |
203 | * state chain is getting too long, the origin can choose to | 205 | * the state chain is getting too long, the origin can choose to originate a |
204 | * originate a state message with a state_delta of UINT64_MAX, | 206 | * state message with a state_delta of UINT64_MAX, thereby starting a new |
205 | * thereby starting a new chain. The origin will then have to | 207 | * chain. The origin will then have to re-create the full state with state |
206 | * re-create the full state with state update messages following the | 208 | * update messages following the state reset message. |
207 | * state reset message. | ||
208 | * | 209 | * |
209 | * Open question: needed in multicast, or just have this in PSYC; | 210 | * Open question: needed in multicast, or just have this in PSYC; still might |
210 | * still might be useful for selective fetching of messages. | 211 | * be useful for selective fetching of messages. Still, that again should |
211 | * Still, that again should that not be done by PSYC? | 212 | * that not be done by PSYC? |
212 | */ | 213 | */ |
213 | uint64_t state_delta GNUNET_PACKED; | 214 | uint64_t state_delta GNUNET_PACKED; |
214 | 215 | ||
215 | /** | 216 | /** |
216 | * Header for the message body. Three message types are | 217 | * Header for the message body. |
217 | * specifically understood by multicast, namely "peer join", "peer | 218 | * |
218 | * leave", and "group terminated". Multicast will use those | 219 | * Three message types are specifically understood by multicast, namely "peer |
219 | * messages to update its list of candidates for content | 220 | * join", "peer leave", and "group terminated". Multicast will use those |
220 | * distribution. All other message types are application-specific. | 221 | * messages to update its list of candidates for content distribution. All |
222 | * other message types are application-specific. | ||
221 | */ | 223 | */ |
222 | struct GNUNET_MessageHeader body; | 224 | struct GNUNET_MessageHeader body; |
223 | 225 | ||
@@ -227,12 +229,12 @@ struct GNUNET_MULTICAST_MessageHeader | |||
227 | GNUNET_NETWORK_STRUCT_END | 229 | GNUNET_NETWORK_STRUCT_END |
228 | 230 | ||
229 | 231 | ||
230 | /** | 232 | /** |
231 | * Replay a message from the multicast group. | 233 | * Replay a message from the multicast group. |
232 | * | 234 | * |
233 | * @param rh replay handle identifying which replay operation was requested | 235 | * @param rh Replay handle identifying which replay operation was requested. |
234 | * @param msg replayed message, NULL if unknown/error | 236 | * @param msg Replayed message, NULL if unknown/error. |
235 | * @param ec error code | 237 | * @param ec Error code. |
236 | */ | 238 | */ |
237 | void | 239 | void |
238 | GNUNET_MULTICAST_replay (struct GNUNET_MULTICAST_ReplayHandle *rh, | 240 | GNUNET_MULTICAST_replay (struct GNUNET_MULTICAST_ReplayHandle *rh, |
@@ -240,28 +242,31 @@ GNUNET_MULTICAST_replay (struct GNUNET_MULTICAST_ReplayHandle *rh, | |||
240 | enum GNUNET_MULTICAST_ReplayErrorCode ec); | 242 | enum GNUNET_MULTICAST_ReplayErrorCode ec); |
241 | 243 | ||
242 | 244 | ||
243 | /** | 245 | /** |
244 | * Handle that identifies a join request (to match calls to the | 246 | * Handle that identifies a join request. |
245 | * 'GNUNET_MULTICAST_MembershipChangeCallback' to the corresponding | 247 | * |
246 | * calls to 'GNUNET_MULTICAST_join_decision'). | 248 | * Used to match calls to #GNUNET_MULTICAST_MembershipChangeCallback to the |
249 | * corresponding calls to GNUNET_MULTICAST_join_decision(). | ||
247 | */ | 250 | */ |
248 | struct GNUNET_MULTICAST_JoinHande; | 251 | struct GNUNET_MULTICAST_JoinHande; |
249 | 252 | ||
250 | 253 | ||
251 | /** | 254 | /** |
252 | * Function to call with the decision made for a membership change | 255 | * Function to call with the decision made for a membership change request. |
253 | * request. Must be called once and only once in response to an | ||
254 | * invocation of the 'GNUNET_MULTICAST_MembershipChangeCallback'. | ||
255 | * | 256 | * |
256 | * @param jh join request handle | 257 | * Must be called once and only once in response to an invocation of the |
257 | * @param join_response message to send in response to the joining peer; | 258 | * #GNUNET_MULTICAST_MembershipChangeCallback. |
259 | * | ||
260 | * @param jh Join request handle. | ||
261 | * @param join_response Message to send in response to the joining peer; | ||
258 | * can also be used to redirect the peer to a different group at the | 262 | * can also be used to redirect the peer to a different group at the |
259 | * application layer; this response is to be transmitted to the | 263 | * application layer; this response is to be transmitted to the |
260 | * peer that issued the request even if admission is denied. | 264 | * peer that issued the request even if admission is denied. |
261 | * @param is_admitted GNUNET_OK if joining is approved, GNUNET_SYSERR if it is disapproved; | 265 | * @param is_admitted #GNUNET_OK if joining is approved, |
262 | * GNUNET_NO for peers leaving | 266 | * #GNUNET_SYSERR if it is disapproved; |
263 | * @param relay_count number of relays given | 267 | * #GNUNET_NO for peers leaving. |
264 | * @param relays array of suggested peers that might be useful relays to use | 268 | * @param relay_count Number of relays given. |
269 | * @param relays Array of suggested peers that might be useful relays to use | ||
265 | * when joining the multicast group (essentially a list of peers that | 270 | * when joining the multicast group (essentially a list of peers that |
266 | * are already part of the multicast group and might thus be willing | 271 | * are already part of the multicast group and might thus be willing |
267 | * to help with routing). If empty, only this local peer (which must | 272 | * to help with routing). If empty, only this local peer (which must |
@@ -277,19 +282,21 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *jh, | |||
277 | const struct GNUNET_PeerIdentity *relays); | 282 | const struct GNUNET_PeerIdentity *relays); |
278 | 283 | ||
279 | 284 | ||
280 | /** | 285 | /** |
281 | * Method called whenever another peer wants to join or has left a | 286 | * Method called whenever another peer wants to join or has left a multicast |
282 | * multicast group. Implementations of this function must call | 287 | * group. |
283 | * 'GNUNET_MULTICAST_join_decision' with the decision. | ||
284 | * | 288 | * |
285 | * @param cls closure | 289 | * Implementations of this function must call GNUNET_MULTICAST_join_decision() |
286 | * @param peer identity of the peer that wants to join or leave | 290 | * with the decision. |
287 | * @param join_req application-dependent join message from the new user | 291 | * |
288 | * (might, for example, contain a user | 292 | * @param cls Closure. |
293 | * @param peer Identity of the peer that wants to join or leave. | ||
294 | * @param join_req Application-dependent join message from the new user | ||
295 | * (might, for example, contain a user, | ||
289 | * bind user identity/pseudonym to peer identity, application-level | 296 | * bind user identity/pseudonym to peer identity, application-level |
290 | * message to origin, etc.) | 297 | * message to origin, etc.). |
291 | * @param is_joining GNUNET_YES if the peer wants to join, GNUNET_NO if the peer left | 298 | * @param is_joining #GNUNET_YES if the peer wants to join, #GNUNET_NO if the peer left. |
292 | * @param jh join handle to pass to 'GNUNET_MULTICAST_join_decison' | 299 | * @param jh Join handle to pass to GNUNET_MULTICAST_join_decison(). |
293 | */ | 300 | */ |
294 | typedef void (*GNUNET_MULTICAST_MembershipChangeCallback)(void *cls, | 301 | typedef void (*GNUNET_MULTICAST_MembershipChangeCallback)(void *cls, |
295 | const struct GNUNET_PeerIdentity *peer, | 302 | const struct GNUNET_PeerIdentity *peer, |
@@ -298,31 +305,31 @@ typedef void (*GNUNET_MULTICAST_MembershipChangeCallback)(void *cls, | |||
298 | struct GNUNET_MULTICAST_JoinHandle *jh); | 305 | struct GNUNET_MULTICAST_JoinHandle *jh); |
299 | 306 | ||
300 | 307 | ||
301 | /** | 308 | /** |
302 | * Handle to pass back for the answer of a membership test. | 309 | * Handle to pass back for the answer of a membership test. |
303 | */ | 310 | */ |
304 | struct GNUNET_MULTICAST_MembershipTestHandle; | 311 | struct GNUNET_MULTICAST_MembershipTestHandle; |
305 | 312 | ||
306 | 313 | ||
307 | /** | 314 | /** |
308 | * Call informing multicast about the decision taken for membership test. | 315 | * Call informing multicast about the decision taken for membership test. |
309 | * | 316 | * |
310 | * @param mth handle that was given for the query | 317 | * @param mth Handle that was given for the query. |
311 | * @param decision GNUNET_YES if peer was a member, GNUNET_NO if peer was not a member, | 318 | * @param decision #GNUNET_YES if peer was a member, #GNUNET_NO if peer was not a member, |
312 | * GNUNET_SYSERR if we cannot answer the membership test | 319 | * #GNUNET_SYSERR if we cannot answer the membership test. |
313 | */ | 320 | */ |
314 | void | 321 | void |
315 | GNUNET_MULTICAST_membership_test_answer (struct GNUNET_MULTICAST_MembershipTestHandle *mth, | 322 | GNUNET_MULTICAST_membership_test_answer (struct GNUNET_MULTICAST_MembershipTestHandle *mth, |
316 | int decision); | 323 | int decision); |
317 | 324 | ||
318 | 325 | ||
319 | /** | 326 | /** |
320 | * Method called to test if a member was in the group at a particular time. | 327 | * Method called to test if a member was in the group at a particular time. |
321 | * | 328 | * |
322 | * @param cls closure | 329 | * @param cls Closure. |
323 | * @param peer identity of the peer that we want to test | 330 | * @param peer Identity of the peer that we want to test. |
324 | * @param message_id message ID for which we want to do the test | 331 | * @param message_id Message ID for which we want to do the test. |
325 | * @param mth handle to give to 'GNUNET_MULTICAST_membership_test_answer' | 332 | * @param mth Handle to give to GNUNET_MULTICAST_membership_test_answer(). |
326 | */ | 333 | */ |
327 | typedef void (*GNUNET_MULTICAST_MembershipTestCallback)(void *cls, | 334 | typedef void (*GNUNET_MULTICAST_MembershipTestCallback)(void *cls, |
328 | const struct GNUNET_PeerIdentity *peer, | 335 | const struct GNUNET_PeerIdentity *peer, |
@@ -330,14 +337,14 @@ typedef void (*GNUNET_MULTICAST_MembershipTestCallback)(void *cls, | |||
330 | struct GNUNET_MULTICAST_MembershipTestHandle *mth); | 337 | struct GNUNET_MULTICAST_MembershipTestHandle *mth); |
331 | 338 | ||
332 | 339 | ||
333 | /** | 340 | /** |
334 | * Function called whenever a group member has transmitted a message | 341 | * Function called whenever a group member has transmitted a message |
335 | * to the origin (other than joining or leaving). | 342 | * to the origin (other than joining or leaving). |
336 | * | 343 | * |
337 | * @param cls closure (set from GNUNET_MULTICAST_origin_start) | 344 | * @param cls Closure (set from GNUNET_MULTICAST_origin_start). |
338 | * @param sender identity of the sender | 345 | * @param sender Identity of the sender. |
339 | * @param response_id unique counter for the response from this sender to this origin | 346 | * @param response_id Unique counter for the response from this sender to this origin. |
340 | * @param msg message to the origin | 347 | * @param msg Message to the origin. |
341 | */ | 348 | */ |
342 | typedef void (*GNUNET_MULTICAST_ResponseCallback) (void *cls, | 349 | typedef void (*GNUNET_MULTICAST_ResponseCallback) (void *cls, |
343 | const struct GNUNET_PeerIdentity *sender, | 350 | const struct GNUNET_PeerIdentity *sender, |
@@ -345,48 +352,51 @@ typedef void (*GNUNET_MULTICAST_ResponseCallback) (void *cls, | |||
345 | const struct GNUNET_MessageHeader *msg); | 352 | const struct GNUNET_MessageHeader *msg); |
346 | 353 | ||
347 | 354 | ||
348 | /** | 355 | /** |
349 | * Function called whenever a group member is receiving a message from | 356 | * Function called whenever a group member is receiving a message from |
350 | * the origin. If admission to the group is denied, this function is | 357 | * the origin. If admission to the group is denied, this function is |
351 | * called once with the response of the 'origin' (as given to | 358 | * called once with the response of the @e origin (as given to |
352 | * 'GNUNET_MULTICAST_join_decision') and then a second time with "NULL" | 359 | * GNUNET_MULTICAST_join_decision()) and then a second time with NULL |
353 | * to indicate that the connection failed for good. | 360 | * to indicate that the connection failed for good. |
354 | * | 361 | * |
355 | * @param cls closure (set from GNUNET_MULTICAST_member_join) | 362 | * @param cls Closure (set from GNUNET_MULTICAST_member_join()) |
356 | * @param message_id unique number of the message, 0 for response to join request, | 363 | * @param message_id Unique number of the message, 0 for response to join request, |
357 | * normal message IDs in either direction start at 1. | 364 | * normal message IDs in either direction start at 1. |
358 | * @param msg message from the origin, NULL if the origin shut down | 365 | * @param msg Message from the origin, NULL if the origin shut down |
359 | * (or we were kicked out, and we should thus call GNUNET_MULTICAST_member_leave next) | 366 | * (or we were kicked out, and we should thus call |
367 | * GNUNET_MULTICAST_member_leave() next) | ||
360 | */ | 368 | */ |
361 | typedef void (*GNUNET_MULTICAST_MulticastMessageCallback) (void *cls, | 369 | typedef void (*GNUNET_MULTICAST_MulticastMessageCallback) (void *cls, |
362 | uint64_t message_id, | 370 | uint64_t message_id, |
363 | const struct GNUNET_MULTICAST_MessageHeader *msg); | 371 | const struct GNUNET_MULTICAST_MessageHeader *msg); |
364 | 372 | ||
365 | 373 | ||
366 | /** | 374 | /** |
367 | * Start a multicast group. Will advertise the origin in the P2P | 375 | * Start a multicast group. |
368 | * overlay network under the respective public key so that other peer | ||
369 | * can find this peer to join it. Peers that issue | ||
370 | * 'GNUNET_MULTICAST_member_join' can then transmit a join request to | ||
371 | * either an existing group member (if the 'join_policy' is | ||
372 | * permissive) or to the origin. If the joining is approved, the | ||
373 | * member is cleared for 'replay' and will begin to receive messages | ||
374 | * transmitted to the group. If joining is disapproved, the failed | ||
375 | * candidate will be given a response. Members in the group can send | ||
376 | * messages to the origin (one at a time). | ||
377 | * | 376 | * |
378 | * @param cfg configuration to use | 377 | * Will advertise the origin in the P2P overlay network under the respective |
379 | * @param cls closure for the various callbacks that follow | 378 | * public key so that other peer can find this peer to join it. Peers that |
379 | * issue GNUNET_MULTICAST_member_join() can then transmit a join request to | ||
380 | * either an existing group member (if the @a join_policy is permissive) or to | ||
381 | * the origin. If the joining is approved, the member is cleared for @e replay | ||
382 | * and will begin to receive messages transmitted to the group. If joining is | ||
383 | * disapproved, the failed candidate will be given a response. Members in the | ||
384 | * group can send messages to the origin (one at a time). | ||
385 | * | ||
386 | * @param cfg Configuration to use. | ||
387 | * @param cls Closure for the various callbacks that follow. | ||
380 | * @param priv_key ECC key that will be used to sign messages for this | 388 | * @param priv_key ECC key that will be used to sign messages for this |
381 | * multicast session; public key is used to identify the | 389 | * multicast session; public key is used to identify the |
382 | * multicast group; FIXME: we'll likely want to use | 390 | * multicast group; FIXME: we'll likely want to use |
383 | * NOT the p521 curve here, but a cheaper one in the future | 391 | * NOT the p521 curve here, but a cheaper one in the future. |
384 | * @param join_policy what is the membership policy of the group? | 392 | * @param join_policy What is the membership policy of the group? |
385 | * @param replay_cb function that can be called to replay a message | 393 | * @param replay_cb Function that can be called to replay a message. |
386 | * @param test_cb function multicast can use to test group membership | 394 | * @param test_cb Function multicast can use to test group membership. |
387 | * @param join_cb function called to approve / disapprove joining of a peer | 395 | * @param join_cb Function called to approve / disapprove joining of a peer, |
388 | * @param response_cb function called with messages from group members | 396 | * and to inform about a leaving member. |
389 | * @return handle for the origin, NULL on error | 397 | * @param leave_cb Function called to inform about a leaving member. |
398 | * @param response_cb Function called with messages from group members. | ||
399 | * @return Handle for the origin, NULL on error. | ||
390 | */ | 400 | */ |
391 | struct GNUNET_MULTICAST_Origin * | 401 | struct GNUNET_MULTICAST_Origin * |
392 | GNUNET_MULTICAST_origin_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 402 | GNUNET_MULTICAST_origin_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
@@ -399,21 +409,21 @@ GNUNET_MULTICAST_origin_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
399 | GNUNET_MULTICAST_ResponseCallback response_cb); | 409 | GNUNET_MULTICAST_ResponseCallback response_cb); |
400 | 410 | ||
401 | 411 | ||
402 | /** | 412 | /** |
403 | * Handle for a request to send a message to all multicast group members | 413 | * Handle for a request to send a message to all multicast group members |
404 | * (from the origin). | 414 | * (from the origin). |
405 | */ | 415 | */ |
406 | struct GNUNET_MULTICAST_MulticastRequest; | 416 | struct GNUNET_MULTICAST_MulticastRequest; |
407 | 417 | ||
408 | 418 | ||
409 | /** | 419 | /** |
410 | * Send a message to the multicast group. | 420 | * Send a message to the multicast group. |
411 | * | 421 | * |
412 | * @param origin handle to the multicast group | 422 | * @param origin Handle to the multicast group. |
413 | * @param size number of bytes to transmit | 423 | * @param size Number of bytes to transmit. |
414 | * @param cb function to call to get the message | 424 | * @param cb Function to call to get the message. |
415 | * @param cb_cls closure for 'cb' | 425 | * @param cb_cls Closure for @a cb. |
416 | * @return NULL on error (i.e. request already pending) | 426 | * @return NULL on error (i.e. request already pending). |
417 | */ | 427 | */ |
418 | struct GNUNET_MULTICAST_MulticastRequest * | 428 | struct GNUNET_MULTICAST_MulticastRequest * |
419 | GNUNET_MULTICAST_origin_to_all (struct GNUNET_MULTICAST_Origin *origin, | 429 | GNUNET_MULTICAST_origin_to_all (struct GNUNET_MULTICAST_Origin *origin, |
@@ -422,16 +432,16 @@ GNUNET_MULTICAST_origin_to_all (struct GNUNET_MULTICAST_Origin *origin, | |||
422 | void *cb_cls); | 432 | void *cb_cls); |
423 | 433 | ||
424 | 434 | ||
425 | /** | 435 | /** |
426 | * Cancel request for message transmission to multicast group. | 436 | * Cancel request for message transmission to multicast group. |
427 | * | 437 | * |
428 | * @param mr request to cancel | 438 | * @param mr Request to cancel. |
429 | */ | 439 | */ |
430 | void | 440 | void |
431 | GNUNET_MULTICAST_origin_to_all_cancel (struct GNUNET_MULTICAST_MulticastRequest *mr); | 441 | GNUNET_MULTICAST_origin_to_all_cancel (struct GNUNET_MULTICAST_MulticastRequest *mr); |
432 | 442 | ||
433 | 443 | ||
434 | /** | 444 | /** |
435 | * End a multicast group. | 445 | * End a multicast group. |
436 | * | 446 | * |
437 | * @param origin multicast group to terminate | 447 | * @param origin multicast group to terminate |
@@ -440,41 +450,42 @@ void | |||
440 | GNUNET_MULTICAST_origin_end (struct GNUNET_MULTICAST_Origin *origin); | 450 | GNUNET_MULTICAST_origin_end (struct GNUNET_MULTICAST_Origin *origin); |
441 | 451 | ||
442 | 452 | ||
443 | /** | 453 | /** |
444 | * Join a multicast group. The entity joining is always the local | 454 | * Join a multicast group. |
445 | * peer. Further information about the candidate can be provided in | 455 | * |
446 | * the 'join_req' message. If the join fails, the 'message_cb' is | 456 | * The entity joining is always the local peer. Further information about the |
447 | * invoked with a (failure) response and then with 'NULL'. If the | 457 | * candidate can be provided in the @a join_req message. If the join fails, the |
448 | * join succeeds, outstanding (state) messages and ongoing multicast | 458 | * @a message_cb is invoked with a (failure) response and then with NULL. If |
449 | * messages will be given to the 'message_cb' until the member decides | 459 | * the join succeeds, outstanding (state) messages and ongoing multicast |
450 | * to leave the group. The 'test_cb' and 'replay_cb' functions may be | 460 | * messages will be given to the @a message_cb until the member decides to leave |
451 | * called at anytime by the multicast service to support relaying | 461 | * the group. The @a test_cb and @a replay_cb functions may be called at |
452 | * messages to other members of the group. | 462 | * anytime by the multicast service to support relaying messages to other |
463 | * members of the group. | ||
453 | * | 464 | * |
454 | * @param cfg configuration to use | 465 | * @param cfg Configuration to use. |
455 | * @param cls closure for callbacks | 466 | * @param cls Closure for callbacks. |
456 | * @param pub_key ECC key that identifies the group | 467 | * @param pub_key ECC key that identifies the group. |
457 | * @param max_known_message_id largest known message ID to the replay service; | 468 | * @param max_known_message_id Largest known message ID to the replay service; |
458 | * all messages with IDs larger than this ID will be replayed if | 469 | * all messages with IDs larger than this ID will be replayed if |
459 | * possible (lower IDs will be considered known and thus only | 470 | * possible (lower IDs will be considered known and thus only |
460 | * be replayed upon explicit request) | 471 | * be replayed upon explicit request). |
461 | * @param max_known_state_message_id largest known message ID with a non-zero | 472 | * @param max_known_state_message_id Largest known message ID with a non-zero |
462 | * value for the 'state_delta'; state messages with | 473 | * value for the @e state_delta; state messages with |
463 | * larger IDs than this value will be replayed with high priority | 474 | * larger IDs than this value will be replayed with high priority |
464 | * (lower IDs will be considered known and thus only | 475 | * (lower IDs will be considered known and thus only |
465 | * be replayed upon explicit request) | 476 | * be replayed upon explicit request). |
466 | * @param replay_cb function that can be called to replay messages | 477 | * @param replay_cb Function that can be called to replay messages |
467 | * this peer already knows from this group; NULL if this | 478 | * this peer already knows from this group; NULL if this |
468 | * client is unable to support replay | 479 | * client is unable to support replay. |
469 | * @param test_cb function multicast can use to test group membership | 480 | * @param test_cb Function multicast can use to test group membership. |
470 | * @param message_cb function to be called for all messages we | 481 | * @param message_cb Function to be called for all messages we |
471 | * receive from the group, excluding those our replay_cb | 482 | * receive from the group, excluding those our @a replay_cb |
472 | * already has | 483 | * already has. |
473 | * @param join_req application-dependent join message to be passed to origin | 484 | * @param join_req Application-dependent join message to be passed to origin |
474 | * (might, for example, contain a user | 485 | * (might, for example, contain a user |
475 | * bind user identity/pseudonym to peer identity, application-level | 486 | * bind user identity/pseudonym to peer identity, application-level |
476 | * message to origin, etc.) | 487 | * message to origin, etc.). |
477 | * @return handle for the member, NULL on error | 488 | * @return Handle for the member, NULL on error. |
478 | */ | 489 | */ |
479 | struct GNUNET_MULTICAST_Member * | 490 | struct GNUNET_MULTICAST_Member * |
480 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | 491 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, |
@@ -488,22 +499,23 @@ GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
488 | const struct GNUNET_MessageHeader *join_req); | 499 | const struct GNUNET_MessageHeader *join_req); |
489 | 500 | ||
490 | 501 | ||
491 | /** | 502 | /** |
492 | * Handle for a replay request. | 503 | * Handle for a replay request. |
493 | */ | 504 | */ |
494 | struct GNUNET_MULTICAST_ReplayRequest; | 505 | struct GNUNET_MULTICAST_ReplayRequest; |
495 | 506 | ||
496 | 507 | ||
497 | /** | 508 | /** |
498 | * Request a message to be replayed. Useful if messages below | 509 | * Request a message to be replayed. |
499 | * the 'max_known_*_id's given when joining are needed and not | 510 | * |
500 | * known to the client. | 511 | * Useful if messages below the @e max_known_*_id's given when joining are |
512 | * needed and not known to the client. | ||
501 | * | 513 | * |
502 | * @param member membership handle | 514 | * @param member Membership handle. |
503 | * @param message_id ID of a message that this client would like to see replayed | 515 | * @param message_id ID of a message that this client would like to see replayed. |
504 | * @param message_cb function to be called for the replayed message | 516 | * @param message_cb Function to be called for the replayed message. |
505 | * @param message_cb_cls closure for 'message_cb' | 517 | * @param message_cb_cls Closure for @a message_cb. |
506 | * @return replay request handle, NULL on error | 518 | * @return Replay request handle, NULL on error. |
507 | */ | 519 | */ |
508 | struct GNUNET_MULTICAST_ReplayRequest * | 520 | struct GNUNET_MULTICAST_ReplayRequest * |
509 | GNUNET_MULTICAST_member_request_replay (struct GNUNET_MULTICAST_Member *member, | 521 | GNUNET_MULTICAST_member_request_replay (struct GNUNET_MULTICAST_Member *member, |
@@ -512,38 +524,38 @@ GNUNET_MULTICAST_member_request_replay (struct GNUNET_MULTICAST_Member *member, | |||
512 | void *message_cb_cls); | 524 | void *message_cb_cls); |
513 | 525 | ||
514 | 526 | ||
515 | /** | 527 | /** |
516 | * Cancel a replay request. | 528 | * Cancel a replay request. |
517 | * | 529 | * |
518 | * @param rr request to cancel | 530 | * @param rr Request to cancel. |
519 | */ | 531 | */ |
520 | void | 532 | void |
521 | GNUNET_MULTICAST_member_request_replay_cancel (struct GNUNET_MULTICAST_ReplayRequest *rr); | 533 | GNUNET_MULTICAST_member_request_replay_cancel (struct GNUNET_MULTICAST_ReplayRequest *rr); |
522 | 534 | ||
523 | 535 | ||
524 | /** | 536 | /** |
525 | * Leave a mutlicast group. | 537 | * Leave a multicast group. |
526 | * | 538 | * |
527 | * @param member membership handle | 539 | * @param member Membership handle. |
528 | */ | 540 | */ |
529 | void | 541 | void |
530 | GNUNET_MULTICAST_member_leave (struct GNUNET_MULTICAST_Member *member); | 542 | GNUNET_MULTICAST_member_leave (struct GNUNET_MULTICAST_Member *member); |
531 | 543 | ||
532 | 544 | ||
533 | /** | 545 | /** |
534 | * Handle for a message to be delivered to the origin. | 546 | * Handle for a message to be delivered to the origin. |
535 | */ | 547 | */ |
536 | struct GNUNET_MULTICAST_ResponseRequest; | 548 | struct GNUNET_MULTICAST_ResponseRequest; |
537 | 549 | ||
538 | 550 | ||
539 | /** | 551 | /** |
540 | * Send a message to the origin of the multicast group. | 552 | * Send a message to the origin of the multicast group. |
541 | * | 553 | * |
542 | * @param member membership handle | 554 | * @param member Membership handle. |
543 | * @param size number of bytes we want to send to origin | 555 | * @param size Number of bytes we want to send to origin. |
544 | * @param cb callback to call to get the message | 556 | * @param cb Callback to call to get the message. |
545 | * @param cb_cls closure for 'cb' | 557 | * @param cb_cls Closure for @a cb. |
546 | * @return handle to cancel request, NULL on error (i.e. request already pending) | 558 | * @return Handle to cancel request, NULL on error (i.e. request already pending). |
547 | */ | 559 | */ |
548 | struct GNUNET_MULTICAST_ResponseRequest * | 560 | struct GNUNET_MULTICAST_ResponseRequest * |
549 | GNUNET_MULTICAST_member_to_origin (struct GNUNET_MULTICAST_Member *member, | 561 | GNUNET_MULTICAST_member_to_origin (struct GNUNET_MULTICAST_Member *member, |
@@ -552,10 +564,10 @@ GNUNET_MULTICAST_member_to_origin (struct GNUNET_MULTICAST_Member *member, | |||
552 | void *cb_cls); | 564 | void *cb_cls); |
553 | 565 | ||
554 | 566 | ||
555 | /** | 567 | /** |
556 | * Cancel request for message transmission to origin. | 568 | * Cancel request for message transmission to origin. |
557 | * | 569 | * |
558 | * @param rr request to cancel | 570 | * @param rr Request to cancel. |
559 | */ | 571 | */ |
560 | void | 572 | void |
561 | GNUNET_MULTICAST_member_to_origin_cancel (struct GNUNET_MULTICAST_ResponseRequest *rr); | 573 | GNUNET_MULTICAST_member_to_origin_cancel (struct GNUNET_MULTICAST_ResponseRequest *rr); |
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index 8116e3d93..e2a839243 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h | |||
@@ -18,7 +18,7 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_psyc_service.h | 22 | * @file include/gnunet_psyc_service.h |
23 | * @brief PSYC service; high-level access to the PSYC protocol | 23 | * @brief PSYC service; high-level access to the PSYC protocol |
24 | * note that clients of this API are NOT expected to | 24 | * note that clients of this API are NOT expected to |
@@ -88,53 +88,53 @@ extern "C" | |||
88 | #include "gnunet_multicast_service.h" | 88 | #include "gnunet_multicast_service.h" |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
92 | * Version number of GNUnet-PSYC API. | 92 | * Version number of GNUnet-PSYC API. |
93 | */ | 93 | */ |
94 | #define GNUNET_PSYC_VERSION 0x00000000 | 94 | #define GNUNET_PSYC_VERSION 0x00000000 |
95 | 95 | ||
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Information flags for data fragments set via PSYC. | 98 | * Information flags for data fragments set via PSYC. |
99 | */ | 99 | */ |
100 | enum GNUNET_PSYC_FragmentStatus | 100 | enum GNUNET_PSYC_FragmentStatus |
101 | { | 101 | { |
102 | /** | 102 | /** |
103 | * This is the first part of data for the given method call. | 103 | * This is the first part of data for the given method call. |
104 | */ | 104 | */ |
105 | GNUNET_PSYC_FS_FIRST = 1, | 105 | GNUNET_PSYC_FS_FIRST = 1, |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * This is the last part of data for the given method call. | 108 | * This is the last part of data for the given method call. |
109 | */ | 109 | */ |
110 | GNUNET_PSYC_FS_LAST = 2, | 110 | GNUNET_PSYC_FS_LAST = 2, |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * OR'ed flags if payload is not fragmented. | 113 | * OR'ed flags if payload is not fragmented. |
114 | */ | 114 | */ |
115 | GNUNET_PSYC_FS_NOT_FRAGMENTED = (GNUNET_PSYC_FS_FIRST | GNUNET_PSYC_FS_LAST) | 115 | GNUNET_PSYC_FS_NOT_FRAGMENTED = (GNUNET_PSYC_FS_FIRST | GNUNET_PSYC_FS_LAST) |
116 | }; | 116 | }; |
117 | 117 | ||
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Method called from PSYC upon receiving a message indicating a call | 120 | * Method called from PSYC upon receiving a message indicating a call |
121 | * to a 'method'. | 121 | * to a @e method. |
122 | * | 122 | * |
123 | * @param cls closure | 123 | * @param cls Closure. |
124 | * @param full_method_name original method name from PSYC (may be more | 124 | * @param full_method_name Original method name from PSYC (may be more |
125 | * specific than the registered method name due to try-and-slice matching) | 125 | * specific than the registered method name due to try-and-slice matching). |
126 | * @param sender who transmitted the message (origin, except for messages | 126 | * @param sender Who transmitted the message (origin, except for messages |
127 | * from one of the members to the origin) | 127 | * from one of the members to the origin). |
128 | * @param message_id unique message counter for this message; | 128 | * @param message_id Unique message counter for this message; |
129 | * (unique only in combination with the given sender for | 129 | * (unique only in combination with the given sender for |
130 | * this channel) | 130 | * this channel). |
131 | * @param group_generation group generation counter for this message | 131 | * @param group_generation Group generation counter for this message |
132 | * (always zero for messages from members to channel owner); FIXME: needed? | 132 | * (always zero for messages from members to channel owner); FIXME: needed? |
133 | * @param data_off byte offset of 'data' in the overall data of the method | 133 | * @param data_off Byte offset of @a data in the overall data of the method. |
134 | * @param data_size number of bytes in 'data'; | 134 | * @param data_size Number of bytes in @a data. |
135 | * @param data data stream given to the method (might not be zero-terminated | 135 | * @param data Data stream given to the method (might not be zero-terminated |
136 | * if data is binary) | 136 | * if data is binary). |
137 | * @param frag fragmentation status for the data | 137 | * @param frag Fragmentation status for the data. |
138 | */ | 138 | */ |
139 | typedef int (*GNUNET_PSYC_Method)(void *cls, | 139 | typedef int (*GNUNET_PSYC_Method)(void *cls, |
140 | const char *full_method_name, | 140 | const char *full_method_name, |
@@ -147,28 +147,28 @@ typedef int (*GNUNET_PSYC_Method)(void *cls, | |||
147 | enum GNUNET_PSYC_FragmentStatus frag); | 147 | enum GNUNET_PSYC_FragmentStatus frag); |
148 | 148 | ||
149 | 149 | ||
150 | /** | 150 | /** |
151 | * Handle for the channel of a PSYC group. | 151 | * Handle for the channel of a PSYC group. |
152 | */ | 152 | */ |
153 | struct GNUNET_PSYC_Channel; | 153 | struct GNUNET_PSYC_Channel; |
154 | 154 | ||
155 | 155 | ||
156 | /** | 156 | /** |
157 | * Start a PSYC channel. Will create a multicast group identified by | 157 | * Create a PSYC channel. |
158 | * the given ECC key. Messages recevied from group members will be | 158 | * |
159 | * given to the respective handler methods. If a new member wants to | 159 | * Will create a multicast group identified by the given ECC key. Messages |
160 | * join a group, the "join" method handler will be invoked; the join | 160 | * received from group members will be given to the respective handler methods. |
161 | * handler must then generate a "join" message to approve the joining | 161 | * If a new member wants to join a group, the "join" method handler will be |
162 | * of the new member. The channel can also change group membership | 162 | * invoked; the join handler must then generate a "join" message to approve the |
163 | * without explicit requests. Note that PSYC doesn't itself "understand" | 163 | * joining of the new member. The channel can also change group membership |
164 | * join or leave messages, the respective methods must call other | 164 | * without explicit requests. Note that PSYC doesn't itself "understand" join |
165 | * PSYC functions to inform PSYC about the meaning of the respective | 165 | * or leave messages, the respective methods must call other PSYC functions to |
166 | * events. | 166 | * inform PSYC about the meaning of the respective events. |
167 | * | 167 | * |
168 | * @param cfg configuration to use (to connect to PSYC service) | 168 | * @param cfg Configuration to use (to connect to PSYC service). |
169 | * @param method functions to invoke on messages received from members, | 169 | * @param method Function to invoke on messages received from members, |
170 | * typcially at least contains functions for 'join' and 'leave'. | 170 | * typcially at least contains functions for @e join and @e leave. |
171 | * @param method_cls closure for 'method' | 171 | * @param method_cls Closure for @a method. |
172 | * @param priv_key ECC key that will be used to sign messages for this | 172 | * @param priv_key ECC key that will be used to sign messages for this |
173 | * PSYC session; public key is used to identify the | 173 | * PSYC session; public key is used to identify the |
174 | * PSYC group; FIXME: we'll likely want to use | 174 | * PSYC group; FIXME: we'll likely want to use |
@@ -177,46 +177,46 @@ struct GNUNET_PSYC_Channel; | |||
177 | * directly, but rather look it up in GADS for groups | 177 | * directly, but rather look it up in GADS for groups |
178 | * managed by other users, or select a file with the private | 178 | * managed by other users, or select a file with the private |
179 | * key(s) when setting up their own channels | 179 | * key(s) when setting up their own channels |
180 | * @param join_policy what is the membership policy of the group? | 180 | * @param join_policy What is the membership policy of the group? |
181 | * Used to automate group management decisions. | 181 | * Used to automate group management decisions. |
182 | * @return handle for the channel, NULL on error | 182 | * @return Handle for the channel, NULL on error. |
183 | */ | 183 | */ |
184 | struct GNUNET_PSYC_Channel * | 184 | struct GNUNET_PSYC_Channel * |
185 | GNUNET_PSYC_channel_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 185 | GNUNET_PSYC_channel_create (const struct GNUNET_CONFIGURATION_Handle *cfg, |
186 | GNUNET_PSYC_Method method, | 186 | GNUNET_PSYC_Method method, |
187 | void *method_cls, | 187 | void *method_cls, |
188 | const struct GNUNET_CRYPTO_EccPrivateKey *priv_key, | 188 | const struct GNUNET_CRYPTO_EccPrivateKey *priv_key, |
189 | enum GNUNET_MULTICAST_JoinPolicy join_policy); | 189 | enum GNUNET_MULTICAST_JoinPolicy join_policy); |
190 | 190 | ||
191 | 191 | ||
192 | /** | 192 | /** |
193 | * Possible operations on PSYC state (persistent) and variables (per message). | 193 | * Possible operations on PSYC state (persistent) and variables (per message). |
194 | */ | 194 | */ |
195 | enum GNUNET_PSYC_Operator | 195 | enum GNUNET_PSYC_Operator |
196 | { | 196 | { |
197 | /** | 197 | /** |
198 | * Replace the full state with the new value ("="). | 198 | * Replace the full state with the new value ("="). |
199 | */ | 199 | */ |
200 | GNUNET_PSYC_SOT_SET_STATE = 0, | 200 | GNUNET_PSYC_SOT_SET_STATE = 0, |
201 | 201 | ||
202 | /** | 202 | /** |
203 | * Delete the complete entry from the state (given data must be | 203 | * Delete the complete entry from the state (given data must be |
204 | * empty). Equivalent to 'SET' with emtpy data, but more | 204 | * empty). Equivalent to @a SET with empty data, but more |
205 | * explicit ("="); | 205 | * explicit ("="); |
206 | */ | 206 | */ |
207 | GNUNET_PSYC_SOT_DELETE = 0, | 207 | GNUNET_PSYC_SOT_DELETE = 0, |
208 | 208 | ||
209 | /** | 209 | /** |
210 | * Set the value of a variable to a new value (":"). | 210 | * Set the value of a variable to a new value (":"). |
211 | */ | 211 | */ |
212 | GNUNET_PSYC_SOT_SET_VARIABLE, | 212 | GNUNET_PSYC_SOT_SET_VARIABLE, |
213 | 213 | ||
214 | /** | 214 | /** |
215 | * Add the given value to the set of values in the state ("+"). | 215 | * Add the given value to the set of values in the state ("+"). |
216 | */ | 216 | */ |
217 | GNUNET_PSYC_SOT_ADD_STATE, | 217 | GNUNET_PSYC_SOT_ADD_STATE, |
218 | 218 | ||
219 | /** | 219 | /** |
220 | * Remove the given value from the set of values in the state ("-"). | 220 | * Remove the given value from the set of values in the state ("-"). |
221 | */ | 221 | */ |
222 | GNUNET_PSYC_SOT_REMOVE_STATE | 222 | GNUNET_PSYC_SOT_REMOVE_STATE |
@@ -224,23 +224,23 @@ enum GNUNET_PSYC_Operator | |||
224 | }; | 224 | }; |
225 | 225 | ||
226 | 226 | ||
227 | /** | 227 | /** |
228 | * Update channel state (or set a variable). The state of a channel | 228 | * Update channel state (or set a variable). |
229 | * must fit into the memory of each member (and the channel); large | 229 | * |
230 | * values that require streaming must only be passed as the stream | 230 | * The state of a channel must fit into the memory of each member (and the |
231 | * arguments to methods. State updates might not be transmitted to | 231 | * channel); large values that require streaming must only be passed as the |
232 | * group members until the next call to | 232 | * stream arguments to methods. State updates might not be transmitted to group |
233 | * 'GNUNET_PSYC_channel_notify_transmit_ready'. Variable updates must | 233 | * members until the next call to GNUNET_PSYC_channel_notify_transmit_ready(). |
234 | * be given just before the call to the respective method that needs | 234 | * Variable updates must be given just before the call to the respective method |
235 | * the variables. | 235 | * that needs the variables. |
236 | * | 236 | * |
237 | * @param channel handle to the PSYC group / channel | 237 | * @param channel Handle to the PSYC group / channel. |
238 | * @param full_state_name name of the field in the channel state to change | 238 | * @param full_state_name Name of the field in the channel state to change. |
239 | * @param type kind of update operation (add, remove, replace, delete) | 239 | * @param type Kind of update operation (add, remove, replace, delete). |
240 | * @param data_size number of bytes in data | 240 | * @param data_size Number of bytes in data. |
241 | * @param data new state value | 241 | * @param data New state value. |
242 | * @return GNUNET_OK on success, GNUNET_SYSERR on internal error | 242 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on internal error |
243 | * (i.e. state too large) | 243 | * (i.e. state too large). |
244 | */ | 244 | */ |
245 | int | 245 | int |
246 | GNUNET_PSYC_channel_state_update (struct GNUNET_PSYC_Channel *channel, | 246 | GNUNET_PSYC_channel_state_update (struct GNUNET_PSYC_Channel *channel, |
@@ -250,24 +250,25 @@ GNUNET_PSYC_channel_state_update (struct GNUNET_PSYC_Channel *channel, | |||
250 | const void *data); | 250 | const void *data); |
251 | 251 | ||
252 | 252 | ||
253 | /** | 253 | /** |
254 | * Function called to provide data for a transmission via PSYC. Note | 254 | * Function called to provide data for a transmission via PSYC. |
255 | * that returning GNUNET_OK or GNUNET_SYSERR (but not GNUNET_NO) | 255 | * |
256 | * Note that returning #GNUNET_OK or #GNUNET_SYSERR (but not #GNUNET_NO) | ||
256 | * invalidates the respective transmission handle. | 257 | * invalidates the respective transmission handle. |
257 | * | 258 | * |
258 | * @param cls closure | 259 | * @param cls Closure. |
259 | * @param message_id set to the unique message ID that was generated for | 260 | * @param message_id Set to the unique message ID that was generated for |
260 | * this message | 261 | * this message. |
261 | * @param group_generation set to the group generation used for this | 262 | * @param group_generation Set to the group generation used for this |
262 | * message | 263 | * message. |
263 | * @param data_size initially set to the number of bytes available in 'data', | 264 | * @param data_size[in,out] Initially set to the number of bytes available in @a data, |
264 | * should be set to the number of bytes written to data (IN/OUT) | 265 | * should be set to the number of bytes written to data (IN/OUT). |
265 | * @param data where to write the body of the message to give to the method; | 266 | * @param data[out] Where to write the body of the message to give to the method; |
266 | * function must copy at most '*data_size' bytes to 'data'. | 267 | * function must copy at most @a *data_size bytes to @a data. |
267 | * @return GNUNET_SYSERR on error (fatal, aborts transmission) | 268 | * @return #GNUNET_SYSERR on error (fatal, aborts transmission) |
268 | * GNUNET_NO on success, if more data is to be transmitted later | 269 | * #GNUNET_NO on success, if more data is to be transmitted later |
269 | * (should be used if 'data_size' was not big enough to take all the data) | 270 | * (should be used if @a *data_size was not big enough to take all the data) |
270 | * GNUNET_YES if this completes the transmission (all data supplied) | 271 | * #GNUNET_YES if this completes the transmission (all data supplied) |
271 | */ | 272 | */ |
272 | typedef int (*GNUNET_PSYC_ChannelReadyNotify)(void *cls, | 273 | typedef int (*GNUNET_PSYC_ChannelReadyNotify)(void *cls, |
273 | uint64_t message_id, | 274 | uint64_t message_id, |
@@ -276,22 +277,22 @@ typedef int (*GNUNET_PSYC_ChannelReadyNotify)(void *cls, | |||
276 | void *data); | 277 | void *data); |
277 | 278 | ||
278 | 279 | ||
279 | /** | 280 | /** |
280 | * Handle for a pending PSYC transmission operation. | 281 | * Handle for a pending PSYC transmission operation. |
281 | */ | 282 | */ |
282 | struct GNUNET_PSYC_ChannelTransmitHandle; | 283 | struct GNUNET_PSYC_ChannelTransmitHandle; |
283 | 284 | ||
284 | 285 | ||
285 | /** | 286 | /** |
286 | * Send a message to call a method to all members in the PSYC channel. | 287 | * Send a message to call a method to all members in the PSYC channel. |
287 | * | 288 | * |
288 | * @param channel handle to the PSYC multicast group | 289 | * @param channel Handle to the PSYC multicast group. |
289 | * @param increment_group_generation GNUNET_YES if we need to increment | 290 | * @param increment_group_generation #GNUNET_YES if we need to increment |
290 | * the group generation counter after transmitting this message | 291 | * the group generation counter after transmitting this message. |
291 | * @param full_method_name which method should be invoked | 292 | * @param full_method_name Which method should be invoked. |
292 | * @param notify function to call to obtain the arguments | 293 | * @param notify Function to call to obtain the arguments. |
293 | * @param notify_cls closure for 'notify' | 294 | * @param notify_cls Closure for @a notify. |
294 | * @return transmission handle, NULL on error (i.e. more than one request queued) | 295 | * @return Transmission handle, NULL on error (i.e. more than one request queued). |
295 | */ | 296 | */ |
296 | struct GNUNET_PSYC_ChannelTransmitHandle * | 297 | struct GNUNET_PSYC_ChannelTransmitHandle * |
297 | GNUNET_PSYC_channel_notify_transmit_ready (struct GNUNET_PSYC_Channel *channel, | 298 | GNUNET_PSYC_channel_notify_transmit_ready (struct GNUNET_PSYC_Channel *channel, |
@@ -301,69 +302,70 @@ GNUNET_PSYC_channel_notify_transmit_ready (struct GNUNET_PSYC_Channel *channel, | |||
301 | void *notify_cls); | 302 | void *notify_cls); |
302 | 303 | ||
303 | 304 | ||
304 | /** | 305 | /** |
305 | * Abort transmission request to channel. | 306 | * Abort transmission request to channel. |
306 | * | 307 | * |
307 | * @param th handle of the request that is being aborted | 308 | * @param th Handle of the request that is being aborted. |
308 | */ | 309 | */ |
309 | void | 310 | void |
310 | GNUNET_PSYC_channel_notify_transmit_ready_cancel (struct GNUNET_PSYC_ChannelTransmitHandle *th); | 311 | GNUNET_PSYC_channel_notify_transmit_ready_cancel (struct GNUNET_PSYC_ChannelTransmitHandle *th); |
311 | 312 | ||
312 | 313 | ||
313 | /** | 314 | /** |
314 | * End a PSYC channel. | 315 | * Destroy a PSYC channel. |
315 | * | 316 | * |
316 | * @param channel PSYC channel to terminate | 317 | * @param channel PSYC channel to terminate. |
317 | */ | 318 | */ |
318 | void | 319 | tvoid |
319 | GNUNET_PSYC_channel_end (struct GNUNET_PSYC_Channel *channel); | 320 | GNUNET_PSYC_channel_destroy (struct GNUNET_PSYC_Channel *channel); |
320 | 321 | ||
321 | 322 | ||
322 | /** | 323 | /** |
323 | * Handle to access PSYC group operations for all members. | 324 | * Handle to access PSYC group operations for all members. |
324 | */ | 325 | */ |
325 | struct GNUNET_PSYC_Group; | 326 | struct GNUNET_PSYC_Group; |
326 | 327 | ||
327 | 328 | ||
328 | /** | 329 | /** |
329 | * Convert 'channel' to a 'group' handle to access the 'group' APIs. | 330 | * Convert @a channel to a @e group handle to access the @e group APIs. |
330 | * | 331 | * |
331 | * @param channel channel handle | 332 | * @param channel Channel handle. |
332 | * @return group handle, valid for as long as 'channel' is valid | 333 | * @return Group handle, valid for as long as @a channel is valid. |
333 | */ | 334 | */ |
334 | struct GNUNET_PSYC_Group * | 335 | struct GNUNET_PSYC_Group * |
335 | GNUNET_PSYC_channel_get_group (struct GNUNET_PSYC_Channel *channel); | 336 | GNUNET_PSYC_channel_get_group (struct GNUNET_PSYC_Channel *channel); |
336 | 337 | ||
337 | 338 | ||
338 | /** | 339 | /** |
339 | * Convert 'member' to a 'group' handle to access the 'group' APIs. | 340 | * Convert @a member to a @e group handle to access the @e group APIs. |
340 | * | 341 | * |
341 | * @param member membership handle | 342 | * @param member Membership handle. |
342 | * @return group handle, valid for as long as 'member' is valid | 343 | * @return Group handle, valid for as long as @a member is valid. |
343 | */ | 344 | */ |
344 | struct GNUNET_PSYC_Group * | 345 | struct GNUNET_PSYC_Group * |
345 | GNUNET_PSYC_member_get_group (struct GNUNET_PSYC_Member *member); | 346 | GNUNET_PSYC_member_get_group (struct GNUNET_PSYC_Member *member); |
346 | 347 | ||
347 | 348 | ||
348 | /** | 349 | /** |
349 | * Add a member to the group. Note that this will NOT generate any | 350 | * Add a member to the group. |
350 | * PSYC traffic, it will merely update the local data base to modify | 351 | * |
351 | * how we react to 'membership test' queries. The channel still needs to | 352 | * Note that this will NOT generate any PSYC traffic, it will merely update the |
352 | * explicitly transmit a 'join' message to notify other group members | 353 | * local data base to modify how we react to <em>membership test</em> queries. The |
353 | * and they then also must still call this function in their respective | 354 | * channel still needs to explicitly transmit a @e join message to notify other |
354 | * methods handling the 'join' message. This way, how 'join' and 'leave' | 355 | * group members and they then also must still call this function in their |
355 | * operations are exactly implemented is still up to the application; | 356 | * respective methods handling the @e join message. This way, how @e join and |
356 | * for example, there might be a 'leave_all' method to kick out everyone. | 357 | * @e leave operations are exactly implemented is still up to the application; |
358 | * for example, there might be a @e leave_all method to kick out everyone. | ||
357 | * | 359 | * |
358 | * Note that group members are explicitly trusted to execute such | 360 | * Note that group members are explicitly trusted to execute such |
359 | * methods correctly; not doing so correctly will result in either | 361 | * methods correctly; not doing so correctly will result in either |
360 | * denying members access or offering access to group data to | 362 | * denying members access or offering access to group data to |
361 | * non-members. | 363 | * non-members. |
362 | * | 364 | * |
363 | * @param group group handle | 365 | * @param group Group handle. |
364 | * @param member which peer to add | 366 | * @param member Which peer to add. |
365 | * @param message_id message ID for the message that changed the membership | 367 | * @param message_id Message ID for the message that changed the membership. |
366 | * @param group_generation the generation ID where the change went into effect | 368 | * @param group_generation The generation ID where the change went into effect. |
367 | */ | 369 | */ |
368 | void | 370 | void |
369 | GNUNET_PSYC_group_member_add (struct GNUNET_PSYC_Group *group, | 371 | GNUNET_PSYC_group_member_add (struct GNUNET_PSYC_Group *group, |
@@ -372,25 +374,26 @@ GNUNET_PSYC_group_member_add (struct GNUNET_PSYC_Group *group, | |||
372 | uint64_t group_generation); | 374 | uint64_t group_generation); |
373 | 375 | ||
374 | 376 | ||
375 | /** | 377 | /** |
376 | * Remove a member from the group. Note that this will NOT generate any | 378 | * Remove a member from the group. |
377 | * PSYC traffic, it will merely update the local data base to modify | 379 | * |
378 | * how we react to 'membership test' queries. The channel still needs to | 380 | * Note that this will NOT generate any PSYC traffic, it will merely update the |
379 | * explicitly transmit a 'leave' message to notify other group members | 381 | * local data base to modify how we react to <em>membership test</em> queries. The |
380 | * and they then also must still call this function in their respective | 382 | * channel still needs to explicitly transmit a @e leave message to notify other |
381 | * methods handling the 'leave' message. This way, how 'join' and 'leave' | 383 | * group members and they then also must still call this function in their |
382 | * operations are exactly implemented is still up to the application; | 384 | * respective methods handling the @e leave message. This way, how @e join and |
383 | * for example, there might be a 'leave_all' message to kick out everyone. | 385 | * @e leave operations are exactly implemented is still up to the application; |
386 | * for example, there might be a @e leave_all message to kick out everyone. | ||
384 | * | 387 | * |
385 | * Note that group members are explicitly trusted to perform these | 388 | * Note that group members are explicitly trusted to perform these |
386 | * operations correctly; not doing so correctly will result in either | 389 | * operations correctly; not doing so correctly will result in either |
387 | * denying members access or offering access to group data to | 390 | * denying members access or offering access to group data to |
388 | * non-members. | 391 | * non-members. |
389 | * | 392 | * |
390 | * @param group group handle | 393 | * @param group Group handle. |
391 | * @param member which peer to remove | 394 | * @param member Which peer to remove. |
392 | * @param message_id message ID for the message that changed the membership | 395 | * @param message_id Message ID for the message that changed the membership. |
393 | * @param group_generation the generation ID where the change went into effect | 396 | * @param group_generation The generation ID where the change went into effect. |
394 | */ | 397 | */ |
395 | void | 398 | void |
396 | GNUNET_PSYC_group_member_remove (struct GNUNET_PSYC_Group *group, | 399 | GNUNET_PSYC_group_member_remove (struct GNUNET_PSYC_Group *group, |
@@ -399,16 +402,16 @@ GNUNET_PSYC_group_member_remove (struct GNUNET_PSYC_Group *group, | |||
399 | uint64_t group_generation); | 402 | uint64_t group_generation); |
400 | 403 | ||
401 | 404 | ||
402 | /** | 405 | /** |
403 | * Function called to inform a member about state changes for a | 406 | * Function called to inform a member about state changes for a channel. |
404 | * channel. Note that (for sets) only the delta is communicated, not | ||
405 | * the full state. | ||
406 | * | 407 | * |
407 | * @param cls closure | 408 | * Note that (for sets) only the delta is communicated, not the full state. |
408 | * @param full_state_name full name of the state | 409 | * |
409 | * @param type how to interpret the change | 410 | * @param cls Closure. |
410 | * @param state_value information about the new state | 411 | * @param full_state_name Full name of the state. |
411 | * @param state_value_size number of bytes in 'state_value' | 412 | * @param type How to interpret the change. |
413 | * @param state_value Information about the new state. | ||
414 | * @param state_value_size Number of bytes in @a state_value. | ||
412 | */ | 415 | */ |
413 | typedef void (*GNUNET_PSYC_StateCallback)(void *cls, | 416 | typedef void (*GNUNET_PSYC_StateCallback)(void *cls, |
414 | const char *full_state_name, | 417 | const char *full_state_name, |
@@ -417,48 +420,49 @@ typedef void (*GNUNET_PSYC_StateCallback)(void *cls, | |||
417 | size_t state_value_size); | 420 | size_t state_value_size); |
418 | 421 | ||
419 | 422 | ||
420 | /** | 423 | /** |
421 | * Descriptor for an event handler handling PSYC state updates. | 424 | * Descriptor for an event handler handling PSYC state updates. |
422 | */ | 425 | */ |
423 | struct GNUNET_PSYC_StateHandler | 426 | struct GNUNET_PSYC_StateHandler |
424 | { | 427 | { |
425 | 428 | ||
426 | /** | 429 | /** |
427 | * Name of the state this handler calls about, used in try-and-slice matching. | 430 | * Name of the state variable this handler calls about, used in try-and-slice matching. |
428 | */ | 431 | */ |
429 | const char *state_name; | 432 | const char *state_name; |
430 | 433 | ||
431 | /** | 434 | /** |
432 | * Function to call whenever the respective state changes. | 435 | * Function to call whenever the respective state changes. |
433 | */ | 436 | */ |
434 | GNUNET_PSYC_StateCallback event_handler; | 437 | GNUNET_PSYC_StateCallback event_handler; |
435 | 438 | ||
436 | /** | 439 | /** |
437 | * Closure for the 'event_handler' function. | 440 | * Closure for the @a event_handler function. |
438 | */ | 441 | */ |
439 | void *event_handler_cls; | 442 | void *event_handler_cls; |
440 | 443 | ||
441 | }; | 444 | }; |
442 | 445 | ||
443 | 446 | ||
444 | /** | 447 | /** |
445 | * Join a PSYC group. The entity joining is always the local peer. | 448 | * Join a PSYC group. |
446 | * The user must immediately use the 'GNUNET_PSYC_member_send_to_host' | 449 | * |
447 | * (and possibly 'GNUNET_PSYC_member_host_variable_set') functions to | 450 | * The entity joining is always the local peer. The user must immediately use |
448 | * transmit a 'join_msg' to the channel; if the join request succeeds, | 451 | * the GNUNET_PSYC_member_send_to_host() (and possibly |
449 | * the channel state (and 'recent' method calls) will be replayed to | 452 | * GNUNET_PSYC_member_host_variable_set()) functions to transmit a @e join_msg to |
450 | * the joining member. There is no explicit notification on failure | 453 | * the channel; if the join request succeeds, the channel state (and @e recent |
451 | * (as the channel may simply take days to approve, and disapproval is | 454 | * method calls) will be replayed to the joining member. There is no explicit |
452 | * simply being ignored). | 455 | * notification on failure (as the channel may simply take days to approve, and |
456 | * disapproval is simply being ignored). | ||
453 | * | 457 | * |
454 | * @param cfg configuration to use | 458 | * @param cfg Configuration to use. |
455 | * @param pub_key ECC key that identifies the channel we wish to join | 459 | * @param pub_key ECC key that identifies the channel we wish to join |
456 | * @param method function to invoke on messages received from the channel, | 460 | * @param method Function to invoke on messages received from the channel, |
457 | * typcially at least contains functions for 'join' and 'leave'. | 461 | * typically at least contains functions for @e join and @e leave. |
458 | * @param method_cls closure for 'method' | 462 | * @param method_cls Closure for @a method. |
459 | * @param state_count number of state handlers | 463 | * @param state_count Number of @a state_handlers. |
460 | * @param state_handlers array of state event handlers | 464 | * @param state_handlers Array of state event handlers. |
461 | * @return handle for the member, NULL on error | 465 | * @return Handle for the member, NULL on error. |
462 | */ | 466 | */ |
463 | struct GNUNET_PSYC_Member * | 467 | struct GNUNET_PSYC_Member * |
464 | GNUNET_PSYC_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | 468 | GNUNET_PSYC_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, |
@@ -469,10 +473,12 @@ GNUNET_PSYC_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
469 | struct GNUNET_PSYC_StateHandler *state_handlers); | 473 | struct GNUNET_PSYC_StateHandler *state_handlers); |
470 | 474 | ||
471 | 475 | ||
472 | /** | 476 | /** |
473 | * Leave a multicast group. Will terminate the connection to the PSYC | 477 | * Leave a multicast group. |
474 | * service. Polite clients should first explicitly send a 'leave' | 478 | * |
475 | * request (via 'GNUNET_PSYC_member_send_to_host'). | 479 | * Will terminate the connection to the PSYC service. Polite clients should |
480 | * first explicitly send a @e leave request (via | ||
481 | * GNUNET_PSYC_member_send_to_host()). | ||
476 | * | 482 | * |
477 | * @param member membership handle | 483 | * @param member membership handle |
478 | */ | 484 | */ |
@@ -480,40 +486,41 @@ void | |||
480 | GNUNET_PSYC_member_leave (struct GNUNET_PSYC_Member *member); | 486 | GNUNET_PSYC_member_leave (struct GNUNET_PSYC_Member *member); |
481 | 487 | ||
482 | 488 | ||
483 | /** | 489 | /** |
484 | * Function called to provide data for a transmission to the channel | 490 | * Function called to provide data for a transmission to the channel |
485 | * owner (aka the 'host' of the channel). Note that returning | 491 | * owner (aka the @e host of the channel). |
486 | * GNUNET_OK or GNUNET_SYSERR (but not GNUNET_NO) invalidates the | 492 | * |
487 | * respective transmission handle. | 493 | * Note that returning #GNUNET_OK or #GNUNET_SYSERR (but not #GNUNET_NO) |
488 | * | 494 | * invalidates the respective transmission handle. |
489 | * @param cls closure | 495 | * |
490 | * @param data_size initially set to the number of bytes available in 'data', | 496 | * @param cls Closure. |
491 | * should be set to the number of bytes written to data (IN/OUT) | 497 | * @param data_size[in,out] Initially set to the number of bytes available in @a data, |
492 | * @param data where to write the body of the message to give to the method; | 498 | * should be set to the number of bytes written to data (IN/OUT). |
493 | * function must copy at most '*data_size' bytes to 'data'. | 499 | * @param data[out] Where to write the body of the message to give to the method; |
494 | * @return GNUNET_SYSERR on error (fatal, aborts transmission) | 500 | * function must copy at most @a *data_size bytes to @a data. |
495 | * GNUNET_NO on success, if more data is to be transmitted later | 501 | * @return #GNUNET_SYSERR on error (fatal, aborts transmission). |
496 | * GNUNET_YES if this completes the transmission (all data supplied) | 502 | * #GNUNET_NO on success, if more data is to be transmitted later. |
503 | * #GNUNET_YES if this completes the transmission (all data supplied). | ||
497 | */ | 504 | */ |
498 | typedef int (*GNUNET_PSYC_OriginReadyNotify)(void *cls, | 505 | typedef int (*GNUNET_PSYC_OriginReadyNotify)(void *cls, |
499 | size_t *data_size, | 506 | size_t *data_size, |
500 | char *data); | 507 | char *data); |
501 | 508 | ||
502 | 509 | ||
503 | /** | 510 | /** |
504 | * Handle for a pending PSYC transmission operation. | 511 | * Handle for a pending PSYC transmission operation. |
505 | */ | 512 | */ |
506 | struct GNUNET_PSYC_OriginTransmitHandle; | 513 | struct GNUNET_PSYC_OriginTransmitHandle; |
507 | 514 | ||
508 | 515 | ||
509 | /** | 516 | /** |
510 | * Request a message to be sent to the channel origin. | 517 | * Request a message to be sent to the channel origin. |
511 | * | 518 | * |
512 | * @param member membership handle | 519 | * @param member Membership handle. |
513 | * @param method_name which (PSYC) method should be invoked (on host) | 520 | * @param method_name Which (PSYC) method should be invoked (on host). |
514 | * @param notify function to call when we are allowed to transmit (to get data) | 521 | * @param notify Function to call when we are allowed to transmit (to get data). |
515 | * @param notify_cls closure for 'notify' | 522 | * @param notify_cls Closure for @a notify. |
516 | * @return transmission handle, NULL on error (i.e. more than one request queued) | 523 | * @return Transmission handle, NULL on error (i.e. more than one request queued). |
517 | */ | 524 | */ |
518 | struct GNUNET_PSYC_OriginTransmitHandle * | 525 | struct GNUNET_PSYC_OriginTransmitHandle * |
519 | GNUNET_PSYC_member_send_to_origin (struct GNUNET_PSYC_Member *member, | 526 | GNUNET_PSYC_member_send_to_origin (struct GNUNET_PSYC_Member *member, |
@@ -522,17 +529,19 @@ GNUNET_PSYC_member_send_to_origin (struct GNUNET_PSYC_Member *member, | |||
522 | void *notify_cls); | 529 | void *notify_cls); |
523 | 530 | ||
524 | 531 | ||
525 | /** | 532 | /** |
526 | * Set a (temporary, ":") variable for the next message being transmitted | 533 | * Set a (temporary, ":") variable for the next message being transmitted |
527 | * via 'GNUNET_PSYC_member_send_to_host'. If 'GNUNET_PSYC_member_send_to_host' | 534 | * via GNUNET_PSYC_member_send_to_host(). |
528 | * is called and then cancelled, all variables that were set using this | ||
529 | * function will be unset (lost/forgotten). To clear a variable state after | ||
530 | * setting it, you can also call this function again with NULL/0 for the value. | ||
531 | * | 535 | * |
532 | * @param member membership handle | 536 | * If GNUNET_PSYC_member_send_to_host() is called and then cancelled, all |
533 | * @param variable_name name of the variable to set | 537 | * variables that were set using this function will be unset (lost/forgotten). |
534 | * @param value value to set for the given variable | 538 | * To clear a variable state after setting it, you can also call this function |
535 | * @param value_size number of bytes in 'value' | 539 | * again with NULL/0 for the @a value. |
540 | * | ||
541 | * @param member Membership handle. | ||
542 | * @param variable_name Name of the variable to set. | ||
543 | * @param value Value to set for the given variable. | ||
544 | * @param value_size Number of bytes in @a value. | ||
536 | */ | 545 | */ |
537 | uint64_t | 546 | uint64_t |
538 | GNUNET_PSYC_member_origin_variable_set (struct GNUNET_PSYC_Member *member, | 547 | GNUNET_PSYC_member_origin_variable_set (struct GNUNET_PSYC_Member *member, |
@@ -541,40 +550,40 @@ GNUNET_PSYC_member_origin_variable_set (struct GNUNET_PSYC_Member *member, | |||
541 | size_t value_size); | 550 | size_t value_size); |
542 | 551 | ||
543 | 552 | ||
544 | /** | 553 | /** |
545 | * Abort transmission request to origin. | 554 | * Abort transmission request to origin. |
546 | * | 555 | * |
547 | * @param th handle of the request that is being aborted | 556 | * @param th Handle of the request that is being aborted. |
548 | */ | 557 | */ |
549 | void | 558 | void |
550 | GNUNET_PSYC_member_send_to_origin_cancel (struct GNUNET_PSYC_OriginTransmitHandle *th); | 559 | GNUNET_PSYC_member_send_to_origin_cancel (struct GNUNET_PSYC_OriginTransmitHandle *th); |
551 | 560 | ||
552 | 561 | ||
553 | /** | 562 | /** |
554 | * Handle to a story telling operation. | 563 | * Handle to a story telling operation. |
555 | */ | 564 | */ |
556 | struct GNUNET_PSYC_Story; | 565 | struct GNUNET_PSYC_Story; |
557 | 566 | ||
558 | 567 | ||
559 | /** | 568 | /** |
560 | * Request to be told the message history of the channel. Historic | 569 | * Request to be told the message history of the channel. |
561 | * messages (but NOT the state at the time) will be replayed (given to | ||
562 | * the normal method handlers) if available and if access is | ||
563 | * permitted. | ||
564 | * | 570 | * |
565 | * @param member which channel should be replayed? | 571 | * Historic messages (but NOT the state at the time) will be replayed (given to |
566 | * @param start earliest interesting point in history | 572 | * the normal method handlers) if available and if access is permitted. |
567 | * @param end last (exclusive) interesting point in history | 573 | * |
568 | * @param method function to invoke on messages received from the story | 574 | * @param member Which channel should be replayed? |
569 | * @param method_cls closure for 'method' | 575 | * @param start Earliest interesting point in history. |
570 | * @param finish_cb function to call when the requested story has been fully | 576 | * @param end Last (exclusive) interesting point in history. |
577 | * @param method Function to invoke on messages received from the story. | ||
578 | * @param method_cls Closure for @a method. | ||
579 | * @param finish_cb Function to call when the requested story has been fully | ||
571 | * told (counting message IDs might not suffice, as some messages | 580 | * told (counting message IDs might not suffice, as some messages |
572 | * might be secret and thus the listener would not know the story is | 581 | * might be secret and thus the listener would not know the story is |
573 | * finished without being told explicitly); once this function | 582 | * finished without being told explicitly); once this function |
574 | * has been called, the client must not call | 583 | * has been called, the client must not call |
575 | * 'GNUNET_PSYC_member_story_tell_cancel' anymore | 584 | * GNUNET_PSYC_member_story_tell_cancel() anymore. |
576 | * @param finish_cb_cls closure to finish_cb | 585 | * @param finish_cb_cls Closure to finish_cb. |
577 | * @return handle to cancel story telling operation | 586 | * @return Handle to cancel story telling operation. |
578 | */ | 587 | */ |
579 | struct GNUNET_PSYC_Story * | 588 | struct GNUNET_PSYC_Story * |
580 | GNUNET_PSYC_member_story_tell (struct GNUNET_PSYC_Member *member, | 589 | GNUNET_PSYC_member_story_tell (struct GNUNET_PSYC_Member *member, |
@@ -586,35 +595,37 @@ GNUNET_PSYC_member_story_tell (struct GNUNET_PSYC_Member *member, | |||
586 | void *finish_cb_cls); | 595 | void *finish_cb_cls); |
587 | 596 | ||
588 | 597 | ||
589 | /** | 598 | /** |
590 | * Abort story telling. This function must not be called from within | 599 | * Abort story telling. |
591 | * method handlers (as given to 'GNUNET_PSYC_member_join') of the | 600 | * |
592 | * member. | 601 | * This function must not be called from within method handlers (as given to |
602 | * GNUNET_PSYC_member_join()) of the member. | ||
593 | * | 603 | * |
594 | * @param story story telling operation to stop | 604 | * @param story Story telling operation to stop. |
595 | */ | 605 | */ |
596 | void | 606 | void |
597 | GNUNET_PSYC_member_story_tell_cancel (struct GNUNET_PSYC_Story *story); | 607 | GNUNET_PSYC_member_story_tell_cancel (struct GNUNET_PSYC_Story *story); |
598 | 608 | ||
599 | 609 | ||
600 | /** | 610 | /** |
601 | * Call the given callback on all matching values (including | 611 | * Call the given callback on all matching values (including variables) in the |
602 | * variables) in the channel state. The callback is invoked | 612 | * channel state. |
603 | * synchronously on all matching states (as the state is fully | 613 | * |
604 | * replicated in the library in this process; channel states should be | 614 | * The callback is invoked synchronously on all matching states (as the state is |
615 | * fully replicated in the library in this process; channel states should be | ||
605 | * small, large data is to be passed as streaming data to methods). | 616 | * small, large data is to be passed as streaming data to methods). |
606 | * | 617 | * |
607 | * A name matches if it includes the 'state_name' prefix, thus | 618 | * A name matches if it includes the @a state_name prefix, thus requesting the |
608 | * requesting the empty state ("") will match all values; requesting | 619 | * empty state ("") will match all values; requesting "a_b" will also return |
609 | * "a_b" will also return values stored under "a_b_c". | 620 | * values stored under "a_b_c". |
610 | * | 621 | * |
611 | * @param member membership handle | 622 | * @param member Membership handle. |
612 | * @param state_name name of the state to query (full name | 623 | * @param state_name Name of the state to query (full name |
613 | * might be longer, this is only the prefix that must match) | 624 | * might be longer, this is only the prefix that must match). |
614 | * @param cb function to call on the matching state values | 625 | * @param cb Function to call on the matching state values. |
615 | * @param cb_cls closure for 'cb' | 626 | * @param cb_cls Closure for @a cb. |
616 | * @return message ID for which the state was returned (last seen | 627 | * @return Message ID for which the state was returned (last seen |
617 | * message ID) | 628 | * message ID). |
618 | */ | 629 | */ |
619 | uint64_t | 630 | uint64_t |
620 | GNUNET_PSYC_member_state_get_all (struct GNUNET_PSYC_Member *member, | 631 | GNUNET_PSYC_member_state_get_all (struct GNUNET_PSYC_Member *member, |
@@ -623,23 +634,24 @@ GNUNET_PSYC_member_state_get_all (struct GNUNET_PSYC_Member *member, | |||
623 | void *cb_cls); | 634 | void *cb_cls); |
624 | 635 | ||
625 | 636 | ||
626 | /** | 637 | /** |
627 | * Obtain the current value of the best-matching value in the state | 638 | * Obtain the current value of the best-matching value in the state |
628 | * (including variables). Note that variables are only valid during a | 639 | * (including variables). |
629 | * GNUNET_PSYC_Method invocation, as variables are only valid for the | 640 | * |
630 | * duration of a method invocation. | 641 | * Note that variables are only valid during a #GNUNET_PSYC_Method invocation, as |
642 | * variables are only valid for the duration of a method invocation. | ||
631 | * | 643 | * |
632 | * If the requested variable name does not have an exact state in | 644 | * If the requested variable name does not have an exact state in |
633 | * the state, the nearest less-specific name is matched; for example, | 645 | * the state, the nearest less-specific name is matched; for example, |
634 | * requesting "a_b" will match "a" if "a_b" does not exist. | 646 | * requesting "a_b" will match "a" if "a_b" does not exist. |
635 | * | 647 | * |
636 | * @param member membership handle | 648 | * @param member Membership handle. |
637 | * @param variable_name name of the variable to query | 649 | * @param variable_name Name of the variable to query. |
638 | * @param return_value_size set to number of bytes in variable, | 650 | * @param return_value_size Set to number of bytes in variable, |
639 | * needed as variables might contain binary data and | 651 | * needed as variables might contain binary data and |
640 | * might also not be 0-terminated; set to 0 on errors | 652 | * might also not be 0-terminated; set to 0 on errors. |
641 | * @return NULL on error (no matching state or variable), pointer | 653 | * @return NULL on error (no matching state or variable), pointer |
642 | to the respective value otherwise | 654 | to the respective value otherwise. |
643 | */ | 655 | */ |
644 | const void * | 656 | const void * |
645 | GNUNET_PSYC_member_state_get (struct GNUNET_PSYC_Member *member, | 657 | GNUNET_PSYC_member_state_get (struct GNUNET_PSYC_Member *member, |
diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index 701f6940f..30671cda2 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h | |||
@@ -18,10 +18,10 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_psycstore_service.h | 22 | * @file include/gnunet_psycstore_service.h |
23 | * @brief PSYCstore service; implements persistent storage for the PSYC service | 23 | * @brief PSYCstore service; implements persistent storage for the PSYC service |
24 | * @author tg | 24 | * @author tg(x) |
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | */ | 26 | */ |
27 | #ifndef GNUNET_PSYCSTORE_SERVICE_H | 27 | #ifndef GNUNET_PSYCSTORE_SERVICE_H |
@@ -37,18 +37,18 @@ extern "C" | |||
37 | 37 | ||
38 | #include "gnunet_util_lib.h" | 38 | #include "gnunet_util_lib.h" |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Version number of GNUnet PSYCstore API. | 41 | * Version number of GNUnet PSYCstore API. |
42 | */ | 42 | */ |
43 | #define GNUNET_PSYCSTORE_VERSION 0x00000000 | 43 | #define GNUNET_PSYCSTORE_VERSION 0x00000000 |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Handle for a PSYCstore | 46 | * Handle for a PSYCstore |
47 | */ | 47 | */ |
48 | struct GNUNET_PSYCSTORE_Handle; | 48 | struct GNUNET_PSYCSTORE_Handle; |
49 | 49 | ||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Connect to the PSYCstore service. | 52 | * Connect to the PSYCstore service. |
53 | * | 53 | * |
54 | * @param cfg Configuration to use. | 54 | * @param cfg Configuration to use. |
@@ -59,7 +59,7 @@ struct GNUNET_PSYCSTORE_Handle * | |||
59 | GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 59 | GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
60 | 60 | ||
61 | 61 | ||
62 | /** | 62 | /** |
63 | * Disconnect from the PSYCstore service. | 63 | * Disconnect from the PSYCstore service. |
64 | * | 64 | * |
65 | * @param h Handle for the connection. | 65 | * @param h Handle for the connection. |
@@ -68,22 +68,23 @@ void | |||
68 | GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h); | 68 | GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h); |
69 | 69 | ||
70 | 70 | ||
71 | /** | 71 | /** |
72 | * Handle for an operation on the PSYCSTORE (useful to cancel the operation). | 72 | * Handle for an operation on the PSYCSTORE (useful to cancel the operation). |
73 | */ | 73 | */ |
74 | struct GNUNET_PSYCSTORE_OperationHandle; | 74 | struct GNUNET_PSYCSTORE_OperationHandle; |
75 | 75 | ||
76 | 76 | ||
77 | /** | 77 | /** |
78 | * | 78 | * Function called with the result of an asynchronous operation. |
79 | * @param result GNUNET_SYSERR on error, | 79 | ; * |
80 | * GNUNET_YES on success or if the peer was a member, | 80 | * @param result #GNUNET_SYSERR on error, |
81 | * GNUNET_NO if the peer was not a member | 81 | * #GNUNET_YES on success or if the peer was a member, |
82 | * #GNUNET_NO if the peer was not a member | ||
82 | */ | 83 | */ |
83 | typedef void (*GNUNET_PSYCSTORE_ContinuationCallback)(void *cls, | 84 | typedef void (*GNUNET_PSYCSTORE_ContinuationCallback)(void *cls, |
84 | int result); | 85 | int result); |
85 | 86 | ||
86 | /** | 87 | /** |
87 | * Store join/leave events for a PSYC channel in order to be able to answer | 88 | * Store join/leave events for a PSYC channel in order to be able to answer |
88 | * membership test queries later. | 89 | * membership test queries later. |
89 | * | 90 | * |
@@ -91,7 +92,7 @@ typedef void (*GNUNET_PSYCSTORE_ContinuationCallback)(void *cls, | |||
91 | * @param channel_id ID of the channel where the event happened. | 92 | * @param channel_id ID of the channel where the event happened. |
92 | * @param message_id ID of the message in which this event was announced. | 93 | * @param message_id ID of the message in which this event was announced. |
93 | * @param peer Identity of joining/leaving peer. | 94 | * @param peer Identity of joining/leaving peer. |
94 | * @param did_join GNUNET_YES on join, GNUNET_NO on leave. | 95 | * @param did_join #GNUNET_YES on join, #GNUNET_NO on leave. |
95 | * @param ccb Callback to call with the result of the storage operation. | 96 | * @param ccb Callback to call with the result of the storage operation. |
96 | * @param ccb_cls Closure for the callback. | 97 | * @param ccb_cls Closure for the callback. |
97 | * | 98 | * |
@@ -107,11 +108,12 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | |||
107 | void *ccb_cls); | 108 | void *ccb_cls); |
108 | 109 | ||
109 | 110 | ||
110 | /** | 111 | /** |
111 | * Test if a peer was a member of the channel when the message with the | 112 | * Test if a peer was a member of the channel when the message with the |
112 | * specified ID was sent to the channel. This is useful in case of | 113 | * specified ID was sent to the channel. |
113 | * retransmissions to check if the peer was authorized to see the requested | 114 | * |
114 | * message. | 115 | * This is useful in case of retransmissions to check if the peer was authorized |
116 | * to see the requested message. | ||
115 | * | 117 | * |
116 | * @param h Handle for the PSYCstore. | 118 | * @param h Handle for the PSYCstore. |
117 | * @param channel_id The channel we are interested in. | 119 | * @param channel_id The channel we are interested in. |
@@ -121,7 +123,8 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | |||
121 | * @param ccb_cls Closure for the callback. | 123 | * @param ccb_cls Closure for the callback. |
122 | * | 124 | * |
123 | * @return Operation handle that can be used to cancel the operation. | 125 | * @return Operation handle that can be used to cancel the operation. |
124 | */struct GNUNET_PSYCSTORE_OperationHandle * | 126 | */ |
127 | struct GNUNET_PSYCSTORE_OperationHandle * | ||
125 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | 128 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, |
126 | const struct GNUNET_HashCode *channel_id, | 129 | const struct GNUNET_HashCode *channel_id, |
127 | uint64_t message_id, | 130 | uint64_t message_id, |
@@ -130,6 +133,17 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | |||
130 | void *ccb_cls); | 133 | void *ccb_cls); |
131 | 134 | ||
132 | 135 | ||
136 | /** | ||
137 | * Store a message sent to a channel. | ||
138 | * | ||
139 | * @param h Handle for the PSYCstore. | ||
140 | * @param channel_id The channel the message belongs to. | ||
141 | * @param message_id Message ID to store. | ||
142 | * @param ccb Callback to call with the result of the operation. | ||
143 | * @param ccb_cls Closure for the callback. | ||
144 | * | ||
145 | * @return Handle that can be used to cancel the operation. | ||
146 | */ | ||
133 | struct GNUNET_PSYCSTORE_OperationHandle * | 147 | struct GNUNET_PSYCSTORE_OperationHandle * |
134 | GNUNET_PSYCSTORE_message_store (struct GNUNET_PSYCSTORE_Handle *h, | 148 | GNUNET_PSYCSTORE_message_store (struct GNUNET_PSYCSTORE_Handle *h, |
135 | const struct GNUNET_HashCode *channel_id, | 149 | const struct GNUNET_HashCode *channel_id, |
@@ -138,11 +152,29 @@ GNUNET_PSYCSTORE_message_store (struct GNUNET_PSYCSTORE_Handle *h, | |||
138 | void *ccb_cls); | 152 | void *ccb_cls); |
139 | 153 | ||
140 | 154 | ||
155 | /** | ||
156 | * Function called with the result of a GNUNET_PSYCSTORE_message_get() call. | ||
157 | * | ||
158 | * @param cls Closure. | ||
159 | * @param message_id ID of the message. | ||
160 | * @param message The retrieved message. | ||
161 | */ | ||
141 | typedef void (*GNUNET_PSYCSTORE_MessageResultCallback)(void *cls, | 162 | typedef void (*GNUNET_PSYCSTORE_MessageResultCallback)(void *cls, |
142 | uint64_t message_id, | 163 | uint64_t message_id, |
143 | const struct GNUNET_MULTICAST_MessageHeader *message); | 164 | const struct GNUNET_MULTICAST_MessageHeader *message); |
144 | 165 | ||
145 | 166 | ||
167 | /** | ||
168 | * Retrieve a message by ID. | ||
169 | * | ||
170 | * @param h Handle for the PSYCstore. | ||
171 | * @param channel_id The channel we are interested in. | ||
172 | * @param message_id Message ID to check. | ||
173 | * @param rcb Callback to call with the result of the operation. | ||
174 | * @param rcb_cls Closure for the callback. | ||
175 | * | ||
176 | * @return Handle that can be used to cancel the operation. | ||
177 | */ | ||
146 | struct GNUNET_PSYCSTORE_OperationHandle * | 178 | struct GNUNET_PSYCSTORE_OperationHandle * |
147 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | 179 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, |
148 | const struct GNUNET_HashCode *channel_id, | 180 | const struct GNUNET_HashCode *channel_id, |
@@ -151,6 +183,16 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
151 | void *rcb_cls); | 183 | void *rcb_cls); |
152 | 184 | ||
153 | 185 | ||
186 | /** | ||
187 | * Get latest message sent to a channel. | ||
188 | * | ||
189 | * @param h Handle for the PSYCstore. | ||
190 | * @param channel_id The channel we are interested in. | ||
191 | * @param rcb Callback to call with the result of the operation. | ||
192 | * @param rcb_cls Closure for the callback. | ||
193 | * | ||
194 | * @return Handle that can be used to cancel the operation. | ||
195 | */ | ||
154 | struct GNUNET_PSYCSTORE_OperationHandle * | 196 | struct GNUNET_PSYCSTORE_OperationHandle * |
155 | GNUNET_PSYCSTORE_message_get_latest (struct GNUNET_PSYCSTORE_Handle *h, | 197 | GNUNET_PSYCSTORE_message_get_latest (struct GNUNET_PSYCSTORE_Handle *h, |
156 | const struct GNUNET_HashCode *channel_id, | 198 | const struct GNUNET_HashCode *channel_id, |
@@ -158,30 +200,73 @@ GNUNET_PSYCSTORE_message_get_latest (struct GNUNET_PSYCSTORE_Handle *h, | |||
158 | void *rcb_cls); | 200 | void *rcb_cls); |
159 | 201 | ||
160 | 202 | ||
203 | /** | ||
204 | * Store a state variable. | ||
205 | * | ||
206 | * @param h Handle for the PSYCstore. | ||
207 | * @param channel_id The channel we are interested in. | ||
208 | * @param name Name of variable. | ||
209 | * @param size Size of @a value. | ||
210 | * @param value Value of variable. | ||
211 | * @param ccb Callback to call with the result of the operation. | ||
212 | * @param ccb_cls Closure for the callback. | ||
213 | * | ||
214 | * @return Handle that can be used to cancel the operation. | ||
215 | */ | ||
161 | struct GNUNET_PSYCSTORE_OperationHandle * | 216 | struct GNUNET_PSYCSTORE_OperationHandle * |
162 | GNUNET_PSYCSTORE_state_set (struct GNUNET_PSYCSTORE_Handle *h, | 217 | GNUNET_PSYCSTORE_state_set (struct GNUNET_PSYCSTORE_Handle *h, |
163 | const struct GNUNET_HashCode *channel_id, | 218 | const struct GNUNET_HashCode *channel_id, |
164 | const char *state_name, | 219 | const char *name, |
165 | size_t size, | 220 | size_t size, |
166 | const void *value, | 221 | const void *value, |
167 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | 222 | GNUNET_PSYCSTORE_ContinuationCallback ccb, |
168 | void *ccb_cls); | 223 | void *ccb_cls); |
169 | 224 | ||
170 | 225 | ||
226 | /** | ||
227 | * Function called with the value of a state variable. | ||
228 | * | ||
229 | * @param cls Closure. | ||
230 | * @param name Name of variable. | ||
231 | * @param size Size of @a value. | ||
232 | * @param value Value of variable. | ||
233 | t * | ||
234 | */ | ||
171 | typedef void (*GNUNET_PSYCSTORE_StateResultCallback)(void *cls, | 235 | typedef void (*GNUNET_PSYCSTORE_StateResultCallback)(void *cls, |
172 | const char *state_name, | 236 | const char *name, |
173 | size_t size, | 237 | size_t size, |
174 | const void *value); | 238 | const void *value); |
175 | 239 | ||
176 | 240 | ||
241 | /** | ||
242 | * Retrieve the given state variable for a channel. | ||
243 | * | ||
244 | * @param h Handle for the PSYCstore. | ||
245 | * @param channel_id The channel we are interested in. | ||
246 | * @param name Name of variable to get. | ||
247 | * @param rcb Callback to call with the result. | ||
248 | * @param rcb_cls Closure for the callback. | ||
249 | * | ||
250 | * @return Handle that can be used to cancel the operation. | ||
251 | */ | ||
177 | struct GNUNET_PSYCSTORE_OperationHandle * | 252 | struct GNUNET_PSYCSTORE_OperationHandle * |
178 | GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, | 253 | GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, |
179 | const struct GNUNET_HashCode *channel_id, | 254 | const struct GNUNET_HashCode *channel_id, |
180 | const char *state_name, | 255 | const char *name, |
181 | GNUNET_PSYCSTORE_StateResultCallback rcb, | 256 | GNUNET_PSYCSTORE_StateResultCallback rcb, |
182 | void *rcb_cls); | 257 | void *rcb_cls); |
183 | 258 | ||
184 | 259 | ||
260 | /** | ||
261 | * Retrieve all state variables for a channel. | ||
262 | * | ||
263 | * @param h Handle for the PSYCstore. | ||
264 | * @param channel_id The channel we are interested in. | ||
265 | * @param rcb Callback to call with the result. | ||
266 | * @param rcb_cls Closure for the callback. | ||
267 | * | ||
268 | * @return Handle that can be used to cancel the operation. | ||
269 | */ | ||
185 | struct GNUNET_PSYCSTORE_OperationHandle * | 270 | struct GNUNET_PSYCSTORE_OperationHandle * |
186 | GNUNET_PSYCSTORE_state_get_all (struct GNUNET_PSYCSTORE_Handle *h, | 271 | GNUNET_PSYCSTORE_state_get_all (struct GNUNET_PSYCSTORE_Handle *h, |
187 | const struct GNUNET_HashCode *channel_id, | 272 | const struct GNUNET_HashCode *channel_id, |
@@ -189,6 +274,11 @@ GNUNET_PSYCSTORE_state_get_all (struct GNUNET_PSYCSTORE_Handle *h, | |||
189 | void *rcb_cls); | 274 | void *rcb_cls); |
190 | 275 | ||
191 | 276 | ||
277 | /** | ||
278 | * Cancel an operation. | ||
279 | * | ||
280 | * @param oh Handle for the operation to cancel. | ||
281 | */ | ||
192 | void | 282 | void |
193 | GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *oh); | 283 | GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *oh); |
194 | 284 | ||
diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h index 3e550ab51..e3483ca74 100644 --- a/src/include/gnunet_social_service.h +++ b/src/include/gnunet_social_service.h | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file include/gnunet_social_service.h | 22 | * @file include/gnunet_social_service.h |
23 | * @brief Social service; implements social functionality using the PSYC service. | 23 | * @brief Social service; implements social functionality using the PSYC service. |
24 | * @author tg | 24 | * @author tg(x) |
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | */ | 26 | */ |
27 | #ifndef GNUNET_SOCIAL_SERVICE_H | 27 | #ifndef GNUNET_SOCIAL_SERVICE_H |
@@ -74,7 +74,7 @@ struct GNUNET_SOCIAL_Slicer; | |||
74 | 74 | ||
75 | /** | 75 | /** |
76 | * Method called from SOCIAL upon receiving a message indicating a call | 76 | * Method called from SOCIAL upon receiving a message indicating a call |
77 | * to a 'method'. | 77 | * to a @a method. |
78 | * | 78 | * |
79 | * @param cls Closure. | 79 | * @param cls Closure. |
80 | * @param full_method_name Original method name from PSYC (may be more | 80 | * @param full_method_name Original method name from PSYC (may be more |
@@ -83,11 +83,11 @@ struct GNUNET_SOCIAL_Slicer; | |||
83 | * @param message_id Unique message counter for this message | 83 | * @param message_id Unique message counter for this message |
84 | * (unique only in combination with the given sender for | 84 | * (unique only in combination with the given sender for |
85 | * this channel). | 85 | * this channel). |
86 | * @param data_off Byte offset of 'data' in the overall data of the method. | 86 | * @param data_off Byte offset of @a data in the overall data of the method. |
87 | * @param data_size Number of bytes in 'data'. | 87 | * @param data_size Number of bytes in @a data. |
88 | * @param data data stream given to the method (might not be zero-terminated | 88 | * @param data Data stream given to the method (might not be zero-terminated |
89 | * if data is binary) | 89 | * if data is binary). |
90 | * @param frag fragmentation status for the data | 90 | * @param frag Fragmentation status for the data. |
91 | */ | 91 | */ |
92 | typedef int (*GNUNET_SOCIAL_Method)(void *cls, | 92 | typedef int (*GNUNET_SOCIAL_Method)(void *cls, |
93 | const char *full_method_name, | 93 | const char *full_method_name, |
@@ -142,9 +142,9 @@ GNUNET_SOCIAL_slicer_destroy (struct GNUNET_SOCIAL_Slicer *slicer); | |||
142 | * Create an ego using the private key from the given file. If the file does | 142 | * Create an ego using the private key from the given file. If the file does |
143 | * not exist, a fresh key is created. | 143 | * not exist, a fresh key is created. |
144 | * | 144 | * |
145 | * @param keyfile name of the file with the private key for the ego, | 145 | * @param keyfile Name of the file with the private key for the ego, |
146 | * NULL for ephemeral egos | 146 | * NULL for ephemeral egos. |
147 | * @return handle to the ego, NULL on error | 147 | * @return Handle to the ego, NULL on error. |
148 | */ | 148 | */ |
149 | struct GNUNET_SOCIAL_Ego * | 149 | struct GNUNET_SOCIAL_Ego * |
150 | GNUNET_SOCIAL_ego_create (const char *keyfile); | 150 | GNUNET_SOCIAL_ego_create (const char *keyfile); |
@@ -153,7 +153,7 @@ GNUNET_SOCIAL_ego_create (const char *keyfile); | |||
153 | /** | 153 | /** |
154 | * Destroy a handle to an ego. | 154 | * Destroy a handle to an ego. |
155 | * | 155 | * |
156 | * @param ego ego to destroy | 156 | * @param ego Ego to destroy. |
157 | */ | 157 | */ |
158 | void | 158 | void |
159 | GNUNET_SOCIAL_ego_destroy (struct GNUNET_SOCIAL_Ego *ego); | 159 | GNUNET_SOCIAL_ego_destroy (struct GNUNET_SOCIAL_Ego *ego); |
@@ -162,16 +162,16 @@ GNUNET_SOCIAL_ego_destroy (struct GNUNET_SOCIAL_Ego *ego); | |||
162 | /** | 162 | /** |
163 | * Function called asking for nym to be admitted to the place. | 163 | * Function called asking for nym to be admitted to the place. |
164 | * | 164 | * |
165 | * Should call either 'GNUNET_SOCIAL_home_admit' or | 165 | * Should call either GNUNET_SOCIAL_home_admit() or |
166 | * 'GNUNET_SOCIAL_home_reject_entry' (possibly asynchronously). If this owner | 166 | * GNUNET_SOCIAL_home_reject_entry() (possibly asynchronously). If this owner |
167 | * cannot decide, it is fine to call neither function, in which case hopefully | 167 | * cannot decide, it is fine to call neither function, in which case hopefully |
168 | * some other owner of the home exists that will make the decision. The 'nym' | 168 | * some other owner of the home exists that will make the decision. The @a nym |
169 | * reference remains valid until the 'GNUNET_SOCIAL_FarewellCallback' is invoked | 169 | * reference remains valid until the #GNUNET_SOCIAL_FarewellCallback is invoked |
170 | * for it. | 170 | * for it. |
171 | * | 171 | * |
172 | * @param cls Closure. | 172 | * @param cls Closure. |
173 | * @param nym Handle for the user who wants to join. | 173 | * @param nym Handle for the user who wants to join. |
174 | * @param join_msg_size Number of bytes in 'join_msg'. | 174 | * @param join_msg_size Number of bytes in @a join_msg. |
175 | * @param join_msg Payload given on join (e.g. a password). | 175 | * @param join_msg Payload given on join (e.g. a password). |
176 | */ | 176 | */ |
177 | typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls, | 177 | typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls, |
@@ -181,10 +181,10 @@ typedef void (*GNUNET_SOCIAL_AnswerDoorCallback)(void *cls, | |||
181 | 181 | ||
182 | 182 | ||
183 | /** | 183 | /** |
184 | * Function called when a 'nym' leaves the place. | 184 | * Function called when a @a nym leaves the place. |
185 | * | 185 | * |
186 | * This is also called if the 'nym' was never given permission to enter | 186 | * This is also called if the @a nym was never given permission to enter |
187 | * (i.e. the 'nym' stopped asking to get in). | 187 | * (i.e. the @a nym stopped asking to get in). |
188 | * | 188 | * |
189 | * @param cls Closure. | 189 | * @param cls Closure. |
190 | * @param nym Handle for the user who left. | 190 | * @param nym Handle for the user who left. |
@@ -197,8 +197,8 @@ typedef void (*GNUNET_SOCIAL_FarewellCallback)(void *cls, | |||
197 | * Enter a home where guests (nyms) can be hosted. | 197 | * Enter a home where guests (nyms) can be hosted. |
198 | * | 198 | * |
199 | * A home is created upon first entering, and exists until | 199 | * A home is created upon first entering, and exists until |
200 | * 'GNUNET_SOCIAL_home_destroy' is called. It can also be left temporarily using | 200 | * GNUNET_SOCIAL_home_destroy() is called. It can also be left temporarily using |
201 | * 'GNUNET_SOCIAL_home_leave'. | 201 | * GNUNET_SOCIAL_home_leave(). |
202 | * | 202 | * |
203 | * @param cfg Configuration to contact the social service. | 203 | * @param cfg Configuration to contact the social service. |
204 | * @param home_keyfile File with the private key for the home, | 204 | * @param home_keyfile File with the private key for the home, |
@@ -209,7 +209,7 @@ typedef void (*GNUNET_SOCIAL_FarewellCallback)(void *cls, | |||
209 | * @param slicer Slicer to handle guests talking. | 209 | * @param slicer Slicer to handle guests talking. |
210 | * @param listener_cb Function to handle new nyms that want to join. | 210 | * @param listener_cb Function to handle new nyms that want to join. |
211 | * @param farewell_cb Function to handle departing nyms. | 211 | * @param farewell_cb Function to handle departing nyms. |
212 | * @param cls Closure for 'listener_cb' and 'farewell_cb'. | 212 | * @param cls Closure for @a listener_cb and @a farewell_cb. |
213 | * @return Handle for a new home. | 213 | * @return Handle for a new home. |
214 | */ | 214 | */ |
215 | struct GNUNET_SOCIAL_Home * | 215 | struct GNUNET_SOCIAL_Home * |
@@ -224,12 +224,12 @@ GNUNET_SOCIAL_home_enter (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
224 | 224 | ||
225 | 225 | ||
226 | /** | 226 | /** |
227 | * Admit 'nym' to the 'home'. | 227 | * Admit @a nym to the @a home. |
228 | * | 228 | * |
229 | * The 'nym' reference will remain valid until either the home is destroyed or | 229 | * The @a nym reference will remain valid until either the home is destroyed or |
230 | * 'nym' leaves. | 230 | * @a nym leaves. |
231 | * | 231 | * |
232 | * @param home Home to allow 'nym' to join. | 232 | * @param home Home to allow @a nym to join. |
233 | * @param nym Handle for the entity that wants to join. | 233 | * @param nym Handle for the entity that wants to join. |
234 | */ | 234 | */ |
235 | void | 235 | void |
@@ -238,10 +238,10 @@ GNUNET_SOCIAL_home_admit (struct GNUNET_SOCIAL_Home *home, | |||
238 | 238 | ||
239 | 239 | ||
240 | /** | 240 | /** |
241 | * Throw 'nym' out of the 'home'. | 241 | * Throw @a nym out of the @a home. |
242 | * | 242 | * |
243 | * The 'nym' reference will remain valid until the | 243 | * The @a nym reference will remain valid until the |
244 | * 'GNUNET_SOCIAL_FarewellCallback' is invoked, | 244 | * #GNUNET_SOCIAL_FarewellCallback is invoked, |
245 | * which should be very soon after this call. | 245 | * which should be very soon after this call. |
246 | * | 246 | * |
247 | * @param home Home to eject nym from. | 247 | * @param home Home to eject nym from. |
@@ -253,12 +253,12 @@ GNUNET_SOCIAL_home_eject (struct GNUNET_SOCIAL_Home *home, | |||
253 | 253 | ||
254 | 254 | ||
255 | /** | 255 | /** |
256 | * Refuse 'nym' entry into the 'home'. | 256 | * Refuse @a nym entry into the @a home. |
257 | * | 257 | * |
258 | * @param home Home to disallow 'nym' to join. | 258 | * @param home Home to disallow @a nym to join. |
259 | * @param nym Handle for the entity that wanted to join. | 259 | * @param nym Handle for the entity that wanted to join. |
260 | * @param method Method name to invoke on caller. | 260 | * @param method Method name to invoke on caller. |
261 | * @param message_size Number of bytes in 'message' for method. | 261 | * @param message_size Number of bytes in @a message for method. |
262 | * @param message Rejection message to send back. | 262 | * @param message Rejection message to send back. |
263 | * | 263 | * |
264 | * FIXME: allow setting variables as well for the message | 264 | * FIXME: allow setting variables as well for the message |
@@ -274,7 +274,7 @@ GNUNET_SOCIAL_home_reject_entry (struct GNUNET_SOCIAL_Home *home, | |||
274 | /** | 274 | /** |
275 | * Get the identity of a user. | 275 | * Get the identity of a user. |
276 | * | 276 | * |
277 | * Suitable, for example, to be used with 'GNUNET_NAMESTORE_zone_to_name'. | 277 | * Suitable, for example, to be used with GNUNET_NAMESTORE_zone_to_name(). |
278 | * | 278 | * |
279 | * @param nym Pseudonym to map to a cryptographic identifier. | 279 | * @param nym Pseudonym to map to a cryptographic identifier. |
280 | * @param identity Set to the identity of the nym (short hash of the public key). | 280 | * @param identity Set to the identity of the nym (short hash of the public key). |
@@ -299,13 +299,13 @@ GNUNET_SOCIAL_home_get_address (struct GNUNET_SOCIAL_Home *home, | |||
299 | /** | 299 | /** |
300 | * (Re)decorate the home by changing objects in it. | 300 | * (Re)decorate the home by changing objects in it. |
301 | * | 301 | * |
302 | * If the operation is 'GNUNET_PSYC_SOT_SET_VARIABLE' then the decoration only | 302 | * If the operation is #GNUNET_PSYC_SOT_SET_VARIABLE then the decoration only |
303 | * applies to the next announcement by the home owner. | 303 | * applies to the next announcement by the home owner. |
304 | * | 304 | * |
305 | * @param home The home to decorate. | 305 | * @param home The home to decorate. |
306 | * @param operation Operation to perform on the object. | 306 | * @param operation Operation to perform on the object. |
307 | * @param object_name Name of the object to modify. | 307 | * @param object_name Name of the object to modify. |
308 | * @param object_value_size Size of the given 'object_value'. | 308 | * @param object_value_size Size of the given @a object_value. |
309 | * @param object_value Value to use for the modification. | 309 | * @param object_value Value to use for the modification. |
310 | */ | 310 | */ |
311 | void | 311 | void |
@@ -330,7 +330,7 @@ struct GNUNET_SOCIAL_Announcement; | |||
330 | * @param home Home to address the announcement to. | 330 | * @param home Home to address the announcement to. |
331 | * @param full_method_name Method to use for the announcement. | 331 | * @param full_method_name Method to use for the announcement. |
332 | * @param notify Function to call to get the payload of the announcement. | 332 | * @param notify Function to call to get the payload of the announcement. |
333 | * @param notify_cls Closure for 'notify'. | 333 | * @param notify_cls Closure for @a notify. |
334 | * @return NULL on error (announcement already in progress?). | 334 | * @return NULL on error (announcement already in progress?). |
335 | */ | 335 | */ |
336 | struct GNUNET_SOCIAL_Announcement * | 336 | struct GNUNET_SOCIAL_Announcement * |
@@ -353,8 +353,8 @@ GNUNET_SOCIAL_home_announce_cancel (struct GNUNET_SOCIAL_Announcement *a); | |||
353 | * Convert our home to a place so we can access it via the place API. | 353 | * Convert our home to a place so we can access it via the place API. |
354 | * | 354 | * |
355 | * @param home Handle for the home. | 355 | * @param home Handle for the home. |
356 | * @return Place handle for the same home, valid as long as 'home' is valid; | 356 | * @return Place handle for the same home, valid as long as @a home is valid; |
357 | * do NOT try to 'GNUNET_SOCIAL_place_leave' this place, it's your home!m | 357 | * do NOT try to GNUNET_SOCIAL_place_leave() this place, it's your home! |
358 | */ | 358 | */ |
359 | struct GNUNET_SOCIAL_Place * | 359 | struct GNUNET_SOCIAL_Place * |
360 | GNUNET_SOCIAL_home_to_place (struct GNUNET_SOCIAL_Home *home); | 360 | GNUNET_SOCIAL_home_to_place (struct GNUNET_SOCIAL_Home *home); |
@@ -392,7 +392,7 @@ GNUNET_SOCIAL_home_destroy (struct GNUNET_SOCIAL_Home *home); | |||
392 | * key already; 'HEX.zkey' however would refer to | 392 | * key already; 'HEX.zkey' however would refer to |
393 | * the 'PLACE' record in the GADS zone with the public key | 393 | * the 'PLACE' record in the GADS zone with the public key |
394 | * 'HEX'. | 394 | * 'HEX'. |
395 | * @param join_msg_size Number of bytes in 'join_msg'. | 395 | * @param join_msg_size Number of bytes in @a join_msg. |
396 | * @param join_msg Message to give to the join callback. | 396 | * @param join_msg Message to give to the join callback. |
397 | * @return NULL on errors, otherwise handle to the place. | 397 | * @return NULL on errors, otherwise handle to the place. |
398 | */ | 398 | */ |
@@ -411,11 +411,11 @@ struct GNUNET_SOCIAL_WatchHandle; | |||
411 | * Watch a place for changed objects. | 411 | * Watch a place for changed objects. |
412 | * | 412 | * |
413 | * @param place Place to watch. | 413 | * @param place Place to watch. |
414 | * @param object_filter Object prefix to match. if | 414 | * @param object_filter Object prefix to match. |
415 | * @param state_cb | 415 | * @param state_cb Function to call when an object/state changes. |
416 | * @param state_cb_cls | 416 | * @param state_cb_cls Closure for callback. |
417 | * | 417 | * |
418 | * @return | 418 | * @return Handle that can be used to cancel watching. |
419 | */ | 419 | */ |
420 | struct GNUNET_SOCIAL_WatchHandle * | 420 | struct GNUNET_SOCIAL_WatchHandle * |
421 | GNUNET_SOCIAL_place_watch (struct GNUNET_SOCIAL_Place *place, | 421 | GNUNET_SOCIAL_place_watch (struct GNUNET_SOCIAL_Place *place, |
@@ -424,6 +424,11 @@ GNUNET_SOCIAL_place_watch (struct GNUNET_SOCIAL_Place *place, | |||
424 | void *state_cb_cls); | 424 | void *state_cb_cls); |
425 | 425 | ||
426 | 426 | ||
427 | /** | ||
428 | * Cancel watching a place for changed objects. | ||
429 | * | ||
430 | * @param wh Watch handle to cancel. | ||
431 | */ | ||
427 | void | 432 | void |
428 | GNUNET_SOCIAL_place_watch_cancel (struct GNUNET_SOCIAL_WatchHandle *wh); | 433 | GNUNET_SOCIAL_place_watch_cancel (struct GNUNET_SOCIAL_WatchHandle *wh); |
429 | 434 | ||
@@ -464,6 +469,8 @@ GNUNET_SOCIAL_place_look_for (struct GNUNET_SOCIAL_Place *place, | |||
464 | 469 | ||
465 | /** | 470 | /** |
466 | * Stop looking at objects. | 471 | * Stop looking at objects. |
472 | * | ||
473 | * @param lh Look handle to stop. | ||
467 | */ | 474 | */ |
468 | void | 475 | void |
469 | GNUNET_SOCIAL_place_look_cancel (struct GNUNET_SOCIAL_LookHandle *lh); | 476 | GNUNET_SOCIAL_place_look_cancel (struct GNUNET_SOCIAL_LookHandle *lh); |
@@ -492,7 +499,7 @@ GNUNET_SOCIAL_place_look_at (struct GNUNET_SOCIAL_Place *place, | |||
492 | * | 499 | * |
493 | * @param place Place to talk in. | 500 | * @param place Place to talk in. |
494 | * @param variable_name Name of variable to set. | 501 | * @param variable_name Name of variable to set. |
495 | * @param value_size Number of bytes in 'value'. | 502 | * @param value_size Number of bytes in @a value. |
496 | * @param value Value of variable. | 503 | * @param value Value of variable. |
497 | */ | 504 | */ |
498 | void | 505 | void |
@@ -514,7 +521,7 @@ struct GNUNET_SOCIAL_TalkRequest; | |||
514 | * @param place Place where we want to talk to the host. | 521 | * @param place Place where we want to talk to the host. |
515 | * @param method_name Method to invoke on the host. | 522 | * @param method_name Method to invoke on the host. |
516 | * @param cb Function to use to get the payload for the method. | 523 | * @param cb Function to use to get the payload for the method. |
517 | * @param cb_cls Closure for 'cb'. | 524 | * @param cb_cls Closure for @a cb. |
518 | * @return NULL if we are already trying to talk to the host, | 525 | * @return NULL if we are already trying to talk to the host, |
519 | * otherwise handle to cancel the request. | 526 | * otherwise handle to cancel the request. |
520 | */ | 527 | */ |
@@ -530,9 +537,9 @@ GNUNET_SOCIAL_place_talk (struct GNUNET_SOCIAL_Place *place, | |||
530 | * FIXME: look up nym in GADS and talk to its place. | 537 | * FIXME: look up nym in GADS and talk to its place. |
531 | * | 538 | * |
532 | * @param nym Nym we want to talk to. | 539 | * @param nym Nym we want to talk to. |
533 | * @param method_name Method to invoke on the nym. | 540 | * @param method_name Method to invoke on the @a nym. |
534 | * @param cb Function to use to get the payload for the method. | 541 | * @param cb Function to use to get the payload for the method. |
535 | * @param cb_cls Closure for 'cb'. | 542 | * @param cb_cls Closure for @a cb. |
536 | * @return NULL if we are already trying to talk to the host, | 543 | * @return NULL if we are already trying to talk to the host, |
537 | * otherwise handle to cancel the request. | 544 | * otherwise handle to cancel the request. |
538 | */ | 545 | */ |
@@ -593,13 +600,13 @@ GNUNET_SOCIAL_place_get_history_cancel (struct GNUNET_SOCIAL_HistoryLesson *hist | |||
593 | /** | 600 | /** |
594 | * Leave a place (destroys the place handle). | 601 | * Leave a place (destroys the place handle). |
595 | * | 602 | * |
596 | * Can either move our user into an 'away' state (in which we continue to record | 603 | * Can either move our user into an @e away state (in which we continue to record |
597 | * ongoing conversations and state changes if our peer is running), or leave the | 604 | * ongoing conversations and state changes if our peer is running), or leave the |
598 | * place entirely and stop following the conversation. | 605 | * place entirely and stop following the conversation. |
599 | * | 606 | * |
600 | * @param place Place to leave. | 607 | * @param place Place to leave. |
601 | * @param keep_following GNUNET_YES to ask the social service to continue | 608 | * @param keep_following #GNUNET_YES to ask the social service to continue |
602 | * to follow the conversation, GNUNET_NO to fully leave the place. | 609 | * to follow the conversation, #GNUNET_NO to fully leave the place. |
603 | */ | 610 | */ |
604 | void | 611 | void |
605 | GNUNET_SOCIAL_place_leave (struct GNUNET_SOCIAL_Place *place, | 612 | GNUNET_SOCIAL_place_leave (struct GNUNET_SOCIAL_Place *place, |