api to interact with the reclaim service More...
#include "platform.h"
#include "gnunet_util_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 | GNUNET_RECLAIM_Operation |
Handle for an operation with the service. More... | |
struct | GNUNET_RECLAIM_TicketIterator |
Handle for a ticket iterator operation. More... | |
struct | GNUNET_RECLAIM_AttributeIterator |
Handle for a attribute iterator operation. More... | |
struct | GNUNET_RECLAIM_CredentialIterator |
Handle for a credential iterator operation. More... | |
struct | GNUNET_RECLAIM_Handle |
Handle to the service. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "reclaim-api", __VA_ARGS__) |
api to interact with the reclaim service
Definition in file reclaim_api.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "reclaim-api", __VA_ARGS__) |
Definition at line 33 of file reclaim_api.c.
|
static |
Try again to connect to the service.
h | handle to the reclaim service. |
Definition at line 1069 of file reclaim_api.c.
References GNUNET_ARM_Handle::cfg, GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT, GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT, GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT, GNUNET_MESSAGE_TYPE_RECLAIM_SUCCESS_RESPONSE, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_MQ_send_copy(), h, handlers, LOG, GNUNET_ARM_Handle::mq, mq_error_handler(), GNUNET_ARM_Operation::next, and op.
Referenced by GNUNET_RECLAIM_connect(), GNUNET_RECLAIM_ticket_consume(), and reconnect_task().
|
static |
Reconnect.
cls | the handle |
Definition at line 419 of file reclaim_api.c.
References handle, and reconnect().
Referenced by force_reconnect().
|
static |
Disconnect from service and then reconnect.
handle | our service |
Definition at line 434 of file reclaim_api.c.
References GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_STD_BACKOFF, handle, GNUNET_VPN_Handle::mq, and reconnect_task().
Referenced by handle_attribute_result(), handle_credential_result(), and mq_error_handler().
|
static |
Free it.
it | entry to free |
Definition at line 453 of file reclaim_api.c.
References GNUNET_RECLAIM_AttributeIterator::env, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MQ_discard(), h, and GNUNET_RECLAIM_AttributeIterator::h.
Referenced by GNUNET_RECLAIM_get_attributes_stop(), and handle_attribute_result().
|
static |
Free it.
ait | entry to free |
Definition at line 470 of file reclaim_api.c.
References GNUNET_RECLAIM_CredentialIterator::env, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MQ_discard(), h, and GNUNET_RECLAIM_CredentialIterator::h.
Referenced by GNUNET_RECLAIM_get_credentials_stop(), and handle_credential_result().
|
static |
Free op.
op | the operation to free |
Definition at line 487 of file reclaim_api.c.
References GNUNET_free, GNUNET_MQ_discard(), and op.
Referenced by GNUNET_RECLAIM_cancel(), handle_attribute_result(), handle_consume_ticket_result(), handle_credential_result(), handle_revoke_ticket_result(), handle_success_response(), and handle_ticket_result().
|
static |
Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue.
Not every message queue implementation supports an error handler.
cls | closure with the struct GNUNET_GNS_Handle * |
error | error code |
Definition at line 506 of file reclaim_api.c.
References force_reconnect(), and handle.
Referenced by reconnect().
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_SUCCESS_RESPONSE.
cls | |
msg | the message we received |
Definition at line 522 of file reclaim_api.c.
References _, free_op(), GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_SYSERR, h, LOG, msg, GNUNET_ARM_Operation::next, op, GNUNET_RECLAIM_Operation::r_id, and res.
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT.
cls | |
msg | the message we received |
Definition at line 562 of file reclaim_api.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, msg, and GNUNET_MessageHeader::size.
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT.
cls | |
msg | the message we received |
Definition at line 591 of file reclaim_api.c.
References GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_RECLAIM_Attribute::credential, GNUNET_RECLAIM_Presentation::credential_id, free_op(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CRYPTO_read_public_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_RECLAIM_attribute_list_deserialize(), GNUNET_RECLAIM_attribute_list_destroy(), GNUNET_RECLAIM_id_is_equal, GNUNET_RECLAIM_id_is_zero, GNUNET_RECLAIM_presentation_list_deserialize(), GNUNET_RECLAIM_presentation_list_destroy(), GNUNET_SYSERR, GNUNET_YES, h, identity, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_PresentationList::list_head, msg, GNUNET_RECLAIM_AttributeListEntry::next, GNUNET_RECLAIM_PresentationListEntry::next, GNUNET_ARM_Operation::next, op, GNUNET_RECLAIM_PresentationListEntry::presentation, and GNUNET_RECLAIM_Operation::r_id.
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT.
cls | |
msg | the message we received |
Definition at line 689 of file reclaim_api.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, msg, and GNUNET_MessageHeader::size.
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT.
cls | |
msg | the message we received |
Definition at line 715 of file reclaim_api.c.
References GNUNET_RECLAIM_AttributeIterator::finish_cb, GNUNET_RECLAIM_AttributeIterator::finish_cb_cls, force_reconnect(), free_it(), free_op(), GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_CRYPTO_read_public_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_RECLAIM_attribute_deserialize(), GNUNET_SYSERR, h, identity, LOG, msg, GNUNET_ARM_Operation::next, GNUNET_RECLAIM_AttributeIterator::next, op, GNUNET_RECLAIM_AttributeIterator::proc, GNUNET_RECLAIM_AttributeIterator::proc_cls, GNUNET_RECLAIM_Operation::r_id, and GNUNET_RECLAIM_AttributeIterator::r_id.
|
static |
Handle an incoming message of type #GNUNET_MESSAGE_TYPE_RECLAIM_credential_RESULT.
cls | |
msg | the message we received |
Definition at line 800 of file reclaim_api.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, msg, and GNUNET_MessageHeader::size.
|
static |
Handle an incoming message of type #GNUNET_MESSAGE_TYPE_RECLAIM_credential_RESULT.
cls | |
msg | the message we received |
Definition at line 826 of file reclaim_api.c.
References GNUNET_RECLAIM_CredentialIterator::finish_cb, GNUNET_RECLAIM_CredentialIterator::finish_cb_cls, force_reconnect(), free_ait(), free_op(), GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_CRYPTO_read_public_key_from_buffer(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_RECLAIM_credential_deserialize(), GNUNET_SYSERR, h, identity, LOG, msg, GNUNET_ARM_Operation::next, GNUNET_RECLAIM_CredentialIterator::next, op, GNUNET_RECLAIM_CredentialIterator::proc, GNUNET_RECLAIM_CredentialIterator::proc_cls, GNUNET_RECLAIM_Operation::r_id, and GNUNET_RECLAIM_CredentialIterator::r_id.
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT.
cls | |
msg | the message we received |
Definition at line 917 of file reclaim_api.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, msg, and GNUNET_MessageHeader::size.
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT.
cls | |
msg | the message we received |
Definition at line 945 of file reclaim_api.c.
References GNUNET_RECLAIM_TicketIterator::cls, GNUNET_RECLAIM_TicketIterator::finish_cb, GNUNET_RECLAIM_TicketIterator::finish_cb_cls, free_op(), GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_RECLAIM_presentation_list_deserialize(), GNUNET_RECLAIM_presentation_list_destroy(), handle, msg, GNUNET_ARM_Operation::next, GNUNET_RECLAIM_TicketIterator::next, op, GNUNET_RECLAIM_TicketIterator::r_id, ticket, and GNUNET_RECLAIM_TicketIterator::tr_cb.
|
static |
Handle an incoming message of type GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT.
cls | |
msg | the message we received |
Definition at line 1033 of file reclaim_api.c.
References free_op(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, h, LOG, msg, GNUNET_ARM_Operation::next, op, and GNUNET_RECLAIM_Operation::r_id.