diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
commit | 61c39c60565b386e0e12ea669556b030e8cd7180 (patch) | |
tree | 59109aeab8297bdc996faca8c4e38ec7426c36cf /src/nse | |
parent | 780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff) | |
download | gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip |
-remove trailing whitespace
Diffstat (limited to 'src/nse')
-rw-r--r-- | src/nse/gnunet-nse-profiler.c | 48 | ||||
-rw-r--r-- | src/nse/gnunet-service-nse.c | 72 | ||||
-rw-r--r-- | src/nse/nse_api.c | 12 | ||||
-rw-r--r-- | src/nse/perf_kdf.c | 2 | ||||
-rw-r--r-- | src/nse/test_nse_api.c | 2 | ||||
-rw-r--r-- | src/nse/test_nse_multipeer.c | 18 |
6 files changed, 77 insertions, 77 deletions
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index fa0b97440..2dbca7541 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c | |||
@@ -133,7 +133,7 @@ static int verbose; | |||
133 | 133 | ||
134 | /** | 134 | /** |
135 | * Name of the file with the hosts to run the test over (configuration option) | 135 | * Name of the file with the hosts to run the test over (configuration option) |
136 | */ | 136 | */ |
137 | static char *hosts_file; | 137 | static char *hosts_file; |
138 | 138 | ||
139 | /** | 139 | /** |
@@ -274,7 +274,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
274 | if (GNUNET_YES == shutting_down) | 274 | if (GNUNET_YES == shutting_down) |
275 | return; | 275 | return; |
276 | shutting_down = GNUNET_YES; | 276 | shutting_down = GNUNET_YES; |
277 | LOG_DEBUG ("Ending test.\n"); | 277 | LOG_DEBUG ("Ending test.\n"); |
278 | close_monitor_connections (); | 278 | close_monitor_connections (); |
279 | if (NULL != data_file) | 279 | if (NULL != data_file) |
280 | { | 280 | { |
@@ -314,7 +314,7 @@ shutdown_now () | |||
314 | * of the size estimation values seen | 314 | * of the size estimation values seen |
315 | */ | 315 | */ |
316 | static void | 316 | static void |
317 | handle_estimate (void *cls, | 317 | handle_estimate (void *cls, |
318 | struct GNUNET_TIME_Absolute timestamp, | 318 | struct GNUNET_TIME_Absolute timestamp, |
319 | double estimate, double std_dev) | 319 | double estimate, double std_dev) |
320 | { | 320 | { |
@@ -329,7 +329,7 @@ handle_estimate (void *cls, | |||
329 | peer, estimate, std_dev); | 329 | peer, estimate, std_dev); |
330 | return; | 330 | return; |
331 | } | 331 | } |
332 | size = GNUNET_snprintf (output_buffer, | 332 | size = GNUNET_snprintf (output_buffer, |
333 | sizeof (output_buffer), | 333 | sizeof (output_buffer), |
334 | "%p %llu %llu %f %f %f\n", | 334 | "%p %llu %llu %f %f %f\n", |
335 | peer, peers_running, | 335 | peer, peers_running, |
@@ -345,7 +345,7 @@ handle_estimate (void *cls, | |||
345 | /** | 345 | /** |
346 | * Adapter function called to establish a connection to | 346 | * Adapter function called to establish a connection to |
347 | * NSE service. | 347 | * NSE service. |
348 | * | 348 | * |
349 | * @param cls closure (the 'struct NSEPeer') | 349 | * @param cls closure (the 'struct NSEPeer') |
350 | * @param cfg configuration of the peer to connect to; will be available until | 350 | * @param cfg configuration of the peer to connect to; will be available until |
351 | * GNUNET_TESTBED_operation_done() is called on the operation returned | 351 | * GNUNET_TESTBED_operation_done() is called on the operation returned |
@@ -365,11 +365,11 @@ nse_connect_adapter (void *cls, | |||
365 | /** | 365 | /** |
366 | * Adapter function called to destroy a connection to | 366 | * Adapter function called to destroy a connection to |
367 | * NSE service. | 367 | * NSE service. |
368 | * | 368 | * |
369 | * @param cls closure | 369 | * @param cls closure |
370 | * @param op_result service handle returned from the connect adapter | 370 | * @param op_result service handle returned from the connect adapter |
371 | */ | 371 | */ |
372 | static void | 372 | static void |
373 | nse_disconnect_adapter (void *cls, | 373 | nse_disconnect_adapter (void *cls, |
374 | void *op_result) | 374 | void *op_result) |
375 | { | 375 | { |
@@ -389,7 +389,7 @@ nse_disconnect_adapter (void *cls, | |||
389 | */ | 389 | */ |
390 | static int | 390 | static int |
391 | stat_iterator (void *cls, | 391 | stat_iterator (void *cls, |
392 | const char *subsystem, | 392 | const char *subsystem, |
393 | const char *name, | 393 | const char *name, |
394 | uint64_t value, int is_persistent) | 394 | uint64_t value, int is_persistent) |
395 | { | 395 | { |
@@ -404,7 +404,7 @@ stat_iterator (void *cls, | |||
404 | if (0 != flag) | 404 | if (0 != flag) |
405 | flag = 1; | 405 | flag = 1; |
406 | size = GNUNET_asprintf (&output_buffer, "%llu %llu %u\n", | 406 | size = GNUNET_asprintf (&output_buffer, "%llu %llu %u\n", |
407 | now.abs_value_us / 1000LL / 1000LL, | 407 | now.abs_value_us / 1000LL / 1000LL, |
408 | value, flag); | 408 | value, flag); |
409 | if (size != GNUNET_DISK_file_write (data_file, output_buffer, size)) | 409 | if (size != GNUNET_DISK_file_write (data_file, output_buffer, size)) |
410 | { | 410 | { |
@@ -431,7 +431,7 @@ stat_connect_adapter (void *cls, | |||
431 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 431 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
432 | { | 432 | { |
433 | struct NSEPeer *peer = cls; | 433 | struct NSEPeer *peer = cls; |
434 | 434 | ||
435 | peer->sh = GNUNET_STATISTICS_create ("nse-profiler", cfg); | 435 | peer->sh = GNUNET_STATISTICS_create ("nse-profiler", cfg); |
436 | return peer->sh; | 436 | return peer->sh; |
437 | } | 437 | } |
@@ -502,18 +502,18 @@ connect_nse_service () | |||
502 | unsigned int connections; | 502 | unsigned int connections; |
503 | 503 | ||
504 | if (0 == connection_limit) | 504 | if (0 == connection_limit) |
505 | return; | 505 | return; |
506 | LOG_DEBUG ("Connecting to nse service of peers\n"); | 506 | LOG_DEBUG ("Connecting to nse service of peers\n"); |
507 | connections = 0; | 507 | connections = 0; |
508 | for (i = 0; i < num_peers_in_round[current_round]; i++) | 508 | for (i = 0; i < num_peers_in_round[current_round]; i++) |
509 | { | 509 | { |
510 | if ((num_peers_in_round[current_round] > connection_limit) && | 510 | if ((num_peers_in_round[current_round] > connection_limit) && |
511 | (0 != (i % (num_peers_in_round[current_round] / connection_limit)))) | 511 | (0 != (i % (num_peers_in_round[current_round] / connection_limit)))) |
512 | continue; | 512 | continue; |
513 | LOG_DEBUG ("Connecting to nse service of peer %d\n", i); | 513 | LOG_DEBUG ("Connecting to nse service of peer %d\n", i); |
514 | current_peer = GNUNET_malloc (sizeof (struct NSEPeer)); | 514 | current_peer = GNUNET_malloc (sizeof (struct NSEPeer)); |
515 | current_peer->daemon = daemons[i]; | 515 | current_peer->daemon = daemons[i]; |
516 | current_peer->nse_op | 516 | current_peer->nse_op |
517 | = GNUNET_TESTBED_service_connect (NULL, | 517 | = GNUNET_TESTBED_service_connect (NULL, |
518 | current_peer->daemon, | 518 | current_peer->daemon, |
519 | "nse", | 519 | "nse", |
@@ -545,7 +545,7 @@ connect_nse_service () | |||
545 | * @param tc scheduler context (unused) | 545 | * @param tc scheduler context (unused) |
546 | */ | 546 | */ |
547 | static void | 547 | static void |
548 | next_round (void *cls, | 548 | next_round (void *cls, |
549 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 549 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
550 | 550 | ||
551 | 551 | ||
@@ -558,7 +558,7 @@ next_round (void *cls, | |||
558 | * @param tc unused | 558 | * @param tc unused |
559 | */ | 559 | */ |
560 | static void | 560 | static void |
561 | finish_round (void *cls, | 561 | finish_round (void *cls, |
562 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 562 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
563 | { | 563 | { |
564 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 564 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
@@ -606,12 +606,12 @@ make_oplist_entry () | |||
606 | * @param op the operation handle | 606 | * @param op the operation handle |
607 | * @param emsg NULL on success; otherwise an error description | 607 | * @param emsg NULL on success; otherwise an error description |
608 | */ | 608 | */ |
609 | static void | 609 | static void |
610 | manage_service_cb (void *cls, struct GNUNET_TESTBED_Operation *op, | 610 | manage_service_cb (void *cls, struct GNUNET_TESTBED_Operation *op, |
611 | const char *emsg) | 611 | const char *emsg) |
612 | { | 612 | { |
613 | struct OpListEntry *entry = cls; | 613 | struct OpListEntry *entry = cls; |
614 | 614 | ||
615 | GNUNET_TESTBED_operation_done (entry->op); | 615 | GNUNET_TESTBED_operation_done (entry->op); |
616 | if (NULL != emsg) | 616 | if (NULL != emsg) |
617 | { | 617 | { |
@@ -673,13 +673,13 @@ adjust_running_peers () | |||
673 | * @param tc unused | 673 | * @param tc unused |
674 | */ | 674 | */ |
675 | static void | 675 | static void |
676 | next_round (void *cls, | 676 | next_round (void *cls, |
677 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 677 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
678 | { | 678 | { |
679 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 679 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
680 | return; | 680 | return; |
681 | LOG_DEBUG ("Disconnecting nse service of peers\n"); | 681 | LOG_DEBUG ("Disconnecting nse service of peers\n"); |
682 | current_round++; | 682 | current_round++; |
683 | if (current_round == num_rounds) | 683 | if (current_round == num_rounds) |
684 | { | 684 | { |
685 | /* this was the last round, terminate */ | 685 | /* this was the last round, terminate */ |
@@ -705,7 +705,7 @@ next_round (void *cls, | |||
705 | * @param event information on what is happening | 705 | * @param event information on what is happening |
706 | */ | 706 | */ |
707 | static void | 707 | static void |
708 | master_controller_cb (void *cls, | 708 | master_controller_cb (void *cls, |
709 | const struct GNUNET_TESTBED_EventInformation *event) | 709 | const struct GNUNET_TESTBED_EventInformation *event) |
710 | { | 710 | { |
711 | switch (event->type) | 711 | switch (event->type) |
@@ -735,7 +735,7 @@ master_controller_cb (void *cls, | |||
735 | * @param links_failed the number of overlay link connection attempts that | 735 | * @param links_failed the number of overlay link connection attempts that |
736 | * failed | 736 | * failed |
737 | */ | 737 | */ |
738 | static void | 738 | static void |
739 | test_master (void *cls, | 739 | test_master (void *cls, |
740 | struct GNUNET_TESTBED_RunHandle *h, | 740 | struct GNUNET_TESTBED_RunHandle *h, |
741 | unsigned int num_peers_, | 741 | unsigned int num_peers_, |
@@ -775,7 +775,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
775 | { | 775 | { |
776 | char *tok; | 776 | char *tok; |
777 | uint64_t event_mask; | 777 | uint64_t event_mask; |
778 | unsigned int num; | 778 | unsigned int num; |
779 | 779 | ||
780 | ok = 1; | 780 | ok = 1; |
781 | testing_cfg = GNUNET_CONFIGURATION_dup (cfg); | 781 | testing_cfg = GNUNET_CONFIGURATION_dup (cfg); |
@@ -806,7 +806,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
806 | return; | 806 | return; |
807 | } | 807 | } |
808 | if ( (NULL != data_filename) && | 808 | if ( (NULL != data_filename) && |
809 | (NULL == (data_file = | 809 | (NULL == (data_file = |
810 | GNUNET_DISK_file_open (data_filename, | 810 | GNUNET_DISK_file_open (data_filename, |
811 | GNUNET_DISK_OPEN_READWRITE | | 811 | GNUNET_DISK_OPEN_READWRITE | |
812 | GNUNET_DISK_OPEN_TRUNCATE | | 812 | GNUNET_DISK_OPEN_TRUNCATE | |
@@ -839,7 +839,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
839 | NULL, /* master_controller_cb cls */ | 839 | NULL, /* master_controller_cb cls */ |
840 | &test_master, | 840 | &test_master, |
841 | NULL); /* test_master cls */ | 841 | NULL); /* test_master cls */ |
842 | shutdown_task_id = | 842 | shutdown_task_id = |
843 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 843 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
844 | &shutdown_task, NULL); | 844 | &shutdown_task, NULL); |
845 | } | 845 | } |
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 2453c7e11..6dff5b8c5 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c | |||
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Should messages be delayed randomly? This option should be set to | 55 | * Should messages be delayed randomly? This option should be set to |
56 | * #GNUNET_NO only for experiments, not in production. | 56 | * #GNUNET_NO only for experiments, not in production. |
57 | */ | 57 | */ |
58 | #define USE_RANDOM_DELAYS GNUNET_YES | 58 | #define USE_RANDOM_DELAYS GNUNET_YES |
59 | 59 | ||
@@ -406,13 +406,13 @@ setup_estimate_message (struct GNUNET_NSE_ClientMessage *em) | |||
406 | * @param message the message received | 406 | * @param message the message received |
407 | */ | 407 | */ |
408 | static void | 408 | static void |
409 | handle_start_message (void *cls, | 409 | handle_start_message (void *cls, |
410 | struct GNUNET_SERVER_Client *client, | 410 | struct GNUNET_SERVER_Client *client, |
411 | const struct GNUNET_MessageHeader *message) | 411 | const struct GNUNET_MessageHeader *message) |
412 | { | 412 | { |
413 | struct GNUNET_NSE_ClientMessage em; | 413 | struct GNUNET_NSE_ClientMessage em; |
414 | 414 | ||
415 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 415 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
416 | "Received START message from client\n"); | 416 | "Received START message from client\n"); |
417 | GNUNET_SERVER_notification_context_add (nc, client); | 417 | GNUNET_SERVER_notification_context_add (nc, client); |
418 | setup_estimate_message (&em); | 418 | setup_estimate_message (&em); |
@@ -483,7 +483,7 @@ pow_hash (const void *buf, | |||
483 | size_t buf_len, | 483 | size_t buf_len, |
484 | struct GNUNET_HashCode *result) | 484 | struct GNUNET_HashCode *result) |
485 | { | 485 | { |
486 | GNUNET_break (0 == | 486 | GNUNET_break (0 == |
487 | gcry_kdf_derive (buf, buf_len, | 487 | gcry_kdf_derive (buf, buf_len, |
488 | GCRY_KDF_SCRYPT, | 488 | GCRY_KDF_SCRYPT, |
489 | 1 /* subalgo */, | 489 | 1 /* subalgo */, |
@@ -572,7 +572,7 @@ get_transmit_delay (int round_offset) | |||
572 | * @param tc scheduler context | 572 | * @param tc scheduler context |
573 | */ | 573 | */ |
574 | static void | 574 | static void |
575 | transmit_task_cb (void *cls, | 575 | transmit_task_cb (void *cls, |
576 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 576 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
577 | 577 | ||
578 | 578 | ||
@@ -586,7 +586,7 @@ transmit_task_cb (void *cls, | |||
586 | * @return number of bytes written to @a buf | 586 | * @return number of bytes written to @a buf |
587 | */ | 587 | */ |
588 | static size_t | 588 | static size_t |
589 | transmit_ready (void *cls, | 589 | transmit_ready (void *cls, |
590 | size_t size, | 590 | size_t size, |
591 | void *buf) | 591 | void *buf) |
592 | { | 592 | { |
@@ -635,7 +635,7 @@ transmit_ready (void *cls, | |||
635 | GNUNET_NO); | 635 | GNUNET_NO); |
636 | #if ENABLE_NSE_HISTOGRAM | 636 | #if ENABLE_NSE_HISTOGRAM |
637 | peer_entry->transmitted_messages++; | 637 | peer_entry->transmitted_messages++; |
638 | peer_entry->last_transmitted_size = | 638 | peer_entry->last_transmitted_size = |
639 | ntohl(size_estimate_messages[idx].matching_bits); | 639 | ntohl(size_estimate_messages[idx].matching_bits); |
640 | #endif | 640 | #endif |
641 | memcpy (buf, &size_estimate_messages[idx], | 641 | memcpy (buf, &size_estimate_messages[idx], |
@@ -651,7 +651,7 @@ transmit_ready (void *cls, | |||
651 | * @param tc scheduler context | 651 | * @param tc scheduler context |
652 | */ | 652 | */ |
653 | static void | 653 | static void |
654 | transmit_task_cb (void *cls, | 654 | transmit_task_cb (void *cls, |
655 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 655 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
656 | { | 656 | { |
657 | struct NSEPeerEntry *peer_entry = cls; | 657 | struct NSEPeerEntry *peer_entry = cls; |
@@ -681,8 +681,8 @@ update_network_size_estimate () | |||
681 | struct GNUNET_NSE_ClientMessage em; | 681 | struct GNUNET_NSE_ClientMessage em; |
682 | 682 | ||
683 | setup_estimate_message (&em); | 683 | setup_estimate_message (&em); |
684 | GNUNET_SERVER_notification_context_broadcast (nc, | 684 | GNUNET_SERVER_notification_context_broadcast (nc, |
685 | &em.header, | 685 | &em.header, |
686 | GNUNET_YES); | 686 | GNUNET_YES); |
687 | } | 687 | } |
688 | 688 | ||
@@ -734,8 +734,8 @@ setup_flood_message (unsigned int slot, | |||
734 | * @return #GNUNET_OK (continue to iterate) | 734 | * @return #GNUNET_OK (continue to iterate) |
735 | */ | 735 | */ |
736 | static int | 736 | static int |
737 | schedule_current_round (void *cls, | 737 | schedule_current_round (void *cls, |
738 | const struct GNUNET_PeerIdentity * key, | 738 | const struct GNUNET_PeerIdentity * key, |
739 | void *value) | 739 | void *value) |
740 | { | 740 | { |
741 | struct NSEPeerEntry *peer_entry = value; | 741 | struct NSEPeerEntry *peer_entry = value; |
@@ -774,7 +774,7 @@ schedule_current_round (void *cls, | |||
774 | * @param tc context for this message | 774 | * @param tc context for this message |
775 | */ | 775 | */ |
776 | static void | 776 | static void |
777 | update_flood_message (void *cls, | 777 | update_flood_message (void *cls, |
778 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 778 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
779 | { | 779 | { |
780 | struct GNUNET_TIME_Relative offset; | 780 | struct GNUNET_TIME_Relative offset; |
@@ -989,8 +989,8 @@ verify_message_crypto (const struct GNUNET_NSE_FloodMessage *incoming_flood) | |||
989 | * @return #GNUNET_OK (continue to iterate) | 989 | * @return #GNUNET_OK (continue to iterate) |
990 | */ | 990 | */ |
991 | static int | 991 | static int |
992 | update_flood_times (void *cls, | 992 | update_flood_times (void *cls, |
993 | const struct GNUNET_PeerIdentity *key, | 993 | const struct GNUNET_PeerIdentity *key, |
994 | void *value) | 994 | void *value) |
995 | { | 995 | { |
996 | struct NSEPeerEntry *exclude = cls; | 996 | struct NSEPeerEntry *exclude = cls; |
@@ -1032,7 +1032,7 @@ update_flood_times (void *cls, | |||
1032 | * @param peer peer identity this message is from (ignored) | 1032 | * @param peer peer identity this message is from (ignored) |
1033 | */ | 1033 | */ |
1034 | static int | 1034 | static int |
1035 | handle_p2p_size_estimate (void *cls, | 1035 | handle_p2p_size_estimate (void *cls, |
1036 | const struct GNUNET_PeerIdentity *peer, | 1036 | const struct GNUNET_PeerIdentity *peer, |
1037 | const struct GNUNET_MessageHeader *message) | 1037 | const struct GNUNET_MessageHeader *message) |
1038 | { | 1038 | { |
@@ -1059,12 +1059,12 @@ handle_p2p_size_estimate (void *cls, | |||
1059 | char pred[5]; | 1059 | char pred[5]; |
1060 | struct GNUNET_PeerIdentity os; | 1060 | struct GNUNET_PeerIdentity os; |
1061 | 1061 | ||
1062 | GNUNET_snprintf (origin, | 1062 | GNUNET_snprintf (origin, |
1063 | sizeof (origin), | 1063 | sizeof (origin), |
1064 | "%4s", | 1064 | "%4s", |
1065 | GNUNET_i2s (&incoming_flood->origin)); | 1065 | GNUNET_i2s (&incoming_flood->origin)); |
1066 | GNUNET_snprintf (pred, | 1066 | GNUNET_snprintf (pred, |
1067 | sizeof (pred), | 1067 | sizeof (pred), |
1068 | "%4s", | 1068 | "%4s", |
1069 | GNUNET_i2s (peer)); | 1069 | GNUNET_i2s (peer)); |
1070 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1070 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1083,7 +1083,7 @@ handle_p2p_size_estimate (void *cls, | |||
1083 | } | 1083 | } |
1084 | #if ENABLE_NSE_HISTOGRAM | 1084 | #if ENABLE_NSE_HISTOGRAM |
1085 | peer_entry->received_messages++; | 1085 | peer_entry->received_messages++; |
1086 | if (peer_entry->transmitted_messages > 0 && | 1086 | if (peer_entry->transmitted_messages > 0 && |
1087 | peer_entry->last_transmitted_size >= matching_bits) | 1087 | peer_entry->last_transmitted_size >= matching_bits) |
1088 | GNUNET_STATISTICS_update(stats, "# cross messages", 1, GNUNET_NO); | 1088 | GNUNET_STATISTICS_update(stats, "# cross messages", 1, GNUNET_NO); |
1089 | #endif | 1089 | #endif |
@@ -1117,7 +1117,7 @@ handle_p2p_size_estimate (void *cls, | |||
1117 | { | 1117 | { |
1118 | /* send to self, update our own estimate IF this also comes from us! */ | 1118 | /* send to self, update our own estimate IF this also comes from us! */ |
1119 | if (0 == | 1119 | if (0 == |
1120 | memcmp (&incoming_flood->origin, | 1120 | memcmp (&incoming_flood->origin, |
1121 | &my_identity, sizeof (my_identity))) | 1121 | &my_identity, sizeof (my_identity))) |
1122 | update_network_size_estimate (); | 1122 | update_network_size_estimate (); |
1123 | return GNUNET_OK; | 1123 | return GNUNET_OK; |
@@ -1131,7 +1131,7 @@ handle_p2p_size_estimate (void *cls, | |||
1131 | peer_entry->previous_round = GNUNET_YES; | 1131 | peer_entry->previous_round = GNUNET_YES; |
1132 | if (idx != estimate_index) | 1132 | if (idx != estimate_index) |
1133 | { | 1133 | { |
1134 | /* do not transmit information for the previous round to this peer | 1134 | /* do not transmit information for the previous round to this peer |
1135 | anymore (but allow current round) */ | 1135 | anymore (but allow current round) */ |
1136 | return GNUNET_OK; | 1136 | return GNUNET_OK; |
1137 | } | 1137 | } |
@@ -1249,7 +1249,7 @@ handle_core_connect (void *cls, | |||
1249 | * @param peer peer identity this notification is about | 1249 | * @param peer peer identity this notification is about |
1250 | */ | 1250 | */ |
1251 | static void | 1251 | static void |
1252 | handle_core_disconnect (void *cls, | 1252 | handle_core_disconnect (void *cls, |
1253 | const struct GNUNET_PeerIdentity *peer) | 1253 | const struct GNUNET_PeerIdentity *peer) |
1254 | { | 1254 | { |
1255 | struct NSEPeerEntry *pos; | 1255 | struct NSEPeerEntry *pos; |
@@ -1288,8 +1288,8 @@ handle_core_disconnect (void *cls, | |||
1288 | * @param cls NULL | 1288 | * @param cls NULL |
1289 | * @param size the amount of data sent (ignored) | 1289 | * @param size the amount of data sent (ignored) |
1290 | */ | 1290 | */ |
1291 | static void | 1291 | static void |
1292 | flush_comp_cb (void *cls, | 1292 | flush_comp_cb (void *cls, |
1293 | size_t size) | 1293 | size_t size) |
1294 | { | 1294 | { |
1295 | GNUNET_TESTBED_LOGGER_disconnect (lh); | 1295 | GNUNET_TESTBED_LOGGER_disconnect (lh); |
@@ -1359,7 +1359,7 @@ shutdown_task (void *cls, | |||
1359 | * @param identity the public identity of this peer | 1359 | * @param identity the public identity of this peer |
1360 | */ | 1360 | */ |
1361 | static void | 1361 | static void |
1362 | core_init (void *cls, | 1362 | core_init (void *cls, |
1363 | const struct GNUNET_PeerIdentity *identity) | 1363 | const struct GNUNET_PeerIdentity *identity) |
1364 | { | 1364 | { |
1365 | struct GNUNET_TIME_Absolute now; | 1365 | struct GNUNET_TIME_Absolute now; |
@@ -1406,7 +1406,7 @@ core_init (void *cls, | |||
1406 | * @param c configuration to use | 1406 | * @param c configuration to use |
1407 | */ | 1407 | */ |
1408 | static void | 1408 | static void |
1409 | run (void *cls, | 1409 | run (void *cls, |
1410 | struct GNUNET_SERVER_Handle *server, | 1410 | struct GNUNET_SERVER_Handle *server, |
1411 | const struct GNUNET_CONFIGURATION_Handle *c) | 1411 | const struct GNUNET_CONFIGURATION_Handle *c) |
1412 | { | 1412 | { |
@@ -1424,7 +1424,7 @@ run (void *cls, | |||
1424 | struct GNUNET_CRYPTO_EccPrivateKey *pk; | 1424 | struct GNUNET_CRYPTO_EccPrivateKey *pk; |
1425 | 1425 | ||
1426 | cfg = c; | 1426 | cfg = c; |
1427 | srv = server; | 1427 | srv = server; |
1428 | if (GNUNET_OK != | 1428 | if (GNUNET_OK != |
1429 | GNUNET_CONFIGURATION_get_value_time (cfg, "NSE", "INTERVAL", | 1429 | GNUNET_CONFIGURATION_get_value_time (cfg, "NSE", "INTERVAL", |
1430 | &gnunet_nse_interval)) | 1430 | &gnunet_nse_interval)) |
@@ -1436,7 +1436,7 @@ run (void *cls, | |||
1436 | } | 1436 | } |
1437 | if (GNUNET_OK != | 1437 | if (GNUNET_OK != |
1438 | GNUNET_CONFIGURATION_get_value_time (cfg, "NSE", "WORKDELAY", | 1438 | GNUNET_CONFIGURATION_get_value_time (cfg, "NSE", "WORKDELAY", |
1439 | &proof_find_delay)) | 1439 | &proof_find_delay)) |
1440 | { | 1440 | { |
1441 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | 1441 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, |
1442 | "NSE", "WORKDELAY"); | 1442 | "NSE", "WORKDELAY"); |
@@ -1461,7 +1461,7 @@ run (void *cls, | |||
1461 | GNUNET_SCHEDULER_shutdown (); | 1461 | GNUNET_SCHEDULER_shutdown (); |
1462 | return; | 1462 | return; |
1463 | } | 1463 | } |
1464 | 1464 | ||
1465 | #if ENABLE_NSE_HISTOGRAM | 1465 | #if ENABLE_NSE_HISTOGRAM |
1466 | if (NULL == (lh = GNUNET_TESTBED_LOGGER_connect (cfg))) | 1466 | if (NULL == (lh = GNUNET_TESTBED_LOGGER_connect (cfg))) |
1467 | { | 1467 | { |
@@ -1477,7 +1477,7 @@ run (void *cls, | |||
1477 | pk = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg); | 1477 | pk = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg); |
1478 | GNUNET_assert (NULL != pk); | 1478 | GNUNET_assert (NULL != pk); |
1479 | my_private_key = pk; | 1479 | my_private_key = pk; |
1480 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, | 1480 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, |
1481 | &my_identity.public_key); | 1481 | &my_identity.public_key); |
1482 | if (GNUNET_OK != | 1482 | if (GNUNET_OK != |
1483 | GNUNET_CONFIGURATION_get_value_filename (cfg, "NSE", "PROOFFILE", &proof)) | 1483 | GNUNET_CONFIGURATION_get_value_filename (cfg, "NSE", "PROOFFILE", &proof)) |
@@ -1486,7 +1486,7 @@ run (void *cls, | |||
1486 | _ | 1486 | _ |
1487 | ("NSE service is lacking key configuration settings. Exiting.\n")); | 1487 | ("NSE service is lacking key configuration settings. Exiting.\n")); |
1488 | GNUNET_free (my_private_key); | 1488 | GNUNET_free (my_private_key); |
1489 | my_private_key = NULL; | 1489 | my_private_key = NULL; |
1490 | GNUNET_SCHEDULER_shutdown (); | 1490 | GNUNET_SCHEDULER_shutdown (); |
1491 | return; | 1491 | return; |
1492 | } | 1492 | } |
@@ -1530,7 +1530,7 @@ run (void *cls, | |||
1530 | * @return 0 ok, 1 on error | 1530 | * @return 0 ok, 1 on error |
1531 | */ | 1531 | */ |
1532 | int | 1532 | int |
1533 | main (int argc, | 1533 | main (int argc, |
1534 | char *const *argv) | 1534 | char *const *argv) |
1535 | { | 1535 | { |
1536 | return (GNUNET_OK == | 1536 | return (GNUNET_OK == |
@@ -1545,7 +1545,7 @@ main (int argc, | |||
1545 | /** | 1545 | /** |
1546 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. | 1546 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. |
1547 | */ | 1547 | */ |
1548 | void __attribute__ ((constructor)) | 1548 | void __attribute__ ((constructor)) |
1549 | GNUNET_ARM_memory_init () | 1549 | GNUNET_ARM_memory_init () |
1550 | { | 1550 | { |
1551 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); | 1551 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); |
diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c index 3542b5f8a..bc927f481 100644 --- a/src/nse/nse_api.c +++ b/src/nse/nse_api.c | |||
@@ -106,7 +106,7 @@ message_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
106 | GNUNET_CLIENT_disconnect (h->client); | 106 | GNUNET_CLIENT_disconnect (h->client); |
107 | h->client = NULL; | 107 | h->client = NULL; |
108 | h->reconnect_task = | 108 | h->reconnect_task = |
109 | GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, | 109 | GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, |
110 | &reconnect, h); | 110 | &reconnect, h); |
111 | return; | 111 | return; |
112 | } | 112 | } |
@@ -118,7 +118,7 @@ message_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
118 | } | 118 | } |
119 | client_msg = (const struct GNUNET_NSE_ClientMessage *) msg; | 119 | client_msg = (const struct GNUNET_NSE_ClientMessage *) msg; |
120 | h->recv_cb (h->recv_cb_cls, GNUNET_TIME_absolute_ntoh (client_msg->timestamp), | 120 | h->recv_cb (h->recv_cb_cls, GNUNET_TIME_absolute_ntoh (client_msg->timestamp), |
121 | GNUNET_ntoh_double (client_msg->size_estimate), | 121 | GNUNET_ntoh_double (client_msg->size_estimate), |
122 | GNUNET_ntoh_double (client_msg->std_deviation)); | 122 | GNUNET_ntoh_double (client_msg->std_deviation)); |
123 | GNUNET_CLIENT_receive (h->client, &message_handler, h, | 123 | GNUNET_CLIENT_receive (h->client, &message_handler, h, |
124 | GNUNET_TIME_UNIT_FOREVER_REL); | 124 | GNUNET_TIME_UNIT_FOREVER_REL); |
@@ -175,13 +175,13 @@ send_start (void *cls, size_t size, void *buf) | |||
175 | { | 175 | { |
176 | /* Connect error... */ | 176 | /* Connect error... */ |
177 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 177 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
178 | "Error while trying to transmit `%s' request.\n", | 178 | "Error while trying to transmit `%s' request.\n", |
179 | "START"); | 179 | "START"); |
180 | reschedule_connect (h); | 180 | reschedule_connect (h); |
181 | return 0; | 181 | return 0; |
182 | } | 182 | } |
183 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 183 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
184 | "Transmitting `%s' request.\n", | 184 | "Transmitting `%s' request.\n", |
185 | "START"); | 185 | "START"); |
186 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); | 186 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); |
187 | 187 | ||
@@ -201,7 +201,7 @@ send_start (void *cls, size_t size, void *buf) | |||
201 | * @param tc scheduler context | 201 | * @param tc scheduler context |
202 | */ | 202 | */ |
203 | static void | 203 | static void |
204 | reconnect (void *cls, | 204 | reconnect (void *cls, |
205 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 205 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
206 | { | 206 | { |
207 | struct GNUNET_NSE_Handle *h = cls; | 207 | struct GNUNET_NSE_Handle *h = cls; |
diff --git a/src/nse/perf_kdf.c b/src/nse/perf_kdf.c index aac71916b..800be3d1b 100644 --- a/src/nse/perf_kdf.c +++ b/src/nse/perf_kdf.c | |||
@@ -43,7 +43,7 @@ pow_hash (const void *buf, | |||
43 | size_t buf_len, | 43 | size_t buf_len, |
44 | struct GNUNET_HashCode *result) | 44 | struct GNUNET_HashCode *result) |
45 | { | 45 | { |
46 | GNUNET_break (0 == | 46 | GNUNET_break (0 == |
47 | gcry_kdf_derive (buf, buf_len, | 47 | gcry_kdf_derive (buf, buf_len, |
48 | GCRY_KDF_SCRYPT, | 48 | GCRY_KDF_SCRYPT, |
49 | 1 /* subalgo */, | 49 | 1 /* subalgo */, |
diff --git a/src/nse/test_nse_api.c b/src/nse/test_nse_api.c index 171595b79..324d4ff16 100644 --- a/src/nse/test_nse_api.c +++ b/src/nse/test_nse_api.c | |||
@@ -76,7 +76,7 @@ check_nse_message (void *cls, struct GNUNET_TIME_Absolute timestamp, | |||
76 | 76 | ||
77 | 77 | ||
78 | static void | 78 | static void |
79 | run (void *cls, | 79 | run (void *cls, |
80 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 80 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
81 | struct GNUNET_TESTING_Peer *peer) | 81 | struct GNUNET_TESTING_Peer *peer) |
82 | { | 82 | { |
diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c index 45462013c..9b085dd90 100644 --- a/src/nse/test_nse_multipeer.c +++ b/src/nse/test_nse_multipeer.c | |||
@@ -52,7 +52,7 @@ struct NSEPeer | |||
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Handle to NSE service. | 54 | * Handle to NSE service. |
55 | */ | 55 | */ |
56 | struct GNUNET_NSE_Handle *nse_handle; | 56 | struct GNUNET_NSE_Handle *nse_handle; |
57 | }; | 57 | }; |
58 | 58 | ||
@@ -100,9 +100,9 @@ handle_estimate (void *cls, struct GNUNET_TIME_Absolute timestamp, | |||
100 | 100 | ||
101 | FPRINTF (stderr, | 101 | FPRINTF (stderr, |
102 | "Received network size estimate from peer %u. logSize: %f std.dev. %f (%f/%u)\n", | 102 | "Received network size estimate from peer %u. logSize: %f std.dev. %f (%f/%u)\n", |
103 | (unsigned int) (peer - nse_peers), | 103 | (unsigned int) (peer - nse_peers), |
104 | estimate, std_dev, | 104 | estimate, std_dev, |
105 | GNUNET_NSE_log_estimate_to_n (estimate), | 105 | GNUNET_NSE_log_estimate_to_n (estimate), |
106 | NUM_PEERS); | 106 | NUM_PEERS); |
107 | ok = 0; | 107 | ok = 0; |
108 | } | 108 | } |
@@ -118,7 +118,7 @@ handle_estimate (void *cls, struct GNUNET_TIME_Absolute timestamp, | |||
118 | * operation has executed successfully. | 118 | * operation has executed successfully. |
119 | */ | 119 | */ |
120 | static void | 120 | static void |
121 | nse_connect_complete_cb (void *cls, | 121 | nse_connect_complete_cb (void *cls, |
122 | struct GNUNET_TESTBED_Operation *op, | 122 | struct GNUNET_TESTBED_Operation *op, |
123 | void *ca_result, | 123 | void *ca_result, |
124 | const char *emsg) | 124 | const char *emsg) |
@@ -143,18 +143,18 @@ nse_connect_complete_cb (void *cls, | |||
143 | /** | 143 | /** |
144 | * Adapter function called to establish a connection to | 144 | * Adapter function called to establish a connection to |
145 | * the NSE service. | 145 | * the NSE service. |
146 | * | 146 | * |
147 | * @param cls closure | 147 | * @param cls closure |
148 | * @param cfg configuration of the peer to connect to; will be available until | 148 | * @param cfg configuration of the peer to connect to; will be available until |
149 | * GNUNET_TESTBED_operation_done() is called on the operation returned | 149 | * GNUNET_TESTBED_operation_done() is called on the operation returned |
150 | * from GNUNET_TESTBED_service_connect() | 150 | * from GNUNET_TESTBED_service_connect() |
151 | * @return service handle to return in 'op_result', NULL on error | 151 | * @return service handle to return in 'op_result', NULL on error |
152 | */ | 152 | */ |
153 | static void * | 153 | static void * |
154 | nse_connect_adapter (void *cls, | 154 | nse_connect_adapter (void *cls, |
155 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 155 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
156 | { | 156 | { |
157 | return GNUNET_NSE_connect (cfg, | 157 | return GNUNET_NSE_connect (cfg, |
158 | &handle_estimate, | 158 | &handle_estimate, |
159 | cls); | 159 | cls); |
160 | } | 160 | } |
@@ -163,7 +163,7 @@ nse_connect_adapter (void *cls, | |||
163 | /** | 163 | /** |
164 | * Adapter function called to destroy connection to | 164 | * Adapter function called to destroy connection to |
165 | * NSE service. | 165 | * NSE service. |
166 | * | 166 | * |
167 | * @param cls closure | 167 | * @param cls closure |
168 | * @param op_result service handle returned from the connect adapter | 168 | * @param op_result service handle returned from the connect adapter |
169 | */ | 169 | */ |
@@ -177,7 +177,7 @@ nse_disconnect_adapter (void *cls, | |||
177 | 177 | ||
178 | /** | 178 | /** |
179 | * Actual "main" function for the testcase. | 179 | * Actual "main" function for the testcase. |
180 | * | 180 | * |
181 | * @param cls closure | 181 | * @param cls closure |
182 | * @param h the run handle | 182 | * @param h the run handle |
183 | * @param num_peers number of peers in 'peers' | 183 | * @param num_peers number of peers in 'peers' |