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;
97 * Type: GNUNET_MESSAGE_TYPE_SET_Request
99 struct GNUNET_MessageHeader header;
104 struct GNUNET_PeerIdentity peer_id;
107 * request id of the request we want to accept
109 uint32_t request_id GNUNET_PACKED;
111 /* rest: inner message */
115 struct EvaluateMessage
118 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE
120 struct GNUNET_MessageHeader header;
122 struct GNUNET_PeerIdentity other_peer;
124 struct GNUNET_HashCode app_id;
129 uint32_t request_id GNUNET_PACKED;
131 /* rest: inner message */
138 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT
140 struct GNUNET_MessageHeader header;
143 * id the result belongs to
145 uint32_t request_id GNUNET_PACKED;
147 uint16_t result_status GNUNET_PACKED;
149 uint16_t element_type GNUNET_PACKED;
151 /* rest: the actual element */
155 struct ElementMessage
158 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or
159 * GNUNET_MESSAGE_TYPE_SET_REMOVE
161 struct GNUNET_MessageHeader header;
163 uint16_t element_type GNUNET_PACKED;
165 /* rest: the actual element */
172 * Type: GNUNET_MESSAGE_TYPE_SET_CANCEL
174 struct GNUNET_MessageHeader header;
177 * id we want to cancel result belongs to
179 uint32_t request_id GNUNET_PACKED;
182 GNUNET_NETWORK_STRUCT_END