diff options
Diffstat (limited to 'src/include/anastasis_service.h')
-rw-r--r-- | src/include/anastasis_service.h | 90 |
1 files changed, 88 insertions, 2 deletions
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h index 0ef31d6..5a8ca21 100644 --- a/src/include/anastasis_service.h +++ b/src/include/anastasis_service.h | |||
@@ -156,6 +156,93 @@ ANASTASIS_config_cancel (struct ANASTASIS_ConfigOperation *co); | |||
156 | 156 | ||
157 | 157 | ||
158 | /** | 158 | /** |
159 | * Detailed meta data result. | ||
160 | */ | ||
161 | struct ANASTASIS_MetaDataEntry | ||
162 | { | ||
163 | |||
164 | /** | ||
165 | * The encrypted meta data we downloaded. | ||
166 | */ | ||
167 | const void *meta_data; | ||
168 | |||
169 | /** | ||
170 | * Number of bytes in @e meta_data. | ||
171 | */ | ||
172 | size_t meta_data_size; | ||
173 | |||
174 | /** | ||
175 | * Policy version this @e meta_data is for. | ||
176 | */ | ||
177 | uint32_t version; | ||
178 | }; | ||
179 | |||
180 | |||
181 | /** | ||
182 | * Detailed results for meta data download. | ||
183 | */ | ||
184 | struct ANASTASIS_MetaDownloadDetails | ||
185 | { | ||
186 | |||
187 | /** | ||
188 | * Version-sorted array of meta data we downloaded. | ||
189 | */ | ||
190 | const struct ANASTASIS_MetaDataEntry *metas; | ||
191 | |||
192 | /** | ||
193 | * Number of entries in @e metas. | ||
194 | */ | ||
195 | unsigned int metas_length; | ||
196 | |||
197 | }; | ||
198 | |||
199 | |||
200 | /** | ||
201 | * Callback to process a GET /policy/$POL/meta request | ||
202 | * | ||
203 | * @param cls closure | ||
204 | * @param http_status HTTP status code for this request | ||
205 | * @param dd the response details | ||
206 | */ | ||
207 | typedef void | ||
208 | (*ANASTASIS_PolicyMetaLookupCallback) ( | ||
209 | void *cls, | ||
210 | unsigned int http_status, | ||
211 | const struct ANASTASIS_MetaDownloadDetails *dd); | ||
212 | |||
213 | |||
214 | /** | ||
215 | * Does a GET /policy/$POL/meta. | ||
216 | * | ||
217 | * @param ctx execution context | ||
218 | * @param backend_url base URL of the merchant backend | ||
219 | * @param anastasis_pub public key of the user's account | ||
220 | * @param max_version maximum version number to fetch | ||
221 | * @param cb callback which will work the response gotten from the backend | ||
222 | * @param cb_cls closure to pass to the callback | ||
223 | * @return handle for this operation, NULL upon errors | ||
224 | */ | ||
225 | struct ANASTASIS_PolicyMetaLookupOperation * | ||
226 | ANASTASIS_policy_meta_lookup ( | ||
227 | struct GNUNET_CURL_Context *ctx, | ||
228 | const char *backend_url, | ||
229 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, | ||
230 | uint32_t max_version, | ||
231 | ANASTASIS_PolicyMetaLookupCallback cb, | ||
232 | void *cb_cls); | ||
233 | |||
234 | |||
235 | /** | ||
236 | * Cancel a GET /policy/$POL/meta request. | ||
237 | * | ||
238 | * @param plo cancel the policy lookup operation | ||
239 | */ | ||
240 | void | ||
241 | ANASTASIS_policy_meta_lookup_cancel ( | ||
242 | struct ANASTASIS_PolicyMetaLookupOperation *plo); | ||
243 | |||
244 | |||
245 | /** | ||
159 | * Detailed results from the successful download. | 246 | * Detailed results from the successful download. |
160 | */ | 247 | */ |
161 | struct ANASTASIS_DownloadDetails | 248 | struct ANASTASIS_DownloadDetails |
@@ -198,8 +285,7 @@ struct ANASTASIS_PolicyLookupOperation; | |||
198 | * | 285 | * |
199 | * @param cls closure | 286 | * @param cls closure |
200 | * @param http_status HTTP status code for this request | 287 | * @param http_status HTTP status code for this request |
201 | * @param ec anastasis-specific error code | 288 | * @param dd the response details |
202 | * @param obj the response body | ||
203 | */ | 289 | */ |
204 | typedef void | 290 | typedef void |
205 | (*ANASTASIS_PolicyLookupCallback) (void *cls, | 291 | (*ANASTASIS_PolicyLookupCallback) (void *cls, |