aboutsummaryrefslogtreecommitdiff
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)
downloadlibbrandt-ec43082b1adfa394184900d49f5fe816dba749ec.tar.gz
libbrandt-ec43082b1adfa394184900d49f5fe816dba749ec.zip
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 @@
31/** defined in internals.h */ 31/** defined in internals.h */
32struct BRANDT_Auction; 32struct BRANDT_Auction;
33 33
34
35/**
36 * Functions of this type are called by libbrandt when the auction should be
37 * started. The application has to announce the ordered list of all bidders to
38 * them and must return the amount of bidders. After this function is called no
39 * more new bidders may be accepted by the application. This callback is only
40 * used if the auction is in seller mode.
41 *
42 * @param[in] auction_closure Closure pointer representing the respective
43 * auction. This is the Pointer given to BRANDT_new().
44 * @return The amount of bidders participating in the auction.
45 */
46typedef uint16_t
47(*BRANDT_CbStart)(void *auction_closure);
48
49
34/** 50/**
35 * Functions of this type are called by libbrandt to broadcast messages to the 51 * Functions of this type are called by libbrandt to broadcast messages to the
36 * blackboard of a specific auction. They have to be sent using authenticated 52 * blackboard of a specific auction. They have to be sent using authenticated
@@ -70,7 +86,7 @@ typedef int
70 * Functions of this type are called by libbrandt to report the auction outcome 86 * Functions of this type are called by libbrandt to report the auction outcome
71 * or malicious/erroneous participants. 87 * or malicious/erroneous participants.
72 * 88 *
73 * \todo: export proof of erroneous behaviour. 89 * \todo: export proof of erroneous behaviour / outcome.
74 * 90 *
75 * @param[in] auction_closure Closure pointer representing the respective 91 * @param[in] auction_closure Closure pointer representing the respective
76 * auction. This is the Pointer given to BRANDT_join() / BRANDT_new(). 92 * auction. This is the Pointer given to BRANDT_join() / BRANDT_new().
@@ -135,9 +151,9 @@ BRANDT_verify_desc (const void *auction_desc,
135 * black-box pointer, do NOT dereference/change it or the data it points to! 151 * black-box pointer, do NOT dereference/change it or the data it points to!
136 */ 152 */
137struct BRANDT_Auction * 153struct BRANDT_Auction *
138BRANDT_join (BRANDT_CbBroadcast broadcast, 154BRANDT_join (BRANDT_CbResult result,
155 BRANDT_CbBroadcast broadcast,
139 BRANDT_CbUnicast unicast, 156 BRANDT_CbUnicast unicast,
140 BRANDT_CbResult result,
141 void *auction_closure, 157 void *auction_closure,
142 const void *auction_desc, 158 const void *auction_desc,
143 size_t auction_desc_len, 159 size_t auction_desc_len,
@@ -182,8 +198,9 @@ BRANDT_join (BRANDT_CbBroadcast broadcast,
182 * black-box pointer, do NOT dereference/change it or the data it points to! 198 * black-box pointer, do NOT dereference/change it or the data it points to!
183 */ 199 */
184struct BRANDT_Auction * 200struct BRANDT_Auction *
185BRANDT_new (BRANDT_CbBroadcast broadcast, 201BRANDT_new (BRANDT_CbResult result,
186 BRANDT_CbResult result, 202 BRANDT_CbBroadcast broadcast,
203 BRANDT_CbStart start,
187 void *auction_closure, 204 void *auction_closure,
188 void **auction_desc, 205 void **auction_desc,
189 size_t *auction_desc_len, 206 size_t *auction_desc_len,