GNUnet  0.11.x
gnunet_scalarproduct_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2013, 2014 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
31 #ifndef GNUNET_SCALARPRODUCT_SERVICE_H
32 #define GNUNET_SCALARPRODUCT_SERVICE_H
33 #define GCRYPT_NO_DEPRECATED
34 #include <gcrypt.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #if 0 /* keep Emacsens' auto-indent happy */
39 }
40 #endif
41 #endif
42 
46 #define GNUNET_SCALARPRODUCT_VERSION 0x00000044
47 
52 {
57 
62 
67 
72 
77 
82 };
83 
84 
88 struct GNUNET_SCALARPRODUCT_Handle;
89 
90 
92 
97 {
101  struct GNUNET_HashCode key;
102 
107 };
108 
110 
111 
119 typedef void
121  void *cls,
123 
124 
132 typedef void
134  void *cls,
136  gcry_mpi_t result);
137 
138 
143 
144 
159  const struct GNUNET_CONFIGURATION_Handle *cfg,
160  const struct GNUNET_HashCode *session_key,
161  const struct GNUNET_PeerIdentity *peer,
162  const struct GNUNET_SCALARPRODUCT_Element *elements,
163  uint32_t element_count,
165  void *cont_cls);
166 
167 
181  const struct GNUNET_CONFIGURATION_Handle *cfg,
182  const struct GNUNET_HashCode *key,
183  const struct GNUNET_SCALARPRODUCT_Element *elements,
184  uint32_t element_count,
186  void *cont_cls);
187 
188 
195 void
197 
198 
199 #if 0 /* keep Emacsens' auto-indent happy */
200 {
201 #endif
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif
207  /* end of group */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
struct GNUNET_HashCode key
The key used in the DHT.
uint16_t status
See PRISM_STATUS_*-constants.
static int result
Global testing status.
static struct GNUNET_HashCode session_key
the session key identifying this computation
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
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.
void(* GNUNET_SCALARPRODUCT_DatumProcessor)(void *cls, enum GNUNET_SCALARPRODUCT_ResponseStatus status, gcry_mpi_t result)
Process a datum that was stored in the scalarproduct.
GNUNET_SCALARPRODUCT_ResponseStatus
Result status values for the computation.
void GNUNET_SCALARPRODUCT_cancel(struct GNUNET_SCALARPRODUCT_ComputationHandle *h)
Cancel an ongoing computation or revoke our collaboration offer.
struct GNUNET_SCALARPRODUCT_ComputationHandle * GNUNET_SCALARPRODUCT_accept_computation(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_HashCode *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,.
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.
@ GNUNET_SCALARPRODUCT_STATUS_INIT
Operation is still active (never returned, used internally).
@ GNUNET_SCALARPRODUCT_STATUS_SUCCESS
The computation was successful.
@ GNUNET_SCALARPRODUCT_STATUS_ACTIVE
Operation is still active (never returned, used internally).
@ GNUNET_SCALARPRODUCT_STATUS_FAILURE
We encountered some error.
@ GNUNET_SCALARPRODUCT_STATUS_DISCONNECTED
We got disconnected from the SCALARPRODUCT service.
@ GNUNET_SCALARPRODUCT_STATUS_INVALID_RESPONSE
We got an invalid response.
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
A handle returned for each computation.
void * cont_cls
Closure for cont_status or cont_datum.
An element key-value pair for scalarproduct.
struct GNUNET_HashCode key
Key used to identify matching pairs of values to multiply.
int64_t value
Value to multiply in scalar product, in NBO.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.