diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-17 17:37:56 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-17 17:37:56 +0200 |
commit | ec43082b1adfa394184900d49f5fe816dba749ec (patch) | |
tree | 2c542044512484a9a29e15d1cfb9c3fef7129cb6 /brandt.h | |
parent | 6eb35ae72f4e579bd094f630b6b9d3d042432ae3 (diff) | |
download | libbrandt-ec43082b1adfa394184900d49f5fe816dba749ec.tar.gz libbrandt-ec43082b1adfa394184900d49f5fe816dba749ec.zip |
add start callback and further basic tests
Diffstat (limited to 'brandt.h')
-rw-r--r-- | brandt.h | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -31,6 +31,22 @@ | |||
31 | /** defined in internals.h */ | 31 | /** defined in internals.h */ |
32 | struct BRANDT_Auction; | 32 | struct 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 | */ | ||
46 | typedef 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 | */ |
137 | struct BRANDT_Auction * | 153 | struct BRANDT_Auction * |
138 | BRANDT_join (BRANDT_CbBroadcast broadcast, | 154 | BRANDT_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 | */ |
184 | struct BRANDT_Auction * | 200 | struct BRANDT_Auction * |
185 | BRANDT_new (BRANDT_CbBroadcast broadcast, | 201 | BRANDT_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, |