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
24 * @brief messages used for the set api
30 #include "gnunet_common.h"
34 * The service sends up to GNUNET_SET_ACK_WINDOW messages per client handle,
35 * the client should send an ack every GNUNET_SET_ACK_WINDOW/2 messages.
37 #define GNUNET_SET_ACK_WINDOW 8
40 GNUNET_NETWORK_STRUCT_BEGIN
42 struct SetCreateMessage
45 * Type: GNUNET_MESSAGE_TYPE_SET_CREATE
47 struct GNUNET_MessageHeader header;
50 * Operation type, values of enum GNUNET_SET_OperationType
52 uint16_t operation GNUNET_PACKED;
59 * Type: GNUNET_MESSAGE_TYPE_SET_LISTEN
61 struct GNUNET_MessageHeader header;
66 struct GNUNET_HashCode app_id;
69 * Operation type, values of enum GNUNET_SET_OperationType
71 uint16_t operation GNUNET_PACKED;
78 * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT
80 struct GNUNET_MessageHeader header;
83 * request id of the request we want to accept
85 uint32_t request_id GNUNET_PACKED;
88 * Zero if the client has rejected the request,
89 * non-zero if it has accepted it
91 uint32_t accepted GNUNET_PACKED;
98 * Type: GNUNET_MESSAGE_TYPE_SET_Request
100 struct GNUNET_MessageHeader header;
105 struct GNUNET_PeerIdentity peer_id;
108 * request id of the request we want to accept
110 uint32_t request_id GNUNET_PACKED;
112 /* rest: inner message */
116 struct EvaluateMessage
119 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE
121 struct GNUNET_MessageHeader header;
124 * Peer to evaluate the operation with
126 struct GNUNET_PeerIdentity peer;
131 struct GNUNET_HashCode app_id;
136 uint32_t request_id GNUNET_PACKED;
139 * Salt to use for the operation
141 uint16_t salt GNUNET_PACKED;
146 uint16_t reserved GNUNET_PACKED;
148 /* rest: inner message */
155 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT
157 struct GNUNET_MessageHeader header;
160 * id the result belongs to
162 uint32_t request_id GNUNET_PACKED;
165 * Was the evaluation successful?
167 uint16_t result_status GNUNET_PACKED;
170 * Type of the element attachted to the message,
173 uint16_t element_type GNUNET_PACKED;
175 /* rest: the actual element */
179 struct ElementMessage
182 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or
183 * GNUNET_MESSAGE_TYPE_SET_REMOVE
185 struct GNUNET_MessageHeader header;
187 uint16_t element_type GNUNET_PACKED;
189 /* rest: the actual element */
196 * Type: GNUNET_MESSAGE_TYPE_SET_CANCEL
198 struct GNUNET_MessageHeader header;
201 * id we want to cancel result belongs to
203 uint32_t request_id GNUNET_PACKED;
207 GNUNET_NETWORK_STRUCT_END