2 This file is part of GNUnet
3 Copyright (C) 2012, 2013 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/>.
20 * @author Martin Schanzenbach
23 * Plugin API for the idp database backend
25 * @defgroup reclaim-plugin IdP service plugin API
26 * Plugin API for the idp database backend
29 #ifndef GNUNET_RECLAIM_PLUGIN_H
30 #define GNUNET_RECLAIM_PLUGIN_H
32 #include "gnunet_util_lib.h"
33 #include "gnunet_reclaim_service.h"
38 #if 0 /* keep Emacsens' auto-indent happy */
45 * Function called by for each matching ticket.
48 * @param ticket the ticket
50 typedef void (*GNUNET_RECLAIM_TicketIterator) (void *cls,
51 const struct GNUNET_RECLAIM_Ticket *ticket,
52 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
56 * @brief struct returned by the initialization function of the plugin
58 struct GNUNET_RECLAIM_PluginFunctions
62 * Closure to pass to all plugin functions.
67 * Store a ticket in the database.
69 * @param cls closure (internal context for the plugin)
70 * @param ticket the ticket to store
71 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
73 int (*store_ticket) (void *cls,
74 const struct GNUNET_RECLAIM_Ticket *ticket,
75 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
78 * Delete a ticket from the database.
80 * @param cls closure (internal context for the plugin)
81 * @param ticket the ticket to store
82 * @return #GNUNET_OK on success, else #GNUNET_SYSERR
84 int (*delete_ticket) (void *cls,
85 const struct GNUNET_RECLAIM_Ticket *ticket);
90 * Iterate over all tickets
92 * @param cls closure (internal context for the plugin)
93 * @param identity the identity
94 * @param audience GNUNET_YES if the identity is the audience of the ticket
95 * else it is considered the issuer
96 * @param iter function to call with the result
97 * @param iter_cls closure for @a iter
98 * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
100 int (*iterate_tickets) (void *cls,
101 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
104 GNUNET_RECLAIM_TicketIterator iter, void *iter_cls);
106 int (*get_ticket_attributes) (void* cls,
107 const struct GNUNET_RECLAIM_Ticket *ticket,
108 GNUNET_RECLAIM_TicketIterator iter,
112 #if 0 /* keep Emacsens' auto-indent happy */
121 /** @} */ /* end of group */