diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-02 13:50:04 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-02 13:50:04 +0000 |
commit | 75bcc248e9dfbbe5976f1ecd3a42f7d40df74432 (patch) | |
tree | 0a9b71825d47b79a482e05312b52f5d65f4fcdb3 /src/include/gnunet_scalarproduct_service.h | |
parent | ac96c0fed4c6831772c198e6ad65714d525efceb (diff) | |
download | gnunet-75bcc248e9dfbbe5976f1ecd3a42f7d40df74432.tar.gz gnunet-75bcc248e9dfbbe5976f1ecd3a42f7d40df74432.zip |
moved scalar-product protocol definitions to scalarproduct.h
moved service-structures to gnunet-service-scalarproduct.c
Diffstat (limited to 'src/include/gnunet_scalarproduct_service.h')
-rw-r--r-- | src/include/gnunet_scalarproduct_service.h | 83 |
1 files changed, 2 insertions, 81 deletions
diff --git a/src/include/gnunet_scalarproduct_service.h b/src/include/gnunet_scalarproduct_service.h index 64134d9ec..5affd6377 100644 --- a/src/include/gnunet_scalarproduct_service.h +++ b/src/include/gnunet_scalarproduct_service.h | |||
@@ -42,78 +42,6 @@ extern "C" { | |||
42 | */ | 42 | */ |
43 | #define GNUNET_SCALARPRODUCT_VERSION 0x00000042 | 43 | #define GNUNET_SCALARPRODUCT_VERSION 0x00000042 |
44 | 44 | ||
45 | /** | ||
46 | * Message type passed from client to service | ||
47 | * to initiate a request or responder role | ||
48 | */ | ||
49 | struct GNUNET_SCALARPRODUCT_client_request | ||
50 | { | ||
51 | /** | ||
52 | * GNUNET message header | ||
53 | */ | ||
54 | struct GNUNET_MessageHeader header; | ||
55 | |||
56 | /** | ||
57 | * how many elements the vector in payload contains | ||
58 | */ | ||
59 | uint16_t element_count GNUNET_PACKED; | ||
60 | |||
61 | /** | ||
62 | * how many bytes the mask has | ||
63 | */ | ||
64 | uint16_t mask_length GNUNET_PACKED; | ||
65 | |||
66 | /** | ||
67 | * the transaction/session key used to identify a session | ||
68 | */ | ||
69 | struct GNUNET_HashCode key; | ||
70 | |||
71 | /** | ||
72 | * the identity of a remote peer we want to communicate with | ||
73 | */ | ||
74 | struct GNUNET_PeerIdentity peer; | ||
75 | |||
76 | /** | ||
77 | * followed by long vector[element_count] | [unsigned char mask[mask_bytes]] | ||
78 | */ | ||
79 | }; | ||
80 | |||
81 | /** | ||
82 | * Message type passed from service client | ||
83 | * to finalize a session as requester or responder | ||
84 | */ | ||
85 | struct GNUNET_SCALARPRODUCT_client_response | ||
86 | { | ||
87 | /** | ||
88 | * GNUNET message header | ||
89 | */ | ||
90 | struct GNUNET_MessageHeader header; | ||
91 | |||
92 | /** | ||
93 | * 0 if no product attached | ||
94 | */ | ||
95 | uint32_t product_length GNUNET_PACKED; | ||
96 | |||
97 | /** | ||
98 | * the transaction/session key used to identify a session | ||
99 | */ | ||
100 | struct GNUNET_HashCode key; | ||
101 | |||
102 | /** | ||
103 | * the identity of a remote peer we want to communicate with | ||
104 | */ | ||
105 | struct GNUNET_PeerIdentity peer; | ||
106 | |||
107 | /** | ||
108 | * Workaround for libgcrypt: -1 if negative, 0 if zero, else 1 | ||
109 | */ | ||
110 | int8_t range; | ||
111 | |||
112 | /** | ||
113 | * followed by product of length product_length (or nothing) | ||
114 | */ | ||
115 | }; | ||
116 | |||
117 | enum GNUNET_SCALARPRODUCT_ResponseStatus | 45 | enum GNUNET_SCALARPRODUCT_ResponseStatus |
118 | { | 46 | { |
119 | GNUNET_SCALARPRODUCT_Status_Success = 0, | 47 | GNUNET_SCALARPRODUCT_Status_Success = 0, |
@@ -194,10 +122,7 @@ typedef void (*GNUNET_SCALARPRODUCT_ResponseMessageHandler) (void *cls, | |||
194 | * operation. | 122 | * operation. |
195 | * | 123 | * |
196 | * @param cls closure | 124 | * @param cls closure |
197 | * @param success GNUNET_SYSERR on failure (including timeout/queue drop) | 125 | * @param status Status of the request |
198 | * GNUNET_NO if content was already there | ||
199 | * GNUNET_YES (or other positive value) on success | ||
200 | * @param msg NULL on success, otherwise an error message | ||
201 | */ | 126 | */ |
202 | typedef void (*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls, | 127 | typedef void (*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls, |
203 | enum GNUNET_SCALARPRODUCT_ResponseStatus status); | 128 | enum GNUNET_SCALARPRODUCT_ResponseStatus status); |
@@ -205,12 +130,8 @@ typedef void (*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls, | |||
205 | * Process a datum that was stored in the scalarproduct. | 130 | * Process a datum that was stored in the scalarproduct. |
206 | * | 131 | * |
207 | * @param cls closure | 132 | * @param cls closure |
208 | * @param key Sessioon key | ||
209 | * @param peer PeerID of the peer with whom the scalar product was calculated. | ||
210 | * @param status Status of the request | 133 | * @param status Status of the request |
211 | * @param size Size of the received message | 134 | * @param type result of the computation |
212 | * @param data Pointer to the data | ||
213 | * @param type Type of data | ||
214 | */ | 135 | */ |
215 | typedef void (*GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls, | 136 | typedef void (*GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls, |
216 | enum GNUNET_SCALARPRODUCT_ResponseStatus status, | 137 | enum GNUNET_SCALARPRODUCT_ResponseStatus status, |