X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fconsensus%2Fconsensus.h;h=f1049e1cd20c7c4c11da081bf8a5978ce0a48a34;hb=dd640f62b529261629b19a3c972ebea36e90b5ee;hp=3f1efe3401b8f5871aad3e1049828caf828c6241;hpb=6b1559589726297aa372048b4e388d2e1473a6f6;p=oweals%2Fgnunet.git diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 3f1efe340..f1049e1cd 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -4,7 +4,7 @@ GNUnet 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 Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but @@ -23,13 +23,17 @@ * @file consensus/consensus.h * @brief */ -#ifndef NSE_H -#define NSE_H +#ifndef CONSENSUS_H +#define CONSENSUS_H #include "gnunet_common.h" GNUNET_NETWORK_STRUCT_BEGIN +/** + * Sent by the client to the service, + * when the client wants the service to join a consensus session. + */ struct GNUNET_CONSENSUS_JoinMessage { /** @@ -37,9 +41,9 @@ struct GNUNET_CONSENSUS_JoinMessage */ struct GNUNET_MessageHeader header; - struct GNUNET_HashCode session_id; + uint32_t num_peers GNUNET_PACKED; - uint16_t num_peers; + struct GNUNET_HashCode session_id; /* GNUNET_PeerIdentity[num_peers] */ }; @@ -52,20 +56,12 @@ struct GNUNET_CONSENSUS_ConcludeMessage */ struct GNUNET_MessageHeader header; - struct GNUNET_TIME_RelativeNBO timeout; -}; + // uint32_t reserved GNUNET_PACKED; // FIXME... - -struct GNUNET_CONSENSUS_ConcludeDoneMessage -{ /** - * Type: GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE_DONE + * Timeout for conclude */ - struct GNUNET_MessageHeader header; - - uint16_t num_peers; - - /** PeerIdentity[num_peers] */ + struct GNUNET_TIME_RelativeNBO timeout; }; @@ -85,11 +81,26 @@ struct GNUNET_CONSENSUS_ElementMessage /** * Type: GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_NEW_ELEMENT */ - uint16_t element_type; + uint16_t element_type GNUNET_PACKED; /* FIXME: alignment? => uint32_t */ /* rest: element data */ }; +struct GNUNET_CONSENSUS_AckMessage +{ + /** + * Type: GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_ACK + */ + struct GNUNET_MessageHeader header; + + /** + * Do we want to keep and propagate the element? + */ + uint8_t keep; /* FIXME: alignment!? => (u)int32_t */ + + /* FIXME: add message hash? */ +}; + GNUNET_NETWORK_STRUCT_END #endif