diff options
Diffstat (limited to 'src/identity')
-rw-r--r-- | src/identity/gnunet-identity.c | 12 | ||||
-rw-r--r-- | src/identity/gnunet-service-identity.c | 68 | ||||
-rw-r--r-- | src/identity/identity.h | 6 | ||||
-rw-r--r-- | src/identity/identity_api.c | 44 | ||||
-rw-r--r-- | src/identity/identity_api_lookup.c | 16 | ||||
-rw-r--r-- | src/identity/test_identity.c | 28 | ||||
-rw-r--r-- | src/identity/test_identity_defaults.c | 32 |
7 files changed, 103 insertions, 103 deletions
diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c index 8dac356e4..c2c381604 100644 --- a/src/identity/gnunet-identity.c +++ b/src/identity/gnunet-identity.c | |||
@@ -104,7 +104,7 @@ shutdown_task (void *cls, | |||
104 | { | 104 | { |
105 | GNUNET_IDENTITY_cancel (delete_op); | 105 | GNUNET_IDENTITY_cancel (delete_op); |
106 | delete_op = NULL; | 106 | delete_op = NULL; |
107 | } | 107 | } |
108 | GNUNET_IDENTITY_disconnect (sh); | 108 | GNUNET_IDENTITY_disconnect (sh); |
109 | sh = NULL; | 109 | sh = NULL; |
110 | } | 110 | } |
@@ -121,7 +121,7 @@ test_finished () | |||
121 | (NULL == set_op) && | 121 | (NULL == set_op) && |
122 | (NULL == set_ego) && | 122 | (NULL == set_ego) && |
123 | (! list) && | 123 | (! list) && |
124 | (! monitor) ) | 124 | (! monitor) ) |
125 | GNUNET_SCHEDULER_shutdown (); | 125 | GNUNET_SCHEDULER_shutdown (); |
126 | } | 126 | } |
127 | 127 | ||
@@ -201,11 +201,11 @@ set_done (void *cls, | |||
201 | * 'ego' does indicate an error (i.e. name is taken or no default | 201 | * 'ego' does indicate an error (i.e. name is taken or no default |
202 | * value is known). If 'ego' is non-NULL and if '*ctx' | 202 | * value is known). If 'ego' is non-NULL and if '*ctx' |
203 | * is set in those callbacks, the value WILL be passed to a subsequent | 203 | * is set in those callbacks, the value WILL be passed to a subsequent |
204 | * call to the identity callback of 'GNUNET_IDENTITY_connect' (if | 204 | * call to the identity callback of 'GNUNET_IDENTITY_connect' (if |
205 | * that one was not NULL). | 205 | * that one was not NULL). |
206 | * | 206 | * |
207 | * When an identity is renamed, this function is called with the | 207 | * When an identity is renamed, this function is called with the |
208 | * (known) ego but the NEW identifier. | 208 | * (known) ego but the NEW identifier. |
209 | * | 209 | * |
210 | * When an identity is deleted, this function is called with the | 210 | * When an identity is deleted, this function is called with the |
211 | * (known) ego and "NULL" for the 'identifier'. In this case, | 211 | * (known) ego and "NULL" for the 'identifier'. In this case, |
@@ -232,7 +232,7 @@ print_ego (void *cls, | |||
232 | if ( (NULL != set_ego) && | 232 | if ( (NULL != set_ego) && |
233 | (NULL != ego) && | 233 | (NULL != ego) && |
234 | (NULL != identifier) && | 234 | (NULL != identifier) && |
235 | (0 == strcmp (identifier, | 235 | (0 == strcmp (identifier, |
236 | set_ego)) ) | 236 | set_ego)) ) |
237 | { | 237 | { |
238 | set_op = GNUNET_IDENTITY_set (sh, | 238 | set_op = GNUNET_IDENTITY_set (sh, |
@@ -348,7 +348,7 @@ main (int argc, char *const *argv) | |||
348 | return 2; | 348 | return 2; |
349 | 349 | ||
350 | res = GNUNET_PROGRAM_run (argc, argv, "gnunet-identity", | 350 | res = GNUNET_PROGRAM_run (argc, argv, "gnunet-identity", |
351 | gettext_noop ("Maintain egos"), | 351 | gettext_noop ("Maintain egos"), |
352 | options, &run, | 352 | options, &run, |
353 | NULL); | 353 | NULL); |
354 | GNUNET_free ((void *) argv); | 354 | GNUNET_free ((void *) argv); |
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c index 52d072967..c61286bd5 100644 --- a/src/identity/gnunet-service-identity.c +++ b/src/identity/gnunet-service-identity.c | |||
@@ -47,12 +47,12 @@ struct Ego | |||
47 | 47 | ||
48 | /** | 48 | /** |
49 | * We keep egos in a DLL. | 49 | * We keep egos in a DLL. |
50 | */ | 50 | */ |
51 | struct Ego *next; | 51 | struct Ego *next; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * We keep egos in a DLL. | 54 | * We keep egos in a DLL. |
55 | */ | 55 | */ |
56 | struct Ego *prev; | 56 | struct Ego *prev; |
57 | 57 | ||
58 | /** | 58 | /** |
@@ -195,7 +195,7 @@ send_result_code (struct GNUNET_SERVER_Client *client, | |||
195 | "Sending result %d (%s) to client\n", | 195 | "Sending result %d (%s) to client\n", |
196 | (int) result_code, | 196 | (int) result_code, |
197 | emsg); | 197 | emsg); |
198 | GNUNET_SERVER_notification_context_unicast (nc, client, &rcm->header, GNUNET_NO); | 198 | GNUNET_SERVER_notification_context_unicast (nc, client, &rcm->header, GNUNET_NO); |
199 | GNUNET_free (rcm); | 199 | GNUNET_free (rcm); |
200 | } | 200 | } |
201 | 201 | ||
@@ -211,7 +211,7 @@ create_update_message (struct Ego *ego) | |||
211 | { | 211 | { |
212 | struct GNUNET_IDENTITY_UpdateMessage *um; | 212 | struct GNUNET_IDENTITY_UpdateMessage *um; |
213 | size_t name_len; | 213 | size_t name_len; |
214 | 214 | ||
215 | name_len = (NULL == ego->identifier) ? 0 : (strlen (ego->identifier) + 1); | 215 | name_len = (NULL == ego->identifier) ? 0 : (strlen (ego->identifier) + 1); |
216 | um = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_UpdateMessage) + name_len); | 216 | um = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_UpdateMessage) + name_len); |
217 | um->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE); | 217 | um->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE); |
@@ -252,7 +252,7 @@ create_set_default_message (struct Ego *ego, | |||
252 | 252 | ||
253 | /** | 253 | /** |
254 | * Handler for START message from client, sends information | 254 | * Handler for START message from client, sends information |
255 | * about all identities to the client immediately and | 255 | * about all identities to the client immediately and |
256 | * adds the client to the notification context for future | 256 | * adds the client to the notification context for future |
257 | * updates. | 257 | * updates. |
258 | * | 258 | * |
@@ -268,7 +268,7 @@ handle_start_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
268 | struct GNUNET_IDENTITY_UpdateMessage ume; | 268 | struct GNUNET_IDENTITY_UpdateMessage ume; |
269 | struct Ego *ego; | 269 | struct Ego *ego; |
270 | 270 | ||
271 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 271 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
272 | "Received START message from client\n"); | 272 | "Received START message from client\n"); |
273 | GNUNET_SERVER_notification_context_add (nc, client); | 273 | GNUNET_SERVER_notification_context_add (nc, client); |
274 | for (ego = ego_head; NULL != ego; ego = ego->next) | 274 | for (ego = ego_head; NULL != ego; ego = ego->next) |
@@ -282,7 +282,7 @@ handle_start_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
282 | ume.header.size = htons (sizeof (struct GNUNET_IDENTITY_UpdateMessage)); | 282 | ume.header.size = htons (sizeof (struct GNUNET_IDENTITY_UpdateMessage)); |
283 | ume.end_of_list = htons (GNUNET_YES); | 283 | ume.end_of_list = htons (GNUNET_YES); |
284 | ume.name_len = htons (0); | 284 | ume.name_len = htons (0); |
285 | GNUNET_SERVER_notification_context_unicast (nc, client, &ume.header, GNUNET_NO); | 285 | GNUNET_SERVER_notification_context_unicast (nc, client, &ume.header, GNUNET_NO); |
286 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 286 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
287 | } | 287 | } |
288 | 288 | ||
@@ -325,7 +325,7 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
325 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 325 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
326 | return; | 326 | return; |
327 | } | 327 | } |
328 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 328 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
329 | "Received GET_DEFAULT for service `%s' from client\n", | 329 | "Received GET_DEFAULT for service `%s' from client\n", |
330 | name); | 330 | name); |
331 | if (GNUNET_OK != | 331 | if (GNUNET_OK != |
@@ -335,7 +335,7 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
335 | &identifier)) | 335 | &identifier)) |
336 | { | 336 | { |
337 | send_result_code (client, 1, gettext_noop ("no default known")); | 337 | send_result_code (client, 1, gettext_noop ("no default known")); |
338 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 338 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | for (ego = ego_head; NULL != ego; ego = ego->next) | 341 | for (ego = ego_head; NULL != ego; ego = ego->next) |
@@ -356,7 +356,7 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
356 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 356 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
357 | "Failed to find ego `%s'\n", | 357 | "Failed to find ego `%s'\n", |
358 | name); | 358 | name); |
359 | send_result_code (client, 1, | 359 | send_result_code (client, 1, |
360 | gettext_noop ("default configured, but ego unknown (internal error)")); | 360 | gettext_noop ("default configured, but ego unknown (internal error)")); |
361 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 361 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
362 | } | 362 | } |
@@ -364,7 +364,7 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
364 | 364 | ||
365 | /** | 365 | /** |
366 | * Compare the given two private keys for equality. | 366 | * Compare the given two private keys for equality. |
367 | * | 367 | * |
368 | * @param pk1 one private key | 368 | * @param pk1 one private key |
369 | * @param pk2 another private key | 369 | * @param pk2 another private key |
370 | * @return 0 if the keys are equal | 370 | * @return 0 if the keys are equal |
@@ -405,7 +405,7 @@ handle_set_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
405 | sdm = (const struct GNUNET_IDENTITY_SetDefaultMessage *) message; | 405 | sdm = (const struct GNUNET_IDENTITY_SetDefaultMessage *) message; |
406 | name_len = ntohs (sdm->name_len); | 406 | name_len = ntohs (sdm->name_len); |
407 | GNUNET_break (0 == ntohs (sdm->reserved)); | 407 | GNUNET_break (0 == ntohs (sdm->reserved)); |
408 | if (name_len + sizeof (struct GNUNET_IDENTITY_SetDefaultMessage) != size) | 408 | if (name_len + sizeof (struct GNUNET_IDENTITY_SetDefaultMessage) != size) |
409 | { | 409 | { |
410 | GNUNET_break (0); | 410 | GNUNET_break (0); |
411 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 411 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
@@ -418,7 +418,7 @@ handle_set_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
418 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 418 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
419 | return; | 419 | return; |
420 | } | 420 | } |
421 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 421 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
422 | "Received SET_DEFAULT for service `%s' from client\n", | 422 | "Received SET_DEFAULT for service `%s' from client\n", |
423 | str); | 423 | str); |
424 | for (ego = ego_head; NULL != ego; ego = ego->next) | 424 | for (ego = ego_head; NULL != ego; ego = ego->next) |
@@ -430,7 +430,7 @@ handle_set_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
430 | str, | 430 | str, |
431 | "DEFAULT_IDENTIFIER", | 431 | "DEFAULT_IDENTIFIER", |
432 | ego->identifier); | 432 | ego->identifier); |
433 | if (GNUNET_OK != | 433 | if (GNUNET_OK != |
434 | GNUNET_CONFIGURATION_write (subsystem_cfg, | 434 | GNUNET_CONFIGURATION_write (subsystem_cfg, |
435 | subsystem_cfg_file)) | 435 | subsystem_cfg_file)) |
436 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 436 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -440,7 +440,7 @@ handle_set_default_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
440 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 440 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
441 | return; | 441 | return; |
442 | } | 442 | } |
443 | } | 443 | } |
444 | send_result_code (client, 1, _("Unknown ego specified for service (internal error)")); | 444 | send_result_code (client, 1, _("Unknown ego specified for service (internal error)")); |
445 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 445 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
446 | } | 446 | } |
@@ -481,7 +481,7 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
481 | const char *str; | 481 | const char *str; |
482 | char *fn; | 482 | char *fn; |
483 | 483 | ||
484 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 484 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
485 | "Received CREATE message from client\n"); | 485 | "Received CREATE message from client\n"); |
486 | size = ntohs (message->size); | 486 | size = ntohs (message->size); |
487 | if (size <= sizeof (struct GNUNET_IDENTITY_CreateRequestMessage)) | 487 | if (size <= sizeof (struct GNUNET_IDENTITY_CreateRequestMessage)) |
@@ -493,7 +493,7 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
493 | crm = (const struct GNUNET_IDENTITY_CreateRequestMessage *) message; | 493 | crm = (const struct GNUNET_IDENTITY_CreateRequestMessage *) message; |
494 | name_len = ntohs (crm->name_len); | 494 | name_len = ntohs (crm->name_len); |
495 | GNUNET_break (0 == ntohs (crm->reserved)); | 495 | GNUNET_break (0 == ntohs (crm->reserved)); |
496 | if (name_len + sizeof (struct GNUNET_IDENTITY_CreateRequestMessage) != size) | 496 | if (name_len + sizeof (struct GNUNET_IDENTITY_CreateRequestMessage) != size) |
497 | { | 497 | { |
498 | GNUNET_break (0); | 498 | GNUNET_break (0); |
499 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 499 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
@@ -528,14 +528,14 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
528 | (void) GNUNET_DISK_directory_create_for_file (fn); | 528 | (void) GNUNET_DISK_directory_create_for_file (fn); |
529 | if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) != | 529 | if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) != |
530 | GNUNET_DISK_fn_write (fn, | 530 | GNUNET_DISK_fn_write (fn, |
531 | &crm->private_key, | 531 | &crm->private_key, |
532 | sizeof (struct GNUNET_CRYPTO_EccPrivateKey), | 532 | sizeof (struct GNUNET_CRYPTO_EccPrivateKey), |
533 | GNUNET_DISK_PERM_USER_READ | | 533 | GNUNET_DISK_PERM_USER_READ | |
534 | GNUNET_DISK_PERM_USER_WRITE)) | 534 | GNUNET_DISK_PERM_USER_WRITE)) |
535 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, | 535 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, |
536 | "write", fn); | 536 | "write", fn); |
537 | GNUNET_free (fn); | 537 | GNUNET_free (fn); |
538 | notify_listeners (ego); | 538 | notify_listeners (ego); |
539 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 539 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
540 | } | 540 | } |
541 | 541 | ||
@@ -543,7 +543,7 @@ handle_create_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
543 | /** | 543 | /** |
544 | * Closure for 'handle_ego_rename'. | 544 | * Closure for 'handle_ego_rename'. |
545 | */ | 545 | */ |
546 | struct RenameContext | 546 | struct RenameContext |
547 | { | 547 | { |
548 | /** | 548 | /** |
549 | * Old name. | 549 | * Old name. |
@@ -579,14 +579,14 @@ handle_ego_rename (void *cls, | |||
579 | return; | 579 | return; |
580 | if (0 != strcmp (id, rc->old_name)) | 580 | if (0 != strcmp (id, rc->old_name)) |
581 | { | 581 | { |
582 | GNUNET_free (id); | 582 | GNUNET_free (id); |
583 | return; | 583 | return; |
584 | } | 584 | } |
585 | GNUNET_CONFIGURATION_set_value_string (subsystem_cfg, | 585 | GNUNET_CONFIGURATION_set_value_string (subsystem_cfg, |
586 | section, | 586 | section, |
587 | "DEFAULT_IDENTIFIER", | 587 | "DEFAULT_IDENTIFIER", |
588 | rc->new_name); | 588 | rc->new_name); |
589 | GNUNET_free (id); | 589 | GNUNET_free (id); |
590 | } | 590 | } |
591 | 591 | ||
592 | 592 | ||
@@ -613,7 +613,7 @@ handle_rename_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
613 | char *fn_old; | 613 | char *fn_old; |
614 | char *fn_new; | 614 | char *fn_new; |
615 | 615 | ||
616 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 616 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
617 | "Received RENAME message from client\n"); | 617 | "Received RENAME message from client\n"); |
618 | size = ntohs (message->size); | 618 | size = ntohs (message->size); |
619 | if (size <= sizeof (struct GNUNET_IDENTITY_RenameMessage)) | 619 | if (size <= sizeof (struct GNUNET_IDENTITY_RenameMessage)) |
@@ -643,7 +643,7 @@ handle_rename_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
643 | new_name)) | 643 | new_name)) |
644 | { | 644 | { |
645 | send_result_code (client, 1, gettext_noop ("target name already exists")); | 645 | send_result_code (client, 1, gettext_noop ("target name already exists")); |
646 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 646 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
647 | return; | 647 | return; |
648 | } | 648 | } |
649 | } | 649 | } |
@@ -661,14 +661,14 @@ handle_rename_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
661 | GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg, | 661 | GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg, |
662 | &handle_ego_rename, | 662 | &handle_ego_rename, |
663 | &rename_ctx); | 663 | &rename_ctx); |
664 | if (GNUNET_OK != | 664 | if (GNUNET_OK != |
665 | GNUNET_CONFIGURATION_write (subsystem_cfg, | 665 | GNUNET_CONFIGURATION_write (subsystem_cfg, |
666 | subsystem_cfg_file)) | 666 | subsystem_cfg_file)) |
667 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 667 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
668 | _("Failed to write subsystem default identifier map to `%s'.\n"), | 668 | _("Failed to write subsystem default identifier map to `%s'.\n"), |
669 | subsystem_cfg_file); | 669 | subsystem_cfg_file); |
670 | ego->identifier = GNUNET_strdup (new_name); | 670 | ego->identifier = GNUNET_strdup (new_name); |
671 | fn_new = get_ego_filename (ego); | 671 | fn_new = get_ego_filename (ego); |
672 | if (0 != RENAME (fn_old, fn_new)) | 672 | if (0 != RENAME (fn_old, fn_new)) |
673 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rename", fn_old); | 673 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rename", fn_old); |
674 | GNUNET_free (fn_old); | 674 | GNUNET_free (fn_old); |
@@ -708,14 +708,14 @@ handle_ego_delete (void *cls, | |||
708 | return; | 708 | return; |
709 | if (0 != strcmp (id, identifier)) | 709 | if (0 != strcmp (id, identifier)) |
710 | { | 710 | { |
711 | GNUNET_free (id); | 711 | GNUNET_free (id); |
712 | return; | 712 | return; |
713 | } | 713 | } |
714 | GNUNET_CONFIGURATION_set_value_string (subsystem_cfg, | 714 | GNUNET_CONFIGURATION_set_value_string (subsystem_cfg, |
715 | section, | 715 | section, |
716 | "DEFAULT_IDENTIFIER", | 716 | "DEFAULT_IDENTIFIER", |
717 | NULL); | 717 | NULL); |
718 | GNUNET_free (id); | 718 | GNUNET_free (id); |
719 | } | 719 | } |
720 | 720 | ||
721 | 721 | ||
@@ -738,7 +738,7 @@ handle_delete_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
738 | const char *name; | 738 | const char *name; |
739 | char *fn; | 739 | char *fn; |
740 | 740 | ||
741 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 741 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
742 | "Received DELETE message from client\n"); | 742 | "Received DELETE message from client\n"); |
743 | size = ntohs (message->size); | 743 | size = ntohs (message->size); |
744 | if (size <= sizeof (struct GNUNET_IDENTITY_DeleteMessage)) | 744 | if (size <= sizeof (struct GNUNET_IDENTITY_DeleteMessage)) |
@@ -769,7 +769,7 @@ handle_delete_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
769 | GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg, | 769 | GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg, |
770 | &handle_ego_delete, | 770 | &handle_ego_delete, |
771 | ego->identifier); | 771 | ego->identifier); |
772 | if (GNUNET_OK != | 772 | if (GNUNET_OK != |
773 | GNUNET_CONFIGURATION_write (subsystem_cfg, | 773 | GNUNET_CONFIGURATION_write (subsystem_cfg, |
774 | subsystem_cfg_file)) | 774 | subsystem_cfg_file)) |
775 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 775 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -830,7 +830,7 @@ process_ego_file (void *cls, | |||
830 | } | 830 | } |
831 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 831 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
832 | "Loaded ego `%s'\n", | 832 | "Loaded ego `%s'\n", |
833 | fn + 1); | 833 | fn + 1); |
834 | ego->identifier = GNUNET_strdup (fn + 1); | 834 | ego->identifier = GNUNET_strdup (fn + 1); |
835 | GNUNET_CONTAINER_DLL_insert (ego_head, | 835 | GNUNET_CONTAINER_DLL_insert (ego_head, |
836 | ego_tail, | 836 | ego_tail, |
@@ -847,7 +847,7 @@ process_ego_file (void *cls, | |||
847 | * @param c configuration to use | 847 | * @param c configuration to use |
848 | */ | 848 | */ |
849 | static void | 849 | static void |
850 | run (void *cls, | 850 | run (void *cls, |
851 | struct GNUNET_SERVER_Handle *server, | 851 | struct GNUNET_SERVER_Handle *server, |
852 | const struct GNUNET_CONFIGURATION_Handle *c) | 852 | const struct GNUNET_CONFIGURATION_Handle *c) |
853 | { | 853 | { |
@@ -892,7 +892,7 @@ run (void *cls, | |||
892 | subsystem_cfg = GNUNET_CONFIGURATION_create (); | 892 | subsystem_cfg = GNUNET_CONFIGURATION_create (); |
893 | if ( (GNUNET_YES == | 893 | if ( (GNUNET_YES == |
894 | GNUNET_DISK_file_test (subsystem_cfg_file)) && | 894 | GNUNET_DISK_file_test (subsystem_cfg_file)) && |
895 | (GNUNET_OK != | 895 | (GNUNET_OK != |
896 | GNUNET_CONFIGURATION_parse (subsystem_cfg, | 896 | GNUNET_CONFIGURATION_parse (subsystem_cfg, |
897 | subsystem_cfg_file)) ) | 897 | subsystem_cfg_file)) ) |
898 | { | 898 | { |
@@ -931,7 +931,7 @@ int | |||
931 | main (int argc, char *const *argv) | 931 | main (int argc, char *const *argv) |
932 | { | 932 | { |
933 | return (GNUNET_OK == | 933 | return (GNUNET_OK == |
934 | GNUNET_SERVICE_run (argc, argv, "identity", | 934 | GNUNET_SERVICE_run (argc, argv, "identity", |
935 | GNUNET_SERVICE_OPTION_NONE, | 935 | GNUNET_SERVICE_OPTION_NONE, |
936 | &run, NULL)) ? 0 : 1; | 936 | &run, NULL)) ? 0 : 1; |
937 | } | 937 | } |
diff --git a/src/identity/identity.h b/src/identity/identity.h index 13ac91e46..5e965b2c7 100644 --- a/src/identity/identity.h +++ b/src/identity/identity.h | |||
@@ -138,7 +138,7 @@ struct GNUNET_IDENTITY_SetDefaultMessage | |||
138 | uint16_t reserved GNUNET_PACKED; | 138 | uint16_t reserved GNUNET_PACKED; |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * The private key | 141 | * The private key |
142 | */ | 142 | */ |
143 | struct GNUNET_CRYPTO_EccPrivateKey private_key; | 143 | struct GNUNET_CRYPTO_EccPrivateKey private_key; |
144 | 144 | ||
@@ -149,7 +149,7 @@ struct GNUNET_IDENTITY_SetDefaultMessage | |||
149 | 149 | ||
150 | /** | 150 | /** |
151 | * Client requests creation of an identity. Service | 151 | * Client requests creation of an identity. Service |
152 | * will respond with a result code. | 152 | * will respond with a result code. |
153 | */ | 153 | */ |
154 | struct GNUNET_IDENTITY_CreateRequestMessage | 154 | struct GNUNET_IDENTITY_CreateRequestMessage |
155 | { | 155 | { |
@@ -169,7 +169,7 @@ struct GNUNET_IDENTITY_CreateRequestMessage | |||
169 | uint16_t reserved GNUNET_PACKED; | 169 | uint16_t reserved GNUNET_PACKED; |
170 | 170 | ||
171 | /** | 171 | /** |
172 | * The private key | 172 | * The private key |
173 | */ | 173 | */ |
174 | struct GNUNET_CRYPTO_EccPrivateKey private_key; | 174 | struct GNUNET_CRYPTO_EccPrivateKey private_key; |
175 | 175 | ||
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 143f9e7e8..dc4613cdb 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #define LOG(kind,...) GNUNET_log_from (kind, "identity-api",__VA_ARGS__) | 33 | #define LOG(kind,...) GNUNET_log_from (kind, "identity-api",__VA_ARGS__) |
34 | 34 | ||
35 | /** | 35 | /** |
36 | * Handle for an ego. | 36 | * Handle for an ego. |
37 | */ | 37 | */ |
38 | struct GNUNET_IDENTITY_Ego | 38 | struct GNUNET_IDENTITY_Ego |
@@ -59,7 +59,7 @@ struct GNUNET_IDENTITY_Ego | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | 61 | ||
62 | /** | 62 | /** |
63 | * Handle for an operation with the identity service. | 63 | * Handle for an operation with the identity service. |
64 | */ | 64 | */ |
65 | struct GNUNET_IDENTITY_Operation | 65 | struct GNUNET_IDENTITY_Operation |
@@ -69,7 +69,7 @@ struct GNUNET_IDENTITY_Operation | |||
69 | * Main identity handle. | 69 | * Main identity handle. |
70 | */ | 70 | */ |
71 | struct GNUNET_IDENTITY_Handle *h; | 71 | struct GNUNET_IDENTITY_Handle *h; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * We keep operations in a DLL. | 74 | * We keep operations in a DLL. |
75 | */ | 75 | */ |
@@ -139,12 +139,12 @@ struct GNUNET_IDENTITY_Handle | |||
139 | 139 | ||
140 | /** | 140 | /** |
141 | * Head of active operations. | 141 | * Head of active operations. |
142 | */ | 142 | */ |
143 | struct GNUNET_IDENTITY_Operation *op_head; | 143 | struct GNUNET_IDENTITY_Operation *op_head; |
144 | 144 | ||
145 | /** | 145 | /** |
146 | * Tail of active operations. | 146 | * Tail of active operations. |
147 | */ | 147 | */ |
148 | struct GNUNET_IDENTITY_Operation *op_tail; | 148 | struct GNUNET_IDENTITY_Operation *op_tail; |
149 | 149 | ||
150 | /** | 150 | /** |
@@ -172,7 +172,7 @@ struct GNUNET_IDENTITY_Handle | |||
172 | 172 | ||
173 | /** | 173 | /** |
174 | * Obtain the ego representing 'anonymous' users. | 174 | * Obtain the ego representing 'anonymous' users. |
175 | * | 175 | * |
176 | * @return handle for the anonymous user, must not be freed | 176 | * @return handle for the anonymous user, must not be freed |
177 | */ | 177 | */ |
178 | const struct GNUNET_IDENTITY_Ego * | 178 | const struct GNUNET_IDENTITY_Ego * |
@@ -240,7 +240,7 @@ reschedule_connect (struct GNUNET_IDENTITY_Handle *h) | |||
240 | * @param msg message received, NULL on timeout or fatal error | 240 | * @param msg message received, NULL on timeout or fatal error |
241 | */ | 241 | */ |
242 | static void | 242 | static void |
243 | message_handler (void *cls, | 243 | message_handler (void *cls, |
244 | const struct GNUNET_MessageHeader *msg) | 244 | const struct GNUNET_MessageHeader *msg) |
245 | { | 245 | { |
246 | struct GNUNET_IDENTITY_Handle *h = cls; | 246 | struct GNUNET_IDENTITY_Handle *h = cls; |
@@ -307,7 +307,7 @@ message_handler (void *cls, | |||
307 | } | 307 | } |
308 | um = (const struct GNUNET_IDENTITY_UpdateMessage *) msg; | 308 | um = (const struct GNUNET_IDENTITY_UpdateMessage *) msg; |
309 | name_len = ntohs (um->name_len); | 309 | name_len = ntohs (um->name_len); |
310 | 310 | ||
311 | str = (const char *) &um[1]; | 311 | str = (const char *) &um[1]; |
312 | if ( (size != name_len + sizeof (struct GNUNET_IDENTITY_UpdateMessage)) || | 312 | if ( (size != name_len + sizeof (struct GNUNET_IDENTITY_UpdateMessage)) || |
313 | ( (0 != name_len) && | 313 | ( (0 != name_len) && |
@@ -369,7 +369,7 @@ message_handler (void *cls, | |||
369 | /* ego changed name */ | 369 | /* ego changed name */ |
370 | GNUNET_free (ego->name); | 370 | GNUNET_free (ego->name); |
371 | ego->name = GNUNET_strdup (str); | 371 | ego->name = GNUNET_strdup (str); |
372 | } | 372 | } |
373 | GNUNET_CLIENT_receive (h->client, &message_handler, h, | 373 | GNUNET_CLIENT_receive (h->client, &message_handler, h, |
374 | GNUNET_TIME_UNIT_FOREVER_REL); | 374 | GNUNET_TIME_UNIT_FOREVER_REL); |
375 | /* inform application about change */ | 375 | /* inform application about change */ |
@@ -456,14 +456,14 @@ transmit_next (struct GNUNET_IDENTITY_Handle *h); | |||
456 | * @return number of bytes copied to buf | 456 | * @return number of bytes copied to buf |
457 | */ | 457 | */ |
458 | static size_t | 458 | static size_t |
459 | send_next_message (void *cls, | 459 | send_next_message (void *cls, |
460 | size_t size, | 460 | size_t size, |
461 | void *buf) | 461 | void *buf) |
462 | { | 462 | { |
463 | struct GNUNET_IDENTITY_Handle *h = cls; | 463 | struct GNUNET_IDENTITY_Handle *h = cls; |
464 | struct GNUNET_IDENTITY_Operation *op = h->op_head; | 464 | struct GNUNET_IDENTITY_Operation *op = h->op_head; |
465 | size_t ret; | 465 | size_t ret; |
466 | 466 | ||
467 | h->th = NULL; | 467 | h->th = NULL; |
468 | if (NULL == op) | 468 | if (NULL == op) |
469 | return 0; | 469 | return 0; |
@@ -472,7 +472,7 @@ send_next_message (void *cls, | |||
472 | { | 472 | { |
473 | reschedule_connect (h); | 473 | reschedule_connect (h); |
474 | return 0; | 474 | return 0; |
475 | } | 475 | } |
476 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 476 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
477 | "Sending message of type %d to identity service\n", | 477 | "Sending message of type %d to identity service\n", |
478 | ntohs (op->msg->type)); | 478 | ntohs (op->msg->type)); |
@@ -543,7 +543,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
543 | if ( (NULL == h->op_head) || | 543 | if ( (NULL == h->op_head) || |
544 | (GNUNET_MESSAGE_TYPE_IDENTITY_START != ntohs (h->op_head->msg->type)) ) | 544 | (GNUNET_MESSAGE_TYPE_IDENTITY_START != ntohs (h->op_head->msg->type)) ) |
545 | { | 545 | { |
546 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + | 546 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + |
547 | sizeof (struct GNUNET_MessageHeader)); | 547 | sizeof (struct GNUNET_MessageHeader)); |
548 | op->h = h; | 548 | op->h = h; |
549 | op->msg = (const struct GNUNET_MessageHeader *) &op[1]; | 549 | op->msg = (const struct GNUNET_MessageHeader *) &op[1]; |
@@ -633,7 +633,7 @@ GNUNET_IDENTITY_get (struct GNUNET_IDENTITY_Handle *id, | |||
633 | struct GNUNET_IDENTITY_GetDefaultMessage *gdm; | 633 | struct GNUNET_IDENTITY_GetDefaultMessage *gdm; |
634 | size_t slen; | 634 | size_t slen; |
635 | 635 | ||
636 | slen = strlen (service_name) + 1; | 636 | slen = strlen (service_name) + 1; |
637 | if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct GNUNET_IDENTITY_GetDefaultMessage)) | 637 | if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct GNUNET_IDENTITY_GetDefaultMessage)) |
638 | { | 638 | { |
639 | GNUNET_break (0); | 639 | GNUNET_break (0); |
@@ -641,7 +641,7 @@ GNUNET_IDENTITY_get (struct GNUNET_IDENTITY_Handle *id, | |||
641 | } | 641 | } |
642 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + | 642 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + |
643 | sizeof (struct GNUNET_IDENTITY_GetDefaultMessage) + | 643 | sizeof (struct GNUNET_IDENTITY_GetDefaultMessage) + |
644 | slen); | 644 | slen); |
645 | op->h = id; | 645 | op->h = id; |
646 | op->cb = cb; | 646 | op->cb = cb; |
647 | op->cls = cb_cls; | 647 | op->cls = cb_cls; |
@@ -691,7 +691,7 @@ GNUNET_IDENTITY_set (struct GNUNET_IDENTITY_Handle *id, | |||
691 | } | 691 | } |
692 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + | 692 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + |
693 | sizeof (struct GNUNET_IDENTITY_SetDefaultMessage) + | 693 | sizeof (struct GNUNET_IDENTITY_SetDefaultMessage) + |
694 | slen); | 694 | slen); |
695 | op->h = id; | 695 | op->h = id; |
696 | op->cont = cont; | 696 | op->cont = cont; |
697 | op->cls = cont_cls; | 697 | op->cls = cont_cls; |
@@ -713,7 +713,7 @@ GNUNET_IDENTITY_set (struct GNUNET_IDENTITY_Handle *id, | |||
713 | } | 713 | } |
714 | 714 | ||
715 | 715 | ||
716 | /** | 716 | /** |
717 | * Create a new identity with the given name. | 717 | * Create a new identity with the given name. |
718 | * | 718 | * |
719 | * @param id identity service to use | 719 | * @param id identity service to use |
@@ -744,7 +744,7 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, | |||
744 | } | 744 | } |
745 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + | 745 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + |
746 | sizeof (struct GNUNET_IDENTITY_CreateRequestMessage) + | 746 | sizeof (struct GNUNET_IDENTITY_CreateRequestMessage) + |
747 | slen); | 747 | slen); |
748 | op->h = id; | 748 | op->h = id; |
749 | op->cont = cont; | 749 | op->cont = cont; |
750 | op->cls = cont_cls; | 750 | op->cls = cont_cls; |
@@ -767,7 +767,7 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, | |||
767 | } | 767 | } |
768 | 768 | ||
769 | 769 | ||
770 | /** | 770 | /** |
771 | * Renames an existing identity. | 771 | * Renames an existing identity. |
772 | * | 772 | * |
773 | * @param id identity service to use | 773 | * @param id identity service to use |
@@ -824,7 +824,7 @@ GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id, | |||
824 | } | 824 | } |
825 | 825 | ||
826 | 826 | ||
827 | /** | 827 | /** |
828 | * Delete an existing identity. | 828 | * Delete an existing identity. |
829 | * | 829 | * |
830 | * @param id identity service to use | 830 | * @param id identity service to use |
@@ -851,7 +851,7 @@ GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id, | |||
851 | } | 851 | } |
852 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + | 852 | op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) + |
853 | sizeof (struct GNUNET_IDENTITY_DeleteMessage) + | 853 | sizeof (struct GNUNET_IDENTITY_DeleteMessage) + |
854 | slen); | 854 | slen); |
855 | op->h = id; | 855 | op->h = id; |
856 | op->cont = cb; | 856 | op->cont = cb; |
857 | op->cls = cb_cls; | 857 | op->cls = cb_cls; |
diff --git a/src/identity/identity_api_lookup.c b/src/identity/identity_api_lookup.c index 87e4face1..b813f5b41 100644 --- a/src/identity/identity_api_lookup.c +++ b/src/identity/identity_api_lookup.c | |||
@@ -32,25 +32,25 @@ | |||
32 | 32 | ||
33 | /** | 33 | /** |
34 | * Handle for ego lookup. | 34 | * Handle for ego lookup. |
35 | */ | 35 | */ |
36 | struct GNUNET_IDENTITY_EgoLookup | 36 | struct GNUNET_IDENTITY_EgoLookup |
37 | { | 37 | { |
38 | 38 | ||
39 | /** | 39 | /** |
40 | * Handle to the identity service. | 40 | * Handle to the identity service. |
41 | */ | 41 | */ |
42 | struct GNUNET_IDENTITY_Handle *identity; | 42 | struct GNUNET_IDENTITY_Handle *identity; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * Name of the ego we are looking up. | 45 | * Name of the ego we are looking up. |
46 | */ | 46 | */ |
47 | char *name; | 47 | char *name; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Function to call with the result. | 50 | * Function to call with the result. |
51 | */ | 51 | */ |
52 | GNUNET_IDENTITY_EgoCallback cb; | 52 | GNUNET_IDENTITY_EgoCallback cb; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Closure for @e cb | 55 | * Closure for @e cb |
56 | */ | 56 | */ |
@@ -58,7 +58,7 @@ struct GNUNET_IDENTITY_EgoLookup | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | 60 | ||
61 | /** | 61 | /** |
62 | * Method called to inform about the egos of this peer. | 62 | * Method called to inform about the egos of this peer. |
63 | * | 63 | * |
64 | * When used with #GNUNET_IDENTITY_connect, this function is | 64 | * When used with #GNUNET_IDENTITY_connect, this function is |
@@ -81,7 +81,7 @@ struct GNUNET_IDENTITY_EgoLookup | |||
81 | * NULL if the user just deleted the ego and it | 81 | * NULL if the user just deleted the ego and it |
82 | * must thus no longer be used | 82 | * must thus no longer be used |
83 | */ | 83 | */ |
84 | static void | 84 | static void |
85 | identity_cb (void *cls, | 85 | identity_cb (void *cls, |
86 | struct GNUNET_IDENTITY_Ego *ego, | 86 | struct GNUNET_IDENTITY_Ego *ego, |
87 | void **ctx, | 87 | void **ctx, |
@@ -98,7 +98,7 @@ identity_cb (void *cls, | |||
98 | GNUNET_IDENTITY_ego_lookup_cancel (el); | 98 | GNUNET_IDENTITY_ego_lookup_cancel (el); |
99 | return; | 99 | return; |
100 | } | 100 | } |
101 | if (NULL == ego) | 101 | if (NULL == ego) |
102 | { | 102 | { |
103 | /* not found */ | 103 | /* not found */ |
104 | el->cb (el->cb_cls, | 104 | el->cb (el->cb_cls, |
diff --git a/src/identity/test_identity.c b/src/identity/test_identity.c index 60c6c2dad..6e8408ea8 100644 --- a/src/identity/test_identity.c +++ b/src/identity/test_identity.c | |||
@@ -50,7 +50,7 @@ static struct GNUNET_IDENTITY_Operation *op; | |||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Handle for task for timeout termination. | 52 | * Handle for task for timeout termination. |
53 | */ | 53 | */ |
54 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 54 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
55 | 55 | ||
56 | 56 | ||
@@ -105,7 +105,7 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
105 | /** | 105 | /** |
106 | * Finish the testcase (successfully). | 106 | * Finish the testcase (successfully). |
107 | */ | 107 | */ |
108 | static void | 108 | static void |
109 | end () | 109 | end () |
110 | { | 110 | { |
111 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 111 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -195,9 +195,9 @@ fail_rename_cont (void *cls, | |||
195 | const char *emsg) | 195 | const char *emsg) |
196 | { | 196 | { |
197 | GNUNET_assert (NULL != emsg); | 197 | GNUNET_assert (NULL != emsg); |
198 | op = GNUNET_IDENTITY_delete (h, | 198 | op = GNUNET_IDENTITY_delete (h, |
199 | "test", | 199 | "test", |
200 | &delete_cont, | 200 | &delete_cont, |
201 | NULL); | 201 | NULL); |
202 | end (); /* yepee */ | 202 | end (); /* yepee */ |
203 | } | 203 | } |
@@ -214,10 +214,10 @@ success_rename_cont (void *cls, | |||
214 | const char *emsg) | 214 | const char *emsg) |
215 | { | 215 | { |
216 | GNUNET_assert (NULL == emsg); | 216 | GNUNET_assert (NULL == emsg); |
217 | op = GNUNET_IDENTITY_rename (h, | 217 | op = GNUNET_IDENTITY_rename (h, |
218 | "test-id", | 218 | "test-id", |
219 | "test", | 219 | "test", |
220 | &fail_rename_cont, | 220 | &fail_rename_cont, |
221 | NULL); | 221 | NULL); |
222 | } | 222 | } |
223 | 223 | ||
@@ -231,12 +231,12 @@ success_rename_cont (void *cls, | |||
231 | static void | 231 | static void |
232 | create_cb (void *cls, | 232 | create_cb (void *cls, |
233 | const char *emsg) | 233 | const char *emsg) |
234 | { | 234 | { |
235 | GNUNET_assert (NULL == emsg); | 235 | GNUNET_assert (NULL == emsg); |
236 | op = GNUNET_IDENTITY_rename (h, | 236 | op = GNUNET_IDENTITY_rename (h, |
237 | "test-id", | 237 | "test-id", |
238 | "test", | 238 | "test", |
239 | &success_rename_cont, | 239 | &success_rename_cont, |
240 | NULL); | 240 | NULL); |
241 | } | 241 | } |
242 | 242 | ||
@@ -249,19 +249,19 @@ create_cb (void *cls, | |||
249 | * @param peer handle to access more of the peer (not used) | 249 | * @param peer handle to access more of the peer (not used) |
250 | */ | 250 | */ |
251 | static void | 251 | static void |
252 | run (void *cls, | 252 | run (void *cls, |
253 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 253 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
254 | struct GNUNET_TESTING_Peer *peer) | 254 | struct GNUNET_TESTING_Peer *peer) |
255 | { | 255 | { |
256 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 256 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
257 | &endbadly, NULL); | 257 | &endbadly, NULL); |
258 | h = GNUNET_IDENTITY_connect (cfg, ¬ification_cb, NULL); | 258 | h = GNUNET_IDENTITY_connect (cfg, ¬ification_cb, NULL); |
259 | GNUNET_assert (NULL != h); | 259 | GNUNET_assert (NULL != h); |
260 | op = GNUNET_IDENTITY_create (h, | 260 | op = GNUNET_IDENTITY_create (h, |
261 | "test-id", | 261 | "test-id", |
262 | &create_cb, | 262 | &create_cb, |
263 | NULL); | 263 | NULL); |
264 | 264 | ||
265 | } | 265 | } |
266 | 266 | ||
267 | 267 | ||
@@ -270,7 +270,7 @@ main (int argc, char *argv[]) | |||
270 | { | 270 | { |
271 | GNUNET_DISK_directory_remove ("/tmp/test-identity-service"); | 271 | GNUNET_DISK_directory_remove ("/tmp/test-identity-service"); |
272 | res = 1; | 272 | res = 1; |
273 | if (0 != | 273 | if (0 != |
274 | GNUNET_TESTING_service_run ("test-identity", | 274 | GNUNET_TESTING_service_run ("test-identity", |
275 | "identity", | 275 | "identity", |
276 | "test_identity.conf", | 276 | "test_identity.conf", |
diff --git a/src/identity/test_identity_defaults.c b/src/identity/test_identity_defaults.c index 2caf03a1e..ad4b91ae9 100644 --- a/src/identity/test_identity_defaults.c +++ b/src/identity/test_identity_defaults.c | |||
@@ -50,7 +50,7 @@ static struct GNUNET_IDENTITY_Operation *op; | |||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Handle for task for timeout termination. | 52 | * Handle for task for timeout termination. |
53 | */ | 53 | */ |
54 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 54 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
55 | 55 | ||
56 | 56 | ||
@@ -105,7 +105,7 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
105 | /** | 105 | /** |
106 | * Finish the testcase (successfully). | 106 | * Finish the testcase (successfully). |
107 | */ | 107 | */ |
108 | static void | 108 | static void |
109 | end () | 109 | end () |
110 | { | 110 | { |
111 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 111 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -149,9 +149,9 @@ get_cb (void *cls, | |||
149 | GNUNET_assert (NULL != ego); | 149 | GNUNET_assert (NULL != ego); |
150 | GNUNET_assert (NULL != identifier); | 150 | GNUNET_assert (NULL != identifier); |
151 | GNUNET_assert (0 == strcmp (identifier, "test-id")); | 151 | GNUNET_assert (0 == strcmp (identifier, "test-id")); |
152 | op = GNUNET_IDENTITY_delete (h, | 152 | op = GNUNET_IDENTITY_delete (h, |
153 | "test-id", | 153 | "test-id", |
154 | &delete_cont, | 154 | &delete_cont, |
155 | NULL); | 155 | NULL); |
156 | } | 156 | } |
157 | 157 | ||
@@ -164,12 +164,12 @@ get_cb (void *cls, | |||
164 | * @param peer handle to access more of the peer (not used) | 164 | * @param peer handle to access more of the peer (not used) |
165 | */ | 165 | */ |
166 | static void | 166 | static void |
167 | run_get (void *cls, | 167 | run_get (void *cls, |
168 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 168 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
169 | struct GNUNET_TESTING_Peer *peer) | 169 | struct GNUNET_TESTING_Peer *peer) |
170 | { | 170 | { |
171 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 171 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
172 | &endbadly, NULL); | 172 | &endbadly, NULL); |
173 | h = GNUNET_IDENTITY_connect (cfg, NULL, NULL); | 173 | h = GNUNET_IDENTITY_connect (cfg, NULL, NULL); |
174 | GNUNET_assert (NULL != h); | 174 | GNUNET_assert (NULL != h); |
175 | op = GNUNET_IDENTITY_get (h, | 175 | op = GNUNET_IDENTITY_get (h, |
@@ -214,10 +214,10 @@ notification_cb (void *cls, | |||
214 | { | 214 | { |
215 | if (NULL == ego) | 215 | if (NULL == ego) |
216 | return; /* skip first call */ | 216 | return; /* skip first call */ |
217 | op = GNUNET_IDENTITY_set (h, | 217 | op = GNUNET_IDENTITY_set (h, |
218 | "test-service", | 218 | "test-service", |
219 | ego, | 219 | ego, |
220 | &success_set_cont, | 220 | &success_set_cont, |
221 | NULL); | 221 | NULL); |
222 | } | 222 | } |
223 | 223 | ||
@@ -231,7 +231,7 @@ notification_cb (void *cls, | |||
231 | static void | 231 | static void |
232 | create_cb (void *cls, | 232 | create_cb (void *cls, |
233 | const char *emsg) | 233 | const char *emsg) |
234 | { | 234 | { |
235 | GNUNET_assert (NULL == emsg); | 235 | GNUNET_assert (NULL == emsg); |
236 | op = NULL; | 236 | op = NULL; |
237 | } | 237 | } |
@@ -245,19 +245,19 @@ create_cb (void *cls, | |||
245 | * @param peer handle to access more of the peer (not used) | 245 | * @param peer handle to access more of the peer (not used) |
246 | */ | 246 | */ |
247 | static void | 247 | static void |
248 | run_set (void *cls, | 248 | run_set (void *cls, |
249 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 249 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
250 | struct GNUNET_TESTING_Peer *peer) | 250 | struct GNUNET_TESTING_Peer *peer) |
251 | { | 251 | { |
252 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 252 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
253 | &endbadly, NULL); | 253 | &endbadly, NULL); |
254 | h = GNUNET_IDENTITY_connect (cfg, ¬ification_cb, NULL); | 254 | h = GNUNET_IDENTITY_connect (cfg, ¬ification_cb, NULL); |
255 | GNUNET_assert (NULL != h); | 255 | GNUNET_assert (NULL != h); |
256 | op = GNUNET_IDENTITY_create (h, | 256 | op = GNUNET_IDENTITY_create (h, |
257 | "test-id", | 257 | "test-id", |
258 | &create_cb, | 258 | &create_cb, |
259 | NULL); | 259 | NULL); |
260 | 260 | ||
261 | } | 261 | } |
262 | 262 | ||
263 | 263 | ||
@@ -266,14 +266,14 @@ main (int argc, char *argv[]) | |||
266 | { | 266 | { |
267 | GNUNET_DISK_directory_remove ("/tmp/test-identity-service"); | 267 | GNUNET_DISK_directory_remove ("/tmp/test-identity-service"); |
268 | res = 1; | 268 | res = 1; |
269 | if (0 != | 269 | if (0 != |
270 | GNUNET_TESTING_service_run ("test-identity-defaults", | 270 | GNUNET_TESTING_service_run ("test-identity-defaults", |
271 | "identity", | 271 | "identity", |
272 | "test_identity.conf", | 272 | "test_identity.conf", |
273 | &run_set, | 273 | &run_set, |
274 | NULL)) | 274 | NULL)) |
275 | return 1; | 275 | return 1; |
276 | if (0 != | 276 | if (0 != |
277 | GNUNET_TESTING_service_run ("test-identity-defaults", | 277 | GNUNET_TESTING_service_run ("test-identity-defaults", |
278 | "identity", | 278 | "identity", |
279 | "test_identity.conf", | 279 | "test_identity.conf", |