some fixmes

This commit is contained in:
Markus Teich 2016-05-27 13:56:03 +02:00
parent 7db11d76da
commit 7d25910885
2 changed files with 14 additions and 11 deletions

2
AUTHORS Normal file
View File

@ -0,0 +1,2 @@
Christian Grothoff <christian@grothoff.org>
Markus Teich <teichm@net.in.tum.de>

View File

@ -1,5 +1,5 @@
/* This file is part of libbrandt. /* This file is part of libbrandt.
* (C) 2016 Markus Teich * Copyright (C) 2016 GNUnet e.V.
* *
* libbrandt is free software: you can redistribute it and/or modify it under * libbrandt is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software * the terms of the GNU General Public License as published by the Free Software
@ -38,7 +38,7 @@ struct BRANDT_Auction;
* @param[in] msg The message to be broadcast to all participants of * @param[in] msg The message to be broadcast to all participants of
* @a auction_closure. * @a auction_closure.
* @param[in] msg_len The length of the message @a msg in bytes. * @param[in] msg_len The length of the message @a msg in bytes.
* @return 1 on success, 0 on failure. FIXME: unusual definition * @return 0 on success, -1 on failure.
*/ */
typedef int typedef int
(*BRANDT_BroadcastCallback) (void *auction_closure, (*BRANDT_BroadcastCallback) (void *auction_closure,
@ -56,7 +56,7 @@ typedef int
* auction. This is the Pointer given to BRANDT_join(). * auction. This is the Pointer given to BRANDT_join().
* @param[in] msg The message to be sent to the seller of @a auction_closure. * @param[in] msg The message to be sent to the seller of @a auction_closure.
* @param[in] msg_len The length of the message @a msg in bytes. * @param[in] msg_len The length of the message @a msg in bytes.
* @return 1 on success, 0 on failure. FIXME: unusual definition * @return 0 on success, -1 on failure.
*/ */
typedef int typedef int
(*BRANDT_UnicastSellerCallback) (void *auction_closure, (*BRANDT_UnicastSellerCallback) (void *auction_closure,
@ -66,23 +66,24 @@ typedef int
/** /**
* Functions of this type are called by libbrandt to report the auction outcome * Functions of this type are called by libbrandt to report the auction outcome
* to the user. * or malicious/erroneous participants.
* *
* TODO: update price type. Don't do this notification as a callback? * TODO: update price type.
* TODO: export proof of erroneous behaviour.
* *
* @param[in] auction_closure Closure pointer representing the respective * @param[in] auction_closure Closure pointer representing the respective
* auction. This is the Pointer given to BRANDT_join(). * auction. This is the Pointer given to BRANDT_join() / BRANDT_new().
* @param[in] won 1 if the user has won the auction, 0 otherwise. * @param[in] bidder_id The numeric Id of the bidder this report refers to.
* @param[in] status 1 if the user @a bidder_id has won the auction, 0 if he has
* lost, -1 if erroneous behaviour was detected.
* @param[in] price The price, the winner has to pay or 0 if the auction result * @param[in] price The price, the winner has to pay or 0 if the auction result
* is private and the user did not win. * is private and the user did not win.
*/ */
typedef void typedef void
(*BRANDT_ReportResultCallback) (void *auction_closure, (*BRANDT_ReportResultCallback) (void *auction_closure,
int won, unsigned int bidder_id,
int status,
uint16_t price); uint16_t price);
// FIXME: the above callback does not work for the seller,
// but seems to be used for the seller right now.
// FIXME: also need way to be told about malicious/erroneous participants
/** /**