#include "gnunet_util_lib.h"
#include "gnunet-service-reclaim_tickets.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_reclaim_lib.h"
#include "gnunet_reclaim_service.h"
#include "reclaim.h"
Go to the source code of this file.
Data Structures | |
struct | TicketIteration |
A ticket iteration operation. More... | |
struct | Iterator |
An attribute iteration operation. More... | |
struct | IdpClient |
An idp client. More... | |
struct | AttributeDeleteHandle |
Handle for attribute deletion request. More... | |
struct | AttributeStoreHandle |
Handle for attribute store request. More... | |
struct | ConsumeTicketOperation |
Handle for ticket consume request. More... | |
struct | TicketRevocationOperation |
Ticket revocation request handle. More... | |
struct | TicketIssueOperation |
Ticket issue operation handle. More... | |
Functions | |
static void | cleanup_adh (struct AttributeDeleteHandle *adh) |
Cleanup attribute delete handle. More... | |
static void | cleanup_as_handle (struct AttributeStoreHandle *ash) |
Cleanup attribute store handle. More... | |
static void | cleanup_client (struct IdpClient *idp) |
Cleanup client. More... | |
static void | cleanup () |
Cleanup task. More... | |
static void | do_shutdown (void *cls) |
Shutdown task. More... | |
static void | send_ticket_result (const struct IdpClient *client, uint32_t r_id, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations, uint32_t success) |
Sends a ticket result message to the client. More... | |
static void | issue_ticket_result_cb (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg) |
Issue ticket result. More... | |
static int | check_issue_ticket_message (void *cls, const struct IssueTicketMessage *im) |
Check issue ticket message. More... | |
static void | handle_issue_ticket_message (void *cls, const struct IssueTicketMessage *im) |
Handle ticket issue message. More... | |
static void | revoke_result_cb (void *cls, int32_t success) |
Handles revocation result. More... | |
static int | check_revoke_ticket_message (void *cls, const struct RevokeTicketMessage *rm) |
Check revocation message format. More... | |
static void | handle_revoke_ticket_message (void *cls, const struct RevokeTicketMessage *rm) |
Handle a revocation message to a ticket. More... | |
static void | consume_result_cb (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg) |
Handle a ticket consume result. More... | |
static int | check_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm) |
Check a consume ticket message. More... | |
static void | handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm) |
Handle a consume ticket message. More... | |
static void | attr_store_cont (void *cls, enum GNUNET_ErrorCode ec) |
Attribute store result handler. More... | |
static void | attr_store_task (void *cls) |
Add a new attribute. More... | |
static int | check_attribute_store_message (void *cls, const struct AttributeStoreMessage *sam) |
Check an attribute store message. More... | |
static void | handle_attribute_store_message (void *cls, const struct AttributeStoreMessage *sam) |
Handle an attribute store message. More... | |
static void | cred_store_cont (void *cls, enum GNUNET_ErrorCode ec) |
Credential store result handler. More... | |
static void | cred_error (void *cls) |
Error looking up potential credential. More... | |
static void | cred_add_cb (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Check for existing record before storing credential. More... | |
static void | cred_store_task (void *cls) |
Add a new credential. More... | |
static int | check_credential_store_message (void *cls, const struct AttributeStoreMessage *sam) |
Check an credential store message. More... | |
static void | handle_credential_store_message (void *cls, const struct AttributeStoreMessage *sam) |
Handle a credential store message. More... | |
static void | send_delete_response (struct AttributeDeleteHandle *adh, int32_t success) |
Send a deletion success response. More... | |
static void | consistency_iter (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Namestore iteration within attribute deletion. More... | |
static void | update_tickets (void *cls) |
Recursion prototype for function. More... | |
static void | ticket_updated (void *cls, enum GNUNET_ErrorCode ec) |
Callback called when a ticket was updated. More... | |
static void | purge_attributes (void *cls) |
Delete all attributes which reference credentials that no longer exist. More... | |
static void | offending_attr_delete_cont (void *cls, enum GNUNET_ErrorCode ec) |
static void | consistency_iter_fin (void *cls) |
Done collecting affected tickets, start updating. More... | |
static void | consistency_iter_err (void *cls) |
Error collecting affected tickets. More... | |
static void | start_consistency_update (void *cls) |
Start processing tickets which may still contain reference to deleted attribute. More... | |
static void | attr_delete_cont (void *cls, enum GNUNET_ErrorCode ec) |
Attribute deleted callback. More... | |
static int | check_attribute_delete_message (void *cls, const struct AttributeDeleteMessage *dam) |
Check attribute delete message format. More... | |
static void | handle_attribute_delete_message (void *cls, const struct AttributeDeleteMessage *dam) |
Handle attribute deletion. More... | |
static void | cred_delete_cont (void *cls, enum GNUNET_ErrorCode ec) |
Credential deleted callback. More... | |
static int | check_credential_delete_message (void *cls, const struct AttributeDeleteMessage *dam) |
Check credential delete message format. More... | |
static void | handle_credential_delete_message (void *cls, const struct AttributeDeleteMessage *dam) |
Handle credential deletion. More... | |
static void | attr_iter_finished (void *cls) |
Done iterating over attributes. More... | |
static void | attr_iter_error (void *cls) |
Error iterating over attributes. More... | |
static void | attr_iter_cb (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Got record. More... | |
static enum GNUNET_GenericReturnValue | check_iteration_start (void *cls, const struct AttributeIterationStartMessage *ais_msg) |
static void | handle_iteration_start (void *cls, const struct AttributeIterationStartMessage *ais_msg) |
Iterate over zone to get attributes. More... | |
static void | handle_iteration_stop (void *cls, const struct AttributeIterationStopMessage *ais_msg) |
Handle iteration stop message from client. More... | |
static void | handle_iteration_next (void *cls, const struct AttributeIterationNextMessage *ais_msg) |
Client requests next attribute from iterator. More... | |
static void | cred_iter_finished (void *cls) |
Done iterating over credentials. More... | |
static void | cred_iter_error (void *cls) |
Error iterating over credentials. More... | |
static void | cred_iter_cb (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) |
Got record. More... | |
static enum GNUNET_GenericReturnValue | check_credential_iteration_start (void *cls, const struct CredentialIterationStartMessage *cis_msg) |
static void | handle_credential_iteration_start (void *cls, const struct CredentialIterationStartMessage *ais_msg) |
Iterate over zone to get attributes. More... | |
static void | handle_credential_iteration_stop (void *cls, const struct CredentialIterationStopMessage *ais_msg) |
Handle iteration stop message from client. More... | |
static void | handle_credential_iteration_next (void *cls, const struct CredentialIterationNextMessage *ais_msg) |
Client requests next credential from iterator. More... | |
static void | ticket_iter_cb (void *cls, struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri) |
static enum GNUNET_GenericReturnValue | check_ticket_iteration_start (void *cls, const struct TicketIterationStartMessage *tis_msg) |
static void | handle_ticket_iteration_start (void *cls, const struct TicketIterationStartMessage *tis_msg) |
Client requests a ticket iteration. More... | |
static void | handle_ticket_iteration_stop (void *cls, const struct TicketIterationStopMessage *tis_msg) |
Client has had enough tickets. More... | |
static void | handle_ticket_iteration_next (void *cls, const struct TicketIterationNextMessage *tis_msg) |
Client requests next result. More... | |
static void | run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *server) |
Main function that will be run. More... | |
static void | client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx) |
Called whenever a client is disconnected. More... | |
static void * | client_connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq) |
Add a client to our list of active clients. More... | |
GNUNET_SERVICE_MAIN (GNUNET_OS_project_data_gnunet(), "reclaim", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_var_size(attribute_store_message, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE, struct AttributeStoreMessage, NULL), GNUNET_MQ_hd_var_size(credential_store_message, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE, struct AttributeStoreMessage, NULL), GNUNET_MQ_hd_var_size(attribute_delete_message, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE, struct AttributeDeleteMessage, NULL), GNUNET_MQ_hd_var_size(credential_delete_message, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE, struct AttributeDeleteMessage, NULL), GNUNET_MQ_hd_var_size(iteration_start, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START, struct AttributeIterationStartMessage, NULL), GNUNET_MQ_hd_fixed_size(iteration_next, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT, struct AttributeIterationNextMessage, NULL), GNUNET_MQ_hd_fixed_size(iteration_stop, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP, struct AttributeIterationStopMessage, NULL), GNUNET_MQ_hd_var_size(credential_iteration_start, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START, struct CredentialIterationStartMessage, NULL), GNUNET_MQ_hd_fixed_size(credential_iteration_next, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT, struct CredentialIterationNextMessage, NULL), GNUNET_MQ_hd_fixed_size(credential_iteration_stop, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP, struct CredentialIterationStopMessage, NULL), GNUNET_MQ_hd_var_size(issue_ticket_message, GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET, struct IssueTicketMessage, NULL), GNUNET_MQ_hd_var_size(consume_ticket_message, GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET, struct ConsumeTicketMessage, NULL), GNUNET_MQ_hd_var_size(ticket_iteration_start, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START, struct TicketIterationStartMessage, NULL), GNUNET_MQ_hd_fixed_size(ticket_iteration_next, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT, struct TicketIterationNextMessage, NULL), GNUNET_MQ_hd_fixed_size(ticket_iteration_stop, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP, struct TicketIterationStopMessage, NULL), GNUNET_MQ_hd_var_size(revoke_ticket_message, GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET, struct RevokeTicketMessage, NULL), GNUNET_MQ_handler_end()) | |
Define "main" method using service macro. More... | |
Variables | |
static struct GNUNET_NAMESTORE_Handle * | nsh |
Namestore handle. More... | |
static struct GNUNET_SCHEDULER_Task * | timeout_task |
Timeout task. More... | |
static const struct GNUNET_CONFIGURATION_Handle * | cfg |
Our configuration. More... | |
static struct IdpClient * | client_list_head = NULL |
Client list. More... | |
static struct IdpClient * | client_list_tail = NULL |
Client list. More... | |
|
static |
Cleanup attribute delete handle.
adh | the attribute to cleanup |
Definition at line 485 of file gnunet-service-reclaim.c.
References AttributeDeleteHandle::claim, AttributeDeleteHandle::credential, TicketRecordsEntry::data, AttributeDeleteHandle::existing_attributes, AttributeDeleteHandle::existing_credentials, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_NAMESTORE_cancel(), GNUNET_NAMESTORE_zone_iteration_stop(), GNUNET_RECLAIM_attribute_list_destroy(), GNUNET_RECLAIM_credential_list_destroy(), AttributeDeleteHandle::label, TicketRecordsEntry::label, AttributeDeleteHandle::ns_it, AttributeDeleteHandle::ns_qe, AttributeDeleteHandle::tickets_to_update_head, and AttributeDeleteHandle::tickets_to_update_tail.
Referenced by attr_delete_cont(), cleanup_client(), consistency_iter_err(), cred_delete_cont(), offending_attr_delete_cont(), and update_tickets().
|
static |
Cleanup attribute store handle.
ash | handle to clean up |
Definition at line 524 of file gnunet-service-reclaim.c.
References AttributeStoreHandle::claim, AttributeStoreHandle::credential, GNUNET_free, GNUNET_NAMESTORE_cancel(), and AttributeStoreHandle::ns_qe.
Referenced by attr_store_cont(), cleanup_client(), cred_error(), and cred_store_cont().
|
static |
Cleanup client.
idp | the client to clean up |
Definition at line 542 of file gnunet-service-reclaim.c.
References ai, ConsumeTicketOperation::ch, cleanup_adh(), cleanup_as_handle(), GNUNET_CONTAINER_DLL_remove, GNUNET_free, idp, TicketIteration::iter, RECLAIM_TICKETS_consume_cancel(), RECLAIM_TICKETS_iteration_stop(), RECLAIM_TICKETS_revoke_cancel(), and TicketRevocationOperation::rh.
Referenced by client_disconnect_cb().
|
static |
Cleanup task.
Definition at line 613 of file gnunet-service-reclaim.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NAMESTORE_disconnect(), GNUNET_SCHEDULER_cancel(), nsh, RECLAIM_TICKETS_deinit(), and timeout_task.
Referenced by do_shutdown().
|
static |
Shutdown task.
cls | NULL |
Definition at line 631 of file gnunet-service-reclaim.c.
References cleanup(), GNUNET_ERROR_TYPE_INFO, and GNUNET_log.
Referenced by attr_store_cont(), cred_error(), cred_store_cont(), and run().
|
static |
Sends a ticket result message to the client.
client | the client to send to |
r_id | the request message ID to reply to |
ticket | the ticket to include (may be NULL) |
success | the success status of the request |
Definition at line 647 of file gnunet-service-reclaim.c.
References env, GNUNET_RECLAIM_Ticket::gns_name, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_RECLAIM_presentation_list_serialize(), GNUNET_RECLAIM_presentation_list_serialize_get_size(), TicketResultMessage::id, IdpClient::mq, TicketResultMessage::presentations_len, TicketResultMessage::rp_uri_len, ticket, and TicketResultMessage::tkt_len.
Referenced by issue_ticket_result_cb().
|
static |
Issue ticket result.
cls | out ticket issue operation handle |
ticket | the issued ticket |
presentations | newly created credential presentations (NULL on error) |
success | issue success status (GNUNET_OK if successful) |
emsg | error message (NULL of success is GNUNET_OK) |
Definition at line 700 of file gnunet-service-reclaim.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_SYSERR, send_ticket_result(), ticket, and tio.
Referenced by handle_issue_ticket_message().
|
static |
Check issue ticket message.
cls | unused |
im | message to check |
Definition at line 735 of file gnunet-service-reclaim.c.
References IssueTicketMessage::attr_len, GNUNET_break, GNUNET_OK, GNUNET_SYSERR, IssueTicketMessage::header, IssueTicketMessage::key_len, IssueTicketMessage::rp_uri_len, GNUNET_MessageHeader::size, and size.
|
static |
Handle ticket issue message.
cls | our client |
im | the message |
Definition at line 763 of file gnunet-service-reclaim.c.
References IssueTicketMessage::attr_len, GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_RECLAIM_Handle::client, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_new, GNUNET_RECLAIM_attribute_list_deserialize(), GNUNET_RECLAIM_attribute_list_destroy(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, IssueTicketMessage::id, identity, idp, issue_ticket_result_cb(), IssueTicketMessage::key_len, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_Attribute::name, GNUNET_RECLAIM_AttributeListEntry::next, RECLAIM_TICKETS_issue(), rp, IssueTicketMessage::rp_uri_len, and tio.
|
static |
Handles revocation result.
cls | our revocation operation handle |
success | revocation result (GNUNET_OK if successful) |
Definition at line 826 of file gnunet-service-reclaim.c.
References TicketRevocationOperation::client, env, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT, GNUNET_MQ_msg, GNUNET_MQ_send(), RevokeTicketResultMessage::id, IdpClient::mq, TicketRevocationOperation::r_id, IdpClient::revoke_op_head, IdpClient::revoke_op_tail, TicketRevocationOperation::rh, and RevokeTicketResultMessage::success.
Referenced by handle_revoke_ticket_message().
|
static |
Check revocation message format.
cls | unused |
rm | the message to check |
Definition at line 854 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, RevokeTicketMessage::header, RevokeTicketMessage::key_len, GNUNET_MessageHeader::size, size, and RevokeTicketMessage::tkt_len.
|
static |
Handle a revocation message to a ticket.
cls | our client |
rm | the message to handle |
Definition at line 880 of file gnunet-service-reclaim.c.
References TicketRevocationOperation::client, GNUNET_RECLAIM_Handle::client, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_new, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, RevokeTicketMessage::id, identity, idp, RevokeTicketMessage::key_len, TicketRevocationOperation::r_id, RECLAIM_TICKETS_revoke(), revoke_result_cb(), TicketRevocationOperation::rh, and ticket.
|
static |
Handle a ticket consume result.
cls | our consume ticket operation handle |
identity | the attribute authority |
attrs | the attribute/claim list |
success | GNUNET_OK if successful |
emsg | error message (NULL if success=GNUNET_OK) |
Definition at line 925 of file gnunet-service-reclaim.c.
References ConsumeTicketResultMessage::attrs_len, ConsumeTicketOperation::client, IdpClient::consume_op_head, IdpClient::consume_op_tail, env, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CRYPTO_public_key_get_length(), GNUNET_CRYPTO_write_public_key_to_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_OK, GNUNET_RECLAIM_attribute_list_serialize(), GNUNET_RECLAIM_attribute_list_serialize_get_size(), GNUNET_RECLAIM_presentation_list_serialize(), GNUNET_RECLAIM_presentation_list_serialize_get_size(), ConsumeTicketResultMessage::id, identity, ConsumeTicketResultMessage::key_len, IdpClient::mq, ConsumeTicketResultMessage::presentations_len, ConsumeTicketOperation::r_id, and ConsumeTicketResultMessage::result.
Referenced by handle_consume_ticket_message().
|
static |
Check a consume ticket message.
cls | unused |
cm | the message to handle |
Definition at line 983 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, ConsumeTicketMessage::header, ConsumeTicketMessage::rp_uri_len, GNUNET_MessageHeader::size, size, and ConsumeTicketMessage::tkt_len.
|
static |
Handle a consume ticket message.
cls | our client handle |
cm | the message to handle |
Definition at line 1008 of file gnunet-service-reclaim.c.
References ConsumeTicketOperation::ch, ConsumeTicketOperation::client, GNUNET_RECLAIM_Handle::client, consume_result_cb(), GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_SERVICE_client_continue(), ConsumeTicketMessage::id, idp, ConsumeTicketOperation::r_id, RECLAIM_TICKETS_consume(), ticket, and ConsumeTicketMessage::tkt_len.
|
static |
Attribute store result handler.
cls | our attribute store handle |
success | GNUNET_OK if successful |
emsg | error message (NULL if success=GNUNET_OK) |
Definition at line 1046 of file gnunet-service-reclaim.c.
References cleanup_as_handle(), AttributeStoreHandle::client, do_shutdown(), env, GNUNET_CONTAINER_DLL_remove, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ErrorCode_get_hint(), GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_SUCCESS_RESPONSE, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_OK, GNUNET_SCHEDULER_add_now(), SuccessResultMessage::id, IdpClient::mq, AttributeStoreHandle::ns_qe, SuccessResultMessage::op_result, AttributeStoreHandle::r_id, IdpClient::store_op_head, and IdpClient::store_op_tail.
Referenced by attr_store_task().
|
static |
Add a new attribute.
cls | the AttributeStoreHandle |
Definition at line 1082 of file gnunet-service-reclaim.c.
References attr_store_cont(), AttributeStoreHandle::claim, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, AttributeStoreHandle::exp, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE, GNUNET_log, GNUNET_malloc, GNUNET_NAMESTORE_record_set_store(), GNUNET_RECLAIM_attribute_serialize(), GNUNET_RECLAIM_attribute_serialize_get_size(), GNUNET_RECLAIM_id_generate, GNUNET_RECLAIM_id_is_zero, GNUNET_STRINGS_data_to_string_alloc(), GNUNET_YES, GNUNET_RECLAIM_Attribute::id, AttributeStoreHandle::identity, AttributeStoreHandle::ns_qe, nsh, rd, GNUNET_GNSRECORD_Data::record_type, and GNUNET_TIME_Relative::rel_value_us.
Referenced by handle_attribute_store_message().
|
static |
Check an attribute store message.
cls | unused |
sam | the message to check |
Definition at line 1126 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, AttributeStoreMessage::header, GNUNET_MessageHeader::size, and size.
|
static |
Handle an attribute store message.
cls | our client |
sam | the message to handle |
Definition at line 1148 of file gnunet-service-reclaim.c.
References AttributeStoreMessage::attr_len, attr_store_task(), AttributeStoreHandle::claim, AttributeStoreHandle::client, GNUNET_RECLAIM_Handle::client, AttributeStoreHandle::exp, AttributeStoreMessage::exp, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_key_get_public(), GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_new, GNUNET_ntohll(), GNUNET_RECLAIM_attribute_deserialize(), GNUNET_SCHEDULER_add_now(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, AttributeStoreMessage::id, identity, AttributeStoreHandle::identity, AttributeStoreHandle::identity_pkey, idp, AttributeStoreMessage::key_len, AttributeStoreHandle::r_id, and GNUNET_TIME_Relative::rel_value_us.
|
static |
Credential store result handler.
cls | our attribute store handle |
success | GNUNET_OK if successful |
emsg | error message (NULL if success=GNUNET_OK) |
Definition at line 1200 of file gnunet-service-reclaim.c.
References cleanup_as_handle(), AttributeStoreHandle::client, do_shutdown(), env, GNUNET_CONTAINER_DLL_remove, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ErrorCode_get_hint(), GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_SUCCESS_RESPONSE, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_OK, GNUNET_SCHEDULER_add_now(), SuccessResultMessage::id, IdpClient::mq, AttributeStoreHandle::ns_qe, SuccessResultMessage::op_result, AttributeStoreHandle::r_id, IdpClient::store_op_head, and IdpClient::store_op_tail.
Referenced by cred_add_cb().
|
static |
Error looking up potential credential.
Abort.
cls | our attribute store handle |
Definition at line 1236 of file gnunet-service-reclaim.c.
References cleanup_as_handle(), do_shutdown(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log, and GNUNET_SCHEDULER_add_now().
Referenced by cred_store_task().
|
static |
Check for existing record before storing credential.
cls | our attribute store handle |
zone | zone we are iterating |
label | label of the records |
rd_count | record count |
rd | records |
Definition at line 1257 of file gnunet-service-reclaim.c.
References cred_store_cont(), AttributeStoreHandle::credential, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, AttributeStoreHandle::exp, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL, GNUNET_log, GNUNET_malloc, GNUNET_NAMESTORE_record_set_store(), GNUNET_RECLAIM_credential_serialize(), GNUNET_RECLAIM_credential_serialize_get_size(), AttributeStoreHandle::identity, AttributeStoreHandle::ns_qe, nsh, GNUNET_GNSRECORD_Data::record_type, and GNUNET_TIME_Relative::rel_value_us.
Referenced by cred_store_task().
|
static |
Add a new credential.
cls | the AttributeStoreHandle |
Definition at line 1297 of file gnunet-service-reclaim.c.
References cred_add_cb(), cred_error(), AttributeStoreHandle::credential, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NAMESTORE_records_lookup(), GNUNET_RECLAIM_id_generate, GNUNET_RECLAIM_id_is_zero, GNUNET_STRINGS_data_to_string_alloc(), GNUNET_YES, GNUNET_RECLAIM_Credential::id, AttributeStoreHandle::identity, AttributeStoreHandle::ns_qe, and nsh.
Referenced by handle_credential_store_message().
|
static |
Check an credential store message.
cls | unused |
sam | the message to check |
Definition at line 1327 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, AttributeStoreMessage::header, GNUNET_MessageHeader::size, and size.
|
static |
Handle a credential store message.
cls | our client |
sam | the message to handle |
Definition at line 1349 of file gnunet-service-reclaim.c.
References AttributeStoreMessage::attr_len, AttributeStoreHandle::client, GNUNET_RECLAIM_Handle::client, cred_store_task(), AttributeStoreHandle::credential, AttributeStoreHandle::exp, AttributeStoreMessage::exp, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_key_get_public(), GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_new, GNUNET_ntohll(), GNUNET_RECLAIM_credential_deserialize(), GNUNET_SCHEDULER_add_now(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, AttributeStoreMessage::id, identity, AttributeStoreHandle::identity, AttributeStoreHandle::identity_pkey, idp, AttributeStoreMessage::key_len, AttributeStoreHandle::r_id, and GNUNET_TIME_Relative::rel_value_us.
|
static |
Send a deletion success response.
adh | our attribute deletion handle |
success | the success status |
Definition at line 1399 of file gnunet-service-reclaim.c.
References AttributeDeleteHandle::client, IdpClient::delete_op_head, IdpClient::delete_op_tail, env, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_SUCCESS_RESPONSE, GNUNET_MQ_msg, GNUNET_MQ_send(), SuccessResultMessage::id, IdpClient::mq, SuccessResultMessage::op_result, and AttributeDeleteHandle::r_id.
Referenced by attr_delete_cont(), consistency_iter_err(), cred_delete_cont(), offending_attr_delete_cont(), and update_tickets().
|
static |
Namestore iteration within attribute deletion.
We need to reissue tickets with the deleted attribute removed.
cls | our attribute deletion handle |
zone | the private key of the ticket issuer |
label | the label of the record |
rd_count | number of records |
rd | record data |
Definition at line 1427 of file gnunet-service-reclaim.c.
References GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_RECLAIM_CredentialListEntry::credential, data, TicketRecordsEntry::data, data_size, TicketRecordsEntry::data_size, AttributeDeleteHandle::existing_attributes, AttributeDeleteHandle::existing_credentials, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_GNSRECORD_records_get_size(), GNUNET_GNSRECORD_records_serialize(), GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE, GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL, GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET, GNUNET_log, GNUNET_malloc, GNUNET_NAMESTORE_zone_iterator_next(), GNUNET_new, GNUNET_NO, GNUNET_RECLAIM_attribute_deserialize(), GNUNET_RECLAIM_credential_deserialize(), GNUNET_strdup, GNUNET_YES, TicketRecordsEntry::label, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_CredentialList::list_head, GNUNET_RECLAIM_AttributeList::list_tail, GNUNET_RECLAIM_CredentialList::list_tail, AttributeDeleteHandle::ns_it, rd, rd_count, TicketRecordsEntry::rd_count, AttributeDeleteHandle::tickets_to_update_head, and AttributeDeleteHandle::tickets_to_update_tail.
Referenced by start_consistency_update().
|
static |
Recursion prototype for function.
Update tickets: Remove shared attribute which has just been deleted.
cls | our deletion handle |
This method is called recursively until all tickets are processed. Eventually, the updated tickets are stored using `‘update_tickets’'.
cls | our attribute deletion handle |
Definition at line 1520 of file gnunet-service-reclaim.c.
References GNUNET_RECLAIM_AttributeListEntry::attribute, cleanup_adh(), GNUNET_RECLAIM_CredentialListEntry::credential, GNUNET_RECLAIM_Presentation::credential_id, data, GNUNET_GNSRECORD_Data::data, data_size, GNUNET_GNSRECORD_Data::data_size, AttributeDeleteHandle::existing_attributes, AttributeDeleteHandle::existing_credentials, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_records_deserialize(), GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF, GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION, GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET, GNUNET_log, GNUNET_NAMESTORE_record_set_store(), GNUNET_OK, GNUNET_RECLAIM_id_is_equal, GNUNET_RECLAIM_presentation_deserialize(), GNUNET_SYSERR, GNUNET_YES, GNUNET_RECLAIM_Attribute::id, GNUNET_RECLAIM_Credential::id, AttributeDeleteHandle::identity, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_CredentialList::list_head, GNUNET_RECLAIM_Attribute::name, GNUNET_RECLAIM_Credential::name, GNUNET_RECLAIM_AttributeListEntry::next, GNUNET_RECLAIM_CredentialListEntry::next, AttributeDeleteHandle::ns_qe, nsh, rd, rd_count, GNUNET_GNSRECORD_Data::record_type, send_delete_response(), ticket_updated(), AttributeDeleteHandle::tickets_to_update_head, and AttributeDeleteHandle::tickets_to_update_tail.
Referenced by purge_attributes(), and ticket_updated().
|
static |
Callback called when a ticket was updated.
cls | our attribute deletion handle |
success | GNUNET_OK if successful |
emsg | error message (NULL if success=GNUNET_OK) |
Definition at line 1503 of file gnunet-service-reclaim.c.
References GNUNET_SCHEDULER_add_now(), AttributeDeleteHandle::ns_qe, and update_tickets().
Referenced by update_tickets().
|
static |
Delete all attributes which reference credentials that no longer exist.
Definition at line 1655 of file gnunet-service-reclaim.c.
References GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_RECLAIM_Attribute::credential, GNUNET_RECLAIM_CredentialListEntry::credential, AttributeDeleteHandle::existing_attributes, AttributeDeleteHandle::existing_credentials, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_NAMESTORE_record_set_store(), GNUNET_RECLAIM_id_is_equal, GNUNET_RECLAIM_id_is_zero, GNUNET_SCHEDULER_add_now(), GNUNET_STRINGS_data_to_string_alloc(), GNUNET_YES, GNUNET_RECLAIM_Attribute::id, GNUNET_RECLAIM_Credential::id, AttributeDeleteHandle::identity, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_CredentialList::list_head, GNUNET_RECLAIM_AttributeList::list_tail, GNUNET_RECLAIM_AttributeListEntry::next, GNUNET_RECLAIM_CredentialListEntry::next, AttributeDeleteHandle::ns_qe, nsh, offending_attr_delete_cont(), and update_tickets().
Referenced by consistency_iter_fin(), and offending_attr_delete_cont().
|
static |
Definition at line 1631 of file gnunet-service-reclaim.c.
References cleanup_adh(), GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SCHEDULER_add_now(), GNUNET_SYSERR, AttributeDeleteHandle::label, AttributeDeleteHandle::ns_qe, purge_attributes(), and send_delete_response().
Referenced by purge_attributes().
|
static |
Done collecting affected tickets, start updating.
cls | our attribute deletion handle |
Definition at line 1717 of file gnunet-service-reclaim.c.
References GNUNET_SCHEDULER_add_now(), AttributeDeleteHandle::ns_it, and purge_attributes().
Referenced by start_consistency_update().
|
static |
Error collecting affected tickets.
Abort.
cls | our attribute deletion handle |
Definition at line 1731 of file gnunet-service-reclaim.c.
References cleanup_adh(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SYSERR, AttributeDeleteHandle::ns_it, and send_delete_response().
Referenced by start_consistency_update().
|
static |
Start processing tickets which may still contain reference to deleted attribute.
cls | attribute deletion handle |
Definition at line 1750 of file gnunet-service-reclaim.c.
References consistency_iter(), consistency_iter_err(), consistency_iter_fin(), AttributeDeleteHandle::existing_attributes, AttributeDeleteHandle::existing_credentials, GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_new, AttributeDeleteHandle::identity, AttributeDeleteHandle::ns_it, and nsh.
Referenced by attr_delete_cont(), and cred_delete_cont().
|
static |
Attribute deleted callback.
cls | our handle |
success | success status |
emsg | error message (NULL if success=GNUNET_OK) |
Definition at line 1776 of file gnunet-service-reclaim.c.
References cleanup_adh(), GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SCHEDULER_add_now(), GNUNET_SYSERR, AttributeDeleteHandle::label, AttributeDeleteHandle::ns_qe, send_delete_response(), and start_consistency_update().
Referenced by handle_attribute_delete_message().
|
static |
Check attribute delete message format.
cls | unused |
dam | message to check |
Definition at line 1802 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, AttributeDeleteMessage::header, GNUNET_MessageHeader::size, and size.
|
static |
Handle attribute deletion.
cls | our client |
dam | deletion message |
Definition at line 1824 of file gnunet-service-reclaim.c.
References attr_delete_cont(), AttributeDeleteMessage::attr_len, AttributeDeleteHandle::claim, AttributeDeleteHandle::client, GNUNET_RECLAIM_Handle::client, AttributeDeleteHandle::credential, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_NAMESTORE_record_set_store(), GNUNET_new, GNUNET_RECLAIM_attribute_deserialize(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_STRINGS_data_to_string_alloc(), GNUNET_SYSERR, GNUNET_RECLAIM_Attribute::id, AttributeDeleteMessage::id, identity, AttributeDeleteHandle::identity, idp, AttributeDeleteMessage::key_len, AttributeDeleteHandle::label, AttributeDeleteHandle::ns_qe, nsh, and AttributeDeleteHandle::r_id.
|
static |
Credential deleted callback.
cls | our handle |
success | success status |
emsg | error message (NULL if success=GNUNET_OK) |
Definition at line 1883 of file gnunet-service-reclaim.c.
References cleanup_adh(), GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SCHEDULER_add_now(), GNUNET_SYSERR, AttributeDeleteHandle::label, AttributeDeleteHandle::ns_qe, send_delete_response(), and start_consistency_update().
Referenced by handle_credential_delete_message().
|
static |
Check credential delete message format.
cls | unused |
dam | message to check |
Definition at line 1909 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, AttributeDeleteMessage::header, GNUNET_MessageHeader::size, and size.
|
static |
Handle credential deletion.
cls | our client |
dam | deletion message |
Definition at line 1931 of file gnunet-service-reclaim.c.
References AttributeDeleteMessage::attr_len, AttributeDeleteHandle::claim, AttributeDeleteHandle::client, GNUNET_RECLAIM_Handle::client, cred_delete_cont(), AttributeDeleteHandle::credential, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_NAMESTORE_record_set_store(), GNUNET_new, GNUNET_RECLAIM_credential_deserialize(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_STRINGS_data_to_string_alloc(), GNUNET_SYSERR, GNUNET_RECLAIM_Credential::id, AttributeDeleteMessage::id, identity, AttributeDeleteHandle::identity, idp, AttributeDeleteMessage::key_len, AttributeDeleteHandle::label, AttributeDeleteHandle::ns_qe, nsh, and AttributeDeleteHandle::r_id.
|
static |
Done iterating over attributes.
cls | our iterator handle |
Definition at line 1992 of file gnunet-service-reclaim.c.
References ai, AttributeResultMessage::attr_len, env, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT, GNUNET_MQ_msg, GNUNET_MQ_send(), AttributeResultMessage::id, and AttributeResultMessage::pkey_len.
Referenced by attr_iter_error(), and handle_iteration_start().
|
static |
Error iterating over attributes.
Abort.
cls | our attribute iteration handle |
Definition at line 2017 of file gnunet-service-reclaim.c.
References ai, attr_iter_finished(), GNUNET_ERROR_TYPE_ERROR, and GNUNET_log.
Referenced by handle_iteration_start().
|
static |
Got record.
Return if it is an attribute.
cls | our attribute iterator |
zone | zone we are iterating |
label | label of the records |
rd_count | record count |
rd | records |
Definition at line 2036 of file gnunet-service-reclaim.c.
References ai, AttributeResultMessage::attr_len, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, env, GNUNET_assert, GNUNET_CRYPTO_key_get_public(), GNUNET_CRYPTO_public_key_get_length(), GNUNET_CRYPTO_write_public_key_to_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NAMESTORE_zone_iterator_next(), AttributeResultMessage::id, identity, AttributeResultMessage::pkey_len, rd, rd_count, and GNUNET_GNSRECORD_Data::record_type.
Referenced by handle_iteration_start().
|
static |
Definition at line 2080 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, AttributeIterationStartMessage::header, AttributeIterationStartMessage::key_len, GNUNET_MessageHeader::size, and size.
|
static |
Iterate over zone to get attributes.
cls | our client |
ais_msg | the iteration message to start |
Definition at line 2106 of file gnunet-service-reclaim.c.
References ai, attr_iter_cb(), attr_iter_error(), attr_iter_finished(), GNUNET_RECLAIM_Handle::client, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_new, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, AttributeIterationStartMessage::id, identity, idp, AttributeIterationStartMessage::key_len, and nsh.
|
static |
Handle iteration stop message from client.
cls | the client |
ais_msg | the stop message |
Definition at line 2155 of file gnunet-service-reclaim.c.
References ai, GNUNET_RECLAIM_Handle::client, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), AttributeIterationStopMessage::id, idp, and GNUNET_TRANSPORT_AddressIdentifier::next.
|
static |
Client requests next attribute from iterator.
cls | the client |
ais_msg | the message |
Definition at line 2188 of file gnunet-service-reclaim.c.
References ai, GNUNET_RECLAIM_Handle::client, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NAMESTORE_zone_iterator_next(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), AttributeIterationNextMessage::id, idp, and GNUNET_TRANSPORT_AddressIdentifier::next.
|
static |
Done iterating over credentials.
cls | our iterator handle |
Definition at line 2223 of file gnunet-service-reclaim.c.
References ai, CredentialResultMessage::credential_len, env, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT, GNUNET_MQ_msg, GNUNET_MQ_send(), CredentialResultMessage::id, and CredentialResultMessage::key_len.
Referenced by cred_iter_error(), and handle_credential_iteration_start().
|
static |
Error iterating over credentials.
Abort.
cls | our attribute iteration handle |
Definition at line 2248 of file gnunet-service-reclaim.c.
References ai, cred_iter_finished(), GNUNET_ERROR_TYPE_ERROR, and GNUNET_log.
Referenced by handle_credential_iteration_start().
|
static |
Got record.
Return credential.
cls | our attribute iterator |
zone | zone we are iterating |
label | label of the records |
rd_count | record count |
rd | records |
Definition at line 2267 of file gnunet-service-reclaim.c.
References ai, CredentialResultMessage::credential_len, GNUNET_GNSRECORD_Data::data, GNUNET_GNSRECORD_Data::data_size, env, GNUNET_assert, GNUNET_CRYPTO_key_get_public(), GNUNET_CRYPTO_public_key_get_length(), GNUNET_CRYPTO_write_public_key_to_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL, GNUNET_log, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_NAMESTORE_zone_iterator_next(), CredentialResultMessage::id, identity, CredentialResultMessage::key_len, rd, rd_count, and GNUNET_GNSRECORD_Data::record_type.
Referenced by handle_credential_iteration_start().
|
static |
Definition at line 2311 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, CredentialIterationStartMessage::header, CredentialIterationStartMessage::key_len, GNUNET_MessageHeader::size, and size.
|
static |
Iterate over zone to get attributes.
cls | our client |
ais_msg | the iteration message to start |
Definition at line 2337 of file gnunet-service-reclaim.c.
References ai, GNUNET_RECLAIM_Handle::client, cred_iter_cb(), cred_iter_error(), cred_iter_finished(), GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_new, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, CredentialIterationStartMessage::id, identity, idp, CredentialIterationStartMessage::key_len, and nsh.
|
static |
Handle iteration stop message from client.
cls | the client |
ais_msg | the stop message |
Definition at line 2388 of file gnunet-service-reclaim.c.
References ai, GNUNET_RECLAIM_Handle::client, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), CredentialIterationStopMessage::id, idp, and GNUNET_TRANSPORT_AddressIdentifier::next.
|
static |
Client requests next credential from iterator.
cls | the client |
ais_msg | the message |
Definition at line 2423 of file gnunet-service-reclaim.c.
References ai, GNUNET_RECLAIM_Handle::client, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NAMESTORE_zone_iterator_next(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), CredentialIterationNextMessage::id, idp, and GNUNET_TRANSPORT_AddressIdentifier::next.
|
static |
Definition at line 2453 of file gnunet-service-reclaim.c.
References TicketIteration::client, env, GNUNET_RECLAIM_Ticket::gns_name, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), TicketResultMessage::id, IdpClient::mq, TicketResultMessage::presentations_len, TicketIteration::r_id, TicketResultMessage::rp_uri_len, ticket, IdpClient::ticket_iter_head, IdpClient::ticket_iter_tail, and TicketResultMessage::tkt_len.
Referenced by handle_ticket_iteration_start().
|
static |
Definition at line 2498 of file gnunet-service-reclaim.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, TicketIterationStartMessage::header, TicketIterationStartMessage::key_len, GNUNET_MessageHeader::size, and size.
|
static |
Client requests a ticket iteration.
cls | the client |
tis_msg | the iteration request message |
Definition at line 2524 of file gnunet-service-reclaim.c.
References TicketIteration::client, IdpClient::client, GNUNET_CONTAINER_DLL_insert, GNUNET_CRYPTO_read_private_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_new, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SYSERR, TicketIterationStartMessage::id, identity, TicketIteration::iter, TicketIterationStartMessage::key_len, TicketIteration::r_id, RECLAIM_TICKETS_iteration_start(), ticket_iter_cb(), IdpClient::ticket_iter_head, and IdpClient::ticket_iter_tail.
|
static |
Client has had enough tickets.
cls | the client |
tis_msg | the stop message |
Definition at line 2568 of file gnunet-service-reclaim.c.
References TicketIteration::client, IdpClient::client, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), TicketIterationStopMessage::id, TicketIteration::iter, TicketIteration::next, TicketIteration::r_id, RECLAIM_TICKETS_iteration_stop(), IdpClient::ticket_iter_head, and IdpClient::ticket_iter_tail.
|
static |
Client requests next result.
cls | the client |
tis_msg | the message |
Definition at line 2604 of file gnunet-service-reclaim.c.
References TicketIteration::client, IdpClient::client, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), TicketIterationNextMessage::id, TicketIteration::iter, TicketIteration::next, TicketIteration::r_id, RECLAIM_TICKETS_iteration_next(), and IdpClient::ticket_iter_head.
|
static |
Main function that will be run.
cls | closure |
c | the configuration used |
server | the service handle |
Definition at line 2636 of file gnunet-service-reclaim.c.
References cfg, do_shutdown(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_log_strerror, GNUNET_NAMESTORE_connect(), GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), nsh, and RECLAIM_TICKETS_init().
|
static |
Called whenever a client is disconnected.
cls | closure |
client | identification of the client |
app_ctx | client |
Definition at line 2669 of file gnunet-service-reclaim.c.
References cleanup_client(), IdpClient::client, client_list_head, client_list_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, and idp.
|
static |
Add a client to our list of active clients.
cls | NULL |
client | client to add |
mq | message queue for client |
Definition at line 2692 of file gnunet-service-reclaim.c.
References IdpClient::client, GNUNET_RECLAIM_Handle::client, client_list_head, client_list_tail, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, idp, mq, and GNUNET_RECLAIM_Handle::mq.
Define "main" method using service macro.
|
static |
Namestore handle.
Definition at line 37 of file gnunet-service-reclaim.c.
Referenced by attr_store_task(), cleanup(), cred_add_cb(), cred_store_task(), handle_attribute_delete_message(), handle_credential_delete_message(), handle_credential_iteration_start(), handle_iteration_start(), purge_attributes(), run(), start_consistency_update(), and update_tickets().
|
static |
|
static |
|
static |
Client list.
Definition at line 471 of file gnunet-service-reclaim.c.
Referenced by client_connect_cb(), and client_disconnect_cb().
|
static |
Client list.
Definition at line 476 of file gnunet-service-reclaim.c.
Referenced by client_connect_cb(), and client_disconnect_cb().