7ad86dba5e3c11bf020da25183433bf7f3d9699d
[oweals/gnunet.git] / src / reclaim / gnunet-service-reclaim_tickets.h
1 /*
2    This file is part of GNUnet.
3    Copyright (C) 2012-2015 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 #include "platform.h"
21 #include "gnunet_util_lib.h"
22 #include "gnunet_constants.h"
23 #include "gnunet_protocols.h"
24 #include "gnunet_gnsrecord_lib.h"
25 #include "gnunet_gns_service.h"
26 #include "gnunet_namestore_service.h"
27 #include "gnunet_statistics_service.h"
28 #include "gnunet_reclaim_plugin.h"
29 #include "gnunet_reclaim_attribute_lib.h"
30 #include "gnunet_signatures.h"
31 #include "reclaim.h"
32
33 /**
34  * Continuation called with ticket.
35  *
36  * @param cls closure
37  * @param ticket the ticket
38  * @param success #GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate)
39  *                #GNUNET_OK on success
40  * @param emsg NULL on success, otherwise an error message
41  */
42 typedef void
43 (*RECLAIM_TICKETS_TicketResult) (void *cls,
44                                  struct GNUNET_RECLAIM_Ticket *ticket,
45                                  uint32_t success,
46                                  const char *emsg);
47
48
49 /**
50  * @author Martin Schanzenbach
51  * @file src/reclaim/gnunet-service-reclaim_tickets.h
52  * @brief reclaim tickets
53  *
54  */
55 void
56 RECLAIM_TICKETS_issue_ticket (const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
57                               const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
58                               const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
59                               RECLAIM_TICKETS_TicketResult cb,
60                               void* cb_cls);
61
62 int
63 RECLAIM_TICKETS_init (const struct GNUNET_CONFIGURATION_Handle *c);