use NULL value in load_path_suffix to NOT load any files
[oweals/gnunet.git] / src / reclaim / reclaim.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2016 GNUnet e.V.
4
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.
9
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.
14
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/>.
17
18      SPDX-License-Identifier: AGPL3.0-or-later
19  */
20
21 /**
22  * @author Martin Schanzenbach
23  * @file reclaim/reclaim.h
24  *
25  * @brief Common type definitions for the identity provider
26  *        service and API.
27  */
28 #ifndef RECLAIM_H
29 #define RECLAIM_H
30
31 #include "gnunet_common.h"
32
33
34 GNUNET_NETWORK_STRUCT_BEGIN
35
36
37 /**
38  * Use to store an identity attribute
39  */
40 struct AttributeStoreMessage
41 {
42   /**
43    * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
44    */
45   struct GNUNET_MessageHeader header;
46
47   /**
48    * Unique identifier for this request (for key collisions).
49    */
50   uint32_t id GNUNET_PACKED;
51
52   /**
53    * The length of the attribute
54    */
55   uint32_t attr_len GNUNET_PACKED;
56
57   /**
58    * The expiration interval of the attribute
59    */
60   uint64_t exp GNUNET_PACKED;
61
62   /**
63    * Identity
64    */
65   struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
66
67   /* followed by the serialized attribute */
68 };
69
70
71 /**
72  * Use to delete an identity attribute
73  */
74 struct AttributeDeleteMessage
75 {
76   /**
77    * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
78    */
79   struct GNUNET_MessageHeader header;
80
81   /**
82    * Unique identifier for this request (for key collisions).
83    */
84   uint32_t id GNUNET_PACKED;
85
86   /**
87    * The length of the attribute
88    */
89   uint32_t attr_len GNUNET_PACKED;
90
91   /**
92    * Identity
93    */
94   struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
95
96   /* followed by the serialized attribute */
97 };
98
99
100 /**
101  * Attribute store/delete response message
102  */
103 struct SuccessResultMessage
104 {
105   /**
106    * Message header
107    */
108   struct GNUNET_MessageHeader header;
109
110   /**
111    * Unique identifier for this request (for key collisions).
112    */
113   uint32_t id GNUNET_PACKED;
114
115   /**
116    * #GNUNET_SYSERR on failure, #GNUNET_OK on success
117    */
118   int32_t op_result GNUNET_PACKED;
119 };
120
121 /**
122  * Attribute is returned from the idp.
123  */
124 struct AttributeResultMessage
125 {
126   /**
127    * Message header
128    */
129   struct GNUNET_MessageHeader header;
130
131   /**
132    * Unique identifier for this request (for key collisions).
133    */
134   uint32_t id GNUNET_PACKED;
135
136   /**
137    * Length of serialized attribute data
138    */
139   uint16_t attr_len GNUNET_PACKED;
140
141   /**
142    * always zero (for alignment)
143    */
144   uint16_t reserved GNUNET_PACKED;
145
146   /**
147    * The public key of the identity.
148    */
149   struct GNUNET_CRYPTO_EcdsaPublicKey identity;
150
151   /* followed by:
152    * serialized attribute data
153    */
154 };
155
156 /**
157  * Reference plus Attestation is returned from the idp.
158  */
159 struct ReferenceResultMessage
160 {
161   /**
162    * Message header
163    */
164   struct GNUNET_MessageHeader header;
165
166   /**
167    * Unique identifier for this request (for key collisions).
168    */
169   uint32_t id GNUNET_PACKED;
170
171   /**
172    * Length of serialized attestation data
173    */
174   uint16_t attest_len GNUNET_PACKED;
175
176   /**
177    * Length of serialized reference data
178    */
179   uint16_t ref_len GNUNET_PACKED;
180
181   /**
182    * always zero (for alignment)
183    */
184   uint16_t reserved GNUNET_PACKED;
185
186   /**
187    * The public key of the identity.
188    */
189   struct GNUNET_CRYPTO_EcdsaPublicKey identity;
190
191   /* followed by:
192    * serialized reference data + attestation data
193    */
194 };
195
196 /**
197  * Start a attribute iteration for the given identity
198  */
199 struct AttributeIterationStartMessage
200 {
201   /**
202    * Message
203    */
204   struct GNUNET_MessageHeader header;
205
206   /**
207    * Unique identifier for this request (for key collisions).
208    */
209   uint32_t id GNUNET_PACKED;
210
211   /**
212    * Identity.
213    */
214   struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
215 };
216
217
218 /**
219  * Ask for next result of attribute iteration for the given operation
220  */
221 struct AttributeIterationNextMessage
222 {
223   /**
224    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
225    */
226   struct GNUNET_MessageHeader header;
227
228   /**
229    * Unique identifier for this request (for key collisions).
230    */
231   uint32_t id GNUNET_PACKED;
232 };
233
234
235 /**
236  * Stop attribute iteration for the given operation
237  */
238 struct AttributeIterationStopMessage
239 {
240   /**
241    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
242    */
243   struct GNUNET_MessageHeader header;
244
245   /**
246    * Unique identifier for this request (for key collisions).
247    */
248   uint32_t id GNUNET_PACKED;
249 };
250
251 /**
252  * Start a ticket iteration for the given identity
253  */
254 struct TicketIterationStartMessage
255 {
256   /**
257    * Message
258    */
259   struct GNUNET_MessageHeader header;
260
261   /**
262    * Unique identifier for this request (for key collisions).
263    */
264   uint32_t id GNUNET_PACKED;
265
266   /**
267    * Identity.
268    */
269   struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
270 };
271
272
273 /**
274  * Ask for next result of ticket iteration for the given operation
275  */
276 struct TicketIterationNextMessage
277 {
278   /**
279    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
280    */
281   struct GNUNET_MessageHeader header;
282
283   /**
284    * Unique identifier for this request (for key collisions).
285    */
286   uint32_t id GNUNET_PACKED;
287 };
288
289
290 /**
291  * Stop ticket iteration for the given operation
292  */
293 struct TicketIterationStopMessage
294 {
295   /**
296    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
297    */
298   struct GNUNET_MessageHeader header;
299
300   /**
301    * Unique identifier for this request (for key collisions).
302    */
303   uint32_t id GNUNET_PACKED;
304 };
305
306
307 /**
308  * Ticket issue message
309  */
310 struct IssueTicketMessage
311 {
312   /**
313    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
314    */
315   struct GNUNET_MessageHeader header;
316
317   /**
318    * Unique identifier for this request (for key collisions).
319    */
320   uint32_t id GNUNET_PACKED;
321
322   /**
323    * Identity.
324    */
325   struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
326
327   /**
328    * Requesting party.
329    */
330   struct GNUNET_CRYPTO_EcdsaPublicKey rp;
331
332   /**
333    * length of serialized attribute list
334    */
335   uint32_t attr_len GNUNET_PACKED;
336
337   // Followed by a serialized attribute list
338 };
339
340 /**
341  * Ticket revoke message
342  */
343 struct RevokeTicketMessage
344 {
345   /**
346    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
347    */
348   struct GNUNET_MessageHeader header;
349
350   /**
351    * Unique identifier for this request (for key collisions).
352    */
353   uint32_t id GNUNET_PACKED;
354
355   /**
356    * Identity.
357    */
358   struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
359
360   /**
361    * length of serialized attribute list
362    */
363   uint32_t attrs_len GNUNET_PACKED;
364
365   /**
366    * The ticket to revoke
367    */
368   struct GNUNET_RECLAIM_Ticket ticket;
369 };
370
371 /**
372  * Ticket revoke message
373  */
374 struct RevokeTicketResultMessage
375 {
376   /**
377    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
378    */
379   struct GNUNET_MessageHeader header;
380
381   /**
382    * Unique identifier for this request (for key collisions).
383    */
384   uint32_t id GNUNET_PACKED;
385
386   /**
387    * Revocation result
388    */
389   uint32_t success GNUNET_PACKED;
390 };
391
392
393 /**
394  * Ticket result message
395  */
396 struct TicketResultMessage
397 {
398   /**
399    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
400    */
401   struct GNUNET_MessageHeader header;
402
403   /**
404    * Unique identifier for this request (for key collisions).
405    */
406   uint32_t id GNUNET_PACKED;
407
408   /**
409    * The new ticket
410    */
411   struct GNUNET_RECLAIM_Ticket ticket;
412 };
413
414 /**
415  * Ticket consume message
416  */
417 struct ConsumeTicketMessage
418 {
419   /**
420    * Type will be #GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
421    */
422   struct GNUNET_MessageHeader header;
423
424   /**
425    * Unique identifier for this request (for key collisions).
426    */
427   uint32_t id GNUNET_PACKED;
428
429   /**
430    * Identity.
431    */
432   struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
433
434   /**
435    * The ticket to consume
436    */
437   struct GNUNET_RECLAIM_Ticket ticket;
438 };
439
440 /**
441  * Attribute list is returned from the idp.
442  */
443 struct ConsumeTicketResultMessage
444 {
445   /**
446    * Message header
447    */
448   struct GNUNET_MessageHeader header;
449
450   /**
451    * Unique identifier for this request (for key collisions).
452    */
453   uint32_t id GNUNET_PACKED;
454
455   /**
456    * Result
457    */
458   uint32_t result GNUNET_PACKED;
459
460   /**
461    * Length of serialized attribute data
462    */
463   uint16_t attrs_len GNUNET_PACKED;
464
465   /**
466    * always zero (for alignment)
467    */
468   uint16_t reserved GNUNET_PACKED;
469
470   /**
471    * The public key of the identity.
472    */
473   struct GNUNET_CRYPTO_EcdsaPublicKey identity;
474
475   /* followed by:
476    * serialized attributes data
477    */
478 };
479
480
481 GNUNET_NETWORK_STRUCT_END
482
483 #endif