library to access the ABD service More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_arm_service.h"
#include "gnunet_hello_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_signatures.h"
#include "abd.h"
#include "abd_serialization.h"
#include "gnunet_abd_service.h"
#include "gnunet_identity_service.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_ABD_Request |
Handle to a verify request. More... | |
struct | GNUNET_ABD_Handle |
Connection to the ABD service. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "abd-api", __VA_ARGS__) |
Functions | |
static void | reconnect (struct GNUNET_ABD_Handle *handle) |
Reconnect to ABD service. More... | |
static void | reconnect_task (void *cls) |
Reconnect to ABD. More... | |
static void | force_reconnect (struct GNUNET_ABD_Handle *handle) |
Disconnect from service and then reconnect. More... | |
static void | mq_error_handler (void *cls, enum GNUNET_MQ_Error error) |
Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue. More... | |
static int | check_result (void *cls, const struct DelegationChainResultMessage *vr_msg) |
Check validity of message received from the ABD service. More... | |
static void | handle_result (void *cls, const struct DelegationChainResultMessage *vr_msg) |
Handler for messages received from the ABD service. More... | |
static int | check_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg) |
static void | handle_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg) |
struct GNUNET_ABD_Handle * | GNUNET_ABD_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Initialize the connection with the ABD service. More... | |
void | GNUNET_ABD_disconnect (struct GNUNET_ABD_Handle *handle) |
Shutdown connection with the ABD service. More... | |
void | GNUNET_ABD_request_cancel (struct GNUNET_ABD_Request *lr) |
Cancel pending verify request. More... | |
struct GNUNET_ABD_Request * | GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle, const struct GNUNET_IDENTITY_PublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_IDENTITY_PrivateKey *subject_key, enum GNUNET_ABD_AlgoDirectionFlags direction, GNUNET_ABD_CredentialResultProcessor proc, void *proc_cls, GNUNET_ABD_IntermediateResultProcessor proc2, void *proc2_cls) |
Performs attribute collection. More... | |
struct GNUNET_ABD_Request * | GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle, const struct GNUNET_IDENTITY_PublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_IDENTITY_PublicKey *subject_key, uint32_t delegate_count, const struct GNUNET_ABD_Delegate *delegates, enum GNUNET_ABD_AlgoDirectionFlags direction, GNUNET_ABD_CredentialResultProcessor proc, void *proc_cls, GNUNET_ABD_IntermediateResultProcessor proc2, void *proc2_cls) |
Performs attribute verification. More... | |
library to access the ABD service
Definition in file abd_api.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "abd-api", __VA_ARGS__) |
|
static |
Reconnect to ABD service.
handle | the handle to the ABD service |
Definition at line 316 of file abd_api.c.
References GNUNET_DNS_Handle::cfg, GNUNET_ABD_Request::env, GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_MESSAGE_TYPE_ABD_COLLECT_RESULT, GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT, GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_MQ_send_copy(), handle, handlers, LOG, GNUNET_DNS_Handle::mq, mq_error_handler(), GNUNET_ABD_Request::next, and result.
Referenced by GNUNET_ABD_connect(), and reconnect_task().
|
static |
Reconnect to ABD.
cls | the handle |
Definition at line 151 of file abd_api.c.
References handle, reconnect(), and GNUNET_DNS_Handle::reconnect_task.
Referenced by force_reconnect().
|
static |
Disconnect from service and then reconnect.
handle | our handle |
Definition at line 166 of file abd_api.c.
References GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_STD_BACKOFF, handle, GNUNET_DNS_Handle::mq, reconnect_task(), and GNUNET_DNS_Handle::reconnect_task.
Referenced by mq_error_handler().
|
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_ABD_Handle * |
error | error code |
Definition at line 188 of file abd_api.c.
References force_reconnect(), and handle.
Referenced by reconnect().
|
static |
Check validity of message received from the ABD service.
cls | the struct GNUNET_ABD_Handle * |
vr_msg | the incoming message |
Definition at line 203 of file abd_api.c.
References GNUNET_OK.
|
static |
Handler for messages received from the ABD service.
cls | the struct GNUNET_ABD_Handle * |
vr_msg | the incoming message |
Definition at line 217 of file abd_api.c.
References DelegationChainResultMessage::c_count, DelegationChainResultMessage::d_count, DelegationChainResultMessage::del_found, GNUNET_ABD_Request::env, GNUNET_ABD_delegation_chain_deserialize(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_MQ_discard(), GNUNET_NO, GNUNET_OK, handle, DelegationChainResultMessage::header, DelegationChainResultMessage::id, LOG, GNUNET_ABD_Request::next, GNUNET_ABD_Request::proc_cls, GNUNET_ABD_Request::r_id, GNUNET_MessageHeader::size, and GNUNET_ABD_Request::verify_proc.
|
static |
|
static |
Definition at line 272 of file abd_api.c.
References GNUNET_ABD_delegation_chain_deserialize(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_new, GNUNET_OK, handle, DelegationChainIntermediateMessage::id, GNUNET_ABD_Request::int_proc, DelegationChainIntermediateMessage::is_bw, LOG, GNUNET_ABD_Request::next, GNUNET_ABD_Request::proc2_cls, GNUNET_ABD_Request::proc_cls, GNUNET_ABD_Request::r_id, DelegationChainIntermediateMessage::size, and size.