aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set.h
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2013-11-11 17:32:48 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2013-11-11 17:32:48 +0000
commitc7954a8ae4bd0e745de626e22b72328e7b2491f4 (patch)
treeaf1c4ff37b84d6244756a8024e170352c98e4cda /src/set/gnunet-service-set.h
parent74d9e28db4e0e515ec17c5fdd1994f6f18377c7b (diff)
downloadgnunet-c7954a8ae4bd0e745de626e22b72328e7b2491f4.tar.gz
gnunet-c7954a8ae4bd0e745de626e22b72328e7b2491f4.zip
added many comments
documented set-union state "machine" removed many deprecated struct-members from state, ops-spec improved doxygen-compliant
Diffstat (limited to 'src/set/gnunet-service-set.h')
-rw-r--r--src/set/gnunet-service-set.h37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h
index 7a2c5ba8d..dd6e91da8 100644
--- a/src/set/gnunet-service-set.h
+++ b/src/set/gnunet-service-set.h
@@ -91,7 +91,7 @@ struct OperationSpecification
91 uint32_t salt; 91 uint32_t salt;
92 92
93 /** 93 /**
94 * ID used to identify responses to a client. 94 * ID used to identify an operation between service and client
95 */ 95 */
96 uint32_t client_request_id; 96 uint32_t client_request_id;
97 97
@@ -168,16 +168,12 @@ typedef void (*OpCreateImpl) (struct Operation *op);
168typedef int (*MsgHandlerImpl) (struct Operation *op, 168typedef int (*MsgHandlerImpl) (struct Operation *op,
169 const struct GNUNET_MessageHeader *msg); 169 const struct GNUNET_MessageHeader *msg);
170 170
171typedef void (*CancelImpl) (struct Operation *op);
172
173
174/** 171/**
175 * Signature of functions that implement sending all the set's 172 * Signature of functions that implement operation cancellation
176 * elements to the client.
177 * 173 *
178 * @param set set that should be iterated over 174 * @param op operation state
179 */ 175 */
180typedef void (*IterateImpl) (struct Set *set); 176typedef void (*CancelImpl) (struct Operation *op);
181 177
182 178
183/** 179/**
@@ -233,11 +229,6 @@ struct SetVT
233 * its ID. 229 * its ID.
234 */ 230 */
235 CancelImpl cancel; 231 CancelImpl cancel;
236
237 /**
238 * Callback for iterating over all set elements.
239 */
240 IterateImpl iterate;
241}; 232};
242 233
243 234
@@ -285,6 +276,8 @@ struct ElementEntry
285 /** 276 /**
286 * GNUNET_YES if the element is a remote element, and does not belong 277 * GNUNET_YES if the element is a remote element, and does not belong
287 * to the operation's set. 278 * to the operation's set.
279 *
280 * //TODO: Move to Union, unless additional set-operations are implemented ever
288 */ 281 */
289 int remote; 282 int remote;
290}; 283};
@@ -295,6 +288,8 @@ struct Operation
295 /** 288 /**
296 * V-Table for the operation belonging 289 * V-Table for the operation belonging
297 * to the tunnel contest. 290 * to the tunnel contest.
291 *
292 * Used for all operation specific operations after receiving the ops request
298 */ 293 */
299 const struct SetVT *vt; 294 const struct SetVT *vt;
300 295
@@ -311,6 +306,8 @@ struct Operation
311 /** 306 /**
312 * GNUNET_YES if this is not a "real" set operation yet, and we still 307 * GNUNET_YES if this is not a "real" set operation yet, and we still
313 * need to wait for the other peer to give us more details. 308 * need to wait for the other peer to give us more details.
309 *
310 * //TODO: replace with state-enum
314 */ 311 */
315 int is_incoming; 312 int is_incoming;
316 313
@@ -372,6 +369,9 @@ struct Set
372 /** 369 /**
373 * Virtual table for this set. 370 * Virtual table for this set.
374 * Determined by the operation type of this set. 371 * Determined by the operation type of this set.
372 *
373 * Used only for Add/remove of elements and when receiving an incoming
374 * operation from a remote peer.
375 */ 375 */
376 const struct SetVT *vt; 376 const struct SetVT *vt;
377 377
@@ -421,6 +421,13 @@ struct Set
421}; 421};
422 422
423 423
424/**
425 * Destroy the given operation. Call the implementation-specific cancel function
426 * of the operation. Disconnects from the remote peer.
427 * Does not disconnect the client, as there may be multiple operations per set.
428 *
429 * @param op operation to destroy
430 */
424void 431void
425_GSS_operation_destroy (struct Operation *op); 432_GSS_operation_destroy (struct Operation *op);
426 433
@@ -428,6 +435,8 @@ _GSS_operation_destroy (struct Operation *op);
428/** 435/**
429 * Get the table with implementing functions for 436 * Get the table with implementing functions for
430 * set union. 437 * set union.
438 *
439 * @return the operation specific VTable
431 */ 440 */
432const struct SetVT * 441const struct SetVT *
433_GSS_union_vt (void); 442_GSS_union_vt (void);
@@ -436,6 +445,8 @@ _GSS_union_vt (void);
436/** 445/**
437 * Get the table with implementing functions for 446 * Get the table with implementing functions for
438 * set intersection. 447 * set intersection.
448 *
449 * @return the operation specific VTable
439 */ 450 */
440const struct SetVT * 451const struct SetVT *
441_GSS_intersection_vt (void); 452_GSS_intersection_vt (void);