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 {
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 * Use to delete an identity attribute
73 struct AttributeDeleteMessage {
75 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
77 struct GNUNET_MessageHeader header;
80 * Unique identifier for this request (for key collisions).
82 uint32_t id GNUNET_PACKED;
85 * The length of the attribute
87 uint32_t attr_len GNUNET_PACKED;
92 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
94 /* followed by the serialized attribute */
99 * Attribute store/delete response message
101 struct SuccessResultMessage {
105 struct GNUNET_MessageHeader header;
108 * Unique identifier for this request (for key collisions).
110 uint32_t id GNUNET_PACKED;
113 * #GNUNET_SYSERR on failure, #GNUNET_OK on success
115 int32_t op_result GNUNET_PACKED;
119 * Attribute is returned from the idp.
121 struct AttributeResultMessage {
125 struct GNUNET_MessageHeader header;
128 * Unique identifier for this request (for key collisions).
130 uint32_t id GNUNET_PACKED;
133 * Length of serialized attribute data
135 uint16_t attr_len GNUNET_PACKED;
138 * always zero (for alignment)
140 uint16_t reserved GNUNET_PACKED;
143 * The public key of the identity.
145 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
148 * serialized attribute data
154 * Start a attribute iteration for the given identity
156 struct AttributeIterationStartMessage {
160 struct GNUNET_MessageHeader header;
163 * Unique identifier for this request (for key collisions).
165 uint32_t id GNUNET_PACKED;
170 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
175 * Ask for next result of attribute iteration for the given operation
177 struct AttributeIterationNextMessage {
179 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
181 struct GNUNET_MessageHeader header;
184 * Unique identifier for this request (for key collisions).
186 uint32_t id GNUNET_PACKED;
191 * Stop attribute iteration for the given operation
193 struct AttributeIterationStopMessage {
195 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
197 struct GNUNET_MessageHeader header;
200 * Unique identifier for this request (for key collisions).
202 uint32_t id GNUNET_PACKED;
206 * Start a ticket iteration for the given identity
208 struct TicketIterationStartMessage {
212 struct GNUNET_MessageHeader header;
215 * Unique identifier for this request (for key collisions).
217 uint32_t id GNUNET_PACKED;
222 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
227 * Ask for next result of ticket iteration for the given operation
229 struct TicketIterationNextMessage {
231 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
233 struct GNUNET_MessageHeader header;
236 * Unique identifier for this request (for key collisions).
238 uint32_t id GNUNET_PACKED;
243 * Stop ticket iteration for the given operation
245 struct TicketIterationStopMessage {
247 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
249 struct GNUNET_MessageHeader header;
252 * Unique identifier for this request (for key collisions).
254 uint32_t id GNUNET_PACKED;
259 * Ticket issue message
261 struct IssueTicketMessage {
263 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
265 struct GNUNET_MessageHeader header;
268 * Unique identifier for this request (for key collisions).
270 uint32_t id GNUNET_PACKED;
275 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
280 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
283 * length of serialized attribute list
285 uint32_t attr_len GNUNET_PACKED;
287 // Followed by a serialized attribute list
291 * Ticket revoke message
293 struct RevokeTicketMessage {
295 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
297 struct GNUNET_MessageHeader header;
300 * Unique identifier for this request (for key collisions).
302 uint32_t id GNUNET_PACKED;
307 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
310 * length of serialized attribute list
312 uint32_t attrs_len GNUNET_PACKED;
315 * The ticket to revoke
317 struct GNUNET_RECLAIM_Ticket ticket;
321 * Ticket revoke message
323 struct RevokeTicketResultMessage {
325 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
327 struct GNUNET_MessageHeader header;
330 * Unique identifier for this request (for key collisions).
332 uint32_t id GNUNET_PACKED;
337 uint32_t success GNUNET_PACKED;
342 * Ticket result message
344 struct TicketResultMessage {
346 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
348 struct GNUNET_MessageHeader header;
351 * Unique identifier for this request (for key collisions).
353 uint32_t id GNUNET_PACKED;
358 struct GNUNET_RECLAIM_Ticket ticket;
362 * Ticket consume message
364 struct ConsumeTicketMessage {
366 * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
368 struct GNUNET_MessageHeader header;
371 * Unique identifier for this request (for key collisions).
373 uint32_t id GNUNET_PACKED;
378 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
381 * The ticket to consume
383 struct GNUNET_RECLAIM_Ticket ticket;
387 * Attribute list is returned from the idp.
389 struct ConsumeTicketResultMessage {
393 struct GNUNET_MessageHeader header;
396 * Unique identifier for this request (for key collisions).
398 uint32_t id GNUNET_PACKED;
403 uint32_t result GNUNET_PACKED;
406 * Length of serialized attribute data
408 uint16_t attrs_len GNUNET_PACKED;
411 * always zero (for alignment)
413 uint16_t reserved GNUNET_PACKED;
416 * The public key of the identity.
418 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
421 * serialized attributes data
426 GNUNET_NETWORK_STRUCT_END