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
38 * Use to store an identity attribute
40 struct AttributeStoreMessage
43 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
45 struct GNUNET_MessageHeader header;
48 * Unique identifier for this request (for key collisions).
50 uint32_t id GNUNET_PACKED;
53 * The length of the attribute
55 uint32_t attr_len GNUNET_PACKED;
58 * The expiration interval of the attribute
60 uint64_t exp GNUNET_PACKED;
65 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
67 /* followed by the serialized attribute */
72 * Use to delete an identity attribute
74 struct AttributeDeleteMessage
77 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
79 struct GNUNET_MessageHeader header;
82 * Unique identifier for this request (for key collisions).
84 uint32_t id GNUNET_PACKED;
87 * The length of the attribute
89 uint32_t attr_len GNUNET_PACKED;
94 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
96 /* followed by the serialized attribute */
101 * Attribute store/delete response message
103 struct SuccessResultMessage
108 struct GNUNET_MessageHeader header;
111 * Unique identifier for this request (for key collisions).
113 uint32_t id GNUNET_PACKED;
116 * #GNUNET_SYSERR on failure, #GNUNET_OK on success
118 int32_t op_result GNUNET_PACKED;
122 * Attribute is returned from the idp.
124 struct AttributeResultMessage
129 struct GNUNET_MessageHeader header;
132 * Unique identifier for this request (for key collisions).
134 uint32_t id GNUNET_PACKED;
137 * Length of serialized attribute data
139 uint16_t attr_len GNUNET_PACKED;
142 * always zero (for alignment)
144 uint16_t reserved GNUNET_PACKED;
147 * The public key of the identity.
149 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
152 * serialized attribute data
158 * Start a attribute iteration for the given identity
160 struct AttributeIterationStartMessage
165 struct GNUNET_MessageHeader header;
168 * Unique identifier for this request (for key collisions).
170 uint32_t id GNUNET_PACKED;
175 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
180 * Ask for next result of attribute iteration for the given operation
182 struct AttributeIterationNextMessage
185 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
187 struct GNUNET_MessageHeader header;
190 * Unique identifier for this request (for key collisions).
192 uint32_t id GNUNET_PACKED;
197 * Stop attribute iteration for the given operation
199 struct AttributeIterationStopMessage
202 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
204 struct GNUNET_MessageHeader header;
207 * Unique identifier for this request (for key collisions).
209 uint32_t id GNUNET_PACKED;
213 * Start a ticket iteration for the given identity
215 struct TicketIterationStartMessage
220 struct GNUNET_MessageHeader header;
223 * Unique identifier for this request (for key collisions).
225 uint32_t id GNUNET_PACKED;
230 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
235 * Ask for next result of ticket iteration for the given operation
237 struct TicketIterationNextMessage
240 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
242 struct GNUNET_MessageHeader header;
245 * Unique identifier for this request (for key collisions).
247 uint32_t id GNUNET_PACKED;
252 * Stop ticket iteration for the given operation
254 struct TicketIterationStopMessage
257 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
259 struct GNUNET_MessageHeader header;
262 * Unique identifier for this request (for key collisions).
264 uint32_t id GNUNET_PACKED;
269 * Ticket issue message
271 struct IssueTicketMessage
274 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
276 struct GNUNET_MessageHeader header;
279 * Unique identifier for this request (for key collisions).
281 uint32_t id GNUNET_PACKED;
286 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
291 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
294 * length of serialized attribute list
296 uint32_t attr_len GNUNET_PACKED;
298 // Followed by a serialized attribute list
302 * Ticket revoke message
304 struct RevokeTicketMessage
307 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
309 struct GNUNET_MessageHeader header;
312 * Unique identifier for this request (for key collisions).
314 uint32_t id GNUNET_PACKED;
319 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
322 * length of serialized attribute list
324 uint32_t attrs_len GNUNET_PACKED;
326 // Followed by a ticket and serialized attribute list
330 * Ticket revoke message
332 struct RevokeTicketResultMessage
335 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
337 struct GNUNET_MessageHeader header;
340 * Unique identifier for this request (for key collisions).
342 uint32_t id GNUNET_PACKED;
347 uint32_t success GNUNET_PACKED;
352 * Ticket result message
354 struct TicketResultMessage
357 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
359 struct GNUNET_MessageHeader header;
362 * Unique identifier for this request (for key collisions).
364 uint32_t id GNUNET_PACKED;
368 * Ticket consume message
370 struct ConsumeTicketMessage
373 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
375 struct GNUNET_MessageHeader header;
378 * Unique identifier for this request (for key collisions).
380 uint32_t id GNUNET_PACKED;
385 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
387 // Followed by a serialized ticket
391 * Attribute list is returned from the idp.
393 struct ConsumeTicketResultMessage
398 struct GNUNET_MessageHeader header;
401 * Unique identifier for this request (for key collisions).
403 uint32_t id GNUNET_PACKED;
408 uint32_t result GNUNET_PACKED;
411 * Length of serialized attribute data
413 uint16_t attrs_len GNUNET_PACKED;
416 * always zero (for alignment)
418 uint16_t reserved GNUNET_PACKED;
421 * The public key of the identity.
423 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
426 * serialized attributes data
431 GNUNET_NETWORK_STRUCT_END