2 This file is part of GNUnet.
3 Copyright (C) 2016 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your 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 Affero General Public License for more details.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * @author Martin Schanzenbach
21 * @file reclaim/reclaim.h
23 * @brief Common type definitions for the identity provider
29 #include "gnunet_common.h"
32 GNUNET_NETWORK_STRUCT_BEGIN
35 * Use to store an identity attribute
37 struct AttributeStoreMessage
40 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
42 struct GNUNET_MessageHeader header;
45 * Unique identifier for this request (for key collisions).
47 uint32_t id GNUNET_PACKED;
50 * The length of the attribute
52 uint32_t attr_len GNUNET_PACKED;
55 * The expiration interval of the attribute
57 uint64_t exp GNUNET_PACKED;
62 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
64 /* followed by the serialized attribute */
69 * Attribute store response message
71 struct AttributeStoreResultMessage
76 struct GNUNET_MessageHeader header;
79 * Unique identifier for this request (for key collisions).
81 uint32_t id GNUNET_PACKED;
84 * #GNUNET_SYSERR on failure, #GNUNET_OK on success
86 int32_t op_result GNUNET_PACKED;
91 * Attribute is returned from the idp.
93 struct AttributeResultMessage
98 struct GNUNET_MessageHeader header;
101 * Unique identifier for this request (for key collisions).
103 uint32_t id GNUNET_PACKED;
106 * Length of serialized attribute data
108 uint16_t attr_len GNUNET_PACKED;
111 * always zero (for alignment)
113 uint16_t reserved GNUNET_PACKED;
116 * The public key of the identity.
118 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
121 * serialized attribute data
127 * Start a attribute iteration for the given identity
129 struct AttributeIterationStartMessage
134 struct GNUNET_MessageHeader header;
137 * Unique identifier for this request (for key collisions).
139 uint32_t id GNUNET_PACKED;
144 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
150 * Ask for next result of attribute iteration for the given operation
152 struct AttributeIterationNextMessage
155 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
157 struct GNUNET_MessageHeader header;
160 * Unique identifier for this request (for key collisions).
162 uint32_t id GNUNET_PACKED;
168 * Stop attribute iteration for the given operation
170 struct AttributeIterationStopMessage
173 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
175 struct GNUNET_MessageHeader header;
178 * Unique identifier for this request (for key collisions).
180 uint32_t id GNUNET_PACKED;
185 * Start a ticket iteration for the given identity
187 struct TicketIterationStartMessage
192 struct GNUNET_MessageHeader header;
195 * Unique identifier for this request (for key collisions).
197 uint32_t id GNUNET_PACKED;
202 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
205 * Identity is audience or issuer
207 uint32_t is_audience GNUNET_PACKED;
212 * Ask for next result of ticket iteration for the given operation
214 struct TicketIterationNextMessage
217 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
219 struct GNUNET_MessageHeader header;
222 * Unique identifier for this request (for key collisions).
224 uint32_t id GNUNET_PACKED;
230 * Stop ticket iteration for the given operation
232 struct TicketIterationStopMessage
235 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
237 struct GNUNET_MessageHeader header;
240 * Unique identifier for this request (for key collisions).
242 uint32_t id GNUNET_PACKED;
249 * Ticket issue message
251 struct IssueTicketMessage
254 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
256 struct GNUNET_MessageHeader header;
259 * Unique identifier for this request (for key collisions).
261 uint32_t id GNUNET_PACKED;
266 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
271 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
274 * length of serialized attribute list
276 uint32_t attr_len GNUNET_PACKED;
278 //Followed by a serialized attribute list
282 * Ticket revoke message
284 struct RevokeTicketMessage
287 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
289 struct GNUNET_MessageHeader header;
292 * Unique identifier for this request (for key collisions).
294 uint32_t id GNUNET_PACKED;
299 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
302 * length of serialized attribute list
304 uint32_t attrs_len GNUNET_PACKED;
306 //Followed by a ticket and serialized attribute list
310 * Ticket revoke message
312 struct RevokeTicketResultMessage
315 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
317 struct GNUNET_MessageHeader header;
320 * Unique identifier for this request (for key collisions).
322 uint32_t id GNUNET_PACKED;
327 uint32_t success GNUNET_PACKED;
332 * Ticket result message
334 struct TicketResultMessage
337 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
339 struct GNUNET_MessageHeader header;
342 * Unique identifier for this request (for key collisions).
344 uint32_t id GNUNET_PACKED;
349 * Ticket consume message
351 struct ConsumeTicketMessage
354 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
356 struct GNUNET_MessageHeader header;
359 * Unique identifier for this request (for key collisions).
361 uint32_t id GNUNET_PACKED;
366 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
368 //Followed by a serialized ticket
372 * Attribute list is returned from the idp.
374 struct ConsumeTicketResultMessage
379 struct GNUNET_MessageHeader header;
382 * Unique identifier for this request (for key collisions).
384 uint32_t id GNUNET_PACKED;
387 * Length of serialized attribute data
389 uint16_t attrs_len GNUNET_PACKED;
392 * always zero (for alignment)
394 uint16_t reserved GNUNET_PACKED;
397 * The public key of the identity.
399 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
402 * serialized attributes data
408 GNUNET_NETWORK_STRUCT_END