aboutsummaryrefslogtreecommitdiff
path: root/internals.h
diff options
context:
space:
mode:
Diffstat (limited to 'internals.h')
-rw-r--r--internals.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/internals.h b/internals.h
index ce67934..acb4845 100644
--- a/internals.h
+++ b/internals.h
@@ -29,6 +29,7 @@
enum rounds {
+ msg_join,
msg_init,
msg_bid,
msg_outcome,
@@ -51,33 +52,55 @@ enum outcome_type {
};
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* This struct describes an auction and has to be followed by #description_len
* bytes of arbitrary data where the description of the item to be sold is
- * stored.
+ * stored. All fields are stored in network byte order.
*
* \todo: align to a multiple of 64bit */
struct BRANDT_DescrP {
+ /** Starting time of the auction. Bidders have to join the auction via
+ * BRANDT_join until this time */
+ struct GNUNET_TIME_AbsoluteNBO time_start;
+
+ /** The maximum duration the participants have to complete each round. */
+ struct GNUNET_TIME_RelativeNBO time_round;
+
/** The length of the description in bytes directly following this struct */
- uint32_t description_len;
+ uint32_t description_len GNUNET_PACKED;
+
+ /** The amount of possible prices */
+ uint16_t k GNUNET_PACKED;
/** Auction type. 0 means first price Auction, >= 0 means M+1st price
* auction with an amount of m items being sold. */
- uint16_t m;
+ uint16_t m GNUNET_PACKED;
/** Outcome type. 0 means private outcome, everything else means public
* outcome. */
- uint16_t outcome_public;
-
- /** The amount of possible prices */
- uint16_t price_range;
-
- /** \todo: time */
+ uint16_t outcome_public GNUNET_PACKED;
};
+GNUNET_NETWORK_STRUCT_END
+
struct BRANDT_Auction {
- struct BRANDT_DescrP *desc; /** pointer to the auction information */
+ /** Starting time of the auction. Bidders have to join the auction via
+ * BRANDT_join until this time */
+ struct GNUNET_TIME_Absolute time_start;
+
+ /** The maximum duration the participants have to complete each round. */
+ struct GNUNET_TIME_Relative time_round;
+
+ /** Auction type. 0 means first price Auction, >= 0 means M+1st price
+ * auction with an amount of m items being sold. */
+ uint16_t m;
+
+ /** Outcome type. 0 means private outcome, everything else means public
+ * outcome. */
+ uint16_t outcome_public;
void *closure; /** auction closure given by the user */