Data Structures | |
struct | GNUNET_SCALARPRODUCT_Element |
An element key-value pair for scalarproduct. More... | |
Macros | |
#define | GCRYPT_NO_DEPRECATED |
#define | GNUNET_SCALARPRODUCT_VERSION 0x00000044 |
Version of the scalarproduct API. More... | |
Typedefs | |
typedef void(* | GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls, enum GNUNET_SCALARPRODUCT_ResponseStatus status, gcry_mpi_t result) |
Process a datum that was stored in the scalarproduct. More... | |
Enumerations | |
enum | GNUNET_SCALARPRODUCT_ResponseStatus { GNUNET_SCALARPRODUCT_STATUS_INIT = 0 , GNUNET_SCALARPRODUCT_STATUS_ACTIVE = 1 , GNUNET_SCALARPRODUCT_STATUS_SUCCESS , GNUNET_SCALARPRODUCT_STATUS_FAILURE , GNUNET_SCALARPRODUCT_STATUS_INVALID_RESPONSE , GNUNET_SCALARPRODUCT_STATUS_DISCONNECTED } |
Result status values for the computation. More... | |
Functions | |
struct GNUNET_SCALARPRODUCT_ComputationHandle * | GNUNET_SCALARPRODUCT_start_computation (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HashCode *session_key, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_SCALARPRODUCT_Element *elements, uint32_t element_count, GNUNET_SCALARPRODUCT_DatumProcessor cont, void *cont_cls) |
Request by Alice's client for computing a scalar product. More... | |
struct GNUNET_SCALARPRODUCT_ComputationHandle * | GNUNET_SCALARPRODUCT_accept_computation (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HashCode *session_key, const struct GNUNET_SCALARPRODUCT_Element *elements, uint32_t element_count, GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, void *cont_cls) |
Used by Bob's client to cooperate with Alice,. More... | |
void | GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle *h) |
Cancel an ongoing computation or revoke our collaboration offer. More... | |
Variables | |
GNUNET_NETWORK_STRUCT_END typedef void(* | GNUNET_SCALARPRODUCT_ContinuationWithStatus )(void *cls, enum GNUNET_SCALARPRODUCT_ResponseStatus status) |
Continuation called to notify client about result of the operation. More... | |
#define GCRYPT_NO_DEPRECATED |
Definition at line 33 of file gnunet_scalarproduct_service.h.
#define GNUNET_SCALARPRODUCT_VERSION 0x00000044 |
Version of the scalarproduct API.
Definition at line 47 of file gnunet_scalarproduct_service.h.
typedef void(* GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls, enum GNUNET_SCALARPRODUCT_ResponseStatus status, gcry_mpi_t result) |
Process a datum that was stored in the scalarproduct.
cls | closure |
status | Status of the request |
result | result of the computation |
Definition at line 133 of file gnunet_scalarproduct_service.h.
Result status values for the computation.
Enumerator | |
---|---|
GNUNET_SCALARPRODUCT_STATUS_INIT | Operation is still active (never returned, used internally). |
GNUNET_SCALARPRODUCT_STATUS_ACTIVE | Operation is still active (never returned, used internally). |
GNUNET_SCALARPRODUCT_STATUS_SUCCESS | The computation was successful. |
GNUNET_SCALARPRODUCT_STATUS_FAILURE | We encountered some error. |
GNUNET_SCALARPRODUCT_STATUS_INVALID_RESPONSE | We got an invalid response. |
GNUNET_SCALARPRODUCT_STATUS_DISCONNECTED | We got disconnected from the SCALARPRODUCT service. |
Definition at line 52 of file gnunet_scalarproduct_service.h.
struct GNUNET_SCALARPRODUCT_ComputationHandle * GNUNET_SCALARPRODUCT_start_computation | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const struct GNUNET_HashCode * | session_key, | ||
const struct GNUNET_PeerIdentity * | peer, | ||
const struct GNUNET_SCALARPRODUCT_Element * | elements, | ||
uint32_t | element_count, | ||
GNUNET_SCALARPRODUCT_DatumProcessor | cont, | ||
void * | cont_cls | ||
) |
Request by Alice's client for computing a scalar product.
cfg | the gnunet configuration handle |
session_key | Session key should be unique to the requesting client |
peer | PeerID of the other peer |
elements | Array of elements of the vector |
element_count | Number of elements in the elements vector |
cont | Callback function |
cont_cls | Closure for the cont callback function |
Definition at line 361 of file scalarproduct_api.c.
References cfg, GNUNET_ARM_Handle::cfg, check_unique(), ComputationBobCryptodataMultipartMessage::element_count_contained, env, GNUNET_break, GNUNET_CLIENT_connect(), GNUNET_free, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_MULTIPART_ALICE, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_TO_ALICE, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT, GNUNET_MIN, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_SYSERR, h, handlers, GNUNET_ARM_Handle::mq, mq_error_handler(), msg, process_result_message(), response, session_key, and size.
Referenced by run().
struct GNUNET_SCALARPRODUCT_ComputationHandle * GNUNET_SCALARPRODUCT_accept_computation | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const struct GNUNET_HashCode * | session_key, | ||
const struct GNUNET_SCALARPRODUCT_Element * | elements, | ||
uint32_t | element_count, | ||
GNUNET_SCALARPRODUCT_ContinuationWithStatus | cont, | ||
void * | cont_cls | ||
) |
Used by Bob's client to cooperate with Alice,.
cfg | the gnunet configuration handle |
session_key | Session key unique to the requesting client |
elements | Array of elements of the vector |
element_count | Number of elements in the elements vector |
cont | Callback function |
cont_cls | Closure for the cont callback function |
Definition at line 214 of file scalarproduct_api.c.
References cfg, GNUNET_ARM_Handle::cfg, check_unique(), ComputationBobCryptodataMultipartMessage::element_count_contained, env, GNUNET_break, GNUNET_CLIENT_connect(), GNUNET_free, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_MULTIPART_BOB, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_CLIENT_TO_BOB, GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT, GNUNET_MIN, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_SYSERR, h, handlers, GNUNET_ARM_Handle::mq, mq_error_handler(), msg, process_status_message(), response, session_key, and size.
Referenced by run().
void GNUNET_SCALARPRODUCT_cancel | ( | struct GNUNET_SCALARPRODUCT_ComputationHandle * | h | ) |
Cancel an ongoing computation or revoke our collaboration offer.
Closes the connection to the service
h | computation handle to terminate |
Definition at line 457 of file scalarproduct_api.c.
References GNUNET_free, GNUNET_MQ_destroy(), h, and GNUNET_ARM_Handle::mq.
Referenced by process_result_message(), process_status_message(), and shutdown_task().
GNUNET_NETWORK_STRUCT_END typedef void(* GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls, enum GNUNET_SCALARPRODUCT_ResponseStatus status) | ( | void * | cls, |
enum GNUNET_SCALARPRODUCT_ResponseStatus | status | ||
) |
Continuation called to notify client about result of the operation.
cls | closure |
status | Status of the request |
Definition at line 120 of file gnunet_scalarproduct_service.h.