2 This file is part of GNUnet.
3 Copyright (C) 2012-2015 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 src/reclaim/gnunet-service-reclaim_tickets.h
24 * @brief reclaim tickets
28 #ifndef GNUNET_SERVICE_RECLAIM_TICKETS_H
29 #define GNUNET_SERVICE_RECLAIM_TICKETS_H
33 #include "gnunet_util_lib.h"
35 #include "gnunet_constants.h"
36 #include "gnunet_gns_service.h"
37 #include "gnunet_gnsrecord_lib.h"
38 #include "gnunet_namestore_service.h"
39 #include "gnunet_protocols.h"
40 #include "gnunet_reclaim_attribute_lib.h"
41 #include "gnunet_reclaim_plugin.h"
42 #include "gnunet_signatures.h"
43 #include "gnunet_statistics_service.h"
46 struct RECLAIM_TICKETS_Iterator;
47 struct RECLAIM_TICKETS_ConsumeHandle;
48 struct RECLAIM_TICKETS_RevokeHandle;
51 * Continuation called with ticket.
54 * @param ticket the ticket
56 typedef void (*RECLAIM_TICKETS_TicketIter) (
57 void *cls, struct GNUNET_RECLAIM_Ticket *ticket);
61 * Continuation called with ticket.
64 * @param ticket the ticket
65 * @param success #GNUNET_SYSERR on failure (including timeout/queue
66 * drop/failure to validate) #GNUNET_OK on success
67 * @param emsg NULL on success, otherwise an error message
69 typedef void (*RECLAIM_TICKETS_TicketResult) (
70 void *cls, struct GNUNET_RECLAIM_Ticket *ticket, int32_t success,
74 typedef void (*RECLAIM_TICKETS_ConsumeCallback) (
75 void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
76 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *l, int32_t success,
80 typedef void (*RECLAIM_TICKETS_RevokeCallback) (void *cls, int32_t success);
82 struct RECLAIM_TICKETS_RevokeHandle *
83 RECLAIM_TICKETS_revoke (const struct GNUNET_RECLAIM_Ticket *ticket,
84 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
85 RECLAIM_TICKETS_RevokeCallback cb, void *cb_cls);
89 RECLAIM_TICKETS_revoke_cancel (struct RECLAIM_TICKETS_RevokeHandle *rh);
92 struct RECLAIM_TICKETS_ConsumeHandle *
93 RECLAIM_TICKETS_consume (const struct GNUNET_CRYPTO_EcdsaPrivateKey *id,
94 const struct GNUNET_RECLAIM_Ticket *ticket,
95 RECLAIM_TICKETS_ConsumeCallback cb, void *cb_cls);
98 RECLAIM_TICKETS_consume_cancel (struct RECLAIM_TICKETS_ConsumeHandle *cth);
101 RECLAIM_TICKETS_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
102 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
103 const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
104 RECLAIM_TICKETS_TicketResult cb, void *cb_cls);
107 RECLAIM_TICKETS_iteration_next (struct RECLAIM_TICKETS_Iterator *iter);
111 RECLAIM_TICKETS_iteration_stop (struct RECLAIM_TICKETS_Iterator *iter);
114 struct RECLAIM_TICKETS_Iterator *
115 RECLAIM_TICKETS_iteration_start (
116 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
117 RECLAIM_TICKETS_TicketIter cb, void *cb_cls);
121 RECLAIM_TICKETS_init (const struct GNUNET_CONFIGURATION_Handle *c);
124 RECLAIM_TICKETS_deinit (void);