summaryrefslogtreecommitdiff
path: root/brandt.h
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-08-17 17:37:56 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-08-17 17:37:56 +0200
commitec43082b1adfa394184900d49f5fe816dba749ec (patch)
tree2c542044512484a9a29e15d1cfb9c3fef7129cb6 /brandt.h
parent6eb35ae72f4e579bd094f630b6b9d3d042432ae3 (diff)
add start callback and further basic tests
Diffstat (limited to 'brandt.h')
-rw-r--r--brandt.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/brandt.h b/brandt.h
index dad324a..1903301 100644
--- a/brandt.h
+++ b/brandt.h
@@ -31,6 +31,22 @@
/** defined in internals.h */
struct BRANDT_Auction;
+
+/**
+ * Functions of this type are called by libbrandt when the auction should be
+ * started. The application has to announce the ordered list of all bidders to
+ * them and must return the amount of bidders. After this function is called no
+ * more new bidders may be accepted by the application. This callback is only
+ * used if the auction is in seller mode.
+ *
+ * @param[in] auction_closure Closure pointer representing the respective
+ * auction. This is the Pointer given to BRANDT_new().
+ * @return The amount of bidders participating in the auction.
+ */
+typedef uint16_t
+(*BRANDT_CbStart)(void *auction_closure);
+
+
/**
* Functions of this type are called by libbrandt to broadcast messages to the
* blackboard of a specific auction. They have to be sent using authenticated
@@ -70,7 +86,7 @@ typedef int
* Functions of this type are called by libbrandt to report the auction outcome
* or malicious/erroneous participants.
*
- * \todo: export proof of erroneous behaviour.
+ * \todo: export proof of erroneous behaviour / outcome.
*
* @param[in] auction_closure Closure pointer representing the respective
* auction. This is the Pointer given to BRANDT_join() / BRANDT_new().
@@ -135,9 +151,9 @@ BRANDT_verify_desc (const void *auction_desc,
* black-box pointer, do NOT dereference/change it or the data it points to!
*/
struct BRANDT_Auction *
-BRANDT_join (BRANDT_CbBroadcast broadcast,
+BRANDT_join (BRANDT_CbResult result,
+ BRANDT_CbBroadcast broadcast,
BRANDT_CbUnicast unicast,
- BRANDT_CbResult result,
void *auction_closure,
const void *auction_desc,
size_t auction_desc_len,
@@ -182,8 +198,9 @@ BRANDT_join (BRANDT_CbBroadcast broadcast,
* black-box pointer, do NOT dereference/change it or the data it points to!
*/
struct BRANDT_Auction *
-BRANDT_new (BRANDT_CbBroadcast broadcast,
- BRANDT_CbResult result,
+BRANDT_new (BRANDT_CbResult result,
+ BRANDT_CbBroadcast broadcast,
+ BRANDT_CbStart start,
void *auction_closure,
void **auction_desc,
size_t *auction_desc_len,