diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-07-14 18:53:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-07-14 18:53:34 +0000 |
commit | 7ca018f77ba7fc571d76478ec382e7b66204d0a5 (patch) | |
tree | 8d32f54ed2ce1b58db4a177f222ad0a3d487355e /src/identity/identity_api.c | |
parent | 45dc1c554237d7ebe828152e2002abf86c2c7c98 (diff) | |
download | gnunet-7ca018f77ba7fc571d76478ec382e7b66204d0a5.tar.gz gnunet-7ca018f77ba7fc571d76478ec382e7b66204d0a5.zip |
-identity IPC definitions
Diffstat (limited to 'src/identity/identity_api.c')
-rw-r--r-- | src/identity/identity_api.c | 147 |
1 files changed, 143 insertions, 4 deletions
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 091a1d60c..81f66ca0d 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c | |||
@@ -37,6 +37,14 @@ | |||
37 | 37 | ||
38 | #define LOG(kind,...) GNUNET_log_from (kind, "identity-api",__VA_ARGS__) | 38 | #define LOG(kind,...) GNUNET_log_from (kind, "identity-api",__VA_ARGS__) |
39 | 39 | ||
40 | /** | ||
41 | * Handle for a pseudonym. | ||
42 | */ | ||
43 | struct GNUNET_IDENTITY_Pseudonym | ||
44 | { | ||
45 | }; | ||
46 | |||
47 | |||
40 | /** | 48 | /** |
41 | * Handle for the service. | 49 | * Handle for the service. |
42 | */ | 50 | */ |
@@ -77,7 +85,8 @@ struct GNUNET_IDENTITY_Handle | |||
77 | * @param tc scheduler context | 85 | * @param tc scheduler context |
78 | */ | 86 | */ |
79 | static void | 87 | static void |
80 | reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 88 | reconnect (void *cls, |
89 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
81 | 90 | ||
82 | 91 | ||
83 | /** | 92 | /** |
@@ -88,7 +97,8 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | |||
88 | * @param msg message received, NULL on timeout or fatal error | 97 | * @param msg message received, NULL on timeout or fatal error |
89 | */ | 98 | */ |
90 | static void | 99 | static void |
91 | message_handler (void *cls, const struct GNUNET_MessageHeader *msg) | 100 | message_handler (void *cls, |
101 | const struct GNUNET_MessageHeader *msg) | ||
92 | { | 102 | { |
93 | struct GNUNET_IDENTITY_Handle *h = cls; | 103 | struct GNUNET_IDENTITY_Handle *h = cls; |
94 | const struct GNUNET_IDENTITY_ClientMessage *client_msg; | 104 | const struct GNUNET_IDENTITY_ClientMessage *client_msg; |
@@ -148,9 +158,11 @@ reschedule_connect (struct GNUNET_IDENTITY_Handle *h) | |||
148 | * @return number of bytes copied to buf | 158 | * @return number of bytes copied to buf |
149 | */ | 159 | */ |
150 | static size_t | 160 | static size_t |
151 | send_start (void *cls, size_t size, void *buf) | 161 | send_start (void *cls, |
162 | size_t size, | ||
163 | void *buf) | ||
152 | { | 164 | { |
153 | return sizeof (struct GNUNET_MessageHeader); | 165 | return 0; |
154 | } | 166 | } |
155 | 167 | ||
156 | 168 | ||
@@ -210,6 +222,133 @@ GNUNET_IDENTITY_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
210 | 222 | ||
211 | 223 | ||
212 | /** | 224 | /** |
225 | * Obtain the ECC key associated with a pseudonym. | ||
226 | * | ||
227 | * @param pseudonym the pseudonym | ||
228 | * @return associated ECC key, valid as long as the pseudonym is valid | ||
229 | */ | ||
230 | const struct GNUNET_CRYPTO_EccPrivateKey * | ||
231 | GNUNET_IDENTITY_pseudonym_get_key (struct GNUNET_IDENTITY_Pseudonym *pseudonym) | ||
232 | { | ||
233 | return NULL; | ||
234 | } | ||
235 | |||
236 | |||
237 | /** | ||
238 | * Obtain the identity that is currently preferred/default | ||
239 | * for a service. | ||
240 | * | ||
241 | * @param id identity service to query | ||
242 | * @param service_name for which service is an identity wanted | ||
243 | * @param cb function to call with the result (will only be called once) | ||
244 | * @param cb_cls closure for cb | ||
245 | * @return handle to abort the operation | ||
246 | */ | ||
247 | struct GNUNET_IDENTITY_Operation * | ||
248 | GNUNET_IDENTITY_get (struct GNUNET_IDENTITY_Handle *id, | ||
249 | const char *service_name, | ||
250 | GNUNET_IDENTITY_Callback cb, | ||
251 | void *cb_cls) | ||
252 | { | ||
253 | return NULL; | ||
254 | } | ||
255 | |||
256 | |||
257 | /** | ||
258 | * Set the preferred/default identity for a service. | ||
259 | * | ||
260 | * @param id identity service to inform | ||
261 | * @param service_name for which service is an identity set | ||
262 | * @param pseu new default identity to be set for this service | ||
263 | * @param cont function to call once the operation finished | ||
264 | * @param cont_cls closure for cont | ||
265 | * @return handle to abort the operation | ||
266 | */ | ||
267 | struct GNUNET_IDENTITY_Operation * | ||
268 | GNUNET_IDENTITY_set (struct GNUNET_IDENTITY_Handle *id, | ||
269 | const char *service_name, | ||
270 | struct GNUNET_IDENTITY_Pseudonym *pseu, | ||
271 | GNUNET_IDENTITY_Continuation cont, | ||
272 | void *cont_cls) | ||
273 | { | ||
274 | return NULL; | ||
275 | } | ||
276 | |||
277 | |||
278 | /** | ||
279 | * Create a new identity with the given identifier. | ||
280 | * | ||
281 | * @param id identity service to use | ||
282 | * @param identifier desired identifier | ||
283 | * @param cb function to call with the result (will only be called once) | ||
284 | * @param cb_cls closure for cb | ||
285 | * @return handle to abort the operation | ||
286 | */ | ||
287 | struct GNUNET_IDENTITY_Operation * | ||
288 | GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, | ||
289 | const char *identifier, | ||
290 | GNUNET_IDENTITY_Callback cb, | ||
291 | void *cb_cls) | ||
292 | { | ||
293 | return NULL; | ||
294 | } | ||
295 | |||
296 | |||
297 | /** | ||
298 | * Renames an existing identity. | ||
299 | * | ||
300 | * @param id identity service to use | ||
301 | * @param old_identifier old identifier | ||
302 | * @param new_identifier desired new identifier | ||
303 | * @param cb function to call with the result (will only be called once) | ||
304 | * @param cb_cls closure for cb | ||
305 | * @return handle to abort the operation | ||
306 | */ | ||
307 | struct GNUNET_IDENTITY_Operation * | ||
308 | GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id, | ||
309 | const char *old_identifier, | ||
310 | const char *new_identifier, | ||
311 | GNUNET_IDENTITY_Continuation cb, | ||
312 | void *cb_cls) | ||
313 | { | ||
314 | return NULL; | ||
315 | } | ||
316 | |||
317 | |||
318 | /** | ||
319 | * Delete an existing identity. | ||
320 | * | ||
321 | * @param id identity service to use | ||
322 | * @param identifier identifier of the identity to delete | ||
323 | * @param cb function to call with the result (will only be called once) | ||
324 | * @param cb_cls closure for cb | ||
325 | * @return handle to abort the operation | ||
326 | */ | ||
327 | struct GNUNET_IDENTITY_Operation * | ||
328 | GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id, | ||
329 | const char *identifier, | ||
330 | GNUNET_IDENTITY_Continuation cb, | ||
331 | void *cb_cls) | ||
332 | { | ||
333 | return NULL; | ||
334 | } | ||
335 | |||
336 | |||
337 | /** | ||
338 | * Cancel an identity operation. Note that the operation MAY still | ||
339 | * be executed; this merely cancels the continuation; if the request | ||
340 | * was already transmitted, the service may still choose to complete | ||
341 | * the operation. | ||
342 | * | ||
343 | * @param op operation to cancel | ||
344 | */ | ||
345 | void | ||
346 | GNUNET_IDENITY_cancel (struct GNUNET_IDENTITY_Operation *op) | ||
347 | { | ||
348 | } | ||
349 | |||
350 | |||
351 | /** | ||
213 | * Disconnect from identity service | 352 | * Disconnect from identity service |
214 | * | 353 | * |
215 | * @param h handle to destroy | 354 | * @param h handle to destroy |