2 This file is part of GNUnet.
3 (C) 2012, 2013 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"
32 #define GNUNET_SET_ACK_WINDOW 10
35 GNUNET_NETWORK_STRUCT_BEGIN
37 struct GNUNET_SET_CreateMessage
40 * Type: GNUNET_MESSAGE_TYPE_SET_CREATE
42 struct GNUNET_MessageHeader header;
45 * Operation type, values of enum GNUNET_SET_OperationType
47 // FIXME: use 32_t for 'enum'.
48 uint16_t operation GNUNET_PACKED;
52 struct GNUNET_SET_ListenMessage
55 * Type: GNUNET_MESSAGE_TYPE_SET_LISTEN
57 struct GNUNET_MessageHeader header;
60 * Operation type, values of enum GNUNET_SET_OperationType
62 uint16_t operation GNUNET_PACKED;
67 struct GNUNET_HashCode app_id;
72 struct GNUNET_SET_AcceptRejectMessage
75 * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT or
76 * GNUNET_MESSAGE_TYPE_SET_REJECT
78 struct GNUNET_MessageHeader header;
81 * ID of the incoming request we want to accept / reject.
83 uint32_t accept_reject_id GNUNET_PACKED;
86 * Request ID to identify responses,
87 * must be 0 if we don't accept the request.
89 uint32_t request_id GNUNET_PACKED;
94 * A request for an operation with another client.
96 struct GNUNET_SET_RequestMessage
99 * Type: GNUNET_MESSAGE_TYPE_SET_Request.
101 struct GNUNET_MessageHeader header;
104 * Identity of the requesting peer.
106 struct GNUNET_PeerIdentity peer_id;
109 * ID of the to identify the request when accepting or
112 uint32_t accept_id GNUNET_PACKED;
114 /* rest: nested context message */
118 struct GNUNET_SET_EvaluateMessage
121 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE
123 struct GNUNET_MessageHeader header;
126 * id of our evaluate, chosen by the client
128 uint32_t request_id GNUNET_PACKED;
131 * Peer to evaluate the operation with
133 struct GNUNET_PeerIdentity target_peer;
138 struct GNUNET_HashCode app_id;
141 * Salt to use for the operation
143 uint16_t salt GNUNET_PACKED;
148 uint16_t reserved GNUNET_PACKED;
150 /* rest: inner message */
154 struct GNUNET_SET_ResultMessage
157 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT
159 struct GNUNET_MessageHeader header;
162 * id the result belongs to
164 uint32_t request_id GNUNET_PACKED;
167 * Was the evaluation successful?
169 uint16_t result_status GNUNET_PACKED;
172 * Type of the element attachted to the message,
175 uint16_t element_type GNUNET_PACKED;
177 /* rest: the actual element */
181 struct GNUNET_SET_ElementMessage
184 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or
185 * GNUNET_MESSAGE_TYPE_SET_REMOVE
187 struct GNUNET_MessageHeader header;
189 uint16_t element_type GNUNET_PACKED;
191 uint16_t reserved GNUNET_PACKED;
193 /* rest: the actual element */
197 GNUNET_NETWORK_STRUCT_END