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/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
22 * @author Martin Schanzenbach
23 * @file reclaim/reclaim.h
25 * @brief Common type definitions for the identity provider
31 #include "gnunet_common.h"
34 GNUNET_NETWORK_STRUCT_BEGIN
37 * Use to store an identity attribute
39 struct AttributeStoreMessage
42 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
44 struct GNUNET_MessageHeader header;
47 * Unique identifier for this request (for key collisions).
49 uint32_t id GNUNET_PACKED;
52 * The length of the attribute
54 uint32_t attr_len GNUNET_PACKED;
57 * The expiration interval of the attribute
59 uint64_t exp GNUNET_PACKED;
64 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
66 /* followed by the serialized attribute */
71 * Attribute store response message
73 struct AttributeStoreResultMessage
78 struct GNUNET_MessageHeader header;
81 * Unique identifier for this request (for key collisions).
83 uint32_t id GNUNET_PACKED;
86 * #GNUNET_SYSERR on failure, #GNUNET_OK on success
88 int32_t op_result GNUNET_PACKED;
93 * Attribute is returned from the idp.
95 struct AttributeResultMessage
100 struct GNUNET_MessageHeader header;
103 * Unique identifier for this request (for key collisions).
105 uint32_t id GNUNET_PACKED;
108 * Length of serialized attribute data
110 uint16_t attr_len GNUNET_PACKED;
113 * always zero (for alignment)
115 uint16_t reserved GNUNET_PACKED;
118 * The public key of the identity.
120 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
123 * serialized attribute data
129 * Start a attribute iteration for the given identity
131 struct AttributeIterationStartMessage
136 struct GNUNET_MessageHeader header;
139 * Unique identifier for this request (for key collisions).
141 uint32_t id GNUNET_PACKED;
146 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
152 * Ask for next result of attribute iteration for the given operation
154 struct AttributeIterationNextMessage
157 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
159 struct GNUNET_MessageHeader header;
162 * Unique identifier for this request (for key collisions).
164 uint32_t id GNUNET_PACKED;
170 * Stop attribute iteration for the given operation
172 struct AttributeIterationStopMessage
175 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
177 struct GNUNET_MessageHeader header;
180 * Unique identifier for this request (for key collisions).
182 uint32_t id GNUNET_PACKED;
187 * Start a ticket iteration for the given identity
189 struct TicketIterationStartMessage
194 struct GNUNET_MessageHeader header;
197 * Unique identifier for this request (for key collisions).
199 uint32_t id GNUNET_PACKED;
204 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
210 * Ask for next result of ticket iteration for the given operation
212 struct TicketIterationNextMessage
215 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
217 struct GNUNET_MessageHeader header;
220 * Unique identifier for this request (for key collisions).
222 uint32_t id GNUNET_PACKED;
228 * Stop ticket iteration for the given operation
230 struct TicketIterationStopMessage
233 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
235 struct GNUNET_MessageHeader header;
238 * Unique identifier for this request (for key collisions).
240 uint32_t id GNUNET_PACKED;
247 * Ticket issue message
249 struct IssueTicketMessage
252 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
254 struct GNUNET_MessageHeader header;
257 * Unique identifier for this request (for key collisions).
259 uint32_t id GNUNET_PACKED;
264 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
269 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
272 * length of serialized attribute list
274 uint32_t attr_len GNUNET_PACKED;
276 //Followed by a serialized attribute list
280 * Ticket revoke message
282 struct RevokeTicketMessage
285 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
287 struct GNUNET_MessageHeader header;
290 * Unique identifier for this request (for key collisions).
292 uint32_t id GNUNET_PACKED;
297 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
300 * length of serialized attribute list
302 uint32_t attrs_len GNUNET_PACKED;
304 //Followed by a ticket and serialized attribute list
308 * Ticket revoke message
310 struct RevokeTicketResultMessage
313 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
315 struct GNUNET_MessageHeader header;
318 * Unique identifier for this request (for key collisions).
320 uint32_t id GNUNET_PACKED;
325 uint32_t success GNUNET_PACKED;
330 * Ticket result message
332 struct TicketResultMessage
335 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
337 struct GNUNET_MessageHeader header;
340 * Unique identifier for this request (for key collisions).
342 uint32_t id GNUNET_PACKED;
347 * Ticket consume message
349 struct ConsumeTicketMessage
352 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
354 struct GNUNET_MessageHeader header;
357 * Unique identifier for this request (for key collisions).
359 uint32_t id GNUNET_PACKED;
364 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
366 //Followed by a serialized ticket
370 * Attribute list is returned from the idp.
372 struct ConsumeTicketResultMessage
377 struct GNUNET_MessageHeader header;
380 * Unique identifier for this request (for key collisions).
382 uint32_t id GNUNET_PACKED;
387 uint32_t result GNUNET_PACKED;
390 * Length of serialized attribute data
392 uint16_t attrs_len GNUNET_PACKED;
395 * always zero (for alignment)
397 uint16_t reserved GNUNET_PACKED;
400 * The public key of the identity.
402 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
405 * serialized attributes data
411 GNUNET_NETWORK_STRUCT_END