2 This file is part of GNUnet.
3 (C) 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @author Florian Dold
23 * @file consensus/consensus.h
29 #include "gnunet_common.h"
33 * The service sends up to GNUNET_SET_ACK_WINDOW messages per client handle,
34 * the client should send an ack every GNUNET_SET_ACK_WINDOW/2 messages.
36 #define GNUNET_SET_ACK_WINDOW 8
39 GNUNET_NETWORK_STRUCT_BEGIN
41 struct SetCreateMessage
44 * Type: GNUNET_MESSAGE_TYPE_SET_CREATE
46 struct GNUNET_MessageHeader header;
49 * Operation type, values of enum GNUNET_SET_OperationType
51 uint16_t operation GNUNET_PACKED;
58 * Type: GNUNET_MESSAGE_TYPE_SET_LISTEN
60 struct GNUNET_MessageHeader header;
65 struct GNUNET_HashCode app_id;
68 * Operation type, values of enum GNUNET_SET_OperationType
70 uint16_t operation GNUNET_PACKED;
73 * Operation type, values of enum GNUNET_SET_OperationType
75 uint16_t op GNUNET_PACKED;
83 * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT
85 struct GNUNET_MessageHeader header;
88 * request id of the request we want to accept
90 uint32_t request_id GNUNET_PACKED;
93 struct GNUNET_TIME_RelativeNBO timeout;
100 * Type: GNUNET_MESSAGE_TYPE_SET_Request
102 struct GNUNET_MessageHeader header;
107 struct GNUNET_PeerIdentity peer_id;
110 * request id of the request we want to accept
112 uint32_t request_id GNUNET_PACKED;
114 /* rest: inner message */
118 struct EvaluateMessage
121 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE
123 struct GNUNET_MessageHeader header;
125 struct GNUNET_PeerIdentity other_peer;
127 struct GNUNET_HashCode app_id;
129 struct GNUNET_TIME_RelativeNBO timeout;
134 uint32_t request_id GNUNET_PACKED;
136 /* rest: inner message */
143 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT
145 struct GNUNET_MessageHeader header;
148 * id the result belongs to
150 uint32_t request_id GNUNET_PACKED;
152 uint16_t result_status GNUNET_PACKED;
154 uint16_t element_type GNUNET_PACKED;
156 /* rest: the actual element */
160 struct ElementMessage
163 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or
164 * GNUNET_MESSAGE_TYPE_SET_REMOVE
166 struct GNUNET_MessageHeader header;
168 uint16_t element_type GNUNET_PACKED;
170 /* rest: the actual element */
177 * Type: GNUNET_MESSAGE_TYPE_SET_CANCEL
179 struct GNUNET_MessageHeader header;
182 * id we want to cancel result belongs to
184 uint32_t request_id GNUNET_PACKED;
187 GNUNET_NETWORK_STRUCT_END