#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_gns_service.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_reclaim_lib.h"
#include "gnunet_reclaim_service.h"
#include "gnunet_signatures.h"
#include "gnunet_statistics_service.h"
#include "reclaim.h"
Go to the source code of this file.
Data Structures | |
struct | TicketRecordsEntry |
List of tickets. More... | |
Typedefs | |
typedef void(* | RECLAIM_TICKETS_TicketIter) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri) |
Continuation called with ticket. More... | |
typedef void(* | RECLAIM_TICKETS_TicketResult) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg) |
Continuation called with ticket. More... | |
typedef void(* | RECLAIM_TICKETS_ConsumeCallback) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_AttributeList *attributes, const struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg) |
Consume callback. More... | |
typedef void(* | RECLAIM_TICKETS_RevokeCallback) (void *cls, int32_t success) |
Revocation callback. More... | |
typedef void(* RECLAIM_TICKETS_TicketIter) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri) |
Continuation called with ticket.
cls | closure |
ticket | the ticket |
rp_uri | the RP URI associated with the ticket |
Definition at line 107 of file gnunet-service-reclaim_tickets.h.
typedef void(* RECLAIM_TICKETS_TicketResult) (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg) |
Continuation called with ticket.
cls | closure |
ticket | the ticket |
presentations | new presentations for ticket (NULL on error) |
success | GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate) GNUNET_OK on success |
emsg | NULL on success, otherwise an error message |
Definition at line 123 of file gnunet-service-reclaim_tickets.h.
typedef void(* RECLAIM_TICKETS_ConsumeCallback) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_AttributeList *attributes, const struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg) |
Consume callback.
cls | closure |
identity | the issuer of the ticket/attributes |
attributes | attribute list retrieved through ticket |
presentations | attribute presentations (may be NULL) |
success | GNUNET_OK on success |
emsg | error message (NULL on success) |
Definition at line 141 of file gnunet-service-reclaim_tickets.h.
typedef void(* RECLAIM_TICKETS_RevokeCallback) (void *cls, int32_t success) |
Revocation callback.
cls | closure |
success | GNUNET_OK on success |
Definition at line 156 of file gnunet-service-reclaim_tickets.h.
struct RECLAIM_TICKETS_RevokeHandle * RECLAIM_TICKETS_revoke | ( | const struct GNUNET_RECLAIM_Ticket * | ticket, |
const struct GNUNET_CRYPTO_PrivateKey * | identity, | ||
RECLAIM_TICKETS_RevokeCallback | cb, | ||
void * | cb_cls | ||
) |
Revoke a ticket.
We start by looking up attribute references in order to change attribute IDs.
ticket | ticket to revoke |
identity | private key of issuer |
cb | revocation status callback |
cb_cls | callback closure |
Get shared attributes
Definition at line 925 of file gnunet-service-reclaim_tickets.c.
References RECLAIM_TICKETS_RevokeHandle::cb, RECLAIM_TICKETS_RevokeHandle::cb_cls, GNUNET_RECLAIM_Ticket::gns_name, GNUNET_assert, GNUNET_free, GNUNET_NAMESTORE_records_lookup(), GNUNET_new, GNUNET_strdup, identity, RECLAIM_TICKETS_RevokeHandle::identity, RECLAIM_TICKETS_RevokeHandle::ns_qe, nsh, revoke_attrs_cb(), rvk_attrs_err_cb(), ticket, and RECLAIM_TICKETS_RevokeHandle::ticket.
Referenced by handle_revoke_ticket_message().
void RECLAIM_TICKETS_revoke_cancel | ( | struct RECLAIM_TICKETS_RevokeHandle * | rh | ) |
Cancel a revocation.
rh | handle to the operation |
Definition at line 961 of file gnunet-service-reclaim_tickets.c.
References cleanup_rvk(), and GNUNET_assert.
Referenced by cleanup_client().
struct RECLAIM_TICKETS_ConsumeHandle * RECLAIM_TICKETS_consume | ( | const struct GNUNET_RECLAIM_Ticket * | ticket, |
const char * | rp_uri, | ||
RECLAIM_TICKETS_ConsumeCallback | cb, | ||
void * | cb_cls | ||
) |
Consume a ticket.
We first looking attribute references under the label ticket.rnd in GNS.
ticket | the ticket to consume |
rp_uri | the expected RP URI |
cb | callback to call with attributes of ticket |
cb_cls | callback closure |
We first looking attribute references under the label ticket.rnd in GNS.
id | the audience of the ticket |
ticket | the ticket to consume |
cb | callback to call with attributes of ticket |
cb_cls | callback closure |
Definition at line 1218 of file gnunet-service-reclaim_tickets.c.
References RECLAIM_TICKETS_ConsumeHandle::attrs, RECLAIM_TICKETS_ConsumeHandle::cb, RECLAIM_TICKETS_ConsumeHandle::cb_cls, gns, GNUNET_RECLAIM_Ticket::gns_name, GNUNET_GNS_LO_DEFAULT, GNUNET_GNS_lookup_with_tld(), GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF, GNUNET_new, GNUNET_TIME_absolute_get(), lookup_authz_cb(), RECLAIM_TICKETS_ConsumeHandle::lookup_request, RECLAIM_TICKETS_ConsumeHandle::lookup_start_time, RECLAIM_TICKETS_ConsumeHandle::presentations, RECLAIM_TICKETS_ConsumeHandle::rp_uri, ticket, and RECLAIM_TICKETS_ConsumeHandle::ticket.
Referenced by handle_consume_ticket_message().
void RECLAIM_TICKETS_consume_cancel | ( | struct RECLAIM_TICKETS_ConsumeHandle * | cth | ) |
Cancel a consume operation.
cth | the operation to cancel |
Definition at line 1251 of file gnunet-service-reclaim_tickets.c.
References cleanup_cth().
Referenced by cleanup_client().
void RECLAIM_TICKETS_issue | ( | const struct GNUNET_CRYPTO_PrivateKey * | identity, |
const struct GNUNET_RECLAIM_AttributeList * | attrs, | ||
const char * | rp, | ||
RECLAIM_TICKETS_TicketResult | cb, | ||
void * | cb_cls | ||
) |
Issue a new reclaim ticket, thereby authorizing the audience to access the set of provided attributes.
identity | the issuer |
attrs | the attributes to share |
rp | the RP URI |
cb | the callback to call with the ticket result |
cb_cls | the callback closure FIXME: Return handle?? |
identity | the issuer |
attrs | the attributes to share |
audience | the audience to share the attributes with |
cb | the callback to call with the ticket result |
cb_cls | the callback closure FIXME: Return handle?? |
Definition at line 1686 of file gnunet-service-reclaim_tickets.c.
References TicketIssueHandle::attrs, TicketIssueHandle::cb, TicketIssueHandle::cb_cls, filter_tickets_cb(), filter_tickets_error_cb(), filter_tickets_finished_cb(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_new, GNUNET_RECLAIM_attribute_list_dup(), identity, TicketIssueHandle::identity, TicketIssueHandle::ns_it, nsh, TicketIssueHandle::presentations, rp, and TicketIssueHandle::rp_uri.
Referenced by handle_issue_ticket_message().
void RECLAIM_TICKETS_iteration_next | ( | struct RECLAIM_TICKETS_Iterator * | iter | ) |
Continue ticket iteration.
iter | the iteration to continue |
Definition at line 1811 of file gnunet-service-reclaim_tickets.c.
References GNUNET_NAMESTORE_zone_iterator_next(), and RECLAIM_TICKETS_Iterator::ns_it.
Referenced by handle_ticket_iteration_next().
void RECLAIM_TICKETS_iteration_stop | ( | struct RECLAIM_TICKETS_Iterator * | iter | ) |
Stop a running ticket iteration.
iter | iteration to cancel |
Definition at line 1823 of file gnunet-service-reclaim_tickets.c.
References cleanup_iter(), GNUNET_NAMESTORE_zone_iteration_stop(), and RECLAIM_TICKETS_Iterator::ns_it.
Referenced by cleanup_client(), and handle_ticket_iteration_stop().
struct RECLAIM_TICKETS_Iterator * RECLAIM_TICKETS_iteration_start | ( | const struct GNUNET_CRYPTO_PrivateKey * | identity, |
RECLAIM_TICKETS_TicketIter | cb, | ||
void * | cb_cls | ||
) |
Iterate over all tickets issued by an identity.
identity | the issuing identity |
cb | ticket callback function |
cb_cls | callback closure |
Definition at line 1839 of file gnunet-service-reclaim_tickets.c.
References RECLAIM_TICKETS_Iterator::cb, RECLAIM_TICKETS_Iterator::cb_cls, collect_tickets_cb(), collect_tickets_error_cb(), collect_tickets_finished_cb(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_new, identity, RECLAIM_TICKETS_Iterator::ns_it, and nsh.
Referenced by handle_ticket_iteration_start().
int RECLAIM_TICKETS_init | ( | const struct GNUNET_CONFIGURATION_Handle * | c | ) |
Initialize tickets component.
c | the configuration |
Definition at line 1869 of file gnunet-service-reclaim_tickets.c.
References DEFAULT_TICKET_REFRESH_INTERVAL, gns, GNUNET_CONFIGURATION_get_value_time(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_GNS_connect(), GNUNET_log, GNUNET_log_strerror, GNUNET_NAMESTORE_connect(), GNUNET_OK, GNUNET_STATISTICS_create(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_YES, nsh, stats, and ticket_refresh_interval.
Referenced by run().
void RECLAIM_TICKETS_deinit | ( | void | ) |
Close handles and clean up.
FIXME: cancel all pending operations (gns, ns etc)
Definition at line 1911 of file gnunet-service-reclaim_tickets.c.
References gns, GNUNET_GNS_disconnect(), GNUNET_NAMESTORE_disconnect(), GNUNET_NO, GNUNET_STATISTICS_destroy(), nsh, and stats.
Referenced by cleanup().