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 that will be sent along with
84 * results for the accepted operation.
85 * Chosen by the client.
86 * Must be 0 if the request has been rejected.
88 uint32_t request_id GNUNET_PACKED;
91 * ID of the incoming request we want to accept / reject.
93 uint32_t accept_id GNUNET_PACKED;
98 * A request for an operation with another client.
100 struct RequestMessage
103 * Type: GNUNET_MESSAGE_TYPE_SET_Request.
105 struct GNUNET_MessageHeader header;
108 * Identity of the requesting peer.
110 struct GNUNET_PeerIdentity peer_id;
113 * ID of the request we want to accept,
114 * chosen by the service.
116 uint32_t accept_id GNUNET_PACKED;
118 /* rest: nested context message */
122 struct EvaluateMessage
125 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE
127 struct GNUNET_MessageHeader header;
130 * Peer to evaluate the operation with
132 struct GNUNET_PeerIdentity peer;
137 struct GNUNET_HashCode app_id;
140 * id of our evaluate, chosen by the client
142 uint32_t request_id GNUNET_PACKED;
145 * Salt to use for the operation
147 uint16_t salt GNUNET_PACKED;
152 uint16_t reserved GNUNET_PACKED;
154 /* rest: inner message */
161 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT
163 struct GNUNET_MessageHeader header;
166 * id the result belongs to
168 uint32_t request_id GNUNET_PACKED;
171 * Was the evaluation successful?
173 uint16_t result_status GNUNET_PACKED;
176 * Type of the element attachted to the message,
179 uint16_t element_type GNUNET_PACKED;
181 /* rest: the actual element */
185 struct ElementMessage
188 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or
189 * GNUNET_MESSAGE_TYPE_SET_REMOVE
191 struct GNUNET_MessageHeader header;
193 uint16_t element_type GNUNET_PACKED;
195 uint16_t reserved GNUNET_PACKED;
197 /* rest: the actual element */
204 * Type: GNUNET_MESSAGE_TYPE_SET_CANCEL
206 struct GNUNET_MessageHeader header;
209 * id we want to cancel result belongs to
211 uint32_t request_id GNUNET_PACKED;
215 GNUNET_NETWORK_STRUCT_END