aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/uncrustify.cfg17
-rw-r--r--src/abd/abd.h2
-rw-r--r--src/abd/abd_api.c90
-rw-r--r--src/abd/abd_serialization.c40
-rw-r--r--src/abd/abd_serialization.h14
-rw-r--r--src/abd/delegate_misc.c2
-rw-r--r--src/abd/delegate_misc.h2
-rw-r--r--src/abd/gnunet-abd.c268
-rw-r--r--src/abd/gnunet-service-abd.c170
-rw-r--r--src/abd/plugin_gnsrecord_abd.c1
-rw-r--r--src/abe/abe.c14
-rw-r--r--src/abe/test_cpabe.c1
-rw-r--r--src/arm/arm_api.c9
-rw-r--r--src/arm/gnunet-arm.c1
-rw-r--r--src/arm/gnunet-service-arm.c6
-rw-r--r--src/arm/mockup-service.c3
-rw-r--r--src/arm/test_arm_api.c4
-rw-r--r--src/arm/test_exponential_backoff.c1
-rw-r--r--src/arm/test_gnunet_service_arm.c1
-rw-r--r--src/ats-tests/ats-testing-experiment.c9
-rw-r--r--src/ats-tests/ats-testing-log.c6
-rw-r--r--src/ats-tests/ats-testing-preferences.c1
-rw-r--r--src/ats-tests/ats-testing-traffic.c1
-rw-r--r--src/ats-tests/ats-testing.c1
-rw-r--r--src/ats-tests/gnunet-ats-sim.c11
-rw-r--r--src/ats-tests/gnunet-solver-eval.c25
-rw-r--r--src/ats-tests/perf_ats.c3
-rw-r--r--src/ats-tests/perf_ats_logging.c5
-rw-r--r--src/ats-tool/gnunet-ats.c1
-rw-r--r--src/ats/ats.h2
-rw-r--r--src/ats/ats_api_performance.c1
-rw-r--r--src/ats/gnunet-ats-solver-eval.c40
-rw-r--r--src/ats/gnunet-service-ats.c1
-rw-r--r--src/ats/gnunet-service-ats_addresses.c1
-rw-r--r--src/ats/gnunet-service-ats_performance.c1
-rw-r--r--src/ats/gnunet-service-ats_reservations.c1
-rw-r--r--src/ats/perf_ats_solver.c4
-rw-r--r--src/ats/plugin_ats_proportional.c3
-rw-r--r--src/ats/test_ats_api.c50
-rw-r--r--src/ats/test_ats_lib.c2
-rw-r--r--src/ats/test_ats_reservation_api.c22
-rw-r--r--src/auction/gnunet-auction-info.c1
-rw-r--r--src/auction/gnunet-auction-join.c1
-rw-r--r--src/auction/test_auction_api.c2
-rw-r--r--src/block/block.c1
-rw-r--r--src/block/plugin_block_template.c1
-rw-r--r--src/block/plugin_block_test.c1
-rw-r--r--src/cadet/cadet_api.c1
-rw-r--r--src/cadet/cadet_api_get_channel.c1
-rw-r--r--src/cadet/cadet_api_list_peers.c1
-rw-r--r--src/cadet/cadet_test_lib.c1
-rw-r--r--src/cadet/gnunet-cadet-profiler.c11
-rw-r--r--src/cadet/gnunet-cadet.c4
-rw-r--r--src/cadet/gnunet-service-cadet.c4
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c6
-rw-r--r--src/cadet/gnunet-service-cadet_channel.h1
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c1
-rw-r--r--src/cadet/gnunet-service-cadet_core.c1
-rw-r--r--src/cadet/gnunet-service-cadet_dht.c1
-rw-r--r--src/cadet/gnunet-service-cadet_hello.c1
-rw-r--r--src/cadet/gnunet-service-cadet_paths.c1
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c3
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.c8
-rw-r--r--src/cadet/test_cadet.c37
-rw-r--r--src/cadet/test_cadet_flow.c15
-rw-r--r--src/cadet/test_cadet_local_mq.c3
-rw-r--r--src/consensus/consensus_api.c2
-rw-r--r--src/consensus/gnunet-service-consensus.c27
-rw-r--r--src/consensus/plugin_block_consensus.c1
-rw-r--r--src/consensus/test_consensus_api.c2
-rw-r--r--src/conversation/conversation_api.c2
-rw-r--r--src/conversation/gnunet-conversation-test.c1
-rw-r--r--src/conversation/gnunet-conversation.c4
-rw-r--r--src/conversation/gnunet-helper-audio-playback.c21
-rw-r--r--src/conversation/gnunet-helper-audio-record-gst.c3
-rw-r--r--src/conversation/gnunet-helper-audio-record.c1
-rw-r--r--src/conversation/gnunet_gst.c35
-rw-r--r--src/conversation/gnunet_gst_def.h3
-rw-r--r--src/conversation/gnunet_gst_test.c8
-rw-r--r--src/conversation/microphone.c1
-rw-r--r--src/conversation/plugin_gnsrecord_conversation.c1
-rw-r--r--src/conversation/speaker.c1
-rw-r--r--src/conversation/test_conversation_api.c1
-rw-r--r--src/conversation/test_conversation_api_reject.c1
-rw-r--r--src/conversation/test_conversation_api_twocalls.c1
-rw-r--r--src/core/gnunet-core.c1
-rw-r--r--src/core/gnunet-service-core.c6
-rw-r--r--src/core/gnunet-service-core_sessions.c1
-rw-r--r--src/core/gnunet-service-core_typemap.c1
-rw-r--r--src/core/test_core_api.c1
-rw-r--r--src/core/test_core_api_reliability.c1
-rw-r--r--src/core/test_core_api_send_to_self.c1
-rw-r--r--src/core/test_core_api_start_only.c1
-rw-r--r--src/core/test_core_quota_compliance.c1
-rw-r--r--src/curl/curl.c4
-rw-r--r--src/curl/curl_reschedule.c1
-rw-r--r--src/datacache/perf_datacache.c1
-rw-r--r--src/datacache/plugin_datacache_heap.c2
-rw-r--r--src/datacache/plugin_datacache_postgres.c1
-rw-r--r--src/datacache/plugin_datacache_template.c1
-rw-r--r--src/datacache/test_datacache.c1
-rw-r--r--src/datacache/test_datacache_quota.c1
-rw-r--r--src/datastore/datastore.h1
-rw-r--r--src/datastore/datastore_api.c1
-rw-r--r--src/datastore/gnunet-datastore.c3
-rw-r--r--src/datastore/gnunet-service-datastore.c3
-rw-r--r--src/datastore/perf_datastore_api.c1
-rw-r--r--src/datastore/perf_plugin_datastore.c2
-rw-r--r--src/datastore/plugin_datastore_heap.c2
-rw-r--r--src/datastore/plugin_datastore_mysql.c2
-rw-r--r--src/datastore/plugin_datastore_postgres.c4
-rw-r--r--src/datastore/plugin_datastore_sqlite.c4
-rw-r--r--src/datastore/plugin_datastore_template.c2
-rw-r--r--src/datastore/test_datastore_api.c1
-rw-r--r--src/datastore/test_datastore_api_management.c1
-rw-r--r--src/datastore/test_plugin_datastore.c6
-rw-r--r--src/dht/dht.h1
-rw-r--r--src/dht/dht_test_lib.c1
-rw-r--r--src/dht/gnunet-dht-get.c1
-rw-r--r--src/dht/gnunet-dht-monitor.c2
-rw-r--r--src/dht/gnunet-dht-put.c2
-rw-r--r--src/dht/gnunet-service-dht.c2
-rw-r--r--src/dht/gnunet-service-dht.h1
-rw-r--r--src/dht/gnunet-service-dht_clients.c5
-rw-r--r--src/dht/gnunet-service-dht_hello.c1
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c7
-rw-r--r--src/dht/gnunet-service-dht_neighbours.h1
-rw-r--r--src/dht/gnunet-service-dht_nse.c1
-rw-r--r--src/dht/gnunet-service-dht_routing.c1
-rw-r--r--src/dht/plugin_block_dht.c1
-rw-r--r--src/dht/test_dht_api.c1
-rw-r--r--src/dht/test_dht_topo.c1
-rw-r--r--src/dns/dns_api.c2
-rw-r--r--src/dns/gnunet-helper-dns.c1
-rw-r--r--src/dns/gnunet-service-dns.c2
-rw-r--r--src/dns/plugin_block_dns.c1
-rw-r--r--src/exit/gnunet-daemon-exit.c7
-rw-r--r--src/exit/gnunet-helper-exit.c1
-rw-r--r--src/fragmentation/defragmentation.c1
-rw-r--r--src/fs/fs_api.h3
-rw-r--r--src/fs/fs_directory.c1
-rw-r--r--src/fs/fs_download.c5
-rw-r--r--src/fs/fs_file_information.c1
-rw-r--r--src/fs/fs_getopt.c3
-rw-r--r--src/fs/fs_publish_ublock.c1
-rw-r--r--src/fs/fs_search.c1
-rw-r--r--src/fs/fs_sharetree.c1
-rw-r--r--src/fs/fs_test_lib.h1
-rw-r--r--src/fs/fs_tree.c1
-rw-r--r--src/fs/fs_unindex.c1
-rw-r--r--src/fs/fs_uri.c8
-rw-r--r--src/fs/gnunet-auto-share.c1
-rw-r--r--src/fs/gnunet-daemon-fsprofiler.c1
-rw-r--r--src/fs/gnunet-directory.c2
-rw-r--r--src/fs/gnunet-download.c1
-rw-r--r--src/fs/gnunet-fs-profiler.c1
-rw-r--r--src/fs/gnunet-fs.c2
-rw-r--r--src/fs/gnunet-helper-fs-publish.c3
-rw-r--r--src/fs/gnunet-publish.c1
-rw-r--r--src/fs/gnunet-search.c1
-rw-r--r--src/fs/gnunet-service-fs.c4
-rw-r--r--src/fs/gnunet-service-fs_cadet_server.c5
-rw-r--r--src/fs/gnunet-service-fs_cp.h1
-rw-r--r--src/fs/gnunet-service-fs_indexing.c1
-rw-r--r--src/fs/gnunet-service-fs_pe.c4
-rw-r--r--src/fs/gnunet-service-fs_pr.c1
-rw-r--r--src/fs/gnunet-service-fs_pr.h1
-rw-r--r--src/fs/gnunet-service-fs_push.c1
-rw-r--r--src/fs/gnunet-service-fs_put.c1
-rw-r--r--src/fs/gnunet-unindex.c2
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p.c1
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p_respect.c2
-rw-r--r--src/fs/plugin_block_fs.c1
-rw-r--r--src/fs/test_fs.c3
-rw-r--r--src/fs/test_fs_directory.c2
-rw-r--r--src/fs/test_fs_download.c1
-rw-r--r--src/fs/test_fs_download_persistence.c1
-rw-r--r--src/fs/test_fs_file_information.c1
-rw-r--r--src/fs/test_fs_list_indexed.c1
-rw-r--r--src/fs/test_fs_publish.c1
-rw-r--r--src/fs/test_fs_publish_persistence.c1
-rw-r--r--src/fs/test_fs_search.c1
-rw-r--r--src/fs/test_fs_search_persistence.c1
-rw-r--r--src/fs/test_fs_search_probes.c1
-rw-r--r--src/fs/test_fs_search_with_and.c1
-rw-r--r--src/fs/test_fs_start_stop.c1
-rw-r--r--src/fs/test_fs_test_lib.c1
-rw-r--r--src/fs/test_fs_unindex.c1
-rw-r--r--src/fs/test_fs_unindex_persistence.c1
-rw-r--r--src/fs/test_fs_uri.c1
-rw-r--r--src/fs/test_gnunet_service_fs_migration.c1
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c1
-rw-r--r--src/fs/test_plugin_block_fs.c1
-rw-r--r--src/gns/gns_tld_api.c1
-rw-r--r--src/gns/gnunet-dns2gns.c2
-rw-r--r--src/gns/gnunet-gns-benchmark.c1
-rw-r--r--src/gns/gnunet-gns-import.c13
-rw-r--r--src/gns/gnunet-gns-proxy.c9
-rw-r--r--src/gns/gnunet-gns.c3
-rw-r--r--src/gns/gnunet-service-gns_interceptor.c1
-rw-r--r--src/gns/gnunet-service-gns_resolver.c1
-rw-r--r--src/gns/nss/nss_gns_query.c1
-rw-r--r--src/gns/plugin_block_gns.c1
-rw-r--r--src/gns/plugin_gnsrecord_gns.c1
-rw-r--r--src/gns/plugin_rest_gns.c1
-rw-r--r--src/gns/test_gns_proxy.c5
-rw-r--r--src/gnsrecord/gnsrecord.c1
-rw-r--r--src/gnsrecord/gnsrecord_crypto.c1
-rw-r--r--src/gnsrecord/gnsrecord_serialization.c3
-rw-r--r--src/gnsrecord/perf_gnsrecord_crypto.c1
-rw-r--r--src/gnsrecord/plugin_gnsrecord_dns.c1
-rw-r--r--src/gnsrecord/test_gnsrecord_block_expiration.c2
-rw-r--r--src/gnsrecord/test_gnsrecord_crypto.c2
-rw-r--r--src/gnsrecord/test_gnsrecord_serialization.c1
-rw-r--r--src/hello/gnunet-hello.c1
-rw-r--r--src/hello/hello.c1
-rw-r--r--src/hello/test_hello.c1
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c1
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_client.c1
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_server.c1
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c1
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c1
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_reconnect.c1
-rw-r--r--src/identity/gnunet-identity.c1
-rw-r--r--src/identity/gnunet-service-identity.c8
-rw-r--r--src/identity/identity_api.c1
-rw-r--r--src/identity/plugin_rest_identity.c16
-rw-r--r--src/include/block_fs.h1
-rw-r--r--src/include/compat.h1
-rw-r--r--src/include/gnunet_abd_service.h125
-rw-r--r--src/include/gnunet_abe_lib.h1
-rw-r--r--src/include/gnunet_ats_service.h3
-rw-r--r--src/include/gnunet_bio_lib.h3
-rw-r--r--src/include/gnunet_block_plugin.h1
-rw-r--r--src/include/gnunet_common.h1
-rw-r--r--src/include/gnunet_configuration_lib.h1
-rw-r--r--src/include/gnunet_consensus_service.h2
-rw-r--r--src/include/gnunet_constants.h3
-rw-r--r--src/include/gnunet_datastore_service.h1
-rw-r--r--src/include/gnunet_dht_service.h2
-rw-r--r--src/include/gnunet_dns_service.h1
-rw-r--r--src/include/gnunet_dnsparser_lib.h1
-rw-r--r--src/include/gnunet_fragmentation_lib.h1
-rw-r--r--src/include/gnunet_fs_service.h4
-rw-r--r--src/include/gnunet_my_lib.h2
-rw-r--r--src/include/gnunet_namecache_service.h1
-rw-r--r--src/include/gnunet_nat_service.h2
-rw-r--r--src/include/gnunet_os_lib.h1
-rw-r--r--src/include/gnunet_rps_service.h1
-rw-r--r--src/include/gnunet_scheduler_lib.h4
-rw-r--r--src/include/gnunet_secretsharing_service.h1
-rw-r--r--src/include/gnunet_service_lib.h1
-rw-r--r--src/include/gnunet_set_service.h2
-rw-r--r--src/include/gnunet_sq_lib.h4
-rw-r--r--src/include/gnunet_statistics_service.h1
-rw-r--r--src/include/gnunet_strings_lib.h1
-rw-r--r--src/include/gnunet_testbed_service.h3
-rw-r--r--src/include/gnunet_testing_lib.h1
-rw-r--r--src/include/gnunet_time_lib.h2
-rw-r--r--src/include/platform.h1
-rw-r--r--src/json/json_generator.c1
-rw-r--r--src/json/json_mhd.c1
-rw-r--r--src/json/test_json.c1
-rw-r--r--src/json/test_json_mhd.c1
-rw-r--r--src/namecache/gnunet-namecache.c1
-rw-r--r--src/namecache/plugin_namecache_flat.c5
-rw-r--r--src/namecache/plugin_namecache_postgres.c1
-rw-r--r--src/namecache/plugin_namecache_sqlite.c1
-rw-r--r--src/namecache/test_namecache_api_cache_block.c1
-rw-r--r--src/namecache/test_plugin_namecache.c1
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c3
-rw-r--r--src/namestore/gnunet-namestore.c1
-rw-r--r--src/namestore/gnunet-zoneimport.c1
-rw-r--r--src/namestore/namestore.h2
-rw-r--r--src/namestore/namestore_api_monitor.c1
-rw-r--r--src/namestore/plugin_namestore_flat.c1
-rw-r--r--src/namestore/plugin_namestore_postgres.c1
-rw-r--r--src/namestore/plugin_namestore_sqlite.c1
-rw-r--r--src/namestore/plugin_rest_namestore.c1
-rw-r--r--src/namestore/test_namestore_api_lookup_nick.c1
-rw-r--r--src/namestore/test_namestore_api_monitoring.c1
-rw-r--r--src/namestore/test_namestore_api_remove.c1
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c1
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_specific_zone.c1
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_stop.c1
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c1
-rw-r--r--src/namestore/test_plugin_namestore.c1
-rw-r--r--src/nat-auto/gnunet-nat-auto_legacy.c1
-rw-r--r--src/nat-auto/gnunet-nat-server.c3
-rw-r--r--src/nat-auto/gnunet-service-nat-auto.c2
-rw-r--r--src/nat-auto/nat-auto.h1
-rw-r--r--src/nat-auto/nat_auto_api.c2
-rw-r--r--src/nat-auto/nat_auto_api_test.c1
-rw-r--r--src/nat/gnunet-helper-nat-client.c1
-rw-r--r--src/nat/gnunet-service-nat.c5
-rw-r--r--src/nat/gnunet-service-nat_externalip.c1
-rw-r--r--src/nat/gnunet-service-nat_mini.c6
-rw-r--r--src/nat/gnunet-service-nat_stun.c1
-rw-r--r--src/nat/nat.h1
-rw-r--r--src/nat/test_nat.c1
-rw-r--r--src/nat/test_nat_mini.c2
-rw-r--r--src/nat/test_nat_test.c1
-rw-r--r--src/nat/test_stun.c2
-rw-r--r--src/nse/gnunet-nse-profiler.c1
-rw-r--r--src/nse/gnunet-service-nse.c11
-rw-r--r--src/nse/nse_api.c1
-rw-r--r--src/nse/perf_kdf.c2
-rw-r--r--src/nse/test_nse_api.c2
-rw-r--r--src/nse/test_nse_multipeer.c1
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c2
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo_plugins.c1
-rw-r--r--src/peerinfo-tool/plugin_rest_peerinfo.c3
-rw-r--r--src/peerinfo/peerinfo.h1
-rw-r--r--src/peerinfo/peerinfo_api.c1
-rw-r--r--src/peerinfo/peerinfo_api_notify.c1
-rw-r--r--src/peerinfo/perf_peerinfo_api.c1
-rw-r--r--src/peerinfo/test_peerinfo_api.c2
-rw-r--r--src/peerinfo/test_peerinfo_api_friend_only.c1
-rw-r--r--src/peerinfo/test_peerinfo_api_notify_friend_only.c3
-rw-r--r--src/peerinfo/test_peerinfo_shipped_hellos.c1
-rw-r--r--src/peerstore/gnunet-peerstore.c1
-rw-r--r--src/peerstore/peerstore_api.c1
-rw-r--r--src/peerstore/perf_peerstore_store.c1
-rw-r--r--src/peerstore/plugin_peerstore_flat.c6
-rw-r--r--src/peerstore/plugin_peerstore_sqlite.c1
-rw-r--r--src/peerstore/test_peerstore_api_iterate.c1
-rw-r--r--src/peerstore/test_peerstore_api_store.c1
-rw-r--r--src/peerstore/test_peerstore_api_sync.c7
-rw-r--r--src/peerstore/test_peerstore_api_watch.c1
-rw-r--r--src/peerstore/test_plugin_peerstore.c1
-rw-r--r--src/pq/pq_connect.c1
-rw-r--r--src/pt/gnunet-daemon-pt.c4
-rw-r--r--src/pt/test_gns_vpn.c3
-rw-r--r--src/pt/test_gnunet_vpn.c1
-rw-r--r--src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c1
-rw-r--r--src/reclaim-attribute/reclaim_attribute.c1
-rw-r--r--src/reclaim/gnunet-reclaim.c12
-rw-r--r--src/reclaim/gnunet-service-reclaim.c4
-rw-r--r--src/reclaim/gnunet-service-reclaim_tickets.c4
-rw-r--r--src/reclaim/json_reclaim.c6
-rw-r--r--src/reclaim/oidc_helper.c11
-rw-r--r--src/reclaim/oidc_helper.h1
-rw-r--r--src/reclaim/plugin_gnsrecord_reclaim.c1
-rw-r--r--src/reclaim/plugin_rest_openid_connect.c20
-rw-r--r--src/reclaim/plugin_rest_reclaim.c10
-rw-r--r--src/reclaim/reclaim_api.c2
-rw-r--r--src/regex/gnunet-daemon-regexprofiler.c10
-rw-r--r--src/regex/gnunet-regex-profiler.c7
-rw-r--r--src/regex/gnunet-regex-simulation-profiler.c7
-rw-r--r--src/regex/perf-regex.c1
-rw-r--r--src/regex/plugin_block_regex.c1
-rw-r--r--src/regex/regex_api_announce.c2
-rw-r--r--src/regex/regex_block_lib.c2
-rw-r--r--src/regex/regex_internal.c62
-rw-r--r--src/regex/regex_internal.h1
-rw-r--r--src/regex/regex_internal_lib.h1
-rw-r--r--src/regex/regex_test_graph.c2
-rw-r--r--src/regex/regex_test_lib.c15
-rw-r--r--src/regex/regex_test_lib.h1
-rw-r--r--src/regex/regex_test_random.c4
-rw-r--r--src/regex/test_regex_api.c1
-rw-r--r--src/regex/test_regex_eval_api.c18
-rw-r--r--src/regex/test_regex_integration.c1
-rw-r--r--src/rest/gnunet-rest-server.c6
-rw-r--r--src/rest/plugin_rest_config.c6
-rw-r--r--src/rest/plugin_rest_copying.c2
-rw-r--r--src/rest/rest.c3
-rw-r--r--src/revocation/gnunet-revocation.c1
-rw-r--r--src/revocation/gnunet-service-revocation.c1
-rw-r--r--src/revocation/plugin_block_revocation.c1
-rw-r--r--src/revocation/revocation.h1
-rw-r--r--src/revocation/test_revocation.c1
-rw-r--r--src/rps/gnunet-rps-profiler.c122
-rw-r--r--src/rps/gnunet-rps.c3
-rw-r--r--src/rps/gnunet-service-rps.c36
-rw-r--r--src/rps/gnunet-service-rps_custommap.c10
-rw-r--r--src/rps/gnunet-service-rps_sampler.c1
-rw-r--r--src/rps/gnunet-service-rps_sampler_elem.c2
-rw-r--r--src/rps/gnunet-service-rps_view.c1
-rw-r--r--src/rps/rps-sampler_common.c2
-rw-r--r--src/rps/rps-test_util.c16
-rw-r--r--src/rps/rps.h1
-rw-r--r--src/rps/rps_api.c6
-rw-r--r--src/rps/test_rps.c157
-rw-r--r--src/rps/test_rps_api.c1
-rw-r--r--src/rps/test_service_rps_custommap.c1
-rw-r--r--src/rps/test_service_rps_sampler_elem.c1
-rw-r--r--src/rps/test_service_rps_view.c1
-rw-r--r--src/scalarproduct/gnunet-scalarproduct.c1
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct.h1
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_alice.c1
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_bob.c3
-rw-r--r--src/scalarproduct/test_ecc_scalarproduct.c1
-rw-r--r--src/secretsharing/gnunet-secretsharing-profiler.c7
-rw-r--r--src/secretsharing/gnunet-service-secretsharing.c2
-rw-r--r--src/secretsharing/secretsharing.h1
-rw-r--r--src/secretsharing/secretsharing_api.c1
-rw-r--r--src/set/gnunet-service-set.c3
-rw-r--r--src/set/gnunet-service-set.h1
-rw-r--r--src/set/gnunet-service-set_union.c7
-rw-r--r--src/set/gnunet-service-set_union.h2
-rw-r--r--src/set/gnunet-set-profiler.c2
-rw-r--r--src/set/ibf.c1
-rw-r--r--src/set/ibf_sim.c4
-rw-r--r--src/set/plugin_block_set_test.c1
-rw-r--r--src/set/set_api.c1
-rw-r--r--src/sq/sq_exec.c2
-rw-r--r--src/sq/sq_prepare.c2
-rw-r--r--src/sq/sq_query_helper.c2
-rw-r--r--src/statistics/gnunet-service-statistics.c5
-rw-r--r--src/statistics/gnunet-statistics.c13
-rw-r--r--src/statistics/statistics_api.c4
-rw-r--r--src/statistics/test_statistics_api.c1
-rw-r--r--src/statistics/test_statistics_api_loop.c1
-rw-r--r--src/statistics/test_statistics_api_watch_zero_value.c1
-rw-r--r--src/template/gnunet-template.c1
-rw-r--r--src/template/test_template_api.c2
-rw-r--r--src/testbed-logger/testbed_logger_api.c1
-rw-r--r--src/testbed/gnunet-daemon-latency-logger.c1
-rw-r--r--src/testbed/gnunet-helper-testbed.c1
-rw-r--r--src/testbed/gnunet-service-test-barriers.c1
-rw-r--r--src/testbed/gnunet-service-testbed.c3
-rw-r--r--src/testbed/gnunet-service-testbed.h2
-rw-r--r--src/testbed/gnunet-service-testbed_barriers.c2
-rw-r--r--src/testbed/gnunet-service-testbed_cache.c1
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c7
-rw-r--r--src/testbed/gnunet-service-testbed_meminfo.c7
-rw-r--r--src/testbed/gnunet-service-testbed_oc.c3
-rw-r--r--src/testbed/gnunet-service-testbed_peers.c1
-rw-r--r--src/testbed/test_gnunet_helper_testbed.c1
-rw-r--r--src/testbed/test_testbed_api.c3
-rw-r--r--src/testbed/test_testbed_api_2peers_1controller.c2
-rw-r--r--src/testbed/test_testbed_api_3peers_3controllers.c1
-rw-r--r--src/testbed/test_testbed_api_controllerlink.c2
-rw-r--r--src/testbed/test_testbed_api_hosts.c1
-rw-r--r--src/testbed/test_testbed_api_operations.c1
-rw-r--r--src/testbed/test_testbed_api_sd.c1
-rw-r--r--src/testbed/test_testbed_api_test.c2
-rw-r--r--src/testbed/test_testbed_api_test_timeout.c1
-rw-r--r--src/testbed/test_testbed_api_testbed_run.c1
-rw-r--r--src/testbed/test_testbed_api_topology.c2
-rw-r--r--src/testbed/test_testbed_api_topology_clique.c2
-rw-r--r--src/testbed/test_testbed_underlay.c1
-rw-r--r--src/testbed/testbed_api.c3
-rw-r--r--src/testbed/testbed_api.h4
-rw-r--r--src/testbed/testbed_api_barriers.c2
-rw-r--r--src/testbed/testbed_api_hosts.c1
-rw-r--r--src/testbed/testbed_api_operations.c3
-rw-r--r--src/testbed/testbed_api_peers.c2
-rw-r--r--src/testbed/testbed_api_sd.c1
-rw-r--r--src/testbed/testbed_api_services.c1
-rw-r--r--src/testbed/testbed_api_test.c1
-rw-r--r--src/testbed/testbed_api_testbed.c1
-rw-r--r--src/testbed/testbed_api_topology.c2
-rw-r--r--src/testing/gnunet-testing.c1
-rw-r--r--src/testing/test_testing_peerstartup.c4
-rw-r--r--src/testing/test_testing_peerstartup2.c4
-rw-r--r--src/testing/test_testing_portreservation.c4
-rw-r--r--src/testing/test_testing_servicestartup.c4
-rw-r--r--src/testing/test_testing_sharedservices.c4
-rw-r--r--src/testing/testing.c3
-rw-r--r--src/topology/gnunet-daemon-topology.c8
-rw-r--r--src/topology/test_gnunet_daemon_topology.c8
-rw-r--r--src/transport/gnunet-communicator-tcp.c3
-rw-r--r--src/transport/gnunet-communicator-udp.c3
-rw-r--r--src/transport/gnunet-communicator-unix.c5
-rw-r--r--src/transport/gnunet-helper-transport-bluetooth.c32
-rw-r--r--src/transport/gnunet-helper-transport-wlan.c30
-rw-r--r--src/transport/gnunet-service-tng.c15
-rw-r--r--src/transport/gnunet-service-transport.c4
-rw-r--r--src/transport/gnunet-service-transport.h3
-rw-r--r--src/transport/gnunet-service-transport_ats.c12
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c1
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c7
-rw-r--r--src/transport/gnunet-service-transport_validation.c6
-rw-r--r--src/transport/gnunet-transport-profiler.c1
-rw-r--r--src/transport/gnunet-transport-wlan-sender.c1
-rw-r--r--src/transport/gnunet-transport.c1
-rw-r--r--src/transport/ieee80211_radiotap.h1
-rw-r--r--src/transport/plugin_transport_http_client.c5
-rw-r--r--src/transport/plugin_transport_http_common.c3
-rw-r--r--src/transport/plugin_transport_http_server.c8
-rw-r--r--src/transport/plugin_transport_smtp.c14
-rw-r--r--src/transport/plugin_transport_tcp.c10
-rw-r--r--src/transport/plugin_transport_template.c6
-rw-r--r--src/transport/plugin_transport_udp.c7
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c12
-rw-r--r--src/transport/plugin_transport_unix.c1
-rw-r--r--src/transport/plugin_transport_wlan.c3
-rw-r--r--src/transport/plugin_transport_wlan.h1
-rw-r--r--src/transport/tcp_server_legacy.c1
-rw-r--r--src/transport/tcp_server_mst_legacy.c2
-rw-r--r--src/transport/test_communicator_unix.c1
-rw-r--r--src/transport/test_http_common.c1
-rw-r--r--src/transport/test_plugin_transport.c6
-rw-r--r--src/transport/test_transport_address_switch.c2
-rw-r--r--src/transport/test_transport_api.c1
-rw-r--r--src/transport/test_transport_api_disconnect.c1
-rw-r--r--src/transport/test_transport_api_limited_sockets.c2
-rw-r--r--src/transport/test_transport_api_manipulation_recv_tcp.c1
-rw-r--r--src/transport/test_transport_api_manipulation_send_tcp.c1
-rw-r--r--src/transport/test_transport_api_monitor_peers.c1
-rw-r--r--src/transport/test_transport_api_restart_reconnect.c1
-rw-r--r--src/transport/test_transport_api_timeout.c1
-rw-r--r--src/transport/test_transport_blacklisting.c4
-rw-r--r--src/transport/test_transport_testing_restart.c1
-rw-r--r--src/transport/test_transport_testing_startstop.c1
-rw-r--r--src/transport/transport-testing-loggers.c2
-rw-r--r--src/transport/transport-testing-main.c1
-rw-r--r--src/transport/transport-testing-send.c1
-rw-r--r--src/transport/transport-testing.c1
-rw-r--r--src/transport/transport_api2_monitor.c1
-rw-r--r--src/transport/transport_api_blacklist.c1
-rw-r--r--src/transport/transport_api_monitor_peers.c1
-rw-r--r--src/transport/transport_api_monitor_plugins.c1
-rw-r--r--src/util/client.c2
-rw-r--r--src/util/common_allocation.c2
-rw-r--r--src/util/common_logging.c16
-rw-r--r--src/util/configuration_loader.c1
-rw-r--r--src/util/container_bloomfilter.c10
-rw-r--r--src/util/container_meta_data.c1
-rw-r--r--src/util/crypto_abe.c14
-rw-r--r--src/util/crypto_crc.c1
-rw-r--r--src/util/crypto_ecc.c6
-rw-r--r--src/util/crypto_ecc_setup.c1
-rw-r--r--src/util/crypto_hash_file.c1
-rw-r--r--src/util/crypto_hkdf.c5
-rw-r--r--src/util/crypto_kdf.c5
-rw-r--r--src/util/crypto_mpi.c1
-rw-r--r--src/util/crypto_paillier.c4
-rw-r--r--src/util/crypto_random.c8
-rw-r--r--src/util/crypto_rsa.c3
-rw-r--r--src/util/crypto_symmetric.c1
-rw-r--r--src/util/disk.c10
-rw-r--r--src/util/getopt.c28
-rw-r--r--src/util/gnunet-config.c1
-rw-r--r--src/util/gnunet-ecc.c4
-rw-r--r--src/util/gnunet-resolver.c1
-rw-r--r--src/util/gnunet-scrypt.c1
-rw-r--r--src/util/gnunet-service-resolver.c7
-rw-r--r--src/util/gnunet-timeout.c1
-rw-r--r--src/util/gnunet-uri.c1
-rw-r--r--src/util/helper.c1
-rw-r--r--src/util/load.c4
-rw-r--r--src/util/mst.c1
-rw-r--r--src/util/nc.c1
-rw-r--r--src/util/network.c3
-rw-r--r--src/util/os_installation.c4
-rw-r--r--src/util/os_network.c4
-rw-r--r--src/util/os_priority.c1
-rw-r--r--src/util/peer.c1
-rw-r--r--src/util/perf_crypto_asymmetric.c1
-rw-r--r--src/util/perf_crypto_ecc_dlog.c1
-rw-r--r--src/util/perf_crypto_hash.c1
-rw-r--r--src/util/perf_crypto_paillier.c1
-rw-r--r--src/util/perf_crypto_rsa.c3
-rw-r--r--src/util/perf_crypto_symmetric.c1
-rw-r--r--src/util/perf_malloc.c1
-rw-r--r--src/util/program.c3
-rw-r--r--src/util/scheduler.c9
-rw-r--r--src/util/signal.c1
-rw-r--r--src/util/socks.c6
-rw-r--r--src/util/speedup.c1
-rw-r--r--src/util/strings.c11
-rw-r--r--src/util/test_bio.c14
-rw-r--r--src/util/test_client.c1
-rw-r--r--src/util/test_common_allocation.c1
-rw-r--r--src/util/test_common_endian.c1
-rw-r--r--src/util/test_common_logging.c2
-rw-r--r--src/util/test_common_logging_dummy.c3
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c11
-rw-r--r--src/util/test_configuration.c5
-rw-r--r--src/util/test_container_bloomfilter.c2
-rw-r--r--src/util/test_container_dll.c1
-rw-r--r--src/util/test_container_heap.c3
-rw-r--r--src/util/test_container_multihashmap.c2
-rw-r--r--src/util/test_container_multihashmap32.c2
-rw-r--r--src/util/test_container_multipeermap.c2
-rw-r--r--src/util/test_crypto_ecc_dlog.c2
-rw-r--r--src/util/test_crypto_ecdhe.c1
-rw-r--r--src/util/test_crypto_ecdsa.c3
-rw-r--r--src/util/test_crypto_eddsa.c3
-rw-r--r--src/util/test_crypto_hash.c4
-rw-r--r--src/util/test_crypto_hash_context.c3
-rw-r--r--src/util/test_crypto_hkdf.c8
-rw-r--r--src/util/test_crypto_paillier.c1
-rw-r--r--src/util/test_crypto_random.c1
-rw-r--r--src/util/test_crypto_symmetric.c1
-rw-r--r--src/util/test_disk.c1
-rw-r--r--src/util/test_os_network.c1
-rw-r--r--src/util/test_os_start_process.c1
-rw-r--r--src/util/test_peer.c4
-rw-r--r--src/util/test_plugin.c1
-rw-r--r--src/util/test_plugin_plug.c2
-rw-r--r--src/util/test_program.c1
-rw-r--r--src/util/test_scheduler.c1
-rw-r--r--src/util/test_scheduler_delay.c1
-rw-r--r--src/util/test_service.c1
-rw-r--r--src/util/test_socks.c1
-rw-r--r--src/util/test_speedup.c1
-rw-r--r--src/util/test_tun.c6
-rw-r--r--src/util/time.c6
-rw-r--r--src/vpn/gnunet-service-vpn.c6
-rw-r--r--src/vpn/vpn_api.c1
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c3
605 files changed, 1921 insertions, 1049 deletions
diff --git a/contrib/uncrustify.cfg b/contrib/uncrustify.cfg
index f56c8e732..8c9df2c43 100644
--- a/contrib/uncrustify.cfg
+++ b/contrib/uncrustify.cfg
@@ -49,8 +49,12 @@ nl_assign_brace=remove
49 49
50# No extra newlines that cause noisy diffs 50# No extra newlines that cause noisy diffs
51nl_start_of_file=remove 51nl_start_of_file=remove
52nl_after_func_proto = 2
53nl_after_func_body = 3
52# If there's no new line, it's not a text file! 54# If there's no new line, it's not a text file!
53nl_end_of_file=add 55nl_end_of_file=add
56nl_max_blank_in_func = 3
57nl_max = 3
54 58
55sp_inside_paren = remove 59sp_inside_paren = remove
56 60
@@ -69,6 +73,7 @@ sp_between_ptr_star = remove
69sp_before_sparen = add 73sp_before_sparen = add
70 74
71sp_inside_fparen = remove 75sp_inside_fparen = remove
76sp_inside_sparen = remove
72 77
73# add space before function call and decl: "foo (x)" 78# add space before function call and decl: "foo (x)"
74sp_func_call_paren = add 79sp_func_call_paren = add
@@ -76,3 +81,15 @@ sp_func_proto_paren = add
76sp_func_proto_paren_empty = add 81sp_func_proto_paren_empty = add
77sp_func_def_paren = add 82sp_func_def_paren = add
78sp_func_def_paren_empty = add 83sp_func_def_paren_empty = add
84
85# We'd want it for "if ( (foo) || (bar) )", but not for "if (m())",
86# so as uncrustify doesn't give exactly what we want => ignore
87sp_paren_paren = ignore
88sp_inside_paren = remove
89sp_bool = force
90
91nl_func_type_name = force
92#nl_branch_else = add
93nl_else_brace = add
94nl_elseif_brace = add
95nl_for_brace = add
diff --git a/src/abd/abd.h b/src/abd/abd.h
index 854814832..1e9d6bcea 100644
--- a/src/abd/abd.h
+++ b/src/abd/abd.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
diff --git a/src/abd/abd_api.c b/src/abd/abd_api.c
index cdc52df91..cc25d06da 100644
--- a/src/abd/abd_api.c
+++ b/src/abd/abd_api.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -192,6 +192,7 @@ mq_error_handler (void *cls, enum GNUNET_MQ_Error error)
192 force_reconnect (handle); 192 force_reconnect (handle);
193} 193}
194 194
195
195/** 196/**
196 * Check validity of message received from the ABD service 197 * Check validity of message received from the ABD service
197 * 198 *
@@ -201,7 +202,7 @@ mq_error_handler (void *cls, enum GNUNET_MQ_Error error)
201static int 202static int
202check_result (void *cls, const struct DelegationChainResultMessage *vr_msg) 203check_result (void *cls, const struct DelegationChainResultMessage *vr_msg)
203{ 204{
204 //TODO 205 // TODO
205 return GNUNET_OK; 206 return GNUNET_OK;
206} 207}
207 208
@@ -241,11 +242,11 @@ handle_result (void *cls, const struct DelegationChainResultMessage *vr_msg)
241 GNUNET_assert ( 242 GNUNET_assert (
242 GNUNET_OK == 243 GNUNET_OK ==
243 GNUNET_ABD_delegation_chain_deserialize (mlen, 244 GNUNET_ABD_delegation_chain_deserialize (mlen,
244 (const char *) &vr_msg[1], 245 (const char *) &vr_msg[1],
245 d_count, 246 d_count,
246 d_chain, 247 d_chain,
247 c_count, 248 c_count,
248 dels)); 249 dels));
249 if (GNUNET_NO == ntohl (vr_msg->del_found)) 250 if (GNUNET_NO == ntohl (vr_msg->del_found))
250 { 251 {
251 proc (proc_cls, 0, NULL, 0, 252 proc (proc_cls, 0, NULL, 0,
@@ -257,51 +258,55 @@ handle_result (void *cls, const struct DelegationChainResultMessage *vr_msg)
257 } 258 }
258} 259}
259 260
261
260static int 262static int
261check_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg) 263check_intermediate (void *cls, const struct
264 DelegationChainIntermediateMessage *vr_msg)
262{ 265{
263 //TODO 266 // TODO
264 return GNUNET_OK; 267 return GNUNET_OK;
265} 268}
266 269
270
267static void 271static void
268handle_intermediate (void *cls, const struct DelegationChainIntermediateMessage *vr_msg) 272handle_intermediate (void *cls, const struct
273 DelegationChainIntermediateMessage *vr_msg)
269{ 274{
270 struct GNUNET_ABD_Handle *handle = cls; 275 struct GNUNET_ABD_Handle *handle = cls;
271 uint32_t r_id = ntohl (vr_msg->id); 276 uint32_t r_id = ntohl (vr_msg->id);
272 uint32_t size = ntohl (vr_msg->size); 277 uint32_t size = ntohl (vr_msg->size);
273 bool is_bw = ntohs(vr_msg->is_bw); 278 bool is_bw = ntohs (vr_msg->is_bw);
274 struct GNUNET_ABD_Request *vr; 279 struct GNUNET_ABD_Request *vr;
275 GNUNET_ABD_IntermediateResultProcessor proc; 280 GNUNET_ABD_IntermediateResultProcessor proc;
276 void *proc_cls; 281 void *proc_cls;
277 struct GNUNET_ABD_Delegation *dd; 282 struct GNUNET_ABD_Delegation *dd;
278 283
279 284
280 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received intermediate reply from ABD service\n"); 285 LOG (GNUNET_ERROR_TYPE_DEBUG,
286 "Received intermediate reply from ABD service\n");
281 287
282 for (vr = handle->request_head; NULL != vr; vr = vr->next) 288 for (vr = handle->request_head; NULL != vr; vr = vr->next)
283 if (vr->r_id == r_id) 289 if (vr->r_id == r_id)
284 break; 290 break;
285 if (NULL == vr) 291 if (NULL == vr)
286 return; 292 return;
287 293
288 proc = vr->int_proc; 294 proc = vr->int_proc;
289 proc_cls = vr->proc2_cls; 295 proc_cls = vr->proc2_cls;
290 296
291 dd = GNUNET_new (struct GNUNET_ABD_Delegation); 297 dd = GNUNET_new (struct GNUNET_ABD_Delegation);
292 GNUNET_assert ( 298 GNUNET_assert (
293 GNUNET_OK == 299 GNUNET_OK ==
294 GNUNET_ABD_delegation_chain_deserialize (size, 300 GNUNET_ABD_delegation_chain_deserialize (size,
295 (const char *) &vr_msg[1], 301 (const char *) &vr_msg[1],
296 1, 302 1,
297 dd, 303 dd,
298 0, 304 0,
299 NULL)); 305 NULL));
300 proc (proc_cls, dd, is_bw); 306 proc (proc_cls, dd, is_bw);
301} 307}
302 308
303 309
304
305/** 310/**
306 * Reconnect to ABD service. 311 * Reconnect to ABD service.
307 * 312 *
@@ -311,19 +316,19 @@ static void
311reconnect (struct GNUNET_ABD_Handle *handle) 316reconnect (struct GNUNET_ABD_Handle *handle)
312{ 317{
313 struct GNUNET_MQ_MessageHandler handlers[] = 318 struct GNUNET_MQ_MessageHandler handlers[] =
314 {GNUNET_MQ_hd_var_size (result, 319 {GNUNET_MQ_hd_var_size (result,
315 GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT, 320 GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT,
316 struct DelegationChainResultMessage, 321 struct DelegationChainResultMessage,
317 handle), 322 handle),
318 GNUNET_MQ_hd_var_size (result, 323 GNUNET_MQ_hd_var_size (result,
319 GNUNET_MESSAGE_TYPE_ABD_COLLECT_RESULT, 324 GNUNET_MESSAGE_TYPE_ABD_COLLECT_RESULT,
320 struct DelegationChainResultMessage, 325 struct DelegationChainResultMessage,
321 handle), 326 handle),
322 GNUNET_MQ_hd_var_size (intermediate, 327 GNUNET_MQ_hd_var_size (intermediate,
323 GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT, 328 GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT,
324 struct DelegationChainIntermediateMessage, 329 struct DelegationChainIntermediateMessage,
325 handle), 330 handle),
326 GNUNET_MQ_handler_end ()}; 331 GNUNET_MQ_handler_end ()};
327 struct GNUNET_ABD_Request *vr; 332 struct GNUNET_ABD_Request *vr;
328 333
329 GNUNET_assert (NULL == handle->mq); 334 GNUNET_assert (NULL == handle->mq);
@@ -404,7 +409,7 @@ GNUNET_ABD_request_cancel (struct GNUNET_ABD_Request *lr)
404 409
405/** 410/**
406 * Performs attribute collection. 411 * Performs attribute collection.
407 * Collects all abds of subject to fulfill the 412 * Collects all abds of subject to fulfill the
408 * attribute, if possible 413 * attribute, if possible
409 * 414 *
410 * @param handle handle to the Credential service 415 * @param handle handle to the Credential service
@@ -438,7 +443,7 @@ GNUNET_ABD_collect (
438 return NULL; 443 return NULL;
439 } 444 }
440 445
441 //DEBUG LOG 446 // DEBUG LOG
442 LOG (GNUNET_ERROR_TYPE_DEBUG, 447 LOG (GNUNET_ERROR_TYPE_DEBUG,
443 "Trying to collect `%s' in ABD\n", 448 "Trying to collect `%s' in ABD\n",
444 issuer_attribute); 449 issuer_attribute);
@@ -469,6 +474,8 @@ GNUNET_ABD_collect (
469 GNUNET_MQ_send_copy (handle->mq, vr->env); 474 GNUNET_MQ_send_copy (handle->mq, vr->env);
470 return vr; 475 return vr;
471} 476}
477
478
472/** 479/**
473 * Performs attribute verification. 480 * Performs attribute verification.
474 * Checks if there is a delegation chain from 481 * Checks if there is a delegation chain from
@@ -507,7 +514,7 @@ GNUNET_ABD_verify (
507 size_t nlen; 514 size_t nlen;
508 size_t clen; 515 size_t clen;
509 516
510 if (NULL == issuer_attribute || NULL == delegates) 517 if ((NULL == issuer_attribute) || (NULL == delegates))
511 { 518 {
512 GNUNET_break (0); 519 GNUNET_break (0);
513 return NULL; 520 return NULL;
@@ -515,7 +522,7 @@ GNUNET_ABD_verify (
515 522
516 clen = GNUNET_ABD_delegates_get_size (delegate_count, delegates); 523 clen = GNUNET_ABD_delegates_get_size (delegate_count, delegates);
517 524
518 //DEBUG LOG 525 // DEBUG LOG
519 LOG (GNUNET_ERROR_TYPE_DEBUG, 526 LOG (GNUNET_ERROR_TYPE_DEBUG,
520 "Trying to verify `%s' in ABD\n", 527 "Trying to verify `%s' in ABD\n",
521 issuer_attribute); 528 issuer_attribute);
@@ -543,14 +550,15 @@ GNUNET_ABD_verify (
543 550
544 GNUNET_memcpy (&v_msg[1], issuer_attribute, strlen (issuer_attribute)); 551 GNUNET_memcpy (&v_msg[1], issuer_attribute, strlen (issuer_attribute));
545 GNUNET_ABD_delegates_serialize (delegate_count, 552 GNUNET_ABD_delegates_serialize (delegate_count,
546 delegates, 553 delegates,
547 clen, 554 clen,
548 ((char *) &v_msg[1]) + 555 ((char *) &v_msg[1])
549 strlen (issuer_attribute) + 1); 556 + strlen (issuer_attribute) + 1);
550 GNUNET_CONTAINER_DLL_insert (handle->request_head, handle->request_tail, vr); 557 GNUNET_CONTAINER_DLL_insert (handle->request_head, handle->request_tail, vr);
551 if (NULL != handle->mq) 558 if (NULL != handle->mq)
552 GNUNET_MQ_send_copy (handle->mq, vr->env); 559 GNUNET_MQ_send_copy (handle->mq, vr->env);
553 return vr; 560 return vr;
554} 561}
555 562
563
556/* end of abd_api.c */ 564/* end of abd_api.c */
diff --git a/src/abd/abd_serialization.c b/src/abd/abd_serialization.c
index d2bc15166..90a89886b 100644
--- a/src/abd/abd_serialization.c
+++ b/src/abd/abd_serialization.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -21,7 +21,7 @@
21 21
22/** 22/**
23 * @file abd/abd_serialization.c 23 * @file abd/abd_serialization.c
24 * @brief API to serialize and deserialize delegation chains 24 * @brief API to serialize and deserialize delegation chains
25 * and abds 25 * and abds
26 * @author Martin Schanzenbach 26 * @author Martin Schanzenbach
27 */ 27 */
@@ -58,6 +58,7 @@ GNUNET_ABD_delegation_set_get_size (
58 return ret; 58 return ret;
59} 59}
60 60
61
61/** 62/**
62 * Serizalize the given delegation chain entries and abd 63 * Serizalize the given delegation chain entries and abd
63 * 64 *
@@ -158,12 +159,15 @@ GNUNET_ABD_delegates_get_size (
158 159
159 for (i = 0; i < c_count; i++) 160 for (i = 0; i < c_count; i++)
160 { 161 {
161 GNUNET_assert ((ret + cd[i].issuer_attribute_len + cd[i].subject_attribute_len) >= ret); 162 GNUNET_assert ((ret + cd[i].issuer_attribute_len
163 + cd[i].subject_attribute_len) >= ret);
162 // subject_attribute_len should be 0 164 // subject_attribute_len should be 0
163 ret += cd[i].issuer_attribute_len + cd[i].subject_attribute_len; 165 ret += cd[i].issuer_attribute_len + cd[i].subject_attribute_len;
164 } 166 }
165 return ret; 167 return ret;
166} 168}
169
170
167/** 171/**
168 * Serizalize the given abds 172 * Serizalize the given abds
169 * 173 *
@@ -187,15 +191,15 @@ GNUNET_ABD_delegates_serialize (
187 off = 0; 191 off = 0;
188 for (i = 0; i < c_count; i++) 192 for (i = 0; i < c_count; i++)
189 { 193 {
190 //c_rec.subject_attribute_len = htonl ((uint32_t) cd[i].subject_attribute_len); 194 // c_rec.subject_attribute_len = htonl ((uint32_t) cd[i].subject_attribute_len);
191 c_rec.issuer_attribute_len = htonl ((uint32_t) cd[i].issuer_attribute_len); 195 c_rec.issuer_attribute_len = htonl ((uint32_t) cd[i].issuer_attribute_len);
192 c_rec.issuer_key = cd[i].issuer_key; 196 c_rec.issuer_key = cd[i].issuer_key;
193 c_rec.subject_key = cd[i].subject_key; 197 c_rec.subject_key = cd[i].subject_key;
194 c_rec.signature = cd[i].signature; 198 c_rec.signature = cd[i].signature;
195 c_rec.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE); 199 c_rec.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE);
196 c_rec.purpose.size = 200 c_rec.purpose.size =
197 htonl ((sizeof (struct DelegateEntry) + cd[i].issuer_attribute_len) - 201 htonl ((sizeof (struct DelegateEntry) + cd[i].issuer_attribute_len)
198 sizeof (struct GNUNET_CRYPTO_EcdsaSignature)); 202 - sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
199 c_rec.expiration = GNUNET_htonll (cd[i].expiration.abs_value_us); 203 c_rec.expiration = GNUNET_htonll (cd[i].expiration.abs_value_us);
200 if (off + sizeof (c_rec) > dest_size) 204 if (off + sizeof (c_rec) > dest_size)
201 return -1; 205 return -1;
@@ -224,9 +228,9 @@ GNUNET_ABD_delegates_serialize (
224 */ 228 */
225int 229int
226GNUNET_ABD_delegates_deserialize (size_t len, 230GNUNET_ABD_delegates_deserialize (size_t len,
227 const char *src, 231 const char *src,
228 unsigned int c_count, 232 unsigned int c_count,
229 struct GNUNET_ABD_Delegate *cd) 233 struct GNUNET_ABD_Delegate *cd)
230{ 234{
231 struct DelegateEntry c_rec; 235 struct DelegateEntry c_rec;
232 unsigned int i; 236 unsigned int i;
@@ -285,6 +289,7 @@ GNUNET_ABD_delegation_chain_get_size (
285 return ret + GNUNET_ABD_delegates_get_size (c_count, cd); 289 return ret + GNUNET_ABD_delegates_get_size (c_count, cd);
286} 290}
287 291
292
288/** 293/**
289 * Serizalize the given delegation chain entries and abd 294 * Serizalize the given delegation chain entries and abd
290 * 295 *
@@ -336,9 +341,9 @@ GNUNET_ABD_delegation_chain_serialize (
336 off += dd[i].subject_attribute_len; 341 off += dd[i].subject_attribute_len;
337 } 342 }
338 return off + GNUNET_ABD_delegates_serialize (c_count, 343 return off + GNUNET_ABD_delegates_serialize (c_count,
339 cd, 344 cd,
340 dest_size - off, 345 dest_size - off,
341 &dest[off]); 346 &dest[off]);
342} 347}
343 348
344 349
@@ -387,14 +392,15 @@ GNUNET_ABD_delegation_chain_deserialize (
387 off += dd[i].subject_attribute_len; 392 off += dd[i].subject_attribute_len;
388 } 393 }
389 return GNUNET_ABD_delegates_deserialize (len - off, 394 return GNUNET_ABD_delegates_deserialize (len - off,
390 &src[off], 395 &src[off],
391 c_count, 396 c_count,
392 cd); 397 cd);
393} 398}
394 399
400
395int 401int
396GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *dele, 402GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *dele,
397 char **data) 403 char **data)
398{ 404{
399 size_t size; 405 size_t size;
400 struct DelegateEntry *cdata; 406 struct DelegateEntry *cdata;
@@ -455,6 +461,7 @@ GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *dele,
455 return size; 461 return size;
456} 462}
457 463
464
458struct GNUNET_ABD_Delegate * 465struct GNUNET_ABD_Delegate *
459GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size) 466GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size)
460{ 467{
@@ -505,4 +512,5 @@ GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size)
505 return dele; 512 return dele;
506} 513}
507 514
515
508/* end of abd_serialization.c */ 516/* end of abd_serialization.c */
diff --git a/src/abd/abd_serialization.h b/src/abd/abd_serialization.h
index cef9f42ef..21dc45a7b 100644
--- a/src/abd/abd_serialization.h
+++ b/src/abd/abd_serialization.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -21,7 +21,7 @@
21 21
22/** 22/**
23 * @file abd/abd_serialization.h 23 * @file abd/abd_serialization.h
24 * @brief API to serialize and deserialize delegation chains 24 * @brief API to serialize and deserialize delegation chains
25 * and abds 25 * and abds
26 * @author Martin Schanzenbach 26 * @author Martin Schanzenbach
27 */ 27 */
@@ -136,6 +136,7 @@ GNUNET_ABD_delegation_chain_deserialize (
136 struct GNUNET_ABD_Delegation *dd, 136 struct GNUNET_ABD_Delegation *dd,
137 unsigned int c_count, 137 unsigned int c_count,
138 struct GNUNET_ABD_Delegate *cd); 138 struct GNUNET_ABD_Delegate *cd);
139
139size_t 140size_t
140GNUNET_ABD_delegates_get_size ( 141GNUNET_ABD_delegates_get_size (
141 unsigned int c_count, 142 unsigned int c_count,
@@ -151,15 +152,16 @@ GNUNET_ABD_delegates_serialize (
151 152
152int 153int
153GNUNET_ABD_delegates_deserialize (size_t len, 154GNUNET_ABD_delegates_deserialize (size_t len,
154 const char *src, 155 const char *src,
155 unsigned int c_count, 156 unsigned int c_count,
156 struct GNUNET_ABD_Delegate *cd); 157 struct GNUNET_ABD_Delegate *cd);
157 158
158int 159int
159GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *cred, 160GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate *cred,
160 char **data); 161 char **data);
161 162
162struct GNUNET_ABD_Delegate * 163struct GNUNET_ABD_Delegate *
163GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size); 164GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size);
165
164#endif 166#endif
165/* end of abd_serialization.h */ 167/* end of abd_serialization.h */
diff --git a/src/abd/delegate_misc.c b/src/abd/delegate_misc.c
index fb5834274..df34cff8b 100644
--- a/src/abd/delegate_misc.c
+++ b/src/abd/delegate_misc.c
@@ -75,6 +75,7 @@ GNUNET_ABD_delegate_to_string (
75 return cred_str; 75 return cred_str;
76} 76}
77 77
78
78struct GNUNET_ABD_Delegate * 79struct GNUNET_ABD_Delegate *
79GNUNET_ABD_delegate_from_string (const char *s) 80GNUNET_ABD_delegate_from_string (const char *s)
80{ 81{
@@ -174,6 +175,7 @@ GNUNET_ABD_delegate_from_string (const char *s)
174 return dele; 175 return dele;
175} 176}
176 177
178
177/** 179/**
178 * Issue an attribute to a subject 180 * Issue an attribute to a subject
179 * 181 *
diff --git a/src/abd/delegate_misc.h b/src/abd/delegate_misc.h
index 42a95ce99..0a4ddd9eb 100644
--- a/src/abd/delegate_misc.h
+++ b/src/abd/delegate_misc.h
@@ -28,7 +28,7 @@
28 28
29char * 29char *
30GNUNET_ABD_delegate_to_string ( 30GNUNET_ABD_delegate_to_string (
31 const struct GNUNET_ABD_Delegate *cred); 31 const struct GNUNET_ABD_Delegate *cred);
32 32
33struct GNUNET_ABD_Delegate * 33struct GNUNET_ABD_Delegate *
34GNUNET_ABD_delegate_from_string (const char *str); 34GNUNET_ABD_delegate_from_string (const char *str);
diff --git a/src/abd/gnunet-abd.c b/src/abd/gnunet-abd.c
index 23083ec68..a5d32c3dd 100644
--- a/src/abd/gnunet-abd.c
+++ b/src/abd/gnunet-abd.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -268,25 +268,27 @@ do_timeout (void *cls)
268 GNUNET_SCHEDULER_shutdown (); 268 GNUNET_SCHEDULER_shutdown ();
269} 269}
270 270
271
271static void 272static void
272handle_intermediate_result(void *cls, 273handle_intermediate_result (void *cls,
273 struct GNUNET_ABD_Delegation *dd, 274 struct GNUNET_ABD_Delegation *dd,
274 bool is_bw) 275 bool is_bw)
275{ 276{
276 char *prefix = ""; 277 char *prefix = "";
277 if(is_bw) 278 if (is_bw)
278 prefix = "Backward -"; 279 prefix = "Backward -";
279 else 280 else
280 prefix = "Forward -"; 281 prefix = "Forward -";
281 282
282 printf ("%s Intermediate result: %s.%s <- %s.%s\n", 283 printf ("%s Intermediate result: %s.%s <- %s.%s\n",
283 prefix, 284 prefix,
284 GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->issuer_key), 285 GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->issuer_key),
285 dd->issuer_attribute, 286 dd->issuer_attribute,
286 GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->subject_key), 287 GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->subject_key),
287 dd->subject_attribute); 288 dd->subject_attribute);
288} 289}
289 290
291
290static void 292static void
291handle_collect_result (void *cls, 293handle_collect_result (void *cls,
292 unsigned int d_count, 294 unsigned int d_count,
@@ -373,6 +375,7 @@ handle_verify_result (void *cls,
373 GNUNET_SCHEDULER_shutdown (); 375 GNUNET_SCHEDULER_shutdown ();
374} 376}
375 377
378
376/** 379/**
377 * Callback invoked from identity service with ego information. 380 * Callback invoked from identity service with ego information.
378 * An @a ego of NULL means the ego was not found. 381 * An @a ego of NULL means the ego was not found.
@@ -414,19 +417,20 @@ identity_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
414 privkey = GNUNET_IDENTITY_ego_get_private_key (ego); 417 privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
415 418
416 collect_request = GNUNET_ABD_collect (abd, 419 collect_request = GNUNET_ABD_collect (abd,
417 &issuer_pkey, 420 &issuer_pkey,
418 issuer_attr, 421 issuer_attr,
419 privkey, 422 privkey,
420 direction, 423 direction,
421 &handle_collect_result, 424 &handle_collect_result,
422 NULL, 425 NULL,
423 &handle_intermediate_result, 426 &handle_intermediate_result,
424 NULL); 427 NULL);
425 return; 428 return;
426 } 429 }
427 GNUNET_SCHEDULER_shutdown (); 430 GNUNET_SCHEDULER_shutdown ();
428} 431}
429 432
433
430/** 434/**
431 * Parse expiration time. 435 * Parse expiration time.
432 * 436 *
@@ -473,6 +477,7 @@ parse_expiration (const char *expirationstring,
473 return GNUNET_SYSERR; 477 return GNUNET_SYSERR;
474} 478}
475 479
480
476/** 481/**
477 * Function called if lookup fails. 482 * Function called if lookup fails.
478 */ 483 */
@@ -483,13 +488,15 @@ error_cb (void *cls)
483 GNUNET_SCHEDULER_shutdown (); 488 GNUNET_SCHEDULER_shutdown ();
484 return; 489 return;
485} 490}
491
492
486static void 493static void
487add_continuation (void *cls, int32_t success, const char *emsg) 494add_continuation (void *cls, int32_t success, const char *emsg)
488{ 495{
489 struct GNUNET_NAMESTORE_QueueEntry **qe = cls; 496 struct GNUNET_NAMESTORE_QueueEntry **qe = cls;
490 *qe = NULL; 497 *qe = NULL;
491 498
492 if(GNUNET_OK == success) 499 if (GNUNET_OK == success)
493 printf ("Adding successful.\n"); 500 printf ("Adding successful.\n");
494 else 501 else
495 fprintf (stderr, "Error occured during adding, shutting down.\n"); 502 fprintf (stderr, "Error occured during adding, shutting down.\n");
@@ -497,6 +504,7 @@ add_continuation (void *cls, int32_t success, const char *emsg)
497 GNUNET_SCHEDULER_shutdown (); 504 GNUNET_SCHEDULER_shutdown ();
498} 505}
499 506
507
500static void 508static void
501get_existing_record (void *cls, 509get_existing_record (void *cls,
502 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 510 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
@@ -535,6 +543,7 @@ get_existing_record (void *cls,
535 return; 543 return;
536} 544}
537 545
546
538static void 547static void
539store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) 548store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
540{ 549{
@@ -627,6 +636,7 @@ store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
627 return; 636 return;
628} 637}
629 638
639
630static void 640static void
631sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) 641sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
632{ 642{
@@ -695,10 +705,10 @@ sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
695 705
696 // Sign delegate 706 // Sign delegate
697 dele = GNUNET_ABD_delegate_issue (privkey, 707 dele = GNUNET_ABD_delegate_issue (privkey,
698 &subject_pkey, 708 &subject_pkey,
699 issuer_attr, 709 issuer_attr,
700 subject_attr, 710 subject_attr,
701 &etime_abs); 711 &etime_abs);
702 res = GNUNET_ABD_delegate_to_string (dele); 712 res = GNUNET_ABD_delegate_to_string (dele);
703 GNUNET_free (dele); 713 GNUNET_free (dele);
704 printf ("%s\n", res); 714 printf ("%s\n", res);
@@ -709,6 +719,7 @@ sign_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
709 GNUNET_SCHEDULER_shutdown (); 719 GNUNET_SCHEDULER_shutdown ();
710} 720}
711 721
722
712/** 723/**
713 * Main function that will be run. 724 * Main function that will be run.
714 * 725 *
@@ -796,7 +807,7 @@ run (void *cls,
796 return; 807 return;
797 } 808 }
798 809
799 if (GNUNET_NO == forward && GNUNET_NO == backward) 810 if ((GNUNET_NO == forward) && (GNUNET_NO == backward))
800 { 811 {
801 // set default: bidirectional 812 // set default: bidirectional
802 forward = GNUNET_YES; 813 forward = GNUNET_YES;
@@ -885,14 +896,14 @@ run (void *cls,
885 GNUNET_SCHEDULER_shutdown (); 896 GNUNET_SCHEDULER_shutdown ();
886 return; 897 return;
887 } 898 }
888 if (NULL == issuer_attr || NULL == subject_delegate) 899 if ((NULL == issuer_attr) || (NULL == subject_delegate))
889 { 900 {
890 fprintf (stderr, _ ("You must provide issuer and subject attributes\n")); 901 fprintf (stderr, _ ("You must provide issuer and subject attributes\n"));
891 GNUNET_SCHEDULER_shutdown (); 902 GNUNET_SCHEDULER_shutdown ();
892 return; 903 return;
893 } 904 }
894 905
895 //Subject credentials are comma separated 906 // Subject credentials are comma separated
896 char *tmp = GNUNET_strdup (subject_delegate); 907 char *tmp = GNUNET_strdup (subject_delegate);
897 char *tok = strtok (tmp, ","); 908 char *tok = strtok (tmp, ",");
898 if (NULL == tok) 909 if (NULL == tok)
@@ -923,16 +934,16 @@ run (void *cls,
923 } 934 }
924 935
925 verify_request = GNUNET_ABD_verify (abd, 936 verify_request = GNUNET_ABD_verify (abd,
926 &issuer_pkey, 937 &issuer_pkey,
927 issuer_attr, 938 issuer_attr,
928 &subject_pkey, 939 &subject_pkey,
929 count, 940 count,
930 delegates, 941 delegates,
931 direction, 942 direction,
932 &handle_verify_result, 943 &handle_verify_result,
933 NULL, 944 NULL,
934 &handle_intermediate_result, 945 &handle_intermediate_result,
935 NULL); 946 NULL);
936 for (i = 0; i < count; i++) 947 for (i = 0; i < count; i++)
937 { 948 {
938 GNUNET_free ((char *) delegates[i].issuer_attribute); 949 GNUNET_free ((char *) delegates[i].issuer_attribute);
@@ -961,93 +972,93 @@ int
961main (int argc, char *const *argv) 972main (int argc, char *const *argv)
962{ 973{
963 struct GNUNET_GETOPT_CommandLineOption options[] = 974 struct GNUNET_GETOPT_CommandLineOption options[] =
964 {GNUNET_GETOPT_option_flag ('V', 975 {GNUNET_GETOPT_option_flag ('V',
965 "verify", 976 "verify",
977 gettext_noop (
978 "verify credential against attribute"),
979 &verify),
980 GNUNET_GETOPT_option_string (
981 's',
982 "subject",
983 "PKEY",
984 gettext_noop (
985 "The public key of the subject to lookup the"
986 "credential for, or for issuer side storage: subject and its attributes"),
987 &subject),
988 GNUNET_GETOPT_option_string (
989 'd',
990 "delegate",
991 "DELE",
992 gettext_noop ("The private, signed delegate presented by the subject"),
993 &subject_delegate),
994 GNUNET_GETOPT_option_string (
995 'i',
996 "issuer",
997 "PKEY",
998 gettext_noop (
999 "The public key of the authority to verify the credential against"),
1000 &issuer_key),
1001 GNUNET_GETOPT_option_string ('e',
1002 "ego",
1003 "EGO",
1004 gettext_noop ("The ego/zone name to use"),
1005 &ego_name),
1006 GNUNET_GETOPT_option_string (
1007 'a',
1008 "attribute",
1009 "ATTR",
1010 gettext_noop ("The issuer attribute to verify against or to issue"),
1011 &issuer_attr),
1012 GNUNET_GETOPT_option_string ('T',
1013 "ttl",
1014 "EXP",
966 gettext_noop ( 1015 gettext_noop (
967 "verify credential against attribute"), 1016 "The time to live for the credential."
968 &verify), 1017 "e.g. 5m, 6h, \"1990-12-30 12:00:00\""),
969 GNUNET_GETOPT_option_string ( 1018 &expiration),
970 's', 1019 GNUNET_GETOPT_option_flag ('g',
971 "subject", 1020 "collect",
972 "PKEY", 1021 gettext_noop ("collect credentials"),
973 gettext_noop ( 1022 &collect),
974 "The public key of the subject to lookup the" 1023 GNUNET_GETOPT_option_flag ('U',
975 "credential for, or for issuer side storage: subject and its attributes"), 1024 "createIssuerSide",
976 &subject), 1025 gettext_noop (
977 GNUNET_GETOPT_option_string ( 1026 "Create and issue a credential issuer side."),
978 'd', 1027 &create_is),
979 "delegate", 1028 GNUNET_GETOPT_option_flag ('C',
980 "DELE", 1029 "createSubjectSide",
981 gettext_noop ("The private, signed delegate presented by the subject"), 1030 gettext_noop (
982 &subject_delegate), 1031 "Issue a credential subject side."),
983 GNUNET_GETOPT_option_string ( 1032 &create_ss),
984 'i', 1033 GNUNET_GETOPT_option_flag (
985 "issuer", 1034 'S',
986 "PKEY", 1035 "signSubjectSide",
987 gettext_noop ( 1036 gettext_noop ("Create, sign and return a credential subject side."),
988 "The public key of the authority to verify the credential against"), 1037 &sign_ss),
989 &issuer_key), 1038 GNUNET_GETOPT_option_string (
990 GNUNET_GETOPT_option_string ('e', 1039 'x',
991 "ego", 1040 "import",
992 "EGO", 1041 "IMP",
993 gettext_noop ("The ego/zone name to use"), 1042 gettext_noop (
994 &ego_name), 1043 "Import signed credentials that should be issued to a zone/ego"),
995 GNUNET_GETOPT_option_string ( 1044 &import),
996 'a', 1045 GNUNET_GETOPT_option_flag ('P',
997 "attribute", 1046 "private",
998 "ATTR", 1047 gettext_noop ("Create private record entry."),
999 gettext_noop ("The issuer attribute to verify against or to issue"), 1048 &is_private),
1000 &issuer_attr), 1049 GNUNET_GETOPT_option_flag (
1001 GNUNET_GETOPT_option_string ('T', 1050 'F',
1002 "ttl", 1051 "forward",
1003 "EXP", 1052 gettext_noop (
1004 gettext_noop ( 1053 "Indicates that the collect/verify process is done via forward search."),
1005 "The time to live for the credential." 1054 &forward),
1006 "e.g. 5m, 6h, \"1990-12-30 12:00:00\""), 1055 GNUNET_GETOPT_option_flag (
1007 &expiration), 1056 'B',
1008 GNUNET_GETOPT_option_flag ('g', 1057 "backward",
1009 "collect", 1058 gettext_noop (
1010 gettext_noop ("collect credentials"), 1059 "Indicates that the collect/verify process is done via forward search."),
1011 &collect), 1060 &backward),
1012 GNUNET_GETOPT_option_flag ('U', 1061 GNUNET_GETOPT_OPTION_END};
1013 "createIssuerSide",
1014 gettext_noop (
1015 "Create and issue a credential issuer side."),
1016 &create_is),
1017 GNUNET_GETOPT_option_flag ('C',
1018 "createSubjectSide",
1019 gettext_noop (
1020 "Issue a credential subject side."),
1021 &create_ss),
1022 GNUNET_GETOPT_option_flag (
1023 'S',
1024 "signSubjectSide",
1025 gettext_noop ("Create, sign and return a credential subject side."),
1026 &sign_ss),
1027 GNUNET_GETOPT_option_string (
1028 'x',
1029 "import",
1030 "IMP",
1031 gettext_noop (
1032 "Import signed credentials that should be issued to a zone/ego"),
1033 &import),
1034 GNUNET_GETOPT_option_flag ('P',
1035 "private",
1036 gettext_noop ("Create private record entry."),
1037 &is_private),
1038 GNUNET_GETOPT_option_flag (
1039 'F',
1040 "forward",
1041 gettext_noop (
1042 "Indicates that the collect/verify process is done via forward search."),
1043 &forward),
1044 GNUNET_GETOPT_option_flag (
1045 'B',
1046 "backward",
1047 gettext_noop (
1048 "Indicates that the collect/verify process is done via forward search."),
1049 &backward),
1050 GNUNET_GETOPT_OPTION_END};
1051 1062
1052 1063
1053 timeout = GNUNET_TIME_UNIT_FOREVER_REL; 1064 timeout = GNUNET_TIME_UNIT_FOREVER_REL;
@@ -1056,15 +1067,16 @@ main (int argc, char *const *argv)
1056 1067
1057 GNUNET_log_setup ("gnunet-abd", "WARNING", NULL); 1068 GNUNET_log_setup ("gnunet-abd", "WARNING", NULL);
1058 if (GNUNET_OK != GNUNET_PROGRAM_run (argc, 1069 if (GNUNET_OK != GNUNET_PROGRAM_run (argc,
1059 argv, 1070 argv,
1060 "gnunet-abd", 1071 "gnunet-abd",
1061 _ ("GNUnet abd resolver tool"), 1072 _ ("GNUnet abd resolver tool"),
1062 options, 1073 options,
1063 &run, 1074 &run,
1064 NULL)) 1075 NULL))
1065 ret = 1; 1076 ret = 1;
1066 GNUNET_free ((void *) argv); 1077 GNUNET_free ((void *) argv);
1067 return ret; 1078 return ret;
1068} 1079}
1069 1080
1081
1070/* end of gnunet-abd.c */ 1082/* end of gnunet-abd.c */
diff --git a/src/abd/gnunet-service-abd.c b/src/abd/gnunet-service-abd.c
index 84222b290..36b0009ef 100644
--- a/src/abd/gnunet-service-abd.c
+++ b/src/abd/gnunet-service-abd.c
@@ -360,6 +360,7 @@ print_deleset (struct DelegationSetQueueEntry *dsentry, char *text)
360 dsentry->delegation_chain_entry->subject_attribute); 360 dsentry->delegation_chain_entry->subject_attribute);
361} 361}
362 362
363
363static void 364static void
364cleanup_dsq_entry (struct DelegationSetQueueEntry *ds_entry) 365cleanup_dsq_entry (struct DelegationSetQueueEntry *ds_entry)
365{ 366{
@@ -385,18 +386,19 @@ cleanup_dsq_entry (struct DelegationSetQueueEntry *ds_entry)
385 GNUNET_free (ds_entry->delegation_chain_entry); 386 GNUNET_free (ds_entry->delegation_chain_entry);
386 } 387 }
387 // Free DQ entries 388 // Free DQ entries
388 for(struct DelegationQueueEntry *dq_entry = ds_entry->queue_entries_head; 389 for (struct DelegationQueueEntry *dq_entry = ds_entry->queue_entries_head;
389 NULL != ds_entry->queue_entries_head; 390 NULL != ds_entry->queue_entries_head;
390 dq_entry = ds_entry->queue_entries_head) 391 dq_entry = ds_entry->queue_entries_head)
391 { 392 {
392 GNUNET_CONTAINER_DLL_remove (ds_entry->queue_entries_head, 393 GNUNET_CONTAINER_DLL_remove (ds_entry->queue_entries_head,
393 ds_entry->queue_entries_tail, 394 ds_entry->queue_entries_tail,
394 dq_entry); 395 dq_entry);
395 GNUNET_free (dq_entry); 396 GNUNET_free (dq_entry);
396 } 397 }
397 GNUNET_free (ds_entry); 398 GNUNET_free (ds_entry);
398} 399}
399 400
401
400static void 402static void
401cleanup_handle (struct VerifyRequestHandle *vrh) 403cleanup_handle (struct VerifyRequestHandle *vrh)
402{ 404{
@@ -405,21 +407,22 @@ cleanup_handle (struct VerifyRequestHandle *vrh)
405 407
406 if (NULL != vrh->dsq_head) 408 if (NULL != vrh->dsq_head)
407 { 409 {
408 for (struct DelegationSetQueueEntry *ds_entry = vrh->dsq_head; NULL != vrh->dsq_head; 410 for (struct DelegationSetQueueEntry *ds_entry = vrh->dsq_head; NULL !=
409 ds_entry = vrh->dsq_head) 411 vrh->dsq_head;
412 ds_entry = vrh->dsq_head)
410 { 413 {
411 GNUNET_CONTAINER_DLL_remove (vrh->dsq_head, vrh->dsq_tail, ds_entry); 414 GNUNET_CONTAINER_DLL_remove (vrh->dsq_head, vrh->dsq_tail, ds_entry);
412 cleanup_dsq_entry(ds_entry); 415 cleanup_dsq_entry (ds_entry);
413 } 416 }
414 } 417 }
415 if (NULL != vrh->del_chain_head) 418 if (NULL != vrh->del_chain_head)
416 { 419 {
417 for (del_entry = vrh->del_chain_head; NULL != vrh->del_chain_head; 420 for (del_entry = vrh->del_chain_head; NULL != vrh->del_chain_head;
418 del_entry = vrh->del_chain_head) 421 del_entry = vrh->del_chain_head)
419 { 422 {
420 GNUNET_CONTAINER_DLL_remove (vrh->del_chain_head, 423 GNUNET_CONTAINER_DLL_remove (vrh->del_chain_head,
421 vrh->del_chain_tail, 424 vrh->del_chain_tail,
422 del_entry); 425 del_entry);
423 GNUNET_free_non_null (del_entry->delegate); 426 GNUNET_free_non_null (del_entry->delegate);
424 GNUNET_free (del_entry); 427 GNUNET_free (del_entry);
425 } 428 }
@@ -428,6 +431,7 @@ cleanup_handle (struct VerifyRequestHandle *vrh)
428 GNUNET_free (vrh); 431 GNUNET_free (vrh);
429} 432}
430 433
434
431static void 435static void
432shutdown_task (void *cls) 436shutdown_task (void *cls)
433{ 437{
@@ -459,15 +463,18 @@ shutdown_task (void *cls)
459 } 463 }
460} 464}
461 465
466
462static void 467static void
463send_intermediate_response(struct VerifyRequestHandle *vrh, struct DelegationChainEntry *ch_entry, bool is_bw){ 468send_intermediate_response (struct VerifyRequestHandle *vrh, struct
469 DelegationChainEntry *ch_entry, bool is_bw)
470{
464 struct DelegationChainIntermediateMessage *rmsg; 471 struct DelegationChainIntermediateMessage *rmsg;
465 struct GNUNET_MQ_Envelope *env; 472 struct GNUNET_MQ_Envelope *env;
466 struct GNUNET_ABD_Delegation *dd; 473 struct GNUNET_ABD_Delegation *dd;
467 size_t size; 474 size_t size;
468 475
469 // Don't report immediate results during collect 476 // Don't report immediate results during collect
470 if(vrh->is_collect) 477 if (vrh->is_collect)
471 return; 478 return;
472 479
473 dd = GNUNET_new (struct GNUNET_ABD_Delegation); 480 dd = GNUNET_new (struct GNUNET_ABD_Delegation);
@@ -482,31 +489,32 @@ send_intermediate_response(struct VerifyRequestHandle *vrh, struct DelegationCha
482 dd->subject_attribute = ch_entry->subject_attribute; 489 dd->subject_attribute = ch_entry->subject_attribute;
483 dd->subject_attribute_len = strlen (ch_entry->subject_attribute) + 1; 490 dd->subject_attribute_len = strlen (ch_entry->subject_attribute) + 1;
484 } 491 }
485 492
486 493
487 size = GNUNET_ABD_delegation_chain_get_size (1, 494 size = GNUNET_ABD_delegation_chain_get_size (1,
488 dd, 495 dd,
489 0, 496 0,
490 NULL); 497 NULL);
491 498
492 env = GNUNET_MQ_msg_extra (rmsg, 499 env = GNUNET_MQ_msg_extra (rmsg,
493 size, 500 size,
494 GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT); 501 GNUNET_MESSAGE_TYPE_ABD_INTERMEDIATE_RESULT);
495 // Assign id so that client can find associated request 502 // Assign id so that client can find associated request
496 rmsg->id = vrh->request_id; 503 rmsg->id = vrh->request_id;
497 rmsg->is_bw = htons(is_bw); 504 rmsg->is_bw = htons (is_bw);
498 rmsg->size = htonl(size); 505 rmsg->size = htonl (size);
499 506
500 GNUNET_assert ( 507 GNUNET_assert (
501 -1 != GNUNET_ABD_delegation_chain_serialize (1, 508 -1 != GNUNET_ABD_delegation_chain_serialize (1,
502 dd, 509 dd,
503 0, 510 0,
504 NULL, 511 NULL,
505 size, 512 size,
506 (char *) &rmsg[1])); 513 (char *) &rmsg[1]));
507 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (vrh->client), env); 514 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (vrh->client), env);
508} 515}
509 516
517
510static void 518static void
511send_lookup_response (struct VerifyRequestHandle *vrh) 519send_lookup_response (struct VerifyRequestHandle *vrh)
512{ 520{
@@ -570,9 +578,9 @@ send_lookup_response (struct VerifyRequestHandle *vrh)
570 } 578 }
571 size = 579 size =
572 GNUNET_ABD_delegation_chain_get_size (vrh->delegation_chain_size, 580 GNUNET_ABD_delegation_chain_get_size (vrh->delegation_chain_size,
573 dd, 581 dd,
574 vrh->del_chain_size, 582 vrh->del_chain_size,
575 dele); 583 dele);
576 env = GNUNET_MQ_msg_extra (rmsg, 584 env = GNUNET_MQ_msg_extra (rmsg,
577 size, 585 size,
578 GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT); 586 GNUNET_MESSAGE_TYPE_ABD_VERIFY_RESULT);
@@ -589,11 +597,11 @@ send_lookup_response (struct VerifyRequestHandle *vrh)
589 GNUNET_assert ( 597 GNUNET_assert (
590 -1 != 598 -1 !=
591 GNUNET_ABD_delegation_chain_serialize (vrh->delegation_chain_size, 599 GNUNET_ABD_delegation_chain_serialize (vrh->delegation_chain_size,
592 dd, 600 dd,
593 vrh->del_chain_size, 601 vrh->del_chain_size,
594 dele, 602 dele,
595 size, 603 size,
596 (char *) &rmsg[1])); 604 (char *) &rmsg[1]));
597 605
598 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (vrh->client), env); 606 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (vrh->client), env);
599 GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh); 607 GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh);
@@ -604,6 +612,7 @@ send_lookup_response (struct VerifyRequestHandle *vrh)
604 GNUNET_NO); 612 GNUNET_NO);
605} 613}
606 614
615
607static char * 616static char *
608partial_match (char *tmp_trail, 617partial_match (char *tmp_trail,
609 char *tmp_subattr, 618 char *tmp_subattr,
@@ -660,6 +669,7 @@ partial_match (char *tmp_trail,
660 return attr_trailer; 669 return attr_trailer;
661} 670}
662 671
672
663static int 673static int
664handle_bidirectional_match (struct DelegationSetQueueEntry *actual_entry, 674handle_bidirectional_match (struct DelegationSetQueueEntry *actual_entry,
665 struct DelegationSetQueueEntry *match_entry, 675 struct DelegationSetQueueEntry *match_entry,
@@ -679,7 +689,7 @@ handle_bidirectional_match (struct DelegationSetQueueEntry *actual_entry,
679 fw_entry = old_fw_parent; 689 fw_entry = old_fw_parent;
680 } 690 }
681 // set last entry of chain as actual_entry 691 // set last entry of chain as actual_entry
682 //actual_entry = last_entry; 692 // actual_entry = last_entry;
683 // set refcount, loop all delegations 693 // set refcount, loop all delegations
684 for (struct DelegateRecordEntry *del_entry = vrh->del_chain_head; 694 for (struct DelegateRecordEntry *del_entry = vrh->del_chain_head;
685 del_entry != NULL; 695 del_entry != NULL;
@@ -724,6 +734,7 @@ handle_bidirectional_match (struct DelegationSetQueueEntry *actual_entry,
724 return GNUNET_YES; 734 return GNUNET_YES;
725} 735}
726 736
737
727static void 738static void
728forward_resolution (void *cls, 739forward_resolution (void *cls,
729 uint32_t rd_count, 740 uint32_t rd_count,
@@ -846,9 +857,9 @@ forward_resolution (void *cls,
846 ds_entry->delegation_chain_entry->issuer_key = del->issuer_key; 857 ds_entry->delegation_chain_entry->issuer_key = del->issuer_key;
847 ds_entry->delegation_chain_entry->issuer_attribute = 858 ds_entry->delegation_chain_entry->issuer_attribute =
848 GNUNET_strdup (del->issuer_attribute); 859 GNUNET_strdup (del->issuer_attribute);
849 860
850 // Found new entry, repoting intermediate result 861 // Found new entry, repoting intermediate result
851 send_intermediate_response(vrh, ds_entry->delegation_chain_entry, false); 862 send_intermediate_response (vrh, ds_entry->delegation_chain_entry, false);
852 863
853 // current delegation as parent 864 // current delegation as parent
854 ds_entry->parent_queue_entry = dq_entry; 865 ds_entry->parent_queue_entry = dq_entry;
@@ -929,7 +940,7 @@ forward_resolution (void *cls,
929 if (GNUNET_NO == 940 if (GNUNET_NO ==
930 handle_bidirectional_match (ds_entry, del_entry, vrh)) 941 handle_bidirectional_match (ds_entry, del_entry, vrh))
931 return; 942 return;
932 943
933 send_lookup_response (vrh); 944 send_lookup_response (vrh);
934 return; 945 return;
935 } 946 }
@@ -948,12 +959,12 @@ forward_resolution (void *cls,
948 959
949 ds_entry->lookup_request = 960 ds_entry->lookup_request =
950 GNUNET_GNS_lookup (gns, 961 GNUNET_GNS_lookup (gns,
951 GNUNET_GNS_EMPTY_LABEL_AT, 962 GNUNET_GNS_EMPTY_LABEL_AT,
952 &del->issuer_key, 963 &del->issuer_key,
953 GNUNET_GNSRECORD_TYPE_DELEGATE, 964 GNUNET_GNSRECORD_TYPE_DELEGATE,
954 GNUNET_GNS_LO_DEFAULT, 965 GNUNET_GNS_LO_DEFAULT,
955 &forward_resolution, 966 &forward_resolution,
956 ds_entry); 967 ds_entry);
957 } 968 }
958 969
959 if (0 == vrh->pending_lookups) 970 if (0 == vrh->pending_lookups)
@@ -964,6 +975,7 @@ forward_resolution (void *cls,
964 } 975 }
965} 976}
966 977
978
967static void 979static void
968backward_resolution (void *cls, 980backward_resolution (void *cls,
969 uint32_t rd_count, 981 uint32_t rd_count,
@@ -998,10 +1010,10 @@ backward_resolution (void *cls,
998 1010
999 if (GNUNET_OK != 1011 if (GNUNET_OK !=
1000 GNUNET_ABD_delegation_set_deserialize (GNUNET_ntohll ( 1012 GNUNET_ABD_delegation_set_deserialize (GNUNET_ntohll (
1001 sets->data_size), 1013 sets->data_size),
1002 (const char *) &sets[1], 1014 (const char *) &sets[1],
1003 ntohl (sets->set_count), 1015 ntohl (sets->set_count),
1004 set)) 1016 set))
1005 { 1017 {
1006 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to deserialize!\n"); 1018 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to deserialize!\n");
1007 continue; 1019 continue;
@@ -1064,7 +1076,7 @@ backward_resolution (void *cls,
1064 GNUNET_strdup (current_set->lookup_attribute); 1076 GNUNET_strdup (current_set->lookup_attribute);
1065 1077
1066 // Found new entry, repoting intermediate result 1078 // Found new entry, repoting intermediate result
1067 send_intermediate_response(vrh, ds_entry->delegation_chain_entry, true); 1079 send_intermediate_response (vrh, ds_entry->delegation_chain_entry, true);
1068 1080
1069 ds_entry->parent_queue_entry = dq_entry; // current_delegation; 1081 ds_entry->parent_queue_entry = dq_entry; // current_delegation;
1070 1082
@@ -1127,8 +1139,8 @@ backward_resolution (void *cls,
1127 ds_entry->unresolved_attribute_delegation); 1139 ds_entry->unresolved_attribute_delegation);
1128 // Continue with next/new backward resolution 1140 // Continue with next/new backward resolution
1129 char issuer_attribute_name[strlen ( 1141 char issuer_attribute_name[strlen (
1130 ds_entry->unresolved_attribute_delegation) + 1142 ds_entry->unresolved_attribute_delegation)
1131 1]; 1143 + 1];
1132 strcpy (issuer_attribute_name, ds_entry->unresolved_attribute_delegation); 1144 strcpy (issuer_attribute_name, ds_entry->unresolved_attribute_delegation);
1133 char *next_attr = strtok (issuer_attribute_name, "."); 1145 char *next_attr = strtok (issuer_attribute_name, ".");
1134 if (NULL == next_attr) 1146 if (NULL == next_attr)
@@ -1156,7 +1168,7 @@ backward_resolution (void *cls,
1156 del_entry = del_entry->next) 1168 del_entry = del_entry->next)
1157 { 1169 {
1158 // only check entries added by forward algorithm 1170 // only check entries added by forward algorithm
1159 if (!del_entry->from_bw) 1171 if (! del_entry->from_bw)
1160 { 1172 {
1161 // key of list entry matches actual key 1173 // key of list entry matches actual key
1162 if (0 == memcmp (&del_entry->delegation_chain_entry->issuer_key, 1174 if (0 == memcmp (&del_entry->delegation_chain_entry->issuer_key,
@@ -1174,8 +1186,8 @@ backward_resolution (void *cls,
1174 // if one node on the path still needs solutions: return 1186 // if one node on the path still needs solutions: return
1175 if (GNUNET_NO == 1187 if (GNUNET_NO ==
1176 handle_bidirectional_match (del_entry, ds_entry, vrh)) 1188 handle_bidirectional_match (del_entry, ds_entry, vrh))
1177 break; 1189 break;
1178 1190
1179 // Send lookup response 1191 // Send lookup response
1180 send_lookup_response (vrh); 1192 send_lookup_response (vrh);
1181 return; 1193 return;
@@ -1197,12 +1209,12 @@ backward_resolution (void *cls,
1197 ds_entry->handle = vrh; 1209 ds_entry->handle = vrh;
1198 ds_entry->lookup_request = 1210 ds_entry->lookup_request =
1199 GNUNET_GNS_lookup (gns, 1211 GNUNET_GNS_lookup (gns,
1200 lookup_attribute, 1212 lookup_attribute,
1201 ds_entry->issuer_key, // issuer_key, 1213 ds_entry->issuer_key, // issuer_key,
1202 GNUNET_GNSRECORD_TYPE_ATTRIBUTE, 1214 GNUNET_GNSRECORD_TYPE_ATTRIBUTE,
1203 GNUNET_GNS_LO_DEFAULT, 1215 GNUNET_GNS_LO_DEFAULT,
1204 &backward_resolution, 1216 &backward_resolution,
1205 ds_entry); 1217 ds_entry);
1206 1218
1207 GNUNET_free (lookup_attribute); 1219 GNUNET_free (lookup_attribute);
1208 } 1220 }
@@ -1262,8 +1274,8 @@ delegation_chain_bw_resolution_start (void *cls)
1262 } 1274 }
1263 1275
1264 1276
1265 //Check for attributes from the issuer and follow the chain 1277 // Check for attributes from the issuer and follow the chain
1266 //till you get the required subject's attributes 1278 // till you get the required subject's attributes
1267 char issuer_attribute_name[strlen (vrh->issuer_attribute) + 1]; 1279 char issuer_attribute_name[strlen (vrh->issuer_attribute) + 1];
1268 strcpy (issuer_attribute_name, vrh->issuer_attribute); 1280 strcpy (issuer_attribute_name, vrh->issuer_attribute);
1269 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1281 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1301,6 +1313,7 @@ delegation_chain_bw_resolution_start (void *cls)
1301 return 0; 1313 return 0;
1302} 1314}
1303 1315
1316
1304static int 1317static int
1305delegation_chain_fw_resolution_start (void *cls) 1318delegation_chain_fw_resolution_start (void *cls)
1306{ 1319{
@@ -1364,11 +1377,13 @@ delegation_chain_fw_resolution_start (void *cls)
1364 GNUNET_memcpy (ds_entry->issuer_key, 1377 GNUNET_memcpy (ds_entry->issuer_key,
1365 &del_entry->delegate->subject_key, 1378 &del_entry->delegate->subject_key,
1366 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); 1379 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
1367 1380
1368 ds_entry->delegation_chain_entry = GNUNET_new (struct DelegationChainEntry); 1381 ds_entry->delegation_chain_entry = GNUNET_new (struct DelegationChainEntry);
1369 ds_entry->delegation_chain_entry->subject_key = del_entry->delegate->subject_key; 1382 ds_entry->delegation_chain_entry->subject_key =
1383 del_entry->delegate->subject_key;
1370 ds_entry->delegation_chain_entry->subject_attribute = NULL; 1384 ds_entry->delegation_chain_entry->subject_attribute = NULL;
1371 ds_entry->delegation_chain_entry->issuer_key = del_entry->delegate->issuer_key; 1385 ds_entry->delegation_chain_entry->issuer_key =
1386 del_entry->delegate->issuer_key;
1372 ds_entry->delegation_chain_entry->issuer_attribute = 1387 ds_entry->delegation_chain_entry->issuer_attribute =
1373 GNUNET_strdup (del_entry->delegate->issuer_attribute); 1388 GNUNET_strdup (del_entry->delegate->issuer_attribute);
1374 1389
@@ -1392,6 +1407,7 @@ delegation_chain_fw_resolution_start (void *cls)
1392 return 0; 1407 return 0;
1393} 1408}
1394 1409
1410
1395static int 1411static int
1396check_verify (void *cls, const struct VerifyMessage *v_msg) 1412check_verify (void *cls, const struct VerifyMessage *v_msg)
1397{ 1413{
@@ -1419,6 +1435,7 @@ check_verify (void *cls, const struct VerifyMessage *v_msg)
1419 return GNUNET_OK; 1435 return GNUNET_OK;
1420} 1436}
1421 1437
1438
1422static void 1439static void
1423handle_verify (void *cls, const struct VerifyMessage *v_msg) 1440handle_verify (void *cls, const struct VerifyMessage *v_msg)
1424{ 1441{
@@ -1465,18 +1482,18 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1465 1482
1466 // Parse delegates from verifaction message 1483 // Parse delegates from verifaction message
1467 delegate_count = ntohl (v_msg->d_count); 1484 delegate_count = ntohl (v_msg->d_count);
1468 delegate_data_size = ntohs (v_msg->header.size) - 1485 delegate_data_size = ntohs (v_msg->header.size)
1469 sizeof (struct VerifyMessage) - 1486 - sizeof (struct VerifyMessage)
1470 ntohs (v_msg->issuer_attribute_len) - 1; 1487 - ntohs (v_msg->issuer_attribute_len) - 1;
1471 struct GNUNET_ABD_Delegate delegates[delegate_count]; 1488 struct GNUNET_ABD_Delegate delegates[delegate_count];
1472 memset (delegates, 1489 memset (delegates,
1473 0, 1490 0,
1474 sizeof (struct GNUNET_ABD_Delegate) * delegate_count); 1491 sizeof (struct GNUNET_ABD_Delegate) * delegate_count);
1475 delegate_data = (char *) &v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1; 1492 delegate_data = (char *) &v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1;
1476 if (GNUNET_OK != GNUNET_ABD_delegates_deserialize (delegate_data_size, 1493 if (GNUNET_OK != GNUNET_ABD_delegates_deserialize (delegate_data_size,
1477 delegate_data, 1494 delegate_data,
1478 delegate_count, 1495 delegate_count,
1479 delegates)) 1496 delegates))
1480 { 1497 {
1481 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot deserialize delegates!\n"); 1498 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot deserialize delegates!\n");
1482 send_lookup_response (vrh); 1499 send_lookup_response (vrh);
@@ -1488,8 +1505,8 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1488 { 1505 {
1489 del_entry = GNUNET_new (struct DelegateRecordEntry); 1506 del_entry = GNUNET_new (struct DelegateRecordEntry);
1490 del_entry->delegate = 1507 del_entry->delegate =
1491 GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + 1508 GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate)
1492 delegates[i].issuer_attribute_len + 1); 1509 + delegates[i].issuer_attribute_len + 1);
1493 GNUNET_memcpy (del_entry->delegate, 1510 GNUNET_memcpy (del_entry->delegate,
1494 &delegates[i], 1511 &delegates[i],
1495 sizeof (struct GNUNET_ABD_Delegate)); 1512 sizeof (struct GNUNET_ABD_Delegate));
@@ -1509,7 +1526,7 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1509 if (GNUNET_ABD_FLAG_BACKWARD & vrh->resolution_algo && 1526 if (GNUNET_ABD_FLAG_BACKWARD & vrh->resolution_algo &&
1510 GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo) 1527 GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
1511 { 1528 {
1512 if(1 == delegation_chain_fw_resolution_start (vrh)) 1529 if (1 == delegation_chain_fw_resolution_start (vrh))
1513 return; 1530 return;
1514 delegation_chain_bw_resolution_start (vrh); 1531 delegation_chain_bw_resolution_start (vrh);
1515 } 1532 }
@@ -1523,6 +1540,7 @@ handle_verify (void *cls, const struct VerifyMessage *v_msg)
1523 } 1540 }
1524} 1541}
1525 1542
1543
1526static void 1544static void
1527handle_delegate_collection_error_cb (void *cls) 1545handle_delegate_collection_error_cb (void *cls)
1528{ 1546{
@@ -1533,6 +1551,7 @@ handle_delegate_collection_error_cb (void *cls)
1533 send_lookup_response (vrh); 1551 send_lookup_response (vrh);
1534} 1552}
1535 1553
1554
1536static void 1555static void
1537delegate_collection_finished (void *cls) 1556delegate_collection_finished (void *cls)
1538{ 1557{
@@ -1544,7 +1563,7 @@ delegate_collection_finished (void *cls)
1544 GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo) 1563 GNUNET_ABD_FLAG_FORWARD & vrh->resolution_algo)
1545 { 1564 {
1546 // if premature match found don't start bw resultion 1565 // if premature match found don't start bw resultion
1547 if(1 == delegation_chain_fw_resolution_start (vrh)) 1566 if (1 == delegation_chain_fw_resolution_start (vrh))
1548 return; 1567 return;
1549 delegation_chain_bw_resolution_start (vrh); 1568 delegation_chain_bw_resolution_start (vrh);
1550 } 1569 }
@@ -1558,6 +1577,7 @@ delegate_collection_finished (void *cls)
1558 } 1577 }
1559} 1578}
1560 1579
1580
1561static void 1581static void
1562handle_delegate_collection_cb (void *cls, 1582handle_delegate_collection_cb (void *cls,
1563 const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, 1583 const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
@@ -1599,6 +1619,7 @@ handle_delegate_collection_cb (void *cls,
1599 delegate_collection_finished (vrh); 1619 delegate_collection_finished (vrh);
1600} 1620}
1601 1621
1622
1602static void 1623static void
1603handle_collect (void *cls, const struct CollectMessage *c_msg) 1624handle_collect (void *cls, const struct CollectMessage *c_msg)
1604{ 1625{
@@ -1682,6 +1703,7 @@ check_collect (void *cls, const struct CollectMessage *c_msg)
1682 return GNUNET_OK; 1703 return GNUNET_OK;
1683} 1704}
1684 1705
1706
1685static void 1707static void
1686client_disconnect_cb (void *cls, 1708client_disconnect_cb (void *cls,
1687 struct GNUNET_SERVICE_Client *client, 1709 struct GNUNET_SERVICE_Client *client,
@@ -1690,6 +1712,7 @@ client_disconnect_cb (void *cls,
1690 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %p disconnected\n", client); 1712 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %p disconnected\n", client);
1691} 1713}
1692 1714
1715
1693static void * 1716static void *
1694client_connect_cb (void *cls, 1717client_connect_cb (void *cls,
1695 struct GNUNET_SERVICE_Client *client, 1718 struct GNUNET_SERVICE_Client *client,
@@ -1699,6 +1722,7 @@ client_connect_cb (void *cls,
1699 return client; 1722 return client;
1700} 1723}
1701 1724
1725
1702/** 1726/**
1703 * Process Credential requests. 1727 * Process Credential requests.
1704 * 1728 *
diff --git a/src/abd/plugin_gnsrecord_abd.c b/src/abd/plugin_gnsrecord_abd.c
index 9d8f4a79b..c7635b997 100644
--- a/src/abd/plugin_gnsrecord_abd.c
+++ b/src/abd/plugin_gnsrecord_abd.c
@@ -346,4 +346,5 @@ libgnunet_plugin_gnsrecord_abd_done (void *cls)
346 return NULL; 346 return NULL;
347} 347}
348 348
349
349/* end of plugin_gnsrecord_abd.c */ 350/* end of plugin_gnsrecord_abd.c */
diff --git a/src/abe/abe.c b/src/abe/abe.c
index bba6e5c45..dbd722ca3 100644
--- a/src/abe/abe.c
+++ b/src/abe/abe.c
@@ -77,6 +77,7 @@ init_aes (element_t k, int enc,
77 return rc; 77 return rc;
78} 78}
79 79
80
80static int 81static int
81aes_128_cbc_encrypt (char*pt, 82aes_128_cbc_encrypt (char*pt,
82 int size, 83 int size,
@@ -115,6 +116,7 @@ aes_128_cbc_encrypt (char*pt,
115 return buf_size; 116 return buf_size;
116} 117}
117 118
119
118static int 120static int
119aes_128_cbc_decrypt (char*ct, 121aes_128_cbc_decrypt (char*ct,
120 int size, 122 int size,
@@ -148,6 +150,7 @@ aes_128_cbc_decrypt (char*ct,
148 return len; 150 return len;
149} 151}
150 152
153
151/** 154/**
152 * @ingroup abe 155 * @ingroup abe
153 * Create a new CP-ABE master key. Caller must free return value. 156 * Create a new CP-ABE master key. Caller must free return value.
@@ -166,6 +169,7 @@ GNUNET_ABE_cpabe_create_master_key (void)
166 return key; 169 return key;
167} 170}
168 171
172
169/** 173/**
170 * @ingroup abe 174 * @ingroup abe
171 * Delete a CP-ABE master key. 175 * Delete a CP-ABE master key.
@@ -183,6 +187,7 @@ GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key)
183 GNUNET_free (key); 187 GNUNET_free (key);
184} 188}
185 189
190
186/** 191/**
187 * @ingroup abe 192 * @ingroup abe
188 * Create a new CP-ABE key. Caller must free return value. 193 * Create a new CP-ABE key. Caller must free return value.
@@ -208,6 +213,7 @@ GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key,
208 return prv_key; 213 return prv_key;
209} 214}
210 215
216
211/** 217/**
212 * @ingroup abe 218 * @ingroup abe
213 * Delete a CP-ABE key. 219 * Delete a CP-ABE key.
@@ -227,6 +233,7 @@ GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key,
227 GNUNET_free (key); 233 GNUNET_free (key);
228} 234}
229 235
236
230static ssize_t 237static ssize_t
231write_cpabe (void **result, 238write_cpabe (void **result,
232 uint32_t file_len, 239 uint32_t file_len,
@@ -255,6 +262,7 @@ write_cpabe (void **result,
255 return 12 + cph_buf_len + aes_buf_len; 262 return 12 + cph_buf_len + aes_buf_len;
256} 263}
257 264
265
258static ssize_t 266static ssize_t
259read_cpabe (const void *data, 267read_cpabe (const void *data,
260 char**cph_buf, 268 char**cph_buf,
@@ -285,6 +293,7 @@ read_cpabe (const void *data,
285 return buf_len; 293 return buf_len;
286} 294}
287 295
296
288/** 297/**
289 * @ingroup abe 298 * @ingroup abe
290 * Encrypt a block using sessionkey. 299 * Encrypt a block using sessionkey.
@@ -329,6 +338,7 @@ GNUNET_ABE_cpabe_encrypt (const void *block,
329 return result_len; 338 return result_len;
330} 339}
331 340
341
332/** 342/**
333 * @ingroup abe 343 * @ingroup abe
334 * Decrypt a block using the ABE key. 344 * Decrypt a block using the ABE key.
@@ -378,6 +388,7 @@ GNUNET_ABE_cpabe_decrypt (const void *block,
378 return plt_len; 388 return plt_len;
379} 389}
380 390
391
381/** 392/**
382 * @ingroup abe 393 * @ingroup abe
383 * Serialize an ABE key. 394 * Serialize an ABE key.
@@ -408,6 +419,7 @@ GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key,
408 return len; 419 return len;
409} 420}
410 421
422
411/** 423/**
412 * @ingroup abe 424 * @ingroup abe
413 * Deserialize a serialized ABE key. 425 * Deserialize a serialized ABE key.
@@ -440,6 +452,7 @@ GNUNET_ABE_cpabe_deserialize_key (const void *data,
440 return key; 452 return key;
441} 453}
442 454
455
443/** 456/**
444 * @ingroup abe 457 * @ingroup abe
445 * Serialize an ABE master key. 458 * Serialize an ABE master key.
@@ -471,6 +484,7 @@ GNUNET_ABE_cpabe_serialize_master_key (const struct
471 return len; 484 return len;
472} 485}
473 486
487
474/** 488/**
475 * @ingroup abe 489 * @ingroup abe
476 * Deserialize an ABE master key. 490 * Deserialize an ABE master key.
diff --git a/src/abe/test_cpabe.c b/src/abe/test_cpabe.c
index c1db72f96..2ac4ef0a8 100644
--- a/src/abe/test_cpabe.c
+++ b/src/abe/test_cpabe.c
@@ -85,4 +85,5 @@ main (int argc, char *argv[])
85 return 0; 85 return 0;
86} 86}
87 87
88
88/* end of test_crypto_aes.c */ 89/* end of test_crypto_aes.c */
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index da7268f67..4c6ce3240 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -288,8 +288,7 @@ handle_arm_result (void *cls,
288 wait for the result message, but also wait for the service to close 288 wait for the result message, but also wait for the service to close
289 the connection (and then we have to close our client handle as well); 289 the connection (and then we have to close our client handle as well);
290 this is done by installing a different receive handler, waiting for 290 this is done by installing a different receive handler, waiting for
291 the connection to go down */ 291 the connection to go down */if (NULL != h->thm)
292 if (NULL != h->thm)
293 { 292 {
294 GNUNET_break (0); 293 GNUNET_break (0);
295 op->result_cont (h->thm->cont_cls, 294 op->result_cont (h->thm->cont_cls,
@@ -956,8 +955,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
956 * 2) We're not connected to ARM. 955 * 2) We're not connected to ARM.
957 * Cancel any reconnection attempts temporarily, then perform 956 * Cancel any reconnection attempts temporarily, then perform
958 * a service test. 957 * a service test.
959 */ 958 */if (GNUNET_YES == h->currently_up)
960 if (GNUNET_YES == h->currently_up)
961 { 959 {
962 LOG (GNUNET_ERROR_TYPE_DEBUG, 960 LOG (GNUNET_ERROR_TYPE_DEBUG,
963 "ARM is already running\n"); 961 "ARM is already running\n");
@@ -976,8 +974,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
976 yet complete the MQ handshake. However, given that users 974 yet complete the MQ handshake. However, given that users
977 are unlikely to hammer 'gnunet-arm -s' on a busy system, 975 are unlikely to hammer 'gnunet-arm -s' on a busy system,
978 the above check should catch 99.99% of the cases where ARM 976 the above check should catch 99.99% of the cases where ARM
979 is already running. */ 977 is already running. */LOG (GNUNET_ERROR_TYPE_DEBUG,
980 LOG (GNUNET_ERROR_TYPE_DEBUG,
981 "Starting ARM service\n"); 978 "Starting ARM service\n");
982 if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_NO, 979 if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_NO,
983 GNUNET_NO, 980 GNUNET_NO,
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index 0fdb66fa0..3b4e770b0 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -1061,4 +1061,5 @@ main (int argc, char *const *argv)
1061 return lret; 1061 return lret;
1062} 1062}
1063 1063
1064
1064/* end of gnunet-arm.c */ 1065/* end of gnunet-arm.c */
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index d13be6eb1..6b6264757 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -1335,6 +1335,7 @@ pool_write (char *pool_start, size_t pool_size, size_t *pool_pos, char *str)
1335 return GNUNET_OK; 1335 return GNUNET_OK;
1336} 1336}
1337 1337
1338
1338/** 1339/**
1339 * Handle LIST-message. 1340 * Handle LIST-message.
1340 * 1341 *
@@ -2193,12 +2194,15 @@ main (int argc, char *const *argv)
2193/** 2194/**
2194 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 2195 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
2195 */ 2196 */
2196void __attribute__ ((constructor)) GNUNET_ARM_memory_init () 2197void __attribute__ ((constructor))
2198GNUNET_ARM_memory_init ()
2197{ 2199{
2198 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 2200 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
2199 mallopt (M_TOP_PAD, 1 * 1024); 2201 mallopt (M_TOP_PAD, 1 * 1024);
2200 malloc_trim (0); 2202 malloc_trim (0);
2201} 2203}
2204
2205
2202#endif 2206#endif
2203 2207
2204 2208
diff --git a/src/arm/mockup-service.c b/src/arm/mockup-service.c
index 9870afea1..43dd3c92b 100644
--- a/src/arm/mockup-service.c
+++ b/src/arm/mockup-service.c
@@ -116,7 +116,8 @@ GNUNET_SERVICE_MAIN ("do-nothing",
116/** 116/**
117 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 117 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
118 */ 118 */
119void __attribute__ ((destructor)) GNUNET_mockup_done () 119void __attribute__ ((destructor))
120GNUNET_mockup_done ()
120{ 121{
121 _exit (special_ret); 122 _exit (special_ret);
122} 123}
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c
index 5a06c823c..56a0abbd2 100644
--- a/src/arm/test_arm_api.c
+++ b/src/arm/test_arm_api.c
@@ -184,8 +184,7 @@ arm_start_cb (void *cls,
184 * ("sent", because it isn't going anywhere, ARM API starts ARM service 184 * ("sent", because it isn't going anywhere, ARM API starts ARM service
185 * by itself). 185 * by itself).
186 * ARM API should report that ARM service is starting. 186 * ARM API should report that ARM service is starting.
187 */ 187 */GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
188 GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
189 GNUNET_break (phase == 0); 188 GNUNET_break (phase == 0);
190 LOG ("Sent 'START' request for arm to ARM %s\n", 189 LOG ("Sent 'START' request for arm to ARM %s\n",
191 (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" : 190 (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" :
@@ -255,4 +254,5 @@ main (int argc, char *argvx[])
255 return ok; 254 return ok;
256} 255}
257 256
257
258/* end of test_arm_api.c */ 258/* end of test_arm_api.c */
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c
index 5d1863f37..e3eed8568 100644
--- a/src/arm/test_exponential_backoff.c
+++ b/src/arm/test_exponential_backoff.c
@@ -412,4 +412,5 @@ main (int argc, char *argv[])
412 return ret; 412 return ret;
413} 413}
414 414
415
415/* end of test_exponential_backoff.c */ 416/* end of test_exponential_backoff.c */
diff --git a/src/arm/test_gnunet_service_arm.c b/src/arm/test_gnunet_service_arm.c
index 45053a41d..90fb8bfa0 100644
--- a/src/arm/test_gnunet_service_arm.c
+++ b/src/arm/test_gnunet_service_arm.c
@@ -263,4 +263,5 @@ main (int argc, char *av[])
263 return ret; 263 return ret;
264} 264}
265 265
266
266/* end of test_gnunet_service_arm.c */ 267/* end of test_gnunet_service_arm.c */
diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c
index 676021926..fa379200f 100644
--- a/src/ats-tests/ats-testing-experiment.c
+++ b/src/ats-tests/ats-testing-experiment.c
@@ -65,6 +65,7 @@ create_experiment ()
65 return e; 65 return e;
66} 66}
67 67
68
68static void 69static void
69free_experiment (struct Experiment *e) 70free_experiment (struct Experiment *e)
70{ 71{
@@ -509,6 +510,7 @@ enforce_start_send (struct GNUNET_ATS_TEST_Operation *op)
509 GNUNET_TIME_UNIT_FOREVER_REL); 510 GNUNET_TIME_UNIT_FOREVER_REL);
510} 511}
511 512
513
512static void 514static void
513enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op) 515enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op)
514{ 516{
@@ -572,6 +574,7 @@ enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
572 op->pref_type); 574 op->pref_type);
573} 575}
574 576
577
575static void 578static void
576enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op) 579enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
577{ 580{
@@ -595,7 +598,9 @@ enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
595 } 598 }
596} 599}
597 600
598static void enforce_episode (struct Episode *ep) 601
602static void
603enforce_episode (struct Episode *ep)
599{ 604{
600 struct GNUNET_ATS_TEST_Operation *cur; 605 struct GNUNET_ATS_TEST_Operation *cur;
601 606
@@ -794,6 +799,7 @@ GNUNET_ATS_TEST_experimentation_load (const char *filename)
794 return e; 799 return e;
795} 800}
796 801
802
797void 803void
798GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e) 804GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e)
799{ 805{
@@ -810,4 +816,5 @@ GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e)
810 free_experiment (e); 816 free_experiment (e);
811} 817}
812 818
819
813/* end of file ats-testing-experiment.c*/ 820/* end of file ats-testing-experiment.c*/
diff --git a/src/ats-tests/ats-testing-log.c b/src/ats-tests/ats-testing-log.c
index 12a08ffda..38094a438 100644
--- a/src/ats-tests/ats-testing-log.c
+++ b/src/ats-tests/ats-testing-log.c
@@ -246,7 +246,6 @@ struct LoggingHandle
246}; 246};
247 247
248 248
249
250static void 249static void
251write_throughput_gnuplot_script (char *fn, struct LoggingPeer *lp, char **fs, 250write_throughput_gnuplot_script (char *fn, struct LoggingPeer *lp, char **fs,
252 int slaves) 251 int slaves)
@@ -380,6 +379,7 @@ write_rtt_gnuplot_script (char *fn, struct LoggingPeer *lp, char **fs, int
380 GNUNET_free (gfn); 379 GNUNET_free (gfn);
381} 380}
382 381
382
383static void 383static void
384write_bw_gnuplot_script (char *fn, struct LoggingPeer *lp, char **fs, int 384write_bw_gnuplot_script (char *fn, struct LoggingPeer *lp, char **fs, int
385 slaves) 385 slaves)
@@ -664,6 +664,7 @@ GNUNET_ATS_TEST_logging_write_to_file (struct LoggingHandle *l,
664 GNUNET_free (filename_master); 664 GNUNET_free (filename_master);
665} 665}
666 666
667
667/** 668/**
668 * Log all data now 669 * Log all data now
669 * 670 *
@@ -895,6 +896,7 @@ GNUNET_ATS_TEST_logging_stop (struct LoggingHandle *l)
895 _ ("Stop logging\n")); 896 _ ("Stop logging\n"));
896} 897}
897 898
899
898/** 900/**
899 * Clean up logging data 901 * Clean up logging data
900 * 902 *
@@ -969,4 +971,6 @@ GNUNET_ATS_TEST_logging_start (struct GNUNET_TIME_Relative log_frequency,
969 971
970 return l; 972 return l;
971} 973}
974
975
972/* end of file ats-testing-log.c */ 976/* end of file ats-testing-log.c */
diff --git a/src/ats-tests/ats-testing-preferences.c b/src/ats-tests/ats-testing-preferences.c
index 8138b18bb..f30fde960 100644
--- a/src/ats-tests/ats-testing-preferences.c
+++ b/src/ats-tests/ats-testing-preferences.c
@@ -261,4 +261,5 @@ GNUNET_ATS_TEST_generate_preferences_stop_all ()
261 } 261 }
262} 262}
263 263
264
264/* end of file ats-testing-preferences.c */ 265/* end of file ats-testing-preferences.c */
diff --git a/src/ats-tests/ats-testing-traffic.c b/src/ats-tests/ats-testing-traffic.c
index 14a8fe327..f19eac871 100644
--- a/src/ats-tests/ats-testing-traffic.c
+++ b/src/ats-tests/ats-testing-traffic.c
@@ -389,4 +389,5 @@ GNUNET_ATS_TEST_generate_traffic_stop_all ()
389 } 389 }
390} 390}
391 391
392
392/* end of file ats-testing-traffic.c */ 393/* end of file ats-testing-traffic.c */
diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c
index 88c1729a6..c7969cdfe 100644
--- a/src/ats-tests/ats-testing.c
+++ b/src/ats-tests/ats-testing.c
@@ -738,7 +738,6 @@ do_connect_ats (void *cls)
738} 738}
739 739
740 740
741
742static void 741static void
743peerinformation_cb (void *cb_cls, 742peerinformation_cb (void *cb_cls,
744 struct GNUNET_TESTBED_Operation *op, 743 struct GNUNET_TESTBED_Operation *op,
diff --git a/src/ats-tests/gnunet-ats-sim.c b/src/ats-tests/gnunet-ats-sim.c
index c9e7a6d9f..fb3014798 100644
--- a/src/ats-tests/gnunet-ats-sim.c
+++ b/src/ats-tests/gnunet-ats-sim.c
@@ -252,22 +252,19 @@ topology_setup_done (void *cls,
252 GNUNET_ATS_TEST_TG_CONSTANT, 1, 1, GNUNET_TIME_UNIT_SECONDS, 252 GNUNET_ATS_TEST_TG_CONSTANT, 1, 1, GNUNET_TIME_UNIT_SECONDS,
253 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250), 253 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250),
254 GNUNET_ATS_PREFERENCE_BANDWIDTH); 254 GNUNET_ATS_PREFERENCE_BANDWIDTH);
255 */ 255 *//*
256/*
257 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0], 256 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0],
258 GNUNET_ATS_TEST_TG_LINEAR, 1, 50, 257 GNUNET_ATS_TEST_TG_LINEAR, 1, 50,
259 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2), 258 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2),
260 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250), 259 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250),
261 GNUNET_ATS_PREFERENCE_BANDWIDTH); 260 GNUNET_ATS_PREFERENCE_BANDWIDTH);
262 */ 261 *//*
263/*
264 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0], 262 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0],
265 GNUNET_ATS_TEST_TG_RANDOM, 1, 50, 263 GNUNET_ATS_TEST_TG_RANDOM, 1, 50,
266 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2), 264 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2),
267 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250), 265 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250),
268 GNUNET_ATS_PREFERENCE_BANDWIDTH); 266 GNUNET_ATS_PREFERENCE_BANDWIDTH);
269 */ 267 *//*
270/*
271 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0], 268 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0],
272 GNUNET_ATS_TEST_TG_SINUS, 10, 5, 269 GNUNET_ATS_TEST_TG_SINUS, 10, 5,
273 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5), 270 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5),
@@ -397,4 +394,6 @@ main (int argc, char *argv[])
397 GNUNET_free (opt_exp_file); 394 GNUNET_free (opt_exp_file);
398 return 0; 395 return 0;
399} 396}
397
398
400/* end of file gnunet-ats-sim.c */ 399/* end of file gnunet-ats-sim.c */
diff --git a/src/ats-tests/gnunet-solver-eval.c b/src/ats-tests/gnunet-solver-eval.c
index bc6a3c435..09ddd7b2d 100644
--- a/src/ats-tests/gnunet-solver-eval.c
+++ b/src/ats-tests/gnunet-solver-eval.c
@@ -408,6 +408,7 @@ load_episode (struct Experiment *e,
408 return GNUNET_OK; 408 return GNUNET_OK;
409} 409}
410 410
411
411static int 412static int
412load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg) 413load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
413{ 414{
@@ -517,8 +518,8 @@ enforce_start_send (struct GNUNET_ATS_TEST_Operation *op)
517 partner->tg = GNUNET_ATS_TEST_generate_traffic_start(peer, partner, 518 partner->tg = GNUNET_ATS_TEST_generate_traffic_start(peer, partner,
518 op->tg_type, op->base_rate, op->max_rate, op->period, 519 op->tg_type, op->base_rate, op->max_rate, op->period,
519 GNUNET_TIME_UNIT_FOREVER_REL); 520 GNUNET_TIME_UNIT_FOREVER_REL);
520 */ 521 */}
521} 522
522 523
523static void 524static void
524enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op) 525enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op)
@@ -541,8 +542,7 @@ enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op)
541 GNUNET_ATS_TEST_generate_traffic_stop(p->tg); 542 GNUNET_ATS_TEST_generate_traffic_stop(p->tg);
542 p->tg = NULL; 543 p->tg = NULL;
543 } 544 }
544 */ 545 */}
545}
546 546
547 547
548static void 548static void
@@ -579,8 +579,8 @@ enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
579 partner->pg = GNUNET_ATS_TEST_generate_preferences_start(peer, partner, 579 partner->pg = GNUNET_ATS_TEST_generate_preferences_start(peer, partner,
580 op->tg_type, op->base_rate, op->max_rate, op->period, op->frequency, 580 op->tg_type, op->base_rate, op->max_rate, op->period, op->frequency,
581 op->pref_type); 581 op->pref_type);
582 */ 582 */}
583} 583
584 584
585static void 585static void
586enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op) 586enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
@@ -603,10 +603,11 @@ enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
603 GNUNET_ATS_TEST_generate_preferences_stop (p->pg); 603 GNUNET_ATS_TEST_generate_preferences_stop (p->pg);
604 p->pg = NULL; 604 p->pg = NULL;
605 } 605 }
606 */ 606 */}
607} 607
608 608
609static void enforce_episode (struct Episode *ep) 609static void
610enforce_episode (struct Episode *ep)
610{ 611{
611 struct GNUNET_ATS_TEST_Operation *cur; 612 struct GNUNET_ATS_TEST_Operation *cur;
612 613
@@ -805,6 +806,7 @@ GNUNET_ATS_solvers_experimentation_load (char *filename)
805 return e; 806 return e;
806} 807}
807 808
809
808void 810void
809GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e) 811GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
810{ 812{
@@ -821,6 +823,7 @@ GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
821 free_experiment (e); 823 free_experiment (e);
822} 824}
823 825
826
824/** 827/**
825 * Solver 828 * Solver
826 */ 829 */
@@ -847,6 +850,7 @@ GNUNET_ATS_solvers_solver_stop (struct GNUNET_ATS_TESTING_SolverHandle *sh)
847 GNUNET_free (sh); 850 GNUNET_free (sh);
848} 851}
849 852
853
850struct GNUNET_ATS_TESTING_SolverHandle * 854struct GNUNET_ATS_TESTING_SolverHandle *
851GNUNET_ATS_solvers_solver_start (enum GNUNET_ATS_Solvers type) 855GNUNET_ATS_solvers_solver_start (enum GNUNET_ATS_Solvers type)
852{ 856{
@@ -885,6 +889,7 @@ GNUNET_ATS_solvers_solver_start (enum GNUNET_ATS_Solvers type)
885 return sh; 889 return sh;
886} 890}
887 891
892
888static struct Experiment *e; 893static struct Experiment *e;
889 894
890static struct GNUNET_ATS_TESTING_SolverHandle *sh; 895static struct GNUNET_ATS_TESTING_SolverHandle *sh;
@@ -1015,4 +1020,6 @@ main (int argc, char *argv[])
1015 1020
1016 return 0; 1021 return 0;
1017} 1022}
1023
1024
1018/* end of file gnunet-solver-eval.c*/ 1025/* end of file gnunet-solver-eval.c*/
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c
index 470c687fc..64756b8aa 100644
--- a/src/ats-tests/perf_ats.c
+++ b/src/ats-tests/perf_ats.c
@@ -420,7 +420,7 @@ main (int argc, char *argv[])
420 /* Determine solver name */ 420 /* Determine solver name */
421 solver = GNUNET_strdup (tmp); 421 solver = GNUNET_strdup (tmp);
422 /* Remove .exe prefix */ 422 /* Remove .exe prefix */
423 if ((NULL != (dotexe = strstr (solver, ".exe")))&&(dotexe[4] == '\0')) 423 if ((NULL != (dotexe = strstr (solver, ".exe"))) && (dotexe[4] == '\0'))
424 dotexe[0] = '\0'; 424 dotexe[0] = '\0';
425 425
426 /* Determine first '_' after solver */ 426 /* Determine first '_' after solver */
@@ -597,4 +597,5 @@ main (int argc, char *argv[])
597 return result; 597 return result;
598} 598}
599 599
600
600/* end of file perf_ats.c */ 601/* end of file perf_ats.c */
diff --git a/src/ats-tests/perf_ats_logging.c b/src/ats-tests/perf_ats_logging.c
index 41c50ea6e..ac8fa8950 100644
--- a/src/ats-tests/perf_ats_logging.c
+++ b/src/ats-tests/perf_ats_logging.c
@@ -372,6 +372,7 @@ write_rtt_gnuplot_script (char *fn, struct LoggingPeer *lp)
372 GNUNET_free (gfn); 372 GNUNET_free (gfn);
373} 373}
374 374
375
375static void 376static void
376write_bw_gnuplot_script (char *fn, struct LoggingPeer *lp) 377write_bw_gnuplot_script (char *fn, struct LoggingPeer *lp)
377{ 378{
@@ -514,7 +515,6 @@ write_to_file ()
514 /* Assembling master string */ 515 /* Assembling master string */
515 516
516 517
517
518 GNUNET_asprintf (&data, "%llu;%llu;%u;%u;%u;%u;%u;%u;;;;;;;;;;;%s\n", 518 GNUNET_asprintf (&data, "%llu;%llu;%u;%u;%u;%u;%u;%u;;;;;;;;;;;%s\n",
519 cur_lt->timestamp, 519 cur_lt->timestamp,
520 GNUNET_TIME_absolute_get_difference (lp[c_m].start, 520 GNUNET_TIME_absolute_get_difference (lp[c_m].start,
@@ -703,6 +703,7 @@ collect_log_now (void)
703 } 703 }
704} 704}
705 705
706
706static void 707static void
707collect_log_task (void *cls) 708collect_log_task (void *cls)
708{ 709{
@@ -774,4 +775,6 @@ perf_logging_start (struct GNUNET_TIME_Relative log_frequency,
774 log_task = GNUNET_SCHEDULER_add_now (&collect_log_task, NULL); 775 log_task = GNUNET_SCHEDULER_add_now (&collect_log_task, NULL);
775 running = GNUNET_YES; 776 running = GNUNET_YES;
776} 777}
778
779
777/* end of file perf_ats_logging.c */ 780/* end of file perf_ats_logging.c */
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 03bddba8f..16636e505 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -988,4 +988,5 @@ main (int argc, char *const *argv)
988 return 1; 988 return 1;
989} 989}
990 990
991
991/* end of gnunet-ats.c */ 992/* end of gnunet-ats.c */
diff --git a/src/ats/ats.h b/src/ats/ats.h
index 3a3d12cfa..711c1c103 100644
--- a/src/ats/ats.h
+++ b/src/ats/ats.h
@@ -235,7 +235,6 @@ struct GNUNET_ATS_SessionReleaseMessage
235}; 235};
236 236
237 237
238
239/** 238/**
240 * ATS Service suggests to the transport service to use the address 239 * ATS Service suggests to the transport service to use the address
241 * identified by the given @e session_id for the given @e peer with 240 * identified by the given @e session_id for the given @e peer with
@@ -490,5 +489,4 @@ struct FeedbackPreferenceMessage
490GNUNET_NETWORK_STRUCT_END 489GNUNET_NETWORK_STRUCT_END
491 490
492 491
493
494#endif 492#endif
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index 8defd6022..acc9356ed 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -992,4 +992,5 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
992 env); 992 env);
993} 993}
994 994
995
995/* end of ats_api_performance.c */ 996/* end of ats_api_performance.c */
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 9866ca929..6a014357e 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -123,6 +123,7 @@ find_peer_by_id (int id)
123 return NULL; 123 return NULL;
124} 124}
125 125
126
126static struct TestPeer * 127static struct TestPeer *
127find_peer_by_pid (const struct GNUNET_PeerIdentity *pid) 128find_peer_by_pid (const struct GNUNET_PeerIdentity *pid)
128{ 129{
@@ -134,6 +135,7 @@ find_peer_by_pid (const struct GNUNET_PeerIdentity *pid)
134 return NULL; 135 return NULL;
135} 136}
136 137
138
137static struct TestAddress * 139static struct TestAddress *
138find_address_by_id (struct TestPeer *peer, int aid) 140find_address_by_id (struct TestPeer *peer, int aid)
139{ 141{
@@ -238,6 +240,7 @@ logging_task (void *cls)
238 l); 240 l);
239} 241}
240 242
243
241struct LoggingHandle * 244struct LoggingHandle *
242GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq) 245GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq)
243{ 246{
@@ -252,6 +255,7 @@ GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq)
252 return l; 255 return l;
253} 256}
254 257
258
255void 259void
256GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l) 260GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l)
257{ 261{
@@ -263,6 +267,7 @@ GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l)
263 l->logging_task = NULL; 267 l->logging_task = NULL;
264} 268}
265 269
270
266static struct LoggingFileHandle * 271static struct LoggingFileHandle *
267find_logging_file_handle (struct LoggingFileHandle *lf_head, 272find_logging_file_handle (struct LoggingFileHandle *lf_head,
268 struct LoggingFileHandle *lf_tail, 273 struct LoggingFileHandle *lf_tail,
@@ -276,6 +281,7 @@ find_logging_file_handle (struct LoggingFileHandle *lf_head,
276 return NULL; 281 return NULL;
277} 282}
278 283
284
279void 285void
280GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int 286GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int
281 add_time_stamp, 287 add_time_stamp,
@@ -391,8 +397,7 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int
391 fprintf(stderr,"\t %s = %.2f %.2f [abs/rel]\n", 397 fprintf(stderr,"\t %s = %.2f %.2f [abs/rel]\n",
392 GNUNET_ATS_print_preference_type(c), 398 GNUNET_ATS_print_preference_type(c),
393 log_p->pref_abs[c], log_p->pref_norm[c]); 399 log_p->pref_abs[c], log_p->pref_norm[c]);
394 */ 400 */GNUNET_asprintf (&prefstring_tmp, "%s;%.3f;%.3f",
395 GNUNET_asprintf (&prefstring_tmp, "%s;%.3f;%.3f",
396 prefstring, log_p->pref_abs[c], log_p->pref_norm[c]); 401 prefstring, log_p->pref_abs[c], log_p->pref_norm[c]);
397 402
398 403
@@ -449,6 +454,7 @@ cleanup:
449 } 454 }
450} 455}
451 456
457
452void 458void
453GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l) 459GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l)
454{ 460{
@@ -493,6 +499,7 @@ GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l)
493 } 499 }
494} 500}
495 501
502
496void 503void
497GNUNET_ATS_solver_logging_free (struct LoggingHandle *l) 504GNUNET_ATS_solver_logging_free (struct LoggingHandle *l)
498{ 505{
@@ -538,6 +545,7 @@ GNUNET_ATS_solver_logging_free (struct LoggingHandle *l)
538 GNUNET_free (l); 545 GNUNET_free (l);
539} 546}
540 547
548
541/** 549/**
542 * Property Generators 550 * Property Generators
543 */ 551 */
@@ -701,6 +709,7 @@ find_prop_gen (unsigned int peer, unsigned int address,
701 return NULL; 709 return NULL;
702} 710}
703 711
712
704void 713void
705GNUNET_ATS_solver_generate_property_stop (struct PropertyGenerator *pg) 714GNUNET_ATS_solver_generate_property_stop (struct PropertyGenerator *pg)
706{ 715{
@@ -1056,6 +1065,7 @@ find_pref_gen (unsigned int peer, enum GNUNET_ATS_PreferenceKind kind)
1056 return NULL; 1065 return NULL;
1057} 1066}
1058 1067
1068
1059void 1069void
1060GNUNET_ATS_solver_generate_preferences_stop (struct PreferenceGenerator *pg) 1070GNUNET_ATS_solver_generate_preferences_stop (struct PreferenceGenerator *pg)
1061{ 1071{
@@ -1210,7 +1220,6 @@ GNUNET_ATS_solver_generate_preferences_start (unsigned int peer,
1210} 1220}
1211 1221
1212 1222
1213
1214/** 1223/**
1215 * Stop all preferences generators 1224 * Stop all preferences generators
1216 */ 1225 */
@@ -1229,7 +1238,6 @@ GNUNET_ATS_solver_generate_preferences_stop_all ()
1229} 1238}
1230 1239
1231 1240
1232
1233/** 1241/**
1234 * Experiments 1242 * Experiments
1235 */ 1243 */
@@ -1983,6 +1991,7 @@ load_op_start_set_property (struct GNUNET_ATS_TEST_Operation *o,
1983 return GNUNET_OK; 1991 return GNUNET_OK;
1984} 1992}
1985 1993
1994
1986static int 1995static int
1987load_op_stop_set_property (struct GNUNET_ATS_TEST_Operation *o, 1996load_op_stop_set_property (struct GNUNET_ATS_TEST_Operation *o,
1988 struct Episode *e, 1997 struct Episode *e,
@@ -2078,6 +2087,7 @@ load_op_start_request (struct GNUNET_ATS_TEST_Operation *o,
2078 return GNUNET_OK; 2087 return GNUNET_OK;
2079} 2088}
2080 2089
2090
2081static int 2091static int
2082load_op_stop_request (struct GNUNET_ATS_TEST_Operation *o, 2092load_op_stop_request (struct GNUNET_ATS_TEST_Operation *o,
2083 struct Episode *e, 2093 struct Episode *e,
@@ -2205,6 +2215,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
2205 return GNUNET_OK; 2215 return GNUNET_OK;
2206} 2216}
2207 2217
2218
2208static int 2219static int
2209load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg) 2220load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
2210{ 2221{
@@ -2280,6 +2291,7 @@ timeout_experiment (void *cls)
2280 GNUNET_SYSERR); 2291 GNUNET_SYSERR);
2281} 2292}
2282 2293
2294
2283struct ATS_Address * 2295struct ATS_Address *
2284create_ats_address (const struct GNUNET_PeerIdentity *peer, 2296create_ats_address (const struct GNUNET_PeerIdentity *peer,
2285 const char *plugin_name, 2297 const char *plugin_name,
@@ -2309,7 +2321,6 @@ create_ats_address (const struct GNUNET_PeerIdentity *peer,
2309} 2321}
2310 2322
2311 2323
2312
2313static void 2324static void
2314enforce_add_address (struct GNUNET_ATS_TEST_Operation *op) 2325enforce_add_address (struct GNUNET_ATS_TEST_Operation *op)
2315{ 2326{
@@ -2413,6 +2424,7 @@ enforce_del_address (struct GNUNET_ATS_TEST_Operation *op)
2413 GNUNET_free (a); 2424 GNUNET_free (a);
2414} 2425}
2415 2426
2427
2416static void 2428static void
2417enforce_start_property (struct GNUNET_ATS_TEST_Operation *op) 2429enforce_start_property (struct GNUNET_ATS_TEST_Operation *op)
2418{ 2430{
@@ -2454,6 +2466,7 @@ enforce_start_property (struct GNUNET_ATS_TEST_Operation *op)
2454 op->prop_type); 2466 op->prop_type);
2455} 2467}
2456 2468
2469
2457static void 2470static void
2458enforce_stop_property (struct GNUNET_ATS_TEST_Operation *op) 2471enforce_stop_property (struct GNUNET_ATS_TEST_Operation *op)
2459{ 2472{
@@ -2477,6 +2490,7 @@ enforce_stop_property (struct GNUNET_ATS_TEST_Operation *op)
2477 } 2490 }
2478} 2491}
2479 2492
2493
2480static void 2494static void
2481enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op) 2495enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
2482{ 2496{
@@ -2509,6 +2523,7 @@ enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
2509 op->frequency); 2523 op->frequency);
2510} 2524}
2511 2525
2526
2512static void 2527static void
2513enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op) 2528enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
2514{ 2529{
@@ -2581,7 +2596,9 @@ enforce_stop_request (struct GNUNET_ATS_TEST_Operation *op)
2581 } 2596 }
2582} 2597}
2583 2598
2584static void enforce_episode (struct Episode *ep) 2599
2600static void
2601enforce_episode (struct Episode *ep)
2585{ 2602{
2586 struct GNUNET_ATS_TEST_Operation *cur; 2603 struct GNUNET_ATS_TEST_Operation *cur;
2587 2604
@@ -2719,6 +2736,7 @@ GNUNET_ATS_solvers_experimentation_run (struct Experiment *e,
2719 enforce_episode (e->cur); 2736 enforce_episode (e->cur);
2720} 2737}
2721 2738
2739
2722void 2740void
2723GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e) 2741GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
2724{ 2742{
@@ -2872,7 +2890,6 @@ GNUNET_ATS_solvers_experimentation_load (char *filename)
2872} 2890}
2873 2891
2874 2892
2875
2876/** 2893/**
2877 * Solver 2894 * Solver
2878 */ 2895 */
@@ -2892,6 +2909,7 @@ free_all_it (void *cls,
2892 return GNUNET_OK; 2909 return GNUNET_OK;
2893} 2910}
2894 2911
2912
2895void 2913void
2896GNUNET_ATS_solvers_solver_stop (struct SolverHandle *sh) 2914GNUNET_ATS_solvers_solver_stop (struct SolverHandle *sh)
2897{ 2915{
@@ -3178,6 +3196,7 @@ solver_info_cb (void *cls,
3178 } 3196 }
3179} 3197}
3180 3198
3199
3181static void 3200static void
3182solver_bandwidth_changed_cb (void *cls, struct ATS_Address *address) 3201solver_bandwidth_changed_cb (void *cls, struct ATS_Address *address)
3183{ 3202{
@@ -3229,6 +3248,7 @@ solver_bandwidth_changed_cb (void *cls, struct ATS_Address *address)
3229 return; 3248 return;
3230} 3249}
3231 3250
3251
3232const double * 3252const double *
3233get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id) 3253get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id)
3234{ 3254{
@@ -3385,6 +3405,7 @@ done ()
3385 end_now (); 3405 end_now ();
3386} 3406}
3387 3407
3408
3388static void 3409static void
3389experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration, 3410experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,
3390 int success) 3411 int success)
@@ -3398,6 +3419,7 @@ experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,
3398 GNUNET_SCHEDULER_add_now (&done, NULL); 3419 GNUNET_SCHEDULER_add_now (&done, NULL);
3399} 3420}
3400 3421
3422
3401static void 3423static void
3402episode_done_cb (struct Episode *ep) 3424episode_done_cb (struct Episode *ep)
3403{ 3425{
@@ -3405,7 +3427,6 @@ episode_done_cb (struct Episode *ep)
3405} 3427}
3406 3428
3407 3429
3408
3409/** 3430/**
3410 * Do shutdown 3431 * Do shutdown
3411 */ 3432 */
@@ -3424,6 +3445,7 @@ end_now ()
3424 } 3445 }
3425} 3446}
3426 3447
3448
3427static void 3449static void
3428run (void *cls, char *const *args, const char *cfgfile, 3450run (void *cls, char *const *args, const char *cfgfile,
3429 const struct GNUNET_CONFIGURATION_Handle *cfg) 3451 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -3560,4 +3582,6 @@ main (int argc, char *argv[])
3560 3582
3561 return res; 3583 return res;
3562} 3584}
3585
3586
3563/* end of file ats-testing-experiment.c*/ 3587/* end of file ats-testing-experiment.c*/
diff --git a/src/ats/gnunet-service-ats.c b/src/ats/gnunet-service-ats.c
index fbef6f166..5e27ecbd0 100644
--- a/src/ats/gnunet-service-ats.c
+++ b/src/ats/gnunet-service-ats.c
@@ -94,7 +94,6 @@ handle_ats_start (void *cls,
94} 94}
95 95
96 96
97
98/** 97/**
99 * Handle 'reservation request' messages from clients. 98 * Handle 'reservation request' messages from clients.
100 * 99 *
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 7c73cbf5b..e8a95c65e 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -712,5 +712,4 @@ GAS_handle_request_address_list (struct GNUNET_SERVICE_Client *client,
712} 712}
713 713
714 714
715
716/* end of gnunet-service-ats_addresses.c */ 715/* end of gnunet-service-ats_addresses.c */
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c
index 441c6610e..a4d7b36b6 100644
--- a/src/ats/gnunet-service-ats_performance.c
+++ b/src/ats/gnunet-service-ats_performance.c
@@ -278,4 +278,5 @@ GAS_performance_done ()
278 nc_pic = NULL; 278 nc_pic = NULL;
279} 279}
280 280
281
281/* end of gnunet-service-ats_performance.c */ 282/* end of gnunet-service-ats_performance.c */
diff --git a/src/ats/gnunet-service-ats_reservations.c b/src/ats/gnunet-service-ats_reservations.c
index c4367fb85..a50e9d5b7 100644
--- a/src/ats/gnunet-service-ats_reservations.c
+++ b/src/ats/gnunet-service-ats_reservations.c
@@ -213,4 +213,5 @@ GAS_reservations_done ()
213 GNUNET_CONTAINER_multipeermap_destroy (trackers); 213 GNUNET_CONTAINER_multipeermap_destroy (trackers);
214} 214}
215 215
216
216/* end of gnunet-service-ats_reservations.c */ 217/* end of gnunet-service-ats_reservations.c */
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c
index 5f10addaf..8e20f4454 100644
--- a/src/ats/perf_ats_solver.c
+++ b/src/ats/perf_ats_solver.c
@@ -530,6 +530,7 @@ perf_update_all_addresses (unsigned int cp, unsigned int ca, unsigned int
530 } 530 }
531} 531}
532 532
533
533/** 534/**
534 * Create an address for a peer 535 * Create an address for a peer
535 * 536 *
@@ -818,6 +819,7 @@ solver_info_cb (void *cls,
818 } 819 }
819} 820}
820 821
822
821/** 823/**
822 * Evaluate results for a specific iteration 824 * Evaluate results for a specific iteration
823 * 825 *
@@ -1016,7 +1018,6 @@ write_all_iterations (void)
1016 struct Result *cur_upd_res; 1018 struct Result *cur_upd_res;
1017 1019
1018 1020
1019
1020 // fprintf (stderr, "P: %u I: %u == %p \n", c_peer, c_iteration, cur_res); 1021 // fprintf (stderr, "P: %u I: %u == %p \n", c_peer, c_iteration, cur_res);
1021 cur_full_res = ph.iterations_results[c_iteration].results_array[c_peer]; 1022 cur_full_res = ph.iterations_results[c_iteration].results_array[c_peer];
1022 if (c_peer == 0) 1023 if (c_peer == 0)
@@ -1505,4 +1506,5 @@ main (int argc, char *argv[])
1505 return ret; 1506 return ret;
1506} 1507}
1507 1508
1509
1508/* end of file perf_ats_solver.c */ 1510/* end of file perf_ats_solver.c */
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c
index a1e995013..f4324d238 100644
--- a/src/ats/plugin_ats_proportional.c
+++ b/src/ats/plugin_ats_proportional.c
@@ -773,8 +773,7 @@ update_active_address (struct GAS_PROPORTIONAL_Handle *s,
773 * suggest one. Therefore we have to disconnect the peer. 773 * suggest one. Therefore we have to disconnect the peer.
774 * The above call to "distribute_bandwidth_in_network() 774 * The above call to "distribute_bandwidth_in_network()
775 * does not see 'current_address' so we need to trigger 775 * does not see 'current_address' so we need to trigger
776 * the update here. */ 776 * the update here. */LOG (GNUNET_ERROR_TYPE_DEBUG,
777 LOG (GNUNET_ERROR_TYPE_DEBUG,
778 "Disconnecting peer `%s'.\n", 777 "Disconnecting peer `%s'.\n",
779 GNUNET_i2s (peer)); 778 GNUNET_i2s (peer));
780 s->env->bandwidth_changed_cb (s->env->cls, 779 s->env->bandwidth_changed_cb (s->env->cls,
diff --git a/src/ats/test_ats_api.c b/src/ats/test_ats_api.c
index 0ec1bbdef..390cafe0f 100644
--- a/src/ats/test_ats_api.c
+++ b/src/ats/test_ats_api.c
@@ -45,7 +45,11 @@ static struct Command test_commands[] = {
45 .properties = { 45 .properties = {
46 .scope = GNUNET_NT_LAN 46 .scope = GNUNET_NT_LAN
47 } 47 }
48
49
48 } 50 }
51
52
49 }, 53 },
50 /* 1: adding same address again should fail */ 54 /* 1: adding same address again should fail */
51 { 55 {
@@ -61,6 +65,8 @@ static struct Command test_commands[] = {
61 }, 65 },
62 .expect_fail = 1 66 .expect_fail = 1
63 } 67 }
68
69
64 }, 70 },
65 /* 2: some solver still require explicit start */ 71 /* 2: some solver still require explicit start */
66 { 72 {
@@ -69,6 +75,8 @@ static struct Command test_commands[] = {
69 .details.request_connection_start = { 75 .details.request_connection_start = {
70 .pid = 0 76 .pid = 0
71 } 77 }
78
79
72 }, 80 },
73 /* 3: check we got an address */ 81 /* 3: check we got an address */
74 { 82 {
@@ -76,6 +84,8 @@ static struct Command test_commands[] = {
76 .details.await_address_suggestion = { 84 .details.await_address_suggestion = {
77 .add_label = "add-address-0-0" 85 .add_label = "add-address-0-0"
78 } 86 }
87
88
79 }, 89 },
80 /* 4: check monitor also got the address */ 90 /* 4: check monitor also got the address */
81 { 91 {
@@ -83,6 +93,8 @@ static struct Command test_commands[] = {
83 .details.await_address_information = { 93 .details.await_address_information = {
84 .add_label = "add-address-0-0" 94 .add_label = "add-address-0-0"
85 } 95 }
96
97
86 }, 98 },
87 /* 5: test session API */ 99 /* 5: test session API */
88 { 100 {
@@ -92,12 +104,16 @@ static struct Command test_commands[] = {
92 .add_label = "add-address-0-0", 104 .add_label = "add-address-0-0",
93 .session = 1 105 .session = 1
94 } 106 }
107
108
95 }, 109 },
96 { 110 {
97 .code = CMD_DEL_SESSION, 111 .code = CMD_DEL_SESSION,
98 .details.del_session = { 112 .details.del_session = {
99 .add_session_label = "add-session-0-0-1", 113 .add_session_label = "add-session-0-0-1",
100 } 114 }
115
116
101 }, 117 },
102 /* 7: test preference API */ 118 /* 7: test preference API */
103 { 119 {
@@ -106,6 +122,8 @@ static struct Command test_commands[] = {
106 .pid = 0 122 .pid = 0
107 /* FIXME: preference details */ 123 /* FIXME: preference details */
108 } 124 }
125
126
109 }, 127 },
110 { 128 {
111 .code = CMD_PROVIDE_FEEDBACK, 129 .code = CMD_PROVIDE_FEEDBACK,
@@ -114,6 +132,8 @@ static struct Command test_commands[] = {
114 .scope = { 50LL } 132 .scope = { 50LL }
115 /* FIXME: preference details */ 133 /* FIXME: preference details */
116 } 134 }
135
136
117 }, 137 },
118 /* 9: test sanity check address listing */ 138 /* 9: test sanity check address listing */
119 { 139 {
@@ -126,6 +146,8 @@ static struct Command test_commands[] = {
126 .min_active_calls = 1, 146 .min_active_calls = 1,
127 .max_active_calls = 1 147 .max_active_calls = 1
128 } 148 }
149
150
129 }, 151 },
130 /* 10: remove address testing */ 152 /* 10: remove address testing */
131 { 153 {
@@ -133,6 +155,8 @@ static struct Command test_commands[] = {
133 .details.del_address = { 155 .details.del_address = {
134 .add_label = "add-address-0-0" 156 .add_label = "add-address-0-0"
135 } 157 }
158
159
136 }, 160 },
137 /* 11: check we got disconnected */ 161 /* 11: check we got disconnected */
138 { 162 {
@@ -140,6 +164,8 @@ static struct Command test_commands[] = {
140 .details.await_disconnect_suggestion = { 164 .details.await_disconnect_suggestion = {
141 .pid = 0 165 .pid = 0
142 } 166 }
167
168
143 }, 169 },
144 /* 12: just for symmetry, also stop asking for the connection */ 170 /* 12: just for symmetry, also stop asking for the connection */
145 { 171 {
@@ -147,6 +173,8 @@ static struct Command test_commands[] = {
147 .details.request_connection_stop = { 173 .details.request_connection_stop = {
148 .connect_label = "request-0", 174 .connect_label = "request-0",
149 } 175 }
176
177
150 }, 178 },
151 /* 13: add address again */ 179 /* 13: add address again */
152 { 180 {
@@ -159,7 +187,11 @@ static struct Command test_commands[] = {
159 .properties = { 187 .properties = {
160 .scope = GNUNET_NT_LAN 188 .scope = GNUNET_NT_LAN
161 } 189 }
190
191
162 } 192 }
193
194
163 }, 195 },
164 /* 14: some solver still require explicit start */ 196 /* 14: some solver still require explicit start */
165 { 197 {
@@ -168,6 +200,8 @@ static struct Command test_commands[] = {
168 .details.request_connection_start = { 200 .details.request_connection_start = {
169 .pid = 0 201 .pid = 0
170 } 202 }
203
204
171 }, 205 },
172 /* 15: check we got an address */ 206 /* 15: check we got an address */
173 { 207 {
@@ -175,6 +209,8 @@ static struct Command test_commands[] = {
175 .details.await_address_suggestion = { 209 .details.await_address_suggestion = {
176 .add_label = "add-address-0-0:1" 210 .add_label = "add-address-0-0:1"
177 } 211 }
212
213
178 }, 214 },
179 /* 16: add alternative address */ 215 /* 16: add alternative address */
180 { 216 {
@@ -188,7 +224,11 @@ static struct Command test_commands[] = {
188 .properties = { 224 .properties = {
189 .scope = GNUNET_NT_LAN 225 .scope = GNUNET_NT_LAN
190 } 226 }
227
228
191 } 229 }
230
231
192 }, 232 },
193 /* 17: remove original address */ 233 /* 17: remove original address */
194 { 234 {
@@ -196,6 +236,8 @@ static struct Command test_commands[] = {
196 .details.del_address = { 236 .details.del_address = {
197 .add_label = "add-address-0-0:1" 237 .add_label = "add-address-0-0:1"
198 } 238 }
239
240
199 }, 241 },
200 /* 18: check we switched to alternative address */ 242 /* 18: check we switched to alternative address */
201 { 243 {
@@ -203,6 +245,8 @@ static struct Command test_commands[] = {
203 .details.await_address_suggestion = { 245 .details.await_address_suggestion = {
204 .add_label = "add-address-0-1" 246 .add_label = "add-address-0-1"
205 } 247 }
248
249
206 }, 250 },
207 /* 19: remove alternative address */ 251 /* 19: remove alternative address */
208 { 252 {
@@ -210,6 +254,8 @@ static struct Command test_commands[] = {
210 .details.del_address = { 254 .details.del_address = {
211 .add_label = "add-address-0-1" 255 .add_label = "add-address-0-1"
212 } 256 }
257
258
213 }, 259 },
214 /* 20: check we got disconnected */ 260 /* 20: check we got disconnected */
215 { 261 {
@@ -217,6 +263,8 @@ static struct Command test_commands[] = {
217 .details.await_disconnect_suggestion = { 263 .details.await_disconnect_suggestion = {
218 .pid = 0 264 .pid = 0
219 } 265 }
266
267
220 }, 268 },
221 /* 21: just for symmetry, also stop asking for the connection */ 269 /* 21: just for symmetry, also stop asking for the connection */
222 { 270 {
@@ -224,6 +272,8 @@ static struct Command test_commands[] = {
224 .details.request_connection_stop = { 272 .details.request_connection_stop = {
225 .connect_label = "request-0", 273 .connect_label = "request-0",
226 } 274 }
275
276
227 }, 277 },
228 /* Test ends successfully */ 278 /* Test ends successfully */
229 { 279 {
diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c
index cd512634d..2c4d3f5ad 100644
--- a/src/ats/test_ats_lib.c
+++ b/src/ats/test_ats_lib.c
@@ -146,7 +146,6 @@ static unsigned int off;
146static struct Command *test_commands; 146static struct Command *test_commands;
147 147
148 148
149
150/** 149/**
151 * Free `struct AddressSuggestData` entry. 150 * Free `struct AddressSuggestData` entry.
152 * 151 *
@@ -1104,4 +1103,5 @@ TEST_ATS_run (int argc,
1104 return ret; 1103 return ret;
1105} 1104}
1106 1105
1106
1107/* end of test_ats_lib.c */ 1107/* end of test_ats_lib.c */
diff --git a/src/ats/test_ats_reservation_api.c b/src/ats/test_ats_reservation_api.c
index ff924b3b4..46658007b 100644
--- a/src/ats/test_ats_reservation_api.c
+++ b/src/ats/test_ats_reservation_api.c
@@ -46,7 +46,11 @@ static struct Command test_commands[] = {
46 /* use network with 65k quota! */ 46 /* use network with 65k quota! */
47 .scope = GNUNET_NT_WAN 47 .scope = GNUNET_NT_WAN
48 } 48 }
49
50
49 } 51 }
52
53
50 }, 54 },
51 /* 1: some solver still require explicit start */ 55 /* 1: some solver still require explicit start */
52 { 56 {
@@ -55,6 +59,8 @@ static struct Command test_commands[] = {
55 .details.request_connection_start = { 59 .details.request_connection_start = {
56 .pid = 0 60 .pid = 0
57 } 61 }
62
63
58 }, 64 },
59 /* 2: check we got an address */ 65 /* 2: check we got an address */
60 { 66 {
@@ -62,6 +68,8 @@ static struct Command test_commands[] = {
62 .details.await_address_suggestion = { 68 .details.await_address_suggestion = {
63 .add_label = "add-address-0-0" 69 .add_label = "add-address-0-0"
64 } 70 }
71
72
65 }, 73 },
66 /* 3: sleep 7s, should give us 5s * 64k/s = 320k buffer; 74 /* 3: sleep 7s, should give us 5s * 64k/s = 320k buffer;
67 Note that this depends on MAX_BANDWIDTH_CARRY_S. We 75 Note that this depends on MAX_BANDWIDTH_CARRY_S. We
@@ -79,6 +87,8 @@ static struct Command test_commands[] = {
79 .amount = 128 * 1024, 87 .amount = 128 * 1024,
80 .expected_result = GNUNET_YES 88 .expected_result = GNUNET_YES
81 } 89 }
90
91
82 }, 92 },
83 /* 5: reserve another 192k -- should just work (now exactly pushing the limit) */ 93 /* 5: reserve another 192k -- should just work (now exactly pushing the limit) */
84 { 94 {
@@ -89,6 +99,8 @@ static struct Command test_commands[] = {
89 .amount = 192 * 1024, 99 .amount = 192 * 1024,
90 .expected_result = GNUNET_YES 100 .expected_result = GNUNET_YES
91 } 101 }
102
103
92 }, 104 },
93 /* 6: reserve another 32k -- should now fail (if MAX_BANDWIDTH_CARRY_S 105 /* 6: reserve another 32k -- should now fail (if MAX_BANDWIDTH_CARRY_S
94 is precisely observed) */ 106 is precisely observed) */
@@ -100,6 +112,8 @@ static struct Command test_commands[] = {
100 .amount = 32 * 1024, 112 .amount = 32 * 1024,
101 .expected_result = GNUNET_SYSERR 113 .expected_result = GNUNET_SYSERR
102 } 114 }
115
116
103 }, 117 },
104 /* 7: sleep 3s, should give us 3s * 64k/s - 32k = 160k buffer */ 118 /* 7: sleep 3s, should give us 3s * 64k/s - 32k = 160k buffer */
105 { 119 {
@@ -116,6 +130,8 @@ static struct Command test_commands[] = {
116 .amount = 160 * 1024, 130 .amount = 160 * 1024,
117 .expected_result = GNUNET_YES 131 .expected_result = GNUNET_YES
118 } 132 }
133
134
119 }, 135 },
120 /* 9: remove address */ 136 /* 9: remove address */
121 { 137 {
@@ -123,6 +139,8 @@ static struct Command test_commands[] = {
123 .details.del_address = { 139 .details.del_address = {
124 .add_label = "add-address-0-0" 140 .add_label = "add-address-0-0"
125 } 141 }
142
143
126 }, 144 },
127 /* 10: check we got disconnected */ 145 /* 10: check we got disconnected */
128 { 146 {
@@ -130,6 +148,8 @@ static struct Command test_commands[] = {
130 .details.await_disconnect_suggestion = { 148 .details.await_disconnect_suggestion = {
131 .pid = 0 149 .pid = 0
132 } 150 }
151
152
133 }, 153 },
134 /* 11: just for symmetry, also stop asking for the connection */ 154 /* 11: just for symmetry, also stop asking for the connection */
135 { 155 {
@@ -137,6 +157,8 @@ static struct Command test_commands[] = {
137 .details.request_connection_stop = { 157 .details.request_connection_stop = {
138 .connect_label = "request-0", 158 .connect_label = "request-0",
139 } 159 }
160
161
140 }, 162 },
141 /* Test ends successfully */ 163 /* Test ends successfully */
142 { 164 {
diff --git a/src/auction/gnunet-auction-info.c b/src/auction/gnunet-auction-info.c
index 05bee50ef..5a3587a40 100644
--- a/src/auction/gnunet-auction-info.c
+++ b/src/auction/gnunet-auction-info.c
@@ -82,4 +82,5 @@ main (int argc, char *const *argv)
82 return ret; 82 return ret;
83} 83}
84 84
85
85/* end of gnunet-auction.c */ 86/* end of gnunet-auction.c */
diff --git a/src/auction/gnunet-auction-join.c b/src/auction/gnunet-auction-join.c
index 05bee50ef..5a3587a40 100644
--- a/src/auction/gnunet-auction-join.c
+++ b/src/auction/gnunet-auction-join.c
@@ -82,4 +82,5 @@ main (int argc, char *const *argv)
82 return ret; 82 return ret;
83} 83}
84 84
85
85/* end of gnunet-auction.c */ 86/* end of gnunet-auction.c */
diff --git a/src/auction/test_auction_api.c b/src/auction/test_auction_api.c
index 0ec6f8cc8..1eac9b5c4 100644
--- a/src/auction/test_auction_api.c
+++ b/src/auction/test_auction_api.c
@@ -29,6 +29,7 @@ check ()
29 return 0; 29 return 0;
30} 30}
31 31
32
32int 33int
33main (int argc, char *argv[]) 34main (int argc, char *argv[])
34{ 35{
@@ -39,4 +40,5 @@ main (int argc, char *argv[])
39 return ret; 40 return ret;
40} 41}
41 42
43
42/* end of test_auction_api.c */ 44/* end of test_auction_api.c */
diff --git a/src/block/block.c b/src/block/block.c
index dafba9d8c..5abe64e69 100644
--- a/src/block/block.c
+++ b/src/block/block.c
@@ -121,7 +121,6 @@ add_plugin (void *cls,
121} 121}
122 122
123 123
124
125/** 124/**
126 * Create a block context. Loads the block plugins. 125 * Create a block context. Loads the block plugins.
127 * 126 *
diff --git a/src/block/plugin_block_template.c b/src/block/plugin_block_template.c
index 21b8a9be6..ecd46e364 100644
--- a/src/block/plugin_block_template.c
+++ b/src/block/plugin_block_template.c
@@ -191,4 +191,5 @@ libgnunet_plugin_block_template_done (void *cls)
191 return NULL; 191 return NULL;
192} 192}
193 193
194
194/* end of plugin_block_template.c */ 195/* end of plugin_block_template.c */
diff --git a/src/block/plugin_block_test.c b/src/block/plugin_block_test.c
index b73e58cab..45d54d339 100644
--- a/src/block/plugin_block_test.c
+++ b/src/block/plugin_block_test.c
@@ -205,4 +205,5 @@ libgnunet_plugin_block_test_done (void *cls)
205 return NULL; 205 return NULL;
206} 206}
207 207
208
208/* end of plugin_block_test.c */ 209/* end of plugin_block_test.c */
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 9aeedb616..68bd4c290 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -1121,4 +1121,5 @@ GNUNET_CADET_get_mq (const struct GNUNET_CADET_Channel *channel)
1121 return channel->mq; 1121 return channel->mq;
1122} 1122}
1123 1123
1124
1124/* end of cadet_api.c */ 1125/* end of cadet_api.c */
diff --git a/src/cadet/cadet_api_get_channel.c b/src/cadet/cadet_api_get_channel.c
index 6d86e8e81..05e2a8383 100644
--- a/src/cadet/cadet_api_get_channel.c
+++ b/src/cadet/cadet_api_get_channel.c
@@ -256,4 +256,5 @@ GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm)
256 return ret; 256 return ret;
257} 257}
258 258
259
259/* end of cadet_api_get_channel.c */ 260/* end of cadet_api_get_channel.c */
diff --git a/src/cadet/cadet_api_list_peers.c b/src/cadet/cadet_api_list_peers.c
index 8865b6f57..52f59cc74 100644
--- a/src/cadet/cadet_api_list_peers.c
+++ b/src/cadet/cadet_api_list_peers.c
@@ -234,4 +234,5 @@ GNUNET_CADET_list_peers_cancel (struct GNUNET_CADET_PeersLister *pl)
234 return ret; 234 return ret;
235} 235}
236 236
237
237/* end of cadet_api_list_peers.c */ 238/* end of cadet_api_list_peers.c */
diff --git a/src/cadet/cadet_test_lib.c b/src/cadet/cadet_test_lib.c
index 490e6539b..9c7b9063d 100644
--- a/src/cadet/cadet_test_lib.c
+++ b/src/cadet/cadet_test_lib.c
@@ -372,4 +372,5 @@ GNUNET_CADET_TEST_ruN (const char *testname,
372 ctx); 372 ctx);
373} 373}
374 374
375
375/* end of cadet_test_lib.c */ 376/* end of cadet_test_lib.c */
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c
index e66761e1e..c3a19a399 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -407,6 +407,7 @@ abort_test (long line)
407 } 407 }
408} 408}
409 409
410
410/** 411/**
411 * Stats callback. Finish the stats testbed operation and when all stats have 412 * Stats callback. Finish the stats testbed operation and when all stats have
412 * been iterated, shutdown the test. 413 * been iterated, shutdown the test.
@@ -615,7 +616,7 @@ tmt_rdy_pong (void *cls, size_t size, void *buf)
615 struct CadetPingMessage *ping = cls; 616 struct CadetPingMessage *ping = cls;
616 struct CadetPingMessage *pong; 617 struct CadetPingMessage *pong;
617 618
618 if ((0 == size)||(NULL == buf)) 619 if ((0 == size) || (NULL == buf))
619 { 620 {
620 GNUNET_free (ping); 621 GNUNET_free (ping);
621 return 0; 622 return 0;
@@ -654,6 +655,7 @@ ping (void *cls)
654 &tmt_rdy_ping, peer); 655 &tmt_rdy_ping, peer);
655} 656}
656 657
658
657/** 659/**
658 * @brief Reply with a pong to origin. 660 * @brief Reply with a pong to origin.
659 * 661 *
@@ -691,7 +693,7 @@ tmt_rdy_ping (void *cls, size_t size, void *buf)
691 peer->ping_ntr = NULL; 693 peer->ping_ntr = NULL;
692 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 694 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
693 "tmt_rdy called, filling buffer\n"); 695 "tmt_rdy called, filling buffer\n");
694 if ((size < sizeof(struct CadetPingMessage))||(NULL == buf)) 696 if ((size < sizeof(struct CadetPingMessage)) || (NULL == buf))
695 { 697 {
696 GNUNET_break (GNUNET_YES == test_finished); 698 GNUNET_break (GNUNET_YES == test_finished);
697 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 699 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -857,6 +859,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
857 return NULL; 859 return NULL;
858} 860}
859 861
862
860/** 863/**
861 * Function called whenever an inbound channel is destroyed. Should clean up 864 * Function called whenever an inbound channel is destroyed. Should clean up
862 * any associated state. 865 * any associated state.
@@ -903,6 +906,7 @@ select_random_peer (struct CadetPeer *peer)
903 return &peers[r]; 906 return &peers[r];
904} 907}
905 908
909
906/** 910/**
907 * START THE TEST ITSELF, AS WE ARE CONNECTED TO THE CADET SERVICES. 911 * START THE TEST ITSELF, AS WE ARE CONNECTED TO THE CADET SERVICES.
908 * 912 *
@@ -999,7 +1003,7 @@ peer_id_cb (void *cls,
999{ 1003{
1000 long n = (long) cls; 1004 long n = (long) cls;
1001 1005
1002 if ((NULL == pinfo)||(NULL != emsg)) 1006 if ((NULL == pinfo) || (NULL != emsg))
1003 { 1007 {
1004 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "pi_cb: %s\n", emsg); 1008 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "pi_cb: %s\n", emsg);
1005 abort_test (__LINE__); 1009 abort_test (__LINE__);
@@ -1151,4 +1155,5 @@ main (int argc, char *argv[])
1151 return 0; 1155 return 0;
1152} 1156}
1153 1157
1158
1154/* end of gnunet-cadet-profiler.c */ 1159/* end of gnunet-cadet-profiler.c */
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index d85a3c6ba..f3ccd9883 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -265,6 +265,7 @@ shutdown_task (void *cls)
265 } 265 }
266} 266}
267 267
268
268void 269void
269mq_cb (void *cls) 270mq_cb (void *cls)
270{ 271{
@@ -676,7 +677,7 @@ run (void *cls,
676 if (target_id && args[1]) 677 if (target_id && args[1])
677 target_port = args[1]; 678 target_port = args[1];
678 679
679 if (((0 != (request_peers | request_tunnels))||(NULL != conn_id)|| 680 if (((0 != (request_peers | request_tunnels)) || (NULL != conn_id) ||
680 (NULL != channel_id) ) && 681 (NULL != channel_id) ) &&
681 (target_id != NULL) ) 682 (target_id != NULL) )
682 { 683 {
@@ -846,4 +847,5 @@ main (int argc, char *const *argv)
846 return 1; 847 return 1;
847} 848}
848 849
850
849/* end of gnunet-cadet.c */ 851/* end of gnunet-cadet.c */
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c
index c64da33e2..ba83fe0fc 100644
--- a/src/cadet/gnunet-service-cadet.c
+++ b/src/cadet/gnunet-service-cadet.c
@@ -688,9 +688,7 @@ check_local_data (void *cls,
688 ONE payload item or multiple? Seems current cadet_api 688 ONE payload item or multiple? Seems current cadet_api
689 at least in theory allows more than one. Next-gen 689 at least in theory allows more than one. Next-gen
690 cadet_api will likely no more, so we could then 690 cadet_api will likely no more, so we could then
691 simplify this mess again. */ 691 simplify this mess again. *//* Sanity check for message size */payload_size = ntohs (msg->header.size) - sizeof(*msg);
692 /* Sanity check for message size */
693 payload_size = ntohs (msg->header.size) - sizeof(*msg);
694 buf = (const char *) &msg[1]; 692 buf = (const char *) &msg[1];
695 while (payload_size >= sizeof(struct GNUNET_MessageHeader)) 693 while (payload_size >= sizeof(struct GNUNET_MessageHeader))
696 { 694 {
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 0a261039c..a2c710cbc 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -1238,8 +1238,7 @@ GCCH_handle_channel_plaintext_data (
1238 * - The channel is out-of-order 1238 * - The channel is out-of-order
1239 * - The channel is reliable and MID matches next expected MID 1239 * - The channel is reliable and MID matches next expected MID
1240 * - The channel is unreliable and MID is before lowest seen MID 1240 * - The channel is unreliable and MID is before lowest seen MID
1241 */ 1241 */if ((GNUNET_YES == ch->out_of_order) ||
1242 if ((GNUNET_YES == ch->out_of_order) ||
1243 ((msg->mid.mid == ch->mid_recv.mid) && (GNUNET_YES == ch->reliable)) || 1242 ((msg->mid.mid == ch->mid_recv.mid) && (GNUNET_YES == ch->reliable)) ||
1244 ((GNUNET_NO == ch->reliable) && 1243 ((GNUNET_NO == ch->reliable) &&
1245 (ntohl (msg->mid.mid) >= ntohl (ch->mid_recv.mid)) && 1244 (ntohl (msg->mid.mid) >= ntohl (ch->mid_recv.mid)) &&
@@ -1415,8 +1414,7 @@ GCCH_handle_channel_plaintext_data (
1415 the case above if "delta" >= 64, which could be the case if 1414 the case above if "delta" >= 64, which could be the case if
1416 max_pending_messages is also >= 64 or if our client is unready 1415 max_pending_messages is also >= 64 or if our client is unready
1417 and we are seeing retransmissions of the message our client is 1416 and we are seeing retransmissions of the message our client is
1418 blocked on. */ 1417 blocked on. */LOG (GNUNET_ERROR_TYPE_DEBUG,
1419 LOG (GNUNET_ERROR_TYPE_DEBUG,
1420 "Duplicate payload of %u bytes on %s (mid %u) dropped\n", 1418 "Duplicate payload of %u bytes on %s (mid %u) dropped\n",
1421 (unsigned int) payload_size, 1419 (unsigned int) payload_size,
1422 GCCH_2s (ch), 1420 GCCH_2s (ch),
diff --git a/src/cadet/gnunet-service-cadet_channel.h b/src/cadet/gnunet-service-cadet_channel.h
index 181c6e88b..0a6c97329 100644
--- a/src/cadet/gnunet-service-cadet_channel.h
+++ b/src/cadet/gnunet-service-cadet_channel.h
@@ -183,7 +183,6 @@ GCCH_handle_duplicate_open (struct CadetChannel *ch,
183 GNUNET_CADET_ConnectionTunnelIdentifier *cti); 183 GNUNET_CADET_ConnectionTunnelIdentifier *cti);
184 184
185 185
186
187/** 186/**
188 * We got payload data for a channel. Pass it on to the client. 187 * We got payload data for a channel. Pass it on to the client.
189 * 188 *
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 66dc20481..c07339ebc 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -1053,4 +1053,5 @@ GCC_debug (struct CadetConnection *cc, enum GNUNET_ErrorType level)
1053#endif 1053#endif
1054} 1054}
1055 1055
1056
1056/* end of gnunet-service-cadet_connection.c */ 1057/* end of gnunet-service-cadet_connection.c */
diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c
index 7d1791f3c..d54022896 100644
--- a/src/cadet/gnunet-service-cadet_core.c
+++ b/src/cadet/gnunet-service-cadet_core.c
@@ -1333,4 +1333,5 @@ GCO_shutdown ()
1333 } 1333 }
1334} 1334}
1335 1335
1336
1336/* end of gnunet-cadet-service_core.c */ 1337/* end of gnunet-cadet-service_core.c */
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c
index 3bb86cae4..4e8ccbb08 100644
--- a/src/cadet/gnunet-service-cadet_dht.c
+++ b/src/cadet/gnunet-service-cadet_dht.c
@@ -349,4 +349,5 @@ GCD_search_stop (struct GCD_search_handle *h)
349 GNUNET_free (h); 349 GNUNET_free (h);
350} 350}
351 351
352
352/* end of gnunet-service-cadet_dht.c */ 353/* end of gnunet-service-cadet_dht.c */
diff --git a/src/cadet/gnunet-service-cadet_hello.c b/src/cadet/gnunet-service-cadet_hello.c
index bbe947ad1..21870a454 100644
--- a/src/cadet/gnunet-service-cadet_hello.c
+++ b/src/cadet/gnunet-service-cadet_hello.c
@@ -146,4 +146,5 @@ GCH_get_mine (void)
146 return mine; 146 return mine;
147} 147}
148 148
149
149/* end of gnunet-service-cadet-new_hello.c */ 150/* end of gnunet-service-cadet-new_hello.c */
diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c
index e4a8dc789..087515a5e 100644
--- a/src/cadet/gnunet-service-cadet_paths.c
+++ b/src/cadet/gnunet-service-cadet_paths.c
@@ -156,7 +156,6 @@ GCPP_add_connection (struct CadetPeerPath *path,
156} 156}
157 157
158 158
159
160/** 159/**
161 * Notify @a path that it is no longer used for connection @a cc which 160 * Notify @a path that it is no longer used for connection @a cc which
162 * ended at the path's offset @a off. 161 * ended at the path's offset @a off.
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index 52a0c2bd3..8258881d0 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -1250,6 +1250,7 @@ GCP_iterate_paths (struct CadetPeer *cp,
1250 return ret; 1250 return ret;
1251} 1251}
1252 1252
1253
1253/** 1254/**
1254 * Iterate over the paths to a peer without direct link. 1255 * Iterate over the paths to a peer without direct link.
1255 * 1256 *
@@ -1552,6 +1553,4 @@ GCP_send_ooo (struct CadetPeer *cp,
1552} 1553}
1553 1554
1554 1555
1555
1556
1557/* end of gnunet-service-cadet-new_peer.c */ 1556/* end of gnunet-service-cadet-new_peer.c */
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c
index 6f2dd1d8d..d7c7f278e 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.c
+++ b/src/cadet/gnunet-service-cadet_tunnels.c
@@ -1922,6 +1922,7 @@ test_crypto_bug (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1,
1922 check_ed (e2, d1); 1922 check_ed (e2, d1);
1923} 1923}
1924 1924
1925
1925#endif 1926#endif
1926 1927
1927 1928
@@ -2064,7 +2065,6 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
2064} 2065}
2065 2066
2066 2067
2067
2068/* ************************************** end core crypto ***************************** */ 2068/* ************************************** end core crypto ***************************** */
2069 2069
2070 2070
@@ -2828,8 +2828,7 @@ maintain_connections_cb (void *cls)
2828 restarted after that happens). 2828 restarted after that happens).
2829 Furthermore, if the paths we do know are in a reasonably narrow 2829 Furthermore, if the paths we do know are in a reasonably narrow
2830 quality band and are plentyful, we might also consider us stabilized 2830 quality band and are plentyful, we might also consider us stabilized
2831 and then reduce the frequency accordingly. */ 2831 and then reduce the frequency accordingly. */delay = GNUNET_TIME_UNIT_MINUTES;
2832 delay = GNUNET_TIME_UNIT_MINUTES;
2833 t->maintain_connections_task 2832 t->maintain_connections_task
2834 = GNUNET_SCHEDULER_add_delayed (delay, 2833 = GNUNET_SCHEDULER_add_delayed (delay,
2835 &maintain_connections_cb, 2834 &maintain_connections_cb,
@@ -3398,8 +3397,7 @@ GCT_handle_encrypted (struct CadetTConnection *ct,
3398 this increment if we successfully decrypted with the old KX 3397 this increment if we successfully decrypted with the old KX
3399 material and thus didn't even both with the new one. This is 3398 material and thus didn't even both with the new one. This is
3400 the ideal case, as a malicious injection of bogus KX data 3399 the ideal case, as a malicious injection of bogus KX data
3401 basically only causes us to increment a counter a few times. */ 3400 basically only causes us to increment a counter a few times. */t->unverified_attempts++;
3402 t->unverified_attempts++;
3403 LOG (GNUNET_ERROR_TYPE_DEBUG, 3401 LOG (GNUNET_ERROR_TYPE_DEBUG,
3404 "Failed to decrypt message with unverified KX data %u times\n", 3402 "Failed to decrypt message with unverified KX data %u times\n",
3405 t->unverified_attempts); 3403 t->unverified_attempts);
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index 354593c4b..25713709c 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -263,7 +263,7 @@ static unsigned int msg_dropped;
263static struct GNUNET_CADET_Channel * 263static struct GNUNET_CADET_Channel *
264get_target_channel () 264get_target_channel ()
265{ 265{
266 if ((SPEED == test)&&(GNUNET_YES == test_backwards)) 266 if ((SPEED == test) && (GNUNET_YES == test_backwards))
267 return outgoing_ch; 267 return outgoing_ch;
268 else 268 else
269 return incoming_ch; 269 return incoming_ch;
@@ -383,7 +383,7 @@ stats_cont (void *cls,
383 "KA sent: %u, KA received: %u\n", 383 "KA sent: %u, KA received: %u\n",
384 ka_sent, 384 ka_sent,
385 ka_received); 385 ka_received);
386 if (((KEEPALIVE == test)||(REOPEN == test)) && 386 if (((KEEPALIVE == test) || (REOPEN == test)) &&
387 ((ka_sent < 2) || (ka_sent > ka_received + 1))) 387 ((ka_sent < 2) || (ka_sent > ka_received + 1)))
388 { 388 {
389 GNUNET_break (0); 389 GNUNET_break (0);
@@ -426,10 +426,10 @@ stats_iterator (void *cls,
426 i = GNUNET_TESTBED_get_index (peer); 426 i = GNUNET_TESTBED_get_index (peer);
427 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i, 427 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i,
428 subsystem, name, (unsigned long long) value); 428 subsystem, name, (unsigned long long) value);
429 if ((0 == strncmp (s_sent, name, strlen (s_sent)))&&(0 == i)) 429 if ((0 == strncmp (s_sent, name, strlen (s_sent))) && (0 == i))
430 ka_sent = value; 430 ka_sent = value;
431 if ((0 == strncmp (s_recv, name, strlen (s_recv)))&&(peers_requested - 1 == 431 if ((0 == strncmp (s_recv, name, strlen (s_recv))) && (peers_requested - 1 ==
432 i) ) 432 i) )
433 ka_received = value; 433 ka_received = value;
434 if (0 == strncmp (rdrops, name, strlen (rdrops))) 434 if (0 == strncmp (rdrops, name, strlen (rdrops)))
435 msg_dropped += value; 435 msg_dropped += value;
@@ -556,6 +556,7 @@ reconnect_op (void *cls)
556 send_test_message (outgoing_ch); 556 send_test_message (outgoing_ch);
557} 557}
558 558
559
559/** 560/**
560 * Function called whenever an MQ-channel is destroyed, unless the destruction 561 * Function called whenever an MQ-channel is destroyed, unless the destruction
561 * was requested by #GNUNET_CADET_channel_destroy. 562 * was requested by #GNUNET_CADET_channel_destroy.
@@ -594,14 +595,14 @@ disconnect_handler (void *cls,
594 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 595 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
595 "Unknown channel! %p\n", 596 "Unknown channel! %p\n",
596 channel); 597 channel);
597 if ((NULL != disconnect_task)&&(REOPEN != test)) 598 if ((NULL != disconnect_task) && (REOPEN != test))
598 { 599 {
599 GNUNET_SCHEDULER_cancel (disconnect_task); 600 GNUNET_SCHEDULER_cancel (disconnect_task);
600 disconnect_task = 601 disconnect_task =
601 GNUNET_SCHEDULER_add_now (&gather_stats_and_exit, 602 GNUNET_SCHEDULER_add_now (&gather_stats_and_exit,
602 (void *) __LINE__); 603 (void *) __LINE__);
603 } 604 }
604 else if ((NULL != reconnect_task)&&(REOPEN == test)) 605 else if ((NULL != reconnect_task) && (REOPEN == test))
605 { 606 {
606 GNUNET_SCHEDULER_cancel (reconnect_task); 607 GNUNET_SCHEDULER_cancel (reconnect_task);
607 reconnect_task = 608 reconnect_task =
@@ -661,7 +662,7 @@ send_test_message (struct GNUNET_CADET_Channel *channel)
661 if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer 662 if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer
662 data_sent++; 663 data_sent++;
663 } 664 }
664 else if ((SPEED == test)||(SPEED_ACK == test)) 665 else if ((SPEED == test) || (SPEED_ACK == test))
665 { 666 {
666 if (get_target_channel () == channel) 667 if (get_target_channel () == channel)
667 { 668 {
@@ -860,7 +861,7 @@ handle_data (void *cls,
860 if (get_target_channel () == channel) /* Got "data" */ 861 if (get_target_channel () == channel) /* Got "data" */
861 { 862 {
862 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received data %u\n", data_received); 863 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received data %u\n", data_received);
863 if ((SPEED != test) ||( (ok_goal - 2) == ok) ) 864 if ((SPEED != test) || ( (ok_goal - 2) == ok) )
864 { 865 {
865 /* Send ACK */ 866 /* Send ACK */
866 send_test_message (channel); 867 send_test_message (channel);
@@ -874,14 +875,14 @@ handle_data (void *cls,
874 } 875 }
875 else /* Got "ack" */ 876 else /* Got "ack" */
876 { 877 {
877 if ((SPEED_ACK == test) ||(SPEED == test) ) 878 if ((SPEED_ACK == test) || (SPEED == test) )
878 { 879 {
879 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received); 880 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received);
880 /* Send more data */ 881 /* Send more data */
881 send_test_message (channel); 882 send_test_message (channel);
882 if ((ack_received < total_packets) &&(SPEED != test) ) 883 if ((ack_received < total_packets) && (SPEED != test) )
883 return; 884 return;
884 if ((ok == 2) &&(SPEED == test) ) 885 if ((ok == 2) && (SPEED == test) )
885 return; 886 return;
886 show_end_data (); 887 show_end_data ();
887 } 888 }
@@ -946,7 +947,7 @@ connect_handler (void *cls,
946 (long) cls); 947 (long) cls);
947 GNUNET_assert (0); 948 GNUNET_assert (0);
948 } 949 }
949 if ((NULL != disconnect_task)&&(REOPEN != test)) 950 if ((NULL != disconnect_task) && (REOPEN != test))
950 { 951 {
951 GNUNET_SCHEDULER_cancel (disconnect_task); 952 GNUNET_SCHEDULER_cancel (disconnect_task);
952 disconnect_task = GNUNET_SCHEDULER_add_delayed (short_time, 953 disconnect_task = GNUNET_SCHEDULER_add_delayed (short_time,
@@ -1223,8 +1224,7 @@ main (int argc, char *argv[])
1223 * total_packets received data packet (@dest) 1224 * total_packets received data packet (@dest)
1224 * total_packets received data packet (@orig) 1225 * total_packets received data packet (@orig)
1225 * 1 received channel destroy (@dest) FIXME #5818 1226 * 1 received channel destroy (@dest) FIXME #5818
1226 */ 1227 */ok_goal = total_packets * 2 + 2;
1227 ok_goal = total_packets * 2 + 2;
1228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED_ACK\n"); 1228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED_ACK\n");
1229 test = SPEED_ACK; 1229 test = SPEED_ACK;
1230 test_name = "speed ack"; 1230 test_name = "speed ack";
@@ -1237,8 +1237,7 @@ main (int argc, char *argv[])
1237 * total_packets received data packet (@dest) 1237 * total_packets received data packet (@dest)
1238 * 1 received data packet (@orig) 1238 * 1 received data packet (@orig)
1239 * 1 received channel destroy (@dest) FIXME #5818 1239 * 1 received channel destroy (@dest) FIXME #5818
1240 */ 1240 */ok_goal = total_packets + 4;
1241 ok_goal = total_packets + 4;
1242 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n"); 1241 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n");
1243 if (strstr (argv[0], "_reliable") != NULL) 1242 if (strstr (argv[0], "_reliable") != NULL)
1244 { 1243 {
@@ -1260,8 +1259,7 @@ main (int argc, char *argv[])
1260 * 1 incoming channel (@dest) 1259 * 1 incoming channel (@dest)
1261 * [wait] 1260 * [wait]
1262 * 1 received channel destroy (@dest) FIXME #5818 1261 * 1 received channel destroy (@dest) FIXME #5818
1263 */ 1262 */ok_goal = 1;
1264 ok_goal = 1;
1265 } 1263 }
1266 else if (strstr (argv[0], "_reopen") != NULL) 1264 else if (strstr (argv[0], "_reopen") != NULL)
1267 { 1265 {
@@ -1313,4 +1311,5 @@ main (int argc, char *argv[])
1313 return 0; 1311 return 0;
1314} 1312}
1315 1313
1314
1316/* end of test_cadet.c */ 1315/* end of test_cadet.c */
diff --git a/src/cadet/test_cadet_flow.c b/src/cadet/test_cadet_flow.c
index 94e1f1c85..2fbdd8d50 100644
--- a/src/cadet/test_cadet_flow.c
+++ b/src/cadet/test_cadet_flow.c
@@ -333,10 +333,10 @@ stats_iterator (void *cls,
333 i = GNUNET_TESTBED_get_index (peer); 333 i = GNUNET_TESTBED_get_index (peer);
334 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i, 334 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i,
335 subsystem, name, (unsigned long long) value); 335 subsystem, name, (unsigned long long) value);
336 if ((0 == strncmp (s_sent, name, strlen (s_sent)))&&(0 == i)) 336 if ((0 == strncmp (s_sent, name, strlen (s_sent))) && (0 == i))
337 ka_sent = value; 337 ka_sent = value;
338 if ((0 == strncmp (s_recv, name, strlen (s_recv)))&&(peers_requested - 1 == 338 if ((0 == strncmp (s_recv, name, strlen (s_recv))) && (peers_requested - 1 ==
339 i) ) 339 i) )
340 ka_received = value; 340 ka_received = value;
341 if (0 == strncmp (rdrops, name, strlen (rdrops))) 341 if (0 == strncmp (rdrops, name, strlen (rdrops)))
342 msg_dropped += value; 342 msg_dropped += value;
@@ -425,7 +425,7 @@ send_test_message (struct GNUNET_CADET_Channel *channel)
425 if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer 425 if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer
426 data_sent++; 426 data_sent++;
427 } 427 }
428 else if ((SPEED == test)||(SPEED_ACK == test)) 428 else if ((SPEED == test) || (SPEED_ACK == test))
429 { 429 {
430 if (get_target_channel () == channel) 430 if (get_target_channel () == channel)
431 { 431 {
@@ -577,14 +577,14 @@ handle_data (void *cls,
577 } 577 }
578 else /* Got "ack" */ 578 else /* Got "ack" */
579 { 579 {
580 if ((SPEED_ACK == test) ||(SPEED == test) ) 580 if ((SPEED_ACK == test) || (SPEED == test) )
581 { 581 {
582 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received); 582 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received);
583 /* Send more data */ 583 /* Send more data */
584 send_test_message (channel); 584 send_test_message (channel);
585 if ((ack_received < total_packets) &&(SPEED != test) ) 585 if ((ack_received < total_packets) && (SPEED != test) )
586 return; 586 return;
587 if ((ok == 2) &&(SPEED == test) ) 587 if ((ok == 2) && (SPEED == test) )
588 return; 588 return;
589 show_end_data (); 589 show_end_data ();
590 } 590 }
@@ -887,4 +887,5 @@ main (int argc,
887 return 0; 887 return 0;
888} 888}
889 889
890
890/* end of test_cadet_flow.c */ 891/* end of test_cadet_flow.c */
diff --git a/src/cadet/test_cadet_local_mq.c b/src/cadet/test_cadet_local_mq.c
index c56b510ae..6f75dfd1f 100644
--- a/src/cadet/test_cadet_local_mq.c
+++ b/src/cadet/test_cadet_local_mq.c
@@ -131,6 +131,7 @@ do_abort (void *cls)
131 GNUNET_SCHEDULER_shutdown (); 131 GNUNET_SCHEDULER_shutdown ();
132} 132}
133 133
134
134/** 135/**
135 * Method called whenever a peer connects to a port in MQ-based CADET. 136 * Method called whenever a peer connects to a port in MQ-based CADET.
136 * 137 *
@@ -155,6 +156,7 @@ connected (void *cls,
155 return channel; 156 return channel;
156} 157}
157 158
159
158/** 160/**
159 * Function called whenever an MQ-channel is destroyed, even if the destruction 161 * Function called whenever an MQ-channel is destroyed, even if the destruction
160 * was requested by #GNUNET_CADET_channel_destroy. 162 * was requested by #GNUNET_CADET_channel_destroy.
@@ -332,4 +334,5 @@ main (int argc, char *argv[])
332 return (result == GNUNET_OK) ? 0 : 1; 334 return (result == GNUNET_OK) ? 0 : 1;
333} 335}
334 336
337
335/* end of test_cadet_local_1.c */ 338/* end of test_cadet_local_1.c */
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c
index c4350adaf..06b4c88ef 100644
--- a/src/consensus/consensus_api.c
+++ b/src/consensus/consensus_api.c
@@ -259,6 +259,7 @@ idc_adapter (void *cls)
259 GNUNET_free (i); 259 GNUNET_free (i);
260} 260}
261 261
262
262/** 263/**
263 * Insert an element in the set being reconsiled. Must not be called after 264 * Insert an element in the set being reconsiled. Must not be called after
264 * "GNUNET_CONSENSUS_conclude". 265 * "GNUNET_CONSENSUS_conclude".
@@ -344,4 +345,5 @@ GNUNET_CONSENSUS_destroy (struct GNUNET_CONSENSUS_Handle *consensus)
344 GNUNET_free (consensus); 345 GNUNET_free (consensus);
345} 346}
346 347
348
347/* end of consensus_api.c */ 349/* end of consensus_api.c */
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 8ef70eee8..160d352d7 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -100,7 +100,6 @@ struct TaskKey
100}; 100};
101 101
102 102
103
104struct SetKey 103struct SetKey
105{ 104{
106 int set_kind GNUNET_PACKED; 105 int set_kind GNUNET_PACKED;
@@ -403,7 +402,6 @@ struct SetHandle
403}; 402};
404 403
405 404
406
407/** 405/**
408 * A consensus session consists of one local client and the remote authorities. 406 * A consensus session consists of one local client and the remote authorities.
409 */ 407 */
@@ -590,6 +588,7 @@ setname (uint16_t kind)
590 } 588 }
591} 589}
592 590
591
593static const char * 592static const char *
594rfnname (uint16_t kind) 593rfnname (uint16_t kind)
595{ 594{
@@ -605,6 +604,7 @@ rfnname (uint16_t kind)
605 } 604 }
606} 605}
607 606
607
608static const char * 608static const char *
609diffname (uint16_t kind) 609diffname (uint16_t kind)
610{ 610{
@@ -622,6 +622,7 @@ diffname (uint16_t kind)
622 } 622 }
623} 623}
624 624
625
625#ifdef GNUNET_EXTRA_LOGGING 626#ifdef GNUNET_EXTRA_LOGGING
626 627
627 628
@@ -635,6 +636,7 @@ debug_str_element (const struct GNUNET_SET_Element *el)
635 return GNUNET_h2s (&hash); 636 return GNUNET_h2s (&hash);
636} 637}
637 638
639
638static const char * 640static const char *
639debug_str_task_key (struct TaskKey *tk) 641debug_str_task_key (struct TaskKey *tk)
640{ 642{
@@ -648,6 +650,7 @@ debug_str_task_key (struct TaskKey *tk)
648 return buf; 650 return buf;
649} 651}
650 652
653
651static const char * 654static const char *
652debug_str_diff_key (struct DiffKey *dk) 655debug_str_diff_key (struct DiffKey *dk)
653{ 656{
@@ -660,6 +663,7 @@ debug_str_diff_key (struct DiffKey *dk)
660 return buf; 663 return buf;
661} 664}
662 665
666
663static const char * 667static const char *
664debug_str_set_key (const struct SetKey *sk) 668debug_str_set_key (const struct SetKey *sk)
665{ 669{
@@ -685,6 +689,7 @@ debug_str_rfn_key (const struct RfnKey *rk)
685 return buf; 689 return buf;
686} 690}
687 691
692
688#endif /* GNUNET_EXTRA_LOGGING */ 693#endif /* GNUNET_EXTRA_LOGGING */
689 694
690 695
@@ -1192,6 +1197,7 @@ set_result_cb (void *cls,
1192 } 1197 }
1193} 1198}
1194 1199
1200
1195#ifdef EVIL 1201#ifdef EVIL
1196 1202
1197enum EvilnessType 1203enum EvilnessType
@@ -1349,6 +1355,7 @@ cleanup:
1349 free (evil_subtype_str); 1355 free (evil_subtype_str);
1350} 1356}
1351 1357
1358
1352#endif 1359#endif
1353 1360
1354 1361
@@ -1538,6 +1545,7 @@ put_diff (struct ConsensusSession *session,
1538 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 1545 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
1539} 1546}
1540 1547
1548
1541static void 1549static void
1542put_set (struct ConsensusSession *session, 1550put_set (struct ConsensusSession *session,
1543 struct SetEntry *set) 1551 struct SetEntry *set)
@@ -1570,7 +1578,6 @@ put_rfn (struct ConsensusSession *session,
1570} 1578}
1571 1579
1572 1580
1573
1574static void 1581static void
1575task_cancel_reconcile (struct TaskEntry *task) 1582task_cancel_reconcile (struct TaskEntry *task)
1576{ 1583{
@@ -1676,6 +1683,8 @@ diff_destroy (struct DiffEntry *diff)
1676 GNUNET_CONTAINER_multihashmap_destroy (diff->changes); 1683 GNUNET_CONTAINER_multihashmap_destroy (diff->changes);
1677 GNUNET_free (diff); 1684 GNUNET_free (diff);
1678} 1685}
1686
1687
1679#endif 1688#endif
1680 1689
1681 1690
@@ -1882,7 +1891,6 @@ finish_step (struct Step *step)
1882} 1891}
1883 1892
1884 1893
1885
1886/** 1894/**
1887 * Apply the result from one round of gradecasts (i.e. every peer 1895 * Apply the result from one round of gradecasts (i.e. every peer
1888 * should have gradecasted) to the peer's current set. 1896 * should have gradecasted) to the peer's current set.
@@ -2326,8 +2334,7 @@ task_start_eval_echo (struct TaskEntry *task)
2326 can't simply send "nothing" for the value. Thus we mark our 'confirm' 2334 can't simply send "nothing" for the value. Thus we mark our 'confirm'
2327 reconciliation as contested. Other peers might not know that the 2335 reconciliation as contested. Other peers might not know that the
2328 leader is faulty, thus we still re-distribute in the confirmation 2336 leader is faulty, thus we still re-distribute in the confirmation
2329 round. */ 2337 round. */output_set->is_contested = GNUNET_YES;
2330 output_set->is_contested = GNUNET_YES;
2331 } 2338 }
2332 2339
2333 switch (majority_vote) 2340 switch (majority_vote)
@@ -2387,6 +2394,7 @@ task_start_finish (struct TaskEntry *task)
2387 task); 2394 task);
2388} 2395}
2389 2396
2397
2390static void 2398static void
2391start_task (struct ConsensusSession *session, struct TaskEntry *task) 2399start_task (struct ConsensusSession *session, struct TaskEntry *task)
2392{ 2400{
@@ -2403,8 +2411,6 @@ start_task (struct ConsensusSession *session, struct TaskEntry *task)
2403} 2411}
2404 2412
2405 2413
2406
2407
2408/* 2414/*
2409 * Run all steps of the session that don't any 2415 * Run all steps of the session that don't any
2410 * more dependencies. 2416 * more dependencies.
@@ -2452,7 +2458,6 @@ run_ready_steps (struct ConsensusSession *session)
2452} 2458}
2453 2459
2454 2460
2455
2456static void 2461static void
2457finish_task (struct TaskEntry *task) 2462finish_task (struct TaskEntry *task)
2458{ 2463{
@@ -2703,7 +2708,6 @@ set_listen_cb (void *cls,
2703} 2708}
2704 2709
2705 2710
2706
2707static void 2711static void
2708put_task (struct GNUNET_CONTAINER_MultiHashMap *taskmap, 2712put_task (struct GNUNET_CONTAINER_MultiHashMap *taskmap,
2709 struct TaskEntry *t) 2713 struct TaskEntry *t)
@@ -2754,7 +2758,6 @@ install_step_timeouts (struct ConsensusSession *session)
2754} 2758}
2755 2759
2756 2760
2757
2758/* 2761/*
2759 * Arrange two peers in some canonical order. 2762 * Arrange two peers in some canonical order.
2760 */ 2763 */
@@ -3134,7 +3137,6 @@ construct_task_graph (struct ConsensusSession *session)
3134 step = NULL; 3137 step = NULL;
3135 3138
3136 3139
3137
3138 /* Byzantine union */ 3140 /* Byzantine union */
3139 3141
3140 /* sequential repetitions of the gradecasts */ 3142 /* sequential repetitions of the gradecasts */
@@ -3193,7 +3195,6 @@ construct_task_graph (struct ConsensusSession *session)
3193} 3195}
3194 3196
3195 3197
3196
3197/** 3198/**
3198 * Check join message. 3199 * Check join message.
3199 * 3200 *
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c
index 1caf4fc39..fb6da5bcd 100644
--- a/src/consensus/plugin_block_consensus.c
+++ b/src/consensus/plugin_block_consensus.c
@@ -134,4 +134,5 @@ libgnunet_plugin_block_consensus_done (void *cls)
134 return NULL; 134 return NULL;
135} 135}
136 136
137
137/* end of plugin_block_consensus.c */ 138/* end of plugin_block_consensus.c */
diff --git a/src/consensus/test_consensus_api.c b/src/consensus/test_consensus_api.c
index d32bc06ed..235a67484 100644
--- a/src/consensus/test_consensus_api.c
+++ b/src/consensus/test_consensus_api.c
@@ -44,6 +44,7 @@ conclude_done (void *cls)
44 GNUNET_SCHEDULER_shutdown (); 44 GNUNET_SCHEDULER_shutdown ();
45} 45}
46 46
47
47static void 48static void
48on_new_element (void *cls, 49on_new_element (void *cls,
49 const struct GNUNET_SET_Element *element) 50 const struct GNUNET_SET_Element *element)
@@ -51,6 +52,7 @@ on_new_element (void *cls,
51 elements_received++; 52 elements_received++;
52} 53}
53 54
55
54static void 56static void
55insert_done (void *cls, int success) 57insert_done (void *cls, int success)
56{ 58{
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c
index eb070e56e..daf51042a 100644
--- a/src/conversation/conversation_api.c
+++ b/src/conversation/conversation_api.c
@@ -62,7 +62,6 @@ enum CallerState
62}; 62};
63 63
64 64
65
66/** 65/**
67 * A caller is the handle we have for an incoming call. 66 * A caller is the handle we have for an incoming call.
68 */ 67 */
@@ -867,4 +866,5 @@ GNUNET_CONVERSATION_caller_resume (struct GNUNET_CONVERSATION_Caller *caller,
867 } 866 }
868} 867}
869 868
869
870/* end of conversation_api.c */ 870/* end of conversation_api.c */
diff --git a/src/conversation/gnunet-conversation-test.c b/src/conversation/gnunet-conversation-test.c
index c03723fc3..307b55435 100644
--- a/src/conversation/gnunet-conversation-test.c
+++ b/src/conversation/gnunet-conversation-test.c
@@ -261,4 +261,5 @@ main (int argc,
261 return ret; 261 return ret;
262} 262}
263 263
264
264/* end of gnunet-conversation-test.c */ 265/* end of gnunet-conversation-test.c */
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
index 0b04ba38e..6c0a6e42f 100644
--- a/src/conversation/gnunet-conversation.c
+++ b/src/conversation/gnunet-conversation.c
@@ -258,8 +258,7 @@ phone_event_handler (void *cls,
258 ring_my_bell(); 258 ring_my_bell();
259 * 259 *
260 * see https://gstreamer.freedesktop.org/documentation/application-development/highlevel/playback-components.html on how to play a wav using the gst framework being used here 260 * see https://gstreamer.freedesktop.org/documentation/application-development/highlevel/playback-components.html on how to play a wav using the gst framework being used here
261 */ 261 */fprintf (
262 fprintf (
263 stdout, 262 stdout,
264 _ ( 263 _ (
265 "Incoming call from `%s'. Please /accept %u or /cancel %u the call.\n"), 264 "Incoming call from `%s'. Please /accept %u or /cancel %u the call.\n"),
@@ -1229,4 +1228,5 @@ main (int argc, char *const *argv)
1229 return (GNUNET_OK == ret) ? 0 : 1; 1228 return (GNUNET_OK == ret) ? 0 : 1;
1230} 1229}
1231 1230
1231
1232/* end of gnunet-conversation.c */ 1232/* end of gnunet-conversation.c */
diff --git a/src/conversation/gnunet-helper-audio-playback.c b/src/conversation/gnunet-helper-audio-playback.c
index d7e1cd036..dfa400d71 100644
--- a/src/conversation/gnunet-helper-audio-playback.c
+++ b/src/conversation/gnunet-helper-audio-playback.c
@@ -262,6 +262,7 @@ write_wav_header ()
262 return ! ret ? -1 : 16; 262 return ! ret ? -1 : 16;
263} 263}
264 264
265
265#endif 266#endif
266 267
267 268
@@ -397,7 +398,7 @@ ogg_demux_and_decode ()
397 { 398 {
398 /*OggOpus streams are identified by a magic string in the initial 399 /*OggOpus streams are identified by a magic string in the initial
399 stream header.*/ 400 stream header.*/
400 if (op.b_o_s &&(op.bytes >= 8) && ! memcmp (op.packet, "OpusHead", 8)) 401 if (op.b_o_s && (op.bytes >= 8) && ! memcmp (op.packet, "OpusHead", 8))
401 { 402 {
402 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 403 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
403 "Got Opus Header\n"); 404 "Got Opus Header\n");
@@ -418,7 +419,7 @@ ogg_demux_and_decode ()
418 } 419 }
419 if (! has_opus_stream) 420 if (! has_opus_stream)
420 { 421 {
421 if ((packet_count > 0) &&(opus_serialno == os.serialno) ) 422 if ((packet_count > 0) && (opus_serialno == os.serialno) )
422 { 423 {
423 fprintf (stderr, 424 fprintf (stderr,
424 "\nError: Apparent chaining without changing serial number (%" 425 "\nError: Apparent chaining without changing serial number (%"
@@ -443,7 +444,7 @@ ogg_demux_and_decode ()
443 (int64_t) os.serialno); 444 (int64_t) os.serialno);
444 } 445 }
445 } 446 }
446 if (! has_opus_stream ||(os.serialno != opus_serialno) ) 447 if (! has_opus_stream || (os.serialno != opus_serialno) )
447 { 448 {
448 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 449 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
449 "breaking out\n"); 450 "breaking out\n");
@@ -458,9 +459,9 @@ ogg_demux_and_decode ()
458 if (! dec) 459 if (! dec)
459 quit (1); 460 quit (1);
460 461
461 if ((0 != ogg_stream_packetout (&os, &op)) ||(255 == 462 if ((0 != ogg_stream_packetout (&os, &op)) || (255 ==
462 og.header[og.header_len 463 og.header[og.header_len
463 - 1]) ) 464 - 1]) )
464 { 465 {
465 /*The format specifies that the initial header and tags packets are on their 466 /*The format specifies that the initial header and tags packets are on their
466 own pages. To aid implementors in discovering that their files are wrong 467 own pages. To aid implementors in discovering that their files are wrong
@@ -490,9 +491,9 @@ ogg_demux_and_decode ()
490 else if (1 == packet_count) 491 else if (1 == packet_count)
491 { 492 {
492 has_tags_packet = 1; 493 has_tags_packet = 1;
493 if ((0 != ogg_stream_packetout (&os, &op)) ||(255 == 494 if ((0 != ogg_stream_packetout (&os, &op)) || (255 ==
494 og.header[og.header_len 495 og.header[og.header_len
495 - 1]) ) 496 - 1]) )
496 { 497 {
497 fprintf (stderr, 498 fprintf (stderr,
498 "Extra packets on initial tags page. Invalid stream.\n"); 499 "Extra packets on initial tags page. Invalid stream.\n");
@@ -506,7 +507,7 @@ ogg_demux_and_decode ()
506 int64_t outsamp; 507 int64_t outsamp;
507 508
508 /*End of stream condition*/ 509 /*End of stream condition*/
509 if (op.e_o_s &&(os.serialno == opus_serialno) ) 510 if (op.e_o_s && (os.serialno == opus_serialno) )
510 { 511 {
511 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 512 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
512 "Got EOS\n"); 513 "Got EOS\n");
diff --git a/src/conversation/gnunet-helper-audio-record-gst.c b/src/conversation/gnunet-helper-audio-record-gst.c
index a3607014e..883dd9eea 100644
--- a/src/conversation/gnunet-helper-audio-record-gst.c
+++ b/src/conversation/gnunet-helper-audio-record-gst.c
@@ -108,6 +108,7 @@ quit ()
108 gst_element_set_state (pipeline, GST_STATE_NULL); 108 gst_element_set_state (pipeline, GST_STATE_NULL);
109} 109}
110 110
111
111static gboolean 112static gboolean
112bus_call (GstBus *bus, GstMessage *msg, gpointer data) 113bus_call (GstBus *bus, GstMessage *msg, gpointer data)
113{ 114{
@@ -141,6 +142,7 @@ bus_call (GstBus *bus, GstMessage *msg, gpointer data)
141 return TRUE; 142 return TRUE;
142} 143}
143 144
145
144void 146void
145source_child_added (GstChildProxy *child_proxy, GObject *object, gchar *name, 147source_child_added (GstChildProxy *child_proxy, GObject *object, gchar *name,
146 gpointer user_data) 148 gpointer user_data)
@@ -150,6 +152,7 @@ source_child_added (GstChildProxy *child_proxy, GObject *object, gchar *name,
150 (gint64) LATENCY_TIME, NULL); 152 (gint64) LATENCY_TIME, NULL);
151} 153}
152 154
155
153static void 156static void
154signalhandler (int s) 157signalhandler (int s)
155{ 158{
diff --git a/src/conversation/gnunet-helper-audio-record.c b/src/conversation/gnunet-helper-audio-record.c
index 16311cf69..633030a64 100644
--- a/src/conversation/gnunet-helper-audio-record.c
+++ b/src/conversation/gnunet-helper-audio-record.c
@@ -774,6 +774,7 @@ ogg_init ()
774 } 774 }
775} 775}
776 776
777
777/** 778/**
778 * The main function for the record helper. 779 * The main function for the record helper.
779 * 780 *
diff --git a/src/conversation/gnunet_gst.c b/src/conversation/gnunet_gst.c
index 7703215bb..d776189cd 100644
--- a/src/conversation/gnunet_gst.c
+++ b/src/conversation/gnunet_gst.c
@@ -62,6 +62,7 @@ BREAKOUT:
62 return; 62 return;
63} 63}
64 64
65
65/*** 66/***
66 * load gnunet configuration 67 * load gnunet configuration
67 */ 68 */
@@ -142,6 +143,7 @@ gg_load_configuration (GNUNET_gstData *d)
142// GNUNET_CONFIGURATION_write(cfg, "mediahelper.conf"); 143// GNUNET_CONFIGURATION_write(cfg, "mediahelper.conf");
143} 144}
144 145
146
145static void 147static void
146write_data (const char *ptr, size_t msg_size) 148write_data (const char *ptr, size_t msg_size)
147{ 149{
@@ -163,7 +165,6 @@ write_data (const char *ptr, size_t msg_size)
163} 165}
164 166
165 167
166
167extern GstFlowReturn 168extern GstFlowReturn
168on_appsink_new_sample (GstElement *element, GNUNET_gstData *d) 169on_appsink_new_sample (GstElement *element, GNUNET_gstData *d)
169{ 170{
@@ -179,9 +180,7 @@ on_appsink_new_sample (GstElement *element, GNUNET_gstData *d)
179 char *si_str; 180 char *si_str;
180 GstCaps *s_caps; 181 GstCaps *s_caps;
181 char *caps_str; 182 char *caps_str;
182 */ 183 */if (gst_app_sink_is_eos (GST_APP_SINK (element)))
183
184 if (gst_app_sink_is_eos (GST_APP_SINK (element)))
185 return GST_FLOW_OK; 184 return GST_FLOW_OK;
186 185
187 // pull sample from appsink 186 // pull sample from appsink
@@ -198,7 +197,6 @@ on_appsink_new_sample (GstElement *element, GNUNET_gstData *d)
198 GST_WARNING ("caps are %" GST_PTR_FORMAT, gst_sample_get_caps (s)); 197 GST_WARNING ("caps are %" GST_PTR_FORMAT, gst_sample_get_caps (s));
199 198
200 199
201
202 gst_buffer_map (b, &map, GST_MAP_READ); 200 gst_buffer_map (b, &map, GST_MAP_READ);
203 201
204 size_t len; 202 size_t len;
@@ -226,6 +224,7 @@ on_appsink_new_sample (GstElement *element, GNUNET_gstData *d)
226 return GST_FLOW_OK; 224 return GST_FLOW_OK;
227} 225}
228 226
227
229/*** 228/***
230 * Dump a pipeline graph 229 * Dump a pipeline graph
231 */ 230 */
@@ -248,7 +247,6 @@ pl_graph (GstElement *pipeline)
248} 247}
249 248
250 249
251
252extern gboolean 250extern gboolean
253gnunet_gst_bus_call (GstBus *bus, GstMessage *msg, gpointer data) 251gnunet_gst_bus_call (GstBus *bus, GstMessage *msg, gpointer data)
254{ 252{
@@ -286,6 +284,7 @@ gnunet_gst_bus_call (GstBus *bus, GstMessage *msg, gpointer data)
286 return TRUE; 284 return TRUE;
287} 285}
288 286
287
289/* called when pipeline changes state */ 288/* called when pipeline changes state */
290extern void 289extern void
291state_changed_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *d) 290state_changed_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *d)
@@ -326,6 +325,7 @@ state_changed_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *d)
326 } 325 }
327} 326}
328 327
328
329static void 329static void
330application_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) 330application_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
331{ 331{
@@ -333,6 +333,7 @@ application_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
333 return; 333 return;
334} 334}
335 335
336
336static void 337static void
337error_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) 338error_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
338{ 339{
@@ -340,6 +341,7 @@ error_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
340 return; 341 return;
341} 342}
342 343
344
343static void 345static void
344eos_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) 346eos_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
345{ 347{
@@ -347,6 +349,7 @@ eos_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data)
347 return; 349 return;
348} 350}
349 351
352
350extern void 353extern void
351gg_setup_gst_bus (GNUNET_gstData *d) 354gg_setup_gst_bus (GNUNET_gstData *d)
352{ 355{
@@ -367,6 +370,7 @@ gg_setup_gst_bus (GNUNET_gstData *d)
367 gst_object_unref (bus); 370 gst_object_unref (bus);
368} 371}
369 372
373
370/* 374/*
371 * take buffer from gstreamer and feed it to gnunet 375 * take buffer from gstreamer and feed it to gnunet
372 */ 376 */
@@ -543,7 +547,6 @@ feed_buffer_to_gst (const char *audio, size_t b_len, GNUNET_gstData *d)
543} 547}
544 548
545 549
546
547/** 550/**
548 * debug making elements 551 * debug making elements
549 */ 552 */
@@ -567,6 +570,7 @@ gst_element_factory_make_debug (gchar *factoryname, gchar *name)
567 } 570 }
568} 571}
569 572
573
570/* 574/*
571 static gboolean 575 static gboolean
572 gst_element_link_many_debug(...) 576 gst_element_link_many_debug(...)
@@ -585,6 +589,7 @@ lf (char *msg)
585 exit (10); 589 exit (10);
586} 590}
587 591
592
588/*** 593/***
589 * used to set properties on autoaudiosink's chosen sink 594 * used to set properties on autoaudiosink's chosen sink
590 */ 595 */
@@ -601,6 +606,7 @@ autoaudiosink_child_added (GstChildProxy *child_proxy,
601 NULL); 606 NULL);
602} 607}
603 608
609
604/*** 610/***
605 * used to set properties on autoaudiosource's chosen sink 611 * used to set properties on autoaudiosource's chosen sink
606 */ 612 */
@@ -624,6 +630,7 @@ get_pipeline (GstElement *element)
624 return GST_ELEMENT (p); 630 return GST_ELEMENT (p);
625} 631}
626 632
633
627static void 634static void
628decoder_ogg_pad_added (GstElement *element, 635decoder_ogg_pad_added (GstElement *element,
629 GstPad *pad, 636 GstPad *pad,
@@ -682,6 +689,7 @@ gnunet_read (GNUNET_gstData *d)
682 return 0; 689 return 0;
683} 690}
684 691
692
685/** 693/**
686 * Message callback 694 * Message callback
687 * 695 *
@@ -802,6 +810,7 @@ get_app (GNUNET_gstData *d, int type)
802 return bin; 810 return bin;
803} 811}
804 812
813
805extern GstBin * 814extern GstBin *
806get_coder (GNUNET_gstData *d, int type) 815get_coder (GNUNET_gstData *d, int type)
807{ 816{
@@ -824,8 +833,7 @@ get_coder (GNUNET_gstData *d, int type)
824 "sprop-stereo", G_TYPE_STRING, "0", 833 "sprop-stereo", G_TYPE_STRING, "0",
825 "encoding-params", G_TYPE_STRING, "2", 834 "encoding-params", G_TYPE_STRING, "2",
826 NULL); 835 NULL);
827 */ 836 */ rtpcaps = gst_caps_new_simple ("application/x-rtp",
828 rtpcaps = gst_caps_new_simple ("application/x-rtp",
829 "media", G_TYPE_STRING, "audio", 837 "media", G_TYPE_STRING, "audio",
830 "clock-rate", G_TYPE_INT, SAMPLING_RATE, 838 "clock-rate", G_TYPE_INT, SAMPLING_RATE,
831 "encoding-name", G_TYPE_STRING, "OPUS", 839 "encoding-name", G_TYPE_STRING, "OPUS",
@@ -1013,8 +1021,7 @@ get_audiobin (GNUNET_gstData *d, int type)
1013 "enough-data", 1021 "enough-data",
1014 G_CALLBACK(appsrc_enough_data), 1022 G_CALLBACK(appsrc_enough_data),
1015 NULL); 1023 NULL);
1016 */ 1024 *//*
1017/*
1018 g_signal_connect (queue, 1025 g_signal_connect (queue,
1019 "notify::current-level-bytes", 1026 "notify::current-level-bytes",
1020 G_CALLBACK(queue_current_level), 1027 G_CALLBACK(queue_current_level),
@@ -1039,11 +1046,7 @@ get_audiobin (GNUNET_gstData *d, int type)
1039 "pushing", 1046 "pushing",
1040 G_CALLBACK(queue_pushing), 1047 G_CALLBACK(queue_pushing),
1041 NULL); 1048 NULL);
1042 */ 1049 */ }
1043 }
1044
1045
1046
1047 1050
1048 1051
1049 gst_bin_add_many (bin, conv, resampler, sink, NULL); 1052 gst_bin_add_many (bin, conv, resampler, sink, NULL);
diff --git a/src/conversation/gnunet_gst_def.h b/src/conversation/gnunet_gst_def.h
index bbadc5f92..7bfcc5e53 100644
--- a/src/conversation/gnunet_gst_def.h
+++ b/src/conversation/gnunet_gst_def.h
@@ -84,7 +84,6 @@
84// static struct AudioMessage *audio_message; 84// static struct AudioMessage *audio_message;
85 85
86 86
87
88typedef struct GNUNET_gstData GNUNET_gstData; 87typedef struct GNUNET_gstData GNUNET_gstData;
89struct GNUNET_gstData 88struct GNUNET_gstData
90{ 89{
@@ -106,8 +105,6 @@ struct GNUNET_gstData
106}; 105};
107 106
108 107
109
110
111#define DEBUG_READ_PURE_OGG 1 108#define DEBUG_READ_PURE_OGG 1
112#define DEBUG_RECORD_PURE_OGG 1 109#define DEBUG_RECORD_PURE_OGG 1
113 110
diff --git a/src/conversation/gnunet_gst_test.c b/src/conversation/gnunet_gst_test.c
index 884b0fe83..98054797c 100644
--- a/src/conversation/gnunet_gst_test.c
+++ b/src/conversation/gnunet_gst_test.c
@@ -34,7 +34,6 @@ main (int argc, char *argv[])
34 GstElement *gnunetsrc, *gnunetsink, *source, *sink, *encoder, *decoder; 34 GstElement *gnunetsrc, *gnunetsink, *source, *sink, *encoder, *decoder;
35 35
36 36
37
38 // audio_message = GNUNET_malloc (UINT16_MAX); 37 // audio_message = GNUNET_malloc (UINT16_MAX);
39 // audio_message->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO); 38 // audio_message->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO);
40 39
@@ -51,9 +50,7 @@ main (int argc, char *argv[])
51 gst->audiobackend = JACK; 50 gst->audiobackend = JACK;
52 gst->dropsilence = TRUE; 51 gst->dropsilence = TRUE;
53 gst->usertp = FALSE; 52 gst->usertp = FALSE;
54 */ 53 *//* Initialize GStreamer */gst_init (&argc, &argv);
55 /* Initialize GStreamer */
56 gst_init (&argc, &argv);
57 54
58 gst->pipeline = GST_PIPELINE (gst_pipeline_new ("gnunet-media-helper")); 55 gst->pipeline = GST_PIPELINE (gst_pipeline_new ("gnunet-media-helper"));
59 56
@@ -118,8 +115,7 @@ main (int argc, char *argv[])
118 GstFlowReturn flow; 115 GstFlowReturn flow;
119 flow = on_appsink_new_sample (gst->appsink, gst); 116 flow = on_appsink_new_sample (gst->appsink, gst);
120 } 117 }
121 */ 118 */}
122 }
123 if (type == SPEAKER) 119 if (type == SPEAKER)
124 { 120 {
125 while (1) 121 while (1)
diff --git a/src/conversation/microphone.c b/src/conversation/microphone.c
index 5ab115c1f..a4a40796f 100644
--- a/src/conversation/microphone.c
+++ b/src/conversation/microphone.c
@@ -196,4 +196,5 @@ GNUNET_MICROPHONE_destroy (struct GNUNET_MICROPHONE_Handle *microphone)
196 GNUNET_free (microphone); 196 GNUNET_free (microphone);
197} 197}
198 198
199
199/* end of microphone.c */ 200/* end of microphone.c */
diff --git a/src/conversation/plugin_gnsrecord_conversation.c b/src/conversation/plugin_gnsrecord_conversation.c
index 9f7299c15..2ea2f48f0 100644
--- a/src/conversation/plugin_gnsrecord_conversation.c
+++ b/src/conversation/plugin_gnsrecord_conversation.c
@@ -258,4 +258,5 @@ libgnunet_plugin_gnsrecord_conversation_done (void *cls)
258 return NULL; 258 return NULL;
259} 259}
260 260
261
261/* end of plugin_gnsrecord_conversation.c */ 262/* end of plugin_gnsrecord_conversation.c */
diff --git a/src/conversation/speaker.c b/src/conversation/speaker.c
index 8703f269d..38eb1159c 100644
--- a/src/conversation/speaker.c
+++ b/src/conversation/speaker.c
@@ -185,4 +185,5 @@ GNUNET_SPEAKER_destroy (struct GNUNET_SPEAKER_Handle *speaker)
185 GNUNET_free (speaker); 185 GNUNET_free (speaker);
186} 186}
187 187
188
188/* end of speaker.c */ 189/* end of speaker.c */
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c
index 66b800304..2b717367a 100644
--- a/src/conversation/test_conversation_api.c
+++ b/src/conversation/test_conversation_api.c
@@ -501,4 +501,5 @@ main (int argc, char *argv[])
501 return ok; 501 return ok;
502} 502}
503 503
504
504/* end of test_conversation_api.c */ 505/* end of test_conversation_api.c */
diff --git a/src/conversation/test_conversation_api_reject.c b/src/conversation/test_conversation_api_reject.c
index 53f700890..62e4109b0 100644
--- a/src/conversation/test_conversation_api_reject.c
+++ b/src/conversation/test_conversation_api_reject.c
@@ -354,4 +354,5 @@ main (int argc, char *argv[])
354 return ok; 354 return ok;
355} 355}
356 356
357
357/* end of test_conversation_api_reject.c */ 358/* end of test_conversation_api_reject.c */
diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c
index 71f97b1d7..fab49f7d7 100644
--- a/src/conversation/test_conversation_api_twocalls.c
+++ b/src/conversation/test_conversation_api_twocalls.c
@@ -633,4 +633,5 @@ main (int argc, char *argv[])
633 return 1; 633 return 1;
634} 634}
635 635
636
636/* end of test_conversation_api_twocalls.c */ 637/* end of test_conversation_api_twocalls.c */
diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c
index 0d991f194..90777a7a8 100644
--- a/src/core/gnunet-core.c
+++ b/src/core/gnunet-core.c
@@ -204,4 +204,5 @@ main (int argc, char *const *argv)
204 return 1; 204 return 1;
205} 205}
206 206
207
207/* end of gnunet-core.c */ 208/* end of gnunet-core.c */
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 3828460dc..04e6d0141 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -501,8 +501,7 @@ handle_client_send (void *cls, const struct SendMessage *sm)
501 * (which triggered removal of the 'car') and now the client gives us a message 501 * (which triggered removal of the 'car') and now the client gives us a message
502 * just *before* the client learns about the disconnect. Theoretically, we 502 * just *before* the client learns about the disconnect. Theoretically, we
503 * might also now be *again* connected. So this can happen (but should be 503 * might also now be *again* connected. So this can happen (but should be
504 * rare). If it does happen, the message is discarded. */ 504 * rare). If it does happen, the message is discarded. */GNUNET_STATISTICS_update (GSC_stats,
505 GNUNET_STATISTICS_update (GSC_stats,
506 gettext_noop ( 505 gettext_noop (
507 "# messages discarded (session disconnected)"), 506 "# messages discarded (session disconnected)"),
508 1, 507 1,
@@ -806,8 +805,7 @@ GSC_CLIENTS_deliver_message (const struct GNUNET_PeerIdentity *sender,
806 and a 99% chance of being kept if we are at the soft max. 805 and a 99% chance of being kept if we are at the soft max.
807 The reason is to make it more likely to drop control traffic 806 The reason is to make it more likely to drop control traffic
808 (ACK, queries) which may be cummulative or highly redundant, 807 (ACK, queries) which may be cummulative or highly redundant,
809 and cheap to drop than data traffic. */ 808 and cheap to drop than data traffic. */qlen = GNUNET_MQ_get_length (c->mq);
810 qlen = GNUNET_MQ_get_length (c->mq);
811 if ((qlen >= HARD_MAX_QUEUE) || 809 if ((qlen >= HARD_MAX_QUEUE) ||
812 ((qlen > SOFT_MAX_QUEUE) && 810 ((qlen > SOFT_MAX_QUEUE) &&
813 ((GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 811 ((GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c
index 503d4600f..6c446fc7c 100644
--- a/src/core/gnunet-service-core_sessions.c
+++ b/src/core/gnunet-service-core_sessions.c
@@ -1039,4 +1039,5 @@ GSC_SESSIONS_done ()
1039 } 1039 }
1040} 1040}
1041 1041
1042
1042/* end of gnunet-service-core_sessions.c */ 1043/* end of gnunet-service-core_sessions.c */
diff --git a/src/core/gnunet-service-core_typemap.c b/src/core/gnunet-service-core_typemap.c
index 645127b99..47235501c 100644
--- a/src/core/gnunet-service-core_typemap.c
+++ b/src/core/gnunet-service-core_typemap.c
@@ -373,4 +373,5 @@ GSC_TYPEMAP_done ()
373 /* nothing to do */ 373 /* nothing to do */
374} 374}
375 375
376
376/* end of gnunet-service-core_typemap.c */ 377/* end of gnunet-service-core_typemap.c */
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index feeea7e9f..dda60215d 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -340,4 +340,5 @@ main (int argc, char *argv1[])
340 return ok; 340 return ok;
341} 341}
342 342
343
343/* end of test_core_api.c */ 344/* end of test_core_api.c */
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index ca0919294..b510e8993 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -531,4 +531,5 @@ main (int argc,
531 return ok; 531 return ok;
532} 532}
533 533
534
534/* end of test_core_api_reliability.c */ 535/* end of test_core_api_reliability.c */
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c
index 77023f573..c2e39cd26 100644
--- a/src/core/test_core_api_send_to_self.c
+++ b/src/core/test_core_api_send_to_self.c
@@ -191,4 +191,5 @@ main (int argc, char *argv[])
191 return ret; 191 return ret;
192} 192}
193 193
194
194/* end of test_core_api_send_to_self.c */ 195/* end of test_core_api_send_to_self.c */
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index f2eda4e7a..3cbe50d72 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -246,4 +246,5 @@ main (int argc,
246 return ret; 246 return ret;
247} 247}
248 248
249
249/* end of test_core_api_start_only.c */ 250/* end of test_core_api_start_only.c */
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index 8d18835ac..67f8bb224 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -434,7 +434,6 @@ disconnect_notify (void *cls,
434} 434}
435 435
436 436
437
438static void 437static void
439handle_test (void *cls, 438handle_test (void *cls,
440 const struct TestMessage *hdr) 439 const struct TestMessage *hdr)
diff --git a/src/curl/curl.c b/src/curl/curl.c
index 98bf67d2e..f0ccd7f19 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -594,8 +594,7 @@ GNUNET_CURL_perform2 (struct GNUNET_CURL_Context *ctx,
594 curl -w "foo%{size_request} -XPOST --data "ABC" $URL 594 curl -w "foo%{size_request} -XPOST --data "ABC" $URL
595 the CURLINFO_REQUEST_SIZE should be the whole size of the request 595 the CURLINFO_REQUEST_SIZE should be the whole size of the request
596 including headers and body. 596 including headers and body.
597 */ 597 */GNUNET_break (size_curl <= size_long);
598 GNUNET_break (size_curl <= size_long);
599 598
600 urd = get_url_benchmark_data (url, (unsigned int) response_code); 599 urd = get_url_benchmark_data (url, (unsigned int) response_code);
601 urd->count++; 600 urd->count++;
@@ -730,4 +729,5 @@ GNUNET_CURL_destructor__ (void)
730 curl_global_cleanup (); 729 curl_global_cleanup ();
731} 730}
732 731
732
733/* end of curl.c */ 733/* end of curl.c */
diff --git a/src/curl/curl_reschedule.c b/src/curl/curl_reschedule.c
index c0dc30c95..a1fe55aa5 100644
--- a/src/curl/curl_reschedule.c
+++ b/src/curl/curl_reschedule.c
@@ -197,4 +197,5 @@ GNUNET_CURL_gnunet_scheduler_reschedule (void *cls)
197 rc->task = GNUNET_SCHEDULER_add_now (&context_task, rc); 197 rc->task = GNUNET_SCHEDULER_add_now (&context_task, rc);
198} 198}
199 199
200
200/* end of curl_reschedule.c */ 201/* end of curl_reschedule.c */
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c
index 1656ac91c..ce3b4c25d 100644
--- a/src/datacache/perf_datacache.c
+++ b/src/datacache/perf_datacache.c
@@ -164,4 +164,5 @@ main (int argc, char *argv[])
164 return ok; 164 return ok;
165} 165}
166 166
167
167/* end of perf_datacache.c */ 168/* end of perf_datacache.c */
diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c
index f176e3568..dbc9cac9c 100644
--- a/src/datacache/plugin_datacache_heap.c
+++ b/src/datacache/plugin_datacache_heap.c
@@ -294,7 +294,6 @@ struct GetContext
294}; 294};
295 295
296 296
297
298/** 297/**
299 * Function called during GET to find matching blocks. 298 * Function called during GET to find matching blocks.
300 * Only matches by type. 299 * Only matches by type.
@@ -590,5 +589,4 @@ libgnunet_plugin_datacache_heap_done (void *cls)
590} 589}
591 590
592 591
593
594/* end of plugin_datacache_heap.c */ 592/* end of plugin_datacache_heap.c */
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c
index c532550ae..09049fde2 100644
--- a/src/datacache/plugin_datacache_postgres.c
+++ b/src/datacache/plugin_datacache_postgres.c
@@ -702,5 +702,4 @@ libgnunet_plugin_datacache_postgres_done (void *cls)
702} 702}
703 703
704 704
705
706/* end of plugin_datacache_postgres.c */ 705/* end of plugin_datacache_postgres.c */
diff --git a/src/datacache/plugin_datacache_template.c b/src/datacache/plugin_datacache_template.c
index edb3b6757..329bfd9a4 100644
--- a/src/datacache/plugin_datacache_template.c
+++ b/src/datacache/plugin_datacache_template.c
@@ -126,7 +126,6 @@ template_plugin_get_random (void *cls,
126} 126}
127 127
128 128
129
130/** 129/**
131 * Iterate over the results that are "close" to a particular key in 130 * Iterate over the results that are "close" to a particular key in
132 * the datacache. "close" is defined as numerically larger than @a 131 * the datacache. "close" is defined as numerically larger than @a
diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c
index 58a03914b..6f6e4eec1 100644
--- a/src/datacache/test_datacache.c
+++ b/src/datacache/test_datacache.c
@@ -191,4 +191,5 @@ main (int argc, char *argv[])
191 return ok; 191 return ok;
192} 192}
193 193
194
194/* end of test_datacache.c */ 195/* end of test_datacache.c */
diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c
index 26a23d632..92807fbe2 100644
--- a/src/datacache/test_datacache_quota.c
+++ b/src/datacache/test_datacache_quota.c
@@ -160,4 +160,5 @@ main (int argc,
160 return ok; 160 return ok;
161} 161}
162 162
163
163/* end of test_datacache_quota.c */ 164/* end of test_datacache_quota.c */
diff --git a/src/datastore/datastore.h b/src/datastore/datastore.h
index ee963b5ef..7af926617 100644
--- a/src/datastore/datastore.h
+++ b/src/datastore/datastore.h
@@ -254,5 +254,4 @@ struct DataMessage
254GNUNET_NETWORK_STRUCT_END 254GNUNET_NETWORK_STRUCT_END
255 255
256 256
257
258#endif 257#endif
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index b10c43944..4537f6efe 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -1241,7 +1241,6 @@ GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h,
1241} 1241}
1242 1242
1243 1243
1244
1245/** 1244/**
1246 * Get a random value from the datastore for content replication. 1245 * Get a random value from the datastore for content replication.
1247 * Returns a single, random value among those with the highest 1246 * Returns a single, random value among those with the highest
diff --git a/src/datastore/gnunet-datastore.c b/src/datastore/gnunet-datastore.c
index 259fa518b..54d087bc4 100644
--- a/src/datastore/gnunet-datastore.c
+++ b/src/datastore/gnunet-datastore.c
@@ -412,7 +412,7 @@ start_insert ()
412 ssize_t len; 412 ssize_t len;
413 413
414 len = GNUNET_DISK_file_read (file_handle, buf, MAGIC_LEN); 414 len = GNUNET_DISK_file_read (file_handle, buf, MAGIC_LEN);
415 if ((len != MAGIC_LEN)||(0 != memcmp (buf, MAGIC_BYTES, MAGIC_LEN))) 415 if ((len != MAGIC_LEN) || (0 != memcmp (buf, MAGIC_BYTES, MAGIC_LEN)))
416 { 416 {
417 fprintf (stderr, _ ("Input file is not of a supported format\n")); 417 fprintf (stderr, _ ("Input file is not of a supported format\n"));
418 return; 418 return;
@@ -504,4 +504,5 @@ main (int argc, char *const *argv)
504 return ret; 504 return ret;
505} 505}
506 506
507
507/* end of gnunet-datastore.c */ 508/* end of gnunet-datastore.c */
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index bd86fdad1..3fc46e19c 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -599,8 +599,7 @@ handle_reserve (void *cls, const struct ReserveMessage *msg)
599 * message happens, the insertion request could be blocked 599 * message happens, the insertion request could be blocked
600 * by less-important content from migration because it is 600 * by less-important content from migration because it is
601 * larger than 1/8th of the overall available space, and 601 * larger than 1/8th of the overall available space, and
602 * we only reserve 1/8th for "fresh" insertions */ 602 * we only reserve 1/8th for "fresh" insertions */GNUNET_log (
603 GNUNET_log (
604 GNUNET_ERROR_TYPE_WARNING, 603 GNUNET_ERROR_TYPE_WARNING,
605 _ ( 604 _ (
606 "The requested amount (%llu bytes) is larger than the cache size (%llu bytes)\n"), 605 "The requested amount (%llu bytes) is larger than the cache size (%llu bytes)\n"),
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index f353d0452..fef38891e 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -625,4 +625,5 @@ main (int argc,
625 return ok; 625 return ok;
626} 626}
627 627
628
628/* end of perf_datastore_api.c */ 629/* end of perf_datastore_api.c */
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c
index a1604d441..d7488d4e7 100644
--- a/src/datastore/perf_plugin_datastore.c
+++ b/src/datastore/perf_plugin_datastore.c
@@ -408,7 +408,6 @@ unload_plugin (struct GNUNET_DATASTORE_PluginFunctions *api,
408} 408}
409 409
410 410
411
412/** 411/**
413 * Last task run during shutdown. Disconnects us from 412 * Last task run during shutdown. Disconnects us from
414 * the transport and core. 413 * the transport and core.
@@ -570,4 +569,5 @@ main (int argc, char *argv[])
570 return ok; 569 return ok;
571} 570}
572 571
572
573/* end of perf_plugin_datastore.c */ 573/* end of perf_plugin_datastore.c */
diff --git a/src/datastore/plugin_datastore_heap.c b/src/datastore/plugin_datastore_heap.c
index 4e48bfd4c..a827a2763 100644
--- a/src/datastore/plugin_datastore_heap.c
+++ b/src/datastore/plugin_datastore_heap.c
@@ -268,6 +268,7 @@ update_iterator (void *cls,
268 return GNUNET_NO; 268 return GNUNET_NO;
269} 269}
270 270
271
271/** 272/**
272 * Store an item in the datastore. 273 * Store an item in the datastore.
273 * 274 *
@@ -939,4 +940,5 @@ libgnunet_plugin_datastore_heap_done (void *cls)
939 return NULL; 940 return NULL;
940} 941}
941 942
943
942/* end of plugin_datastore_heap.c */ 944/* end of plugin_datastore_heap.c */
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index 6aec09c54..15c2fe386 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -920,7 +920,6 @@ struct ExpiCtx
920}; 920};
921 921
922 922
923
924/** 923/**
925 * Wrapper for the processor for #mysql_plugin_get_expiration(). 924 * Wrapper for the processor for #mysql_plugin_get_expiration().
926 * If no expired value was found, we do a second query for 925 * If no expired value was found, we do a second query for
@@ -1200,4 +1199,5 @@ libgnunet_plugin_datastore_mysql_done (void *cls)
1200 return NULL; 1199 return NULL;
1201} 1200}
1202 1201
1202
1203/* end of plugin_datastore_mysql.c */ 1203/* end of plugin_datastore_mysql.c */
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 0811edfd7..eba717226 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -73,8 +73,7 @@ init_connection (struct Plugin *plugin)
73 * we do math or inequality tests, so we can't handle the entire range of uint32_t. 73 * we do math or inequality tests, so we can't handle the entire range of uint32_t.
74 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC. 74 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC.
75 * PostgreSQL also recommends against using WITH OIDS. 75 * PostgreSQL also recommends against using WITH OIDS.
76 */ 76 */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 ("
77 GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 ("
78 " repl INTEGER NOT NULL DEFAULT 0," 77 " repl INTEGER NOT NULL DEFAULT 0,"
79 " type INTEGER NOT NULL DEFAULT 0," 78 " type INTEGER NOT NULL DEFAULT 0,"
80 " prio INTEGER NOT NULL DEFAULT 0," 79 " prio INTEGER NOT NULL DEFAULT 0,"
@@ -970,4 +969,5 @@ libgnunet_plugin_datastore_postgres_done (void *cls)
970 return NULL; 969 return NULL;
971} 970}
972 971
972
973/* end of plugin_datastore_postgres.c */ 973/* end of plugin_datastore_postgres.c */
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index b1bb7df7e..b3b30f256 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -349,8 +349,7 @@ database_setup (const struct GNUNET_CONFIGURATION_Handle *cfg,
349 * we only test equality on it and can cast it to/from uint32_t. For repl, prio, and anonLevel 349 * we only test equality on it and can cast it to/from uint32_t. For repl, prio, and anonLevel
350 * we do math or inequality tests, so we can't handle the entire range of uint32_t. 350 * we do math or inequality tests, so we can't handle the entire range of uint32_t.
351 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC. 351 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC.
352 */ 352 */if ((SQLITE_DONE == sqlite3_step (stmt)) &&
353 if ((SQLITE_DONE == sqlite3_step (stmt)) &&
354 (SQLITE_OK != sqlite3_exec (plugin->dbh, 353 (SQLITE_OK != sqlite3_exec (plugin->dbh,
355 "CREATE TABLE gn091 (" 354 "CREATE TABLE gn091 ("
356 " repl INT4 NOT NULL DEFAULT 0," 355 " repl INT4 NOT NULL DEFAULT 0,"
@@ -1350,4 +1349,5 @@ libgnunet_plugin_datastore_sqlite_done (void *cls)
1350 return NULL; 1349 return NULL;
1351} 1350}
1352 1351
1352
1353/* end of plugin_datastore_sqlite.c */ 1353/* end of plugin_datastore_sqlite.c */
diff --git a/src/datastore/plugin_datastore_template.c b/src/datastore/plugin_datastore_template.c
index 1f9a0f416..2b455f8cb 100644
--- a/src/datastore/plugin_datastore_template.c
+++ b/src/datastore/plugin_datastore_template.c
@@ -118,7 +118,6 @@ template_plugin_get_key (void *cls,
118} 118}
119 119
120 120
121
122/** 121/**
123 * Get a random item for replication. Returns a single, not expired, 122 * Get a random item for replication. Returns a single, not expired,
124 * random item from those with the highest replication counters. The 123 * random item from those with the highest replication counters. The
@@ -271,4 +270,5 @@ libgnunet_plugin_datastore_template_done (void *cls)
271 return NULL; 270 return NULL;
272} 271}
273 272
273
274/* end of plugin_datastore_template.c */ 274/* end of plugin_datastore_template.c */
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 93ba46ff8..dbe590bab 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -728,4 +728,5 @@ main (int argc,
728 return ok; 728 return ok;
729} 729}
730 730
731
731/* end of test_datastore_api.c */ 732/* end of test_datastore_api.c */
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c
index e6bacaf6e..7bec0d064 100644
--- a/src/datastore/test_datastore_api_management.c
+++ b/src/datastore/test_datastore_api_management.c
@@ -404,4 +404,5 @@ main (int argc, char *argv[])
404 return ok; 404 return ok;
405} 405}
406 406
407
407/* end of test_datastore_api_management.c */ 408/* end of test_datastore_api_management.c */
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c
index 15fead3b7..9fe2462e7 100644
--- a/src/datastore/test_plugin_datastore.c
+++ b/src/datastore/test_plugin_datastore.c
@@ -154,8 +154,8 @@ do_put (struct CpsRunContext *crc)
154 /* most content is 32k */ 154 /* most content is 32k */
155 size = 32 * 1024; 155 size = 32 * 1024;
156 156
157 if ((0 != i)&&(GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16) == 157 if ((0 != i) && (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16) ==
158 0) ) /* but some of it is less! */ 158 0) ) /* but some of it is less! */
159 size = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 32 * 1024); 159 size = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 32 * 1024);
160 size = size - (size & 7); /* always multiple of 8 */ 160 size = size - (size & 7); /* always multiple of 8 */
161 161
@@ -274,7 +274,6 @@ unload_plugin (struct GNUNET_DATASTORE_PluginFunctions *api,
274} 274}
275 275
276 276
277
278/** 277/**
279 * Last task run during shutdown. Disconnects us from 278 * Last task run during shutdown. Disconnects us from
280 * the transport and core. 279 * the transport and core.
@@ -475,4 +474,5 @@ main (int argc, char *argv[])
475 return ok; 474 return ok;
476} 475}
477 476
477
478/* end of test_plugin_datastore.c */ 478/* end of test_plugin_datastore.c */
diff --git a/src/dht/dht.h b/src/dht/dht.h
index 052a60b99..86f1b9b49 100644
--- a/src/dht/dht.h
+++ b/src/dht/dht.h
@@ -137,7 +137,6 @@ struct GNUNET_DHT_ClientGetResultSeenMessage
137}; 137};
138 138
139 139
140
141/** 140/**
142 * Reply to a GET send from the service to a client. 141 * Reply to a GET send from the service to a client.
143 */ 142 */
diff --git a/src/dht/dht_test_lib.c b/src/dht/dht_test_lib.c
index e18d2ab24..0d382cd74 100644
--- a/src/dht/dht_test_lib.c
+++ b/src/dht/dht_test_lib.c
@@ -213,4 +213,5 @@ GNUNET_DHT_TEST_run (const char *testname,
213 &dht_test_run, ctx); 213 &dht_test_run, ctx);
214} 214}
215 215
216
216/* end of dht_test_lib.c */ 217/* end of dht_test_lib.c */
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index aacd4ac98..c8a1cb735 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -286,4 +286,5 @@ main (int argc, char *const *argv)
286 : 1; 286 : 1;
287} 287}
288 288
289
289/* end of gnunet-dht-get.c */ 290/* end of gnunet-dht-get.c */
diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c
index d0cd4cff1..8dc14e223 100644
--- a/src/dht/gnunet-dht-monitor.c
+++ b/src/dht/gnunet-dht-monitor.c
@@ -284,6 +284,7 @@ run (void *cls,
284 NULL); 284 NULL);
285} 285}
286 286
287
287/** 288/**
288 * Entry point for gnunet-dht-monitor 289 * Entry point for gnunet-dht-monitor
289 * 290 *
@@ -340,4 +341,5 @@ main (int argc, char *const *argv)
340 : 1; 341 : 1;
341} 342}
342 343
344
343/* end of gnunet-dht-monitor.c */ 345/* end of gnunet-dht-monitor.c */
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c
index d8bffbf37..7ee4ec185 100644
--- a/src/dht/gnunet-dht-put.c
+++ b/src/dht/gnunet-dht-put.c
@@ -168,6 +168,7 @@ run (void *cls,
168 NULL); 168 NULL);
169} 169}
170 170
171
171/** 172/**
172 * Entry point for gnunet-dht-put 173 * Entry point for gnunet-dht-put
173 * 174 *
@@ -236,4 +237,5 @@ main (int argc, char *const *argv)
236 : 1; 237 : 1;
237} 238}
238 239
240
239/* end of gnunet-dht-put.c */ 241/* end of gnunet-dht-put.c */
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index 380002deb..2dd49a1b6 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -161,6 +161,4 @@ run (void *cls,
161GDS_DHT_SERVICE_INIT ("dht", &run); 161GDS_DHT_SERVICE_INIT ("dht", &run);
162 162
163 163
164
165
166/* end of gnunet-service-dht.c */ 164/* end of gnunet-service-dht.c */
diff --git a/src/dht/gnunet-service-dht.h b/src/dht/gnunet-service-dht.h
index 2574edc7b..6741efb4e 100644
--- a/src/dht/gnunet-service-dht.h
+++ b/src/dht/gnunet-service-dht.h
@@ -59,7 +59,6 @@ extern struct GNUNET_STATISTICS_Handle *GDS_stats;
59extern struct GNUNET_MessageHeader *GDS_my_hello; 59extern struct GNUNET_MessageHeader *GDS_my_hello;
60 60
61 61
62
63/** 62/**
64 * Handle a reply we've received from another peer. If the reply 63 * Handle a reply we've received from another peer. If the reply
65 * matches any of our pending queries, forward it to the respective 64 * matches any of our pending queries, forward it to the respective
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 932b04d9b..be6e22d01 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -1318,7 +1318,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type,
1318 cl_size = 0; 1318 cl_size = 0;
1319 for (m = monitor_head; NULL != m; m = m->next) 1319 for (m = monitor_head; NULL != m; m = m->next)
1320 { 1320 {
1321 if (((GNUNET_BLOCK_TYPE_ANY == m->type) ||(m->type == type) ) && 1321 if (((GNUNET_BLOCK_TYPE_ANY == m->type) || (m->type == type) ) &&
1322 ((NULL == m->key) || 1322 ((NULL == m->key) ||
1323 (memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) )) 1323 (memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) ))
1324 { 1324 {
@@ -1402,7 +1402,7 @@ GDS_CLIENTS_process_put (uint32_t options,
1402 cl_size = 0; 1402 cl_size = 0;
1403 for (m = monitor_head; NULL != m; m = m->next) 1403 for (m = monitor_head; NULL != m; m = m->next)
1404 { 1404 {
1405 if (((GNUNET_BLOCK_TYPE_ANY == m->type) ||(m->type == type) ) && 1405 if (((GNUNET_BLOCK_TYPE_ANY == m->type) || (m->type == type) ) &&
1406 ((NULL == m->key) || 1406 ((NULL == m->key) ||
1407 (memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) )) 1407 (memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0) ))
1408 { 1408 {
@@ -1540,4 +1540,5 @@ GDS_CLIENTS_done ()
1540 } 1540 }
1541} 1541}
1542 1542
1543
1543/* end of gnunet-service-dht_clients.c */ 1544/* end of gnunet-service-dht_clients.c */
diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c
index e57951ab1..a0141d1fb 100644
--- a/src/dht/gnunet-service-dht_hello.c
+++ b/src/dht/gnunet-service-dht_hello.c
@@ -144,4 +144,5 @@ GDS_HELLO_done ()
144 } 144 }
145} 145}
146 146
147
147/* end of gnunet-service-dht_hello.c */ 148/* end of gnunet-service-dht_hello.c */
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index fe9dd3e9c..c251dfa12 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -907,11 +907,8 @@ get_distance (const struct GNUNET_HashCode *target,
907 * use the highest 2^9 bits of the result to signify the 907 * use the highest 2^9 bits of the result to signify the
908 * number of (mis)matching LSB bits; if we have 0 matching 908 * number of (mis)matching LSB bits; if we have 0 matching
909 * and hence 512 mismatching LSB bits we return -1 (since 909 * and hence 512 mismatching LSB bits we return -1 (since
910 * 512 itself cannot be represented with 9 bits) */ 910 * 512 itself cannot be represented with 9 bits) *//* first, calculate the most significant 9 bits of our
911 911 * result, aka the number of LSBs */bucket = GNUNET_CRYPTO_hash_matching_bits (target,
912 /* first, calculate the most significant 9 bits of our
913 * result, aka the number of LSBs */
914 bucket = GNUNET_CRYPTO_hash_matching_bits (target,
915 have); 912 have);
916 /* bucket is now a value between 0 and 512 */ 913 /* bucket is now a value between 0 and 512 */
917 if (bucket == 512) 914 if (bucket == 512)
diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h
index cdcf30b01..55cc5b135 100644
--- a/src/dht/gnunet-service-dht_neighbours.h
+++ b/src/dht/gnunet-service-dht_neighbours.h
@@ -143,7 +143,6 @@ GDS_am_closest_peer (const struct GNUNET_HashCode *key,
143 const struct GNUNET_CONTAINER_BloomFilter *bloom); 143 const struct GNUNET_CONTAINER_BloomFilter *bloom);
144 144
145 145
146
147/** 146/**
148 * Initialize neighbours subsystem. 147 * Initialize neighbours subsystem.
149 * 148 *
diff --git a/src/dht/gnunet-service-dht_nse.c b/src/dht/gnunet-service-dht_nse.c
index 89107be16..7f411cf71 100644
--- a/src/dht/gnunet-service-dht_nse.c
+++ b/src/dht/gnunet-service-dht_nse.c
@@ -113,4 +113,5 @@ GDS_NSE_done ()
113 } 113 }
114} 114}
115 115
116
116/* end of gnunet-service-dht_nse.c */ 117/* end of gnunet-service-dht_nse.c */
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c
index 3454c1acb..75513f833 100644
--- a/src/dht/gnunet-service-dht_routing.c
+++ b/src/dht/gnunet-service-dht_routing.c
@@ -484,4 +484,5 @@ GDS_ROUTING_done ()
484 recent_map = NULL; 484 recent_map = NULL;
485} 485}
486 486
487
487/* end of gnunet-service-dht_routing.c */ 488/* end of gnunet-service-dht_routing.c */
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 084384146..f213433ed 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -247,4 +247,5 @@ libgnunet_plugin_block_dht_done (void *cls)
247 return NULL; 247 return NULL;
248} 248}
249 249
250
250/* end of plugin_block_dht.c */ 251/* end of plugin_block_dht.c */
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c
index a62ee9668..957c71d7f 100644
--- a/src/dht/test_dht_api.c
+++ b/src/dht/test_dht_api.c
@@ -189,4 +189,5 @@ main (int argc,
189 return ok; 189 return ok;
190} 190}
191 191
192
192/* end of test_dht_api.c */ 193/* end of test_dht_api.c */
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c
index d92095cc6..7f737ea03 100644
--- a/src/dht/test_dht_topo.c
+++ b/src/dht/test_dht_topo.c
@@ -528,4 +528,5 @@ main (int xargc, char *xargv[])
528 return ok; 528 return ok;
529} 529}
530 530
531
531/* end of test_dht_topo.c */ 532/* end of test_dht_topo.c */
diff --git a/src/dns/dns_api.c b/src/dns/dns_api.c
index cd208d820..5969102b9 100644
--- a/src/dns/dns_api.c
+++ b/src/dns/dns_api.c
@@ -146,7 +146,6 @@ mq_error_handler (void *cls,
146} 146}
147 147
148 148
149
150/** 149/**
151 * This receives packets from the DNS service and calls the application to 150 * This receives packets from the DNS service and calls the application to
152 * check that the request is well-formed 151 * check that the request is well-formed
@@ -384,4 +383,5 @@ GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *dh)
384 GNUNET_free (dh); 383 GNUNET_free (dh);
385} 384}
386 385
386
387/* end of dns_api.c */ 387/* end of dns_api.c */
diff --git a/src/dns/gnunet-helper-dns.c b/src/dns/gnunet-helper-dns.c
index eceb278d2..ca3a2532d 100644
--- a/src/dns/gnunet-helper-dns.c
+++ b/src/dns/gnunet-helper-dns.c
@@ -1189,4 +1189,5 @@ cleanup_rest:
1189 return r; 1189 return r;
1190} 1190}
1191 1191
1192
1192/* end of gnunet-helper-dns.c */ 1193/* end of gnunet-helper-dns.c */
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c
index e1cb7a6ff..25fbcf430 100644
--- a/src/dns/gnunet-service-dns.c
+++ b/src/dns/gnunet-service-dns.c
@@ -1267,6 +1267,8 @@ GNUNET_DNS_init ()
1267 strerror (errno)); 1267 strerror (errno));
1268 } 1268 }
1269} 1269}
1270
1271
1270#endif 1272#endif
1271 1273
1272 1274
diff --git a/src/dns/plugin_block_dns.c b/src/dns/plugin_block_dns.c
index fc07a4073..029474b49 100644
--- a/src/dns/plugin_block_dns.c
+++ b/src/dns/plugin_block_dns.c
@@ -232,4 +232,5 @@ libgnunet_plugin_block_dns_done (void *cls)
232 return NULL; 232 return NULL;
233} 233}
234 234
235
235/* end of plugin_block_dns.c */ 236/* end of plugin_block_dns.c */
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index 578997f4a..c479720d4 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -699,7 +699,6 @@ get_redirect_state (int af,
699} 699}
700 700
701 701
702
703/** 702/**
704 * Check a request via cadet to send a request to a TCP service 703 * Check a request via cadet to send a request to a TCP service
705 * offered by this system. 704 * offered by this system.
@@ -3800,7 +3799,7 @@ setup_exit_helper_args ()
3800 GNUNET_CONFIGURATION_get_value_string (cfg, 3799 GNUNET_CONFIGURATION_get_value_string (cfg,
3801 "exit", 3800 "exit",
3802 "IPV6ADDR", 3801 "IPV6ADDR",
3803 &ipv6addr))|| 3802 &ipv6addr)) ||
3804 (1 != inet_pton (AF_INET6, 3803 (1 != inet_pton (AF_INET6,
3805 ipv6addr, 3804 ipv6addr,
3806 &exit_ipv6addr)))) 3805 &exit_ipv6addr))))
@@ -3851,7 +3850,7 @@ setup_exit_helper_args ()
3851 GNUNET_CONFIGURATION_get_value_string (cfg, 3850 GNUNET_CONFIGURATION_get_value_string (cfg,
3852 "exit", 3851 "exit",
3853 "IPV4ADDR", 3852 "IPV4ADDR",
3854 &ipv4addr))|| 3853 &ipv4addr)) ||
3855 (1 != inet_pton (AF_INET, 3854 (1 != inet_pton (AF_INET,
3856 ipv4addr, 3855 ipv4addr,
3857 &exit_ipv4addr)))) 3856 &exit_ipv4addr))))
@@ -3868,7 +3867,7 @@ setup_exit_helper_args ()
3868 GNUNET_CONFIGURATION_get_value_string (cfg, 3867 GNUNET_CONFIGURATION_get_value_string (cfg,
3869 "exit", 3868 "exit",
3870 "IPV4MASK", 3869 "IPV4MASK",
3871 &ipv4mask))|| 3870 &ipv4mask)) ||
3872 (1 != inet_pton (AF_INET, 3871 (1 != inet_pton (AF_INET,
3873 ipv4mask, 3872 ipv4mask,
3874 &exit_ipv4mask)))) 3873 &exit_ipv4mask))))
diff --git a/src/exit/gnunet-helper-exit.c b/src/exit/gnunet-helper-exit.c
index ca187afa6..cf322725d 100644
--- a/src/exit/gnunet-helper-exit.c
+++ b/src/exit/gnunet-helper-exit.c
@@ -813,4 +813,5 @@ cleanup:
813 return global_ret; 813 return global_ret;
814} 814}
815 815
816
816/* end of gnunet-helper-exit.c */ 817/* end of gnunet-helper-exit.c */
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c
index 5dd935d7d..92ae9f595 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -586,4 +586,5 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
586 return GNUNET_YES; 586 return GNUNET_YES;
587} 587}
588 588
589
589/* end of defragmentation.c */ 590/* end of defragmentation.c */
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index f7eb40b42..0228e37ce 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -676,7 +676,6 @@ void *
676GNUNET_FS_make_file_reader_context_ (const char *filename); 676GNUNET_FS_make_file_reader_context_ (const char *filename);
677 677
678 678
679
680/** 679/**
681 * Function that provides data by copying from a buffer. 680 * Function that provides data by copying from a buffer.
682 * 681 *
@@ -799,7 +798,6 @@ void
799GNUNET_FS_download_start_task_ (void *cls); 798GNUNET_FS_download_start_task_ (void *cls);
800 799
801 800
802
803/** 801/**
804 * Fill in all of the generic fields for 802 * Fill in all of the generic fields for
805 * an unindex event and call the callback. 803 * an unindex event and call the callback.
@@ -1064,7 +1062,6 @@ GNUNET_FS_end_top (struct GNUNET_FS_Handle *h,
1064 struct TopLevelActivity *top); 1062 struct TopLevelActivity *top);
1065 1063
1066 1064
1067
1068/** 1065/**
1069 * Master context for most FS operations. 1066 * Master context for most FS operations.
1070 */ 1067 */
diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c
index 5e1e0af5e..1ef5fa3bb 100644
--- a/src/fs/fs_directory.c
+++ b/src/fs/fs_directory.c
@@ -317,6 +317,7 @@ GNUNET_FS_directory_list_contents (size_t size,
317 return GNUNET_OK; 317 return GNUNET_OK;
318} 318}
319 319
320
320/** 321/**
321 * Entries in the directory (builder). 322 * Entries in the directory (builder).
322 */ 323 */
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index e7ea87e50..4d03b6546 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -463,8 +463,7 @@ try_match_block (struct GNUNET_FS_DownloadContext *dc,
463 thus, reconstruction of (some) inner blocks will fail. 463 thus, reconstruction of (some) inner blocks will fail.
464 FIXME: we might eventually want to write a tighter test to 464 FIXME: we might eventually want to write a tighter test to
465 maximize the circumstances under which we do succeed with 465 maximize the circumstances under which we do succeed with
466 IBlock reconstruction. (need good tests though). */ 466 IBlock reconstruction. (need good tests though). */return;
467 return;
468 } 467 }
469 complete = GNUNET_YES; 468 complete = GNUNET_YES;
470 for (i = 0; i < dr->num_children; i++) 469 for (i = 0; i < dr->num_children; i++)
@@ -2285,6 +2284,7 @@ GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc)
2285 dc->job_queue); 2284 dc->job_queue);
2286} 2285}
2287 2286
2287
2288/** 2288/**
2289 * Suspend a download. 2289 * Suspend a download.
2290 * 2290 *
@@ -2414,4 +2414,5 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete)
2414 GNUNET_free (dc); 2414 GNUNET_free (dc);
2415} 2415}
2416 2416
2417
2417/* end of fs_download.c */ 2418/* end of fs_download.c */
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c
index bbbc30a6e..28bbf12dd 100644
--- a/src/fs/fs_file_information.c
+++ b/src/fs/fs_file_information.c
@@ -49,6 +49,7 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s)
49 return s->serialization; 49 return s->serialization;
50} 50}
51 51
52
52/** 53/**
53 * Obtain the filename from the file information structure. 54 * Obtain the filename from the file information structure.
54 * 55 *
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c
index 84c1f6123..43a02a9fa 100644
--- a/src/fs/fs_getopt.c
+++ b/src/fs/fs_getopt.c
@@ -240,6 +240,7 @@ getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
240 return GNUNET_OK; 240 return GNUNET_OK;
241} 241}
242 242
243
243/** 244/**
244 * Allow user to specify metadata. 245 * Allow user to specify metadata.
245 * 246 *
@@ -270,6 +271,4 @@ GNUNET_FS_GETOPT_METADATA (char shortName,
270} 271}
271 272
272 273
273
274
275/* end of fs_getopt.c */ 274/* end of fs_getopt.c */
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index c50e71f0b..2d118ee51 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -320,4 +320,5 @@ GNUNET_FS_publish_ublock_cancel_ (struct GNUNET_FS_PublishUblockContext *uc)
320 GNUNET_free (uc); 320 GNUNET_free (uc);
321} 321}
322 322
323
323/* end of fs_publish_ublock.c */ 324/* end of fs_publish_ublock.c */
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 62ff4e90d..8e2d7deba 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -1831,4 +1831,5 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc)
1831 GNUNET_free (sc); 1831 GNUNET_free (sc);
1832} 1832}
1833 1833
1834
1834/* end of fs_search.c */ 1835/* end of fs_search.c */
diff --git a/src/fs/fs_sharetree.c b/src/fs/fs_sharetree.c
index dab5d00a0..e291938b5 100644
--- a/src/fs/fs_sharetree.c
+++ b/src/fs/fs_sharetree.c
@@ -452,4 +452,5 @@ GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel)
452 GNUNET_free (toplevel); 452 GNUNET_free (toplevel);
453} 453}
454 454
455
455/* end fs_sharetree.c */ 456/* end fs_sharetree.c */
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h
index 87bc90bd6..36244eb19 100644
--- a/src/fs/fs_test_lib.h
+++ b/src/fs/fs_test_lib.h
@@ -99,5 +99,4 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
99 void *cont_cls); 99 void *cont_cls);
100 100
101 101
102
103#endif 102#endif
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 177f151f2..e7f922823 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -459,4 +459,5 @@ GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te,
459 GNUNET_free (te); 459 GNUNET_free (te);
460} 460}
461 461
462
462/* end of fs_tree.c */ 463/* end of fs_tree.c */
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index c35d49312..f2315d7d0 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -897,4 +897,5 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc)
897 GNUNET_free (uc); 897 GNUNET_free (uc);
898} 898}
899 899
900
900/* end of fs_unindex.c */ 901/* end of fs_unindex.c */
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index 7eb9f86b0..c1faf4f12 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -265,6 +265,7 @@ percent_decode_keyword (const char *in, char **emsg)
265 return ret; 265 return ret;
266} 266}
267 267
268
268#define GNUNET_FS_URI_KSK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX 269#define GNUNET_FS_URI_KSK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX
269 270
270/** 271/**
@@ -397,6 +398,7 @@ uri_sks_parse (const char *s, char **emsg)
397 return ret; 398 return ret;
398} 399}
399 400
401
400#define GNUNET_FS_URI_CHK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX 402#define GNUNET_FS_URI_CHK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX
401 403
402 404
@@ -1679,6 +1681,8 @@ get_keywords_from_tokens (const char *s, char **array, int index)
1679 GNUNET_free (ss); 1681 GNUNET_free (ss);
1680 return seps; 1682 return seps;
1681} 1683}
1684
1685
1682#undef TOKENS 1686#undef TOKENS
1683 1687
1684 1688
@@ -1719,8 +1723,7 @@ gather_uri_data (void *cls,
1719 * If given non-utf8 string it will, most likely, find it to be invalid, 1723 * If given non-utf8 string it will, most likely, find it to be invalid,
1720 * and will return the length of its valid part, skipping the keyword. 1724 * and will return the length of its valid part, skipping the keyword.
1721 * If it does - fix the extractor, not this check! 1725 * If it does - fix the extractor, not this check!
1722 */ 1726 */if (u8_strcount ((const uint8_t *) data) <= 2)
1723 if (u8_strcount ((const uint8_t *) data) <= 2)
1724 return 0; 1727 return 0;
1725 if ((EXTRACTOR_METATYPE_MIMETYPE == type) && 1728 if ((EXTRACTOR_METATYPE_MIMETYPE == type) &&
1726 (NULL != (sep = memchr (data, '/', data_len))) && (sep != data)) 1729 (NULL != (sep = memchr (data, '/', data_len))) && (sep != data))
@@ -2049,4 +2052,5 @@ GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri)
2049 } 2052 }
2050} 2053}
2051 2054
2055
2052/* end of fs_uri.c */ 2056/* end of fs_uri.c */
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index dc1912f09..53c64ab04 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -779,4 +779,5 @@ main (int argc, char *const *argv)
779 return ok; 779 return ok;
780} 780}
781 781
782
782/* end of gnunet-auto-share.c */ 783/* end of gnunet-auto-share.c */
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c
index 0fe26fe8b..829906461 100644
--- a/src/fs/gnunet-daemon-fsprofiler.c
+++ b/src/fs/gnunet-daemon-fsprofiler.c
@@ -668,4 +668,5 @@ main (int argc, char *const *argv)
668 options, &run, NULL)) ? global_ret : 1; 668 options, &run, NULL)) ? global_ret : 1;
669} 669}
670 670
671
671/* end of gnunet-daemon-fsprofiler.c */ 672/* end of gnunet-daemon-fsprofiler.c */
diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c
index 8819d1777..58950bceb 100644
--- a/src/fs/gnunet-directory.c
+++ b/src/fs/gnunet-directory.c
@@ -174,6 +174,7 @@ run (void *cls,
174 } 174 }
175} 175}
176 176
177
177/** 178/**
178 * The main function to inspect GNUnet directories. 179 * The main function to inspect GNUnet directories.
179 * 180 *
@@ -206,4 +207,5 @@ main (int argc, char *const *argv)
206 return ret; 207 return ret;
207} 208}
208 209
210
209/* end of gnunet-directory.c */ 211/* end of gnunet-directory.c */
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c
index 05e102eac..63bb02958 100644
--- a/src/fs/gnunet-download.c
+++ b/src/fs/gnunet-download.c
@@ -380,4 +380,5 @@ main (int argc, char *const *argv)
380 return ret; 380 return ret;
381} 381}
382 382
383
383/* end of gnunet-download.c */ 384/* end of gnunet-download.c */
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c
index a6e248213..6aad92055 100644
--- a/src/fs/gnunet-fs-profiler.c
+++ b/src/fs/gnunet-fs-profiler.c
@@ -241,4 +241,5 @@ main (int argc, char *const *argv)
241 return ret; 241 return ret;
242} 242}
243 243
244
244/* end of gnunet-fs-profiler.c */ 245/* end of gnunet-fs-profiler.c */
diff --git a/src/fs/gnunet-fs.c b/src/fs/gnunet-fs.c
index a44fcdf7a..35d410d37 100644
--- a/src/fs/gnunet-fs.c
+++ b/src/fs/gnunet-fs.c
@@ -110,6 +110,7 @@ run (void *cls,
110 } 110 }
111} 111}
112 112
113
113/** 114/**
114 * The main function to access special file-sharing functions. 115 * The main function to access special file-sharing functions.
115 * 116 *
@@ -147,4 +148,5 @@ main (int argc, char *const *argv)
147 return ret; 148 return ret;
148} 149}
149 150
151
150/* end of gnunet-fs.c */ 152/* end of gnunet-fs.c */
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c
index fb5f7497d..5d2d1229b 100644
--- a/src/fs/gnunet-helper-fs-publish.c
+++ b/src/fs/gnunet-helper-fs-publish.c
@@ -149,6 +149,8 @@ add_to_md (void *cls,
149 } 149 }
150 return 0; 150 return 0;
151} 151}
152
153
152#endif 154#endif
153 155
154 156
@@ -572,4 +574,5 @@ main (int argc, char *const *argv)
572 return 0; 574 return 0;
573} 575}
574 576
577
575/* end of gnunet-helper-fs-publish.c */ 578/* end of gnunet-helper-fs-publish.c */
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index ff56dac8c..ac310b785 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -996,4 +996,5 @@ main (int argc, char *const *argv)
996 return ret; 996 return ret;
997} 997}
998 998
999
999/* end of gnunet-publish.c */ 1000/* end of gnunet-publish.c */
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index f11335985..e0b9a31fd 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -375,4 +375,5 @@ main (int argc, char *const *argv)
375 return ret; 375 return ret;
376} 376}
377 377
378
378/* end of gnunet-search.c */ 379/* end of gnunet-search.c */
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 40b3f6c1d..29e6de9d5 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -68,7 +68,6 @@
68#define INSANE_STATISTICS GNUNET_NO 68#define INSANE_STATISTICS GNUNET_NO
69 69
70 70
71
72/** 71/**
73 * Doubly-linked list of requests we are performing 72 * Doubly-linked list of requests we are performing
74 * on behalf of the same client. 73 * on behalf of the same client.
@@ -504,9 +503,6 @@ client_disconnect_cb (void *cls,
504} 503}
505 504
506 505
507
508
509
510/** 506/**
511 * Task that periodically ages our cover traffic statistics. 507 * Task that periodically ages our cover traffic statistics.
512 * 508 *
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index 34e4e6f58..395842ebb 100644
--- a/src/fs/gnunet-service-fs_cadet_server.c
+++ b/src/fs/gnunet-service-fs_cadet_server.c
@@ -143,7 +143,6 @@ static unsigned int sc_count;
143static unsigned long long sc_count_max; 143static unsigned long long sc_count_max;
144 144
145 145
146
147/** 146/**
148 * Task run to asynchronously terminate the cadet due to timeout. 147 * Task run to asynchronously terminate the cadet due to timeout.
149 * 148 *
@@ -248,8 +247,7 @@ handle_datastore_reply (void *cls,
248 answers should be queried; OTOH, this is not a 247 answers should be queried; OTOH, this is not a
249 hard error as we might have had the answer in the 248 hard error as we might have had the answer in the
250 past and the user might have unindexed it. Hence 249 past and the user might have unindexed it. Hence
251 we log at level "INFO" for now. */ 250 we log at level "INFO" for now. */if (NULL == key)
252 if (NULL == key)
253 { 251 {
254 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 252 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
255 "Have no answer and the query was NULL\n"); 253 "Have no answer and the query was NULL\n");
@@ -544,4 +542,5 @@ GSF_cadet_stop_server ()
544 GNUNET_assert (0 == sc_count); 542 GNUNET_assert (0 == sc_count);
545} 543}
546 544
545
547/* end of gnunet-service-fs_cadet.c */ 546/* end of gnunet-service-fs_cadet.c */
diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h
index c17b6a0a8..54f952778 100644
--- a/src/fs/gnunet-service-fs_cp.h
+++ b/src/fs/gnunet-service-fs_cp.h
@@ -387,7 +387,6 @@ const struct GNUNET_PeerIdentity *
387GSF_connected_peer_get_identity2_ (const struct GSF_ConnectedPeer *cp); 387GSF_connected_peer_get_identity2_ (const struct GSF_ConnectedPeer *cp);
388 388
389 389
390
391/** 390/**
392 * Iterate over all connected peers. 391 * Iterate over all connected peers.
393 * 392 *
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index 4a7172c50..98fca3ec5 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -515,4 +515,5 @@ GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c,
515 return GNUNET_OK; 515 return GNUNET_OK;
516} 516}
517 517
518
518/* end of gnunet-service-fs_indexing.c */ 519/* end of gnunet-service-fs_indexing.c */
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index 7933b2dee..bb4b07c02 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -300,8 +300,7 @@ plan (struct PeerPlan *pp,
300 * which satisfies all of the rules above. 300 * which satisfies all of the rules above.
301 * 301 *
302 * Note: M_PI_4 = PI/4 = arctan(1) 302 * Note: M_PI_4 = PI/4 = arctan(1)
303 */ 303 */rp->priority =
304 rp->priority =
305 round ((GSF_current_priorities 304 round ((GSF_current_priorities
306 + 1.0) * atan (delay.rel_value_us / avg_delay)) / M_PI_4; 305 + 1.0) * atan (delay.rel_value_us / avg_delay)) / M_PI_4;
307 /* Note: usage of 'round' and 'atan' requires -lm */ 306 /* Note: usage of 'round' and 'atan' requires -lm */
@@ -812,5 +811,4 @@ GSF_plan_done ()
812} 811}
813 812
814 813
815
816/* end of gnunet-service-fs_pe.h */ 814/* end of gnunet-service-fs_pe.h */
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 9c558674b..71de5668b 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -424,6 +424,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
424 return pr; 424 return pr;
425} 425}
426 426
427
427/** 428/**
428 * Obtain the public data associated with a pending request 429 * Obtain the public data associated with a pending request
429 * 430 *
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h
index f22f85ee0..e060e734e 100644
--- a/src/fs/gnunet-service-fs_pr.h
+++ b/src/fs/gnunet-service-fs_pr.h
@@ -404,7 +404,6 @@ GSF_pending_request_test_target_ (struct GSF_PendingRequest *pr,
404 const struct GNUNET_PeerIdentity *target); 404 const struct GNUNET_PeerIdentity *target);
405 405
406 406
407
408/** 407/**
409 * Setup the subsystem. 408 * Setup the subsystem.
410 */ 409 */
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index 02990a637..1825e8eb3 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -673,4 +673,5 @@ GSF_push_done_ ()
673 GNUNET_assert (0 == mig_size); 673 GNUNET_assert (0 == mig_size);
674} 674}
675 675
676
676/* end of gnunet-service-fs_push.c */ 677/* end of gnunet-service-fs_push.c */
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index 335496119..ddc15820a 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -292,4 +292,5 @@ GSF_put_done_ ()
292 } 292 }
293} 293}
294 294
295
295/* end of gnunet-service-fs_put.c */ 296/* end of gnunet-service-fs_put.c */
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c
index 88825fa60..bf32de812 100644
--- a/src/fs/gnunet-unindex.c
+++ b/src/fs/gnunet-unindex.c
@@ -60,6 +60,7 @@ shutdown_task (void *cls)
60 } 60 }
61} 61}
62 62
63
63/** 64/**
64 * Called by FS client to give information about the progress of an 65 * Called by FS client to give information about the progress of an
65 * operation. 66 * operation.
@@ -200,4 +201,5 @@ main (int argc, char *const *argv)
200 return ret; 201 return ret;
201} 202}
202 203
204
203/* end of gnunet-unindex.c */ 205/* end of gnunet-unindex.c */
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c
index 39563dfa4..062f062b5 100644
--- a/src/fs/perf_gnunet_service_fs_p2p.c
+++ b/src/fs/perf_gnunet_service_fs_p2p.c
@@ -364,4 +364,5 @@ main (int argc, char *argv[])
364 return ok; 364 return ok;
365} 365}
366 366
367
367/* end of perf_gnunet_service_fs_p2p.c */ 368/* end of perf_gnunet_service_fs_p2p.c */
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c
index fc17235fa..b7fe61be7 100644
--- a/src/fs/perf_gnunet_service_fs_p2p_respect.c
+++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c
@@ -198,7 +198,6 @@ get_done (void *cls, int success)
198} 198}
199 199
200 200
201
202/** 201/**
203 * Adapter function called to establish a connection to 202 * Adapter function called to establish a connection to
204 * statistics service. 203 * statistics service.
@@ -476,4 +475,5 @@ main (int argc, char *argv[])
476 return ok; 475 return ok;
477} 476}
478 477
478
479/* end of perf_gnunet_service_fs_p2p_respect.c */ 479/* end of perf_gnunet_service_fs_p2p_respect.c */
diff --git a/src/fs/plugin_block_fs.c b/src/fs/plugin_block_fs.c
index e5ea91c98..02855f418 100644
--- a/src/fs/plugin_block_fs.c
+++ b/src/fs/plugin_block_fs.c
@@ -295,4 +295,5 @@ libgnunet_plugin_block_fs_done (void *cls)
295 return NULL; 295 return NULL;
296} 296}
297 297
298
298/* end of plugin_block_fs.c */ 299/* end of plugin_block_fs.c */
diff --git a/src/fs/test_fs.c b/src/fs/test_fs.c
index 73de7b204..7a57e98b0 100644
--- a/src/fs/test_fs.c
+++ b/src/fs/test_fs.c
@@ -47,6 +47,7 @@ makeName (unsigned int i)
47 return fn; 47 return fn;
48} 48}
49 49
50
50static enum GNUNET_FSUI_EventType lastEvent; 51static enum GNUNET_FSUI_EventType lastEvent;
51 52
52static struct GNUNET_MetaData *search_meta; 53static struct GNUNET_MetaData *search_meta;
@@ -101,6 +102,7 @@ eventCallback (void *cls, const GNUNET_FSUI_Event *event)
101 return NULL; 102 return NULL;
102} 103}
103 104
105
104#define START_DAEMON 1 106#define START_DAEMON 1
105 107
106int 108int
@@ -256,4 +258,5 @@ FAILURE:
256 return (ok == GNUNET_YES) ? 0 : 1; 258 return (ok == GNUNET_YES) ? 0 : 1;
257} 259}
258 260
261
259/* end of test_fs.c */ 262/* end of test_fs.c */
diff --git a/src/fs/test_fs_directory.c b/src/fs/test_fs_directory.c
index 37d74613a..1b109c4d4 100644
--- a/src/fs/test_fs_directory.c
+++ b/src/fs/test_fs_directory.c
@@ -63,6 +63,7 @@ processor (void *cls, const char *filename, const struct GNUNET_FS_Uri *uri,
63 fprintf (stderr, "Error at %s:%d\n", __FILE__, __LINE__); 63 fprintf (stderr, "Error at %s:%d\n", __FILE__, __LINE__);
64} 64}
65 65
66
66static int 67static int
67testDirectory (unsigned int i) 68testDirectory (unsigned int i)
68{ 69{
@@ -181,4 +182,5 @@ main (int argc, char *argv[])
181 return 0; 182 return 0;
182} 183}
183 184
185
184/* end of test_fs_directory.c */ 186/* end of test_fs_directory.c */
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index 422c41523..2be2e7f6a 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -361,4 +361,5 @@ main (int argc, char *argv[])
361 return err; 361 return err;
362} 362}
363 363
364
364/* end of test_fs_download.c */ 365/* end of test_fs_download.c */
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c
index 7b7a886eb..35d4ed441 100644
--- a/src/fs/test_fs_download_persistence.c
+++ b/src/fs/test_fs_download_persistence.c
@@ -347,4 +347,5 @@ main (int argc, char *argv[])
347 return err; 347 return err;
348} 348}
349 349
350
350/* end of test_fs_download_persistence.c */ 351/* end of test_fs_download_persistence.c */
diff --git a/src/fs/test_fs_file_information.c b/src/fs/test_fs_file_information.c
index 3f6f2d5a8..391b667cb 100644
--- a/src/fs/test_fs_file_information.c
+++ b/src/fs/test_fs_file_information.c
@@ -157,4 +157,5 @@ main (int argc, char *argv[])
157 return 0; 157 return 0;
158} 158}
159 159
160
160/* end of test_fs_file_information.c */ 161/* end of test_fs_file_information.c */
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c
index 431d42b2e..93367883f 100644
--- a/src/fs/test_fs_list_indexed.c
+++ b/src/fs/test_fs_list_indexed.c
@@ -259,4 +259,5 @@ main (int argc, char *argv[])
259 return 0; 259 return 0;
260} 260}
261 261
262
262/* end of test_fs_list_indexed.c */ 263/* end of test_fs_list_indexed.c */
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c
index 40eaa09e3..c42e546e3 100644
--- a/src/fs/test_fs_publish.c
+++ b/src/fs/test_fs_publish.c
@@ -245,4 +245,5 @@ main (int argc, char *argv[])
245 return err; 245 return err;
246} 246}
247 247
248
248/* end of test_fs_publish.c */ 249/* end of test_fs_publish.c */
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index 4247f78dd..4ec39d06e 100644
--- a/src/fs/test_fs_publish_persistence.c
+++ b/src/fs/test_fs_publish_persistence.c
@@ -316,4 +316,5 @@ main (int argc, char *argv[])
316 return err; 316 return err;
317} 317}
318 318
319
319/* end of test_fs_publish_persistence.c */ 320/* end of test_fs_publish_persistence.c */
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index 16f8ecbda..b392cc8ac 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -248,4 +248,5 @@ main (int argc, char *argv[])
248 return err; 248 return err;
249} 249}
250 250
251
251/* end of test_fs_search.c */ 252/* end of test_fs_search.c */
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index 40671823d..d523a6404 100644
--- a/src/fs/test_fs_search_persistence.c
+++ b/src/fs/test_fs_search_persistence.c
@@ -314,4 +314,5 @@ main (int argc, char *argv[])
314 return err; 314 return err;
315} 315}
316 316
317
317/* end of test_fs_search_persistence.c */ 318/* end of test_fs_search_persistence.c */
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index 2e2dc6005..b3c717aa1 100644
--- a/src/fs/test_fs_search_probes.c
+++ b/src/fs/test_fs_search_probes.c
@@ -254,4 +254,5 @@ main (int argc, char *argv[])
254 return err; 254 return err;
255} 255}
256 256
257
257/* end of test_fs_search_probes.c */ 258/* end of test_fs_search_probes.c */
diff --git a/src/fs/test_fs_search_with_and.c b/src/fs/test_fs_search_with_and.c
index 60ceb94ee..2187f4531 100644
--- a/src/fs/test_fs_search_with_and.c
+++ b/src/fs/test_fs_search_with_and.c
@@ -268,4 +268,5 @@ main (int argc, char *argv[])
268 return err; 268 return err;
269} 269}
270 270
271
271/* end of test_fs_search.c */ 272/* end of test_fs_search.c */
diff --git a/src/fs/test_fs_start_stop.c b/src/fs/test_fs_start_stop.c
index 1d6e27d62..509fbe76a 100644
--- a/src/fs/test_fs_start_stop.c
+++ b/src/fs/test_fs_start_stop.c
@@ -60,4 +60,5 @@ main (int argc, char *argv[])
60 return 0; 60 return 0;
61} 61}
62 62
63
63/* end of test_fs_start_stop.c */ 64/* end of test_fs_start_stop.c */
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c
index 25b843e85..7f0077bdd 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -175,4 +175,5 @@ main (int argc, char *argv[])
175 return ret; 175 return ret;
176} 176}
177 177
178
178/* end of test_fs_test_lib.c */ 179/* end of test_fs_test_lib.c */
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c
index 19b935dbf..a11c574c1 100644
--- a/src/fs/test_fs_unindex.c
+++ b/src/fs/test_fs_unindex.c
@@ -232,4 +232,5 @@ main (int argc, char *argv[])
232 return 0; 232 return 0;
233} 233}
234 234
235
235/* end of test_fs_unindex.c */ 236/* end of test_fs_unindex.c */
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c
index 28079b842..c3668f4e0 100644
--- a/src/fs/test_fs_unindex_persistence.c
+++ b/src/fs/test_fs_unindex_persistence.c
@@ -302,4 +302,5 @@ main (int argc, char *argv[])
302 return 0; 302 return 0;
303} 303}
304 304
305
305/* end of test_fs_unindex_persistence.c */ 306/* end of test_fs_unindex_persistence.c */
diff --git a/src/fs/test_fs_uri.c b/src/fs/test_fs_uri.c
index 0602d8318..2a324af9a 100644
--- a/src/fs/test_fs_uri.c
+++ b/src/fs/test_fs_uri.c
@@ -333,4 +333,5 @@ main (int argc, char *argv[])
333 return 0; 333 return 0;
334} 334}
335 335
336
336/* end of test_fs_uri.c */ 337/* end of test_fs_uri.c */
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c
index 9842f8a83..d4a1c38b5 100644
--- a/src/fs/test_gnunet_service_fs_migration.c
+++ b/src/fs/test_gnunet_service_fs_migration.c
@@ -217,4 +217,5 @@ main (int argc,
217 return ok; 217 return ok;
218} 218}
219 219
220
220/* end of test_gnunet_service_fs_migration.c */ 221/* end of test_gnunet_service_fs_migration.c */
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c
index 8d2ed144f..bedcb7173 100644
--- a/src/fs/test_gnunet_service_fs_p2p.c
+++ b/src/fs/test_gnunet_service_fs_p2p.c
@@ -162,4 +162,5 @@ main (int argc, char *argv[])
162 return ok; 162 return ok;
163} 163}
164 164
165
165/* end of test_gnunet_service_fs_p2p.c */ 166/* end of test_gnunet_service_fs_p2p.c */
diff --git a/src/fs/test_plugin_block_fs.c b/src/fs/test_plugin_block_fs.c
index 305da2f18..4f71c5d74 100644
--- a/src/fs/test_plugin_block_fs.c
+++ b/src/fs/test_plugin_block_fs.c
@@ -88,4 +88,5 @@ main (int argc, char *argv[])
88 return ret; 88 return ret;
89} 89}
90 90
91
91/* end of test_plugin_block_fs.c */ 92/* end of test_plugin_block_fs.c */
diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c
index e646efc3e..e8253ee4c 100644
--- a/src/gns/gns_tld_api.c
+++ b/src/gns/gns_tld_api.c
@@ -346,4 +346,5 @@ GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr)
346 return ret; 346 return ret;
347} 347}
348 348
349
349/* end of gns_tld_api.c */ 350/* end of gns_tld_api.c */
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c
index a1ae888dd..81a12de0a 100644
--- a/src/gns/gnunet-dns2gns.c
+++ b/src/gns/gnunet-dns2gns.c
@@ -103,7 +103,6 @@ static in_addr_t address;
103static struct in6_addr address6; 103static struct in6_addr address6;
104 104
105 105
106
107/** 106/**
108 * Handle to GNS resolver. 107 * Handle to GNS resolver.
109 */ 108 */
@@ -780,4 +779,5 @@ main (int argc,
780 return ret; 779 return ret;
781} 780}
782 781
782
783/* end of gnunet-dns2gns.c */ 783/* end of gnunet-dns2gns.c */
diff --git a/src/gns/gnunet-gns-benchmark.c b/src/gns/gnunet-gns-benchmark.c
index d85b9e203..bf13efb11 100644
--- a/src/gns/gnunet-gns-benchmark.c
+++ b/src/gns/gnunet-gns-benchmark.c
@@ -614,4 +614,5 @@ main (int argc,
614 return ret; 614 return ret;
615} 615}
616 616
617
617/* end of gnunet-gns-benchmark.c */ 618/* end of gnunet-gns-benchmark.c */
diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c
index 064294234..0dc04064a 100644
--- a/src/gns/gnunet-gns-import.c
+++ b/src/gns/gnunet-gns-import.c
@@ -163,6 +163,7 @@ run_process_and_wait (int pipe_control,
163 return 0; 163 return 0;
164} 164}
165 165
166
166static void 167static void
167check_pkey (unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, 168check_pkey (unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd,
168 char *pk, int *found_rec) 169 char *pk, int *found_rec)
@@ -186,6 +187,7 @@ check_pkey (unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd,
186 } 187 }
187} 188}
188 189
190
189/** 191/**
190 * Process a record that was stored in the namestore. 192 * Process a record that was stored in the namestore.
191 * 193 *
@@ -211,6 +213,7 @@ zone_iterator (void *cls,
211 GNUNET_NAMESTORE_zone_iterator_next (list_it); 213 GNUNET_NAMESTORE_zone_iterator_next (list_it);
212} 214}
213 215
216
214static void 217static void
215zone_iteration_error (void *cls) 218zone_iteration_error (void *cls)
216{ 219{
@@ -322,17 +325,19 @@ get_ego (void *cls,
322 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 325 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
323 if (NULL != identifier) 326 if (NULL != identifier)
324 { 327 {
325 if ((NULL == master_zone_pkey) &&(0 == strcmp ("master-zone", identifier)) ) 328 if ((NULL == master_zone_pkey) && (0 == strcmp ("master-zone",
329 identifier)) )
326 { 330 {
327 master_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); 331 master_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
328 master_pk = *GNUNET_IDENTITY_ego_get_private_key (ego); 332 master_pk = *GNUNET_IDENTITY_ego_get_private_key (ego);
329 } 333 }
330 else if ((NULL == private_zone_pkey) &&(0 == strcmp ("private-zone", 334 else if ((NULL == private_zone_pkey) && (0 == strcmp ("private-zone",
331 identifier)) ) 335 identifier)) )
332 private_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); 336 private_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
333 } 337 }
334} 338}
335 339
340
336/** 341/**
337 * Task run on shutdown. 342 * Task run on shutdown.
338 * 343 *
@@ -362,6 +367,7 @@ shutdown_task (void *cls)
362 } 367 }
363} 368}
364 369
370
365/** 371/**
366 * Main function that will be run. 372 * Main function that will be run.
367 * 373 *
@@ -484,4 +490,5 @@ main (int argc, char *const *argv)
484 return GNUNET_OK == r ? ret : 1; 490 return GNUNET_OK == r ? ret : 1;
485} 491}
486 492
493
487/* end of gnunet-gns-import.c */ 494/* end of gnunet-gns-import.c */
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 2a39efef2..7a5dbb627 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -45,7 +45,6 @@
45#include "gns.h" 45#include "gns.h"
46 46
47 47
48
49/** 48/**
50 * Default Socks5 listen port. 49 * Default Socks5 listen port.
51 */ 50 */
@@ -298,7 +297,6 @@ struct Socks5ServerResponseMessage
298}; 297};
299 298
300 299
301
302/* *********************** Datastructures for HTTP handling ****************** */ 300/* *********************** Datastructures for HTTP handling ****************** */
303 301
304/** 302/**
@@ -335,7 +333,6 @@ struct ProxyGNSCertificate
335}; 333};
336 334
337 335
338
339/** 336/**
340 * A structure for all running Httpds 337 * A structure for all running Httpds
341 */ 338 */
@@ -652,7 +649,6 @@ struct Socks5Request
652}; 649};
653 650
654 651
655
656/* *********************** Globals **************************** */ 652/* *********************** Globals **************************** */
657 653
658/** 654/**
@@ -1953,8 +1949,7 @@ create_response (void *cls,
1953 * Pre-populate cache to resolve Hostname. 1949 * Pre-populate cache to resolve Hostname.
1954 * This is necessary as the DNS name in the CURLOPT_URL is used 1950 * This is necessary as the DNS name in the CURLOPT_URL is used
1955 * for SNI http://de.wikipedia.org/wiki/Server_Name_Indication 1951 * for SNI http://de.wikipedia.org/wiki/Server_Name_Indication
1956 */ 1952 */if (NULL != s5r->leho)
1957 if (NULL != s5r->leho)
1958 { 1953 {
1959 char *curl_hosts; 1954 char *curl_hosts;
1960 1955
@@ -2393,6 +2388,7 @@ mhd_connection_cb (void *cls,
2393 } 2388 }
2394} 2389}
2395 2390
2391
2396/** 2392/**
2397 * Function called when MHD first processes an incoming connection. 2393 * Function called when MHD first processes an incoming connection.
2398 * Gives us the respective URI information. 2394 * Gives us the respective URI information.
@@ -3905,4 +3901,5 @@ main (int argc,
3905 return ret; 3901 return ret;
3906} 3902}
3907 3903
3904
3908/* end of gnunet-gns-proxy.c */ 3905/* end of gnunet-gns-proxy.c */
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c
index 510e46d14..c3ba0a1f8 100644
--- a/src/gns/gnunet-gns.c
+++ b/src/gns/gnunet-gns.c
@@ -110,6 +110,7 @@ do_shutdown (void *cls)
110 } 110 }
111} 111}
112 112
113
113/** 114/**
114 * Task to run on timeout 115 * Task to run on timeout
115 * 116 *
@@ -123,6 +124,7 @@ do_timeout (void*cls)
123 GNUNET_SCHEDULER_shutdown (); 124 GNUNET_SCHEDULER_shutdown ();
124} 125}
125 126
127
126/** 128/**
127 * Function called with the result of a GNS lookup. 129 * Function called with the result of a GNS lookup.
128 * 130 *
@@ -319,4 +321,5 @@ main (int argc, char *const *argv)
319 return global_ret; 321 return global_ret;
320} 322}
321 323
324
322/* end of gnunet-gns.c */ 325/* end of gnunet-gns.c */
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c
index d6ee7f91c..a44d36c89 100644
--- a/src/gns/gnunet-service-gns_interceptor.c
+++ b/src/gns/gnunet-service-gns_interceptor.c
@@ -409,4 +409,5 @@ GNS_interceptor_done ()
409 } 409 }
410} 410}
411 411
412
412/* end of gnunet-service-gns_interceptor.c */ 413/* end of gnunet-service-gns_interceptor.c */
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index d4f174184..01af17fdc 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -536,6 +536,7 @@ is_canonical (const char *name)
536 return GNUNET_YES; 536 return GNUNET_YES;
537} 537}
538 538
539
539/* ************************** Resolution **************************** */ 540/* ************************** Resolution **************************** */
540 541
541/** 542/**
diff --git a/src/gns/nss/nss_gns_query.c b/src/gns/nss/nss_gns_query.c
index fb431919b..9ebdcb31f 100644
--- a/src/gns/nss/nss_gns_query.c
+++ b/src/gns/nss/nss_gns_query.c
@@ -146,4 +146,5 @@ gns_resolve_name (int af, const char *name, struct userdata *u)
146 return 0; 146 return 0;
147} 147}
148 148
149
149/* end of nss_gns_query.c */ 150/* end of nss_gns_query.c */
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c
index f4f5f906c..aabedcaac 100644
--- a/src/gns/plugin_block_gns.c
+++ b/src/gns/plugin_block_gns.c
@@ -246,4 +246,5 @@ libgnunet_plugin_block_gns_done (void *cls)
246 return NULL; 246 return NULL;
247} 247}
248 248
249
249/* end of plugin_block_gns.c */ 250/* end of plugin_block_gns.c */
diff --git a/src/gns/plugin_gnsrecord_gns.c b/src/gns/plugin_gnsrecord_gns.c
index e0bc4fb0c..cffd5a965 100644
--- a/src/gns/plugin_gnsrecord_gns.c
+++ b/src/gns/plugin_gnsrecord_gns.c
@@ -381,4 +381,5 @@ libgnunet_plugin_gnsrecord_gns_done (void *cls)
381 return NULL; 381 return NULL;
382} 382}
383 383
384
384/* end of plugin_gnsrecord_gns.c */ 385/* end of plugin_gnsrecord_gns.c */
diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c
index cdcdd6cf8..6ae753a07 100644
--- a/src/gns/plugin_rest_gns.c
+++ b/src/gns/plugin_rest_gns.c
@@ -465,4 +465,5 @@ libgnunet_plugin_rest_gns_done (void *cls)
465 return NULL; 465 return NULL;
466} 466}
467 467
468
468/* end of plugin_rest_gns.c */ 469/* end of plugin_rest_gns.c */
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c
index 02a9fc01e..12f3f8625 100644
--- a/src/gns/test_gns_proxy.c
+++ b/src/gns/test_gns_proxy.c
@@ -112,6 +112,7 @@ load_file (const char*filename,
112 return buffer; 112 return buffer;
113} 113}
114 114
115
115/** 116/**
116 * Load PEM key from file 117 * Load PEM key from file
117 * 118 *
@@ -142,6 +143,7 @@ load_key_from_file (gnutls_x509_privkey_t key,
142 return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; 143 return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK;
143} 144}
144 145
146
145/** 147/**
146 * Load cert from file 148 * Load cert from file
147 * 149 *
@@ -173,6 +175,7 @@ load_cert_from_file (gnutls_x509_crt_t crt,
173 return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; 175 return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK;
174} 176}
175 177
178
176static size_t 179static size_t
177copy_buffer (void *ptr, size_t size, size_t nmemb, void *ctx) 180copy_buffer (void *ptr, size_t size, size_t nmemb, void *ctx)
178{ 181{
@@ -521,6 +524,7 @@ run (void *cls,
521 NULL); 524 NULL);
522} 525}
523 526
527
524int 528int
525main (int argc, char *const *argv) 529main (int argc, char *const *argv)
526{ 530{
@@ -568,4 +572,5 @@ main (int argc, char *const *argv)
568 return global_ret; 572 return global_ret;
569} 573}
570 574
575
571/* end of test_gns_proxy.c */ 576/* end of test_gns_proxy.c */
diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c
index 9d01210be..82fb71c06 100644
--- a/src/gnsrecord/gnsrecord.c
+++ b/src/gnsrecord/gnsrecord.c
@@ -246,4 +246,5 @@ GNUNET_GNSRECORD_number_to_typename (uint32_t type)
246 return NULL; 246 return NULL;
247} 247}
248 248
249
249/* end of gnsrecord.c */ 250/* end of gnsrecord.c */
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c
index b173062ff..2b05dea56 100644
--- a/src/gnsrecord/gnsrecord_crypto.c
+++ b/src/gnsrecord/gnsrecord_crypto.c
@@ -288,7 +288,6 @@ GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
288} 288}
289 289
290 290
291
292/** 291/**
293 * Check if a signature is valid. This API is used by the GNS Block 292 * Check if a signature is valid. This API is used by the GNS Block
294 * to validate signatures received from the network. 293 * to validate signatures received from the network.
diff --git a/src/gnsrecord/gnsrecord_serialization.c b/src/gnsrecord/gnsrecord_serialization.c
index a2711538c..42665e662 100644
--- a/src/gnsrecord/gnsrecord_serialization.c
+++ b/src/gnsrecord/gnsrecord_serialization.c
@@ -130,8 +130,7 @@ GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
130 * Efficiently round up to the next 130 * Efficiently round up to the next
131 * power of 2 for padding 131 * power of 2 for padding
132 * https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 132 * https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
133 */ 133 */ret--;
134 ret--;
135 ret |= ret >> 1; 134 ret |= ret >> 1;
136 ret |= ret >> 2; 135 ret |= ret >> 2;
137 ret |= ret >> 4; 136 ret |= ret >> 4;
diff --git a/src/gnsrecord/perf_gnsrecord_crypto.c b/src/gnsrecord/perf_gnsrecord_crypto.c
index 4dadbe9b6..3bb4ca4e1 100644
--- a/src/gnsrecord/perf_gnsrecord_crypto.c
+++ b/src/gnsrecord/perf_gnsrecord_crypto.c
@@ -136,4 +136,5 @@ main (int argc, char *argv[])
136 return 0; 136 return 0;
137} 137}
138 138
139
139/* end of test_gnsrecord_crypto.c */ 140/* end of test_gnsrecord_crypto.c */
diff --git a/src/gnsrecord/plugin_gnsrecord_dns.c b/src/gnsrecord/plugin_gnsrecord_dns.c
index 9a45b5b93..5410d9546 100644
--- a/src/gnsrecord/plugin_gnsrecord_dns.c
+++ b/src/gnsrecord/plugin_gnsrecord_dns.c
@@ -808,4 +808,5 @@ libgnunet_plugin_gnsrecord_dns_done (void *cls)
808 return NULL; 808 return NULL;
809} 809}
810 810
811
811/* end of plugin_gnsrecord_dns.c */ 812/* end of plugin_gnsrecord_dns.c */
diff --git a/src/gnsrecord/test_gnsrecord_block_expiration.c b/src/gnsrecord/test_gnsrecord_block_expiration.c
index 9672c2ffb..b53d7d7e8 100644
--- a/src/gnsrecord/test_gnsrecord_block_expiration.c
+++ b/src/gnsrecord/test_gnsrecord_block_expiration.c
@@ -42,7 +42,6 @@
42static int res; 42static int res;
43 43
44 44
45
46static void 45static void
47run (void *cls, char *const *args, const char *cfgfile, 46run (void *cls, char *const *args, const char *cfgfile,
48 const struct GNUNET_CONFIGURATION_Handle *cfg) 47 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -105,4 +104,5 @@ main (int argc, char *argv[])
105 return res; 104 return res;
106} 105}
107 106
107
108/* end of test_gnsrecord_crypto.c */ 108/* end of test_gnsrecord_crypto.c */
diff --git a/src/gnsrecord/test_gnsrecord_crypto.c b/src/gnsrecord/test_gnsrecord_crypto.c
index b16828147..0da19fbe9 100644
--- a/src/gnsrecord/test_gnsrecord_crypto.c
+++ b/src/gnsrecord/test_gnsrecord_crypto.c
@@ -94,6 +94,7 @@ rd_decrypt_cb (void *cls,
94 res = 0; 94 res = 0;
95} 95}
96 96
97
97static void 98static void
98run (void *cls, 99run (void *cls,
99 char *const *args, 100 char *const *args,
@@ -166,4 +167,5 @@ main (int argc, char *argv[])
166 return res; 167 return res;
167} 168}
168 169
170
169/* end of test_gnsrecord_crypto.c */ 171/* end of test_gnsrecord_crypto.c */
diff --git a/src/gnsrecord/test_gnsrecord_serialization.c b/src/gnsrecord/test_gnsrecord_serialization.c
index 6905cf515..22d9f8396 100644
--- a/src/gnsrecord/test_gnsrecord_serialization.c
+++ b/src/gnsrecord/test_gnsrecord_serialization.c
@@ -153,4 +153,5 @@ main (int argcx, char *argvx[])
153 return res; 153 return res;
154} 154}
155 155
156
156/* end of test_gnsrecord_serialization.c */ 157/* end of test_gnsrecord_serialization.c */
diff --git a/src/hello/gnunet-hello.c b/src/hello/gnunet-hello.c
index 9f277de4a..b3f48322b 100644
--- a/src/hello/gnunet-hello.c
+++ b/src/hello/gnunet-hello.c
@@ -211,4 +211,5 @@ main (int argc, char *argv[])
211 return 0; 211 return 0;
212} 212}
213 213
214
214/* end of gnunet-hello.c */ 215/* end of gnunet-hello.c */
diff --git a/src/hello/hello.c b/src/hello/hello.c
index e701e1f17..11eec9898 100644
--- a/src/hello/hello.c
+++ b/src/hello/hello.c
@@ -945,7 +945,6 @@ GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg)
945 */ 945 */
946 946
947 947
948
949/** 948/**
950 * Function that is called on each address of this peer. 949 * Function that is called on each address of this peer.
951 * Expands the corresponding URI string. 950 * Expands the corresponding URI string.
diff --git a/src/hello/test_hello.c b/src/hello/test_hello.c
index 1580dcc55..8631d2af3 100644
--- a/src/hello/test_hello.c
+++ b/src/hello/test_hello.c
@@ -249,4 +249,5 @@ main (int argc,
249 return 0; /* testcase passed */ 249 return 0; /* testcase passed */
250} 250}
251 251
252
252/* end of test_hello.c */ 253/* end of test_hello.c */
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index bf6542d7f..adb1a328d 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -413,4 +413,5 @@ main (int argc, char *const *argv)
413 return ret; 413 return ret;
414} 414}
415 415
416
416/* end of gnunet-daemon-hostlist.c */ 417/* end of gnunet-daemon-hostlist.c */
diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c
index 564aef2bd..a5ff9f9fa 100644
--- a/src/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/hostlist/gnunet-daemon-hostlist_client.c
@@ -1789,4 +1789,5 @@ GNUNET_HOSTLIST_client_stop ()
1789 cfg = NULL; 1789 cfg = NULL;
1790} 1790}
1791 1791
1792
1792/* end of gnunet-daemon-hostlist_client.c */ 1793/* end of gnunet-daemon-hostlist_client.c */
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c
index 43513930a..b2b7dac72 100644
--- a/src/hostlist/gnunet-daemon-hostlist_server.c
+++ b/src/hostlist/gnunet-daemon-hostlist_server.c
@@ -899,4 +899,5 @@ GNUNET_HOSTLIST_server_stop ()
899 core = NULL; 899 core = NULL;
900} 900}
901 901
902
902/* end of gnunet-daemon-hostlist_server.c */ 903/* end of gnunet-daemon-hostlist_server.c */
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index 182340f9b..d10924eac 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -260,4 +260,5 @@ main (int argc, char *argv[])
260 return ret; 260 return ret;
261} 261}
262 262
263
263/* end of test_gnunet_daemon_hostlist.c */ 264/* end of test_gnunet_daemon_hostlist.c */
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index f9fabab10..a45721521 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -588,4 +588,5 @@ main (int argc, char *argv[])
588 return ret; 588 return ret;
589} 589}
590 590
591
591/* end of test_gnunet_daemon_hostlist_learning.c */ 592/* end of test_gnunet_daemon_hostlist_learning.c */
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
index ce17cfe4d..657b85fd8 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -259,4 +259,5 @@ main (int argcx, char *argvx[])
259 return ok; 259 return ok;
260} 260}
261 261
262
262/* end of test_gnunet_daemon_hostlist_reconnect.c */ 263/* end of test_gnunet_daemon_hostlist_reconnect.c */
diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c
index 6a5b1b1ca..1350376d9 100644
--- a/src/identity/gnunet-identity.c
+++ b/src/identity/gnunet-identity.c
@@ -446,4 +446,5 @@ main (int argc, char *const *argv)
446 return global_ret; 446 return global_ret;
447} 447}
448 448
449
449/* end of gnunet-identity.c */ 450/* end of gnunet-identity.c */
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c
index 98b5bde45..b509e7e9a 100644
--- a/src/identity/gnunet-service-identity.c
+++ b/src/identity/gnunet-service-identity.c
@@ -127,6 +127,7 @@ get_ego_filename (struct Ego *ego)
127 return filename; 127 return filename;
128} 128}
129 129
130
130/** 131/**
131 * Called whenever a client is disconnected. 132 * Called whenever a client is disconnected.
132 * 133 *
@@ -159,6 +160,7 @@ client_connect_cb (void *cls,
159 return client; 160 return client;
160} 161}
161 162
163
162/** 164/**
163 * Task run during shutdown. 165 * Task run during shutdown.
164 * 166 *
@@ -521,6 +523,7 @@ key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1,
521 return GNUNET_memcmp (pk1, pk2); 523 return GNUNET_memcmp (pk1, pk2);
522} 524}
523 525
526
524/** 527/**
525 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT message 528 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT message
526 * 529 *
@@ -557,6 +560,7 @@ check_set_default_message (void *cls, const struct SetDefaultMessage *msg)
557 return GNUNET_OK; 560 return GNUNET_OK;
558} 561}
559 562
563
560/** 564/**
561 * Handler for SET_DEFAULT message from client, updates 565 * Handler for SET_DEFAULT message from client, updates
562 * default identity for some service. 566 * default identity for some service.
@@ -629,6 +633,7 @@ notify_listeners (struct Ego *ego)
629 GNUNET_free (um); 633 GNUNET_free (um);
630} 634}
631 635
636
632/** 637/**
633 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE message 638 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE message
634 * 639 *
@@ -665,6 +670,7 @@ check_create_message (void *cls, const struct CreateRequestMessage *msg)
665 return GNUNET_OK; 670 return GNUNET_OK;
666} 671}
667 672
673
668/** 674/**
669 * Handler for CREATE message from client, creates 675 * Handler for CREATE message from client, creates
670 * new identity. 676 * new identity.
@@ -765,6 +771,7 @@ handle_ego_rename (void *cls, const char *section)
765 GNUNET_free (id); 771 GNUNET_free (id);
766} 772}
767 773
774
768/** 775/**
769 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME message 776 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME message
770 * 777 *
@@ -916,6 +923,7 @@ handle_ego_delete (void *cls, const char *section)
916 GNUNET_free (id); 923 GNUNET_free (id);
917} 924}
918 925
926
919/** 927/**
920 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE message 928 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE message
921 * 929 *
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 42e25c11d..29d9b9011 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -865,4 +865,5 @@ GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h)
865 GNUNET_free (h); 865 GNUNET_free (h);
866} 866}
867 867
868
868/* end of identity_api.c */ 869/* end of identity_api.c */
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index e052ac6b3..65bbaaaba 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -291,6 +291,7 @@ cleanup_handle (void *cls)
291 GNUNET_free (handle); 291 GNUNET_free (handle);
292} 292}
293 293
294
294/** 295/**
295 * Task run on errors. Reports an error and cleans up everything. 296 * Task run on errors. Reports an error and cleans up everything.
296 * 297 *
@@ -410,6 +411,7 @@ ego_get_for_subsystem (void *cls,
410 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle); 411 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
411} 412}
412 413
414
413/** 415/**
414 * Handle identity GET request for subsystem 416 * Handle identity GET request for subsystem
415 * 417 *
@@ -567,6 +569,7 @@ ego_get_pubkey (struct GNUNET_REST_RequestHandle *con_handle,
567 ego_get_response (handle, ego_entry); 569 ego_get_response (handle, ego_entry);
568} 570}
569 571
572
570/** 573/**
571 * Handle identity GET request with a name 574 * Handle identity GET request with a name
572 * 575 *
@@ -789,6 +792,7 @@ ego_edit_pubkey (struct GNUNET_REST_RequestHandle *con_handle,
789 ego_edit (handle, ego_entry); 792 ego_edit (handle, ego_entry);
790} 793}
791 794
795
792/** 796/**
793 * Handle identity PUT request with name 797 * Handle identity PUT request with name
794 * 798 *
@@ -828,6 +832,7 @@ ego_edit_name (struct GNUNET_REST_RequestHandle *con_handle,
828 ego_edit (handle, ego_entry); 832 ego_edit (handle, ego_entry);
829} 833}
830 834
835
831/** 836/**
832 * Handle identity subsystem PUT request with name 837 * Handle identity subsystem PUT request with name
833 * 838 *
@@ -936,6 +941,7 @@ ego_edit_subsystem (struct GNUNET_REST_RequestHandle *con_handle,
936 return; 941 return;
937} 942}
938 943
944
939/** 945/**
940 * Handle identity POST request 946 * Handle identity POST request
941 * 947 *
@@ -1026,6 +1032,7 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle,
1026 handle); 1032 handle);
1027} 1033}
1028 1034
1035
1029/** 1036/**
1030 * Handle identity DELETE request with public key 1037 * Handle identity DELETE request with public key
1031 * 1038 *
@@ -1137,6 +1144,7 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle,
1137 return; 1144 return;
1138} 1145}
1139 1146
1147
1140/** 1148/**
1141 * Handle rest request 1149 * Handle rest request
1142 * 1150 *
@@ -1179,6 +1187,7 @@ init_cont (struct RequestHandle *handle)
1179 } 1187 }
1180} 1188}
1181 1189
1190
1182/** 1191/**
1183 * If listing is enabled, prints information about the egos. 1192 * If listing is enabled, prints information about the egos.
1184 * 1193 *
@@ -1257,7 +1266,8 @@ init_egos (void *cls,
1257 GNUNET_free (tmp->identifier); 1266 GNUNET_free (tmp->identifier);
1258 GNUNET_free (tmp); 1267 GNUNET_free (tmp);
1259 } 1268 }
1260 else { 1269 else
1270 {
1261 // Renamed 1271 // Renamed
1262 GNUNET_free (tmp->identifier); 1272 GNUNET_free (tmp->identifier);
1263 tmp->identifier = GNUNET_strdup (identifier); 1273 tmp->identifier = GNUNET_strdup (identifier);
@@ -1276,6 +1286,7 @@ init_egos (void *cls,
1276 1286
1277} 1287}
1278 1288
1289
1279/** 1290/**
1280 * Function processing the REST call 1291 * Function processing the REST call
1281 * 1292 *
@@ -1315,6 +1326,7 @@ rest_process_request (struct GNUNET_REST_RequestHandle *rest_handle,
1315 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n"); 1326 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n");
1316} 1327}
1317 1328
1329
1318/** 1330/**
1319 * Entry point for the plugin. 1331 * Entry point for the plugin.
1320 * 1332 *
@@ -1348,6 +1360,7 @@ libgnunet_plugin_rest_identity_init (void *cls)
1348 return api; 1360 return api;
1349} 1361}
1350 1362
1363
1351/** 1364/**
1352 * Exit point from the plugin. 1365 * Exit point from the plugin.
1353 * 1366 *
@@ -1368,4 +1381,5 @@ libgnunet_plugin_rest_identity_done (void *cls)
1368 return NULL; 1381 return NULL;
1369} 1382}
1370 1383
1384
1371/* end of plugin_rest_identity.c */ 1385/* end of plugin_rest_identity.c */
diff --git a/src/include/block_fs.h b/src/include/block_fs.h
index 358fb43fa..e4caf6e50 100644
--- a/src/include/block_fs.h
+++ b/src/include/block_fs.h
@@ -41,7 +41,6 @@
41#define MAX_UBLOCK_SIZE (60 * 1024) 41#define MAX_UBLOCK_SIZE (60 * 1024)
42 42
43 43
44
45GNUNET_NETWORK_STRUCT_BEGIN 44GNUNET_NETWORK_STRUCT_BEGIN
46 45
47/** 46/**
diff --git a/src/include/compat.h b/src/include/compat.h
index 19badcefc..729e5e70a 100644
--- a/src/include/compat.h
+++ b/src/include/compat.h
@@ -44,6 +44,7 @@ void*
44GN_memrchr_ (const void *s, 44GN_memrchr_ (const void *s,
45 int c, 45 int c,
46 size_t n); 46 size_t n);
47
47#ifndef HAVE_MEMRCHR 48#ifndef HAVE_MEMRCHR
48#define memrchr(s, c, n) GN_memrchr_ (s, c, n) 49#define memrchr(s, c, n) GN_memrchr_ (s, c, n)
49#endif 50#endif
diff --git a/src/include/gnunet_abd_service.h b/src/include/gnunet_abd_service.h
index b50ff8b86..afec880f1 100644
--- a/src/include/gnunet_abd_service.h
+++ b/src/include/gnunet_abd_service.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -58,15 +58,16 @@ struct GNUNET_ABD_Request;
58/* 58/*
59* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject 59* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
60*/ 60*/
61enum GNUNET_ABD_CredentialFlags { 61enum GNUNET_ABD_CredentialFlags
62{
62 63
63 //Subject had credentials before, but have been revoked now 64 // Subject had credentials before, but have been revoked now
64 GNUNET_ABD_FLAG_REVOKED=0, 65 GNUNET_ABD_FLAG_REVOKED=0,
65 66
66 //Subject flag indicates that the subject is a holder of this credential and may present it as such 67 // Subject flag indicates that the subject is a holder of this credential and may present it as such
67 GNUNET_ABD_FLAG_SUBJECT=1, 68 GNUNET_ABD_FLAG_SUBJECT=1,
68 69
69 //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance 70 // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
70 GNUNET_ABD_FLAG_ISSUER=2 71 GNUNET_ABD_FLAG_ISSUER=2
71 72
72}; 73};
@@ -75,7 +76,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
75/** 76/**
76 * The attribute delegation record 77 * The attribute delegation record
77 */ 78 */
78struct GNUNET_ABD_DelegationRecord { 79struct GNUNET_ABD_DelegationRecord
80{
79 81
80 /** 82 /**
81 * Number of delegation sets in this record 83 * Number of delegation sets in this record
@@ -95,7 +97,8 @@ struct GNUNET_ABD_DelegationRecord {
95/** 97/**
96 * The attribute delegation record 98 * The attribute delegation record
97 */ 99 */
98struct GNUNET_ABD_DelegationRecordSet { 100struct GNUNET_ABD_DelegationRecordSet
101{
99 102
100 /** 103 /**
101 * Public key of the subject this attribute was delegated to 104 * Public key of the subject this attribute was delegated to
@@ -114,7 +117,8 @@ GNUNET_NETWORK_STRUCT_END
114/** 117/**
115 * The attribute delegation record 118 * The attribute delegation record
116 */ 119 */
117struct GNUNET_ABD_DelegationSet { 120struct GNUNET_ABD_DelegationSet
121{
118 122
119 /** 123 /**
120 * Public key of the subject this attribute was delegated to 124 * Public key of the subject this attribute was delegated to
@@ -133,7 +137,8 @@ struct GNUNET_ABD_DelegationSet {
133/** 137/**
134 * A delegation 138 * A delegation
135 */ 139 */
136struct GNUNET_ABD_Delegation { 140struct GNUNET_ABD_Delegation
141{
137 142
138 /** 143 /**
139 * The issuer of the delegation 144 * The issuer of the delegation
@@ -170,7 +175,8 @@ struct GNUNET_ABD_Delegation {
170/** 175/**
171 * A delegate 176 * A delegate
172 */ 177 */
173struct GNUNET_ABD_Delegate { 178struct GNUNET_ABD_Delegate
179{
174 180
175 /** 181 /**
176 * The issuer of the credential 182 * The issuer of the credential
@@ -217,12 +223,13 @@ struct GNUNET_ABD_Delegate {
217/* 223/*
218* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject 224* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
219*/ 225*/
220enum GNUNET_ABD_AlgoDirectionFlags { 226enum GNUNET_ABD_AlgoDirectionFlags
227{
221 228
222 //Subject had credentials before, but have been revoked now 229 // Subject had credentials before, but have been revoked now
223 GNUNET_ABD_FLAG_FORWARD=1 << 0, 230 GNUNET_ABD_FLAG_FORWARD=1 << 0,
224 231
225 //Subject flag indicates that the subject is a holder of this credential and may present it as such 232 // Subject flag indicates that the subject is a holder of this credential and may present it as such
226 GNUNET_ABD_FLAG_BACKWARD=1 << 1 233 GNUNET_ABD_FLAG_BACKWARD=1 << 1
227 234
228}; 235};
@@ -256,14 +263,19 @@ GNUNET_ABD_disconnect (struct GNUNET_ABD_Handle *handle);
256 * @param delegate the delegates 263 * @param delegate the delegates
257 */ 264 */
258typedef void (*GNUNET_ABD_CredentialResultProcessor) (void *cls, 265typedef void (*GNUNET_ABD_CredentialResultProcessor) (void *cls,
259 unsigned int d_count, 266 unsigned int d_count,
260 struct GNUNET_ABD_Delegation *delegation_chain, 267 struct
261 unsigned int c_count, 268 GNUNET_ABD_Delegation *
262 struct GNUNET_ABD_Delegate *delegte); 269 delegation_chain,
263 270 unsigned int c_count,
271 struct GNUNET_ABD_Delegate
272 *delegte);
273
264typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls, 274typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls,
265 struct GNUNET_ABD_Delegation *delegation, 275 struct
266 bool is_bw); 276 GNUNET_ABD_Delegation *
277 delegation,
278 bool is_bw);
267 279
268/** 280/**
269 * Iterator called on obtained result for an attribute delegation. 281 * Iterator called on obtained result for an attribute delegation.
@@ -273,7 +285,7 @@ typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls,
273 * @param result the record data that can be handed to the subject 285 * @param result the record data that can be handed to the subject
274 */ 286 */
275typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls, 287typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls,
276 uint32_t success); 288 uint32_t success);
277 289
278/** 290/**
279 * Iterator called on obtained result for an attribute delegation removal. 291 * Iterator called on obtained result for an attribute delegation removal.
@@ -283,7 +295,7 @@ typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls,
283 * @param result the record data that can be handed to the subject 295 * @param result the record data that can be handed to the subject
284 */ 296 */
285typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls, 297typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls,
286 uint32_t success); 298 uint32_t success);
287 299
288 300
289/** 301/**
@@ -305,28 +317,28 @@ typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls,
305 * @return handle to the queued request 317 * @return handle to the queued request
306 */ 318 */
307struct GNUNET_ABD_Request* 319struct GNUNET_ABD_Request*
308GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle, 320 GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle,
309 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 321 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
310 const char *issuer_attribute, 322 const char *issuer_attribute,
311 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, 323 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
312 uint32_t delegate_count, 324 uint32_t delegate_count,
313 const struct GNUNET_ABD_Delegate *delegates, 325 const struct GNUNET_ABD_Delegate *delegates,
314 enum GNUNET_ABD_AlgoDirectionFlags direction, 326 enum GNUNET_ABD_AlgoDirectionFlags direction,
315 GNUNET_ABD_CredentialResultProcessor proc, 327 GNUNET_ABD_CredentialResultProcessor proc,
316 void *proc_cls, 328 void *proc_cls,
317 GNUNET_ABD_IntermediateResultProcessor, 329 GNUNET_ABD_IntermediateResultProcessor,
318 void *proc2_cls); 330 void *proc2_cls);
319 331
320struct GNUNET_ABD_Request* 332struct GNUNET_ABD_Request*
321GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle, 333 GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
322 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 334 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
323 const char *issuer_attribute, 335 const char *issuer_attribute,
324 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, 336 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
325 enum GNUNET_ABD_AlgoDirectionFlags direction, 337 enum GNUNET_ABD_AlgoDirectionFlags direction,
326 GNUNET_ABD_CredentialResultProcessor proc, 338 GNUNET_ABD_CredentialResultProcessor proc,
327 void *proc_cls, 339 void *proc_cls,
328 GNUNET_ABD_IntermediateResultProcessor, 340 GNUNET_ABD_IntermediateResultProcessor,
329 void *proc2_cls); 341 void *proc2_cls);
330 342
331/** 343/**
332 * Delegate an attribute 344 * Delegate an attribute
@@ -342,12 +354,12 @@ GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
342 */ 354 */
343struct GNUNET_ABD_Request * 355struct GNUNET_ABD_Request *
344GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle, 356GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle,
345 struct GNUNET_IDENTITY_Ego *issuer, 357 struct GNUNET_IDENTITY_Ego *issuer,
346 const char *attribute, 358 const char *attribute,
347 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 359 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
348 const char *delegated_attribute, 360 const char *delegated_attribute,
349 GNUNET_ABD_DelegateResultProcessor proc, 361 GNUNET_ABD_DelegateResultProcessor proc,
350 void *proc_cls); 362 void *proc_cls);
351 363
352/** 364/**
353 * Remove a delegation 365 * Remove a delegation
@@ -361,11 +373,10 @@ GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle,
361 */ 373 */
362struct GNUNET_ABD_Request * 374struct GNUNET_ABD_Request *
363GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle, 375GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle,
364 struct GNUNET_IDENTITY_Ego *issuer, 376 struct GNUNET_IDENTITY_Ego *issuer,
365 const char *attribute, 377 const char *attribute,
366 GNUNET_ABD_RemoveDelegateResultProcessor proc, 378 GNUNET_ABD_RemoveDelegateResultProcessor proc,
367 void *proc_cls); 379 void *proc_cls);
368
369 380
370 381
371/** 382/**
@@ -379,10 +390,10 @@ GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle,
379 */ 390 */
380struct GNUNET_ABD_Delegate* 391struct GNUNET_ABD_Delegate*
381GNUNET_ABD_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, 392GNUNET_ABD_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
382 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 393 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
383 const char *iss_attr, 394 const char *iss_attr,
384 const char *sub_attr, 395 const char *sub_attr,
385 struct GNUNET_TIME_Absolute *expiration); 396 struct GNUNET_TIME_Absolute *expiration);
386 397
387 398
388/** 399/**
diff --git a/src/include/gnunet_abe_lib.h b/src/include/gnunet_abe_lib.h
index fd1df9f0d..7aeb3520d 100644
--- a/src/include/gnunet_abe_lib.h
+++ b/src/include/gnunet_abe_lib.h
@@ -52,7 +52,6 @@ struct GNUNET_CRYPTO_AbeMasterKey;
52struct GNUNET_CRYPTO_AbeKey; 52struct GNUNET_CRYPTO_AbeKey;
53 53
54 54
55
56/** 55/**
57 * @ingroup abe 56 * @ingroup abe
58 * Create a new CP-ABE master key. Caller must free return value. 57 * Create a new CP-ABE master key. Caller must free return value.
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index cd1e62bee..8b8ce3f02 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -148,7 +148,6 @@ struct GNUNET_ATS_PropertiesNBO
148}; 148};
149 149
150 150
151
152/* ********************* LAN Characterization library ************************ */ 151/* ********************* LAN Characterization library ************************ */
153/* Note: these functions do not really communicate with the ATS service */ 152/* Note: these functions do not really communicate with the ATS service */
154 153
@@ -175,7 +174,6 @@ GNUNET_ATS_properties_ntoh (struct GNUNET_ATS_Properties *hbo,
175 const struct GNUNET_ATS_PropertiesNBO *nbo); 174 const struct GNUNET_ATS_PropertiesNBO *nbo);
176 175
177 176
178
179/* ********************Connection Suggestion API ***************************** */ 177/* ********************Connection Suggestion API ***************************** */
180 178
181/** 179/**
@@ -379,7 +377,6 @@ void
379GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar); 377GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar);
380 378
381 379
382
383/* ******************************** Performance API ***************************** */ 380/* ******************************** Performance API ***************************** */
384 381
385/** 382/**
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h
index 5529ca8f4..34dd46dd5 100644
--- a/src/include/gnunet_bio_lib.h
+++ b/src/include/gnunet_bio_lib.h
@@ -137,7 +137,6 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what,
137 f, sizeof(float))) 137 f, sizeof(float)))
138 138
139 139
140
141/** 140/**
142 * Read a double. 141 * Read a double.
143 * 142 *
@@ -270,7 +269,6 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
270 const struct GNUNET_CONTAINER_MetaData *m); 269 const struct GNUNET_CONTAINER_MetaData *m);
271 270
272 271
273
274/** 272/**
275 * Write a float. 273 * Write a float.
276 * 274 *
@@ -280,7 +278,6 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
280#define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float)) 278#define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float))
281 279
282 280
283
284/** 281/**
285 * Write a double. 282 * Write a double.
286 * 283 *
diff --git a/src/include/gnunet_block_plugin.h b/src/include/gnunet_block_plugin.h
index b01134f09..ee237ac03 100644
--- a/src/include/gnunet_block_plugin.h
+++ b/src/include/gnunet_block_plugin.h
@@ -215,7 +215,6 @@ typedef int
215 struct GNUNET_HashCode *key); 215 struct GNUNET_HashCode *key);
216 216
217 217
218
219/** 218/**
220 * Each plugin is required to return a pointer to a struct of this 219 * Each plugin is required to return a pointer to a struct of this
221 * type as the return value from its entry point. 220 * type as the return value from its entry point.
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 4af43d857..4fdc2d777 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -418,6 +418,7 @@ GNUNET_get_log_call_status (int caller_level,
418 const char *file, 418 const char *file,
419 const char *function, 419 const char *function,
420 int line); 420 int line);
421
421#endif 422#endif
422 423
423 424
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 4df8d8965..302429430 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -341,7 +341,6 @@ GNUNET_CONFIGURATION_get_value_time (const struct
341 struct GNUNET_TIME_Relative *time); 341 struct GNUNET_TIME_Relative *time);
342 342
343 343
344
345/** 344/**
346 * Get a configuration value that should be a size in bytes. 345 * Get a configuration value that should be a size in bytes.
347 * 346 *
diff --git a/src/include/gnunet_consensus_service.h b/src/include/gnunet_consensus_service.h
index 35cf424fb..9387aa095 100644
--- a/src/include/gnunet_consensus_service.h
+++ b/src/include/gnunet_consensus_service.h
@@ -68,7 +68,6 @@ typedef void (*GNUNET_CONSENSUS_ElementCallback) (void *cls,
68 GNUNET_SET_Element *element); 68 GNUNET_SET_Element *element);
69 69
70 70
71
72/** 71/**
73 * Opaque handle for the consensus service. 72 * Opaque handle for the consensus service.
74 */ 73 */
@@ -139,7 +138,6 @@ GNUNET_CONSENSUS_insert (struct GNUNET_CONSENSUS_Handle *consensus,
139 void *idc_cls); 138 void *idc_cls);
140 139
141 140
142
143/** 141/**
144 * Called when a conclusion was successful. 142 * Called when a conclusion was successful.
145 * 143 *
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index e2678a60e..e1572635f 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -41,7 +41,6 @@ extern "C"
41#endif 41#endif
42 42
43 43
44
45/** 44/**
46 * Bandwidth (in/out) to assume initially (before either peer has 45 * Bandwidth (in/out) to assume initially (before either peer has
47 * communicated any particular preference). Should be rather low; set 46 * communicated any particular preference). Should be rather low; set
@@ -165,8 +164,6 @@ extern "C"
165#define GNUNET_CONSTANTS_BLOOMFILTER_K 16 164#define GNUNET_CONSTANTS_BLOOMFILTER_K 16
166 165
167 166
168
169
170#if 0 /* keep Emacsens' auto-indent happy */ 167#if 0 /* keep Emacsens' auto-indent happy */
171{ 168{
172#endif 169#endif
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h
index 57b813225..c99db67bc 100644
--- a/src/include/gnunet_datastore_service.h
+++ b/src/include/gnunet_datastore_service.h
@@ -341,7 +341,6 @@ GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h,
341 void *proc_cls); 341 void *proc_cls);
342 342
343 343
344
345/** 344/**
346 * Cancel a datastore operation. The final callback from the 345 * Cancel a datastore operation. The final callback from the
347 * operation must not have been done yet. 346 * operation must not have been done yet.
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index 573a800e5..ea3ea92fa 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -55,7 +55,6 @@ extern "C"
55 GNUNET_TIME_UNIT_MINUTES, 60) 55 GNUNET_TIME_UNIT_MINUTES, 60)
56 56
57 57
58
59/** 58/**
60 * Connection to the DHT service. 59 * Connection to the DHT service.
61 */ 60 */
@@ -356,7 +355,6 @@ typedef void
356 size_t size); 355 size_t size);
357 356
358 357
359
360/** 358/**
361 * Start monitoring the local DHT service. 359 * Start monitoring the local DHT service.
362 * 360 *
diff --git a/src/include/gnunet_dns_service.h b/src/include/gnunet_dns_service.h
index da2881e5b..66f6890f8 100644
--- a/src/include/gnunet_dns_service.h
+++ b/src/include/gnunet_dns_service.h
@@ -96,7 +96,6 @@ enum GNUNET_DNS_Flags
96}; 96};
97 97
98 98
99
100/** 99/**
101 * Signature of a function that is called whenever the DNS service 100 * Signature of a function that is called whenever the DNS service
102 * encounters a DNS request and needs to do something with it. The 101 * encounters a DNS request and needs to do something with it. The
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h
index cbb53e416..8d882a216 100644
--- a/src/include/gnunet_dnsparser_lib.h
+++ b/src/include/gnunet_dnsparser_lib.h
@@ -407,7 +407,6 @@ struct GNUNET_DNSPARSER_CaaRecord
407}; 407};
408 408
409 409
410
411/** 410/**
412 * Binary record information (unparsed). 411 * Binary record information (unparsed).
413 */ 412 */
diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h
index 6683a08d7..512a9b93b 100644
--- a/src/include/gnunet_fragmentation_lib.h
+++ b/src/include/gnunet_fragmentation_lib.h
@@ -218,7 +218,6 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
218 const struct GNUNET_MessageHeader *msg); 218 const struct GNUNET_MessageHeader *msg);
219 219
220 220
221
222#if 0 /* keep Emacsens' auto-indent happy */ 221#if 0 /* keep Emacsens' auto-indent happy */
223{ 222{
224#endif 223#endif
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 2b25b5c81..01d736e89 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -103,7 +103,6 @@ typedef int
103 int is_mandatory); 103 int is_mandatory);
104 104
105 105
106
107/** 106/**
108 * Get a unique key from a URI. This is for putting URIs 107 * Get a unique key from a URI. This is for putting URIs
109 * into HashMaps. The key may change between FS implementations. 108 * into HashMaps. The key may change between FS implementations.
@@ -491,7 +490,6 @@ GNUNET_FS_getopt_set_metadata (struct
491 const char *value); 490 const char *value);
492 491
493 492
494
495/* ************************* sharing API ***************** */ 493/* ************************* sharing API ***************** */
496 494
497 495
@@ -2343,7 +2341,6 @@ enum GNUNET_FS_DownloadOptions
2343}; 2341};
2344 2342
2345 2343
2346
2347/** 2344/**
2348 * Download parts of a file. Note that this will store 2345 * Download parts of a file. Note that this will store
2349 * the blocks at the respective offset in the given file. Also, the 2346 * the blocks at the respective offset in the given file. Also, the
@@ -2456,7 +2453,6 @@ void
2456GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc); 2453GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc);
2457 2454
2458 2455
2459
2460/* ******************** Directory API *********************** */ 2456/* ******************** Directory API *********************** */
2461 2457
2462 2458
diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h
index 04dddeb92..74e7bf492 100644
--- a/src/include/gnunet_my_lib.h
+++ b/src/include/gnunet_my_lib.h
@@ -44,7 +44,6 @@ extern "C"
44#endif 44#endif
45 45
46 46
47
48/** 47/**
49 * Information we pass to #GNUNET_MY_exec_prepared() to 48 * Information we pass to #GNUNET_MY_exec_prepared() to
50 * initialize the arguments of the prepared statement. 49 * initialize the arguments of the prepared statement.
@@ -258,7 +257,6 @@ struct GNUNET_MY_ResultSpec
258#define GNUNET_MY_result_spec_end { NULL, NULL, NULL, 0, NULL, 0, 0 } 257#define GNUNET_MY_result_spec_end { NULL, NULL, NULL, 0, NULL, 0, 0 }
259 258
260 259
261
262/** 260/**
263 * Obtain fixed size result of @a ptr_size bytes from 261 * Obtain fixed size result of @a ptr_size bytes from
264 * MySQL, store in already allocated buffer at @a ptr. 262 * MySQL, store in already allocated buffer at @a ptr.
diff --git a/src/include/gnunet_namecache_service.h b/src/include/gnunet_namecache_service.h
index da2121d31..07b26aec3 100644
--- a/src/include/gnunet_namecache_service.h
+++ b/src/include/gnunet_namecache_service.h
@@ -104,7 +104,6 @@ typedef void
104 const char *emsg); 104 const char *emsg);
105 105
106 106
107
108/** 107/**
109 * Store an item in the namecache. If the item is already present, 108 * Store an item in the namecache. If the item is already present,
110 * it is replaced with the new record. 109 * it is replaced with the new record.
diff --git a/src/include/gnunet_nat_service.h b/src/include/gnunet_nat_service.h
index 4273b5ad1..b66c188cc 100644
--- a/src/include/gnunet_nat_service.h
+++ b/src/include/gnunet_nat_service.h
@@ -236,7 +236,6 @@ enum GNUNET_NAT_StatusCode
236}; 236};
237 237
238 238
239
240/** 239/**
241 * What the situation of the NAT connectivity 240 * What the situation of the NAT connectivity
242 */ 241 */
@@ -269,7 +268,6 @@ enum GNUNET_NAT_Type
269}; 268};
270 269
271 270
272
273/** 271/**
274 * Signature of the callback passed to #GNUNET_NAT_register() for 272 * Signature of the callback passed to #GNUNET_NAT_register() for
275 * a function to call whenever our set of 'valid' addresses changes. 273 * a function to call whenever our set of 'valid' addresses changes.
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index e4c0d6cdb..2eada2783 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -625,7 +625,6 @@ int
625GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); 625GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
626 626
627 627
628
629/** 628/**
630 * Retrieve the status of a process, waiting on it if dead. 629 * Retrieve the status of a process, waiting on it if dead.
631 * Blocking version. 630 * Blocking version.
diff --git a/src/include/gnunet_rps_service.h b/src/include/gnunet_rps_service.h
index b6f2e2456..f5df8639f 100644
--- a/src/include/gnunet_rps_service.h
+++ b/src/include/gnunet_rps_service.h
@@ -200,6 +200,7 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
200 uint32_t num_peers, 200 uint32_t num_peers,
201 const struct GNUNET_PeerIdentity *ids, 201 const struct GNUNET_PeerIdentity *ids,
202 const struct GNUNET_PeerIdentity *target_peer); 202 const struct GNUNET_PeerIdentity *target_peer);
203
203#endif /* ENABLE_MALICIOUS */ 204#endif /* ENABLE_MALICIOUS */
204 205
205/* Get internals for debugging/profiling purposes */ 206/* Get internals for debugging/profiling purposes */
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index da968737e..b828e2db7 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -209,8 +209,6 @@ struct GNUNET_SCHEDULER_TaskContext
209}; 209};
210 210
211 211
212
213
214/** 212/**
215 * Function used by event-loop implementations to signal the scheduler 213 * Function used by event-loop implementations to signal the scheduler
216 * that a particular @a task is ready due to an event specified in the 214 * that a particular @a task is ready due to an event specified in the
@@ -907,7 +905,6 @@ GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select,
907 void *new_select_cls); 905 void *new_select_cls);
908 906
909 907
910
911/** 908/**
912 * Change the async scope for the currently executing task and (transitively) 909 * Change the async scope for the currently executing task and (transitively)
913 * for all tasks scheduled by the current task after calling this function. 910 * for all tasks scheduled by the current task after calling this function.
@@ -924,7 +921,6 @@ void
924GNUNET_SCHEDULER_begin_async_scope (struct GNUNET_AsyncScopeId *aid); 921GNUNET_SCHEDULER_begin_async_scope (struct GNUNET_AsyncScopeId *aid);
925 922
926 923
927
928#if 0 /* keep Emacsens' auto-indent happy */ 924#if 0 /* keep Emacsens' auto-indent happy */
929{ 925{
930#endif 926#endif
diff --git a/src/include/gnunet_secretsharing_service.h b/src/include/gnunet_secretsharing_service.h
index 9bacee06e..127f1db78 100644
--- a/src/include/gnunet_secretsharing_service.h
+++ b/src/include/gnunet_secretsharing_service.h
@@ -95,7 +95,6 @@ extern "C"
95 "1d7024c3650f60d0da" 95 "1d7024c3650f60d0da"
96 96
97 97
98
99/** 98/**
100 * Session that will eventually establish a shared secred between 99 * Session that will eventually establish a shared secred between
101 * the involved peers and allow encryption and cooperative decryption. 100 * the involved peers and allow encryption and cooperative decryption.
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index 19a5fb89b..ad238a0fa 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -84,7 +84,6 @@ enum GNUNET_SERVICE_Options
84}; 84};
85 85
86 86
87
88/* **************** NEW SERVICE API ********************** */ 87/* **************** NEW SERVICE API ********************** */
89 88
90/** 89/**
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h
index 13f761d7d..187c65626 100644
--- a/src/include/gnunet_set_service.h
+++ b/src/include/gnunet_set_service.h
@@ -153,7 +153,6 @@ enum GNUNET_SET_Status
153}; 153};
154 154
155 155
156
157/** 156/**
158 * The way results are given to the client. 157 * The way results are given to the client.
159 */ 158 */
@@ -324,7 +323,6 @@ typedef void
324 struct GNUNET_SET_Request *request); 323 struct GNUNET_SET_Request *request);
325 324
326 325
327
328typedef void 326typedef void
329(*GNUNET_SET_CopyReadyCallback) (void *cls, 327(*GNUNET_SET_CopyReadyCallback) (void *cls,
330 struct GNUNET_SET_Handle *copy); 328 struct GNUNET_SET_Handle *copy);
diff --git a/src/include/gnunet_sq_lib.h b/src/include/gnunet_sq_lib.h
index b6b09eb67..21ce5b393 100644
--- a/src/include/gnunet_sq_lib.h
+++ b/src/include/gnunet_sq_lib.h
@@ -98,7 +98,6 @@ GNUNET_SQ_query_param_fixed_size (const void *ptr,
98 size_t ptr_size); 98 size_t ptr_size);
99 99
100 100
101
102/** 101/**
103 * Generate query parameter for a string. 102 * Generate query parameter for a string.
104 * 103 *
@@ -452,7 +451,6 @@ void
452GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs); 451GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs);
453 452
454 453
455
456/* ******************** sq_prepare.c functions ************** */ 454/* ******************** sq_prepare.c functions ************** */
457 455
458 456
@@ -492,7 +490,6 @@ GNUNET_SQ_make_prepare (const char *sql,
492 sqlite3_stmt **pstmt); 490 sqlite3_stmt **pstmt);
493 491
494 492
495
496/** 493/**
497 * Prepare all statements given in the (NULL,NULL)-terminated 494 * Prepare all statements given in the (NULL,NULL)-terminated
498 * array at @a ps 495 * array at @a ps
@@ -568,7 +565,6 @@ GNUNET_SQ_exec_statements (sqlite3 *dbh,
568 const struct GNUNET_SQ_ExecuteStatement *es); 565 const struct GNUNET_SQ_ExecuteStatement *es);
569 566
570 567
571
572#endif /* GNUNET_SQ_LIB_H_ */ 568#endif /* GNUNET_SQ_LIB_H_ */
573 569
574/* end of include/gnunet_sq_lib.h */ 570/* end of include/gnunet_sq_lib.h */
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h
index dfb03d67a..20e958865 100644
--- a/src/include/gnunet_statistics_service.h
+++ b/src/include/gnunet_statistics_service.h
@@ -218,7 +218,6 @@ GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle,
218 int make_persistent); 218 int make_persistent);
219 219
220 220
221
222#if 0 /* keep Emacsens' auto-indent happy */ 221#if 0 /* keep Emacsens' auto-indent happy */
223{ 222{
224#endif 223#endif
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h
index 7f532c97a..0c659bfb3 100644
--- a/src/include/gnunet_strings_lib.h
+++ b/src/include/gnunet_strings_lib.h
@@ -235,7 +235,6 @@ GNUNET_STRINGS_buffer_tokenize (const char *buffer,
235 unsigned int count, ...); 235 unsigned int count, ...);
236 236
237 237
238
239/** 238/**
240 * @ingroup time 239 * @ingroup time
241 * Like `asctime`, except for GNUnet time. Converts a GNUnet internal 240 * Like `asctime`, except for GNUnet time. Converts a GNUnet internal
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h
index d45f5bc34..03c372623 100644
--- a/src/include/gnunet_testbed_service.h
+++ b/src/include/gnunet_testbed_service.h
@@ -95,7 +95,6 @@ GNUNET_TESTBED_host_create (const char *hostname,
95 uint16_t port); 95 uint16_t port);
96 96
97 97
98
99/** 98/**
100 * Create a host to run peers and controllers on. This function is used 99 * Create a host to run peers and controllers on. This function is used
101 * if a peer learns about a host via IPC between controllers (and thus 100 * if a peer learns about a host via IPC between controllers (and thus
@@ -875,7 +874,6 @@ GNUNET_TESTBED_shutdown_peers (struct GNUNET_TESTBED_Controller *c,
875 void *cb_cls); 874 void *cb_cls);
876 875
877 876
878
879/** 877/**
880 * Options for peer connections. 878 * Options for peer connections.
881 */ 879 */
@@ -943,7 +941,6 @@ GNUNET_TESTBED_underlay_configure_link (void *op_cls,
943 ...); 941 ...);
944 942
945 943
946
947/** 944/**
948 * Topologies and topology options supported for testbeds. Options should always 945 * Topologies and topology options supported for testbeds. Options should always
949 * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END 946 * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 3c3ef8f2e..22e142e43 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -242,6 +242,7 @@ GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system,
242int 242int
243GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system, 243GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system,
244 struct GNUNET_CONFIGURATION_Handle *cfg); 244 struct GNUNET_CONFIGURATION_Handle *cfg);
245
245// FIXME: add dual to 'release' ports again... 246// FIXME: add dual to 'release' ports again...
246 247
247 248
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index fd6010f5d..6f14de2f4 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -163,7 +163,6 @@ GNUNET_NETWORK_STRUCT_END
163#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ () 163#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ ()
164 164
165 165
166
167/** 166/**
168 * Threshold after which exponential backoff should not increase (15 m). 167 * Threshold after which exponential backoff should not increase (15 m).
169 */ 168 */
@@ -326,7 +325,6 @@ GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1,
326 struct GNUNET_TIME_Relative t2); 325 struct GNUNET_TIME_Relative t2);
327 326
328 327
329
330/** 328/**
331 * Return the maximum of two relative time values. 329 * Return the maximum of two relative time values.
332 * 330 *
diff --git a/src/include/platform.h b/src/include/platform.h
index 85f451bea..dd5e28760 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -205,6 +205,7 @@
205#if ! HAVE_ATOLL 205#if ! HAVE_ATOLL
206long long 206long long
207atoll (const char *nptr); 207atoll (const char *nptr);
208
208#endif 209#endif
209 210
210#if ENABLE_NLS 211#if ENABLE_NLS
diff --git a/src/json/json_generator.c b/src/json/json_generator.c
index 72ee05dfc..6373d65d8 100644
--- a/src/json/json_generator.c
+++ b/src/json/json_generator.c
@@ -161,6 +161,7 @@ GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig)
161 return ret; 161 return ret;
162} 162}
163 163
164
164/** 165/**
165 * Convert GNS record to JSON. 166 * Convert GNS record to JSON.
166 * 167 *
diff --git a/src/json/json_mhd.c b/src/json/json_mhd.c
index 602a15b7a..dac4a5f2d 100644
--- a/src/json/json_mhd.c
+++ b/src/json/json_mhd.c
@@ -364,4 +364,5 @@ GNUNET_JSON_post_parser_cleanup (void *con_cls)
364 } 364 }
365} 365}
366 366
367
367/* end of mhd_json.c */ 368/* end of mhd_json.c */
diff --git a/src/json/test_json.c b/src/json/test_json.c
index f77d9add9..4485a37a4 100644
--- a/src/json/test_json.c
+++ b/src/json/test_json.c
@@ -225,4 +225,5 @@ main (int argc, const char *const argv[])
225 return 0; 225 return 0;
226} 226}
227 227
228
228/* end of test_json.c */ 229/* end of test_json.c */
diff --git a/src/json/test_json_mhd.c b/src/json/test_json_mhd.c
index 6af1edd86..5ab1b63ca 100644
--- a/src/json/test_json_mhd.c
+++ b/src/json/test_json_mhd.c
@@ -188,4 +188,5 @@ main (int argc, const char *const argv[])
188 return global_ret; 188 return global_ret;
189} 189}
190 190
191
191/* end of test_json_mhd.c */ 192/* end of test_json_mhd.c */
diff --git a/src/namecache/gnunet-namecache.c b/src/namecache/gnunet-namecache.c
index 20729e125..15a0c96ee 100644
--- a/src/namecache/gnunet-namecache.c
+++ b/src/namecache/gnunet-namecache.c
@@ -242,4 +242,5 @@ main (int argc, char *const *argv)
242 return ret; 242 return ret;
243} 243}
244 244
245
245/* end of gnunet-namecache.c */ 246/* end of gnunet-namecache.c */
diff --git a/src/namecache/plugin_namecache_flat.c b/src/namecache/plugin_namecache_flat.c
index 14406c13d..69b54fcf3 100644
--- a/src/namecache/plugin_namecache_flat.c
+++ b/src/namecache/plugin_namecache_flat.c
@@ -188,6 +188,7 @@ database_setup (struct Plugin *plugin)
188 return GNUNET_OK; 188 return GNUNET_OK;
189} 189}
190 190
191
191/** 192/**
192 * Store values in hashmap in file and free data 193 * Store values in hashmap in file and free data
193 * 194 *
@@ -232,6 +233,7 @@ store_and_free_entries (void *cls,
232 return GNUNET_YES; 233 return GNUNET_YES;
233} 234}
234 235
236
235/** 237/**
236 * Shutdown database connection and associate data 238 * Shutdown database connection and associate data
237 * structures. 239 * structures.
@@ -263,6 +265,7 @@ database_shutdown (struct Plugin *plugin)
263 GNUNET_DISK_file_close (fh); 265 GNUNET_DISK_file_close (fh);
264} 266}
265 267
268
266static int 269static int
267expire_blocks (void *cls, 270expire_blocks (void *cls,
268 const struct GNUNET_HashCode *key, 271 const struct GNUNET_HashCode *key,
@@ -285,7 +288,6 @@ expire_blocks (void *cls,
285} 288}
286 289
287 290
288
289/** 291/**
290 * Removes any expired block. 292 * Removes any expired block.
291 * 293 *
@@ -430,4 +432,5 @@ libgnunet_plugin_namecache_flat_done (void *cls)
430 return NULL; 432 return NULL;
431} 433}
432 434
435
433/* end of plugin_namecache_sqlite.c */ 436/* end of plugin_namecache_sqlite.c */
diff --git a/src/namecache/plugin_namecache_postgres.c b/src/namecache/plugin_namecache_postgres.c
index 35bf5c2ff..f4a114e22 100644
--- a/src/namecache/plugin_namecache_postgres.c
+++ b/src/namecache/plugin_namecache_postgres.c
@@ -348,4 +348,5 @@ libgnunet_plugin_namecache_postgres_done (void *cls)
348 return NULL; 348 return NULL;
349} 349}
350 350
351
351/* end of plugin_namecache_postgres.c */ 352/* end of plugin_namecache_postgres.c */
diff --git a/src/namecache/plugin_namecache_sqlite.c b/src/namecache/plugin_namecache_sqlite.c
index ee3ec7eab..8f762cb40 100644
--- a/src/namecache/plugin_namecache_sqlite.c
+++ b/src/namecache/plugin_namecache_sqlite.c
@@ -592,4 +592,5 @@ libgnunet_plugin_namecache_sqlite_done (void *cls)
592 return NULL; 592 return NULL;
593} 593}
594 594
595
595/* end of plugin_namecache_sqlite.c */ 596/* end of plugin_namecache_sqlite.c */
diff --git a/src/namecache/test_namecache_api_cache_block.c b/src/namecache/test_namecache_api_cache_block.c
index 2b25a26f9..9b150c9d9 100644
--- a/src/namecache/test_namecache_api_cache_block.c
+++ b/src/namecache/test_namecache_api_cache_block.c
@@ -148,6 +148,7 @@ name_lookup_proc (void *cls,
148 (void *) name)); 148 (void *) name));
149} 149}
150 150
151
151static void 152static void
152cache_cont (void *cls, int32_t success, const char *emsg) 153cache_cont (void *cls, int32_t success, const char *emsg)
153{ 154{
diff --git a/src/namecache/test_plugin_namecache.c b/src/namecache/test_plugin_namecache.c
index e4ca145d7..5e0cd7cfd 100644
--- a/src/namecache/test_plugin_namecache.c
+++ b/src/namecache/test_plugin_namecache.c
@@ -128,4 +128,5 @@ main (int argc, char *argv[])
128 return ok; 128 return ok;
129} 129}
130 130
131
131/* end of test_plugin_namecache.c */ 132/* end of test_plugin_namecache.c */
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 93048ca1a..ca9f6ed0e 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -698,6 +698,7 @@ lookup_it_processor (void *cls,
698 GNUNET_NAMESTORE_zone_iterator_next (request->lookup_it, 1); 698 GNUNET_NAMESTORE_zone_iterator_next (request->lookup_it, 1);
699} 699}
700 700
701
701static void 702static void
702lookup_it_finished (void *cls) 703lookup_it_finished (void *cls)
703{ 704{
@@ -729,6 +730,7 @@ lookup_it_finished (void *cls)
729 request); 730 request);
730} 731}
731 732
733
732/** 734/**
733 * Main MHD callback for handling requests. 735 * Main MHD callback for handling requests.
734 * 736 *
@@ -1212,4 +1214,5 @@ main (int argc,
1212 return ret; 1214 return ret;
1213} 1215}
1214 1216
1217
1215/* end of gnunet-namestore-fcfsd.c */ 1218/* end of gnunet-namestore-fcfsd.c */
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 65c0f7726..df2b49a62 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -1677,4 +1677,5 @@ main (int argc, char *const *argv)
1677 return ret; 1677 return ret;
1678} 1678}
1679 1679
1680
1680/* end of gnunet-namestore.c */ 1681/* end of gnunet-namestore.c */
diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c
index bbbe7d783..eca02bdc3 100644
--- a/src/namestore/gnunet-zoneimport.c
+++ b/src/namestore/gnunet-zoneimport.c
@@ -1881,4 +1881,5 @@ main (int argc, char *const *argv)
1881 return 0; 1881 return 0;
1882} 1882}
1883 1883
1884
1884/* end of gnunet-zoneimport.c */ 1885/* end of gnunet-zoneimport.c */
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h
index 0fb5bea7c..6f45ab1c1 100644
--- a/src/namestore/namestore.h
+++ b/src/namestore/namestore.h
@@ -185,7 +185,6 @@ struct LabelLookupResponseMessage
185}; 185};
186 186
187 187
188
189/** 188/**
190 * Lookup a name for a zone hash 189 * Lookup a name for a zone hash
191 */ 190 */
@@ -340,7 +339,6 @@ struct ZoneMonitorNextMessage
340}; 339};
341 340
342 341
343
344/** 342/**
345 * Start a zone iteration for the given zone 343 * Start a zone iteration for the given zone
346 */ 344 */
diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c
index a7046c940..ab6140328 100644
--- a/src/namestore/namestore_api_monitor.c
+++ b/src/namestore/namestore_api_monitor.c
@@ -384,4 +384,5 @@ GNUNET_NAMESTORE_zone_monitor_stop (struct GNUNET_NAMESTORE_ZoneMonitor *zm)
384 GNUNET_free (zm); 384 GNUNET_free (zm);
385} 385}
386 386
387
387/* end of namestore_api_monitor.c */ 388/* end of namestore_api_monitor.c */
diff --git a/src/namestore/plugin_namestore_flat.c b/src/namestore/plugin_namestore_flat.c
index 89cab6e52..dbceab45d 100644
--- a/src/namestore/plugin_namestore_flat.c
+++ b/src/namestore/plugin_namestore_flat.c
@@ -811,4 +811,5 @@ libgnunet_plugin_namestore_flat_done (void *cls)
811 return NULL; 811 return NULL;
812} 812}
813 813
814
814/* end of plugin_namestore_flat.c */ 815/* end of plugin_namestore_flat.c */
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c
index 23893538b..d0fc33fe9 100644
--- a/src/namestore/plugin_namestore_postgres.c
+++ b/src/namestore/plugin_namestore_postgres.c
@@ -622,4 +622,5 @@ libgnunet_plugin_namestore_postgres_done (void *cls)
622 return NULL; 622 return NULL;
623} 623}
624 624
625
625/* end of plugin_namestore_postgres.c */ 626/* end of plugin_namestore_postgres.c */
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c
index fbf30567b..a909221e2 100644
--- a/src/namestore/plugin_namestore_sqlite.c
+++ b/src/namestore/plugin_namestore_sqlite.c
@@ -787,4 +787,5 @@ libgnunet_plugin_namestore_sqlite_done (void *cls)
787 return NULL; 787 return NULL;
788} 788}
789 789
790
790/* end of plugin_namestore_sqlite.c */ 791/* end of plugin_namestore_sqlite.c */
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index 07b3840c5..d2a93a286 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -947,4 +947,5 @@ libgnunet_plugin_rest_namestore_done (void *cls)
947 return NULL; 947 return NULL;
948} 948}
949 949
950
950/* end of plugin_rest_namestore.c */ 951/* end of plugin_rest_namestore.c */
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c
index 976e8bc1e..b3946de34 100644
--- a/src/namestore/test_namestore_api_lookup_nick.c
+++ b/src/namestore/test_namestore_api_lookup_nick.c
@@ -305,6 +305,7 @@ run (void *cls,
305 } 305 }
306} 306}
307 307
308
308#include "test_common.c" 309#include "test_common.c"
309 310
310 311
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c
index f7271cd76..a23424d30 100644
--- a/src/namestore/test_namestore_api_monitoring.c
+++ b/src/namestore/test_namestore_api_monitoring.c
@@ -30,7 +30,6 @@
30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
31 31
32 32
33
34#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) 33#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
35 34
36 35
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c
index 10160cd13..ff826804e 100644
--- a/src/namestore/test_namestore_api_remove.c
+++ b/src/namestore/test_namestore_api_remove.c
@@ -222,4 +222,5 @@ main (int argc, char *argv[])
222 return res; 222 return res;
223} 223}
224 224
225
225/* end of test_namestore_api_remove.c */ 226/* end of test_namestore_api_remove.c */
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c
index 5558696a8..217f8a51a 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -179,4 +179,5 @@ main (int argc, char *argv[])
179 return res; 179 return res;
180} 180}
181 181
182
182/* end of test_namestore_api_remove_not_existing_record.c */ 183/* end of test_namestore_api_remove_not_existing_record.c */
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
index 50c247b14..d37fb8cd3 100644
--- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -455,4 +455,5 @@ main (int argc, char *argv[])
455 return res; 455 return res;
456} 456}
457 457
458
458/* end of test_namestore_api_zone_iteration_specific_zone.c */ 459/* end of test_namestore_api_zone_iteration_specific_zone.c */
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c
index 2f8ea9a97..81fb4de7e 100644
--- a/src/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/namestore/test_namestore_api_zone_iteration_stop.c
@@ -473,4 +473,5 @@ main (int argc, char *argv[])
473 return res; 473 return res;
474} 474}
475 475
476
476/* end of test_namestore_api_zone_iteration_stop.c */ 477/* end of test_namestore_api_zone_iteration_stop.c */
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 68f2461f1..65366e267 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -266,4 +266,5 @@ main (int argc,
266 return res; 266 return res;
267} 267}
268 268
269
269/* end of test_namestore_api_zone_to_name.c */ 270/* end of test_namestore_api_zone_to_name.c */
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c
index 03b1a21e4..0f9ce97e4 100644
--- a/src/namestore/test_plugin_namestore.c
+++ b/src/namestore/test_plugin_namestore.c
@@ -201,4 +201,5 @@ main (int argc, char *argv[])
201 return ok; 201 return ok;
202} 202}
203 203
204
204/* end of test_plugin_namestore.c */ 205/* end of test_plugin_namestore.c */
diff --git a/src/nat-auto/gnunet-nat-auto_legacy.c b/src/nat-auto/gnunet-nat-auto_legacy.c
index 0a531d5cd..8ba50c184 100644
--- a/src/nat-auto/gnunet-nat-auto_legacy.c
+++ b/src/nat-auto/gnunet-nat-auto_legacy.c
@@ -593,4 +593,5 @@ GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst)
593 GNUNET_free (tst); 593 GNUNET_free (tst);
594} 594}
595 595
596
596/* end of nat_test.c */ 597/* end of nat_test.c */
diff --git a/src/nat-auto/gnunet-nat-server.c b/src/nat-auto/gnunet-nat-server.c
index 5186cb8c0..499893c70 100644
--- a/src/nat-auto/gnunet-nat-server.c
+++ b/src/nat-auto/gnunet-nat-server.c
@@ -320,7 +320,6 @@ force_timeout (void *cls)
320} 320}
321 321
322 322
323
324/** 323/**
325 * Callback called when a client connects to the service. 324 * Callback called when a client connects to the service.
326 * 325 *
@@ -395,9 +394,9 @@ GNUNET_ARM_memory_init ()
395 mallopt (M_TOP_PAD, 1 * 1024); 394 mallopt (M_TOP_PAD, 1 * 1024);
396 malloc_trim (0); 395 malloc_trim (0);
397} 396}
398#endif
399 397
400 398
399#endif
401 400
402 401
403/* end of gnunet-nat-server.c */ 402/* end of gnunet-nat-server.c */
diff --git a/src/nat-auto/gnunet-service-nat-auto.c b/src/nat-auto/gnunet-service-nat-auto.c
index 2c7faae2e..51c82f6b3 100644
--- a/src/nat-auto/gnunet-service-nat-auto.c
+++ b/src/nat-auto/gnunet-service-nat-auto.c
@@ -481,6 +481,8 @@ GNUNET_ARM_memory_init ()
481 mallopt (M_TOP_PAD, 1 * 1024); 481 mallopt (M_TOP_PAD, 1 * 1024);
482 malloc_trim (0); 482 malloc_trim (0);
483} 483}
484
485
484#endif 486#endif
485 487
486/* end of gnunet-service-nat.c */ 488/* end of gnunet-service-nat.c */
diff --git a/src/nat-auto/nat-auto.h b/src/nat-auto/nat-auto.h
index bee8ecf26..ac0e7c2d5 100644
--- a/src/nat-auto/nat-auto.h
+++ b/src/nat-auto/nat-auto.h
@@ -29,7 +29,6 @@
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30 30
31 31
32
33GNUNET_NETWORK_STRUCT_BEGIN 32GNUNET_NETWORK_STRUCT_BEGIN
34 33
35/** 34/**
diff --git a/src/nat-auto/nat_auto_api.c b/src/nat-auto/nat_auto_api.c
index f7a821a82..3c982f883 100644
--- a/src/nat-auto/nat_auto_api.c
+++ b/src/nat-auto/nat_auto_api.c
@@ -31,7 +31,6 @@
31#include "nat-auto.h" 31#include "nat-auto.h"
32 32
33 33
34
35/** 34/**
36 * Handle to auto-configuration in progress. 35 * Handle to auto-configuration in progress.
37 */ 36 */
@@ -289,4 +288,5 @@ GNUNET_NAT_AUTO_autoconfig_cancel (struct GNUNET_NAT_AUTO_AutoHandle *ah)
289 GNUNET_free (ah); 288 GNUNET_free (ah);
290} 289}
291 290
291
292/* end of nat_api_auto.c */ 292/* end of nat_api_auto.c */
diff --git a/src/nat-auto/nat_auto_api_test.c b/src/nat-auto/nat_auto_api_test.c
index 0d35d869f..ec7557cd0 100644
--- a/src/nat-auto/nat_auto_api_test.c
+++ b/src/nat-auto/nat_auto_api_test.c
@@ -598,4 +598,5 @@ GNUNET_NAT_AUTO_test_stop (struct GNUNET_NAT_AUTO_Test *tst)
598 GNUNET_free (tst); 598 GNUNET_free (tst);
599} 599}
600 600
601
601/* end of nat_auto_api_test.c */ 602/* end of nat_auto_api_test.c */
diff --git a/src/nat/gnunet-helper-nat-client.c b/src/nat/gnunet-helper-nat-client.c
index 5d12092e7..12abfd2df 100644
--- a/src/nat/gnunet-helper-nat-client.c
+++ b/src/nat/gnunet-helper-nat-client.c
@@ -541,4 +541,5 @@ cleanup:
541 return global_ret; 541 return global_ret;
542} 542}
543 543
544
544/* end of gnunet-helper-nat-client.c */ 545/* end of gnunet-helper-nat-client.c */
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 59a340324..9a70622c4 100644
--- a/src/nat/gnunet-service-nat.c
+++ b/src/nat/gnunet-service-nat.c
@@ -1732,8 +1732,7 @@ handle_stun (void *cls,
1732 removed again. The timeout frequency should be configurable 1732 removed again. The timeout frequency should be configurable
1733 (with a sane default), so that the UDP plugin can tell how 1733 (with a sane default), so that the UDP plugin can tell how
1734 often to re-request STUN. 1734 often to re-request STUN.
1735 */ 1735 */struct StunExternalIP *se;
1736 struct StunExternalIP *se;
1737 1736
1738 /* Check if we had a prior response from this STUN server */ 1737 /* Check if we had a prior response from this STUN server */
1739 for (se = se_head; NULL != se; se = se->next) 1738 for (se = se_head; NULL != se; se = se->next)
@@ -2077,6 +2076,8 @@ GNUNET_ARM_memory_init ()
2077 mallopt (M_TOP_PAD, 1 * 1024); 2076 mallopt (M_TOP_PAD, 1 * 1024);
2078 malloc_trim (0); 2077 malloc_trim (0);
2079} 2078}
2079
2080
2080#endif 2081#endif
2081 2082
2082/* end of gnunet-service-nat.c */ 2083/* end of gnunet-service-nat.c */
diff --git a/src/nat/gnunet-service-nat_externalip.c b/src/nat/gnunet-service-nat_externalip.c
index 0a251bdb2..c2625be2d 100644
--- a/src/nat/gnunet-service-nat_externalip.c
+++ b/src/nat/gnunet-service-nat_externalip.c
@@ -312,4 +312,5 @@ GN_external_ipv4_monitor_stop (struct GN_ExternalIPMonitor *mon)
312 GNUNET_free (mon); 312 GNUNET_free (mon);
313} 313}
314 314
315
315/* end of gnunet-service-nat_externalip.c */ 316/* end of gnunet-service-nat_externalip.c */
diff --git a/src/nat/gnunet-service-nat_mini.c b/src/nat/gnunet-service-nat_mini.c
index 1382010bd..ae94e3f5b 100644
--- a/src/nat/gnunet-service-nat_mini.c
+++ b/src/nat/gnunet-service-nat_mini.c
@@ -443,8 +443,7 @@ process_refresh_output (void *cls, const char *line)
443 * 443 *
444 * "%s TCP PORT->STRING:OURPORT *" or 444 * "%s TCP PORT->STRING:OURPORT *" or
445 * "%s UDP PORT->STRING:OURPORT *" 445 * "%s UDP PORT->STRING:OURPORT *"
446 */ 446 */GNUNET_snprintf (pstr, sizeof(pstr), ":%u ", mini->port);
447 GNUNET_snprintf (pstr, sizeof(pstr), ":%u ", mini->port);
448 if (NULL == (s = strstr (line, "->"))) 447 if (NULL == (s = strstr (line, "->")))
449 return; /* skip */ 448 return; /* skip */
450 if (NULL == strstr (s, pstr)) 449 if (NULL == strstr (s, pstr))
@@ -554,8 +553,7 @@ process_map_output (void *cls, const char *line)
554 * The upnpc output we're after looks like this: 553 * The upnpc output we're after looks like this:
555 * 554 *
556 * "external 87.123.42.204:3000 TCP is redirected to internal 192.168.2.150:3000" 555 * "external 87.123.42.204:3000 TCP is redirected to internal 192.168.2.150:3000"
557 */ 556 */if ((NULL == (ipaddr = strstr (line, " "))) ||
558 if ((NULL == (ipaddr = strstr (line, " "))) ||
559 (NULL == (pstr = strstr (ipaddr, ":"))) || 557 (NULL == (pstr = strstr (ipaddr, ":"))) ||
560 (1 != sscanf (pstr + 1, "%u", &port))) 558 (1 != sscanf (pstr + 1, "%u", &port)))
561 { 559 {
diff --git a/src/nat/gnunet-service-nat_stun.c b/src/nat/gnunet-service-nat_stun.c
index 8a5311254..203728ebf 100644
--- a/src/nat/gnunet-service-nat_stun.c
+++ b/src/nat/gnunet-service-nat_stun.c
@@ -211,4 +211,5 @@ GNUNET_NAT_stun_handle_packet_ (const void *data,
211 return ret; 211 return ret;
212} 212}
213 213
214
214/* end of gnunet-service-nat_stun.c */ 215/* end of gnunet-service-nat_stun.c */
diff --git a/src/nat/nat.h b/src/nat/nat.h
index aac8db64c..1d8648aaf 100644
--- a/src/nat/nat.h
+++ b/src/nat/nat.h
@@ -29,7 +29,6 @@
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30 30
31 31
32
33GNUNET_NETWORK_STRUCT_BEGIN 32GNUNET_NETWORK_STRUCT_BEGIN
34 33
35/** 34/**
diff --git a/src/nat/test_nat.c b/src/nat/test_nat.c
index f04cf5669..69a2f4218 100644
--- a/src/nat/test_nat.c
+++ b/src/nat/test_nat.c
@@ -188,4 +188,5 @@ main (int argc, char *const argv[])
188 return 0; 188 return 0;
189} 189}
190 190
191
191/* end of test_nat.c */ 192/* end of test_nat.c */
diff --git a/src/nat/test_nat_mini.c b/src/nat/test_nat_mini.c
index 49c801571..8cbd4131d 100644
--- a/src/nat/test_nat_mini.c
+++ b/src/nat/test_nat_mini.c
@@ -75,6 +75,7 @@ stop (void *cls)
75 GNUNET_NAT_mini_map_stop (mini); 75 GNUNET_NAT_mini_map_stop (mini);
76} 76}
77 77
78
78#define PORT 10000 79#define PORT 10000
79 80
80/** 81/**
@@ -129,4 +130,5 @@ main (int argc, char *const argv[])
129 return 0; 130 return 0;
130} 131}
131 132
133
132/* end of test_nat_mini.c */ 134/* end of test_nat_mini.c */
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c
index 1eabab50c..43998c97c 100644
--- a/src/nat/test_nat_test.c
+++ b/src/nat/test_nat_test.c
@@ -138,4 +138,5 @@ main (int argc, char *const argv[])
138 return ret; 138 return ret;
139} 139}
140 140
141
141/* end of test_nat_test.c */ 142/* end of test_nat_test.c */
diff --git a/src/nat/test_stun.c b/src/nat/test_stun.c
index 41e962ea0..a41734af1 100644
--- a/src/nat/test_stun.c
+++ b/src/nat/test_stun.c
@@ -35,7 +35,6 @@
35#include "gnunet_nat_lib.h" 35#include "gnunet_nat_lib.h"
36 36
37 37
38
39#define LOG(kind, ...) GNUNET_log_from (kind, "test-stun", __VA_ARGS__) 38#define LOG(kind, ...) GNUNET_log_from (kind, "test-stun", __VA_ARGS__)
40 39
41/** 40/**
@@ -310,4 +309,5 @@ main (int argc, char *const argv[])
310 return ret; 309 return ret;
311} 310}
312 311
312
313/* end of test_stun.c */ 313/* end of test_stun.c */
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index c97798772..81a16b245 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -917,4 +917,5 @@ main (int argc, char *const *argv)
917 return ok; 917 return ok;
918} 918}
919 919
920
920/* end of nse-profiler.c */ 921/* end of nse-profiler.c */
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index fe32dc30b..e31b07d14 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -1046,7 +1046,7 @@ handle_p2p_estimate (void *cls,
1046 1046
1047#if ENABLE_NSE_HISTOGRAM 1047#if ENABLE_NSE_HISTOGRAM
1048 peer_entry->received_messages++; 1048 peer_entry->received_messages++;
1049 if ((peer_entry->transmitted_messages > 0)&& 1049 if ((peer_entry->transmitted_messages > 0) &&
1050 (peer_entry->last_transmitted_size >= matching_bits) ) 1050 (peer_entry->last_transmitted_size >= matching_bits) )
1051 GNUNET_STATISTICS_update (stats, "# cross messages", 1, GNUNET_NO); 1051 GNUNET_STATISTICS_update (stats, "# cross messages", 1, GNUNET_NO);
1052#endif 1052#endif
@@ -1253,6 +1253,8 @@ flush_comp_cb (void *cls, size_t size)
1253 GNUNET_TESTBED_LOGGER_disconnect (lh); 1253 GNUNET_TESTBED_LOGGER_disconnect (lh);
1254 lh = NULL; 1254 lh = NULL;
1255} 1255}
1256
1257
1256#endif 1258#endif
1257 1259
1258 1260
@@ -1388,6 +1390,8 @@ status_cb (void *cls, int status)
1388 GNUNET_SCHEDULER_shutdown (); 1390 GNUNET_SCHEDULER_shutdown ();
1389 } 1391 }
1390} 1392}
1393
1394
1391#endif 1395#endif
1392 1396
1393 1397
@@ -1581,12 +1585,15 @@ GNUNET_SERVICE_MAIN ("nse",
1581/** 1585/**
1582 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1586 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1583 */ 1587 */
1584void __attribute__ ((constructor)) GNUNET_ARM_memory_init () 1588void __attribute__ ((constructor))
1589GNUNET_ARM_memory_init ()
1585{ 1590{
1586 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1591 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1587 mallopt (M_TOP_PAD, 1 * 1024); 1592 mallopt (M_TOP_PAD, 1 * 1024);
1588 malloc_trim (0); 1593 malloc_trim (0);
1589} 1594}
1595
1596
1590#endif 1597#endif
1591 1598
1592 1599
diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c
index af6a2065b..5ed596bf2 100644
--- a/src/nse/nse_api.c
+++ b/src/nse/nse_api.c
@@ -205,4 +205,5 @@ GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h)
205 GNUNET_free (h); 205 GNUNET_free (h);
206} 206}
207 207
208
208/* end of nse_api.c */ 209/* end of nse_api.c */
diff --git a/src/nse/perf_kdf.c b/src/nse/perf_kdf.c
index a6c1432c8..ec6dc7ff3 100644
--- a/src/nse/perf_kdf.c
+++ b/src/nse/perf_kdf.c
@@ -29,7 +29,6 @@
29#include <gauger.h> 29#include <gauger.h>
30 30
31 31
32
33/** 32/**
34 * Calculate the 'proof-of-work' hash (an expensive hash). 33 * Calculate the 'proof-of-work' hash (an expensive hash).
35 * 34 *
@@ -84,4 +83,5 @@ main (int argc, char *argv[])
84 return 0; 83 return 0;
85} 84}
86 85
86
87/* end of perf_kdf.c */ 87/* end of perf_kdf.c */
diff --git a/src/nse/test_nse_api.c b/src/nse/test_nse_api.c
index 3b9682696..f1b7c652b 100644
--- a/src/nse/test_nse_api.c
+++ b/src/nse/test_nse_api.c
@@ -47,6 +47,7 @@ end_test (void *cls)
47 } 47 }
48} 48}
49 49
50
50/** 51/**
51 * Callback to call when network size estimate is updated. 52 * Callback to call when network size estimate is updated.
52 * 53 *
@@ -102,4 +103,5 @@ main (int argc, char *argv[])
102 return ok; 103 return ok;
103} 104}
104 105
106
105/* end of test_nse_api.c */ 107/* end of test_nse_api.c */
diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c
index 4c998373e..6ee03b3fa 100644
--- a/src/nse/test_nse_multipeer.c
+++ b/src/nse/test_nse_multipeer.c
@@ -231,4 +231,5 @@ main (int argc, char *argv[])
231 return ok; 231 return ok;
232} 232}
233 233
234
234/* end of test_nse_multipeer.c */ 235/* end of test_nse_multipeer.c */
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index 7fa7ab2f5..4d4c4de33 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -408,6 +408,7 @@ print_peer_info (void *cls,
408 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &print_address, pc); 408 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &print_address, pc);
409} 409}
410 410
411
411/* ************************* DUMP Hello ************************** */ 412/* ************************* DUMP Hello ************************** */
412 413
413/** 414/**
@@ -858,4 +859,5 @@ main (int argc, char *const *argv)
858 return ret; 859 return ret;
859} 860}
860 861
862
861/* end of gnunet-peerinfo.c */ 863/* end of gnunet-peerinfo.c */
diff --git a/src/peerinfo-tool/gnunet-peerinfo_plugins.c b/src/peerinfo-tool/gnunet-peerinfo_plugins.c
index 9449dd67e..901ded014 100644
--- a/src/peerinfo-tool/gnunet-peerinfo_plugins.c
+++ b/src/peerinfo-tool/gnunet-peerinfo_plugins.c
@@ -77,7 +77,6 @@ static struct TransportPlugin *plugins_head;
77static struct TransportPlugin *plugins_tail; 77static struct TransportPlugin *plugins_tail;
78 78
79 79
80
81/** 80/**
82 * Load and initialize all plugins. The respective functions will be 81 * Load and initialize all plugins. The respective functions will be
83 * invoked by the plugins when the respective events happen. The 82 * invoked by the plugins when the respective events happen. The
diff --git a/src/peerinfo-tool/plugin_rest_peerinfo.c b/src/peerinfo-tool/plugin_rest_peerinfo.c
index 176e24e42..7544b5ede 100644
--- a/src/peerinfo-tool/plugin_rest_peerinfo.c
+++ b/src/peerinfo-tool/plugin_rest_peerinfo.c
@@ -614,6 +614,7 @@ peerinfo_list_iteration (void *cls,
614 pc); 614 pc);
615} 615}
616 616
617
617/** 618/**
618 * Handle peerinfo GET request 619 * Handle peerinfo GET request
619 * 620 *
@@ -669,7 +670,6 @@ peerinfo_get (struct GNUNET_REST_RequestHandle *con_handle,
669} 670}
670 671
671 672
672
673/** 673/**
674 * Respond to OPTIONS request 674 * Respond to OPTIONS request
675 * 675 *
@@ -818,4 +818,5 @@ libgnunet_plugin_rest_peerinfo_done (void *cls)
818 return NULL; 818 return NULL;
819} 819}
820 820
821
821/* end of plugin_rest_peerinfo.c */ 822/* end of plugin_rest_peerinfo.c */
diff --git a/src/peerinfo/peerinfo.h b/src/peerinfo/peerinfo.h
index 69992170f..7db923d4d 100644
--- a/src/peerinfo/peerinfo.h
+++ b/src/peerinfo/peerinfo.h
@@ -32,7 +32,6 @@
32#include "gnunet_peerinfo_service.h" 32#include "gnunet_peerinfo_service.h"
33 33
34 34
35
36GNUNET_NETWORK_STRUCT_BEGIN 35GNUNET_NETWORK_STRUCT_BEGIN
37 36
38/** 37/**
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 52d7b4192..b73d9d927 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -239,7 +239,6 @@ mq_error_handler (void *cls,
239} 239}
240 240
241 241
242
243/** 242/**
244 * Function called when we receive an info message. Check it is 243 * Function called when we receive an info message. Check it is
245 * well-formed. 244 * well-formed.
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c
index 778fe2344..5f4c123ff 100644
--- a/src/peerinfo/peerinfo_api_notify.c
+++ b/src/peerinfo/peerinfo_api_notify.c
@@ -287,4 +287,5 @@ GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc)
287 GNUNET_free (nc); 287 GNUNET_free (nc);
288} 288}
289 289
290
290/* end of peerinfo_api_notify.c */ 291/* end of peerinfo_api_notify.c */
diff --git a/src/peerinfo/perf_peerinfo_api.c b/src/peerinfo/perf_peerinfo_api.c
index 0c8c22345..055388d43 100644
--- a/src/peerinfo/perf_peerinfo_api.c
+++ b/src/peerinfo/perf_peerinfo_api.c
@@ -189,4 +189,5 @@ main (int argc,
189 return 0; 189 return 0;
190} 190}
191 191
192
192/* end of perf_peerinfo_api.c */ 193/* end of perf_peerinfo_api.c */
diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c
index b13b9dc57..27df6e37b 100644
--- a/src/peerinfo/test_peerinfo_api.c
+++ b/src/peerinfo/test_peerinfo_api.c
@@ -81,6 +81,7 @@ address_generator (void *cls, size_t max, void *buf)
81 return ret; 81 return ret;
82} 82}
83 83
84
84struct GNUNET_PeerIdentity pid; 85struct GNUNET_PeerIdentity pid;
85 86
86static void 87static void
@@ -167,4 +168,5 @@ main (int argc, char *argv[])
167 return global_ret; 168 return global_ret;
168} 169}
169 170
171
170/* end of test_peerinfo_api.c */ 172/* end of test_peerinfo_api.c */
diff --git a/src/peerinfo/test_peerinfo_api_friend_only.c b/src/peerinfo/test_peerinfo_api_friend_only.c
index 8d50cf417..a5414e701 100644
--- a/src/peerinfo/test_peerinfo_api_friend_only.c
+++ b/src/peerinfo/test_peerinfo_api_friend_only.c
@@ -168,4 +168,5 @@ main (int argc,
168 return global_ret; 168 return global_ret;
169} 169}
170 170
171
171/* end of test_peerinfo_api_friend_only */ 172/* end of test_peerinfo_api_friend_only */
diff --git a/src/peerinfo/test_peerinfo_api_notify_friend_only.c b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
index 7c5162102..6d5793dcf 100644
--- a/src/peerinfo/test_peerinfo_api_notify_friend_only.c
+++ b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
@@ -108,6 +108,7 @@ done (void *cls)
108 GNUNET_break (0); 108 GNUNET_break (0);
109} 109}
110 110
111
111static ssize_t 112static ssize_t
112address_generator (void *cls, size_t max, void *buf) 113address_generator (void *cls, size_t max, void *buf)
113{ 114{
@@ -171,6 +172,7 @@ process_w_fo (void *cls,
171 } 172 }
172} 173}
173 174
175
174static void 176static void
175process_wo_fo (void *cls, const struct GNUNET_PeerIdentity *peer, 177process_wo_fo (void *cls, const struct GNUNET_PeerIdentity *peer,
176 const struct GNUNET_HELLO_Message *hello, const char *err_msg) 178 const struct GNUNET_HELLO_Message *hello, const char *err_msg)
@@ -255,4 +257,5 @@ main (int argc, char *argv[])
255 return global_ret; 257 return global_ret;
256} 258}
257 259
260
258/* end of test_peerinfo_api_notify_friend_only.c */ 261/* end of test_peerinfo_api_notify_friend_only.c */
diff --git a/src/peerinfo/test_peerinfo_shipped_hellos.c b/src/peerinfo/test_peerinfo_shipped_hellos.c
index 24cc26a94..45ea73be6 100644
--- a/src/peerinfo/test_peerinfo_shipped_hellos.c
+++ b/src/peerinfo/test_peerinfo_shipped_hellos.c
@@ -140,4 +140,5 @@ main (int argc,
140 return global_ret; 140 return global_ret;
141} 141}
142 142
143
143/* end of test_peerinfo_shipped_hellos.c */ 144/* end of test_peerinfo_shipped_hellos.c */
diff --git a/src/peerstore/gnunet-peerstore.c b/src/peerstore/gnunet-peerstore.c
index 392318f84..11313b5d3 100644
--- a/src/peerstore/gnunet-peerstore.c
+++ b/src/peerstore/gnunet-peerstore.c
@@ -93,4 +93,5 @@ main (int argc, char *const *argv)
93 NULL)) ? ret : 1; 93 NULL)) ? ret : 1;
94} 94}
95 95
96
96/* end of gnunet-peerstore.c */ 97/* end of gnunet-peerstore.c */
diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c
index e5881a6b4..17f73d70a 100644
--- a/src/peerstore/peerstore_api.c
+++ b/src/peerstore/peerstore_api.c
@@ -930,4 +930,5 @@ GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
930 return wc; 930 return wc;
931} 931}
932 932
933
933/* end of peerstore_api.c */ 934/* end of peerstore_api.c */
diff --git a/src/peerstore/perf_peerstore_store.c b/src/peerstore/perf_peerstore_store.c
index bdff19cb5..24c7e4f01 100644
--- a/src/peerstore/perf_peerstore_store.c
+++ b/src/peerstore/perf_peerstore_store.c
@@ -105,4 +105,5 @@ main (int argc, char *argv[])
105 return ok; 105 return ok;
106} 106}
107 107
108
108/* end of perf_peerstore_store.c */ 109/* end of perf_peerstore_store.c */
diff --git a/src/peerstore/plugin_peerstore_flat.c b/src/peerstore/plugin_peerstore_flat.c
index 224664685..6983ff2d8 100644
--- a/src/peerstore/plugin_peerstore_flat.c
+++ b/src/peerstore/plugin_peerstore_flat.c
@@ -146,6 +146,7 @@ peerstore_flat_delete_records (void *cls, const char *sub_system,
146 return plugin->deleted_entries; 146 return plugin->deleted_entries;
147} 147}
148 148
149
149static int 150static int
150expire_entries (void *cls, 151expire_entries (void *cls,
151 const struct GNUNET_HashCode *key, 152 const struct GNUNET_HashCode *key,
@@ -163,7 +164,6 @@ expire_entries (void *cls,
163} 164}
164 165
165 166
166
167/** 167/**
168 * Delete expired records (expiry < now) 168 * Delete expired records (expiry < now)
169 * 169 *
@@ -222,6 +222,7 @@ iterate_entries (void *cls,
222 return GNUNET_YES; 222 return GNUNET_YES;
223} 223}
224 224
225
225/** 226/**
226 * Iterate over the records given an optional peer id 227 * Iterate over the records given an optional peer id
227 * and/or key. 228 * and/or key.
@@ -478,6 +479,7 @@ database_setup (struct Plugin *plugin)
478 return GNUNET_OK; 479 return GNUNET_OK;
479} 480}
480 481
482
481static int 483static int
482store_and_free_entries (void *cls, 484store_and_free_entries (void *cls,
483 const struct GNUNET_HashCode *key, 485 const struct GNUNET_HashCode *key,
@@ -517,6 +519,7 @@ store_and_free_entries (void *cls,
517 return GNUNET_YES; 519 return GNUNET_YES;
518} 520}
519 521
522
520/** 523/**
521 * Shutdown database connection and associate data 524 * Shutdown database connection and associate data
522 * structures. 525 * structures.
@@ -599,4 +602,5 @@ libgnunet_plugin_peerstore_flat_done (void *cls)
599 return NULL; 602 return NULL;
600} 603}
601 604
605
602/* end of plugin_peerstore_sqlite.c */ 606/* end of plugin_peerstore_sqlite.c */
diff --git a/src/peerstore/plugin_peerstore_sqlite.c b/src/peerstore/plugin_peerstore_sqlite.c
index 51cc651a2..cf499a5df 100644
--- a/src/peerstore/plugin_peerstore_sqlite.c
+++ b/src/peerstore/plugin_peerstore_sqlite.c
@@ -698,4 +698,5 @@ libgnunet_plugin_peerstore_sqlite_done (void *cls)
698 return NULL; 698 return NULL;
699} 699}
700 700
701
701/* end of plugin_peerstore_sqlite.c */ 702/* end of plugin_peerstore_sqlite.c */
diff --git a/src/peerstore/test_peerstore_api_iterate.c b/src/peerstore/test_peerstore_api_iterate.c
index 79d4a3b3c..b6cd51906 100644
--- a/src/peerstore/test_peerstore_api_iterate.c
+++ b/src/peerstore/test_peerstore_api_iterate.c
@@ -172,4 +172,5 @@ main (int argc, char *argv[])
172 return ok; 172 return ok;
173} 173}
174 174
175
175/* end of test_peerstore_api_iterate.c */ 176/* end of test_peerstore_api_iterate.c */
diff --git a/src/peerstore/test_peerstore_api_store.c b/src/peerstore/test_peerstore_api_store.c
index c1ecc16bf..77e8a17c1 100644
--- a/src/peerstore/test_peerstore_api_store.c
+++ b/src/peerstore/test_peerstore_api_store.c
@@ -229,4 +229,5 @@ main (int argc, char *argv[])
229 return ok; 229 return ok;
230} 230}
231 231
232
232/* end of test_peerstore_api_store.c */ 233/* end of test_peerstore_api_store.c */
diff --git a/src/peerstore/test_peerstore_api_sync.c b/src/peerstore/test_peerstore_api_sync.c
index bfeae6ed8..4c826c654 100644
--- a/src/peerstore/test_peerstore_api_sync.c
+++ b/src/peerstore/test_peerstore_api_sync.c
@@ -117,6 +117,7 @@ test_cont (void *cls)
117 NULL); 117 NULL);
118} 118}
119 119
120
120static void 121static void
121disc_cont (void *cls) 122disc_cont (void *cls)
122{ 123{
@@ -127,6 +128,7 @@ disc_cont (void *cls)
127 NULL); 128 NULL);
128} 129}
129 130
131
130static void 132static void
131store_cont (void *cls, int success) 133store_cont (void *cls, int success)
132{ 134{
@@ -135,11 +137,11 @@ store_cont (void *cls, int success)
135 a chance to actually finish the operation; otherwise, 137 a chance to actually finish the operation; otherwise,
136 the test may fail non-deterministically if the new 138 the test may fail non-deterministically if the new
137 connection is faster than the cleanup routine of the 139 connection is faster than the cleanup routine of the
138 old one. */ 140 old one. */GNUNET_SCHEDULER_add_now (&disc_cont,
139 GNUNET_SCHEDULER_add_now (&disc_cont,
140 NULL); 141 NULL);
141} 142}
142 143
144
143/** 145/**
144 * Actually run the test. 146 * Actually run the test.
145 */ 147 */
@@ -192,4 +194,5 @@ main (int argc, char *argv[])
192 return ok; 194 return ok;
193} 195}
194 196
197
195/* end of test_peerstore_api_sync.c */ 198/* end of test_peerstore_api_sync.c */
diff --git a/src/peerstore/test_peerstore_api_watch.c b/src/peerstore/test_peerstore_api_watch.c
index b833a99a5..126b321df 100644
--- a/src/peerstore/test_peerstore_api_watch.c
+++ b/src/peerstore/test_peerstore_api_watch.c
@@ -98,4 +98,5 @@ main (int argc,
98 return ok; 98 return ok;
99} 99}
100 100
101
101/* end of test_peerstore_api_watch.c */ 102/* end of test_peerstore_api_watch.c */
diff --git a/src/peerstore/test_plugin_peerstore.c b/src/peerstore/test_plugin_peerstore.c
index 8fce65e23..03e71ed63 100644
--- a/src/peerstore/test_plugin_peerstore.c
+++ b/src/peerstore/test_plugin_peerstore.c
@@ -220,4 +220,5 @@ main (int argc, char *argv[])
220 return ok; 220 return ok;
221} 221}
222 222
223
223/* end of test_plugin_peerstore.c */ 224/* end of test_plugin_peerstore.c */
diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c
index 882df4f89..7d9a524b3 100644
--- a/src/pq/pq_connect.c
+++ b/src/pq/pq_connect.c
@@ -251,4 +251,5 @@ GNUNET_PQ_disconnect (struct GNUNET_PQ_Context *db)
251 GNUNET_free (db); 251 GNUNET_free (db);
252} 252}
253 253
254
254/* end of pq/pq_connect.c */ 255/* end of pq/pq_connect.c */
diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c
index 675c71732..0d1a34441 100644
--- a/src/pt/gnunet-daemon-pt.c
+++ b/src/pt/gnunet-daemon-pt.c
@@ -179,7 +179,6 @@ struct CadetExit
179}; 179};
180 180
181 181
182
183/** 182/**
184 * State we keep for a request that is going out via CADET. 183 * State we keep for a request that is going out via CADET.
185 */ 184 */
@@ -738,8 +737,7 @@ timeout_request (void *cls)
738 avoid a prohibitively negative score (see 737 avoid a prohibitively negative score (see
739 #get_channel_weight(), which checks for a certain 738 #get_channel_weight(), which checks for a certain
740 minimum number of transmissions before making 739 minimum number of transmissions before making
741 up an opinion) */ 740 up an opinion) */exit->num_transmitted = 5;
742 exit->num_transmitted = 5;
743 exit->num_answered = 0; 741 exit->num_answered = 0;
744 dns_exit_available--; 742 dns_exit_available--;
745 /* now try to open an alternative exit */ 743 /* now try to open an alternative exit */
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c
index a51320eae..96f0dc025 100644
--- a/src/pt/test_gns_vpn.c
+++ b/src/pt/test_gns_vpn.c
@@ -429,7 +429,6 @@ mhd_main ()
429} 429}
430 430
431 431
432
433/** 432/**
434 * Open '/dev/null' and make the result the given 433 * Open '/dev/null' and make the result the given
435 * file descriptor. 434 * file descriptor.
@@ -520,7 +519,6 @@ fork_and_exec (const char *file,
520} 519}
521 520
522 521
523
524/** 522/**
525 * Method called to inform about the egos of this peer. 523 * Method called to inform about the egos of this peer.
526 * 524 *
@@ -863,4 +861,5 @@ main (int argc,
863 return global_ret; 861 return global_ret;
864} 862}
865 863
864
866/* end of test_gns_vpn.c */ 865/* end of test_gns_vpn.c */
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index dcf3c5d93..42fd52c38 100644
--- a/src/pt/test_gnunet_vpn.c
+++ b/src/pt/test_gnunet_vpn.c
@@ -514,4 +514,5 @@ main (int argc, char *const *argv)
514 return global_ret; 514 return global_ret;
515} 515}
516 516
517
517/* end of test_gnunet_vpn.c */ 518/* end of test_gnunet_vpn.c */
diff --git a/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c b/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c
index 8b63fe856..bb60909d9 100644
--- a/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c
+++ b/src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c
@@ -177,4 +177,5 @@ libgnunet_plugin_reclaim_attribute_gnuid_done (void *cls)
177 return NULL; 177 return NULL;
178} 178}
179 179
180
180/* end of plugin_reclaim_attribute_type_gnuid.c */ 181/* end of plugin_reclaim_attribute_type_gnuid.c */
diff --git a/src/reclaim-attribute/reclaim_attribute.c b/src/reclaim-attribute/reclaim_attribute.c
index ac51a6b86..b81394ad2 100644
--- a/src/reclaim-attribute/reclaim_attribute.c
+++ b/src/reclaim-attribute/reclaim_attribute.c
@@ -520,4 +520,5 @@ GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size)
520 return attr; 520 return attr;
521} 521}
522 522
523
523/* end of reclaim_attribute.c */ 524/* end of reclaim_attribute.c */
diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c
index c5f0ed4fa..58f8cd6e2 100644
--- a/src/reclaim/gnunet-reclaim.c
+++ b/src/reclaim/gnunet-reclaim.c
@@ -191,6 +191,7 @@ do_cleanup (void *cls)
191 GNUNET_free (attr_to_delete); 191 GNUNET_free (attr_to_delete);
192} 192}
193 193
194
194static void 195static void
195ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket) 196ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
196{ 197{
@@ -209,6 +210,7 @@ ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
209 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 210 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
210} 211}
211 212
213
212static void 214static void
213store_attr_cont (void *cls, int32_t success, const char *emsg) 215store_attr_cont (void *cls, int32_t success, const char *emsg)
214{ 216{
@@ -220,6 +222,7 @@ store_attr_cont (void *cls, int32_t success, const char *emsg)
220 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 222 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
221} 223}
222 224
225
223static void 226static void
224process_attrs (void *cls, 227process_attrs (void *cls,
225 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 228 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
@@ -255,6 +258,7 @@ process_attrs (void *cls,
255 GNUNET_free (id); 258 GNUNET_free (id);
256} 259}
257 260
261
258static void 262static void
259ticket_iter_err (void *cls) 263ticket_iter_err (void *cls)
260{ 264{
@@ -263,6 +267,7 @@ ticket_iter_err (void *cls)
263 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 267 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
264} 268}
265 269
270
266static void 271static void
267ticket_iter_fin (void *cls) 272ticket_iter_fin (void *cls)
268{ 273{
@@ -270,6 +275,7 @@ ticket_iter_fin (void *cls)
270 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 275 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
271} 276}
272 277
278
273static void 279static void
274ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket) 280ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
275{ 281{
@@ -292,6 +298,7 @@ ticket_iter (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
292 GNUNET_RECLAIM_ticket_iteration_next (ticket_iterator); 298 GNUNET_RECLAIM_ticket_iteration_next (ticket_iterator);
293} 299}
294 300
301
295static void 302static void
296iter_error (void *cls) 303iter_error (void *cls)
297{ 304{
@@ -300,6 +307,7 @@ iter_error (void *cls)
300 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 307 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
301} 308}
302 309
310
303static void 311static void
304timeout_task (void *cls) 312timeout_task (void *cls)
305{ 313{
@@ -310,6 +318,7 @@ timeout_task (void *cls)
310 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 318 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
311} 319}
312 320
321
313static void 322static void
314process_rvk (void *cls, int success, const char *msg) 323process_rvk (void *cls, int success, const char *msg)
315{ 324{
@@ -432,6 +441,7 @@ iter_finished (void *cls)
432 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 441 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
433} 442}
434 443
444
435static void 445static void
436iter_cb (void *cls, 446iter_cb (void *cls,
437 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 447 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
@@ -511,6 +521,7 @@ iter_cb (void *cls,
511 GNUNET_RECLAIM_get_attributes_next (attr_iterator); 521 GNUNET_RECLAIM_get_attributes_next (attr_iterator);
512} 522}
513 523
524
514static void 525static void
515start_process () 526start_process ()
516{ 527{
@@ -565,6 +576,7 @@ start_process ()
565 NULL); 576 NULL);
566} 577}
567 578
579
568static int init = GNUNET_YES; 580static int init = GNUNET_YES;
569 581
570static void 582static void
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c
index 440656343..a83ea05a6 100644
--- a/src/reclaim/gnunet-service-reclaim.c
+++ b/src/reclaim/gnunet-service-reclaim.c
@@ -712,7 +712,6 @@ handle_issue_ticket_message (void *cls, const struct IssueTicketMessage *im)
712} 712}
713 713
714 714
715
716/********************************************************** 715/**********************************************************
717* Revocation 716* Revocation
718**********************************************************/ 717**********************************************************/
@@ -880,6 +879,7 @@ handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm)
880 GNUNET_SERVICE_client_continue (idp->client); 879 GNUNET_SERVICE_client_continue (idp->client);
881} 880}
882 881
882
883/***************************************** 883/*****************************************
884* Attribute store 884* Attribute store
885*****************************************/ 885*****************************************/
@@ -1355,6 +1355,7 @@ attr_iter_finished (void *cls)
1355 GNUNET_free (ai); 1355 GNUNET_free (ai);
1356} 1356}
1357 1357
1358
1358/** 1359/**
1359 * Error iterating over attributes. Abort. 1360 * Error iterating over attributes. Abort.
1360 * 1361 *
@@ -1512,6 +1513,7 @@ handle_iteration_next (void *cls,
1512 GNUNET_SERVICE_client_continue (idp->client); 1513 GNUNET_SERVICE_client_continue (idp->client);
1513} 1514}
1514 1515
1516
1515/****************************************************** 1517/******************************************************
1516* Ticket iteration 1518* Ticket iteration
1517******************************************************/ 1519******************************************************/
diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c
index 57c9e2167..4d1a26333 100644
--- a/src/reclaim/gnunet-service-reclaim_tickets.c
+++ b/src/reclaim/gnunet-service-reclaim_tickets.c
@@ -330,7 +330,6 @@ static struct GNUNET_GNS_Handle *gns;
330static struct GNUNET_STATISTICS_Handle *stats; 330static struct GNUNET_STATISTICS_Handle *stats;
331 331
332 332
333
334/** 333/**
335 * Cleanup revoke handle 334 * Cleanup revoke handle
336 * 335 *
@@ -1265,6 +1264,7 @@ issue_ticket (struct TicketIssueHandle *ih)
1265 GNUNET_free (label); 1264 GNUNET_free (label);
1266} 1265}
1267 1266
1267
1268/************************************************* 1268/*************************************************
1269* Ticket iteration (finding a specific ticket) 1269* Ticket iteration (finding a specific ticket)
1270*************************************************/ 1270*************************************************/
@@ -1359,7 +1359,7 @@ filter_tickets_cb (void *cls,
1359 * If we found a matching ticket, return that to the caller and 1359 * If we found a matching ticket, return that to the caller and
1360 * we are done. 1360 * we are done.
1361 */ 1361 */
1362 if ((attr_cnt == found_attrs_cnt)&&(NULL != ticket)) 1362 if ((attr_cnt == found_attrs_cnt) && (NULL != ticket))
1363 { 1363 {
1364 GNUNET_NAMESTORE_zone_iteration_stop (tih->ns_it); 1364 GNUNET_NAMESTORE_zone_iteration_stop (tih->ns_it);
1365 tih->cb (tih->cb_cls, &tih->ticket, GNUNET_OK, NULL); 1365 tih->cb (tih->cb_cls, &tih->ticket, GNUNET_OK, NULL);
diff --git a/src/reclaim/json_reclaim.c b/src/reclaim/json_reclaim.c
index fa3901e43..e029fdfb6 100644
--- a/src/reclaim/json_reclaim.c
+++ b/src/reclaim/json_reclaim.c
@@ -102,6 +102,7 @@ parse_attr (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec)
102 return GNUNET_OK; 102 return GNUNET_OK;
103} 103}
104 104
105
105/** 106/**
106 * Cleanup data left from parsing RSA public key. 107 * Cleanup data left from parsing RSA public key.
107 * 108 *
@@ -121,6 +122,7 @@ clean_attr (void *cls, struct GNUNET_JSON_Specification *spec)
121 } 122 }
122} 123}
123 124
125
124/** 126/**
125 * JSON Specification for Reclaim claims. 127 * JSON Specification for Reclaim claims.
126 * 128 *
@@ -141,6 +143,8 @@ GNUNET_RECLAIM_JSON_spec_claim (struct GNUNET_RECLAIM_ATTRIBUTE_Claim **attr)
141 *attr = NULL; 143 *attr = NULL;
142 return ret; 144 return ret;
143} 145}
146
147
144/** 148/**
145 * Parse given JSON object to a ticket 149 * Parse given JSON object to a ticket
146 * 150 *
@@ -219,6 +223,7 @@ parse_ticket (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec)
219 return GNUNET_OK; 223 return GNUNET_OK;
220} 224}
221 225
226
222/** 227/**
223 * Cleanup data left from parsing RSA public key. 228 * Cleanup data left from parsing RSA public key.
224 * 229 *
@@ -238,6 +243,7 @@ clean_ticket (void *cls, struct GNUNET_JSON_Specification *spec)
238 } 243 }
239} 244}
240 245
246
241/** 247/**
242 * JSON Specification for Reclaim tickets. 248 * JSON Specification for Reclaim tickets.
243 * 249 *
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c
index 6bcae21d4..1c3d65f35 100644
--- a/src/reclaim/oidc_helper.c
+++ b/src/reclaim/oidc_helper.c
@@ -79,6 +79,7 @@ create_jwt_header (void)
79 return json_str; 79 return json_str;
80} 80}
81 81
82
82static void 83static void
83replace_char (char *str, char find, char replace) 84replace_char (char *str, char find, char replace)
84{ 85{
@@ -91,6 +92,7 @@ replace_char (char *str, char find, char replace)
91 } 92 }
92} 93}
93 94
95
94// RFC4648 96// RFC4648
95static void 97static void
96fix_base64 (char *str) 98fix_base64 (char *str)
@@ -102,6 +104,7 @@ fix_base64 (char *str)
102 replace_char (str, '/', '_'); 104 replace_char (str, '/', '_');
103} 105}
104 106
107
105/** 108/**
106 * Create a JWT from attributes 109 * Create a JWT from attributes
107 * 110 *
@@ -229,6 +232,7 @@ OIDC_id_token_new (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
229 return result; 232 return result;
230} 233}
231 234
235
232/* Converts a hex character to its integer value */ 236/* Converts a hex character to its integer value */
233static char 237static char
234from_hex (char ch) 238from_hex (char ch)
@@ -236,6 +240,7 @@ from_hex (char ch)
236 return isdigit (ch) ? ch - '0' : tolower (ch) - 'a' + 10; 240 return isdigit (ch) ? ch - '0' : tolower (ch) - 'a' + 10;
237} 241}
238 242
243
239/* Converts an integer value to its hex character*/ 244/* Converts an integer value to its hex character*/
240static char 245static char
241to_hex (char code) 246to_hex (char code)
@@ -245,6 +250,7 @@ to_hex (char code)
245 return hex[code & 15]; 250 return hex[code & 15];
246} 251}
247 252
253
248/* Returns a url-encoded version of str */ 254/* Returns a url-encoded version of str */
249/* IMPORTANT: be sure to free() the returned string after use */ 255/* IMPORTANT: be sure to free() the returned string after use */
250static char * 256static char *
@@ -307,6 +313,7 @@ url_decode (const char *str)
307 return buf; 313 return buf;
308} 314}
309 315
316
310/** 317/**
311 * Returns base64 encoded string urlencoded 318 * Returns base64 encoded string urlencoded
312 * 319 *
@@ -440,6 +447,7 @@ encrypt_payload (const struct GNUNET_CRYPTO_EcdsaPublicKey *ecdsa_pub,
440 GNUNET_CRYPTO_symmetric_encrypt (payload, payload_len, &key, &iv, buf)); 447 GNUNET_CRYPTO_symmetric_encrypt (payload, payload_len, &key, &iv, buf));
441} 448}
442 449
450
443/** 451/**
444 * Builds an OIDC authorization code including 452 * Builds an OIDC authorization code including
445 * a reclaim ticket and nonce 453 * a reclaim ticket and nonce
@@ -481,7 +489,7 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
481 // Assign nonce 489 // Assign nonce
482 nonce = 0; 490 nonce = 0;
483 payload_len = sizeof(struct OIDC_Parameters); 491 payload_len = sizeof(struct OIDC_Parameters);
484 if ((NULL != nonce_str)&& (strcmp ("", nonce_str) != 0)) 492 if ((NULL != nonce_str) && (strcmp ("", nonce_str) != 0))
485 { 493 {
486 if ((1 != sscanf (nonce_str, "%u", &nonce)) || (nonce > UINT32_MAX)) 494 if ((1 != sscanf (nonce_str, "%u", &nonce)) || (nonce > UINT32_MAX))
487 { 495 {
@@ -753,6 +761,7 @@ OIDC_build_token_response (const char *access_token,
753 json_decref (root_json); 761 json_decref (root_json);
754} 762}
755 763
764
756/** 765/**
757 * Generate a new access token 766 * Generate a new access token
758 */ 767 */
diff --git a/src/reclaim/oidc_helper.h b/src/reclaim/oidc_helper.h
index fa3d7f2d9..1774618e8 100644
--- a/src/reclaim/oidc_helper.h
+++ b/src/reclaim/oidc_helper.h
@@ -109,6 +109,7 @@ OIDC_build_token_response (const char *access_token,
109 const char *id_token, 109 const char *id_token,
110 const struct GNUNET_TIME_Relative *expiration_time, 110 const struct GNUNET_TIME_Relative *expiration_time,
111 char **token_response); 111 char **token_response);
112
112/** 113/**
113 * Generate a new access token 114 * Generate a new access token
114 */ 115 */
diff --git a/src/reclaim/plugin_gnsrecord_reclaim.c b/src/reclaim/plugin_gnsrecord_reclaim.c
index e4d1adfde..d530ef01d 100644
--- a/src/reclaim/plugin_gnsrecord_reclaim.c
+++ b/src/reclaim/plugin_gnsrecord_reclaim.c
@@ -194,4 +194,5 @@ libgnunet_plugin_gnsrecord_reclaim_done (void *cls)
194 return NULL; 194 return NULL;
195} 195}
196 196
197
197/* end of plugin_gnsrecord_dns.c */ 198/* end of plugin_gnsrecord_dns.c */
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index a4a368ab5..92a1de621 100644
--- a/src/reclaim/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -576,6 +576,7 @@ cleanup_handle (struct RequestHandle *handle)
576 GNUNET_free (handle); 576 GNUNET_free (handle);
577} 577}
578 578
579
579static void 580static void
580cleanup_handle_delayed (void *cls) 581cleanup_handle_delayed (void *cls)
581{ 582{
@@ -667,6 +668,7 @@ do_redirect_error (void *cls)
667 GNUNET_free (redirect); 668 GNUNET_free (redirect);
668} 669}
669 670
671
670/** 672/**
671 * Task run on timeout, sends error message. Cleans up everything. 673 * Task run on timeout, sends error message. Cleans up everything.
672 * 674 *
@@ -681,6 +683,7 @@ do_timeout (void *cls)
681 do_error (handle); 683 do_error (handle);
682} 684}
683 685
686
684/** 687/**
685 * Return attributes for claim 688 * Return attributes for claim
686 * 689 *
@@ -817,6 +820,7 @@ cookie_identity_interpretation (struct RequestHandle *handle)
817 GNUNET_free (cookies); 820 GNUNET_free (cookies);
818} 821}
819 822
823
820/** 824/**
821 * Redirects to login page stored in configuration file 825 * Redirects to login page stored in configuration file
822 */ 826 */
@@ -868,6 +872,7 @@ login_redirect (void *cls)
868 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle); 872 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle);
869} 873}
870 874
875
871/** 876/**
872 * Does internal server error when iteration failed. 877 * Does internal server error when iteration failed.
873 */ 878 */
@@ -943,6 +948,7 @@ oidc_ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
943 GNUNET_free (code_string); 948 GNUNET_free (code_string);
944} 949}
945 950
951
946static void 952static void
947oidc_collect_finished_cb (void *cls) 953oidc_collect_finished_cb (void *cls)
948{ 954{
@@ -1226,6 +1232,7 @@ client_redirect (void *cls)
1226 handle); 1232 handle);
1227} 1233}
1228 1234
1235
1229static char * 1236static char *
1230get_url_parameter_copy (const struct RequestHandle *handle, const char *key) 1237get_url_parameter_copy (const struct RequestHandle *handle, const char *key)
1231{ 1238{
@@ -1358,6 +1365,7 @@ build_authz_response (void *cls)
1358 GNUNET_SCHEDULER_add_now (&client_redirect, handle); 1365 GNUNET_SCHEDULER_add_now (&client_redirect, handle);
1359} 1366}
1360 1367
1368
1361/** 1369/**
1362 * Iterate over tlds in config 1370 * Iterate over tlds in config
1363 */ 1371 */
@@ -1377,6 +1385,7 @@ tld_iter (void *cls, const char *section, const char *option, const char *value)
1377 handle->tld = GNUNET_strdup (option + 1); 1385 handle->tld = GNUNET_strdup (option + 1);
1378} 1386}
1379 1387
1388
1380/** 1389/**
1381 * Responds to authorization GET and url-encoded POST request 1390 * Responds to authorization GET and url-encoded POST request
1382 * 1391 *
@@ -1452,6 +1461,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1452 GNUNET_SCHEDULER_add_now (&build_authz_response, handle); 1461 GNUNET_SCHEDULER_add_now (&build_authz_response, handle);
1453} 1462}
1454 1463
1464
1455/** 1465/**
1456 * Combines an identity with a login time and responds OK to login request 1466 * Combines an identity with a login time and responds OK to login request
1457 * 1467 *
@@ -1522,6 +1532,7 @@ login_cont (struct GNUNET_REST_RequestHandle *con_handle,
1522 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle); 1532 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle);
1523} 1533}
1524 1534
1535
1525static int 1536static int
1526check_authorization (struct RequestHandle *handle, 1537check_authorization (struct RequestHandle *handle,
1527 struct GNUNET_CRYPTO_EcdsaPublicKey *cid) 1538 struct GNUNET_CRYPTO_EcdsaPublicKey *cid)
@@ -1640,6 +1651,7 @@ check_authorization (struct RequestHandle *handle,
1640 return GNUNET_OK; 1651 return GNUNET_OK;
1641} 1652}
1642 1653
1654
1643const struct EgoEntry * 1655const struct EgoEntry *
1644find_ego (struct RequestHandle *handle, 1656find_ego (struct RequestHandle *handle,
1645 struct GNUNET_CRYPTO_EcdsaPublicKey *test_key) 1657 struct GNUNET_CRYPTO_EcdsaPublicKey *test_key)
@@ -1657,6 +1669,7 @@ find_ego (struct RequestHandle *handle,
1657 return NULL; 1669 return NULL;
1658} 1670}
1659 1671
1672
1660static void 1673static void
1661persist_access_token (const struct RequestHandle *handle, 1674persist_access_token (const struct RequestHandle *handle,
1662 const char *access_token, 1675 const char *access_token,
@@ -1676,6 +1689,7 @@ persist_access_token (const struct RequestHandle *handle,
1676 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 1689 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
1677} 1690}
1678 1691
1692
1679/** 1693/**
1680 * Responds to token url-encoded POST request 1694 * Responds to token url-encoded POST request
1681 * 1695 *
@@ -1841,6 +1855,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1841 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle); 1855 GNUNET_SCHEDULER_add_now (&cleanup_handle_delayed, handle);
1842} 1856}
1843 1857
1858
1844/** 1859/**
1845 * Collects claims and stores them in handle 1860 * Collects claims and stores them in handle
1846 */ 1861 */
@@ -1866,6 +1881,7 @@ consume_ticket (void *cls,
1866 GNUNET_free (tmp_value); 1881 GNUNET_free (tmp_value);
1867} 1882}
1868 1883
1884
1869/** 1885/**
1870 * Responds to userinfo GET and url-encoded POST request 1886 * Responds to userinfo GET and url-encoded POST request
1871 * 1887 *
@@ -2002,6 +2018,7 @@ init_cont (struct RequestHandle *handle)
2002 } 2018 }
2003} 2019}
2004 2020
2021
2005/** 2022/**
2006 * If listing is enabled, prints information about the egos. 2023 * If listing is enabled, prints information about the egos.
2007 * 2024 *
@@ -2108,6 +2125,7 @@ list_ego (void *cls,
2108 } 2125 }
2109} 2126}
2110 2127
2128
2111static void 2129static void
2112rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle, 2130rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle,
2113 GNUNET_REST_ResultProcessor proc, 2131 GNUNET_REST_ResultProcessor proc,
@@ -2140,6 +2158,7 @@ rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle,
2140 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n"); 2158 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n");
2141} 2159}
2142 2160
2161
2143/** 2162/**
2144 * Entry point for the plugin. 2163 * Entry point for the plugin.
2145 * 2164 *
@@ -2213,4 +2232,5 @@ libgnunet_plugin_rest_openid_connect_done (void *cls)
2213 return NULL; 2232 return NULL;
2214} 2233}
2215 2234
2235
2216/* end of plugin_rest_openid_connect.c */ 2236/* end of plugin_rest_openid_connect.c */
diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c
index fd35059d7..9a75b2d16 100644
--- a/src/reclaim/plugin_rest_reclaim.c
+++ b/src/reclaim/plugin_rest_reclaim.c
@@ -287,6 +287,7 @@ cleanup_handle (struct RequestHandle *handle)
287 GNUNET_free (handle); 287 GNUNET_free (handle);
288} 288}
289 289
290
290static void 291static void
291cleanup_handle_delayed (void *cls) 292cleanup_handle_delayed (void *cls)
292{ 293{
@@ -342,6 +343,7 @@ collect_error_cb (void *cls)
342 do_error (handle); 343 do_error (handle);
343} 344}
344 345
346
345static void 347static void
346finished_cont (void *cls, int32_t success, const char *emsg) 348finished_cont (void *cls, int32_t success, const char *emsg)
347{ 349{
@@ -379,6 +381,7 @@ return_response (void *cls)
379 cleanup_handle (handle); 381 cleanup_handle (handle);
380} 382}
381 383
384
382static void 385static void
383collect_finished_cb (void *cls) 386collect_finished_cb (void *cls)
384{ 387{
@@ -818,6 +821,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
818 GNUNET_JSON_parse_free (tktspec); 821 GNUNET_JSON_parse_free (tktspec);
819} 822}
820 823
824
821static void 825static void
822consume_cont (void *cls, 826consume_cont (void *cls,
823 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 827 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
@@ -850,6 +854,7 @@ consume_cont (void *cls,
850 GNUNET_free (val_str); 854 GNUNET_free (val_str);
851} 855}
852 856
857
853static void 858static void
854consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle, 859consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
855 const char *url, 860 const char *url,
@@ -943,6 +948,7 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle,
943 return; 948 return;
944} 949}
945 950
951
946/** 952/**
947 * Handle rest request 953 * Handle rest request
948 * 954 *
@@ -982,6 +988,7 @@ init_cont (struct RequestHandle *handle)
982 } 988 }
983} 989}
984 990
991
985/** 992/**
986 * If listing is enabled, prints information about the egos. 993 * If listing is enabled, prints information about the egos.
987 * 994 *
@@ -1044,6 +1051,7 @@ list_ego (void *cls,
1044 } 1051 }
1045} 1052}
1046 1053
1054
1047static void 1055static void
1048rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle, 1056rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle,
1049 GNUNET_REST_ResultProcessor proc, 1057 GNUNET_REST_ResultProcessor proc,
@@ -1068,6 +1076,7 @@ rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle,
1068 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n"); 1076 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n");
1069} 1077}
1070 1078
1079
1071/** 1080/**
1072 * Entry point for the plugin. 1081 * Entry point for the plugin.
1073 * 1082 *
@@ -1124,4 +1133,5 @@ libgnunet_plugin_rest_reclaim_done (void *cls)
1124 return NULL; 1133 return NULL;
1125} 1134}
1126 1135
1136
1127/* end of plugin_rest_reclaim.c */ 1137/* end of plugin_rest_reclaim.c */
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c
index 3e03d973b..7d4d7588a 100644
--- a/src/reclaim/reclaim_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -370,6 +370,7 @@ free_it (struct GNUNET_RECLAIM_AttributeIterator *it)
370 GNUNET_free (it); 370 GNUNET_free (it);
371} 371}
372 372
373
373/** 374/**
374 * Free @a op 375 * Free @a op
375 * 376 *
@@ -832,6 +833,7 @@ GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h)
832 GNUNET_free (h); 833 GNUNET_free (h);
833} 834}
834 835
836
835/** 837/**
836 * Store an attribute. If the attribute is already present, 838 * Store an attribute. If the attribute is already present,
837 * it is replaced with the new attribute. 839 * it is replaced with the new attribute.
diff --git a/src/regex/gnunet-daemon-regexprofiler.c b/src/regex/gnunet-daemon-regexprofiler.c
index a23336808..fb061acc1 100644
--- a/src/regex/gnunet-daemon-regexprofiler.c
+++ b/src/regex/gnunet-daemon-regexprofiler.c
@@ -101,7 +101,6 @@ static unsigned int rounds = 3;
101static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key; 101static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
102 102
103 103
104
105/** 104/**
106 * Task run during shutdown. 105 * Task run during shutdown.
107 * 106 *
@@ -157,7 +156,7 @@ reannounce_regex (void *cls)
157 } 156 }
158 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Announcing regex: %s\n", regex); 157 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Announcing regex: %s\n", regex);
159 GNUNET_STATISTICS_update (stats_handle, "# regexes announced", 1, GNUNET_NO); 158 GNUNET_STATISTICS_update (stats_handle, "# regexes announced", 1, GNUNET_NO);
160 if ((NULL == announce_handle)&&(NULL != regex)) 159 if ((NULL == announce_handle) && (NULL != regex))
161 { 160 {
162 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 161 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
163 "First time, creating regex: %s\n", 162 "First time, creating regex: %s\n",
@@ -196,7 +195,7 @@ announce_regex (const char *regex)
196{ 195{
197 char *copy; 196 char *copy;
198 197
199 if ((NULL == regex)||(0 == strlen (regex))) 198 if ((NULL == regex) || (0 == strlen (regex)))
200 { 199 {
201 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot announce empty regex\n"); 200 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot announce empty regex\n");
202 return; 201 return;
@@ -393,12 +392,15 @@ main (int argc, char *const *argv)
393/** 392/**
394 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 393 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
395 */ 394 */
396void __attribute__ ((constructor)) GNUNET_ARM_memory_init () 395void __attribute__ ((constructor))
396GNUNET_ARM_memory_init ()
397{ 397{
398 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 398 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
399 mallopt (M_TOP_PAD, 1 * 1024); 399 mallopt (M_TOP_PAD, 1 * 1024);
400 malloc_trim (0); 400 malloc_trim (0);
401} 401}
402
403
402#endif 404#endif
403 405
404 406
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c
index 16b7a7f0e..695d66144 100644
--- a/src/regex/gnunet-regex-profiler.c
+++ b/src/regex/gnunet-regex-profiler.c
@@ -417,7 +417,7 @@ do_shutdown (void *cls)
417 { 417 {
418 peer = &peers[peer_cnt]; 418 peer = &peers[peer_cnt];
419 419
420 if ((GNUNET_YES != peer->search_str_matched) &&(NULL != data_file) ) 420 if ((GNUNET_YES != peer->search_str_matched) && (NULL != data_file) )
421 { 421 {
422 prof_time = GNUNET_TIME_absolute_get_duration (peer->prof_start_time); 422 prof_time = GNUNET_TIME_absolute_get_duration (peer->prof_start_time);
423 size = 423 size =
@@ -650,7 +650,7 @@ stats_connect_cb (void *cls,
650{ 650{
651 struct RegexPeer *peer = cls; 651 struct RegexPeer *peer = cls;
652 652
653 if ((NULL == ca_result)||(NULL != emsg)) 653 if ((NULL == ca_result) || (NULL != emsg))
654 { 654 {
655 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 655 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
656 "Failed to connect to statistics service on peer %u: %s\n", 656 "Failed to connect to statistics service on peer %u: %s\n",
@@ -1043,7 +1043,7 @@ dht_connect_cb (void *cls,
1043{ 1043{
1044 struct RegexPeer *peer = (struct RegexPeer *) cls; 1044 struct RegexPeer *peer = (struct RegexPeer *) cls;
1045 1045
1046 if ((NULL != emsg)||(NULL == op)||(NULL == ca_result)) 1046 if ((NULL != emsg) || (NULL == op) || (NULL == ca_result))
1047 { 1047 {
1048 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "DHT connect failed: %s\n", emsg); 1048 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "DHT connect failed: %s\n", emsg);
1049 GNUNET_assert (0); 1049 GNUNET_assert (0);
@@ -1170,6 +1170,7 @@ test_master (void *cls,
1170 GNUNET_SCHEDULER_add_delayed (search_timeout_time, &search_timed_out, NULL); 1170 GNUNET_SCHEDULER_add_delayed (search_timeout_time, &search_timed_out, NULL);
1171} 1171}
1172 1172
1173
1173/** 1174/**
1174 * Function that will be called whenever something in the testbed changes. 1175 * Function that will be called whenever something in the testbed changes.
1175 * 1176 *
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c
index 6637bafed..9adde99bd 100644
--- a/src/regex/gnunet-regex-simulation-profiler.c
+++ b/src/regex/gnunet-regex-simulation-profiler.c
@@ -305,6 +305,7 @@ do_abort (void *cls)
305 GNUNET_SCHEDULER_shutdown (); 305 GNUNET_SCHEDULER_shutdown ();
306} 306}
307 307
308
308/** 309/**
309 * Iterator over all states that inserts each state into the MySQL db. 310 * Iterator over all states that inserts each state into the MySQL db.
310 * 311 *
@@ -369,7 +370,7 @@ regex_iterator (void *cls,
369 return; 370 return;
370 } 371 }
371 372
372 if ((-1 != total) &&(total > 0) ) 373 if ((-1 != total) && (total > 0) )
373 { 374 {
374 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Total: %llu (%s, %s)\n", 375 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Total: %llu (%s, %s)\n",
375 (unsigned long long) total, 376 (unsigned long long) total,
@@ -409,7 +410,7 @@ regex_iterator (void *cls,
409 num_merged_states++; 410 num_merged_states++;
410 } 411 }
411 412
412 if ((GNUNET_SYSERR == result) || ((1 != result) &&(0 != result) )) 413 if ((GNUNET_SYSERR == result) || ((1 != result) && (0 != result) ))
413 { 414 {
414 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 415 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
415 "Error executing prepared mysql statement for edge: Affected rows: %i, expected 0 or 1!\n", 416 "Error executing prepared mysql statement for edge: Affected rows: %i, expected 0 or 1!\n",
@@ -433,7 +434,7 @@ regex_iterator (void *cls,
433 stmt_handle, 434 stmt_handle,
434 params_stmt); 435 params_stmt);
435 436
436 if ((1 != result) &&(0 != result) ) 437 if ((1 != result) && (0 != result) )
437 { 438 {
438 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 439 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
439 "Error executing prepared mysql statement for edge: Affected rows: %i, expected 0 or 1!\n", 440 "Error executing prepared mysql statement for edge: Affected rows: %i, expected 0 or 1!\n",
diff --git a/src/regex/perf-regex.c b/src/regex/perf-regex.c
index d41887f6b..6155501f2 100644
--- a/src/regex/perf-regex.c
+++ b/src/regex/perf-regex.c
@@ -125,4 +125,5 @@ main (int argc, char *const *argv)
125 return 0; 125 return 0;
126} 126}
127 127
128
128/* end of prof-regex.c */ 129/* end of prof-regex.c */
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c
index e8ff158dd..9c7aa9119 100644
--- a/src/regex/plugin_block_regex.c
+++ b/src/regex/plugin_block_regex.c
@@ -408,4 +408,5 @@ libgnunet_plugin_block_regex_done (void *cls)
408 return NULL; 408 return NULL;
409} 409}
410 410
411
411/* end of plugin_block_regex.c */ 412/* end of plugin_block_regex.c */
diff --git a/src/regex/regex_api_announce.c b/src/regex/regex_api_announce.c
index 318d73263..ad8a4fab9 100644
--- a/src/regex/regex_api_announce.c
+++ b/src/regex/regex_api_announce.c
@@ -63,7 +63,6 @@ struct GNUNET_REGEX_Announcement
63}; 63};
64 64
65 65
66
67/** 66/**
68 * (Re)connect to the REGEX service with the given announcement @a a. 67 * (Re)connect to the REGEX service with the given announcement @a a.
69 * 68 *
@@ -183,4 +182,5 @@ GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_Announcement *a)
183 GNUNET_free (a); 182 GNUNET_free (a);
184} 183}
185 184
185
186/* end of regex_api_announce.c */ 186/* end of regex_api_announce.c */
diff --git a/src/regex/regex_block_lib.c b/src/regex/regex_block_lib.c
index 2c6752e09..a309c2305 100644
--- a/src/regex/regex_block_lib.c
+++ b/src/regex/regex_block_lib.c
@@ -218,7 +218,7 @@ REGEX_BLOCK_check (const struct RegexBlock *block,
218 GNUNET_break_op (0); 218 GNUNET_break_op (0);
219 return GNUNET_SYSERR; 219 return GNUNET_SYSERR;
220 } 220 }
221 if ((NULL != query)&& 221 if ((NULL != query) &&
222 (0 != GNUNET_memcmp (&key, 222 (0 != GNUNET_memcmp (&key,
223 query)) ) 223 query)) )
224 { 224 {
diff --git a/src/regex/regex_internal.c b/src/regex/regex_internal.c
index 78c2de8ab..1dd4f6a97 100644
--- a/src/regex/regex_internal.c
+++ b/src/regex/regex_internal.c
@@ -121,7 +121,7 @@ state_add_transition (struct REGEX_INTERNAL_Context *ctx,
121 /* Do not add duplicate state transitions */ 121 /* Do not add duplicate state transitions */
122 for (t = from_state->transitions_head; NULL != t; t = t->next) 122 for (t = from_state->transitions_head; NULL != t; t = t->next)
123 { 123 {
124 if ((t->to_state == to_state) &&(0 == nullstrcmp (t->label, label)) && 124 if ((t->to_state == to_state) && (0 == nullstrcmp (t->label, label)) &&
125 (t->from_state == from_state) ) 125 (t->from_state == from_state) )
126 return; 126 return;
127 } 127 }
@@ -162,7 +162,7 @@ static void
162state_remove_transition (struct REGEX_INTERNAL_State *state, 162state_remove_transition (struct REGEX_INTERNAL_State *state,
163 struct REGEX_INTERNAL_Transition *transition) 163 struct REGEX_INTERNAL_Transition *transition)
164{ 164{
165 if ((NULL == state)||(NULL == transition)) 165 if ((NULL == state) || (NULL == transition))
166 return; 166 return;
167 167
168 if (transition->from_state != state) 168 if (transition->from_state != state)
@@ -247,7 +247,7 @@ state_set_compare (struct REGEX_INTERNAL_StateSet *sset1,
247 int result; 247 int result;
248 unsigned int i; 248 unsigned int i;
249 249
250 if ((NULL == sset1)||(NULL == sset2)) 250 if ((NULL == sset1) || (NULL == sset2))
251 return 1; 251 return 1;
252 252
253 result = sset1->off - sset2->off; 253 result = sset1->off - sset2->off;
@@ -339,7 +339,7 @@ automaton_remove_state (struct REGEX_INTERNAL_Automaton *a,
339 struct REGEX_INTERNAL_Transition *t_check; 339 struct REGEX_INTERNAL_Transition *t_check;
340 struct REGEX_INTERNAL_Transition *t_check_next; 340 struct REGEX_INTERNAL_Transition *t_check_next;
341 341
342 if ((NULL == a)||(NULL == s)) 342 if ((NULL == a) || (NULL == s))
343 return; 343 return;
344 344
345 /* remove all transitions leading to this state */ 345 /* remove all transitions leading to this state */
@@ -399,7 +399,7 @@ automaton_merge_states (struct REGEX_INTERNAL_Context *ctx,
399 is_dup = GNUNET_NO; 399 is_dup = GNUNET_NO;
400 for (t = t_check->from_state->transitions_head; NULL != t; t = t->next) 400 for (t = t_check->from_state->transitions_head; NULL != t; t = t->next)
401 { 401 {
402 if ((t->to_state == s1) &&(0 == strcmp (t_check->label, t->label)) ) 402 if ((t->to_state == s1) && (0 == strcmp (t_check->label, t->label)) )
403 is_dup = GNUNET_YES; 403 is_dup = GNUNET_YES;
404 } 404 }
405 if (GNUNET_NO == is_dup) 405 if (GNUNET_NO == is_dup)
@@ -487,7 +487,7 @@ automaton_state_traverse (struct REGEX_INTERNAL_State *s,
487 for (t = s->transitions_head; NULL != t; t = t->next) 487 for (t = s->transitions_head; NULL != t; t = t->next)
488 { 488 {
489 if ((NULL == check) || 489 if ((NULL == check) ||
490 ((NULL != check) &&(GNUNET_YES == check (check_cls, s, t)) )) 490 ((NULL != check) && (GNUNET_YES == check (check_cls, s, t)) ))
491 { 491 {
492 automaton_state_traverse (t->to_state, 492 automaton_state_traverse (t->to_state,
493 marks, 493 marks,
@@ -525,7 +525,7 @@ REGEX_INTERNAL_automaton_traverse (const struct REGEX_INTERNAL_Automaton *a,
525 unsigned int count; 525 unsigned int count;
526 struct REGEX_INTERNAL_State *s; 526 struct REGEX_INTERNAL_State *s;
527 527
528 if ((NULL == a)||(0 == a->state_count)) 528 if ((NULL == a) || (0 == a->state_count))
529 return; 529 return;
530 530
531 int marks[a->state_count]; 531 int marks[a->state_count];
@@ -1197,9 +1197,7 @@ automaton_create_proofs_simplify (const struct StringBuffer *R_last_ij,
1197 * R_cur_ij = R_cur_l | R_cur_r 1197 * R_cur_ij = R_cur_l | R_cur_r
1198 * R_cur_l == R^{(k-1)}_{ij} 1198 * R_cur_l == R^{(k-1)}_{ij}
1199 * R_cur_r == R^{(k-1)}_{ik} ( R^{(k-1)}_{kk} )^* R^{(k-1)}_{kj} 1199 * R_cur_r == R^{(k-1)}_{ik} ( R^{(k-1)}_{kk} )^* R^{(k-1)}_{kj}
1200 */ 1200 */if ((GNUNET_YES == R_last_ij->null_flag) &&
1201
1202 if ((GNUNET_YES == R_last_ij->null_flag) &&
1203 ((GNUNET_YES == R_last_ik->null_flag) || 1201 ((GNUNET_YES == R_last_ik->null_flag) ||
1204 (GNUNET_YES == R_last_kj->null_flag))) 1202 (GNUNET_YES == R_last_kj->null_flag)))
1205 { 1203 {
@@ -1283,8 +1281,7 @@ automaton_create_proofs_simplify (const struct StringBuffer *R_last_ij,
1283 * (e|a)|(e|a)a*a = a* 1281 * (e|a)|(e|a)a*a = a*
1284 * (e|a)|(e|a)a*(e|a) = a* 1282 * (e|a)|(e|a)a*(e|a) = a*
1285 * (e|a)|(e|a)(e|a)*(e|a) = a* 1283 * (e|a)|(e|a)(e|a)*(e|a) = a*
1286 */ 1284 */if (GNUNET_YES == needs_parentheses (&R_temp_ij))
1287 if (GNUNET_YES == needs_parentheses (&R_temp_ij))
1288 sb_printf1 (R_cur_r, "(%.*s)*", 3, &R_temp_ij); 1285 sb_printf1 (R_cur_r, "(%.*s)*", 3, &R_temp_ij);
1289 else 1286 else
1290 sb_printf1 (R_cur_r, "%.*s*", 1, &R_temp_ij); 1287 sb_printf1 (R_cur_r, "%.*s*", 1, &R_temp_ij);
@@ -1297,8 +1294,7 @@ automaton_create_proofs_simplify (const struct StringBuffer *R_last_ij,
1297 * a|aa*(e|a) = a+ 1294 * a|aa*(e|a) = a+
1298 * a|(e|a)(e|a)*a = a+ 1295 * a|(e|a)(e|a)*a = a+
1299 * a|a(e|a)*(e|a) = a+ 1296 * a|a(e|a)*(e|a) = a+
1300 */ 1297 */if (GNUNET_YES == needs_parentheses (&R_temp_ij))
1301 if (GNUNET_YES == needs_parentheses (&R_temp_ij))
1302 sb_printf1 (R_cur_r, "(%.*s)+", 3, &R_temp_ij); 1298 sb_printf1 (R_cur_r, "(%.*s)+", 3, &R_temp_ij);
1303 else 1299 else
1304 sb_printf1 (R_cur_r, "%.*s+", 1, &R_temp_ij); 1300 sb_printf1 (R_cur_r, "%.*s+", 1, &R_temp_ij);
@@ -1435,8 +1431,7 @@ automaton_create_proofs_simplify (const struct StringBuffer *R_last_ij,
1435 * aa*(e|a) = a+ 1431 * aa*(e|a) = a+
1436 * a(e|a)*(e|a) = a+ 1432 * a(e|a)*(e|a) = a+
1437 * (e|a)a*a = a+ 1433 * (e|a)a*a = a+
1438 */ 1434 */else
1439 else
1440 { 1435 {
1441 eps_check = (has_epsilon (R_last_ik) + has_epsilon (R_last_kk) 1436 eps_check = (has_epsilon (R_last_ik) + has_epsilon (R_last_kk)
1442 + has_epsilon (R_last_kj)); 1437 + has_epsilon (R_last_kj));
@@ -1922,7 +1917,7 @@ dfa_remove_dead_states (struct REGEX_INTERNAL_Automaton *a)
1922 dead = 1; 1917 dead = 1;
1923 for (t = s->transitions_head; NULL != t; t = t->next) 1918 for (t = s->transitions_head; NULL != t; t = t->next)
1924 { 1919 {
1925 if ((NULL != t->to_state) &&(t->to_state != s) ) 1920 if ((NULL != t->to_state) && (t->to_state != s) )
1926 { 1921 {
1927 dead = 0; 1922 dead = 0;
1928 break; 1923 break;
@@ -2201,7 +2196,7 @@ REGEX_INTERNAL_dfa_add_multi_strides (struct REGEX_INTERNAL_Context *regex_ctx,
2201 struct REGEX_INTERNAL_Transition *t; 2196 struct REGEX_INTERNAL_Transition *t;
2202 struct REGEX_INTERNAL_Transition *t_next; 2197 struct REGEX_INTERNAL_Transition *t_next;
2203 2198
2204 if ((1 > stride_len)||(GNUNET_YES == dfa->is_multistrided)) 2199 if ((1 > stride_len) || (GNUNET_YES == dfa->is_multistrided))
2205 return; 2200 return;
2206 2201
2207 /* Compute the new transitions of given stride_len */ 2202 /* Compute the new transitions of given stride_len */
@@ -2226,6 +2221,7 @@ REGEX_INTERNAL_dfa_add_multi_strides (struct REGEX_INTERNAL_Context *regex_ctx,
2226 dfa->is_multistrided = GNUNET_YES; 2221 dfa->is_multistrided = GNUNET_YES;
2227} 2222}
2228 2223
2224
2229/** 2225/**
2230 * Recursive Helper function for DFA path compression. Does DFS on the DFA graph 2226 * Recursive Helper function for DFA path compression. Does DFS on the DFA graph
2231 * and adds new transitions to the given transitions DLL and marks states that 2227 * and adds new transitions to the given transitions DLL and marks states that
@@ -2252,11 +2248,14 @@ dfa_compress_paths_helper (struct REGEX_INTERNAL_Automaton *dfa,
2252 char *new_label; 2248 char *new_label;
2253 2249
2254 2250
2255 if ((NULL != label)&& 2251 if ((NULL != label) &&
2256 (((cur->incoming_transition_count > 1)||(GNUNET_YES == cur->accepting)|| 2252 (((cur->incoming_transition_count > 1) || (GNUNET_YES ==
2253 cur->accepting) ||
2257 (GNUNET_YES == cur->marked) ) || 2254 (GNUNET_YES == cur->marked) ) ||
2258 ((start != dfa->start)&&(max_len > 0)&&(max_len == strlen (label))) || 2255 ((start != dfa->start) && (max_len > 0) && (max_len == strlen (
2259 ((start == dfa->start)&&(GNUNET_REGEX_INITIAL_BYTES == strlen (label))))) 2256 label))) ||
2257 ((start == dfa->start) && (GNUNET_REGEX_INITIAL_BYTES == strlen (
2258 label)))))
2260 { 2259 {
2261 t = GNUNET_new (struct REGEX_INTERNAL_Transition); 2260 t = GNUNET_new (struct REGEX_INTERNAL_Transition);
2262 t->label = GNUNET_strdup (label); 2261 t->label = GNUNET_strdup (label);
@@ -2279,7 +2278,7 @@ dfa_compress_paths_helper (struct REGEX_INTERNAL_Automaton *dfa,
2279 else if (cur != start) 2278 else if (cur != start)
2280 cur->contained = GNUNET_YES; 2279 cur->contained = GNUNET_YES;
2281 2280
2282 if ((GNUNET_YES == cur->marked)&&(cur != start)) 2281 if ((GNUNET_YES == cur->marked) && (cur != start))
2283 return; 2282 return;
2284 2283
2285 cur->marked = GNUNET_YES; 2284 cur->marked = GNUNET_YES;
@@ -2398,7 +2397,7 @@ nfa_fragment_create (struct REGEX_INTERNAL_State *start,
2398 n->end = NULL; 2397 n->end = NULL;
2399 n->state_count = 0; 2398 n->state_count = 0;
2400 2399
2401 if ((NULL == start)||(NULL == end)) 2400 if ((NULL == start) || (NULL == end))
2402 return n; 2401 return n;
2403 2402
2404 automaton_add_state (n, end); 2403 automaton_add_state (n, end);
@@ -2427,7 +2426,7 @@ nfa_add_states (struct REGEX_INTERNAL_Automaton *n,
2427{ 2426{
2428 struct REGEX_INTERNAL_State *s; 2427 struct REGEX_INTERNAL_State *s;
2429 2428
2430 if ((NULL == n)||(NULL == states_head)) 2429 if ((NULL == n) || (NULL == states_head))
2431 { 2430 {
2432 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not add states\n"); 2431 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not add states\n");
2433 return; 2432 return;
@@ -2820,7 +2819,7 @@ REGEX_INTERNAL_construct_nfa (const char *regex, const size_t len)
2820 int atomcount; 2819 int atomcount;
2821 } *p; 2820 } *p;
2822 2821
2823 if ((NULL == regex)||(0 == strlen (regex))||(0 == len)) 2822 if ((NULL == regex) || (0 == strlen (regex)) || (0 == len))
2824 { 2823 {
2825 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2824 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2826 "Could not parse regex. Empty regex string provided.\n"); 2825 "Could not parse regex. Empty regex string provided.\n");
@@ -3009,7 +3008,7 @@ construct_dfa_states (struct REGEX_INTERNAL_Context *ctx,
3009 3008
3010 for (ctran = dfa_state->transitions_head; NULL != ctran; ctran = ctran->next) 3009 for (ctran = dfa_state->transitions_head; NULL != ctran; ctran = ctran->next)
3011 { 3010 {
3012 if ((NULL == ctran->label) ||(NULL != ctran->to_state) ) 3011 if ((NULL == ctran->label) || (NULL != ctran->to_state) )
3013 continue; 3012 continue;
3014 3013
3015 nfa_closure_set_create (&tmp, nfa, &dfa_state->nfa_set, ctran->label); 3014 nfa_closure_set_create (&tmp, nfa, &dfa_state->nfa_set, ctran->label);
@@ -3173,7 +3172,7 @@ evaluate_dfa (struct REGEX_INTERNAL_Automaton *a, const char *string)
3173 s = a->start; 3172 s = a->start;
3174 3173
3175 /* If the string is empty but the starting state is accepting, we accept. */ 3174 /* If the string is empty but the starting state is accepting, we accept. */
3176 if (((NULL == string)||(0 == strlen (string))) && s->accepting) 3175 if (((NULL == string) || (0 == strlen (string))) && s->accepting)
3177 return 0; 3176 return 0;
3178 3177
3179 for (strp = string; NULL != strp && *strp; strp += step_len) 3178 for (strp = string; NULL != strp && *strp; strp += step_len)
@@ -3184,7 +3183,7 @@ evaluate_dfa (struct REGEX_INTERNAL_Automaton *a, const char *string)
3184 break; 3183 break;
3185 } 3184 }
3186 3185
3187 if ((NULL != s)&& s->accepting) 3186 if ((NULL != s) && s->accepting)
3188 return 0; 3187 return 0;
3189 3188
3190 return 1; 3189 return 1;
@@ -3218,7 +3217,7 @@ evaluate_nfa (struct REGEX_INTERNAL_Automaton *a, const char *string)
3218 } 3217 }
3219 3218
3220 /* If the string is empty but the starting state is accepting, we accept. */ 3219 /* If the string is empty but the starting state is accepting, we accept. */
3221 if (((NULL == string)||(0 == strlen (string))) && a->start->accepting) 3220 if (((NULL == string) || (0 == strlen (string))) && a->start->accepting)
3222 return 0; 3221 return 0;
3223 3222
3224 result = 1; 3223 result = 1;
@@ -3644,7 +3643,7 @@ reachability_iterator (void *cls,
3644 /* already visited and marked */ 3643 /* already visited and marked */
3645 return GNUNET_YES; 3644 return GNUNET_YES;
3646 3645
3647 if ((GNUNET_REGEX_INITIAL_BYTES > strlen (state->proof))&& 3646 if ((GNUNET_REGEX_INITIAL_BYTES > strlen (state->proof)) &&
3648 (GNUNET_NO == state->accepting) ) 3647 (GNUNET_NO == state->accepting) )
3649 /* not directly reachable */ 3648 /* not directly reachable */
3650 return GNUNET_YES; 3649 return GNUNET_YES;
@@ -3685,6 +3684,7 @@ iterate_reachables (void *cls, const struct GNUNET_HashCode *key, void *value)
3685 return GNUNET_YES; 3684 return GNUNET_YES;
3686} 3685}
3687 3686
3687
3688/** 3688/**
3689 * Iterate over all edges of automaton 'a' that are reachable from a state with 3689 * Iterate over all edges of automaton 'a' that are reachable from a state with
3690 * a proof of at least GNUNET_REGEX_INITIAL_BYTES characters. 3690 * a proof of at least GNUNET_REGEX_INITIAL_BYTES characters.
diff --git a/src/regex/regex_internal.h b/src/regex/regex_internal.h
index 1e0722136..17b038f21 100644
--- a/src/regex/regex_internal.h
+++ b/src/regex/regex_internal.h
@@ -446,7 +446,6 @@ REGEX_INTERNAL_dfa_add_multi_strides (struct REGEX_INTERNAL_Context *regex_ctx,
446 const unsigned int stride_len); 446 const unsigned int stride_len);
447 447
448 448
449
450#if 0 /* keep Emacsens' auto-indent happy */ 449#if 0 /* keep Emacsens' auto-indent happy */
451{ 450{
452#endif 451#endif
diff --git a/src/regex/regex_internal_lib.h b/src/regex/regex_internal_lib.h
index 531f998cc..cd955e68b 100644
--- a/src/regex/regex_internal_lib.h
+++ b/src/regex/regex_internal_lib.h
@@ -157,7 +157,6 @@ REGEX_INTERNAL_iterate_reachable_edges (struct REGEX_INTERNAL_Automaton *a,
157 void *iterator_cls); 157 void *iterator_cls);
158 158
159 159
160
161/** 160/**
162 * Handle to store cached data about a regex announce. 161 * Handle to store cached data about a regex announce.
163 */ 162 */
diff --git a/src/regex/regex_test_graph.c b/src/regex/regex_test_graph.c
index c988b5aae..8e1e00fd4 100644
--- a/src/regex/regex_test_graph.c
+++ b/src/regex/regex_test_graph.c
@@ -282,7 +282,7 @@ REGEX_TEST_automaton_save_graph (struct REGEX_INTERNAL_Automaton *a,
282 return; 282 return;
283 } 283 }
284 284
285 if ((NULL == filename)||(strlen (filename) < 1)) 285 if ((NULL == filename) || (strlen (filename) < 1))
286 { 286 {
287 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No Filename given!"); 287 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No Filename given!");
288 return; 288 return;
diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c
index 15d6c653a..05001b5d2 100644
--- a/src/regex/regex_test_lib.c
+++ b/src/regex/regex_test_lib.c
@@ -72,11 +72,11 @@ c2i (char c, int size)
72 break; 72 break;
73 73
74 case 16: 74 case 16:
75 if ((c >= '0') &&(c <= '9') ) 75 if ((c >= '0') && (c <= '9') )
76 return c - '0'; 76 return c - '0';
77 else if ((c >= 'A') &&(c <= 'F') ) 77 else if ((c >= 'A') && (c <= 'F') )
78 return c - 'A' + 10; 78 return c - 'A' + 10;
79 else if ((c >= 'a') &&(c <= 'f') ) 79 else if ((c >= 'a') && (c <= 'f') )
80 return c - 'a' + 10; 80 return c - 'a' + 10;
81 else 81 else
82 { 82 {
@@ -324,6 +324,7 @@ get_longest_prefix (struct RegexCombineCtx *ctx, const char *regex)
324 return best; 324 return best;
325} 325}
326 326
327
327static void 328static void
328regex_add_multiple (struct RegexCombineCtx *ctx, 329regex_add_multiple (struct RegexCombineCtx *ctx,
329 const char *regex, 330 const char *regex,
@@ -347,7 +348,7 @@ regex_add_multiple (struct RegexCombineCtx *ctx,
347 count = 0; 348 count = 0;
348 for (i = 1UL; i < l; i++) 349 for (i = 1UL; i < l; i++)
349 { 350 {
350 if ((regex[i] != '|') &&(regex[i] != ')') ) 351 if ((regex[i] != '|') && (regex[i] != ')') )
351 { 352 {
352 count++; 353 count++;
353 } 354 }
@@ -361,7 +362,7 @@ regex_add_multiple (struct RegexCombineCtx *ctx,
361 tmp[1] = '\0'; 362 tmp[1] = '\0';
362 for (i = 1UL; i < l; i++) 363 for (i = 1UL; i < l; i++)
363 { 364 {
364 if ((regex[i] != '|') &&(regex[i] != ')') ) 365 if ((regex[i] != '|') && (regex[i] != ')') )
365 { 366 {
366 tmp[0] = regex[i]; 367 tmp[0] = regex[i];
367 newctx = new_regex_ctx (ctx->size); 368 newctx = new_regex_ctx (ctx->size);
@@ -375,6 +376,7 @@ regex_add_multiple (struct RegexCombineCtx *ctx,
375 } 376 }
376} 377}
377 378
379
378/** 380/**
379 * Add a single regex to a context, splitting the exisiting state. 381 * Add a single regex to a context, splitting the exisiting state.
380 * 382 *
@@ -482,7 +484,7 @@ regex_add (struct RegexCombineCtx *ctx, const char *regex)
482 484
483 /* There is no prefix match, add new */ 485 /* There is no prefix match, add new */
484 idx = c2i (regex[0], ctx->size); 486 idx = c2i (regex[0], ctx->size);
485 if ((NULL == ctx->children[idx])&&(NULL != ctx->s)) 487 if ((NULL == ctx->children[idx]) && (NULL != ctx->s))
486 { 488 {
487 /* this was the end before, add empty string */ 489 /* this was the end before, add empty string */
488 newctx = new_regex_ctx (ctx->size); 490 newctx = new_regex_ctx (ctx->size);
@@ -652,4 +654,5 @@ REGEX_TEST_free_from_file (char **regexes)
652 GNUNET_free (regexes); 654 GNUNET_free (regexes);
653} 655}
654 656
657
655/* end of regex_test_lib.c */ 658/* end of regex_test_lib.c */
diff --git a/src/regex/regex_test_lib.h b/src/regex/regex_test_lib.h
index a0ad0723a..98f60d317 100644
--- a/src/regex/regex_test_lib.h
+++ b/src/regex/regex_test_lib.h
@@ -147,7 +147,6 @@ REGEX_TEST_automaton_save_graph (struct REGEX_INTERNAL_Automaton *a,
147 enum REGEX_TEST_GraphSavingOptions options); 147 enum REGEX_TEST_GraphSavingOptions options);
148 148
149 149
150
151#if 0 /* keep Emacsens' auto-indent happy */ 150#if 0 /* keep Emacsens' auto-indent happy */
152{ 151{
153 #endif 152 #endif
diff --git a/src/regex/regex_test_random.c b/src/regex/regex_test_random.c
index 29b5315db..02d59f5dc 100644
--- a/src/regex/regex_test_random.c
+++ b/src/regex/regex_test_random.c
@@ -123,8 +123,8 @@ REGEX_TEST_generate_random_regex (size_t rx_length, char *matching_str)
123 } 123 }
124 124
125 if ((NULL != matching_strp) && 125 if ((NULL != matching_strp) &&
126 ((current_char != '+') &&(current_char != '*') &&(current_char != 126 ((current_char != '+') && (current_char != '*') && (current_char !=
127 '?') && 127 '?') &&
128 (current_char != '|') )) 128 (current_char != '|') ))
129 { 129 {
130 *matching_strp = current_char; 130 *matching_strp = current_char;
diff --git a/src/regex/test_regex_api.c b/src/regex/test_regex_api.c
index eaae8c682..734fbdbf3 100644
--- a/src/regex/test_regex_api.c
+++ b/src/regex/test_regex_api.c
@@ -128,4 +128,5 @@ main (int argc, char *argv[])
128 return ok; 128 return ok;
129} 129}
130 130
131
131/* end of test_regex_api.c */ 132/* end of test_regex_api.c */
diff --git a/src/regex/test_regex_eval_api.c b/src/regex/test_regex_eval_api.c
index f6078c7ef..767571156 100644
--- a/src/regex/test_regex_eval_api.c
+++ b/src/regex/test_regex_eval_api.c
@@ -119,8 +119,8 @@ test_random (unsigned int rx_length, unsigned int max_str_len,
119 /* We only want to match the whole string, because that's what our DFA does, 119 /* We only want to match the whole string, because that's what our DFA does,
120 * too. */ 120 * too. */
121 if ((eval_check == 0) && 121 if ((eval_check == 0) &&
122 ((matchptr[0].rm_so != 0) ||(matchptr[0].rm_eo != strlen ( 122 ((matchptr[0].rm_so != 0) || (matchptr[0].rm_eo != strlen (
123 matching_str)) )) 123 matching_str)) ))
124 eval_check = 1; 124 eval_check = 1;
125 125
126 /* Match canonical regex */ 126 /* Match canonical regex */
@@ -150,12 +150,12 @@ test_random (unsigned int rx_length, unsigned int max_str_len,
150 /* We only want to match the whole string, because that's what our DFA does, 150 /* We only want to match the whole string, because that's what our DFA does,
151 * too. */ 151 * too. */
152 if ((eval_canonical_check == 0) && 152 if ((eval_canonical_check == 0) &&
153 ((matchptr[0].rm_so != 0) ||(matchptr[0].rm_eo != strlen ( 153 ((matchptr[0].rm_so != 0) || (matchptr[0].rm_eo != strlen (
154 matching_str)) )) 154 matching_str)) ))
155 eval_canonical_check = 1; 155 eval_canonical_check = 1;
156 156
157 /* compare results */ 157 /* compare results */
158 if ((eval_check != eval) ||(eval_canonical != eval_canonical_check) ) 158 if ((eval_check != eval) || (eval_canonical != eval_canonical_check) )
159 { 159 {
160 regerror (eval_check, &rx, error, sizeof error); 160 regerror (eval_check, &rx, error, sizeof error);
161 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 161 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -184,6 +184,7 @@ error:
184 return -1; 184 return -1;
185} 185}
186 186
187
187/** 188/**
188 * Automaton test that compares the result of matching regular expression 'rx' 189 * Automaton test that compares the result of matching regular expression 'rx'
189 * with the strings and expected results in 'rxstr' with the result of matching 190 * with the strings and expected results in 'rxstr' with the result of matching
@@ -227,10 +228,10 @@ test_automaton (struct REGEX_INTERNAL_Automaton *a, regex_t *rx,
227 (matchptr[0].rm_eo != strlen (rxstr->strings[i])) )) 228 (matchptr[0].rm_eo != strlen (rxstr->strings[i])) ))
228 eval_check = 1; 229 eval_check = 1;
229 230
230 if (((rxstr->expected_results[i] == match) && ((0 != eval) ||(0 != 231 if (((rxstr->expected_results[i] == match) && ((0 != eval) || (0 !=
231 eval_check) )) 232 eval_check) ))
232 || ((rxstr->expected_results[i] == nomatch) && 233 || ((rxstr->expected_results[i] == nomatch) &&
233 ((0 == eval) ||(0 == eval_check) ))) 234 ((0 == eval) || (0 == eval_check) )))
234 { 235 {
235 result = 1; 236 result = 1;
236 regerror (eval_check, rx, error, sizeof error); 237 regerror (eval_check, rx, error, sizeof error);
@@ -247,6 +248,7 @@ test_automaton (struct REGEX_INTERNAL_Automaton *a, regex_t *rx,
247 return result; 248 return result;
248} 249}
249 250
251
250int 252int
251main (int argc, char *argv[]) 253main (int argc, char *argv[])
252{ 254{
diff --git a/src/regex/test_regex_integration.c b/src/regex/test_regex_integration.c
index c7a7e38b5..2e6874e4d 100644
--- a/src/regex/test_regex_integration.c
+++ b/src/regex/test_regex_integration.c
@@ -208,4 +208,5 @@ main (int argc, char *argv[])
208 return ok; 208 return ok;
209} 209}
210 210
211
211/* end of test_regex_integration.c */ 212/* end of test_regex_integration.c */
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index 2456ad50c..02a2c6daf 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -185,6 +185,7 @@ run_mhd_now ()
185 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL); 185 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL);
186} 186}
187 187
188
188/** 189/**
189 * Plugin result callback 190 * Plugin result callback
190 * 191 *
@@ -242,6 +243,7 @@ cleanup_handle (struct MhdConnectionHandle *handle)
242 GNUNET_free (handle); 243 GNUNET_free (handle);
243} 244}
244 245
246
245static int 247static int
246header_iterator (void *cls, 248header_iterator (void *cls,
247 enum MHD_ValueKind kind, 249 enum MHD_ValueKind kind,
@@ -299,6 +301,7 @@ url_iterator (void *cls,
299 return MHD_YES; 301 return MHD_YES;
300} 302}
301 303
304
302static int 305static int
303post_data_iter (void *cls, 306post_data_iter (void *cls,
304 enum MHD_ValueKind kind, 307 enum MHD_ValueKind kind,
@@ -334,6 +337,7 @@ post_data_iter (void *cls,
334 return MHD_YES; 337 return MHD_YES;
335} 338}
336 339
340
337/* ********************************* MHD response generation ******************* */ 341/* ********************************* MHD response generation ******************* */
338 342
339/** 343/**
@@ -641,6 +645,7 @@ schedule_httpd ()
641 GNUNET_NETWORK_fdset_destroy (wws); 645 GNUNET_NETWORK_fdset_destroy (wws);
642} 646}
643 647
648
644/** 649/**
645 * Task run whenever HTTP server operations are pending. 650 * Task run whenever HTTP server operations are pending.
646 * 651 *
@@ -1050,4 +1055,5 @@ main (int argc, char *const *argv)
1050 return ret; 1055 return ret;
1051} 1056}
1052 1057
1058
1053/* end of gnunet-rest-server.c */ 1059/* end of gnunet-rest-server.c */
diff --git a/src/rest/plugin_rest_config.c b/src/rest/plugin_rest_config.c
index 16f5d2ec1..d89c858ee 100644
--- a/src/rest/plugin_rest_config.c
+++ b/src/rest/plugin_rest_config.c
@@ -124,6 +124,7 @@ add_sections (void *cls,
124 json_object_set_new (sections_obj, section, sec_obj); 124 json_object_set_new (sections_obj, section, sec_obj);
125} 125}
126 126
127
127static void 128static void
128add_section_contents (void *cls, 129add_section_contents (void *cls,
129 const char *section, 130 const char *section,
@@ -135,6 +136,7 @@ add_section_contents (void *cls,
135 json_object_set_new (section_obj, option, json_string (value)); 136 json_object_set_new (section_obj, option, json_string (value));
136} 137}
137 138
139
138/** 140/**
139 * Handle rest request 141 * Handle rest request
140 * 142 *
@@ -179,6 +181,7 @@ get_cont (struct GNUNET_REST_RequestHandle *con_handle,
179 json_decref (result); 181 json_decref (result);
180} 182}
181 183
184
182struct GNUNET_CONFIGURATION_Handle * 185struct GNUNET_CONFIGURATION_Handle *
183set_value (struct GNUNET_CONFIGURATION_Handle *config, 186set_value (struct GNUNET_CONFIGURATION_Handle *config,
184 const char *section, 187 const char *section,
@@ -202,6 +205,7 @@ set_value (struct GNUNET_CONFIGURATION_Handle *config,
202 return config; // for error handling (0 -> success, 1 -> error) 205 return config; // for error handling (0 -> success, 1 -> error)
203} 206}
204 207
208
205/** 209/**
206 * Handle REST POST request 210 * Handle REST POST request
207 * 211 *
@@ -308,6 +312,7 @@ set_cont (struct GNUNET_REST_RequestHandle *con_handle,
308 cleanup_handle (handle); 312 cleanup_handle (handle);
309} 313}
310 314
315
311/** 316/**
312 * Handle rest request 317 * Handle rest request
313 * 318 *
@@ -416,4 +421,5 @@ libgnunet_plugin_rest_config_done (void *cls)
416 return NULL; 421 return NULL;
417} 422}
418 423
424
419/* end of plugin_rest_config.c */ 425/* end of plugin_rest_config.c */
diff --git a/src/rest/plugin_rest_copying.c b/src/rest/plugin_rest_copying.c
index eabe96c63..e601e505e 100644
--- a/src/rest/plugin_rest_copying.c
+++ b/src/rest/plugin_rest_copying.c
@@ -120,7 +120,6 @@ get_cont (struct GNUNET_REST_RequestHandle *con_handle,
120} 120}
121 121
122 122
123
124/** 123/**
125 * Handle rest request 124 * Handle rest request
126 * 125 *
@@ -231,4 +230,5 @@ libgnunet_plugin_rest_copying_done (void *cls)
231 return NULL; 230 return NULL;
232} 231}
233 232
233
234/* end of plugin_rest_copying.c */ 234/* end of plugin_rest_copying.c */
diff --git a/src/rest/rest.c b/src/rest/rest.c
index b83530ee1..0dfd44ce7 100644
--- a/src/rest/rest.c
+++ b/src/rest/rest.c
@@ -46,6 +46,7 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace)
46 return 0 == strncmp (namespace, url, strlen (namespace)); 46 return 0 == strncmp (namespace, url, strlen (namespace));
47} 47}
48 48
49
49/** 50/**
50 * Create MHD response 51 * Create MHD response
51 * 52 *
@@ -71,6 +72,7 @@ GNUNET_REST_create_response (const char *data)
71 return resp; 72 return resp;
72} 73}
73 74
75
74int 76int
75GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn, 77GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn,
76 const struct GNUNET_REST_RequestHandler *handlers, 78 const struct GNUNET_REST_RequestHandler *handlers,
@@ -106,4 +108,5 @@ GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn,
106 return GNUNET_NO; 108 return GNUNET_NO;
107} 109}
108 110
111
109/* end of rest.c */ 112/* end of rest.c */
diff --git a/src/revocation/gnunet-revocation.c b/src/revocation/gnunet-revocation.c
index 652c1e62d..f5aa2d17e 100644
--- a/src/revocation/gnunet-revocation.c
+++ b/src/revocation/gnunet-revocation.c
@@ -531,4 +531,5 @@ main (int argc, char *const *argv)
531 return ret; 531 return ret;
532} 532}
533 533
534
534/* end of gnunet-revocation.c */ 535/* end of gnunet-revocation.c */
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 8be2d3926..456b3834a 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -960,6 +960,7 @@ GNUNET_REVOCATION_memory_init ()
960 malloc_trim (0); 960 malloc_trim (0);
961} 961}
962 962
963
963#endif 964#endif
964 965
965 966
diff --git a/src/revocation/plugin_block_revocation.c b/src/revocation/plugin_block_revocation.c
index 124524209..3d0b55a0d 100644
--- a/src/revocation/plugin_block_revocation.c
+++ b/src/revocation/plugin_block_revocation.c
@@ -252,4 +252,5 @@ libgnunet_plugin_block_revocation_done (void *cls)
252 return NULL; 252 return NULL;
253} 253}
254 254
255
255/* end of plugin_block_revocation.c */ 256/* end of plugin_block_revocation.c */
diff --git a/src/revocation/revocation.h b/src/revocation/revocation.h
index 60cc05457..b6e7a07ec 100644
--- a/src/revocation/revocation.h
+++ b/src/revocation/revocation.h
@@ -132,5 +132,4 @@ struct RevocationResponseMessage
132GNUNET_NETWORK_STRUCT_END 132GNUNET_NETWORK_STRUCT_END
133 133
134 134
135
136#endif 135#endif
diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c
index 44d6c6ec8..012bac09e 100644
--- a/src/revocation/test_revocation.c
+++ b/src/revocation/test_revocation.c
@@ -406,4 +406,5 @@ main (int argc, char *argv[])
406 return ok; 406 return ok;
407} 407}
408 408
409
409/* end of test_revocation.c */ 410/* end of test_revocation.c */
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 03b96f264..af43a0fa1 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -160,7 +160,8 @@ struct STATcls
160 * 160 *
161 * @return corresponding enum 161 * @return corresponding enum
162 */ 162 */
163enum STAT_TYPE stat_str_2_type (const char *stat_str) 163enum STAT_TYPE
164stat_str_2_type (const char *stat_str)
164{ 165{
165 if (0 == strncmp (stat_type_strings[STAT_TYPE_BLOCKS_NO_PULL], 166 if (0 == strncmp (stat_type_strings[STAT_TYPE_BLOCKS_NO_PULL],
166 stat_str, 167 stat_str,
@@ -890,9 +891,7 @@ tofile_ (const char *file_name, const char *line)
890 "Failed to write string to buffer (size: %i)\n", 891 "Failed to write string to buffer (size: %i)\n",
891 size); 892 size);
892 return; 893 return;
893 } */ 894 } */size = strlen (line) * sizeof(char);
894
895 size = strlen (line) * sizeof(char);
896 895
897 size2 = GNUNET_DISK_file_write (f, line, size); 896 size2 = GNUNET_DISK_file_write (f, line, size);
898 if (size != size2) 897 if (size != size2)
@@ -916,6 +915,7 @@ tofile_ (const char *file_name, const char *line)
916 } 915 }
917} 916}
918 917
918
919/** 919/**
920 * This function is used to facilitate writing important information to disk 920 * This function is used to facilitate writing important information to disk
921 */ 921 */
@@ -1000,7 +1000,8 @@ make_oplist_entry ()
1000 * @return #GNUNET_YES if so 1000 * @return #GNUNET_YES if so
1001 * #GNUNET_NO otherwise 1001 * #GNUNET_NO otherwise
1002 */ 1002 */
1003static int check_statistics_collect_completed_single_peer ( 1003static int
1004check_statistics_collect_completed_single_peer (
1004 const struct RPSPeer *rps_peer) 1005 const struct RPSPeer *rps_peer)
1005{ 1006{
1006 if (cur_test_run.stat_collect_flags != 1007 if (cur_test_run.stat_collect_flags !=
@@ -1011,6 +1012,8 @@ static int check_statistics_collect_completed_single_peer (
1011 } 1012 }
1012 return GNUNET_YES; 1013 return GNUNET_YES;
1013} 1014}
1015
1016
1014/** 1017/**
1015 * @brief Checks if all peers already received their statistics value from the 1018 * @brief Checks if all peers already received their statistics value from the
1016 * statistics service. 1019 * statistics service.
@@ -1018,7 +1021,8 @@ static int check_statistics_collect_completed_single_peer (
1018 * @return #GNUNET_YES if so 1021 * @return #GNUNET_YES if so
1019 * #GNUNET_NO otherwise 1022 * #GNUNET_NO otherwise
1020 */ 1023 */
1021static int check_statistics_collect_completed () 1024static int
1025check_statistics_collect_completed ()
1022{ 1026{
1023 uint32_t i; 1027 uint32_t i;
1024 1028
@@ -1039,6 +1043,7 @@ static int check_statistics_collect_completed ()
1039 return GNUNET_YES; 1043 return GNUNET_YES;
1040} 1044}
1041 1045
1046
1042static void 1047static void
1043rps_disconnect_adapter (void *cls, 1048rps_disconnect_adapter (void *cls,
1044 void *op_result); 1049 void *op_result);
@@ -1059,6 +1064,7 @@ cancel_pending_req (struct PendingRequest *pending_req)
1059 GNUNET_free (pending_req); 1064 GNUNET_free (pending_req);
1060} 1065}
1061 1066
1067
1062static void 1068static void
1063cancel_request (struct PendingReply *pending_rep) 1069cancel_request (struct PendingReply *pending_rep)
1064{ 1070{
@@ -1078,6 +1084,7 @@ cancel_request (struct PendingReply *pending_rep)
1078 pending_rep = NULL; 1084 pending_rep = NULL;
1079} 1085}
1080 1086
1087
1081void 1088void
1082clean_peer (unsigned peer_index) 1089clean_peer (unsigned peer_index)
1083{ 1090{
@@ -1111,6 +1118,7 @@ clean_peer (unsigned peer_index)
1111 } 1118 }
1112} 1119}
1113 1120
1121
1114/** 1122/**
1115 * Task run on timeout to shut everything down. 1123 * Task run on timeout to shut everything down.
1116 */ 1124 */
@@ -1158,6 +1166,7 @@ shutdown_op (void *cls)
1158 close_all_files (); 1166 close_all_files ();
1159} 1167}
1160 1168
1169
1161static void 1170static void
1162trigger_shutdown (void *cls) 1171trigger_shutdown (void *cls)
1163{ 1172{
@@ -1209,7 +1218,7 @@ post_test_op (void *cls)
1209 } 1218 }
1210 } 1219 }
1211 /* If we do not collect statistics, shut down directly */ 1220 /* If we do not collect statistics, shut down directly */
1212 if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics)|| 1221 if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics) ||
1213 (GNUNET_YES == check_statistics_collect_completed ()) ) 1222 (GNUNET_YES == check_statistics_collect_completed ()) )
1214 { 1223 {
1215 GNUNET_SCHEDULER_cancel (shutdown_task); 1224 GNUNET_SCHEDULER_cancel (shutdown_task);
@@ -1255,12 +1264,12 @@ info_cb (void *cb_cls,
1255 1264
1256 (void) op; 1265 (void) op;
1257 1266
1258 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1267 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1259 { 1268 {
1260 return; 1269 return;
1261 } 1270 }
1262 1271
1263 if ((NULL == pinfo)||(NULL != emsg)) 1272 if ((NULL == pinfo) || (NULL != emsg))
1264 { 1273 {
1265 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Got Error: %s\n", emsg); 1274 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Got Error: %s\n", emsg);
1266 GNUNET_TESTBED_operation_done (entry->op); 1275 GNUNET_TESTBED_operation_done (entry->op);
@@ -1309,7 +1318,7 @@ rps_connect_complete_cb (void *cls,
1309 struct RPSPeer *rps_peer = cls; 1318 struct RPSPeer *rps_peer = cls;
1310 struct GNUNET_RPS_Handle *rps = ca_result; 1319 struct GNUNET_RPS_Handle *rps = ca_result;
1311 1320
1312 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1321 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1313 { 1322 {
1314 return; 1323 return;
1315 } 1324 }
@@ -1361,6 +1370,7 @@ rps_connect_adapter (void *cls,
1361 return h; 1370 return h;
1362} 1371}
1363 1372
1373
1364/** 1374/**
1365 * Called to open a connection to the peer's statistics 1375 * Called to open a connection to the peer's statistics
1366 * 1376 *
@@ -1380,6 +1390,7 @@ stat_connect_adapter (void *cls,
1380 return peer->stats_h; 1390 return peer->stats_h;
1381} 1391}
1382 1392
1393
1383/** 1394/**
1384 * Called to disconnect from peer's statistics service 1395 * Called to disconnect from peer's statistics service
1385 * 1396 *
@@ -1401,6 +1412,7 @@ stat_disconnect_adapter (void *cls, void *op_result)
1401 peer->stats_h = NULL; 1412 peer->stats_h = NULL;
1402} 1413}
1403 1414
1415
1404/** 1416/**
1405 * Called after successfully opening a connection to a peer's statistics 1417 * Called after successfully opening a connection to a peer's statistics
1406 * service; we register statistics monitoring for CORE and NSE here. 1418 * service; we register statistics monitoring for CORE and NSE here.
@@ -1551,7 +1563,7 @@ request_peers (void *cls)
1551 rps_peer->pending_req_tail, 1563 rps_peer->pending_req_tail,
1552 pending_req); 1564 pending_req);
1553 rps_peer->num_pending_reqs--; 1565 rps_peer->num_pending_reqs--;
1554 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1566 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1555 return; 1567 return;
1556 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1568 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1557 "Requesting one peer\n"); 1569 "Requesting one peer\n");
@@ -1604,6 +1616,7 @@ schedule_missing_requests (struct RPSPeer *rps_peer)
1604 } 1616 }
1605} 1617}
1606 1618
1619
1607void 1620void
1608cancel_pending_req_rep (struct RPSPeer *rps_peer) 1621cancel_pending_req_rep (struct RPSPeer *rps_peer)
1609{ 1622{
@@ -1617,6 +1630,7 @@ cancel_pending_req_rep (struct RPSPeer *rps_peer)
1617 GNUNET_assert (0 == rps_peer->num_pending_reps); 1630 GNUNET_assert (0 == rps_peer->num_pending_reps);
1618} 1631}
1619 1632
1633
1620/*********************************** 1634/***********************************
1621* MALICIOUS 1635* MALICIOUS
1622***********************************/ 1636***********************************/
@@ -1624,7 +1638,8 @@ cancel_pending_req_rep (struct RPSPeer *rps_peer)
1624/** 1638/**
1625 * Initialise only non-mal RPSPeers 1639 * Initialise only non-mal RPSPeers
1626 */ 1640 */
1627static void mal_init_peer (struct RPSPeer *rps_peer) 1641static void
1642mal_init_peer (struct RPSPeer *rps_peer)
1628{ 1643{
1629 if (rps_peer->index >= round (portion * num_peers)) 1644 if (rps_peer->index >= round (portion * num_peers))
1630 rps_peer->num_ids_to_request = 1; 1645 rps_peer->num_ids_to_request = 1;
@@ -1664,12 +1679,13 @@ mal_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
1664 #endif /* ENABLE_MALICIOUS */ 1679 #endif /* ENABLE_MALICIOUS */
1665} 1680}
1666 1681
1682
1667static void 1683static void
1668mal_cb (struct RPSPeer *rps_peer) 1684mal_cb (struct RPSPeer *rps_peer)
1669{ 1685{
1670 uint32_t num_mal_peers; 1686 uint32_t num_mal_peers;
1671 1687
1672 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1688 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1673 { 1689 {
1674 return; 1690 return;
1675 } 1691 }
@@ -1690,6 +1706,7 @@ mal_cb (struct RPSPeer *rps_peer)
1690 #endif /* ENABLE_MALICIOUS */ 1706 #endif /* ENABLE_MALICIOUS */
1691} 1707}
1692 1708
1709
1693/*********************************** 1710/***********************************
1694* CHURN 1711* CHURN
1695***********************************/ 1712***********************************/
@@ -1711,13 +1728,13 @@ churn (void *cls);
1711static void 1728static void
1712churn_test_cb (struct RPSPeer *rps_peer) 1729churn_test_cb (struct RPSPeer *rps_peer)
1713{ 1730{
1714 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1731 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1715 { 1732 {
1716 return; 1733 return;
1717 } 1734 }
1718 1735
1719 /* Start churn */ 1736 /* Start churn */
1720 if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task)) 1737 if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
1721 { 1738 {
1722 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1739 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1723 "Starting churn task\n"); 1740 "Starting churn task\n");
@@ -1735,6 +1752,7 @@ churn_test_cb (struct RPSPeer *rps_peer)
1735 schedule_missing_requests (rps_peer); 1752 schedule_missing_requests (rps_peer);
1736} 1753}
1737 1754
1755
1738/*********************************** 1756/***********************************
1739* PROFILER 1757* PROFILER
1740***********************************/ 1758***********************************/
@@ -1756,7 +1774,7 @@ churn_cb (void *cls,
1756 1774
1757 (void) op; 1775 (void) op;
1758 1776
1759 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1777 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1760 { 1778 {
1761 return; 1779 return;
1762 } 1780 }
@@ -1828,6 +1846,7 @@ churn_cb (void *cls,
1828 // run_round (); 1846 // run_round ();
1829} 1847}
1830 1848
1849
1831/** 1850/**
1832 * @brief Set the rps-service up or down for a specific peer 1851 * @brief Set the rps-service up or down for a specific peer
1833 * 1852 *
@@ -1895,7 +1914,7 @@ churn (void *cls)
1895 1914
1896 (void) cls; 1915 (void) cls;
1897 1916
1898 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1917 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1899 { 1918 {
1900 return; 1919 return;
1901 } 1920 }
@@ -1956,7 +1975,8 @@ churn (void *cls)
1956/** 1975/**
1957 * Initialise given RPSPeer 1976 * Initialise given RPSPeer
1958 */ 1977 */
1959static void profiler_init_peer (struct RPSPeer *rps_peer) 1978static void
1979profiler_init_peer (struct RPSPeer *rps_peer)
1960{ 1980{
1961 rps_peer->num_ids_to_request = cur_test_run.num_requests; 1981 rps_peer->num_ids_to_request = cur_test_run.num_requests;
1962 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "peer shall request %i peers\n", 1982 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "peer shall request %i peers\n",
@@ -2111,13 +2131,13 @@ profiler_reply_handle_info (void *cls,
2111static void 2131static void
2112profiler_cb (struct RPSPeer *rps_peer) 2132profiler_cb (struct RPSPeer *rps_peer)
2113{ 2133{
2114 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 2134 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
2115 { 2135 {
2116 return; 2136 return;
2117 } 2137 }
2118 2138
2119 /* Start churn */ 2139 /* Start churn */
2120 if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task)) 2140 if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
2121 { 2141 {
2122 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2142 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2123 "Starting churn task\n"); 2143 "Starting churn task\n");
@@ -2139,6 +2159,7 @@ profiler_cb (struct RPSPeer *rps_peer)
2139 schedule_missing_requests (rps_peer); 2159 schedule_missing_requests (rps_peer);
2140} 2160}
2141 2161
2162
2142/** 2163/**
2143 * Function called from #profiler_eval with a filename. 2164 * Function called from #profiler_eval with a filename.
2144 * 2165 *
@@ -2175,6 +2196,7 @@ file_name_cb (void *cls, const char *filename)
2175 return GNUNET_OK; 2196 return GNUNET_OK;
2176} 2197}
2177 2198
2199
2178/** 2200/**
2179 * This is run after the test finished. 2201 * This is run after the test finished.
2180 * 2202 *
@@ -2202,7 +2224,8 @@ profiler_eval (void)
2202 * 2224 *
2203 * @return 2225 * @return
2204 */ 2226 */
2205static int is_in_view (uint32_t a, uint32_t b) 2227static int
2228is_in_view (uint32_t a, uint32_t b)
2206{ 2229{
2207 uint32_t i; 2230 uint32_t i;
2208 2231
@@ -2218,7 +2241,9 @@ static int is_in_view (uint32_t a, uint32_t b)
2218 return GNUNET_NO; 2241 return GNUNET_NO;
2219} 2242}
2220 2243
2221static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid) 2244
2245static uint32_t
2246get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
2222{ 2247{
2223 uint32_t i; 2248 uint32_t i;
2224 2249
@@ -2238,6 +2263,7 @@ static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
2238 GNUNET_assert (0); 2263 GNUNET_assert (0);
2239} 2264}
2240 2265
2266
2241/** 2267/**
2242 * @brief Counts number of peers in view of a that have b in their view 2268 * @brief Counts number of peers in view of a that have b in their view
2243 * 2269 *
@@ -2246,7 +2272,8 @@ static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
2246 * 2272 *
2247 * @return 2273 * @return
2248 */ 2274 */
2249static uint32_t count_containing_views (uint32_t a, uint32_t b) 2275static uint32_t
2276count_containing_views (uint32_t a, uint32_t b)
2250{ 2277{
2251 uint32_t i; 2278 uint32_t i;
2252 uint32_t peer_idx; 2279 uint32_t peer_idx;
@@ -2263,13 +2290,15 @@ static uint32_t count_containing_views (uint32_t a, uint32_t b)
2263 return count; 2290 return count;
2264} 2291}
2265 2292
2293
2266/** 2294/**
2267 * @brief Computes the probability for each other peer to be selected by the 2295 * @brief Computes the probability for each other peer to be selected by the
2268 * sampling process based on the views of all peers 2296 * sampling process based on the views of all peers
2269 * 2297 *
2270 * @param peer_idx index of the peer that is about to sample 2298 * @param peer_idx index of the peer that is about to sample
2271 */ 2299 */
2272static void compute_probabilities (uint32_t peer_idx) 2300static void
2301compute_probabilities (uint32_t peer_idx)
2273{ 2302{
2274 // double probs[num_peers] = { 0 }; 2303 // double probs[num_peers] = { 0 };
2275 double probs[num_peers]; 2304 double probs[num_peers];
@@ -2427,6 +2456,7 @@ static void compute_probabilities (uint32_t peer_idx)
2427 GNUNET_free (probs_as_str); 2456 GNUNET_free (probs_as_str);
2428} 2457}
2429 2458
2459
2430/** 2460/**
2431 * @brief This counts the number of peers in which views a given peer occurs. 2461 * @brief This counts the number of peers in which views a given peer occurs.
2432 * 2462 *
@@ -2436,7 +2466,8 @@ static void compute_probabilities (uint32_t peer_idx)
2436 * 2466 *
2437 * @return the number of occurrences 2467 * @return the number of occurrences
2438 */ 2468 */
2439static uint32_t count_peer_in_views_2 (uint32_t peer_idx) 2469static uint32_t
2470count_peer_in_views_2 (uint32_t peer_idx)
2440{ 2471{
2441 uint32_t i, j; 2472 uint32_t i, j;
2442 uint32_t count = 0; 2473 uint32_t count = 0;
@@ -2458,7 +2489,9 @@ static uint32_t count_peer_in_views_2 (uint32_t peer_idx)
2458 return count; 2489 return count;
2459} 2490}
2460 2491
2461static uint32_t cumulated_view_sizes () 2492
2493static uint32_t
2494cumulated_view_sizes ()
2462{ 2495{
2463 uint32_t i; 2496 uint32_t i;
2464 2497
@@ -2470,7 +2503,9 @@ static uint32_t cumulated_view_sizes ()
2470 return view_sizes; 2503 return view_sizes;
2471} 2504}
2472 2505
2473static void count_peer_in_views (uint32_t *count_peers) 2506
2507static void
2508count_peer_in_views (uint32_t *count_peers)
2474{ 2509{
2475 uint32_t i, j; 2510 uint32_t i, j;
2476 2511
@@ -2488,7 +2523,9 @@ static void count_peer_in_views (uint32_t *count_peers)
2488 } 2523 }
2489} 2524}
2490 2525
2491void compute_diversity () 2526
2527void
2528compute_diversity ()
2492{ 2529{
2493 uint32_t i; 2530 uint32_t i;
2494 /* ith entry represents the numer of occurrences in other peer's views */ 2531 /* ith entry represents the numer of occurrences in other peer's views */
@@ -2531,7 +2568,9 @@ void compute_diversity ()
2531 GNUNET_free (deviation); 2568 GNUNET_free (deviation);
2532} 2569}
2533 2570
2534void print_view_sizes () 2571
2572void
2573print_view_sizes ()
2535{ 2574{
2536 uint32_t i; 2575 uint32_t i;
2537 2576
@@ -2545,15 +2584,19 @@ void print_view_sizes ()
2545 } 2584 }
2546} 2585}
2547 2586
2548void all_views_updated_cb () 2587
2588void
2589all_views_updated_cb ()
2549{ 2590{
2550 compute_diversity (); 2591 compute_diversity ();
2551 print_view_sizes (); 2592 print_view_sizes ();
2552} 2593}
2553 2594
2554void view_update_cb (void *cls, 2595
2555 uint64_t view_size, 2596void
2556 const struct GNUNET_PeerIdentity *peers) 2597view_update_cb (void *cls,
2598 uint64_t view_size,
2599 const struct GNUNET_PeerIdentity *peers)
2557{ 2600{
2558 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2601 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2559 "View was updated (%" PRIu64 ")\n", view_size); 2602 "View was updated (%" PRIu64 ")\n", view_size);
@@ -2602,6 +2645,7 @@ void view_update_cb (void *cls,
2602 all_views_updated_cb (); 2645 all_views_updated_cb ();
2603} 2646}
2604 2647
2648
2605static void 2649static void
2606pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h) 2650pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
2607{ 2651{
@@ -2612,7 +2656,9 @@ pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
2612 GNUNET_RPS_view_request (h, 0, view_update_cb, rps_peer); 2656 GNUNET_RPS_view_request (h, 0, view_update_cb, rps_peer);
2613} 2657}
2614 2658
2615void write_final_stats (void) 2659
2660void
2661write_final_stats (void)
2616{ 2662{
2617 uint64_t sums[STAT_TYPE_MAX] = { 0 }; 2663 uint64_t sums[STAT_TYPE_MAX] = { 0 };
2618 2664
@@ -2732,6 +2778,7 @@ void write_final_stats (void)
2732 sums[STAT_TYPE_VIEW_SIZE_AIM]); 2778 sums[STAT_TYPE_VIEW_SIZE_AIM]);
2733} 2779}
2734 2780
2781
2735/** 2782/**
2736 * Continuation called by #GNUNET_STATISTICS_get() functions. 2783 * Continuation called by #GNUNET_STATISTICS_get() functions.
2737 * 2784 *
@@ -2766,7 +2813,7 @@ post_test_shutdown_ready_cb (void *cls,
2766 return; 2813 return;
2767 } 2814 }
2768 2815
2769 if ((NULL != rps_peer->stat_op)&& 2816 if ((NULL != rps_peer->stat_op) &&
2770 (GNUNET_YES == check_statistics_collect_completed_single_peer ( 2817 (GNUNET_YES == check_statistics_collect_completed_single_peer (
2771 rps_peer)) ) 2818 rps_peer)) )
2772 { 2819 {
@@ -2788,6 +2835,7 @@ post_test_shutdown_ready_cb (void *cls,
2788 } 2835 }
2789} 2836}
2790 2837
2838
2791/** 2839/**
2792 * Callback function to process statistic values. 2840 * Callback function to process statistic values.
2793 * 2841 *
@@ -2907,7 +2955,7 @@ test_run (void *cls,
2907 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n"); 2955 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
2908 2956
2909 /* Check whether we timed out */ 2957 /* Check whether we timed out */
2910 if ((n_peers != num_peers)|| 2958 if ((n_peers != num_peers) ||
2911 (NULL == peers) || 2959 (NULL == peers) ||
2912 (0 == links_succeeded) ) 2960 (0 == links_succeeded) )
2913 { 2961 {
@@ -3127,6 +3175,7 @@ run (void *cls,
3127 NULL); 3175 NULL);
3128} 3176}
3129 3177
3178
3130/** 3179/**
3131 * Entry point for the testcase, sets up the testbed. 3180 * Entry point for the testcase, sets up the testbed.
3132 * 3181 *
@@ -3204,4 +3253,5 @@ main (int argc, char *argv[])
3204 return ret_value; 3253 return ret_value;
3205} 3254}
3206 3255
3256
3207/* end of test_rps.c */ 3257/* end of test_rps.c */
diff --git a/src/rps/gnunet-rps.c b/src/rps/gnunet-rps.c
index 6c1c96cc9..33c03f006 100644
--- a/src/rps/gnunet-rps.c
+++ b/src/rps/gnunet-rps.c
@@ -106,6 +106,7 @@ reply_handle (void *cls,
106 GNUNET_SCHEDULER_shutdown (); 106 GNUNET_SCHEDULER_shutdown ();
107} 107}
108 108
109
109/** 110/**
110 * Callback called on receipt view update. 111 * Callback called on receipt view update.
111 * Prints view. 112 * Prints view.
@@ -249,6 +250,7 @@ run (void *cls,
249 } 250 }
250} 251}
251 252
253
252/** 254/**
253 * The main function to rps. 255 * The main function to rps.
254 * 256 *
@@ -288,4 +290,5 @@ main (int argc, char *const *argv)
288 options, &run, NULL)) ? ret : 1; 290 options, &run, NULL)) ? ret : 1;
289} 291}
290 292
293
291/* end of gnunet-rps.c */ 294/* end of gnunet-rps.c */
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 66ffd173a..58fbd6a18 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -85,7 +85,6 @@
85#define unset_channel_flag(channel_flags, mask) ((*channel_flags) &= ~(mask)) 85#define unset_channel_flag(channel_flags, mask) ((*channel_flags) &= ~(mask))
86 86
87 87
88
89/** 88/**
90 * Pending operation on peer consisting of callback and closure 89 * Pending operation on peer consisting of callback and closure
91 * 90 *
@@ -623,6 +622,7 @@ get_peer_ctx (const struct GNUNET_CONTAINER_MultiPeerMap *peer_map,
623 return ctx; 622 return ctx;
624} 623}
625 624
625
626/** 626/**
627 * @brief Check whether we have information about the given peer. 627 * @brief Check whether we have information about the given peer.
628 * 628 *
@@ -856,6 +856,7 @@ add_valid_peer (const struct GNUNET_PeerIdentity *peer,
856 return ret; 856 return ret;
857} 857}
858 858
859
859static void 860static void
860remove_pending_message (struct PendingMessage *pending_msg, int cancel); 861remove_pending_message (struct PendingMessage *pending_msg, int cancel);
861 862
@@ -900,6 +901,7 @@ set_peer_online (struct PeerContext *peer_ctx)
900 GNUNET_array_grow (peer_ctx->pending_ops, peer_ctx->num_pending_ops, 0); 901 GNUNET_array_grow (peer_ctx->pending_ops, peer_ctx->num_pending_ops, 0);
901} 902}
902 903
904
903static void 905static void
904cleanup_destroyed_channel (void *cls, 906cleanup_destroyed_channel (void *cls,
905 const struct GNUNET_CADET_Channel *channel); 907 const struct GNUNET_CADET_Channel *channel);
@@ -1048,6 +1050,7 @@ get_mq (struct PeerContext *peer_ctx)
1048 return peer_ctx->mq; 1050 return peer_ctx->mq;
1049} 1051}
1050 1052
1053
1051/** 1054/**
1052 * @brief Add an envelope to a message passed to mq to list of pending messages 1055 * @brief Add an envelope to a message passed to mq to list of pending messages
1053 * 1056 *
@@ -1124,6 +1127,7 @@ mq_online_check_successful (void *cls)
1124 } 1127 }
1125} 1128}
1126 1129
1130
1127/** 1131/**
1128 * Issue a check whether peer is online 1132 * Issue a check whether peer is online
1129 * 1133 *
@@ -1758,6 +1762,7 @@ check_peer_flag (const struct GNUNET_CONTAINER_MultiPeerMap *peer_map,
1758 return check_peer_flag_set (peer_ctx, flags); 1762 return check_peer_flag_set (peer_ctx, flags);
1759} 1763}
1760 1764
1765
1761/** 1766/**
1762 * @brief Try connecting to a peer to see whether it is online 1767 * @brief Try connecting to a peer to see whether it is online
1763 * 1768 *
@@ -1969,6 +1974,7 @@ destroy_sending_channel (struct PeerContext *peer_ctx)
1969 return GNUNET_NO; 1974 return GNUNET_NO;
1970} 1975}
1971 1976
1977
1972/** 1978/**
1973 * @brief Send a message to another peer. 1979 * @brief Send a message to another peer.
1974 * 1980 *
@@ -1999,6 +2005,7 @@ send_message (struct PeerContext *peer_ctx,
1999 GNUNET_MQ_send (mq, ev); 2005 GNUNET_MQ_send (mq, ev);
2000} 2006}
2001 2007
2008
2002/** 2009/**
2003 * @brief Schedule a operation on given peer 2010 * @brief Schedule a operation on given peer
2004 * 2011 *
@@ -2035,6 +2042,7 @@ schedule_operation (struct PeerContext *peer_ctx,
2035 return GNUNET_NO; 2042 return GNUNET_NO;
2036} 2043}
2037 2044
2045
2038/*********************************************************************** 2046/***********************************************************************
2039* /Old gnunet-service-rps_peers.c 2047* /Old gnunet-service-rps_peers.c
2040***********************************************************************/ 2048***********************************************************************/
@@ -2122,9 +2130,6 @@ struct ClientContext *cli_ctx_tail;
2122***********************************************************************/ 2130***********************************************************************/
2123 2131
2124 2132
2125
2126
2127
2128/*********************************************************************** 2133/***********************************************************************
2129* Util functions 2134* Util functions
2130***********************************************************************/ 2135***********************************************************************/
@@ -2383,7 +2388,7 @@ clients_notify_stream_peer (const struct Sub *sub,
2383 cli_ctx_iter = cli_ctx_iter->next) 2388 cli_ctx_iter = cli_ctx_iter->next)
2384 { 2389 {
2385 if ((GNUNET_YES == cli_ctx_iter->stream_update) && 2390 if ((GNUNET_YES == cli_ctx_iter->stream_update) &&
2386 ((sub == cli_ctx_iter->sub) ||(sub == msub) )) 2391 ((sub == cli_ctx_iter->sub) || (sub == msub) ))
2387 { 2392 {
2388 send_stream_peers (cli_ctx_iter, num_peers, peers); 2393 send_stream_peers (cli_ctx_iter, num_peers, peers);
2389 } 2394 }
@@ -2828,7 +2833,7 @@ cleanup_destroyed_channel (void *cls,
2828 2833
2829 channel_ctx->channel = NULL; 2834 channel_ctx->channel = NULL;
2830 remove_channel_ctx (channel_ctx); 2835 remove_channel_ctx (channel_ctx);
2831 if ((NULL != peer_ctx)&& 2836 if ((NULL != peer_ctx) &&
2832 (peer_ctx->send_channel_ctx == channel_ctx) && 2837 (peer_ctx->send_channel_ctx == channel_ctx) &&
2833 (GNUNET_YES == check_sending_channel_needed (channel_ctx->peer_ctx)) ) 2838 (GNUNET_YES == check_sending_channel_needed (channel_ctx->peer_ctx)) )
2834 { 2839 {
@@ -2836,12 +2841,12 @@ cleanup_destroyed_channel (void *cls,
2836 } 2841 }
2837} 2842}
2838 2843
2844
2839/*********************************************************************** 2845/***********************************************************************
2840* /Util functions 2846* /Util functions
2841***********************************************************************/ 2847***********************************************************************/
2842 2848
2843 2849
2844
2845/*********************************************************************** 2850/***********************************************************************
2846* Sub 2851* Sub
2847***********************************************************************/ 2852***********************************************************************/
@@ -3016,6 +3021,8 @@ write_histogram_to_file (const uint32_t hist_array[],
3016 collect_str); 3021 collect_str);
3017 GNUNET_free (file_name_full); 3022 GNUNET_free (file_name_full);
3018} 3023}
3024
3025
3019#endif /* TO_FILE */ 3026#endif /* TO_FILE */
3020 3027
3021 3028
@@ -3148,6 +3155,7 @@ core_disconnects (void *cls,
3148 GNUNET_CONTAINER_multipeermap_remove_all (map_single_hop, peer); 3155 GNUNET_CONTAINER_multipeermap_remove_all (map_single_hop, peer);
3149} 3156}
3150 3157
3158
3151/*********************************************************************** 3159/***********************************************************************
3152* /Core handlers 3160* /Core handlers
3153***********************************************************************/ 3161***********************************************************************/
@@ -3442,7 +3450,7 @@ handle_client_start_sub (void *cls,
3442 struct ClientContext *cli_ctx = cls; 3450 struct ClientContext *cli_ctx = cls;
3443 3451
3444 LOG (GNUNET_ERROR_TYPE_DEBUG, "Client requested start of a new sub.\n"); 3452 LOG (GNUNET_ERROR_TYPE_DEBUG, "Client requested start of a new sub.\n");
3445 if ((NULL != cli_ctx->sub)&& 3453 if ((NULL != cli_ctx->sub) &&
3446 (0 != memcmp (&cli_ctx->sub->hash, 3454 (0 != memcmp (&cli_ctx->sub->hash,
3447 &msg->hash, 3455 &msg->hash,
3448 sizeof(struct GNUNET_HashCode))) ) 3456 sizeof(struct GNUNET_HashCode))) )
@@ -3633,7 +3641,7 @@ handle_peer_pull_request (void *cls,
3633 3641
3634 #if ENABLE_MALICIOUS 3642 #if ENABLE_MALICIOUS
3635 if ((1 == mal_type) 3643 if ((1 == mal_type)
3636 ||(3 == mal_type)) 3644 || (3 == mal_type))
3637 { /* Try to maximise representation */ 3645 { /* Try to maximise representation */
3638 send_pull_reply (peer_ctx, mal_peers, num_mal_peers); 3646 send_pull_reply (peer_ctx, mal_peers, num_mal_peers);
3639 } 3647 }
@@ -3774,13 +3782,13 @@ handle_peer_pull_reply (void *cls,
3774 3782
3775 #if ENABLE_MALICIOUS 3783 #if ENABLE_MALICIOUS
3776 if ((NULL != att_peer_set) && 3784 if ((NULL != att_peer_set) &&
3777 ((1 == mal_type) ||(3 == mal_type) )) 3785 ((1 == mal_type) || (3 == mal_type) ))
3778 { /* Add attacked peer to local list */ 3786 { /* Add attacked peer to local list */
3779 // TODO check if we sent a request and this was the first reply 3787 // TODO check if we sent a request and this was the first reply
3780 if ((GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (att_peer_set, 3788 if ((GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (att_peer_set,
3781 &peers[i])) 3789 &peers[i]))
3782 &&(GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set, 3790 && (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set,
3783 &peers[i])) ) 3791 &peers[i])) )
3784 { 3792 {
3785 tmp_att_peer = GNUNET_new (struct AttackedPeer); 3793 tmp_att_peer = GNUNET_new (struct AttackedPeer);
3786 tmp_att_peer->peer_id = peers[i]; 3794 tmp_att_peer->peer_id = peers[i];
@@ -3988,6 +3996,7 @@ check_client_act_malicious (void *cls,
3988 return GNUNET_OK; 3996 return GNUNET_OK;
3989} 3997}
3990 3998
3999
3991/** 4000/**
3992 * Turn RPS service to act malicious. 4001 * Turn RPS service to act malicious.
3993 * 4002 *
@@ -4236,6 +4245,8 @@ do_mal_round (void *cls)
4236 &do_mal_round, sub); 4245 &do_mal_round, sub);
4237 LOG (GNUNET_ERROR_TYPE_DEBUG, "Finished round\n"); 4246 LOG (GNUNET_ERROR_TYPE_DEBUG, "Finished round\n");
4238} 4247}
4248
4249
4239#endif /* ENABLE_MALICIOUS */ 4250#endif /* ENABLE_MALICIOUS */
4240 4251
4241 4252
@@ -4785,6 +4796,7 @@ client_connect_cb (void *cls,
4785 return cli_ctx; 4796 return cli_ctx;
4786} 4797}
4787 4798
4799
4788/** 4800/**
4789 * Callback called when a client disconnected from the service 4801 * Callback called when a client disconnected from the service
4790 * 4802 *
diff --git a/src/rps/gnunet-service-rps_custommap.c b/src/rps/gnunet-service-rps_custommap.c
index 8fcfc5558..54e361d32 100644
--- a/src/rps/gnunet-service-rps_custommap.c
+++ b/src/rps/gnunet-service-rps_custommap.c
@@ -87,6 +87,7 @@ CustomPeerMap_create (unsigned int len)
87 return c_peer_map; 87 return c_peer_map;
88} 88}
89 89
90
90/** 91/**
91 * Get the size of the custom peer map 92 * Get the size of the custom peer map
92 * 93 *
@@ -102,6 +103,7 @@ CustomPeerMap_size (const struct CustomPeerMap *c_peer_map)
102 return GNUNET_CONTAINER_multipeermap_size (c_peer_map->peer_map); 103 return GNUNET_CONTAINER_multipeermap_size (c_peer_map->peer_map);
103} 104}
104 105
106
105/** 107/**
106 * Insert peer into the custom peer map 108 * Insert peer into the custom peer map
107 * 109 *
@@ -149,6 +151,7 @@ CustomPeerMap_put (const struct CustomPeerMap *c_peer_map,
149 return GNUNET_NO; 151 return GNUNET_NO;
150} 152}
151 153
154
152/** 155/**
153 * Check whether custom peer map contains a peer 156 * Check whether custom peer map contains a peer
154 * 157 *
@@ -165,6 +168,7 @@ CustomPeerMap_contains_peer (const struct CustomPeerMap *c_peer_map,
165 return GNUNET_CONTAINER_multipeermap_contains (c_peer_map->peer_map, peer); 168 return GNUNET_CONTAINER_multipeermap_contains (c_peer_map->peer_map, peer);
166} 169}
167 170
171
168/** 172/**
169 * Get index of peer in custom peer map 173 * Get index of peer in custom peer map
170 * 174 *
@@ -184,6 +188,7 @@ CustomPeerMap_get_index_pointer (const struct CustomPeerMap *c_peer_map,
184 return index; 188 return index;
185} 189}
186 190
191
187/** 192/**
188 * Remove peer from custom peer map 193 * Remove peer from custom peer map
189 * 194 *
@@ -243,6 +248,7 @@ CustomPeerMap_remove_peer (const struct CustomPeerMap *c_peer_map,
243 return GNUNET_OK; 248 return GNUNET_OK;
244} 249}
245 250
251
246/** 252/**
247 * Get a peer by index 253 * Get a peer by index
248 * 254 *
@@ -264,6 +270,7 @@ CustomPeerMap_get_peer_by_index (const struct CustomPeerMap *c_peer_map,
264 return NULL; 270 return NULL;
265} 271}
266 272
273
267/** 274/**
268 * Remove peer from custom peer map by index 275 * Remove peer from custom peer map by index
269 * 276 *
@@ -301,6 +308,7 @@ CustomPeerMap_remove_peer_by_index (const struct CustomPeerMap *c_peer_map,
301 return GNUNET_OK; 308 return GNUNET_OK;
302} 309}
303 310
311
304/** 312/**
305 * Clear the custom peer map 313 * Clear the custom peer map
306 * 314 *
@@ -326,6 +334,7 @@ CustomPeerMap_clear (const struct CustomPeerMap *c_peer_map)
326 GNUNET_assert (0 == CustomPeerMap_size (c_peer_map)); 334 GNUNET_assert (0 == CustomPeerMap_size (c_peer_map));
327} 335}
328 336
337
329/** 338/**
330 * Destroy peermap. 339 * Destroy peermap.
331 * 340 *
@@ -340,4 +349,5 @@ CustomPeerMap_destroy (struct CustomPeerMap *c_peer_map)
340 GNUNET_free (c_peer_map); 349 GNUNET_free (c_peer_map);
341} 350}
342 351
352
343/* end of gnunet-service-rps_custommap.c */ 353/* end of gnunet-service-rps_custommap.c */
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c
index 7573fd4eb..598cc887e 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -216,6 +216,7 @@ RPS_sampler_init (size_t init_size,
216 return sampler; 216 return sampler;
217} 217}
218 218
219
219/** 220/**
220 * Get one random peer out of the sampled peers. 221 * Get one random peer out of the sampled peers.
221 * 222 *
diff --git a/src/rps/gnunet-service-rps_sampler_elem.c b/src/rps/gnunet-service-rps_sampler_elem.c
index 17b3be6d2..aa8b72445 100644
--- a/src/rps/gnunet-service-rps_sampler_elem.c
+++ b/src/rps/gnunet-service-rps_sampler_elem.c
@@ -152,6 +152,7 @@ RPS_sampler_elem_next (struct RPS_SamplerElement *sampler_elem,
152 sampler_elem->is_empty = NOT_EMPTY; 152 sampler_elem->is_empty = NOT_EMPTY;
153} 153}
154 154
155
155/** 156/**
156 * Set the min-wise independent function of the given sampler element. 157 * Set the min-wise independent function of the given sampler element.
157 * 158 *
@@ -165,4 +166,5 @@ RPS_sampler_elem_set (struct RPS_SamplerElement *sampler_elem,
165 sampler_elem->auth_key = auth_key; 166 sampler_elem->auth_key = auth_key;
166} 167}
167 168
169
168/* end of gnunet-service-rps.c */ 170/* end of gnunet-service-rps.c */
diff --git a/src/rps/gnunet-service-rps_view.c b/src/rps/gnunet-service-rps_view.c
index 5de7c84dc..d58b995a3 100644
--- a/src/rps/gnunet-service-rps_view.c
+++ b/src/rps/gnunet-service-rps_view.c
@@ -290,4 +290,5 @@ View_destroy (struct View *view)
290 GNUNET_free (view); 290 GNUNET_free (view);
291} 291}
292 292
293
293/* end of gnunet-service-rps_view.c */ 294/* end of gnunet-service-rps_view.c */
diff --git a/src/rps/rps-sampler_common.c b/src/rps/rps-sampler_common.c
index ab8c65f17..488ed8e01 100644
--- a/src/rps/rps-sampler_common.c
+++ b/src/rps/rps-sampler_common.c
@@ -354,7 +354,7 @@ RPS_sampler_count_id (struct RPS_Sampler *sampler,
354 for (i = 0; i < sampler->sampler_size; i++) 354 for (i = 0; i < sampler->sampler_size; i++)
355 { 355 {
356 if ((0 == GNUNET_memcmp (&sampler->sampler_elements[i]->peer_id, id)) 356 if ((0 == GNUNET_memcmp (&sampler->sampler_elements[i]->peer_id, id))
357 &&(EMPTY != sampler->sampler_elements[i]->is_empty) ) 357 && (EMPTY != sampler->sampler_elements[i]->is_empty) )
358 count++; 358 count++;
359 } 359 }
360 return count; 360 return count;
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c
index 66f93d86f..d2cdd3aa7 100644
--- a/src/rps/rps-test_util.c
+++ b/src/rps/rps-test_util.c
@@ -61,7 +61,6 @@ static unsigned num_bits_buf_unaligned;
61static struct GNUNET_CONTAINER_MultiHashMap *open_files; 61static struct GNUNET_CONTAINER_MultiHashMap *open_files;
62 62
63 63
64
65/** 64/**
66 * @brief Get file handle 65 * @brief Get file handle
67 * 66 *
@@ -162,7 +161,6 @@ close_all_files ()
162} 161}
163 162
164 163
165
166void 164void
167to_file_raw (const char *file_name, const char *buf, size_t size_buf) 165to_file_raw (const char *file_name, const char *buf, size_t size_buf)
168{ 166{
@@ -206,6 +204,7 @@ to_file_raw (const char *file_name, const char *buf, size_t size_buf)
206 "Unable to close file\n"); 204 "Unable to close file\n");
207} 205}
208 206
207
209void 208void
210to_file_raw_unaligned (const char *file_name, 209to_file_raw_unaligned (const char *file_name,
211 const char *buf, 210 const char *buf,
@@ -372,6 +371,7 @@ to_file_raw_unaligned (const char *file_name,
372 LOG (GNUNET_ERROR_TYPE_DEBUG, "\n"); 371 LOG (GNUNET_ERROR_TYPE_DEBUG, "\n");
373} 372}
374 373
374
375char * 375char *
376auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key) 376auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key)
377{ 377{
@@ -414,6 +414,7 @@ auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key)
414 return name_buf; 414 return name_buf;
415} 415}
416 416
417
417#endif /* TO_FILE */ 418#endif /* TO_FILE */
418 419
419 420
@@ -470,7 +471,7 @@ store_prefix_file_name (const unsigned int index,
470 64, 471 64,
471 "%u", 472 "%u",
472 index); 473 index);
473 if ((64 < out_size)|| 474 if ((64 < out_size) ||
474 (0 > out_size) ) 475 (0 > out_size) )
475 { 476 {
476 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 477 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -488,7 +489,7 @@ store_prefix_file_name (const unsigned int index,
488 "/tmp/rps/%s-%s", 489 "/tmp/rps/%s-%s",
489 prefix, 490 prefix,
490 index_str); 491 index_str);
491 if ((len_file_name < out_size)|| 492 if ((len_file_name < out_size) ||
492 (0 > out_size) ) 493 (0 > out_size) )
493 { 494 {
494 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 495 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -507,7 +508,8 @@ store_prefix_file_name (const unsigned int index,
507 * 508 *
508 * @return Factorial of @a x 509 * @return Factorial of @a x
509 */ 510 */
510uint32_t fac (uint32_t x) 511uint32_t
512fac (uint32_t x)
511{ 513{
512 if (1 >= x) 514 if (1 >= x)
513 { 515 {
@@ -516,6 +518,7 @@ uint32_t fac (uint32_t x)
516 return x * fac (x - 1); 518 return x * fac (x - 1);
517} 519}
518 520
521
519/** 522/**
520 * @brief Binomial coefficient (n choose k) 523 * @brief Binomial coefficient (n choose k)
521 * 524 *
@@ -524,7 +527,8 @@ uint32_t fac (uint32_t x)
524 * 527 *
525 * @return Binomial coefficient of @a n and @a k 528 * @return Binomial coefficient of @a n and @a k
526 */ 529 */
527uint32_t binom (uint32_t n, uint32_t k) 530uint32_t
531binom (uint32_t n, uint32_t k)
528{ 532{
529 // GNUNET_assert (n >= k); 533 // GNUNET_assert (n >= k);
530 if (k > n) 534 if (k > n)
diff --git a/src/rps/rps.h b/src/rps/rps.h
index 32e5d07af..9d42a6104 100644
--- a/src/rps/rps.h
+++ b/src/rps/rps.h
@@ -56,7 +56,6 @@ struct GNUNET_RPS_P2P_PullReplyMessage
56}; 56};
57 57
58 58
59
60/*********************************************************************** 59/***********************************************************************
61* Client-Service Messages 60* Client-Service Messages
62***********************************************************************/ 61***********************************************************************/
diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c
index 19cbdcf8a..da24ca4c9 100644
--- a/src/rps/rps_api.c
+++ b/src/rps/rps_api.c
@@ -857,7 +857,7 @@ GNUNET_RPS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
857 GNUNET_free (h); 857 GNUNET_free (h);
858 return NULL; 858 return NULL;
859 } 859 }
860 if ((0 > h->desired_probability)|| 860 if ((0 > h->desired_probability) ||
861 (1 < h->desired_probability) ) 861 (1 < h->desired_probability) )
862 { 862 {
863 LOG (GNUNET_ERROR_TYPE_ERROR, 863 LOG (GNUNET_ERROR_TYPE_ERROR,
@@ -876,7 +876,7 @@ GNUNET_RPS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
876 GNUNET_free (h); 876 GNUNET_free (h);
877 return NULL; 877 return NULL;
878 } 878 }
879 if ((0 > h->desired_probability)|| 879 if ((0 > h->desired_probability) ||
880 (1 < h->desired_probability) ) 880 (1 < h->desired_probability) )
881 { 881 {
882 LOG (GNUNET_ERROR_TYPE_ERROR, 882 LOG (GNUNET_ERROR_TYPE_ERROR,
@@ -1186,6 +1186,8 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
1186 1186
1187 GNUNET_MQ_send (h->mq, ev); 1187 GNUNET_MQ_send (h->mq, ev);
1188} 1188}
1189
1190
1189#endif /* ENABLE_MALICIOUS */ 1191#endif /* ENABLE_MALICIOUS */
1190 1192
1191 1193
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 3a01e73ff..81cf63c72 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -623,9 +623,7 @@ tofile_ (const char *file_name, const char *line)
623 "Failed to write string to buffer (size: %i)\n", 623 "Failed to write string to buffer (size: %i)\n",
624 size); 624 size);
625 return; 625 return;
626 } */ 626 } */size = strlen (line) * sizeof(char);
627
628 size = strlen (line) * sizeof(char);
629 627
630 size2 = GNUNET_DISK_file_write (f, line, size); 628 size2 = GNUNET_DISK_file_write (f, line, size);
631 if (size != size2) 629 if (size != size2)
@@ -649,6 +647,7 @@ tofile_ (const char *file_name, const char *line)
649 } 647 }
650} 648}
651 649
650
652/** 651/**
653 * This function is used to facilitate writing important information to disk 652 * This function is used to facilitate writing important information to disk
654 */ 653 */
@@ -740,7 +739,8 @@ make_oplist_entry ()
740 * @return #GNUNET_YES if so 739 * @return #GNUNET_YES if so
741 * #GNUNET_NO otherwise 740 * #GNUNET_NO otherwise
742 */ 741 */
743static int check_statistics_collect_completed_single_peer ( 742static int
743check_statistics_collect_completed_single_peer (
744 const struct RPSPeer *rps_peer) 744 const struct RPSPeer *rps_peer)
745{ 745{
746 if (cur_test_run.stat_collect_flags != 746 if (cur_test_run.stat_collect_flags !=
@@ -760,7 +760,8 @@ static int check_statistics_collect_completed_single_peer (
760 * @return #GNUNET_YES if so 760 * @return #GNUNET_YES if so
761 * #GNUNET_NO otherwise 761 * #GNUNET_NO otherwise
762 */ 762 */
763static int check_statistics_collect_completed () 763static int
764check_statistics_collect_completed ()
764{ 765{
765 uint32_t i; 766 uint32_t i;
766 767
@@ -853,7 +854,7 @@ post_test_op (void *cls)
853 } 854 }
854 } 855 }
855 /* If we do not collect statistics, shut down directly */ 856 /* If we do not collect statistics, shut down directly */
856 if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics)|| 857 if ((NO_COLLECT_STATISTICS == cur_test_run.have_collect_statistics) ||
857 (GNUNET_YES == check_statistics_collect_completed ()) ) 858 (GNUNET_YES == check_statistics_collect_completed ()) )
858 { 859 {
859 GNUNET_SCHEDULER_shutdown (); 860 GNUNET_SCHEDULER_shutdown ();
@@ -871,7 +872,7 @@ seed_peers (void *cls)
871 unsigned int amount; 872 unsigned int amount;
872 unsigned int i; 873 unsigned int i;
873 874
874 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 875 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
875 { 876 {
876 return; 877 return;
877 } 878 }
@@ -925,6 +926,7 @@ seed_peers_big (void *cls)
925 GNUNET_RPS_seed_ids (peer->rps_handle, amount, ids_to_seed); 926 GNUNET_RPS_seed_ids (peer->rps_handle, amount, ids_to_seed);
926} 927}
927 928
929
928/** 930/**
929 * Get the id of peer i. 931 * Get the id of peer i.
930 */ 932 */
@@ -938,12 +940,12 @@ info_cb (void *cb_cls,
938 940
939 (void) op; 941 (void) op;
940 942
941 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 943 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
942 { 944 {
943 return; 945 return;
944 } 946 }
945 947
946 if ((NULL == pinfo)||(NULL != emsg)) 948 if ((NULL == pinfo) || (NULL != emsg))
947 { 949 {
948 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Got Error: %s\n", emsg); 950 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Got Error: %s\n", emsg);
949 GNUNET_TESTBED_operation_done (entry->op); 951 GNUNET_TESTBED_operation_done (entry->op);
@@ -994,7 +996,7 @@ rps_connect_complete_cb (void *cls,
994 996
995 GNUNET_assert (NULL != ca_result); 997 GNUNET_assert (NULL != ca_result);
996 998
997 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 999 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
998 { 1000 {
999 return; 1001 return;
1000 } 1002 }
@@ -1046,6 +1048,7 @@ rps_connect_adapter (void *cls,
1046 return h; 1048 return h;
1047} 1049}
1048 1050
1051
1049/** 1052/**
1050 * Called to open a connection to the peer's statistics 1053 * Called to open a connection to the peer's statistics
1051 * 1054 *
@@ -1065,6 +1068,7 @@ stat_connect_adapter (void *cls,
1065 return peer->stats_h; 1068 return peer->stats_h;
1066} 1069}
1067 1070
1071
1068/** 1072/**
1069 * Called to disconnect from peer's statistics service 1073 * Called to disconnect from peer's statistics service
1070 * 1074 *
@@ -1086,6 +1090,7 @@ stat_disconnect_adapter (void *cls, void *op_result)
1086 peer->stats_h = NULL; 1090 peer->stats_h = NULL;
1087} 1091}
1088 1092
1093
1089/** 1094/**
1090 * Called after successfully opening a connection to a peer's statistics 1095 * Called after successfully opening a connection to a peer's statistics
1091 * service; we register statistics monitoring for CORE and NSE here. 1096 * service; we register statistics monitoring for CORE and NSE here.
@@ -1156,20 +1161,24 @@ default_eval_cb (void)
1156 return evaluate (); 1161 return evaluate ();
1157} 1162}
1158 1163
1164
1159static int 1165static int
1160no_eval (void) 1166no_eval (void)
1161{ 1167{
1162 return 0; 1168 return 0;
1163} 1169}
1164 1170
1171
1165/** 1172/**
1166 * Initialise given RPSPeer 1173 * Initialise given RPSPeer
1167 */ 1174 */
1168static void default_init_peer (struct RPSPeer *rps_peer) 1175static void
1176default_init_peer (struct RPSPeer *rps_peer)
1169{ 1177{
1170 rps_peer->num_ids_to_request = 1; 1178 rps_peer->num_ids_to_request = 1;
1171} 1179}
1172 1180
1181
1173/** 1182/**
1174 * Callback to call on receipt of a reply 1183 * Callback to call on receipt of a reply
1175 * 1184 *
@@ -1206,7 +1215,7 @@ default_reply_handle (void *cls,
1206 rps_peer->num_recv_ids++; 1215 rps_peer->num_recv_ids++;
1207 } 1216 }
1208 1217
1209 if ((0 == evaluate ())&&(HAVE_QUICK_QUIT == cur_test_run.have_quick_quit)) 1218 if ((0 == evaluate ()) && (HAVE_QUICK_QUIT == cur_test_run.have_quick_quit))
1210 { 1219 {
1211 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test succeeded before timeout\n"); 1220 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test succeeded before timeout\n");
1212 GNUNET_assert (NULL != post_test_task); 1221 GNUNET_assert (NULL != post_test_task);
@@ -1216,6 +1225,7 @@ default_reply_handle (void *cls,
1216 } 1225 }
1217} 1226}
1218 1227
1228
1219/** 1229/**
1220 * Request random peers. 1230 * Request random peers.
1221 */ 1231 */
@@ -1226,7 +1236,7 @@ request_peers (void *cls)
1226 struct RPSPeer *rps_peer; 1236 struct RPSPeer *rps_peer;
1227 struct PendingReply *pending_rep; 1237 struct PendingReply *pending_rep;
1228 1238
1229 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1239 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1230 return; 1240 return;
1231 rps_peer = pending_req->rps_peer; 1241 rps_peer = pending_req->rps_peer;
1232 GNUNET_assert (1 <= rps_peer->num_pending_reqs); 1242 GNUNET_assert (1 <= rps_peer->num_pending_reqs);
@@ -1248,6 +1258,7 @@ request_peers (void *cls)
1248 rps_peer->num_pending_reqs--; 1258 rps_peer->num_pending_reqs--;
1249} 1259}
1250 1260
1261
1251static void 1262static void
1252cancel_pending_req (struct PendingRequest *pending_req) 1263cancel_pending_req (struct PendingRequest *pending_req)
1253{ 1264{
@@ -1264,6 +1275,7 @@ cancel_pending_req (struct PendingRequest *pending_req)
1264 GNUNET_free (pending_req); 1275 GNUNET_free (pending_req);
1265} 1276}
1266 1277
1278
1267static void 1279static void
1268cancel_request (struct PendingReply *pending_rep) 1280cancel_request (struct PendingReply *pending_rep)
1269{ 1281{
@@ -1280,6 +1292,7 @@ cancel_request (struct PendingReply *pending_rep)
1280 GNUNET_free (pending_rep); 1292 GNUNET_free (pending_rep);
1281} 1293}
1282 1294
1295
1283/** 1296/**
1284 * Cancel a request. 1297 * Cancel a request.
1285 */ 1298 */
@@ -1289,7 +1302,7 @@ cancel_request_cb (void *cls)
1289 struct RPSPeer *rps_peer = cls; 1302 struct RPSPeer *rps_peer = cls;
1290 struct PendingReply *pending_rep; 1303 struct PendingReply *pending_rep;
1291 1304
1292 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1305 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1293 return; 1306 return;
1294 pending_rep = rps_peer->pending_rep_head; 1307 pending_rep = rps_peer->pending_rep_head;
1295 GNUNET_assert (1 <= rps_peer->num_pending_reps); 1308 GNUNET_assert (1 <= rps_peer->num_pending_reps);
@@ -1330,6 +1343,7 @@ schedule_missing_requests (struct RPSPeer *rps_peer)
1330 } 1343 }
1331} 1344}
1332 1345
1346
1333void 1347void
1334cancel_pending_req_rep (struct RPSPeer *rps_peer) 1348cancel_pending_req_rep (struct RPSPeer *rps_peer)
1335{ 1349{
@@ -1343,6 +1357,7 @@ cancel_pending_req_rep (struct RPSPeer *rps_peer)
1343 GNUNET_assert (0 == rps_peer->num_pending_reps); 1357 GNUNET_assert (0 == rps_peer->num_pending_reps);
1344} 1358}
1345 1359
1360
1346/*********************************** 1361/***********************************
1347* MALICIOUS 1362* MALICIOUS
1348***********************************/ 1363***********************************/
@@ -1350,7 +1365,8 @@ cancel_pending_req_rep (struct RPSPeer *rps_peer)
1350/** 1365/**
1351 * Initialise only non-mal RPSPeers 1366 * Initialise only non-mal RPSPeers
1352 */ 1367 */
1353static void mal_init_peer (struct RPSPeer *rps_peer) 1368static void
1369mal_init_peer (struct RPSPeer *rps_peer)
1354{ 1370{
1355 if (rps_peer->index >= round (portion * num_peers)) 1371 if (rps_peer->index >= round (portion * num_peers))
1356 rps_peer->num_ids_to_request = 1; 1372 rps_peer->num_ids_to_request = 1;
@@ -1390,12 +1406,13 @@ mal_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
1390 #endif /* ENABLE_MALICIOUS */ 1406 #endif /* ENABLE_MALICIOUS */
1391} 1407}
1392 1408
1409
1393static void 1410static void
1394mal_cb (struct RPSPeer *rps_peer) 1411mal_cb (struct RPSPeer *rps_peer)
1395{ 1412{
1396 uint32_t num_mal_peers; 1413 uint32_t num_mal_peers;
1397 1414
1398 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1415 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1399 { 1416 {
1400 return; 1417 return;
1401 } 1418 }
@@ -1423,7 +1440,7 @@ mal_cb (struct RPSPeer *rps_peer)
1423static void 1440static void
1424single_req_cb (struct RPSPeer *rps_peer) 1441single_req_cb (struct RPSPeer *rps_peer)
1425{ 1442{
1426 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1443 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1427 { 1444 {
1428 return; 1445 return;
1429 } 1446 }
@@ -1431,13 +1448,14 @@ single_req_cb (struct RPSPeer *rps_peer)
1431 schedule_missing_requests (rps_peer); 1448 schedule_missing_requests (rps_peer);
1432} 1449}
1433 1450
1451
1434/*********************************** 1452/***********************************
1435* DELAYED_REQUESTS 1453* DELAYED_REQUESTS
1436***********************************/ 1454***********************************/
1437static void 1455static void
1438delay_req_cb (struct RPSPeer *rps_peer) 1456delay_req_cb (struct RPSPeer *rps_peer)
1439{ 1457{
1440 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1458 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1441 { 1459 {
1442 return; 1460 return;
1443 } 1461 }
@@ -1445,13 +1463,14 @@ delay_req_cb (struct RPSPeer *rps_peer)
1445 schedule_missing_requests (rps_peer); 1463 schedule_missing_requests (rps_peer);
1446} 1464}
1447 1465
1466
1448/*********************************** 1467/***********************************
1449* SEED 1468* SEED
1450***********************************/ 1469***********************************/
1451static void 1470static void
1452seed_cb (struct RPSPeer *rps_peer) 1471seed_cb (struct RPSPeer *rps_peer)
1453{ 1472{
1454 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1473 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1455 { 1474 {
1456 return; 1475 return;
1457 } 1476 }
@@ -1461,13 +1480,14 @@ seed_cb (struct RPSPeer *rps_peer)
1461 seed_peers, rps_peer); 1480 seed_peers, rps_peer);
1462} 1481}
1463 1482
1483
1464/*********************************** 1484/***********************************
1465* SEED_BIG 1485* SEED_BIG
1466***********************************/ 1486***********************************/
1467static void 1487static void
1468seed_big_cb (struct RPSPeer *rps_peer) 1488seed_big_cb (struct RPSPeer *rps_peer)
1469{ 1489{
1470 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1490 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1471 { 1491 {
1472 return; 1492 return;
1473 } 1493 }
@@ -1478,6 +1498,7 @@ seed_big_cb (struct RPSPeer *rps_peer)
1478 seed_peers_big, rps_peer); 1498 seed_peers_big, rps_peer);
1479} 1499}
1480 1500
1501
1481/*********************************** 1502/***********************************
1482* SINGLE_PEER_SEED 1503* SINGLE_PEER_SEED
1483***********************************/ 1504***********************************/
@@ -1488,13 +1509,14 @@ single_peer_seed_cb (struct RPSPeer *rps_peer)
1488 // TODO 1509 // TODO
1489} 1510}
1490 1511
1512
1491/*********************************** 1513/***********************************
1492* SEED_REQUEST 1514* SEED_REQUEST
1493***********************************/ 1515***********************************/
1494static void 1516static void
1495seed_req_cb (struct RPSPeer *rps_peer) 1517seed_req_cb (struct RPSPeer *rps_peer)
1496{ 1518{
1497 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1519 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1498 { 1520 {
1499 return; 1521 return;
1500 } 1522 }
@@ -1505,6 +1527,7 @@ seed_req_cb (struct RPSPeer *rps_peer)
1505 schedule_missing_requests (rps_peer); 1527 schedule_missing_requests (rps_peer);
1506} 1528}
1507 1529
1530
1508// TODO start big mal 1531// TODO start big mal
1509 1532
1510/*********************************** 1533/***********************************
@@ -1513,7 +1536,7 @@ seed_req_cb (struct RPSPeer *rps_peer)
1513static void 1536static void
1514req_cancel_cb (struct RPSPeer *rps_peer) 1537req_cancel_cb (struct RPSPeer *rps_peer)
1515{ 1538{
1516 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1539 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1517 { 1540 {
1518 return; 1541 return;
1519 } 1542 }
@@ -1525,6 +1548,7 @@ req_cancel_cb (struct RPSPeer *rps_peer)
1525 cancel_request_cb, rps_peer); 1548 cancel_request_cb, rps_peer);
1526} 1549}
1527 1550
1551
1528/*********************************** 1552/***********************************
1529* CHURN 1553* CHURN
1530***********************************/ 1554***********************************/
@@ -1546,13 +1570,13 @@ churn (void *cls);
1546static void 1570static void
1547churn_test_cb (struct RPSPeer *rps_peer) 1571churn_test_cb (struct RPSPeer *rps_peer)
1548{ 1572{
1549 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1573 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1550 { 1574 {
1551 return; 1575 return;
1552 } 1576 }
1553 1577
1554 /* Start churn */ 1578 /* Start churn */
1555 if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task)) 1579 if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
1556 { 1580 {
1557 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1581 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1558 "Starting churn task\n"); 1582 "Starting churn task\n");
@@ -1570,6 +1594,7 @@ churn_test_cb (struct RPSPeer *rps_peer)
1570 schedule_missing_requests (rps_peer); 1594 schedule_missing_requests (rps_peer);
1571} 1595}
1572 1596
1597
1573/*********************************** 1598/***********************************
1574* SUB 1599* SUB
1575***********************************/ 1600***********************************/
@@ -1633,6 +1658,7 @@ sub_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
1633 rps_peer); 1658 rps_peer);
1634} 1659}
1635 1660
1661
1636/*********************************** 1662/***********************************
1637* PROFILER 1663* PROFILER
1638***********************************/ 1664***********************************/
@@ -1653,7 +1679,7 @@ churn_cb (void *cls,
1653 // FIXME 1679 // FIXME
1654 struct OpListEntry *entry = cls; 1680 struct OpListEntry *entry = cls;
1655 1681
1656 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1682 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1657 { 1683 {
1658 return; 1684 return;
1659 } 1685 }
@@ -1725,6 +1751,7 @@ churn_cb (void *cls,
1725 // run_round (); 1751 // run_round ();
1726} 1752}
1727 1753
1754
1728/** 1755/**
1729 * @brief Set the rps-service up or down for a specific peer 1756 * @brief Set the rps-service up or down for a specific peer
1730 * 1757 *
@@ -1791,7 +1818,7 @@ churn (void *cls)
1791 double portion_go_online; 1818 double portion_go_online;
1792 double portion_go_offline; 1819 double portion_go_offline;
1793 1820
1794 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1821 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1795 { 1822 {
1796 return; 1823 return;
1797 } 1824 }
@@ -1852,7 +1879,8 @@ churn (void *cls)
1852/** 1879/**
1853 * Initialise given RPSPeer 1880 * Initialise given RPSPeer
1854 */ 1881 */
1855static void profiler_init_peer (struct RPSPeer *rps_peer) 1882static void
1883profiler_init_peer (struct RPSPeer *rps_peer)
1856{ 1884{
1857 if (num_peers - 1 == rps_peer->index) 1885 if (num_peers - 1 == rps_peer->index)
1858 rps_peer->num_ids_to_request = cur_test_run.num_requests; 1886 rps_peer->num_ids_to_request = cur_test_run.num_requests;
@@ -1907,13 +1935,13 @@ profiler_reply_handle (void *cls,
1907static void 1935static void
1908profiler_cb (struct RPSPeer *rps_peer) 1936profiler_cb (struct RPSPeer *rps_peer)
1909{ 1937{
1910 if ((GNUNET_YES == in_shutdown)||(GNUNET_YES == post_test)) 1938 if ((GNUNET_YES == in_shutdown) || (GNUNET_YES == post_test))
1911 { 1939 {
1912 return; 1940 return;
1913 } 1941 }
1914 1942
1915 /* Start churn */ 1943 /* Start churn */
1916 if ((HAVE_CHURN == cur_test_run.have_churn)&&(NULL == churn_task)) 1944 if ((HAVE_CHURN == cur_test_run.have_churn) && (NULL == churn_task))
1917 { 1945 {
1918 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1946 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1919 "Starting churn task\n"); 1947 "Starting churn task\n");
@@ -1935,6 +1963,7 @@ profiler_cb (struct RPSPeer *rps_peer)
1935 schedule_missing_requests (rps_peer); 1963 schedule_missing_requests (rps_peer);
1936} 1964}
1937 1965
1966
1938/** 1967/**
1939 * Function called from #profiler_eval with a filename. 1968 * Function called from #profiler_eval with a filename.
1940 * 1969 *
@@ -1972,6 +2001,7 @@ file_name_cb (void *cls, const char *filename)
1972 return GNUNET_OK; 2001 return GNUNET_OK;
1973} 2002}
1974 2003
2004
1975/** 2005/**
1976 * This is run after the test finished. 2006 * This is run after the test finished.
1977 * 2007 *
@@ -1998,7 +2028,8 @@ profiler_eval (void)
1998 * 2028 *
1999 * @return 2029 * @return
2000 */ 2030 */
2001static int is_in_view (uint32_t a, uint32_t b) 2031static int
2032is_in_view (uint32_t a, uint32_t b)
2002{ 2033{
2003 uint32_t i; 2034 uint32_t i;
2004 2035
@@ -2014,7 +2045,9 @@ static int is_in_view (uint32_t a, uint32_t b)
2014 return GNUNET_NO; 2045 return GNUNET_NO;
2015} 2046}
2016 2047
2017static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid) 2048
2049static uint32_t
2050get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
2018{ 2051{
2019 uint32_t i; 2052 uint32_t i;
2020 2053
@@ -2034,6 +2067,7 @@ static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
2034 GNUNET_assert (0); 2067 GNUNET_assert (0);
2035} 2068}
2036 2069
2070
2037/** 2071/**
2038 * @brief Counts number of peers in view of a that have b in their view 2072 * @brief Counts number of peers in view of a that have b in their view
2039 * 2073 *
@@ -2042,7 +2076,8 @@ static uint32_t get_idx_of_pid (const struct GNUNET_PeerIdentity *pid)
2042 * 2076 *
2043 * @return 2077 * @return
2044 */ 2078 */
2045static uint32_t count_containing_views (uint32_t a, uint32_t b) 2079static uint32_t
2080count_containing_views (uint32_t a, uint32_t b)
2046{ 2081{
2047 uint32_t i; 2082 uint32_t i;
2048 uint32_t peer_idx; 2083 uint32_t peer_idx;
@@ -2059,13 +2094,15 @@ static uint32_t count_containing_views (uint32_t a, uint32_t b)
2059 return count; 2094 return count;
2060} 2095}
2061 2096
2097
2062/** 2098/**
2063 * @brief Computes the probability for each other peer to be selected by the 2099 * @brief Computes the probability for each other peer to be selected by the
2064 * sampling process based on the views of all peers 2100 * sampling process based on the views of all peers
2065 * 2101 *
2066 * @param peer_idx index of the peer that is about to sample 2102 * @param peer_idx index of the peer that is about to sample
2067 */ 2103 */
2068static void compute_probabilities (uint32_t peer_idx) 2104static void
2105compute_probabilities (uint32_t peer_idx)
2069{ 2106{
2070 // double probs[num_peers] = { 0 }; 2107 // double probs[num_peers] = { 0 };
2071 double probs[num_peers]; 2108 double probs[num_peers];
@@ -2197,6 +2234,7 @@ static void compute_probabilities (uint32_t peer_idx)
2197 GNUNET_free (probs_as_str); 2234 GNUNET_free (probs_as_str);
2198} 2235}
2199 2236
2237
2200/** 2238/**
2201 * @brief This counts the number of peers in which views a given peer occurs. 2239 * @brief This counts the number of peers in which views a given peer occurs.
2202 * 2240 *
@@ -2206,7 +2244,8 @@ static void compute_probabilities (uint32_t peer_idx)
2206 * 2244 *
2207 * @return the number of occurrences 2245 * @return the number of occurrences
2208 */ 2246 */
2209static uint32_t count_peer_in_views_2 (uint32_t peer_idx) 2247static uint32_t
2248count_peer_in_views_2 (uint32_t peer_idx)
2210{ 2249{
2211 uint32_t i, j; 2250 uint32_t i, j;
2212 uint32_t count = 0; 2251 uint32_t count = 0;
@@ -2228,7 +2267,9 @@ static uint32_t count_peer_in_views_2 (uint32_t peer_idx)
2228 return count; 2267 return count;
2229} 2268}
2230 2269
2231static uint32_t cumulated_view_sizes () 2270
2271static uint32_t
2272cumulated_view_sizes ()
2232{ 2273{
2233 uint32_t i; 2274 uint32_t i;
2234 2275
@@ -2240,7 +2281,9 @@ static uint32_t cumulated_view_sizes ()
2240 return view_sizes; 2281 return view_sizes;
2241} 2282}
2242 2283
2243static void count_peer_in_views (uint32_t *count_peers) 2284
2285static void
2286count_peer_in_views (uint32_t *count_peers)
2244{ 2287{
2245 uint32_t i, j; 2288 uint32_t i, j;
2246 2289
@@ -2258,7 +2301,9 @@ static void count_peer_in_views (uint32_t *count_peers)
2258 } 2301 }
2259} 2302}
2260 2303
2261void compute_diversity () 2304
2305void
2306compute_diversity ()
2262{ 2307{
2263 uint32_t i; 2308 uint32_t i;
2264 /* ith entry represents the numer of occurrences in other peer's views */ 2309 /* ith entry represents the numer of occurrences in other peer's views */
@@ -2301,7 +2346,9 @@ void compute_diversity ()
2301 GNUNET_free (deviation); 2346 GNUNET_free (deviation);
2302} 2347}
2303 2348
2304void print_view_sizes () 2349
2350void
2351print_view_sizes ()
2305{ 2352{
2306 uint32_t i; 2353 uint32_t i;
2307 2354
@@ -2315,15 +2362,19 @@ void print_view_sizes ()
2315 } 2362 }
2316} 2363}
2317 2364
2318void all_views_updated_cb () 2365
2366void
2367all_views_updated_cb ()
2319{ 2368{
2320 compute_diversity (); 2369 compute_diversity ();
2321 print_view_sizes (); 2370 print_view_sizes ();
2322} 2371}
2323 2372
2324void view_update_cb (void *cls, 2373
2325 uint64_t view_size, 2374void
2326 const struct GNUNET_PeerIdentity *peers) 2375view_update_cb (void *cls,
2376 uint64_t view_size,
2377 const struct GNUNET_PeerIdentity *peers)
2327{ 2378{
2328 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2379 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2329 "View was updated (%" PRIu64 ")\n", view_size); 2380 "View was updated (%" PRIu64 ")\n", view_size);
@@ -2372,6 +2423,7 @@ void view_update_cb (void *cls,
2372 all_views_updated_cb (); 2423 all_views_updated_cb ();
2373} 2424}
2374 2425
2426
2375static void 2427static void
2376pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h) 2428pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
2377{ 2429{
@@ -2380,7 +2432,9 @@ pre_profiler (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h)
2380 GNUNET_RPS_view_request (h, 0, view_update_cb, rps_peer); 2432 GNUNET_RPS_view_request (h, 0, view_update_cb, rps_peer);
2381} 2433}
2382 2434
2383void write_final_stats (void) 2435
2436void
2437write_final_stats (void)
2384{ 2438{
2385 uint32_t i; 2439 uint32_t i;
2386 2440
@@ -2416,6 +2470,7 @@ void write_final_stats (void)
2416 } 2470 }
2417} 2471}
2418 2472
2473
2419/** 2474/**
2420 * Continuation called by #GNUNET_STATISTICS_get() functions. 2475 * Continuation called by #GNUNET_STATISTICS_get() functions.
2421 * 2476 *
@@ -2448,7 +2503,7 @@ post_test_shutdown_ready_cb (void *cls,
2448 GNUNET_break (0); 2503 GNUNET_break (0);
2449 } 2504 }
2450 2505
2451 if ((NULL != rps_peer->stat_op)&& 2506 if ((NULL != rps_peer->stat_op) &&
2452 (GNUNET_YES == check_statistics_collect_completed_single_peer ( 2507 (GNUNET_YES == check_statistics_collect_completed_single_peer (
2453 rps_peer)) ) 2508 rps_peer)) )
2454 { 2509 {
@@ -2470,6 +2525,7 @@ post_test_shutdown_ready_cb (void *cls,
2470 } 2525 }
2471} 2526}
2472 2527
2528
2473/** 2529/**
2474 * @brief Converts string representation to the corresponding #STAT_TYPE enum. 2530 * @brief Converts string representation to the corresponding #STAT_TYPE enum.
2475 * 2531 *
@@ -2477,7 +2533,8 @@ post_test_shutdown_ready_cb (void *cls,
2477 * 2533 *
2478 * @return corresponding enum 2534 * @return corresponding enum
2479 */ 2535 */
2480enum STAT_TYPE stat_str_2_type (const char *stat_str) 2536enum STAT_TYPE
2537stat_str_2_type (const char *stat_str)
2481{ 2538{
2482 if (0 == strncmp ("# rounds blocked - no pull replies", stat_str, strlen ( 2539 if (0 == strncmp ("# rounds blocked - no pull replies", stat_str, strlen (
2483 "# rounds blocked - no pull replies"))) 2540 "# rounds blocked - no pull replies")))
@@ -2571,7 +2628,8 @@ enum STAT_TYPE stat_str_2_type (const char *stat_str)
2571 * 2628 *
2572 * @return string representation that matches statistics value 2629 * @return string representation that matches statistics value
2573 */ 2630 */
2574char*stat_type_2_str (enum STAT_TYPE stat_type) 2631char*
2632stat_type_2_str (enum STAT_TYPE stat_type)
2575{ 2633{
2576 switch (stat_type) 2634 switch (stat_type)
2577 { 2635 {
@@ -2630,6 +2688,7 @@ char*stat_type_2_str (enum STAT_TYPE stat_type)
2630 } 2688 }
2631} 2689}
2632 2690
2691
2633/** 2692/**
2634 * Callback function to process statistic values. 2693 * Callback function to process statistic values.
2635 * 2694 *
@@ -2735,7 +2794,9 @@ stat_iterator (void *cls,
2735 return GNUNET_OK; 2794 return GNUNET_OK;
2736} 2795}
2737 2796
2738void post_profiler (struct RPSPeer *rps_peer) 2797
2798void
2799post_profiler (struct RPSPeer *rps_peer)
2739{ 2800{
2740 if (COLLECT_STATISTICS != cur_test_run.have_collect_statistics) 2801 if (COLLECT_STATISTICS != cur_test_run.have_collect_statistics)
2741 { 2802 {
@@ -2808,7 +2869,7 @@ run (void *cls,
2808 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n"); 2869 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
2809 2870
2810 /* Check whether we timed out */ 2871 /* Check whether we timed out */
2811 if ((n_peers != num_peers)|| 2872 if ((n_peers != num_peers) ||
2812 (NULL == peers) || 2873 (NULL == peers) ||
2813 (0 == links_succeeded) ) 2874 (0 == links_succeeded) )
2814 { 2875 {
diff --git a/src/rps/test_rps_api.c b/src/rps/test_rps_api.c
index 6fca7ea12..06dad2887 100644
--- a/src/rps/test_rps_api.c
+++ b/src/rps/test_rps_api.c
@@ -83,4 +83,5 @@ main (int argc, char *argv[])
83 return check (); 83 return check ();
84} 84}
85 85
86
86/* end of test_rps_api.c */ 87/* end of test_rps_api.c */
diff --git a/src/rps/test_service_rps_custommap.c b/src/rps/test_service_rps_custommap.c
index 6f6f6b0d3..05590b097 100644
--- a/src/rps/test_service_rps_custommap.c
+++ b/src/rps/test_service_rps_custommap.c
@@ -123,4 +123,5 @@ main (int argc, char *argv[])
123 return check (); 123 return check ();
124} 124}
125 125
126
126/* end of test_service_rps_custommap.c */ 127/* end of test_service_rps_custommap.c */
diff --git a/src/rps/test_service_rps_sampler_elem.c b/src/rps/test_service_rps_sampler_elem.c
index 706abf4f9..8fef5adaf 100644
--- a/src/rps/test_service_rps_sampler_elem.c
+++ b/src/rps/test_service_rps_sampler_elem.c
@@ -209,4 +209,5 @@ main (int argc, char *argv[])
209 return check (); 209 return check ();
210} 210}
211 211
212
212/* end of test_service_rps_peers.c */ 213/* end of test_service_rps_peers.c */
diff --git a/src/rps/test_service_rps_view.c b/src/rps/test_service_rps_view.c
index 5b668efe1..5a8c00849 100644
--- a/src/rps/test_service_rps_view.c
+++ b/src/rps/test_service_rps_view.c
@@ -141,4 +141,5 @@ main ()
141 return check (); 141 return check ();
142} 142}
143 143
144
144/* end of test_service_rps_view.c */ 145/* end of test_service_rps_view.c */
diff --git a/src/scalarproduct/gnunet-scalarproduct.c b/src/scalarproduct/gnunet-scalarproduct.c
index 76320dbba..7dc8ff5c3 100644
--- a/src/scalarproduct/gnunet-scalarproduct.c
+++ b/src/scalarproduct/gnunet-scalarproduct.c
@@ -398,4 +398,5 @@ main (int argc, char *const *argv)
398 options, &run, NULL)) ? ret : 1; 398 options, &run, NULL)) ? ret : 1;
399} 399}
400 400
401
401/* end of gnunet-scalarproduct.c */ 402/* end of gnunet-scalarproduct.c */
diff --git a/src/scalarproduct/gnunet-service-scalarproduct.h b/src/scalarproduct/gnunet-service-scalarproduct.h
index f2592bacf..4e79afa2f 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct.h
+++ b/src/scalarproduct/gnunet-service-scalarproduct.h
@@ -136,7 +136,6 @@ struct BobCryptodataMultipartMessage
136}; 136};
137 137
138 138
139
140GNUNET_NETWORK_STRUCT_END 139GNUNET_NETWORK_STRUCT_END
141 140
142 141
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
index 66b01c89e..44534c850 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
@@ -623,6 +623,7 @@ check_bobs_cryptodata_multipart (
623 return GNUNET_OK; 623 return GNUNET_OK;
624} 624}
625 625
626
626/** 627/**
627 * Handle a multipart chunk of a response we got from another service 628 * Handle a multipart chunk of a response we got from another service
628 * we wanted to calculate a scalarproduct with. 629 * we wanted to calculate a scalarproduct with.
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
index 23d59a36a..c000749af 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
@@ -202,7 +202,6 @@ struct BobServiceSession
202}; 202};
203 203
204 204
205
206/** 205/**
207 * GNUnet configuration handle 206 * GNUnet configuration handle
208 */ 207 */
@@ -524,6 +523,8 @@ transmit_bobs_cryptodata_message (struct BobServiceSession *s)
524 e); 523 e);
525 transmit_bobs_cryptodata_message_multipart (s); 524 transmit_bobs_cryptodata_message_multipart (s);
526} 525}
526
527
527#undef ELEMENT_CAPACITY 528#undef ELEMENT_CAPACITY
528 529
529 530
diff --git a/src/scalarproduct/test_ecc_scalarproduct.c b/src/scalarproduct/test_ecc_scalarproduct.c
index 1117f0811..eced3ef6a 100644
--- a/src/scalarproduct/test_ecc_scalarproduct.c
+++ b/src/scalarproduct/test_ecc_scalarproduct.c
@@ -173,4 +173,5 @@ main (int argc, char *argv[])
173 return 0; 173 return 0;
174} 174}
175 175
176
176/* end of test_ecc_scalarproduct.c */ 177/* end of test_ecc_scalarproduct.c */
diff --git a/src/secretsharing/gnunet-secretsharing-profiler.c b/src/secretsharing/gnunet-secretsharing-profiler.c
index 38163e2c2..3465e0167 100644
--- a/src/secretsharing/gnunet-secretsharing-profiler.c
+++ b/src/secretsharing/gnunet-secretsharing-profiler.c
@@ -207,8 +207,9 @@ decrypt_connect_complete (void *cls,
207 * @param cls Plaintext 207 * @param cls Plaintext
208 * @param plaintext Plaintext 208 * @param plaintext Plaintext
209 */ 209 */
210static void decrypt_cb (void *cls, 210static void
211 const struct GNUNET_SECRETSHARING_Plaintext *plaintext) 211decrypt_cb (void *cls,
212 const struct GNUNET_SECRETSHARING_Plaintext *plaintext)
212{ 213{
213 struct GNUNET_SECRETSHARING_DecryptionHandle **dhp = cls; 214 struct GNUNET_SECRETSHARING_DecryptionHandle **dhp = cls;
214 unsigned int n = dhp - decrypt_handles; 215 unsigned int n = dhp - decrypt_handles;
@@ -244,7 +245,6 @@ static void decrypt_cb (void *cls,
244} 245}
245 246
246 247
247
248/** 248/**
249 * Adapter function called to establish a connection to 249 * Adapter function called to establish a connection to
250 * a service. 250 * a service.
@@ -383,7 +383,6 @@ session_connect_adapter (void *cls,
383} 383}
384 384
385 385
386
387/** 386/**
388 * Adapter function called to destroy a connection to 387 * Adapter function called to destroy a connection to
389 * a service. 388 * a service.
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c
index bf7f35920..1aec5000e 100644
--- a/src/secretsharing/gnunet-service-secretsharing.c
+++ b/src/secretsharing/gnunet-service-secretsharing.c
@@ -662,7 +662,6 @@ cleanup_task (void *cls)
662} 662}
663 663
664 664
665
666/** 665/**
667 * Generate the random coefficients of our pre-secret polynomial 666 * Generate the random coefficients of our pre-secret polynomial
668 * 667 *
@@ -884,7 +883,6 @@ keygen_round2_conclude (void *cls)
884} 883}
885 884
886 885
887
888static void 886static void
889restore_fair (const struct GNUNET_CRYPTO_PaillierPublicKey *ppub, 887restore_fair (const struct GNUNET_CRYPTO_PaillierPublicKey *ppub,
890 const struct GNUNET_SECRETSHARING_FairEncryption *fe, 888 const struct GNUNET_SECRETSHARING_FairEncryption *fe,
diff --git a/src/secretsharing/secretsharing.h b/src/secretsharing/secretsharing.h
index 01d7dcf6b..af6263c46 100644
--- a/src/secretsharing/secretsharing.h
+++ b/src/secretsharing/secretsharing.h
@@ -81,7 +81,6 @@ struct GNUNET_SECRETSHARING_CreateMessage
81}; 81};
82 82
83 83
84
85struct GNUNET_SECRETSHARING_ShareHeaderNBO 84struct GNUNET_SECRETSHARING_ShareHeaderNBO
86{ 85{
87 /** 86 /**
diff --git a/src/secretsharing/secretsharing_api.c b/src/secretsharing/secretsharing_api.c
index 4e35bf87a..b29109da9 100644
--- a/src/secretsharing/secretsharing_api.c
+++ b/src/secretsharing/secretsharing_api.c
@@ -514,4 +514,5 @@ GNUNET_SECRETSHARING_decrypt_cancel (struct
514 GNUNET_free (dh); 514 GNUNET_free (dh);
515} 515}
516 516
517
517/* end of secretsharing_api.c */ 518/* end of secretsharing_api.c */
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index 6e49599a2..8b46f68de 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -1775,8 +1775,7 @@ handle_client_cancel (void *cls, const struct GNUNET_SET_CancelMessage *msg)
1775 * the other peer disconnecting. The client may not know about this 1775 * the other peer disconnecting. The client may not know about this
1776 * yet and try to cancel the (just barely non-existent) operation. 1776 * yet and try to cancel the (just barely non-existent) operation.
1777 * So this is not a hard error. 1777 * So this is not a hard error.
1778 */ 1778 */GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1779 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1780 "Client canceled non-existent op %u\n", 1779 "Client canceled non-existent op %u\n",
1781 (uint32_t) ntohl (msg->request_id)); 1780 (uint32_t) ntohl (msg->request_id));
1782 } 1781 }
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h
index 402281da4..e118828be 100644
--- a/src/set/gnunet-service-set.h
+++ b/src/set/gnunet-service-set.h
@@ -154,7 +154,6 @@ typedef void
154(*OpChannelDeathImpl) (struct Operation *op); 154(*OpChannelDeathImpl) (struct Operation *op);
155 155
156 156
157
158/** 157/**
159 * Dispatch table for a specific set operation. Every set operation 158 * Dispatch table for a specific set operation. Every set operation
160 * has to implement the callback in this struct. 159 * has to implement the callback in this struct.
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index ca4ef2092..87c6faf98 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -2168,8 +2168,7 @@ handle_union_p2p_done (void *cls,
2168 * We should notify the active peer once 2168 * We should notify the active peer once
2169 * all our demands are satisfied, so that the active 2169 * all our demands are satisfied, so that the active
2170 * peer can quit if we gave it everything. 2170 * peer can quit if we gave it everything.
2171 */ 2171 */GNUNET_CADET_receive_done (op->channel);
2172 GNUNET_CADET_receive_done (op->channel);
2173 maybe_finish (op); 2172 maybe_finish (op);
2174 return; 2173 return;
2175 2174
@@ -2182,8 +2181,7 @@ handle_union_p2p_done (void *cls,
2182 * 2181 *
2183 * We'll close the channel 2182 * We'll close the channel
2184 * to the other peer once our demands are met. 2183 * to the other peer once our demands are met.
2185 */ 2184 */op->state->phase = PHASE_FINISH_CLOSING;
2186 op->state->phase = PHASE_FINISH_CLOSING;
2187 GNUNET_CADET_receive_done (op->channel); 2185 GNUNET_CADET_receive_done (op->channel);
2188 maybe_finish (op); 2186 maybe_finish (op);
2189 return; 2187 return;
@@ -2195,6 +2193,7 @@ handle_union_p2p_done (void *cls,
2195 } 2193 }
2196} 2194}
2197 2195
2196
2198/** 2197/**
2199 * Handle a over message from a remote peer 2198 * Handle a over message from a remote peer
2200 * 2199 *
diff --git a/src/set/gnunet-service-set_union.h b/src/set/gnunet-service-set_union.h
index 5da5b7254..2c0262f07 100644
--- a/src/set/gnunet-service-set_union.h
+++ b/src/set/gnunet-service-set_union.h
@@ -151,7 +151,6 @@ handle_union_p2p_inquiry (void *cls,
151 const struct InquiryMessage *msg); 151 const struct InquiryMessage *msg);
152 152
153 153
154
155/** 154/**
156 * Handle a request for full set transmission. 155 * Handle a request for full set transmission.
157 * 156 *
@@ -163,7 +162,6 @@ handle_union_p2p_request_full (void *cls,
163 const struct GNUNET_MessageHeader *mh); 162 const struct GNUNET_MessageHeader *mh);
164 163
165 164
166
167/** 165/**
168 * Handle a "full done" message. 166 * Handle a "full done" message.
169 * 167 *
diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c
index 81263966a..3014861a6 100644
--- a/src/set/gnunet-set-profiler.c
+++ b/src/set/gnunet-set-profiler.c
@@ -138,7 +138,7 @@ statistics_done (void *cls,
138static void 138static void
139check_all_done (void) 139check_all_done (void)
140{ 140{
141 if ((info1.done == GNUNET_NO)||(info2.done == GNUNET_NO)) 141 if ((info1.done == GNUNET_NO) || (info2.done == GNUNET_NO))
142 return; 142 return;
143 143
144 GNUNET_CONTAINER_multihashmap_iterate (info1.received, map_remove_iterator, 144 GNUNET_CONTAINER_multihashmap_iterate (info1.received, map_remove_iterator,
diff --git a/src/set/ibf.c b/src/set/ibf.c
index 7c7adaa3c..1532afceb 100644
--- a/src/set/ibf.c
+++ b/src/set/ibf.c
@@ -45,6 +45,7 @@ ibf_key_from_hashcode (const struct GNUNET_HashCode *hash)
45 return *(struct IBF_Key *) hash; 45 return *(struct IBF_Key *) hash;
46} 46}
47 47
48
48/** 49/**
49 * Create a hashcode from a key, by replicating the key 50 * Create a hashcode from a key, by replicating the key
50 * until the hascode is filled 51 * until the hascode is filled
diff --git a/src/set/ibf_sim.c b/src/set/ibf_sim.c
index 226a9d751..6415d00e1 100644
--- a/src/set/ibf_sim.c
+++ b/src/set/ibf_sim.c
@@ -93,8 +93,7 @@ main (int argc, char **argv)
93 get 990/1000 elements on average over 1 million runs; key 93 get 990/1000 elements on average over 1 million runs; key
94 idea being to stop short of the 'last' possible IBF as 94 idea being to stop short of the 'last' possible IBF as
95 otherwise a "lowball" per-chance would unduely influence the 95 otherwise a "lowball" per-chance would unduely influence the
96 result */ 96 result */if ((j > 0) &&
97 if ((j > 0) &&
98 (buckets[j - 1] > MAX_IBF_DECODE)) 97 (buckets[j - 1] > MAX_IBF_DECODE))
99 { 98 {
100 ret *= (1 << (j + 1)); 99 ret *= (1 << (j + 1));
@@ -136,6 +135,7 @@ main (int argc, char **argv)
136 return 0; 135 return 0;
137} 136}
138 137
138
139/* TODO: should calculate stddev of the results to also be able to 139/* TODO: should calculate stddev of the results to also be able to
140 say something about the stability of the results, outside of 140 say something about the stability of the results, outside of
141 large-scale averages -- gaining 8% precision at the expense of 141 large-scale averages -- gaining 8% precision at the expense of
diff --git a/src/set/plugin_block_set_test.c b/src/set/plugin_block_set_test.c
index a9da9d549..1de086092 100644
--- a/src/set/plugin_block_set_test.c
+++ b/src/set/plugin_block_set_test.c
@@ -119,4 +119,5 @@ libgnunet_plugin_block_set_test_done (void *cls)
119 return NULL; 119 return NULL;
120} 120}
121 121
122
122/* end of plugin_block_set_test.c */ 123/* end of plugin_block_set_test.c */
diff --git a/src/set/set_api.c b/src/set/set_api.c
index 961bfdba9..ce4b1c965 100644
--- a/src/set/set_api.c
+++ b/src/set/set_api.c
@@ -1257,4 +1257,5 @@ GNUNET_SET_element_hash (const struct GNUNET_SET_Element *element,
1257 GNUNET_CRYPTO_hash_context_finish (ctx, ret_hash); 1257 GNUNET_CRYPTO_hash_context_finish (ctx, ret_hash);
1258} 1258}
1259 1259
1260
1260/* end of set_api.c */ 1261/* end of set_api.c */
diff --git a/src/sq/sq_exec.c b/src/sq/sq_exec.c
index 1dfa535d9..8c47c22b4 100644
--- a/src/sq/sq_exec.c
+++ b/src/sq/sq_exec.c
@@ -44,7 +44,6 @@ GNUNET_SQ_make_execute (const char *sql)
44} 44}
45 45
46 46
47
48/** 47/**
49 * Create a `struct GNUNET_SQ_ExecuteStatement` where errors should 48 * Create a `struct GNUNET_SQ_ExecuteStatement` where errors should
50 * be tolerated. 49 * be tolerated.
@@ -110,4 +109,5 @@ GNUNET_SQ_exec_statements (sqlite3 *dbh,
110 return GNUNET_OK; 109 return GNUNET_OK;
111} 110}
112 111
112
113/* end of sq_exec */ 113/* end of sq_exec */
diff --git a/src/sq/sq_prepare.c b/src/sq/sq_prepare.c
index 5d232fd17..e1e1834b7 100644
--- a/src/sq/sq_prepare.c
+++ b/src/sq/sq_prepare.c
@@ -46,7 +46,6 @@ GNUNET_SQ_make_prepare (const char *sql,
46} 46}
47 47
48 48
49
50/** 49/**
51 * Prepare all statements given in the (NULL,NULL)-terminated 50 * Prepare all statements given in the (NULL,NULL)-terminated
52 * array at @a ps 51 * array at @a ps
@@ -82,4 +81,5 @@ GNUNET_SQ_prepare (sqlite3 *dbh,
82 return GNUNET_OK; 81 return GNUNET_OK;
83} 82}
84 83
84
85/* end of sq_prepare.c */ 85/* end of sq_prepare.c */
diff --git a/src/sq/sq_query_helper.c b/src/sq/sq_query_helper.c
index ce317a656..c9e4bf031 100644
--- a/src/sq/sq_query_helper.c
+++ b/src/sq/sq_query_helper.c
@@ -438,6 +438,7 @@ bind_u32 (void *cls,
438 return GNUNET_OK; 438 return GNUNET_OK;
439} 439}
440 440
441
441/** 442/**
442 * Generate query parameter for an uint32_t in host byte order. 443 * Generate query parameter for an uint32_t in host byte order.
443 * 444 *
@@ -505,4 +506,5 @@ GNUNET_SQ_query_param_uint64 (const uint64_t *x)
505 return qp; 506 return qp;
506} 507}
507 508
509
508/* end of sq_query_helper.c */ 510/* end of sq_query_helper.c */
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index 3de481e77..ba6a614c8 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -1048,12 +1048,15 @@ GNUNET_SERVICE_MAIN (
1048/** 1048/**
1049 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1049 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1050 */ 1050 */
1051void __attribute__ ((constructor)) GNUNET_STATISTICS_memory_init () 1051void __attribute__ ((constructor))
1052GNUNET_STATISTICS_memory_init ()
1052{ 1053{
1053 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1054 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1054 mallopt (M_TOP_PAD, 1 * 1024); 1055 mallopt (M_TOP_PAD, 1 * 1024);
1055 malloc_trim (0); 1056 malloc_trim (0);
1056} 1057}
1058
1059
1057#endif 1060#endif
1058 1061
1059 1062
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c
index aba80ab36..e004a0f1c 100644
--- a/src/statistics/gnunet-statistics.c
+++ b/src/statistics/gnunet-statistics.c
@@ -192,6 +192,7 @@ new_value_set (const char *subsystem,
192 return value_set; 192 return value_set;
193} 193}
194 194
195
195/** 196/**
196 * @brief Print the (collected) values. 197 * @brief Print the (collected) values.
197 * 198 *
@@ -258,6 +259,7 @@ printer (void *cls, const struct GNUNET_HashCode *key, void *value)
258 return GNUNET_YES; 259 return GNUNET_YES;
259} 260}
260 261
262
261/** 263/**
262 * Callback function to process statistic values. 264 * Callback function to process statistic values.
263 * 265 *
@@ -318,6 +320,7 @@ printer_watch (void *cls,
318 return GNUNET_OK; 320 return GNUNET_OK;
319} 321}
320 322
323
321/** 324/**
322 * @brief Clean all data structures related to given node. 325 * @brief Clean all data structures related to given node.
323 * 326 *
@@ -372,6 +375,7 @@ clean_node (void *cls)
372 } 375 }
373} 376}
374 377
378
375/** 379/**
376 * @brief Print and shutdown 380 * @brief Print and shutdown
377 * 381 *
@@ -384,6 +388,7 @@ print_finish (void *cls)
384 GNUNET_SCHEDULER_shutdown (); 388 GNUNET_SCHEDULER_shutdown ();
385} 389}
386 390
391
387/** 392/**
388 * @brief Called once all statistic values are available. 393 * @brief Called once all statistic values are available.
389 * 394 *
@@ -422,6 +427,7 @@ continuation_print (void *cls, int success)
422 } 427 }
423} 428}
424 429
430
425/** 431/**
426 * Function called last by the statistics code. 432 * Function called last by the statistics code.
427 * 433 *
@@ -450,6 +456,7 @@ cleanup (void *cls, int success)
450 GNUNET_SCHEDULER_shutdown (); 456 GNUNET_SCHEDULER_shutdown ();
451} 457}
452 458
459
453/** 460/**
454 * @brief Iterate over statistics values and store them in #values. 461 * @brief Iterate over statistics values and store them in #values.
455 * They will be printed once all are available. 462 * They will be printed once all are available.
@@ -500,6 +507,7 @@ collector (void *cls,
500 return GNUNET_OK; 507 return GNUNET_OK;
501} 508}
502 509
510
503/** 511/**
504 * Main task that does the actual work. 512 * Main task that does the actual work.
505 * 513 *
@@ -582,6 +590,7 @@ main_task (void *cls)
582 GNUNET_SCHEDULER_add_shutdown (&clean_node, &nodes[index_node].index_node); 590 GNUNET_SCHEDULER_add_shutdown (&clean_node, &nodes[index_node].index_node);
583} 591}
584 592
593
585/** 594/**
586 * @brief Iter over content of a node's directory to check for existence of a 595 * @brief Iter over content of a node's directory to check for existence of a
587 * config file. 596 * config file.
@@ -617,6 +626,7 @@ iter_check_config (void *cls, const char *filename)
617 } 626 }
618} 627}
619 628
629
620/** 630/**
621 * @brief Iterates over filenames in testbed directory. 631 * @brief Iterates over filenames in testbed directory.
622 * 632 *
@@ -649,6 +659,7 @@ iter_testbed_path (void *cls, const char *filename)
649 return GNUNET_OK; 659 return GNUNET_OK;
650} 660}
651 661
662
652/** 663/**
653 * @brief Count the number of nodes running in the testbed 664 * @brief Count the number of nodes running in the testbed
654 * 665 *
@@ -671,6 +682,7 @@ discover_testbed_nodes (const char *path_testbed)
671 return 0; 682 return 0;
672} 683}
673 684
685
674/** 686/**
675 * Main function that will be run by the scheduler. 687 * Main function that will be run by the scheduler.
676 * 688 *
@@ -857,4 +869,5 @@ main (int argc, char *const *argv)
857 return ret; 869 return ret;
858} 870}
859 871
872
860/* end of gnunet-statistics.c */ 873/* end of gnunet-statistics.c */
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 1f3dfcfa6..869d51544 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -739,8 +739,7 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h)
739 * Chances are that it's down for good and we are not going to connect to 739 * Chances are that it's down for good and we are not going to connect to
740 * it anymore. 740 * it anymore.
741 * Give up and don't sync the rest of the data. 741 * Give up and don't sync the rest of the data.
742 */ 742 */loss = GNUNET_NO;
743 loss = GNUNET_NO;
744 for (gh = h->action_head; NULL != gh; gh = gh->next) 743 for (gh = h->action_head; NULL != gh; gh = gh->next)
745 if ((gh->make_persistent) && 744 if ((gh->make_persistent) &&
746 (ACTION_SET == gh->type)) 745 (ACTION_SET == gh->type))
@@ -762,7 +761,6 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h)
762} 761}
763 762
764 763
765
766/** 764/**
767 * Transmit a GET request (and if successful, start to receive 765 * Transmit a GET request (and if successful, start to receive
768 * the response). 766 * the response).
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c
index 9ff02d510..fcdeccad6 100644
--- a/src/statistics/test_statistics_api.c
+++ b/src/statistics/test_statistics_api.c
@@ -249,4 +249,5 @@ main (int argc, char *argv_ign[])
249 return ok; 249 return ok;
250} 250}
251 251
252
252/* end of test_statistics_api.c */ 253/* end of test_statistics_api.c */
diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c
index 54de96107..50507bdc4 100644
--- a/src/statistics/test_statistics_api_loop.c
+++ b/src/statistics/test_statistics_api_loop.c
@@ -118,4 +118,5 @@ main (int argc, char *argv_ign[])
118 return ok; 118 return ok;
119} 119}
120 120
121
121/* end of test_statistics_api_loop.c */ 122/* end of test_statistics_api_loop.c */
diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c
index 67cfb4c46..80ca57c18 100644
--- a/src/statistics/test_statistics_api_watch_zero_value.c
+++ b/src/statistics/test_statistics_api_watch_zero_value.c
@@ -192,4 +192,5 @@ main (int argc, char *argv_ign[])
192 return 1; 192 return 1;
193} 193}
194 194
195
195/* end of test_statistics_api_watch_zero_value.c */ 196/* end of test_statistics_api_watch_zero_value.c */
diff --git a/src/template/gnunet-template.c b/src/template/gnunet-template.c
index 20d286d3c..b33cbcc64 100644
--- a/src/template/gnunet-template.c
+++ b/src/template/gnunet-template.c
@@ -82,4 +82,5 @@ main (int argc, char *const *argv)
82 return ret; 82 return ret;
83} 83}
84 84
85
85/* end of gnunet-template.c */ 86/* end of gnunet-template.c */
diff --git a/src/template/test_template_api.c b/src/template/test_template_api.c
index 68fe8b879..196edec2d 100644
--- a/src/template/test_template_api.c
+++ b/src/template/test_template_api.c
@@ -29,6 +29,7 @@ check ()
29 return 0; 29 return 0;
30} 30}
31 31
32
32int 33int
33main (int argc, char *argv[]) 34main (int argc, char *argv[])
34{ 35{
@@ -39,4 +40,5 @@ main (int argc, char *argv[])
39 return ret; 40 return ret;
40} 41}
41 42
43
42/* end of test_template_api.c */ 44/* end of test_template_api.c */
diff --git a/src/testbed-logger/testbed_logger_api.c b/src/testbed-logger/testbed_logger_api.c
index 58f3d36ce..1d6074d13 100644
--- a/src/testbed-logger/testbed_logger_api.c
+++ b/src/testbed-logger/testbed_logger_api.c
@@ -341,4 +341,5 @@ GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h)
341 h->cb_cls = NULL; 341 h->cb_cls = NULL;
342} 342}
343 343
344
344/* End of testbed_logger_api.c */ 345/* End of testbed_logger_api.c */
diff --git a/src/testbed/gnunet-daemon-latency-logger.c b/src/testbed/gnunet-daemon-latency-logger.c
index c35282048..be6efaedf 100644
--- a/src/testbed/gnunet-daemon-latency-logger.c
+++ b/src/testbed/gnunet-daemon-latency-logger.c
@@ -150,6 +150,7 @@ do_shutdown (void *cls)
150 } 150 }
151} 151}
152 152
153
153/** 154/**
154 * Signature of a function that is called with QoS information about an address. 155 * Signature of a function that is called with QoS information about an address.
155 * 156 *
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index f7d089d93..4c1637db6 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -616,4 +616,5 @@ main (int argc, char **argv)
616 return (GNUNET_OK == status) ? 0 : 1; 616 return (GNUNET_OK == status) ? 0 : 1;
617} 617}
618 618
619
619/* end of gnunet-helper-testbed.c */ 620/* end of gnunet-helper-testbed.c */
diff --git a/src/testbed/gnunet-service-test-barriers.c b/src/testbed/gnunet-service-test-barriers.c
index b28f343a1..c6c42cd1f 100644
--- a/src/testbed/gnunet-service-test-barriers.c
+++ b/src/testbed/gnunet-service-test-barriers.c
@@ -130,7 +130,6 @@ run (void *cls,
130} 130}
131 131
132 132
133
134/** 133/**
135 * Main 134 * Main
136 */ 135 */
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c
index b34550339..21a9d0a51 100644
--- a/src/testbed/gnunet-service-testbed.c
+++ b/src/testbed/gnunet-service-testbed.c
@@ -836,8 +836,7 @@ client_disconnect_cb (void *cls,
836 * from stdin, but if stdin fails for some reason, this shouldn't 836 * from stdin, but if stdin fails for some reason, this shouldn't
837 * hurt for now --- might need to revise this later if we ever 837 * hurt for now --- might need to revise this later if we ever
838 * decide that master connections might be temporarily down 838 * decide that master connections might be temporarily down
839 * for some reason */ 839 * for some reason */// GNUNET_SCHEDULER_shutdown ();
840 // GNUNET_SCHEDULER_shutdown ();
841 } 840 }
842} 841}
843 842
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h
index 032dd54ed..03955327c 100644
--- a/src/testbed/gnunet-service-testbed.h
+++ b/src/testbed/gnunet-service-testbed.h
@@ -757,8 +757,6 @@ handle_manage_peer_service (void *cls,
757 GNUNET_TESTBED_ManagePeerServiceMessage *msg); 757 GNUNET_TESTBED_ManagePeerServiceMessage *msg);
758 758
759 759
760
761
762/** 760/**
763 * Check #GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER type messages. 761 * Check #GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER type messages.
764 * 762 *
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c
index 7ea1df662..ac89abc88 100644
--- a/src/testbed/gnunet-service-testbed_barriers.c
+++ b/src/testbed/gnunet-service-testbed_barriers.c
@@ -616,7 +616,6 @@ fwd_tout_barrier_init (void *cls)
616} 616}
617 617
618 618
619
620/** 619/**
621 * Check #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT messages. 620 * Check #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT messages.
622 * 621 *
@@ -923,4 +922,5 @@ handle_barrier_status (void *cls,
923 } 922 }
924} 923}
925 924
925
926/* end of gnunet-service-testbed_barriers.c */ 926/* end of gnunet-service-testbed_barriers.c */
diff --git a/src/testbed/gnunet-service-testbed_cache.c b/src/testbed/gnunet-service-testbed_cache.c
index 4afa06645..f87f39067 100644
--- a/src/testbed/gnunet-service-testbed_cache.c
+++ b/src/testbed/gnunet-service-testbed_cache.c
@@ -265,4 +265,5 @@ GST_cache_add_hello (const unsigned int peer_id,
265 entry->hello = GNUNET_copy_message (hello); 265 entry->hello = GNUNET_copy_message (hello);
266} 266}
267 267
268
268/* end of gnunet-service-testbed_hc.c */ 269/* end of gnunet-service-testbed_hc.c */
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c
index ae6450176..f38b9aee6 100644
--- a/src/testbed/gnunet-service-testbed_cpustatus.c
+++ b/src/testbed/gnunet-service-testbed_cpustatus.c
@@ -118,6 +118,8 @@ initMachCpuStats ()
118 (vm_size_t) (cpu_msg_count * sizeof(*cpu_load))); 118 (vm_size_t) (cpu_msg_count * sizeof(*cpu_load)));
119 return GNUNET_OK; 119 return GNUNET_OK;
120} 120}
121
122
121#endif 123#endif
122 124
123/** 125/**
@@ -464,6 +466,7 @@ updateAgedLoad ()
464 } 466 }
465} 467}
466 468
469
467/** 470/**
468 * Get the load of the CPU relative to what is allowed. 471 * Get the load of the CPU relative to what is allowed.
469 * @return the CPU load as a percentage of allowed 472 * @return the CPU load as a percentage of allowed
@@ -489,6 +492,7 @@ disk_get_load ()
489 return (int) agedIOLoad; 492 return (int) agedIOLoad;
490} 493}
491 494
495
492/** 496/**
493 * Get the percentage of memory used 497 * Get the percentage of memory used
494 * 498 *
@@ -531,6 +535,8 @@ get_nproc ()
531 closedir (dir); 535 closedir (dir);
532 return nproc; 536 return nproc;
533} 537}
538
539
534#endif 540#endif
535 541
536 542
@@ -654,4 +660,5 @@ GST_stats_destroy ()
654 bw = NULL; 660 bw = NULL;
655} 661}
656 662
663
657/* end of cpustatus.c */ 664/* end of cpustatus.c */
diff --git a/src/testbed/gnunet-service-testbed_meminfo.c b/src/testbed/gnunet-service-testbed_meminfo.c
index 5afce288b..1a513db6c 100644
--- a/src/testbed/gnunet-service-testbed_meminfo.c
+++ b/src/testbed/gnunet-service-testbed_meminfo.c
@@ -102,13 +102,15 @@ typedef struct mem_table_struct
102 unsigned long *slot; /* slot in return struct */ 102 unsigned long *slot; /* slot in return struct */
103} mem_table_struct; 103} mem_table_struct;
104 104
105static int compare_mem_table_structs (const void *a, const void *b) 105static int
106compare_mem_table_structs (const void *a, const void *b)
106{ 107{
107 return strcmp (((const mem_table_struct*) a)->name, ((const 108 return strcmp (((const mem_table_struct*) a)->name, ((const
108 mem_table_struct*) b)-> 109 mem_table_struct*) b)->
109 name); 110 name);
110} 111}
111 112
113
112/* example data, following junk, with comments added: 114/* example data, following junk, with comments added:
113 * 115 *
114 * MemTotal: 61768 kB old 116 * MemTotal: 61768 kB old
@@ -186,7 +188,8 @@ static unsigned long kb_nfs_unstable;
186static unsigned long kb_swap_reclaimable; 188static unsigned long kb_swap_reclaimable;
187static unsigned long kb_swap_unreclaimable; 189static unsigned long kb_swap_unreclaimable;
188 190
189void meminfo (void) 191void
192meminfo (void)
190{ 193{
191 char namebuf[16]; /* big enough to hold any row name */ 194 char namebuf[16]; /* big enough to hold any row name */
192 mem_table_struct findme = { namebuf, NULL }; 195 mem_table_struct findme = { namebuf, NULL };
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c
index 817a8b2fc..262fcfc00 100644
--- a/src/testbed/gnunet-service-testbed_oc.c
+++ b/src/testbed/gnunet-service-testbed_oc.c
@@ -515,6 +515,7 @@ cleanup_occ_rp2c (struct RemotePeer2Context *rp2c)
515 } 515 }
516} 516}
517 517
518
518/** 519/**
519 * Condition for checking if given peer is ready to be destroyed 520 * Condition for checking if given peer is ready to be destroyed
520 * 521 *
@@ -645,8 +646,6 @@ GST_notify_client_disconnect_oc (struct GNUNET_SERVICE_Client *client)
645} 646}
646 647
647 648
648
649
650/** 649/**
651 * FIXME. 650 * FIXME.
652 */ 651 */
diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c
index 836f05464..d3d597d4f 100644
--- a/src/testbed/gnunet-service-testbed_peers.c
+++ b/src/testbed/gnunet-service-testbed_peers.c
@@ -148,7 +148,6 @@ static struct PeerReconfigureContext *prc_head;
148static struct PeerReconfigureContext *prc_tail; 148static struct PeerReconfigureContext *prc_tail;
149 149
150 150
151
152/** 151/**
153 * DLL head for queue of manage service requests 152 * DLL head for queue of manage service requests
154 */ 153 */
diff --git a/src/testbed/test_gnunet_helper_testbed.c b/src/testbed/test_gnunet_helper_testbed.c
index caf33c71b..7c4d4bad5 100644
--- a/src/testbed/test_gnunet_helper_testbed.c
+++ b/src/testbed/test_gnunet_helper_testbed.c
@@ -251,4 +251,5 @@ main (int argc, char **argv)
251 return (GNUNET_OK == result) ? 0 : 1; 251 return (GNUNET_OK == result) ? 0 : 1;
252} 252}
253 253
254
254/* end of test_gnunet_helper_testbed.c */ 255/* end of test_gnunet_helper_testbed.c */
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c
index ad71aa35e..dd270df17 100644
--- a/src/testbed/test_testbed_api.c
+++ b/src/testbed/test_testbed_api.c
@@ -262,7 +262,6 @@ service_connect_comp_cb (void *cls,
262} 262}
263 263
264 264
265
266/** 265/**
267 * Callback to be called when the requested peer information is available 266 * Callback to be called when the requested peer information is available
268 * 267 *
@@ -460,7 +459,6 @@ status_cb (void *cls,
460} 459}
461 460
462 461
463
464/** 462/**
465 * Main run function. 463 * Main run function.
466 * 464 *
@@ -513,4 +511,5 @@ main (int argc, char **argv)
513 return 0; 511 return 0;
514} 512}
515 513
514
516/* end of test_testbed_api.c */ 515/* end of test_testbed_api.c */
diff --git a/src/testbed/test_testbed_api_2peers_1controller.c b/src/testbed/test_testbed_api_2peers_1controller.c
index de56ec88a..c854d1ccc 100644
--- a/src/testbed/test_testbed_api_2peers_1controller.c
+++ b/src/testbed/test_testbed_api_2peers_1controller.c
@@ -487,7 +487,6 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg_, int
487} 487}
488 488
489 489
490
491/** 490/**
492 * Main run function. 491 * Main run function.
493 * 492 *
@@ -537,4 +536,5 @@ main (int argc, char **argv)
537 return 0; 536 return 0;
538} 537}
539 538
539
540/* end of test_testbed_api_2peers_1controller.c */ 540/* end of test_testbed_api_2peers_1controller.c */
diff --git a/src/testbed/test_testbed_api_3peers_3controllers.c b/src/testbed/test_testbed_api_3peers_3controllers.c
index 1de635fd9..bf9011941 100644
--- a/src/testbed/test_testbed_api_3peers_3controllers.c
+++ b/src/testbed/test_testbed_api_3peers_3controllers.c
@@ -960,4 +960,5 @@ main (int argc, char **argv)
960 } 960 }
961} 961}
962 962
963
963/* end of test_testbed_api_3peers_3controllers.c */ 964/* end of test_testbed_api_3peers_3controllers.c */
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c
index 55ec184ea..16a3f7b91 100644
--- a/src/testbed/test_testbed_api_controllerlink.c
+++ b/src/testbed/test_testbed_api_controllerlink.c
@@ -725,6 +725,7 @@ registration_cont (void *cls, const char *emsg)
725 } 725 }
726} 726}
727 727
728
728/** 729/**
729 * Callback to signal successfull startup of the controller process 730 * Callback to signal successfull startup of the controller process
730 * 731 *
@@ -876,4 +877,5 @@ main (int argc, char **argv)
876 } 877 }
877} 878}
878 879
880
879/* end of test_testbed_api_controllerlink.c */ 881/* end of test_testbed_api_controllerlink.c */
diff --git a/src/testbed/test_testbed_api_hosts.c b/src/testbed/test_testbed_api_hosts.c
index 9c2a96fb7..9e49debf7 100644
--- a/src/testbed/test_testbed_api_hosts.c
+++ b/src/testbed/test_testbed_api_hosts.c
@@ -179,4 +179,5 @@ main (int argc, char **argv)
179 return (GNUNET_OK == status) ? 0 : 1; 179 return (GNUNET_OK == status) ? 0 : 1;
180} 180}
181 181
182
182/* end of test_testbed_api_hosts.c */ 183/* end of test_testbed_api_hosts.c */
diff --git a/src/testbed/test_testbed_api_operations.c b/src/testbed/test_testbed_api_operations.c
index 832a42576..aed213d49 100644
--- a/src/testbed/test_testbed_api_operations.c
+++ b/src/testbed/test_testbed_api_operations.c
@@ -564,4 +564,5 @@ main (int argc, char **argv)
564 return 0; 564 return 0;
565} 565}
566 566
567
567/* end of test_testbed_api_operations.c */ 568/* end of test_testbed_api_operations.c */
diff --git a/src/testbed/test_testbed_api_sd.c b/src/testbed/test_testbed_api_sd.c
index f7c60ea4d..816f8e9a6 100644
--- a/src/testbed/test_testbed_api_sd.c
+++ b/src/testbed/test_testbed_api_sd.c
@@ -107,4 +107,5 @@ main (int argc, char **argv)
107 return ret; 107 return ret;
108} 108}
109 109
110
110/* end of test_testbed_api_sd.c */ 111/* end of test_testbed_api_sd.c */
diff --git a/src/testbed/test_testbed_api_test.c b/src/testbed/test_testbed_api_test.c
index f0d8d1d25..d3fec78d9 100644
--- a/src/testbed/test_testbed_api_test.c
+++ b/src/testbed/test_testbed_api_test.c
@@ -82,6 +82,7 @@ do_shutdown (void *cls)
82 GNUNET_SCHEDULER_shutdown (); 82 GNUNET_SCHEDULER_shutdown ();
83} 83}
84 84
85
85/** 86/**
86 * shortcut to exit during failure 87 * shortcut to exit during failure
87 */ 88 */
@@ -246,4 +247,5 @@ main (int argc, char **argv)
246 return 0; 247 return 0;
247} 248}
248 249
250
249/* end of test_testbed_api_test.c */ 251/* end of test_testbed_api_test.c */
diff --git a/src/testbed/test_testbed_api_test_timeout.c b/src/testbed/test_testbed_api_test_timeout.c
index 65cda0b33..d2f73df14 100644
--- a/src/testbed/test_testbed_api_test_timeout.c
+++ b/src/testbed/test_testbed_api_test_timeout.c
@@ -122,4 +122,5 @@ main (int argc, char **argv)
122 return 0; 122 return 0;
123} 123}
124 124
125
125/* end of test_testbed_api_test.c */ 126/* end of test_testbed_api_test.c */
diff --git a/src/testbed/test_testbed_api_testbed_run.c b/src/testbed/test_testbed_api_testbed_run.c
index 66f857222..fda5c3223 100644
--- a/src/testbed/test_testbed_api_testbed_run.c
+++ b/src/testbed/test_testbed_api_testbed_run.c
@@ -238,4 +238,5 @@ main (int argc, char **argv)
238 return 0; 238 return 0;
239} 239}
240 240
241
241/* end of test_testbed_api_testbed_run.c */ 242/* end of test_testbed_api_testbed_run.c */
diff --git a/src/testbed/test_testbed_api_topology.c b/src/testbed/test_testbed_api_topology.c
index 1fa13bf4f..dada7286f 100644
--- a/src/testbed/test_testbed_api_topology.c
+++ b/src/testbed/test_testbed_api_topology.c
@@ -76,6 +76,7 @@ do_shutdown (void *cls)
76 GNUNET_SCHEDULER_shutdown (); 76 GNUNET_SCHEDULER_shutdown ();
77} 77}
78 78
79
79/** 80/**
80 * Controller event callback 81 * Controller event callback
81 * 82 *
@@ -184,4 +185,5 @@ main (int argc, char **argv)
184 return 0; 185 return 0;
185} 186}
186 187
188
187/* end of test_testbed_api_topology.c */ 189/* end of test_testbed_api_topology.c */
diff --git a/src/testbed/test_testbed_api_topology_clique.c b/src/testbed/test_testbed_api_topology_clique.c
index 33569a2b9..33c21a69c 100644
--- a/src/testbed/test_testbed_api_topology_clique.c
+++ b/src/testbed/test_testbed_api_topology_clique.c
@@ -76,6 +76,7 @@ do_shutdown (void *cls)
76 GNUNET_SCHEDULER_shutdown (); 76 GNUNET_SCHEDULER_shutdown ();
77} 77}
78 78
79
79/** 80/**
80 * Controller event callback 81 * Controller event callback
81 * 82 *
@@ -180,4 +181,5 @@ main (int argc, char **argv)
180 return 0; 181 return 0;
181} 182}
182 183
184
183/* end of test_testbed_api_topology.c */ 185/* end of test_testbed_api_topology.c */
diff --git a/src/testbed/test_testbed_underlay.c b/src/testbed/test_testbed_underlay.c
index e0434379b..8b706ff83 100644
--- a/src/testbed/test_testbed_underlay.c
+++ b/src/testbed/test_testbed_underlay.c
@@ -86,7 +86,6 @@ overlay_connect_status (void *cls,
86} 86}
87 87
88 88
89
90/** 89/**
91 * Signature of a main function for a testcase. 90 * Signature of a main function for a testcase.
92 * 91 *
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c
index 38913509b..9fe5bccdc 100644
--- a/src/testbed/testbed_api.c
+++ b/src/testbed/testbed_api.c
@@ -1320,8 +1320,7 @@ cleanup:
1320 * required at the chained testbed controller setup to ensure the only the 1320 * required at the chained testbed controller setup to ensure the only the
1321 * test-driver echos the status and the controller hierarchy properly 1321 * test-driver echos the status and the controller hierarchy properly
1322 * propagates the status. 1322 * propagates the status.
1323 */ 1323 */if ((NULL != barrier) && (GNUNET_YES == barrier->echo))
1324 if ((NULL != barrier) && (GNUNET_YES == barrier->echo))
1325 GNUNET_TESTBED_barrier_remove_ (barrier); 1324 GNUNET_TESTBED_barrier_remove_ (barrier);
1326} 1325}
1327 1326
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h
index 023d772a0..17cd38df3 100644
--- a/src/testbed/testbed_api.h
+++ b/src/testbed/testbed_api.h
@@ -105,7 +105,6 @@ enum OperationType
105}; 105};
106 106
107 107
108
109/** 108/**
110 * Enumeration of states of OperationContext 109 * Enumeration of states of OperationContext
111 */ 110 */
@@ -309,7 +308,6 @@ struct GNUNET_TESTBED_Barrier
309}; 308};
310 309
311 310
312
313/** 311/**
314 * Queues a message in send queue for sending to the service 312 * Queues a message in send queue for sending to the service
315 * 313 *
@@ -484,7 +482,6 @@ GNUNET_TESTBED_get_slave_config_ (void *op_cls,
484 uint32_t slave_host_id); 482 uint32_t slave_host_id);
485 483
486 484
487
488/** 485/**
489 * Initialise a barrier and call the given callback when the required percentage 486 * Initialise a barrier and call the given callback when the required percentage
490 * of peers (quorum) reach the barrier OR upon error. 487 * of peers (quorum) reach the barrier OR upon error.
@@ -520,6 +517,5 @@ void
520GNUNET_TESTBED_barrier_remove_ (struct GNUNET_TESTBED_Barrier *barrier); 517GNUNET_TESTBED_barrier_remove_ (struct GNUNET_TESTBED_Barrier *barrier);
521 518
522 519
523
524#endif 520#endif
525/* end of testbed_api.h */ 521/* end of testbed_api.h */
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c
index 988fa7a1e..61578c1e6 100644
--- a/src/testbed/testbed_api_barriers.c
+++ b/src/testbed/testbed_api_barriers.c
@@ -72,7 +72,6 @@ struct GNUNET_TESTBED_BarrierWaitHandle
72}; 72};
73 73
74 74
75
76/** 75/**
77 * Check if barrier status message is well-formed. 76 * Check if barrier status message is well-formed.
78 * 77 *
@@ -261,4 +260,5 @@ GNUNET_TESTBED_barrier_wait_cancel (struct GNUNET_TESTBED_BarrierWaitHandle *h)
261 GNUNET_free (h); 260 GNUNET_free (h);
262} 261}
263 262
263
264/* end of testbed_api_barriers.c */ 264/* end of testbed_api_barriers.c */
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index fdff952a0..95463e44d 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1570,4 +1570,5 @@ GNUNET_TESTBED_host_resolve_ (struct GNUNET_TESTBED_Host *host)
1570 host->hostname = GNUNET_strdup (host->hostname); 1570 host->hostname = GNUNET_strdup (host->hostname);
1571} 1571}
1572 1572
1573
1573/* end of testbed_api_hosts.c */ 1574/* end of testbed_api_hosts.c */
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c
index 185f62aa8..a406c0e0b 100644
--- a/src/testbed/testbed_api_operations.c
+++ b/src/testbed/testbed_api_operations.c
@@ -746,7 +746,6 @@ merge_ops (struct GNUNET_TESTBED_Operation ***old,
746} 746}
747 747
748 748
749
750/** 749/**
751 * Checks for the readiness of an operation and schedules a operation start task 750 * Checks for the readiness of an operation and schedules a operation start task
752 * 751 *
@@ -1383,4 +1382,6 @@ GNUNET_TESTBED_operations_fini ()
1383 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1382 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1384 "Be disciplined. Some operations were not marked as done.\n"); 1383 "Be disciplined. Some operations were not marked as done.\n");
1385} 1384}
1385
1386
1386/* end of testbed_api_operations.c */ 1387/* end of testbed_api_operations.c */
diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c
index 8d74d956f..7bd895871 100644
--- a/src/testbed/testbed_api_peers.c
+++ b/src/testbed/testbed_api_peers.c
@@ -85,7 +85,6 @@ GNUNET_TESTBED_cleanup_peers_ (void)
85} 85}
86 86
87 87
88
89/** 88/**
90 * Function to call to start a peer_create type operation once all 89 * Function to call to start a peer_create type operation once all
91 * queues the operation is part of declare that the 90 * queues the operation is part of declare that the
@@ -1014,5 +1013,4 @@ GNUNET_TESTBED_peer_manage_service (void *op_cls,
1014} 1013}
1015 1014
1016 1015
1017
1018/* end of testbed_api_peers.c */ 1016/* end of testbed_api_peers.c */
diff --git a/src/testbed/testbed_api_sd.c b/src/testbed/testbed_api_sd.c
index 9a40464d7..59c7a3ebd 100644
--- a/src/testbed/testbed_api_sd.c
+++ b/src/testbed/testbed_api_sd.c
@@ -209,4 +209,5 @@ GNUNET_TESTBED_SD_deviation_factor_ (struct SDHandle *h, unsigned int amount,
209 return GNUNET_OK; 209 return GNUNET_OK;
210} 210}
211 211
212
212/* end of testbed_api_sd.c */ 213/* end of testbed_api_sd.c */
diff --git a/src/testbed/testbed_api_services.c b/src/testbed/testbed_api_services.c
index 692fe505f..2c9a90fd4 100644
--- a/src/testbed/testbed_api_services.c
+++ b/src/testbed/testbed_api_services.c
@@ -287,4 +287,5 @@ GNUNET_TESTBED_service_connect (void *op_cls, struct GNUNET_TESTBED_Peer *peer,
287 return data->operation; 287 return data->operation;
288} 288}
289 289
290
290/* end of testbed_api_services.c */ 291/* end of testbed_api_services.c */
diff --git a/src/testbed/testbed_api_test.c b/src/testbed/testbed_api_test.c
index 5b57826ba..6179a23ef 100644
--- a/src/testbed/testbed_api_test.c
+++ b/src/testbed/testbed_api_test.c
@@ -159,4 +159,5 @@ GNUNET_TESTBED_test_run (const char *testname,
159 return ret; 159 return ret;
160} 160}
161 161
162
162/* end of testbed_api_test.c */ 163/* end of testbed_api_test.c */
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c
index 3c56dd024..7be8054ca 100644
--- a/src/testbed/testbed_api_testbed.c
+++ b/src/testbed/testbed_api_testbed.c
@@ -446,6 +446,7 @@ remove_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct
446 rcop)); 446 rcop));
447} 447}
448 448
449
449/** 450/**
450 * Assuming all peers have been destroyed cleanup run handle 451 * Assuming all peers have been destroyed cleanup run handle
451 * 452 *
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c
index 191dbab66..9ffe7f47d 100644
--- a/src/testbed/testbed_api_topology.c
+++ b/src/testbed/testbed_api_topology.c
@@ -407,7 +407,6 @@ overlay_link_completed (void *cls,
407} 407}
408 408
409 409
410
411/** 410/**
412 * Function called when a overlay connect operation is ready 411 * Function called when a overlay connect operation is ready
413 * 412 *
@@ -1658,4 +1657,5 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers,
1658 return ret; 1657 return ret;
1659} 1658}
1660 1659
1660
1661/* end of testbed_api_topology.c */ 1661/* end of testbed_api_topology.c */
diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c
index a13a32f77..b850d6b13 100644
--- a/src/testing/gnunet-testing.c
+++ b/src/testing/gnunet-testing.c
@@ -440,4 +440,5 @@ main (int argc, char *const *argv)
440 return ret; 440 return ret;
441} 441}
442 442
443
443/* end of gnunet-testing.c */ 444/* end of gnunet-testing.c */
diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c
index cfc79e618..4e21fedc9 100644
--- a/src/testing/test_testing_peerstartup.c
+++ b/src/testing/test_testing_peerstartup.c
@@ -122,7 +122,8 @@ end:
122} 122}
123 123
124 124
125int main (int argc, char *argv[]) 125int
126main (int argc, char *argv[])
126{ 127{
127 struct GNUNET_GETOPT_CommandLineOption options[] = { 128 struct GNUNET_GETOPT_CommandLineOption options[] = {
128 GNUNET_GETOPT_OPTION_END 129 GNUNET_GETOPT_OPTION_END
@@ -138,4 +139,5 @@ int main (int argc, char *argv[])
138 return (GNUNET_OK == status) ? 0 : 1; 139 return (GNUNET_OK == status) ? 0 : 1;
139} 140}
140 141
142
141/* end of test_testing_peerstartup.c */ 143/* end of test_testing_peerstartup.c */
diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c
index 316a55951..26948b7c5 100644
--- a/src/testing/test_testing_peerstartup2.c
+++ b/src/testing/test_testing_peerstartup2.c
@@ -201,7 +201,8 @@ end:
201} 201}
202 202
203 203
204int main (int argc, char *argv[]) 204int
205main (int argc, char *argv[])
205{ 206{
206 struct GNUNET_GETOPT_CommandLineOption options[] = { 207 struct GNUNET_GETOPT_CommandLineOption options[] = {
207 GNUNET_GETOPT_OPTION_END 208 GNUNET_GETOPT_OPTION_END
@@ -217,4 +218,5 @@ int main (int argc, char *argv[])
217 return (GNUNET_OK == status) ? 0 : 1; 218 return (GNUNET_OK == status) ? 0 : 1;
218} 219}
219 220
221
220/* end of test_testing_peerstartup.c */ 222/* end of test_testing_peerstartup.c */
diff --git a/src/testing/test_testing_portreservation.c b/src/testing/test_testing_portreservation.c
index d810ad8cf..df3d8d523 100644
--- a/src/testing/test_testing_portreservation.c
+++ b/src/testing/test_testing_portreservation.c
@@ -80,7 +80,8 @@ end:
80} 80}
81 81
82 82
83int main (int argc, char *argv[]) 83int
84main (int argc, char *argv[])
84{ 85{
85 struct GNUNET_GETOPT_CommandLineOption options[] = { 86 struct GNUNET_GETOPT_CommandLineOption options[] = {
86 GNUNET_GETOPT_OPTION_END 87 GNUNET_GETOPT_OPTION_END
@@ -100,4 +101,5 @@ int main (int argc, char *argv[])
100 return (GNUNET_OK == status) ? 0 : 1; 101 return (GNUNET_OK == status) ? 0 : 1;
101} 102}
102 103
104
103/* end of test_testing_portreservation.c */ 105/* end of test_testing_portreservation.c */
diff --git a/src/testing/test_testing_servicestartup.c b/src/testing/test_testing_servicestartup.c
index d25c16167..83458898b 100644
--- a/src/testing/test_testing_servicestartup.c
+++ b/src/testing/test_testing_servicestartup.c
@@ -59,7 +59,8 @@ test_run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg,
59/** 59/**
60 * The main point of execution 60 * The main point of execution
61 */ 61 */
62int main (int argc, char *argv[]) 62int
63main (int argc, char *argv[])
63{ 64{
64 test_success = GNUNET_NO; 65 test_success = GNUNET_NO;
65 GNUNET_assert (0 == GNUNET_TESTING_service_run ("test-testing-servicestartup", 66 GNUNET_assert (0 == GNUNET_TESTING_service_run ("test-testing-servicestartup",
@@ -70,4 +71,5 @@ int main (int argc, char *argv[])
70 return (GNUNET_YES == test_success) ? 0 : 1; 71 return (GNUNET_YES == test_success) ? 0 : 1;
71} 72}
72 73
74
73/* end of test_testing_servicestartup.c */ 75/* end of test_testing_servicestartup.c */
diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c
index 13219bf5d..77def3453 100644
--- a/src/testing/test_testing_sharedservices.c
+++ b/src/testing/test_testing_sharedservices.c
@@ -143,7 +143,8 @@ end:
143} 143}
144 144
145 145
146int main (int argc, char *argv[]) 146int
147main (int argc, char *argv[])
147{ 148{
148 struct GNUNET_GETOPT_CommandLineOption options[] = { 149 struct GNUNET_GETOPT_CommandLineOption options[] = {
149 GNUNET_GETOPT_OPTION_END 150 GNUNET_GETOPT_OPTION_END
@@ -162,4 +163,5 @@ int main (int argc, char *argv[])
162 return (GNUNET_OK == status) ? 0 : 3; 163 return (GNUNET_OK == status) ? 0 : 3;
163} 164}
164 165
166
165/* end of test_testing_sharedservices.c */ 167/* end of test_testing_sharedservices.c */
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 362a24af5..3e447e1ff 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -595,8 +595,7 @@ GNUNET_TESTING_reserve_port (struct GNUNET_TESTING_System *system)
595 address families are considered open. 595 address families are considered open.
596 On system with either IPv4 or IPv6. A port is considered open if it's 596 On system with either IPv4 or IPv6. A port is considered open if it's
597 open in the respective address family 597 open in the respective address family
598 */ 598 */hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */
599 hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */
600 hint.ai_socktype = 0; 599 hint.ai_socktype = 0;
601 hint.ai_protocol = 0; 600 hint.ai_protocol = 0;
602 hint.ai_addrlen = 0; 601 hint.ai_addrlen = 0;
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 9e662ca0b..1b6004392 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -388,8 +388,7 @@ setup_filter (struct Peer *peer)
388 * of the data structure and would only really become 388 * of the data structure and would only really become
389 * "useless" once a HELLO has been passed on to ~100 389 * "useless" once a HELLO has been passed on to ~100
390 * other peers, which is likely more than enough in 390 * other peers, which is likely more than enough in
391 * any case; hence 64, 5 as bloomfilter parameters. */ 391 * any case; hence 64, 5 as bloomfilter parameters. */peer->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, 64, 5);
392 peer->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, 64, 5);
393 peer->filter_expiration = 392 peer->filter_expiration =
394 GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_REPEAT_FREQUENCY); 393 GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_REPEAT_FREQUENCY);
395 /* never send a peer its own HELLO */ 394 /* never send a peer its own HELLO */
@@ -1142,12 +1141,15 @@ main (int argc, char *const *argv)
1142/** 1141/**
1143 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1142 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1144 */ 1143 */
1145void __attribute__ ((constructor)) GNUNET_ARM_memory_init () 1144void __attribute__ ((constructor))
1145GNUNET_ARM_memory_init ()
1146{ 1146{
1147 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1147 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1148 mallopt (M_TOP_PAD, 1 * 1024); 1148 mallopt (M_TOP_PAD, 1 * 1024);
1149 malloc_trim (0); 1149 malloc_trim (0);
1150} 1150}
1151
1152
1151#endif 1153#endif
1152 1154
1153/* end of gnunet-daemon-topology.c */ 1155/* end of gnunet-daemon-topology.c */
diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c
index f6d0e2c2b..a7dace383 100644
--- a/src/topology/test_gnunet_daemon_topology.c
+++ b/src/topology/test_gnunet_daemon_topology.c
@@ -98,6 +98,7 @@ shutdown_task (void *cls)
98 GNUNET_SCHEDULER_cancel (timeout_tid); 98 GNUNET_SCHEDULER_cancel (timeout_tid);
99} 99}
100 100
101
101static void 102static void
102timeout_task (void *cls) 103timeout_task (void *cls)
103{ 104{
@@ -109,6 +110,7 @@ timeout_task (void *cls)
109 GNUNET_SCHEDULER_shutdown (); 110 GNUNET_SCHEDULER_shutdown ();
110} 111}
111 112
113
112/* 114/*
113 * The function is called every time the topology of connected 115 * The function is called every time the topology of connected
114 * peers to a peer changes. 116 * peers to a peer changes.
@@ -131,7 +133,7 @@ statistics_iterator (void *cls,
131 if (p_ctx->connections < value) 133 if (p_ctx->connections < value)
132 p_ctx->connections = value; 134 p_ctx->connections = value;
133 135
134 if ((THRESHOLD <= value)&&(GNUNET_NO == p_ctx->reported)) 136 if ((THRESHOLD <= value) && (GNUNET_NO == p_ctx->reported))
135 { 137 {
136 p_ctx->reported = GNUNET_YES; 138 p_ctx->reported = GNUNET_YES;
137 checked_peers++; 139 checked_peers++;
@@ -153,6 +155,7 @@ statistics_iterator (void *cls,
153 return GNUNET_YES; 155 return GNUNET_YES;
154} 156}
155 157
158
156static void * 159static void *
157ca_statistics (void *cls, 160ca_statistics (void *cls,
158 const struct GNUNET_CONFIGURATION_Handle *cfg) 161 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -203,6 +206,7 @@ service_connect_complete (void *cls,
203 "call to GNUNET_STATISTICS_watch() failed\n"); 206 "call to GNUNET_STATISTICS_watch() failed\n");
204} 207}
205 208
209
206static void 210static void
207notify_connect_complete (void *cls, 211notify_connect_complete (void *cls,
208 struct GNUNET_TESTBED_Operation *op, 212 struct GNUNET_TESTBED_Operation *op,
@@ -219,6 +223,7 @@ notify_connect_complete (void *cls,
219 connect_left--; 223 connect_left--;
220} 224}
221 225
226
222static void 227static void
223do_connect (void *cls, 228do_connect (void *cls,
224 struct GNUNET_TESTBED_RunHandle *h, 229 struct GNUNET_TESTBED_RunHandle *h,
@@ -286,4 +291,5 @@ main (int argc, char *argv[])
286 return (GNUNET_OK != result) ? 1 : 0; 291 return (GNUNET_OK != result) ? 1 : 0;
287} 292}
288 293
294
289/* end of test_gnunet_daemon_topology.c */ 295/* end of test_gnunet_daemon_topology.c */
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c
index f3ccbd262..098bb9523 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -1052,8 +1052,7 @@ queue_read (void *cls)
1052 wrong key for everything after the rekey; in that case, we have 1052 wrong key for everything after the rekey; in that case, we have
1053 to re-do the decryption at 'total' instead of at 'max'. If there 1053 to re-do the decryption at 'total' instead of at 'max'. If there
1054 is no rekey and the last message is incomplete (max > total), 1054 is no rekey and the last message is incomplete (max > total),
1055 it is safe to keep the decryption so we shift by 'max' */ 1055 it is safe to keep the decryption so we shift by 'max' */if (GNUNET_YES == queue->rekeyed)
1056 if (GNUNET_YES == queue->rekeyed)
1057 { 1056 {
1058 max = total; 1057 max = total;
1059 queue->rekeyed = GNUNET_NO; 1058 queue->rekeyed = GNUNET_NO;
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c
index 2d9fabfec..80fc4142b 100644
--- a/src/transport/gnunet-communicator-udp.c
+++ b/src/transport/gnunet-communicator-udp.c
@@ -2526,8 +2526,7 @@ iface_proc (void *cls,
2526 * group in the normal IPv6 routing table and using the resulting 2526 * group in the normal IPv6 routing table and using the resulting
2527 * interface; we do this for each interface, so no need to use 2527 * interface; we do this for each interface, so no need to use
2528 * zero (anymore...). 2528 * zero (anymore...).
2529 */ 2529 */bi->mcreq.ipv6mr_interface = s6->sin6_scope_id;
2530 bi->mcreq.ipv6mr_interface = s6->sin6_scope_id;
2531 2530
2532 /* Join the multicast group */ 2531 /* Join the multicast group */
2533 if (GNUNET_OK != GNUNET_NETWORK_socket_setsockopt (udp_sock, 2532 if (GNUNET_OK != GNUNET_NETWORK_socket_setsockopt (udp_sock,
diff --git a/src/transport/gnunet-communicator-unix.c b/src/transport/gnunet-communicator-unix.c
index d8205addb..2cfb802e3 100644
--- a/src/transport/gnunet-communicator-unix.c
+++ b/src/transport/gnunet-communicator-unix.c
@@ -1111,12 +1111,15 @@ main (int argc, char *const *argv)
1111/** 1111/**
1112 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1112 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1113 */ 1113 */
1114void __attribute__ ((constructor)) GNUNET_ARM_memory_init () 1114void __attribute__ ((constructor))
1115GNUNET_ARM_memory_init ()
1115{ 1116{
1116 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1117 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1117 mallopt (M_TOP_PAD, 1 * 1024); 1118 mallopt (M_TOP_PAD, 1 * 1024);
1118 malloc_trim (0); 1119 malloc_trim (0);
1119} 1120}
1121
1122
1120#endif 1123#endif
1121 1124
1122/* end of gnunet-communicator-unix.c */ 1125/* end of gnunet-communicator-unix.c */
diff --git a/src/transport/gnunet-helper-transport-bluetooth.c b/src/transport/gnunet-helper-transport-bluetooth.c
index c0e0d9673..9b56d0922 100644
--- a/src/transport/gnunet-helper-transport-bluetooth.c
+++ b/src/transport/gnunet-helper-transport-bluetooth.c
@@ -446,6 +446,7 @@ do_align:
446 return ret; 446 return ret;
447} 447}
448 448
449
449/** 450/**
450 * Destroys a tokenizer. 451 * Destroys a tokenizer.
451 * 452 *
@@ -458,6 +459,7 @@ mst_destroy (struct MessageStreamTokenizer *mst)
458 free (mst); 459 free (mst);
459} 460}
460 461
462
461/** 463/**
462 * Calculate crc32, the start of the calculation 464 * Calculate crc32, the start of the calculation
463 * 465 *
@@ -558,14 +560,13 @@ check_crc_buf_osdep (const unsigned char *buf, size_t len)
558 560
559 crc = calc_crc_osdep (buf, len); 561 crc = calc_crc_osdep (buf, len);
560 buf += len; 562 buf += len;
561 if ((((crc) & 0xFF) == buf[0])&&(((crc >> 8) & 0xFF) == buf[1])&& 563 if ((((crc) & 0xFF) == buf[0]) && (((crc >> 8) & 0xFF) == buf[1]) &&
562 ( ((crc >> 16) & 0xFF) == buf[2]) &&( ((crc >> 24) & 0xFF) == buf[3]) ) 564 ( ((crc >> 16) & 0xFF) == buf[2]) && ( ((crc >> 24) & 0xFF) == buf[3]) )
563 return 0; 565 return 0;
564 return 1; 566 return 1;
565} 567}
566 568
567 569
568
569/* ************** end of clone ***************** */ 570/* ************** end of clone ***************** */
570#ifdef LINUX 571#ifdef LINUX
571/** 572/**
@@ -593,6 +594,8 @@ bind_socket (int socket, struct sockaddr_rc *addr)
593 594
594 return -1; 595 return -1;
595} 596}
597
598
596#endif 599#endif
597 600
598/** 601/**
@@ -613,8 +616,7 @@ register_service (struct HardwareInfos *dev, int rc_channel)
613 * 5. set the name, provider and description 616 * 5. set the name, provider and description
614 * 6. register the service record to the local SDP server 617 * 6. register the service record to the local SDP server
615 * 7. cleanup 618 * 7. cleanup
616 */ 619 */uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
617 uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
618 dev->pl_mac.mac[5], dev->pl_mac.mac[4], 620 dev->pl_mac.mac[5], dev->pl_mac.mac[4],
619 dev->pl_mac.mac[3], 621 dev->pl_mac.mac[3],
620 dev->pl_mac.mac[2], dev->pl_mac.mac[1], 622 dev->pl_mac.mac[2], dev->pl_mac.mac[1],
@@ -688,6 +690,7 @@ register_service (struct HardwareInfos *dev, int rc_channel)
688 return 0; 690 return 0;
689} 691}
690 692
693
691/** 694/**
692 * Function used for searching and browsing for a service. This will return the 695 * Function used for searching and browsing for a service. This will return the
693 * port number on which the service is running. 696 * port number on which the service is running.
@@ -706,8 +709,7 @@ get_channel (struct HardwareInfos *dev, bdaddr_t dest)
706 * 2.2. get a list of service records with the specific UUID 709 * 2.2. get a list of service records with the specific UUID
707 * 2.3. for each service record get a list of the protocol sequences and get 710 * 2.3. for each service record get a list of the protocol sequences and get
708 * the port number 711 * the port number
709 */ 712 */uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
710 uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
711 dest.b[5], dest.b[4], dest.b[3], 713 dest.b[5], dest.b[4], dest.b[3],
712 dest.b[2], dest.b[1], dest.b[0] }; 714 dest.b[2], dest.b[1], dest.b[0] };
713 sdp_session_t *session = 0; 715 sdp_session_t *session = 0;
@@ -763,6 +765,7 @@ get_channel (struct HardwareInfos *dev, bdaddr_t dest)
763 return channel; 765 return channel;
764} 766}
765 767
768
766/** 769/**
767 * Read from the socket and put the result into the buffer for transmission to 'stdout'. 770 * Read from the socket and put the result into the buffer for transmission to 'stdout'.
768 * 771 *
@@ -954,7 +957,6 @@ open_device (struct HardwareInfos *dev)
954 (void) close (fd_hci); 957 (void) close (fd_hci);
955 958
956 959
957
958 /* Bind the rfcomm socket to the interface */ 960 /* Bind the rfcomm socket to the interface */
959 memset (&rc_addr, 0, sizeof(rc_addr)); 961 memset (&rc_addr, 0, sizeof(rc_addr));
960 rc_addr.rc_family = AF_BLUETOOTH; 962 rc_addr.rc_family = AF_BLUETOOTH;
@@ -1010,6 +1012,7 @@ mac_set (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame *taIeeeHeader,
1010 taIeeeHeader->addr2 = dev->pl_mac; 1012 taIeeeHeader->addr2 = dev->pl_mac;
1011} 1013}
1012 1014
1015
1013#ifdef LINUX 1016#ifdef LINUX
1014/** 1017/**
1015 * Test if the given interface name really corresponds to a bluetooth 1018 * Test if the given interface name really corresponds to a bluetooth
@@ -1038,6 +1041,8 @@ test_bluetooth_interface (const char *iface)
1038 } 1041 }
1039 return 0; 1042 return 0;
1040} 1043}
1044
1045
1041#endif 1046#endif
1042 1047
1043/** 1048/**
@@ -1112,6 +1117,7 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
1112 write_pout.size = sendsize; 1117 write_pout.size = sendsize;
1113} 1118}
1114 1119
1120
1115#ifdef LINUX 1121#ifdef LINUX
1116/** 1122/**
1117 * Broadcast a HELLO message for peer discovery 1123 * Broadcast a HELLO message for peer discovery
@@ -1127,7 +1133,7 @@ send_broadcast (struct HardwareInfos *dev, int *sendsocket)
1127 int loops = 0; 1133 int loops = 0;
1128 1134
1129search_for_devices: 1135search_for_devices:
1130 if (((neighbours.size == neighbours.pos)&&(new_device == 1)) || 1136 if (((neighbours.size == neighbours.pos) && (new_device == 1)) ||
1131 (neighbours.size == 0) ) 1137 (neighbours.size == 0) )
1132 { 1138 {
1133inquiry_devices: // skip the conditions and force a inquiry for new devices 1139inquiry_devices: // skip the conditions and force a inquiry for new devices
@@ -1359,6 +1365,8 @@ inquiry_devices: // skip the conditions and force a inquiry for new devices
1359 1365
1360 return 0; 1366 return 0;
1361} 1367}
1368
1369
1362#endif 1370#endif
1363 1371
1364/** 1372/**
@@ -1606,9 +1614,9 @@ main (int argc, char *argv[])
1606connect_retry: 1614connect_retry:
1607 status = connect (sendsocket, (struct sockaddr *) &addr, 1615 status = connect (sendsocket, (struct sockaddr *) &addr,
1608 sizeof(addr)); 1616 sizeof(addr));
1609 if ((0 != status) &&(errno != EAGAIN) ) 1617 if ((0 != status) && (errno != EAGAIN) )
1610 { 1618 {
1611 if ((errno == ECONNREFUSED) &&(tries < 2) ) 1619 if ((errno == ECONNREFUSED) && (tries < 2) )
1612 { 1620 {
1613 fprintf (stderr, "LOG : %.*s failed to connect. Trying again!\n", 1621 fprintf (stderr, "LOG : %.*s failed to connect. Trying again!\n",
1614 IFNAMSIZ, dev.iface); 1622 IFNAMSIZ, dev.iface);
@@ -1668,7 +1676,7 @@ connect_retry:
1668 int retval = select (maxfd + 1, &rfds, &wfds, NULL, NULL); 1676 int retval = select (maxfd + 1, &rfds, &wfds, NULL, NULL);
1669 if ((-1 == retval) && (EINTR == errno)) 1677 if ((-1 == retval) && (EINTR == errno))
1670 continue; 1678 continue;
1671 if ((0 > retval) &&(errno != EBADF) ) // we handle BADF errors later 1679 if ((0 > retval) && (errno != EBADF) ) // we handle BADF errors later
1672 { 1680 {
1673 fprintf (stderr, "select failed: %s\n", strerror (errno)); 1681 fprintf (stderr, "select failed: %s\n", strerror (errno));
1674 break; 1682 break;
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c
index 7ad6c5175..68adadbe8 100644
--- a/src/transport/gnunet-helper-transport-wlan.c
+++ b/src/transport/gnunet-helper-transport-wlan.c
@@ -176,7 +176,6 @@
176#define MAXLINE 4096 176#define MAXLINE 4096
177 177
178 178
179
180/* ********* structure of messages of type ARPHRD_IEEE80211_PRISM *********** */ 179/* ********* structure of messages of type ARPHRD_IEEE80211_PRISM *********** */
181 180
182/** 181/**
@@ -465,7 +464,6 @@ enum RadiotapType
465#define IEEE80211_RADIOTAP_PRESENT_EXTEND_MASK (1 << IEEE80211_RADIOTAP_EXT) 464#define IEEE80211_RADIOTAP_PRESENT_EXTEND_MASK (1 << IEEE80211_RADIOTAP_EXT)
466 465
467 466
468
469/** 467/**
470 * Bit in IEEE80211_RADIOTAP_FLAGS (which we might get 468 * Bit in IEEE80211_RADIOTAP_FLAGS (which we might get
471 * as part of a 'struct Ieee80211RadiotapHeader' extension 469 * as part of a 'struct Ieee80211RadiotapHeader' extension
@@ -651,7 +649,6 @@ struct RadiotapTransmissionHeader
651 IEEE80211_RADIOTAP_TX_FLAGS)) 649 IEEE80211_RADIOTAP_TX_FLAGS))
652 650
653 651
654
655/** 652/**
656 * struct Ieee80211RadiotapHeaderIterator - tracks walk through present radiotap arguments 653 * struct Ieee80211RadiotapHeaderIterator - tracks walk through present radiotap arguments
657 * in the radiotap header. Used when we parse radiotap packets received from the kernel. 654 * in the radiotap header. Used when we parse radiotap packets received from the kernel.
@@ -770,7 +767,6 @@ static struct SendBuffer write_pout;
770static struct SendBuffer write_std; 767static struct SendBuffer write_std;
771 768
772 769
773
774/* *********** specialized version of server_mst.c begins here ********** */ 770/* *********** specialized version of server_mst.c begins here ********** */
775 771
776/** 772/**
@@ -1031,6 +1027,7 @@ mst_destroy (struct MessageStreamTokenizer *mst)
1031 free (mst); 1027 free (mst);
1032} 1028}
1033 1029
1030
1034/* ***************** end of server_mst.c clone ***************** **/ 1031/* ***************** end of server_mst.c clone ***************** **/
1035 1032
1036 1033
@@ -1091,8 +1088,7 @@ ieee80211_radiotap_iterator_init (struct
1091 * check for insanity where the present bitmaps 1088 * check for insanity where the present bitmaps
1092 * keep claiming to extend up to or even beyond the 1089 * keep claiming to extend up to or even beyond the
1093 * stated radiotap header length 1090 * stated radiotap header length
1094 */ 1091 */if (iterator->arg - ((uint8_t*) iterator->rtheader) >
1095 if (iterator->arg - ((uint8_t*) iterator->rtheader) >
1096 iterator->max_length) 1092 iterator->max_length)
1097 return -1; 1093 return -1;
1098 } 1094 }
@@ -1101,8 +1097,7 @@ ieee80211_radiotap_iterator_init (struct
1101 * no need to check again for blowing past stated radiotap 1097 * no need to check again for blowing past stated radiotap
1102 * header length, becuase ieee80211_radiotap_iterator_next 1098 * header length, becuase ieee80211_radiotap_iterator_next
1103 * checks it before it is dereferenced 1099 * checks it before it is dereferenced
1104 */ 1100 */}
1105 }
1106 /* we are all initialized happily */ 1101 /* we are all initialized happily */
1107 return 0; 1102 return 0;
1108} 1103}
@@ -1137,9 +1132,7 @@ ieee80211_radiotap_iterator_next (struct
1137 * 1132 *
1138 * upper nybble: content alignment for arg 1133 * upper nybble: content alignment for arg
1139 * lower nybble: content length for arg 1134 * lower nybble: content length for arg
1140 */ 1135 */static const uint8_t rt_sizes[] = {
1141
1142 static const uint8_t rt_sizes[] = {
1143 [IEEE80211_RADIOTAP_TSFT] = 0x88, 1136 [IEEE80211_RADIOTAP_TSFT] = 0x88,
1144 [IEEE80211_RADIOTAP_FLAGS] = 0x11, 1137 [IEEE80211_RADIOTAP_FLAGS] = 0x11,
1145 [IEEE80211_RADIOTAP_RATE] = 0x11, 1138 [IEEE80211_RADIOTAP_RATE] = 0x11,
@@ -1198,8 +1191,7 @@ ieee80211_radiotap_iterator_next (struct
1198 * radiotap header. There is no guarantee that the radiotap 1191 * radiotap header. There is no guarantee that the radiotap
1199 * header itself is aligned on any kind of boundary, thus we 1192 * header itself is aligned on any kind of boundary, thus we
1200 * need to really look at the delta here. 1193 * need to really look at the delta here.
1201 */ 1194 */wanted_alignment = rt_sizes[iterator->arg_index] >> 4;
1202 wanted_alignment = rt_sizes[iterator->arg_index] >> 4;
1203 unalignment = (((void *) iterator->arg) - ((void *) iterator->rtheader)) 1195 unalignment = (((void *) iterator->arg) - ((void *) iterator->rtheader))
1204 & (wanted_alignment - 1); 1196 & (wanted_alignment - 1);
1205 if (0 != unalignment) 1197 if (0 != unalignment)
@@ -1224,8 +1216,7 @@ ieee80211_radiotap_iterator_next (struct
1224 * claims to have more arg content than the length of the 1216 * claims to have more arg content than the length of the
1225 * radiotap section. We will normally end up equalling this 1217 * radiotap section. We will normally end up equalling this
1226 * max_length on the last arg, never exceeding it. 1218 * max_length on the last arg, never exceeding it.
1227 */ 1219 */if ((((void *) iterator->arg) - ((void *) iterator->rtheader)) >
1228 if ((((void *) iterator->arg) - ((void *) iterator->rtheader)) >
1229 iterator->max_length) 1220 iterator->max_length)
1230 return -1; 1221 return -1;
1231 } 1222 }
@@ -1365,8 +1356,8 @@ check_crc_buf_osdep (const unsigned char *buf, size_t len)
1365 1356
1366 crc = calc_crc_osdep (buf, len); 1357 crc = calc_crc_osdep (buf, len);
1367 buf += len; 1358 buf += len;
1368 if ((((crc) & 0xFF) == buf[0])&&(((crc >> 8) & 0xFF) == buf[1])&& 1359 if ((((crc) & 0xFF) == buf[0]) && (((crc >> 8) & 0xFF) == buf[1]) &&
1369 ( ((crc >> 16) & 0xFF) == buf[2]) &&( ((crc >> 24) & 0xFF) == buf[3]) ) 1360 ( ((crc >> 16) & 0xFF) == buf[2]) && ( ((crc >> 24) & 0xFF) == buf[3]) )
1370 return 0; 1361 return 0;
1371 return 1; 1362 return 1;
1372} 1363}
@@ -1386,11 +1377,11 @@ check_crc_buf_osdep (const unsigned char *buf, size_t len)
1386static int 1377static int
1387get_channel_from_frequency (int32_t frequency) 1378get_channel_from_frequency (int32_t frequency)
1388{ 1379{
1389 if ((frequency >= 2412)&&(frequency <= 2472)) 1380 if ((frequency >= 2412) && (frequency <= 2472))
1390 return (frequency - 2407) / 5; 1381 return (frequency - 2407) / 5;
1391 if (frequency == 2484) 1382 if (frequency == 2484)
1392 return 14; 1383 return 14;
1393 if ((frequency >= 5000)&&(frequency <= 6100)) 1384 if ((frequency >= 5000) && (frequency <= 6100))
1394 return (frequency - 5000) / 5; 1385 return (frequency - 5000) / 5;
1395 return -1; 1386 return -1;
1396} 1387}
@@ -2191,4 +2182,5 @@ main (int argc, char *argv[])
2191 return 1; /* we never exit 'normally' */ 2182 return 1; /* we never exit 'normally' */
2192} 2183}
2193 2184
2185
2194/* end of gnunet-helper-transport-wlan.c */ 2186/* end of gnunet-helper-transport-wlan.c */
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index 66a836b84..8d68d90a6 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -4734,8 +4734,7 @@ consider_sending_fc (void *cls)
4734 then. See vl->last_fc_rtt! NOTE: to do this properly, we also 4734 then. See vl->last_fc_rtt! NOTE: to do this properly, we also
4735 need an estimate for the bandwidth-delay-product for the entire 4735 need an estimate for the bandwidth-delay-product for the entire
4736 VL, as that determines "significantly". We have the delay, but 4736 VL, as that determines "significantly". We have the delay, but
4737 the bandwidth statistics need to be added for the VL!*/ 4737 the bandwidth statistics need to be added for the VL!*/(void) duration;
4738 (void) duration;
4739 4738
4740 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4739 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4741 "Sending FC seq %u to %s with new window %llu\n", 4740 "Sending FC seq %u to %s with new window %llu\n",
@@ -5218,8 +5217,7 @@ handle_raw_message (void *cls, const struct GNUNET_MessageHeader *mh)
5218 we pass this on, CORE would be confused (link down, messages 5217 we pass this on, CORE would be confused (link down, messages
5219 arrive). We should investigate more if this happens often, 5218 arrive). We should investigate more if this happens often,
5220 or in a persistent manner, and possibly do "something" about 5219 or in a persistent manner, and possibly do "something" about
5221 it. Thus logging as error for now. */ 5220 it. Thus logging as error for now. */GNUNET_break_op (0);
5222 GNUNET_break_op (0);
5223 GNUNET_STATISTICS_update (GST_stats, 5221 GNUNET_STATISTICS_update (GST_stats,
5224 "# CORE messages droped (virtual link still down)", 5222 "# CORE messages droped (virtual link still down)",
5225 1, 5223 1,
@@ -8643,8 +8641,7 @@ select_best_pending_from_link (struct PendingMessageScoreContext *sc,
8643 given message fits _this_ queue, and do not consider how well other 8641 given message fits _this_ queue, and do not consider how well other
8644 queues might suit the message. Taking other queues into consideration 8642 queues might suit the message. Taking other queues into consideration
8645 may further improve the result, but could also be expensive 8643 may further improve the result, but could also be expensive
8646 in terms of CPU time. */ 8644 in terms of CPU time. */long long sc_score = sc->frag * 40 + sc->relb * 20 + sc->real_overhead;
8647 long long sc_score = sc->frag * 40 + sc->relb * 20 + sc->real_overhead;
8648 long long pm_score = frag * 40 + relb * 20 + real_overhead; 8645 long long pm_score = frag * 40 + relb * 20 + real_overhead;
8649 long long time_delta = 8646 long long time_delta =
8650 (sc->best->next_attempt.abs_value_us - pos->next_attempt.abs_value_us) 8647 (sc->best->next_attempt.abs_value_us - pos->next_attempt.abs_value_us)
@@ -8848,8 +8845,7 @@ transmit_on_queue (void *cls)
8848 via DV (and thus the ultimate target of the pending message is for 8845 via DV (and thus the ultimate target of the pending message is for
8849 a different virtual link than the one of the queue), then we need 8846 a different virtual link than the one of the queue), then we need
8850 to use up not only the window of the direct link but also the 8847 to use up not only the window of the direct link but also the
8851 flow control window for the DV link! */ 8848 flow control window for the DV link! */pm->vl->outbound_fc_window_size_used += pm->bytes_msg;
8852 pm->vl->outbound_fc_window_size_used += pm->bytes_msg;
8853 8849
8854 if (pm->vl != queue->neighbour->vl) 8850 if (pm->vl != queue->neighbour->vl)
8855 { 8851 {
@@ -8888,8 +8884,7 @@ transmit_on_queue (void *cls)
8888 8884
8889 OPTIMIZE: Note that in the future this heuristic should likely 8885 OPTIMIZE: Note that in the future this heuristic should likely
8890 be improved further (measure RTT stability, consider message 8886 be improved further (measure RTT stability, consider message
8891 urgency and size when delaying ACKs, etc.) */ 8887 urgency and size when delaying ACKs, etc.) */update_pm_next_attempt (pm,
8892 update_pm_next_attempt (pm,
8893 GNUNET_TIME_relative_to_absolute ( 8888 GNUNET_TIME_relative_to_absolute (
8894 GNUNET_TIME_relative_multiply (queue->pd.aged_rtt, 8889 GNUNET_TIME_relative_multiply (queue->pd.aged_rtt,
8895 4))); 8890 4)));
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 853a61127..7638839cc 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -2390,9 +2390,7 @@ test_blacklisted (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
2390 * If (NULL != transport_name) we look for a transport specific entry: 2390 * If (NULL != transport_name) we look for a transport specific entry:
2391 * if (transport_name == be) forbidden 2391 * if (transport_name == be) forbidden
2392 * 2392 *
2393 */ 2393 */GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2394
2395 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2396 "Comparing BL request for peer `%4s':`%s' with BL entry: `%s'\n", 2394 "Comparing BL request for peer `%4s':`%s' with BL entry: `%s'\n",
2397 GNUNET_i2s (key), 2395 GNUNET_i2s (key),
2398 (NULL == transport_name) ? "unspecified" : transport_name, 2396 (NULL == transport_name) ? "unspecified" : transport_name,
diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h
index 3c2ca5a08..acb1de395 100644
--- a/src/transport/gnunet-service-transport.h
+++ b/src/transport/gnunet-service-transport.h
@@ -133,7 +133,6 @@ GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer,
133struct GST_BlacklistCheck; 133struct GST_BlacklistCheck;
134 134
135 135
136
137/** 136/**
138 * Test if a peer/transport combination is blacklisted. 137 * Test if a peer/transport combination is blacklisted.
139 * 138 *
@@ -231,7 +230,5 @@ void
231GST_clients_broadcast_disconnect (const struct GNUNET_PeerIdentity *peer); 230GST_clients_broadcast_disconnect (const struct GNUNET_PeerIdentity *peer);
232 231
233 232
234
235
236#endif 233#endif
237/* end of file gnunet-service-transport_plugins.h */ 234/* end of file gnunet-service-transport_plugins.h */
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index 9c262dbdf..130311e15 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -333,7 +333,7 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address,
333 return; /* our own, ignore! */ 333 return; /* our own, ignore! */
334 ai = find_ai (address, 334 ai = find_ai (address,
335 session); 335 session);
336 if ((NULL == ai)||(NULL == ai->ar)) 336 if ((NULL == ai) || (NULL == ai->ar))
337 { 337 {
338 /* The address is already gone/blocked, this can happen during a blacklist 338 /* The address is already gone/blocked, this can happen during a blacklist
339 * callback. */ 339 * callback. */
@@ -366,8 +366,7 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address,
366 above played out: it was either freed in 366 above played out: it was either freed in
367 #GNUNET_ATS_address_del_session() because it was 367 #GNUNET_ATS_address_del_session() because it was
368 incoming, or explicitly in 368 incoming, or explicitly in
369 #GNUNET_ATS_address_del_session(). */ 369 #GNUNET_ATS_address_del_session(). */ai->ar = NULL;
370 ai->ar = NULL;
371 370
372 /* determine when the address should come back to life */ 371 /* determine when the address should come back to life */
373 ai->blocked = GNUNET_TIME_relative_to_absolute (ai->back_off); 372 ai->blocked = GNUNET_TIME_relative_to_absolute (ai->back_off);
@@ -559,8 +558,7 @@ GST_ats_new_session (const struct GNUNET_HELLO_Address *address,
559 other part of the code could not tell if it just created a new 558 other part of the code could not tell if it just created a new
560 session or just got one recycled from the plugin; hence, we may 559 session or just got one recycled from the plugin; hence, we may
561 be called with "new" session even for an "old" session; in that 560 be called with "new" session even for an "old" session; in that
562 case, check that this is the case, but just ignore it. */ 561 case, check that this is the case, but just ignore it. */GNUNET_assert (NULL != (find_ai (address, session)));
563 GNUNET_assert (NULL != (find_ai (address, session)));
564 return; 562 return;
565 } 563 }
566 GNUNET_assert (NULL == ai->session); 564 GNUNET_assert (NULL == ai->session);
@@ -679,8 +677,7 @@ GST_ats_del_session (const struct GNUNET_HELLO_Address *address,
679 above played out: it was either freed in 677 above played out: it was either freed in
680 #GNUNET_ATS_address_del_session() because it was 678 #GNUNET_ATS_address_del_session() because it was
681 incoming, or explicitly in 679 incoming, or explicitly in
682 #GNUNET_ATS_address_del_session(). */ 680 #GNUNET_ATS_address_del_session(). */ai->ar = NULL;
683 ai->ar = NULL;
684 } 681 }
685 destroy_ai (ai); 682 destroy_ai (ai);
686 return; 683 return;
@@ -919,4 +916,5 @@ GST_ats_done ()
919 p2a = NULL; 916 p2a = NULL;
920} 917}
921 918
919
922/* end of gnunet-service-transport_ats.c */ 920/* end of gnunet-service-transport_ats.c */
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index 47ae5b981..04d1774c0 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -582,4 +582,5 @@ GST_manipulation_stop ()
582 } 582 }
583} 583}
584 584
585
585/* end of file gnunet-service-transport_manipulation.c */ 586/* end of file gnunet-service-transport_manipulation.c */
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 3de10d108..9c6cebc24 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -3568,9 +3568,7 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
3568 We expect a ACK: 3568 We expect a ACK:
3569 - If a remote peer has sent a SYN, we responded with a SYN_ACK and 3569 - If a remote peer has sent a SYN, we responded with a SYN_ACK and
3570 now wait for the ACK to finally be connected 3570 now wait for the ACK to finally be connected
3571 - If we sent a SYN_ACK to this peer before */ 3571 - If we sent a SYN_ACK to this peer before */if (((GNUNET_TRANSPORT_PS_SYN_RECV_ACK != n->state) &&
3572
3573 if (((GNUNET_TRANSPORT_PS_SYN_RECV_ACK != n->state) &&
3574 (ACK_SEND_ACK != n->ack_state)) || 3572 (ACK_SEND_ACK != n->ack_state)) ||
3575 (NULL == n->primary_address.address)) 3573 (NULL == n->primary_address.address))
3576 { 3574 {
@@ -3606,8 +3604,7 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
3606 * an ACK. 3604 * an ACK.
3607 * That suggests that the primary_address used to be non-NULL, but maybe it 3605 * That suggests that the primary_address used to be non-NULL, but maybe it
3608 * got reset to NULL without the state being changed appropriately? 3606 * got reset to NULL without the state being changed appropriately?
3609 */ 3607 */GNUNET_break (0);
3610 GNUNET_break (0);
3611 return GNUNET_OK; 3608 return GNUNET_OK;
3612 } 3609 }
3613 3610
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index ec8600b7f..631b0a8f8 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -81,8 +81,6 @@ enum GNUNET_TRANSPORT_ValidationState
81}; 81};
82 82
83 83
84
85
86/** 84/**
87 * How long is a PONG signature valid? We'll recycle a signature until 85 * How long is a PONG signature valid? We'll recycle a signature until
88 * 1/4 of this time is remaining. PONGs should expire so that if our 86 * 1/4 of this time is remaining. PONGs should expire so that if our
@@ -993,9 +991,7 @@ GST_validation_start (unsigned int max_fds)
993 * - "fast start": run validation immediately 991 * - "fast start": run validation immediately
994 * - have delay of (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2) 992 * - have delay of (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2)
995 * (300 sec / ~150 == ~2 sec.) between two validations 993 * (300 sec / ~150 == ~2 sec.) between two validations
996 */ 994 */validation_next = GNUNET_TIME_absolute_get ();
997
998 validation_next = GNUNET_TIME_absolute_get ();
999 validation_delay.rel_value_us = 995 validation_delay.rel_value_us =
1000 (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2); 996 (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2);
1001 validations_fast_start_threshold = (max_fds / 2); 997 validations_fast_start_threshold = (max_fds / 2);
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index b09361d14..6c13cf059 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -621,4 +621,5 @@ main (int argc, char *const *argv)
621 return 1; 621 return 1;
622} 622}
623 623
624
624/* end of gnunet-transport-profiler.c */ 625/* end of gnunet-transport-profiler.c */
diff --git a/src/transport/gnunet-transport-wlan-sender.c b/src/transport/gnunet-transport-wlan-sender.c
index 191ea8619..5256ec7be 100644
--- a/src/transport/gnunet-transport-wlan-sender.c
+++ b/src/transport/gnunet-transport-wlan-sender.c
@@ -65,6 +65,7 @@ getRadiotapHeader (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *header,
65 return GNUNET_YES; 65 return GNUNET_YES;
66} 66}
67 67
68
68/** 69/**
69 * function to generate the wlan hardware header for one packet 70 * function to generate the wlan hardware header for one packet
70 * @param Header address to write the header to 71 * @param Header address to write the header to
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index f0d9d30c3..5a437b660 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -1433,4 +1433,5 @@ main (int argc, char *const *argv)
1433 return 1; 1433 return 1;
1434} 1434}
1435 1435
1436
1436/* end of gnunet-transport.c */ 1437/* end of gnunet-transport.c */
diff --git a/src/transport/ieee80211_radiotap.h b/src/transport/ieee80211_radiotap.h
index 9bdfa02f5..1a79cf214 100644
--- a/src/transport/ieee80211_radiotap.h
+++ b/src/transport/ieee80211_radiotap.h
@@ -272,4 +272,5 @@ ieee80211_get_radiotap_len (unsigned char *data)
272 return get_unaligned_le16 ((const u8 *) &hdr->it_len); 272 return get_unaligned_le16 ((const u8 *) &hdr->it_len);
273} 273}
274 274
275
275#endif /* IEEE80211_RADIOTAP_H */ 276#endif /* IEEE80211_RADIOTAP_H */
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 98ab6544f..87cd7ead2 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -703,6 +703,8 @@ client_log (CURL *curl,
703 text); 703 text);
704 return 0; 704 return 0;
705} 705}
706
707
706#endif 708#endif
707 709
708/** 710/**
@@ -1504,6 +1506,8 @@ open_tcp_stealth_socket_cb (void *clientp,
1504 return CURL_SOCKET_BAD; 1506 return CURL_SOCKET_BAD;
1505 } 1507 }
1506} 1508}
1509
1510
1507#endif 1511#endif
1508 1512
1509 1513
@@ -2528,4 +2532,5 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls)
2528 return api; 2532 return api;
2529} 2533}
2530 2534
2535
2531/* end of plugin_transport_http_client.c */ 2536/* end of plugin_transport_http_client.c */
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c
index 6d3ee3429..2bcab42b4 100644
--- a/src/transport/plugin_transport_http_common.c
+++ b/src/transport/plugin_transport_http_common.c
@@ -173,6 +173,7 @@ http_split_address (const char *addr)
173 return sp; 173 return sp;
174} 174}
175 175
176
176/** 177/**
177 * Closure for #append_port(). 178 * Closure for #append_port().
178 */ 179 */
@@ -640,6 +641,7 @@ http_common_plugin_address_to_string (const char *plugin,
640 return NULL; 641 return NULL;
641} 642}
642 643
644
643/** 645/**
644 * Function called to convert a string address to 646 * Function called to convert a string address to
645 * a binary address. 647 * a binary address.
@@ -943,5 +945,4 @@ http_common_get_network_for_address (struct
943} 945}
944 946
945 947
946
947/* end of plugin_transport_http_common.c */ 948/* end of plugin_transport_http_common.c */
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 6e106fe78..20bdb6273 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -35,7 +35,6 @@
35#include <regex.h> 35#include <regex.h>
36 36
37 37
38
39#if BUILD_HTTPS 38#if BUILD_HTTPS
40#define PLUGIN_NAME "https_server" 39#define PLUGIN_NAME "https_server"
41#define LIBGNUNET_PLUGIN_TRANSPORT_INIT \ 40#define LIBGNUNET_PLUGIN_TRANSPORT_INIT \
@@ -2115,6 +2114,8 @@ server_load_file (const char *file)
2115 GNUNET_DISK_file_close (gn_file); 2114 GNUNET_DISK_file_close (gn_file);
2116 return text; 2115 return text;
2117} 2116}
2117
2118
2118#endif 2119#endif
2119 2120
2120 2121
@@ -2242,6 +2243,8 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin)
2242 "TLS certificate loaded\n"); 2243 "TLS certificate loaded\n");
2243 return res; 2244 return res;
2244} 2245}
2246
2247
2245#endif 2248#endif
2246 2249
2247 2250
@@ -2358,7 +2361,6 @@ server_start (struct HTTP_Server_Plugin *plugin)
2358#endif 2361#endif
2359 2362
2360 2363
2361
2362 plugin->server_v4 = NULL; 2364 plugin->server_v4 = NULL;
2363 if (GNUNET_YES == plugin->use_ipv4) 2365 if (GNUNET_YES == plugin->use_ipv4)
2364 { 2366 {
@@ -2557,7 +2559,6 @@ server_remove_address (void *cls,
2557} 2559}
2558 2560
2559 2561
2560
2561/** 2562/**
2562 * Our external IP address/port mapping has changed. 2563 * Our external IP address/port mapping has changed.
2563 * 2564 *
@@ -3598,4 +3599,5 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls)
3598 return api; 3599 return api;
3599} 3600}
3600 3601
3602
3601/* end of plugin_transport_http_server.c */ 3603/* end of plugin_transport_http_server.c */
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c
index 7fbbc9126..330023118 100644
--- a/src/transport/plugin_transport_smtp.c
+++ b/src/transport/plugin_transport_smtp.c
@@ -257,6 +257,7 @@ END:
257 return NULL; 257 return NULL;
258} 258}
259 259
260
260/* *************** API implementation *************** */ 261/* *************** API implementation *************** */
261 262
262/** 263/**
@@ -287,6 +288,7 @@ api_verify_hello (const GNUNET_MessageHello *hello)
287 return GNUNET_OK; 288 return GNUNET_OK;
288} 289}
289 290
291
290/** 292/**
291 * Create a hello-Message for the current node. The hello is created 293 * Create a hello-Message for the current node. The hello is created
292 * without signature and without a timestamp. The GNUnet core will 294 * without signature and without a timestamp. The GNUnet core will
@@ -336,6 +338,7 @@ api_create_hello ()
336 return msg; 338 return msg;
337} 339}
338 340
341
339struct GetMessageClosure 342struct GetMessageClosure
340{ 343{
341 unsigned int esize; 344 unsigned int esize;
@@ -361,6 +364,7 @@ get_message (void **buf, int *len, void *cls)
361 return gmc->ebody; 364 return gmc->ebody;
362} 365}
363 366
367
364/** 368/**
365 * Send a message to the specified remote node. 369 * Send a message to the specified remote node.
366 * 370 *
@@ -529,6 +533,7 @@ api_send (GNUNET_TSession *tsession, const void *msg, const unsigned int size,
529 return GNUNET_OK; 533 return GNUNET_OK;
530} 534}
531 535
536
532/** 537/**
533 * Establish a connection to a remote node. 538 * Establish a connection to a remote node.
534 * @param hello the hello-Message for the target node 539 * @param hello the hello-Message for the target node
@@ -551,6 +556,7 @@ api_connect (const GNUNET_MessageHello *hello, GNUNET_TSession **tsessionPtr,
551 return GNUNET_OK; 556 return GNUNET_OK;
552} 557}
553 558
559
554/** 560/**
555 * Disconnect from a remote node. 561 * Disconnect from a remote node.
556 * 562 *
@@ -569,6 +575,7 @@ api_disconnect (GNUNET_TSession *tsession)
569 return GNUNET_OK; 575 return GNUNET_OK;
570} 576}
571 577
578
572/** 579/**
573 * Start the server process to receive inbound traffic. 580 * Start the server process to receive inbound traffic.
574 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed 581 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
@@ -589,6 +596,7 @@ api_start_transport_server ()
589 return GNUNET_OK; 596 return GNUNET_OK;
590} 597}
591 598
599
592/** 600/**
593 * Shutdown the server process (stop receiving inbound traffic). Maybe 601 * Shutdown the server process (stop receiving inbound traffic). Maybe
594 * restarted later! 602 * restarted later!
@@ -604,6 +612,7 @@ api_stop_transport_server ()
604 return GNUNET_OK; 612 return GNUNET_OK;
605} 613}
606 614
615
607/** 616/**
608 * Convert SMTP hello to an IP address (always fails). 617 * Convert SMTP hello to an IP address (always fails).
609 */ 618 */
@@ -614,6 +623,7 @@ api_hello_to_address (const GNUNET_MessageHello *hello, void **sa,
614 return GNUNET_SYSERR; 623 return GNUNET_SYSERR;
615} 624}
616 625
626
617/** 627/**
618 * Always fails. 628 * Always fails.
619 */ 629 */
@@ -623,6 +633,7 @@ api_associate (GNUNET_TSession *tsession)
623 return GNUNET_SYSERR; /* SMTP connections can never be associated */ 633 return GNUNET_SYSERR; /* SMTP connections can never be associated */
624} 634}
625 635
636
626/** 637/**
627 * Always succeeds (for now; we should look at adding 638 * Always succeeds (for now; we should look at adding
628 * frequency limits to SMTP in the future!). 639 * frequency limits to SMTP in the future!).
@@ -634,6 +645,7 @@ api_test_would_try (GNUNET_TSession *tsession, unsigned int size,
634 return GNUNET_OK; /* we always try... */ 645 return GNUNET_OK; /* we always try... */
635} 646}
636 647
648
637/** 649/**
638 * The exported method. Makes the core api available via a global and 650 * The exported method. Makes the core api available via a global and
639 * returns the smtp transport API. 651 * returns the smtp transport API.
@@ -714,6 +726,7 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport *core)
714 return &smtpAPI; 726 return &smtpAPI;
715} 727}
716 728
729
717void 730void
718donetransport_smtp () 731donetransport_smtp ()
719{ 732{
@@ -733,4 +746,5 @@ donetransport_smtp ()
733 email = NULL; 746 email = NULL;
734} 747}
735 748
749
736/* end of smtp.c */ 750/* end of smtp.c */
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 36ff00dd8..ad0766af9 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -402,6 +402,7 @@ void
402GNUNET_SERVER_client_set_user_context_ (struct GNUNET_SERVER_Client *client, 402GNUNET_SERVER_client_set_user_context_ (struct GNUNET_SERVER_Client *client,
403 void *ptr, 403 void *ptr,
404 size_t size); 404 size_t size);
405
405/** 406/**
406 * Return user context associated with the given client. 407 * Return user context associated with the given client.
407 * 408 *
@@ -1376,6 +1377,8 @@ get_server_addresses (const char *service_name,
1376 *addr_lens = saddrlens; 1377 *addr_lens = saddrlens;
1377 return resi; 1378 return resi;
1378} 1379}
1380
1381
1379/* end ancient copy-and-paste */ 1382/* end ancient copy-and-paste */
1380 1383
1381 1384
@@ -2447,8 +2450,7 @@ tcp_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address)
2447 one TCP connection to any given peer at the same time. 2450 one TCP connection to any given peer at the same time.
2448 Without this, peers sometimes disagree about which of the TCP 2451 Without this, peers sometimes disagree about which of the TCP
2449 connections they should use, causing one side to believe that 2452 connections they should use, causing one side to believe that
2450 they transmit successfully, while the other receives nothing. */ 2453 they transmit successfully, while the other receives nothing. */return NULL; /* Refuse to have more than one TCP connection per
2451 return NULL; /* Refuse to have more than one TCP connection per
2452 peer pair at the same time. */ 2454 peer pair at the same time. */
2453 } 2455 }
2454 2456
@@ -2956,8 +2958,7 @@ handle_tcp_nat_probe (void *cls,
2956 * received the punch message and now wants us to use the new connection 2958 * received the punch message and now wants us to use the new connection
2957 * as the default for that peer. Do so and then send a WELCOME message 2959 * as the default for that peer. Do so and then send a WELCOME message
2958 * so we can really be connected! 2960 * so we can really be connected!
2959 */ 2961 */if (ntohs (message->size) != sizeof(struct TCP_NAT_ProbeMessage))
2960 if (ntohs (message->size) != sizeof(struct TCP_NAT_ProbeMessage))
2961 { 2962 {
2962 GNUNET_break_op (0); 2963 GNUNET_break_op (0);
2963 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 2964 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -3962,4 +3963,5 @@ libgnunet_plugin_transport_tcp_done (void *cls)
3962 return NULL; 3963 return NULL;
3963} 3964}
3964 3965
3966
3965/* end of plugin_transport_tcp.c */ 3967/* end of plugin_transport_tcp.c */
diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c
index 54b3a277a..239f32f4a 100644
--- a/src/transport/plugin_transport_template.c
+++ b/src/transport/plugin_transport_template.c
@@ -180,6 +180,8 @@ notify_session_monitor (struct Plugin *plugin,
180 session, 180 session,
181 &info); 181 &info);
182} 182}
183
184
183#endif 185#endif
184 186
185 187
@@ -337,7 +339,6 @@ template_plugin_address_pretty_printer (void *cls, const char *type,
337} 339}
338 340
339 341
340
341/** 342/**
342 * Another peer has suggested an address for this 343 * Another peer has suggested an address for this
343 * peer and transport plugin. Check that this could be a valid 344 * peer and transport plugin. Check that this could be a valid
@@ -463,6 +464,8 @@ send_session_info_iter (void *cls,
463 GNUNET_TRANSPORT_SS_UP); 464 GNUNET_TRANSPORT_SS_UP);
464 return GNUNET_OK; 465 return GNUNET_OK;
465} 466}
467
468
466#endif 469#endif
467 470
468 471
@@ -558,4 +561,5 @@ libgnunet_plugin_transport_template_done (void *cls)
558 return NULL; 561 return NULL;
559} 562}
560 563
564
561/* end of plugin_transport_template.c */ 565/* end of plugin_transport_template.c */
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 8d0bbea47..ef4fddb24 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -2016,8 +2016,7 @@ udp_plugin_send (void *cls,
2016 * For UDP we update session timeout only on receive, this will 2016 * For UDP we update session timeout only on receive, this will
2017 * cover keep alives, since remote peer will reply with keep alive 2017 * cover keep alives, since remote peer will reply with keep alive
2018 * responses! 2018 * responses!
2019 */ 2019 */if (udpmlen <= UDP_MTU)
2020 if (udpmlen <= UDP_MTU)
2021 { 2020 {
2022 /* unfragmented message */ 2021 /* unfragmented message */
2023 udpw = GNUNET_malloc (sizeof(struct UDP_MessageWrapper) + udpmlen); 2022 udpw = GNUNET_malloc (sizeof(struct UDP_MessageWrapper) + udpmlen);
@@ -3178,8 +3177,7 @@ analyze_send_error (struct Plugin *plugin,
3178 * This indicates that this system is IPv6 enabled, but does not 3177 * This indicates that this system is IPv6 enabled, but does not
3179 * have a valid global IPv6 address assigned or we do not have 3178 * have a valid global IPv6 address assigned or we do not have
3180 * connectivity 3179 * connectivity
3181 */ 3180 */LOG (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
3182 LOG (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
3183 _ ( 3181 _ (
3184 "UDP could not transmit IPv6 message! " 3182 "UDP could not transmit IPv6 message! "
3185 "Please check your network configuration and disable IPv6 if your " 3183 "Please check your network configuration and disable IPv6 if your "
@@ -3894,4 +3892,5 @@ libgnunet_plugin_transport_udp_done (void *cls)
3894 return NULL; 3892 return NULL;
3895} 3893}
3896 3894
3895
3897/* end of plugin_transport_udp.c */ 3896/* end of plugin_transport_udp.c */
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index d8fdfe886..c85124b68 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -223,7 +223,7 @@ prepare_beacon (struct Plugin *plugin,
223 hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello); 223 hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello);
224 msg_size = hello_size + sizeof(struct UDP_Beacon_Message); 224 msg_size = hello_size + sizeof(struct UDP_Beacon_Message);
225 225
226 if ((hello_size < (sizeof(struct GNUNET_MessageHeader)))|| 226 if ((hello_size < (sizeof(struct GNUNET_MessageHeader))) ||
227 (msg_size > (UDP_MTU))) 227 (msg_size > (UDP_MTU)))
228 return 0; 228 return 0;
229 229
@@ -331,8 +331,7 @@ udp_ipv6_broadcast_send (void *cls)
331 if the scope ID is ignored, the kernel should just multicast 331 if the scope ID is ignored, the kernel should just multicast
332 on ALL interfaces, which is merely slightly less efficient; 332 on ALL interfaces, which is merely slightly less efficient;
333 in that case, we might want to revert to only doing this 333 in that case, we might want to revert to only doing this
334 once, and not per interface (hard to test...) */ 334 once, and not per interface (hard to test...) */plugin->ipv6_multicast_address.sin6_scope_id = s6->sin6_scope_id;
335 plugin->ipv6_multicast_address.sin6_scope_id = s6->sin6_scope_id;
336 sent = GNUNET_NETWORK_socket_sendto (plugin->sockv6, &buf, msg_size, 335 sent = GNUNET_NETWORK_socket_sendto (plugin->sockv6, &buf, msg_size,
337 (const struct sockaddr *) 336 (const struct sockaddr *)
338 &plugin->ipv6_multicast_address, 337 &plugin->ipv6_multicast_address,
@@ -346,8 +345,7 @@ udp_ipv6_broadcast_send (void *cls)
346 * 345 *
347 * This indicates that this system is IPv6 enabled, but does not 346 * This indicates that this system is IPv6 enabled, but does not
348 * have a valid global IPv6 address assigned 347 * have a valid global IPv6 address assigned
349 */ 348 */GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING,
350 GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING,
351 "Network connectivity is down, cannot send beacon!\n"); 349 "Network connectivity is down, cannot send beacon!\n");
352 } 350 }
353 else 351 else
@@ -492,8 +490,7 @@ iface_proc (void *cls,
492 * group in the normal IPv6 routing table and using the resulting 490 * group in the normal IPv6 routing table and using the resulting
493 * interface; we do this for each interface, so no need to use 491 * interface; we do this for each interface, so no need to use
494 * zero (anymore...). 492 * zero (anymore...).
495 */ 493 */multicastRequest.ipv6mr_interface = s6->sin6_scope_id;
496 multicastRequest.ipv6mr_interface = s6->sin6_scope_id;
497 494
498 /* Join the multicast group */ 495 /* Join the multicast group */
499 if (GNUNET_OK != 496 if (GNUNET_OK !=
@@ -646,4 +643,5 @@ stop_broadcast (struct Plugin *plugin)
646 } 643 }
647} 644}
648 645
646
649/* end of plugin_transport_udp_broadcasting.c */ 647/* end of plugin_transport_udp_broadcasting.c */
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 42d16f131..083a1cf7f 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -1886,4 +1886,5 @@ libgnunet_plugin_transport_unix_done (void *cls)
1886 return NULL; 1886 return NULL;
1887} 1887}
1888 1888
1889
1889/* end of plugin_transport_unix.c */ 1890/* end of plugin_transport_unix.c */
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 570a39ed7..d831a7b78 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -102,7 +102,6 @@
102#endif 102#endif
103 103
104 104
105
106/** 105/**
107 * Functions with this signature are called whenever a 106 * Functions with this signature are called whenever a
108 * complete message is received by the tokenizer. 107 * complete message is received by the tokenizer.
@@ -876,7 +875,6 @@ session_timeout (void *cls)
876} 875}
877 876
878 877
879
880/** 878/**
881 * Lookup a new session 879 * Lookup a new session
882 * 880 *
@@ -2203,7 +2201,6 @@ wlan_plugin_setup_monitor (void *cls,
2203} 2201}
2204 2202
2205 2203
2206
2207/** 2204/**
2208 * Function that will be called whenever the transport service wants to 2205 * Function that will be called whenever the transport service wants to
2209 * notify the plugin that a session is still active and in use and 2206 * notify the plugin that a session is still active and in use and
diff --git a/src/transport/plugin_transport_wlan.h b/src/transport/plugin_transport_wlan.h
index 5fe9f166f..9ba9d2771 100644
--- a/src/transport/plugin_transport_wlan.h
+++ b/src/transport/plugin_transport_wlan.h
@@ -153,7 +153,6 @@ struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame
153} GNUNET_PACKED; 153} GNUNET_PACKED;
154 154
155 155
156
157/** 156/**
158 * Message from the plugin to the WLAN helper: send the given message with the 157 * Message from the plugin to the WLAN helper: send the given message with the
159 * given connection parameters. 158 * given connection parameters.
diff --git a/src/transport/tcp_server_legacy.c b/src/transport/tcp_server_legacy.c
index 1a1d493cd..59b4fc20a 100644
--- a/src/transport/tcp_server_legacy.c
+++ b/src/transport/tcp_server_legacy.c
@@ -337,7 +337,6 @@ struct GNUNET_SERVER_Client
337}; 337};
338 338
339 339
340
341/** 340/**
342 * Return user context associated with the given client. 341 * Return user context associated with the given client.
343 * Note: you should probably use the macro (call without the underscore). 342 * Note: you should probably use the macro (call without the underscore).
diff --git a/src/transport/tcp_server_mst_legacy.c b/src/transport/tcp_server_mst_legacy.c
index b27590a6f..cef41c5b0 100644
--- a/src/transport/tcp_server_mst_legacy.c
+++ b/src/transport/tcp_server_mst_legacy.c
@@ -72,7 +72,6 @@ struct GNUNET_SERVER_MessageStreamTokenizer
72}; 72};
73 73
74 74
75
76/** 75/**
77 * Create a message stream tokenizer. 76 * Create a message stream tokenizer.
78 * 77 *
@@ -305,5 +304,4 @@ GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst)
305} 304}
306 305
307 306
308
309/* end of server_mst.c */ 307/* end of server_mst.c */
diff --git a/src/transport/test_communicator_unix.c b/src/transport/test_communicator_unix.c
index d1ab99910..db355c93e 100644
--- a/src/transport/test_communicator_unix.c
+++ b/src/transport/test_communicator_unix.c
@@ -193,6 +193,7 @@ run (void *cls)
193 NULL); /* cls */ 193 NULL); /* cls */
194} 194}
195 195
196
196int 197int
197main (int argc, 198main (int argc,
198 char *const *argv) 199 char *const *argv)
diff --git a/src/transport/test_http_common.c b/src/transport/test_http_common.c
index d925f1318..6e31ec85e 100644
--- a/src/transport/test_http_common.c
+++ b/src/transport/test_http_common.c
@@ -262,4 +262,5 @@ main (int argc, char *argv[])
262 return ret; 262 return ret;
263} 263}
264 264
265
265/* end of test_http_common.c */ 266/* end of test_http_common.c */
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index ceb4333ac..10e07dae5 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -255,6 +255,7 @@ end_badly (void *cls)
255 ok = 1; 255 ok = 1;
256} 256}
257 257
258
258static void 259static void
259wait_end (void *cls) 260wait_end (void *cls)
260{ 261{
@@ -293,6 +294,7 @@ env_receive (void *cls,
293 return GNUNET_TIME_relative_get_zero_ (); 294 return GNUNET_TIME_relative_get_zero_ ();
294} 295}
295 296
297
296static int got_reply; 298static int got_reply;
297 299
298 300
@@ -377,8 +379,7 @@ test_addr_string (void *cls)
377 int c1; 379 int c1;
378 for (c1 = 0; c1 < s2a_len; c1++ ) 380 for (c1 = 0; c1 < s2a_len; c1++ )
379 fprintf (stderr, "%u == %u\n", ((char *) s2a)[c1], ((char *) w->addr)[c1]); 381 fprintf (stderr, "%u == %u\n", ((char *) s2a)[c1], ((char *) w->addr)[c1]);
380 */ 382 */if (s2a_len != w->address->address_length)
381 if (s2a_len != w->address->address_length)
382 { 383 {
383 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 384 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
384 "Plugin creates different address length when converting address->string->address: %u != %u\n", 385 "Plugin creates different address length when converting address->string->address: %u != %u\n",
@@ -788,4 +789,5 @@ main (int argc,
788 return ret; 789 return ret;
789} 790}
790 791
792
791/* end of test_plugin_transport.c */ 793/* end of test_plugin_transport.c */
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index b030aa1b8..b49cb187b 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -428,4 +428,6 @@ main (int argc, char *argv[])
428 return 1; 428 return 1;
429 return 0; 429 return 0;
430} 430}
431
432
431/* end of test_transport_address_switch.c */ 433/* end of test_transport_address_switch.c */
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 950eb2b04..5f5e03a9e 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -122,4 +122,5 @@ main (int argc,
122 return 0; 122 return 0;
123} 123}
124 124
125
125/* end of test_transport_api.c */ 126/* end of test_transport_api.c */
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c
index 76e0325af..c469f28bc 100644
--- a/src/transport/test_transport_api_disconnect.c
+++ b/src/transport/test_transport_api_disconnect.c
@@ -130,4 +130,5 @@ main (int argc,
130 return 0; 130 return 0;
131} 131}
132 132
133
133/* end of test_transport_api_disconnect.c */ 134/* end of test_transport_api_disconnect.c */
diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c
index 089ad7a32..0e47800e8 100644
--- a/src/transport/test_transport_api_limited_sockets.c
+++ b/src/transport/test_transport_api_limited_sockets.c
@@ -113,6 +113,7 @@ main (int argc, char *argv[])
113 return 0; 113 return 0;
114} 114}
115 115
116
116#else 117#else
117/* cannot setrlimit */ 118/* cannot setrlimit */
118 119
@@ -125,6 +126,7 @@ main (int argc, char *argv[])
125 return 77; 126 return 77;
126} 127}
127 128
129
128#endif 130#endif
129 131
130/* end of test_transport_api_limited_sockets.c */ 132/* end of test_transport_api_limited_sockets.c */
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c
index 5f651e3ed..207c4416f 100644
--- a/src/transport/test_transport_api_manipulation_recv_tcp.c
+++ b/src/transport/test_transport_api_manipulation_recv_tcp.c
@@ -199,4 +199,5 @@ main (int argc,
199 return 0; 199 return 0;
200} 200}
201 201
202
202/* end of test_transport_api_manipulation_recv_tcp.c */ 203/* end of test_transport_api_manipulation_recv_tcp.c */
diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c
index 28516bcae..ea735cfc6 100644
--- a/src/transport/test_transport_api_manipulation_send_tcp.c
+++ b/src/transport/test_transport_api_manipulation_send_tcp.c
@@ -195,4 +195,5 @@ main (int argc,
195 return 0; 195 return 0;
196} 196}
197 197
198
198/* end of test_transport_api_manipulation_send_tcp.c */ 199/* end of test_transport_api_manipulation_send_tcp.c */
diff --git a/src/transport/test_transport_api_monitor_peers.c b/src/transport/test_transport_api_monitor_peers.c
index 4e12d0bad..c09e3782d 100644
--- a/src/transport/test_transport_api_monitor_peers.c
+++ b/src/transport/test_transport_api_monitor_peers.c
@@ -222,4 +222,5 @@ main (int argc, char *argv[])
222 return 0; 222 return 0;
223} 223}
224 224
225
225/* end of test_transport_api_monitor_peers.c */ 226/* end of test_transport_api_monitor_peers.c */
diff --git a/src/transport/test_transport_api_restart_reconnect.c b/src/transport/test_transport_api_restart_reconnect.c
index dff57a3a8..d58c1de54 100644
--- a/src/transport/test_transport_api_restart_reconnect.c
+++ b/src/transport/test_transport_api_restart_reconnect.c
@@ -213,4 +213,5 @@ main (int argc,
213 return 0; 213 return 0;
214} 214}
215 215
216
216/* end of test_transport_api_restart_1peer.c */ 217/* end of test_transport_api_restart_1peer.c */
diff --git a/src/transport/test_transport_api_timeout.c b/src/transport/test_transport_api_timeout.c
index 80a457d15..9f8d3bb2b 100644
--- a/src/transport/test_transport_api_timeout.c
+++ b/src/transport/test_transport_api_timeout.c
@@ -160,4 +160,5 @@ main (int argc,
160 return 0; 160 return 0;
161} 161}
162 162
163
163/* end of test_transport_api_timeout.c*/ 164/* end of test_transport_api_timeout.c*/
diff --git a/src/transport/test_transport_blacklisting.c b/src/transport/test_transport_blacklisting.c
index ef7f96d99..204935dcb 100644
--- a/src/transport/test_transport_blacklisting.c
+++ b/src/transport/test_transport_blacklisting.c
@@ -164,6 +164,7 @@ end_badly (void *cls)
164 ok = GNUNET_SYSERR; 164 ok = GNUNET_SYSERR;
165} 165}
166 166
167
167static void 168static void
168testing_connect_cb (void *cls) 169testing_connect_cb (void *cls)
169{ 170{
@@ -540,6 +541,7 @@ run_stage (void *cls)
540 GNUNET_SCHEDULER_add_now (&end, NULL); 541 GNUNET_SCHEDULER_add_now (&end, NULL);
541} 542}
542 543
544
543static void 545static void
544run (void *cls, char *const *args, const char *cfgfile, 546run (void *cls, char *const *args, const char *cfgfile,
545 const struct GNUNET_CONFIGURATION_Handle *cfg) 547 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -550,6 +552,7 @@ run (void *cls, char *const *args, const char *cfgfile,
550 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL); 552 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL);
551} 553}
552 554
555
553int 556int
554main (int argc, char *argv0[]) 557main (int argc, char *argv0[])
555{ 558{
@@ -575,4 +578,5 @@ main (int argc, char *argv0[])
575 return ok; 578 return ok;
576} 579}
577 580
581
578/* end of transport_api_blacklisting.c */ 582/* end of transport_api_blacklisting.c */
diff --git a/src/transport/test_transport_testing_restart.c b/src/transport/test_transport_testing_restart.c
index 108c8929e..f537af5fc 100644
--- a/src/transport/test_transport_testing_restart.c
+++ b/src/transport/test_transport_testing_restart.c
@@ -159,4 +159,5 @@ main (int argc,
159 return ret; 159 return ret;
160} 160}
161 161
162
162/* end of test_transport_testing_restart.c */ 163/* end of test_transport_testing_restart.c */
diff --git a/src/transport/test_transport_testing_startstop.c b/src/transport/test_transport_testing_startstop.c
index 5b75a80e1..4783c1813 100644
--- a/src/transport/test_transport_testing_startstop.c
+++ b/src/transport/test_transport_testing_startstop.c
@@ -134,4 +134,5 @@ main (int argc, char *argv[])
134 return ret; 134 return ret;
135} 135}
136 136
137
137/* end of test_transport_testing_startstop.c */ 138/* end of test_transport_testing_startstop.c */
diff --git a/src/transport/transport-testing-loggers.c b/src/transport/transport-testing-loggers.c
index 0e539eac0..330a392c6 100644
--- a/src/transport/transport-testing-loggers.c
+++ b/src/transport/transport-testing-loggers.c
@@ -50,7 +50,6 @@ GNUNET_TRANSPORT_TESTING_log_connect (void *cls,
50} 50}
51 51
52 52
53
54/** 53/**
55 * Log a disconnect event. 54 * Log a disconnect event.
56 * 55 *
@@ -77,4 +76,5 @@ GNUNET_TRANSPORT_TESTING_log_disconnect (void *cls,
77 GNUNET_free (ps); 76 GNUNET_free (ps);
78} 77}
79 78
79
80/* end of transport-testing-loggers.c */ 80/* end of transport-testing-loggers.c */
diff --git a/src/transport/transport-testing-main.c b/src/transport/transport-testing-main.c
index 7581120c8..8c35ff252 100644
--- a/src/transport/transport-testing-main.c
+++ b/src/transport/transport-testing-main.c
@@ -609,4 +609,5 @@ GNUNET_TRANSPORT_TESTING_main_ (const char *argv0,
609 return ret; 609 return ret;
610} 610}
611 611
612
612/* end of transport-testing-main.c */ 613/* end of transport-testing-main.c */
diff --git a/src/transport/transport-testing-send.c b/src/transport/transport-testing-send.c
index 5885ffb03..38018c172 100644
--- a/src/transport/transport-testing-send.c
+++ b/src/transport/transport-testing-send.c
@@ -236,4 +236,5 @@ GNUNET_TRANSPORT_TESTING_large_send (void *cls)
236 done ? sc->cont_cls : sc); 236 done ? sc->cont_cls : sc);
237} 237}
238 238
239
239/* end of transport-testing-send.c */ 240/* end of transport-testing-send.c */
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index 225f7044f..06dbe891a 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -925,4 +925,5 @@ GNUNET_TRANSPORT_TESTING_init ()
925 return tth; 925 return tth;
926} 926}
927 927
928
928/* end of transport-testing.c */ 929/* end of transport-testing.c */
diff --git a/src/transport/transport_api2_monitor.c b/src/transport/transport_api2_monitor.c
index f358051b6..67aa1985e 100644
--- a/src/transport/transport_api2_monitor.c
+++ b/src/transport/transport_api2_monitor.c
@@ -288,4 +288,5 @@ GNUNET_TRANSPORT_monitor_cancel (struct GNUNET_TRANSPORT_MonitorContext *mc)
288 GNUNET_free (mc); 288 GNUNET_free (mc);
289} 289}
290 290
291
291/* end of transport_api2_monitor.c */ 292/* end of transport_api2_monitor.c */
diff --git a/src/transport/transport_api_blacklist.c b/src/transport/transport_api_blacklist.c
index 45d9bcf29..b195a7fc7 100644
--- a/src/transport/transport_api_blacklist.c
+++ b/src/transport/transport_api_blacklist.c
@@ -92,6 +92,7 @@ handle_query (void *cls,
92 env); 92 env);
93} 93}
94 94
95
95/** 96/**
96 * Generic error handler, called with the appropriate error code and 97 * Generic error handler, called with the appropriate error code and
97 * the same closure specified at the creation of the message queue. 98 * the same closure specified at the creation of the message queue.
diff --git a/src/transport/transport_api_monitor_peers.c b/src/transport/transport_api_monitor_peers.c
index 956bf9e15..2f0f07f23 100644
--- a/src/transport/transport_api_monitor_peers.c
+++ b/src/transport/transport_api_monitor_peers.c
@@ -320,7 +320,6 @@ handle_response (void *cls,
320} 320}
321 321
322 322
323
324/** 323/**
325 * Generic error handler, called with the appropriate error code and 324 * Generic error handler, called with the appropriate error code and
326 * the same closure specified at the creation of the message queue. 325 * the same closure specified at the creation of the message queue.
diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c
index 7910a57c2..d8eddddaa 100644
--- a/src/transport/transport_api_monitor_plugins.c
+++ b/src/transport/transport_api_monitor_plugins.c
@@ -93,7 +93,6 @@ struct GNUNET_TRANSPORT_PluginSession
93}; 93};
94 94
95 95
96
97/** 96/**
98 * Task run to re-establish the connection. 97 * Task run to re-establish the connection.
99 * 98 *
diff --git a/src/util/client.c b/src/util/client.c
index d431909cf..024f34b3a 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -45,7 +45,6 @@
45 GNUNET_TIME_UNIT_SECONDS, 5) 45 GNUNET_TIME_UNIT_SECONDS, 5)
46 46
47 47
48
49/** 48/**
50 * Internal state for a client connected to a GNUnet service. 49 * Internal state for a client connected to a GNUnet service.
51 */ 50 */
@@ -1109,4 +1108,5 @@ GNUNET_CLIENT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
1109 return cstate->mq; 1108 return cstate->mq;
1110} 1109}
1111 1110
1111
1112/* end of client.c */ 1112/* end of client.c */
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c
index 358c09808..137af7b85 100644
--- a/src/util/common_allocation.c
+++ b/src/util/common_allocation.c
@@ -361,6 +361,8 @@ strnlen (const char *s, size_t n)
361 return n; 361 return n;
362 return e - s; 362 return e - s;
363} 363}
364
365
364#endif 366#endif
365 367
366 368
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 3ff9bf18e..d13f3a7fa 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -401,6 +401,8 @@ setup_log_file (const struct tm *tm)
401 GNUNET_stderr = altlog; 401 GNUNET_stderr = altlog;
402 return GNUNET_OK; 402 return GNUNET_OK;
403} 403}
404
405
404#endif 406#endif
405 407
406 408
@@ -504,7 +506,7 @@ GNUNET_get_log_call_status (int caller_level,
504 { 506 {
505 ld = &logdefs[i]; 507 ld = &logdefs[i];
506 if (((! force_only) || ld->force) && 508 if (((! force_only) || ld->force) &&
507 ((line >= ld->from_line) &&(line <= ld->to_line) ) && 509 ((line >= ld->from_line) && (line <= ld->to_line) ) &&
508 (0 == regexec (&ld->component_regex, comp, 0, NULL, 0)) && 510 (0 == regexec (&ld->component_regex, comp, 0, NULL, 0)) &&
509 (0 == regexec (&ld->file_regex, file, 0, NULL, 0)) && 511 (0 == regexec (&ld->file_regex, file, 0, NULL, 0)) &&
510 (0 == regexec (&ld->function_regex, function, 0, NULL, 0))) 512 (0 == regexec (&ld->function_regex, function, 0, NULL, 0)))
@@ -693,6 +695,8 @@ parse_all_definitions ()
693 parse_definitions ("GNUNET_LOG", 0); 695 parse_definitions ("GNUNET_LOG", 0);
694 gnunet_log_parsed = GNUNET_YES; 696 gnunet_log_parsed = GNUNET_YES;
695} 697}
698
699
696#endif 700#endif
697 701
698 702
@@ -823,8 +827,7 @@ output_message (enum GNUNET_ErrorType kind,
823 * interactively, yet the same message shouldn't look 827 * interactively, yet the same message shouldn't look
824 * this way if the output is going to logfiles or robots 828 * this way if the output is going to logfiles or robots
825 * instead. 829 * instead.
826 */ 830 */fprintf (GNUNET_stderr, "* %s", msg);
827 fprintf (GNUNET_stderr, "* %s", msg);
828 } 831 }
829 else if (GNUNET_YES == current_async_scope.have_scope) 832 else if (GNUNET_YES == current_async_scope.have_scope)
830 { 833 {
@@ -1545,7 +1548,8 @@ GNUNET_async_scope_get (struct GNUNET_AsyncScopeSave *scope_ret)
1545/** 1548/**
1546 * Initializer 1549 * Initializer
1547 */ 1550 */
1548void __attribute__ ((constructor)) GNUNET_util_cl_init () 1551void __attribute__ ((constructor))
1552GNUNET_util_cl_init ()
1549{ 1553{
1550 GNUNET_stderr = stderr; 1554 GNUNET_stderr = stderr;
1551} 1555}
@@ -1554,9 +1558,11 @@ void __attribute__ ((constructor)) GNUNET_util_cl_init ()
1554/** 1558/**
1555 * Destructor 1559 * Destructor
1556 */ 1560 */
1557void __attribute__ ((destructor)) GNUNET_util_cl_fini () 1561void __attribute__ ((destructor))
1562GNUNET_util_cl_fini ()
1558{ 1563{
1559 1564
1560} 1565}
1561 1566
1567
1562/* end of common_logging.c */ 1568/* end of common_logging.c */
diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c
index b043a2e12..b9e5cb67f 100644
--- a/src/util/configuration_loader.c
+++ b/src/util/configuration_loader.c
@@ -84,4 +84,5 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
84 return GNUNET_OK; 84 return GNUNET_OK;
85} 85}
86 86
87
87/* end of configuration_loader.c */ 88/* end of configuration_loader.c */
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index cb7984c3f..eca651862 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -149,6 +149,7 @@ setBit (char *bitArray, unsigned int bitIdx)
149 bitArray[arraySlot] |= targetBit; 149 bitArray[arraySlot] |= targetBit;
150} 150}
151 151
152
152/** 153/**
153 * Clears a bit from bitArray. Bit is cleared from the array 154 * Clears a bit from bitArray. Bit is cleared from the array
154 * only if the respective usage counter on the disk hits/is zero. 155 * only if the respective usage counter on the disk hits/is zero.
@@ -167,6 +168,7 @@ clearBit (char *bitArray, unsigned int bitIdx)
167 bitArray[slot] = bitArray[slot] & (~targetBit); 168 bitArray[slot] = bitArray[slot] & (~targetBit);
168} 169}
169 170
171
170/** 172/**
171 * Checks if a bit is active in the bitArray 173 * Checks if a bit is active in the bitArray
172 * 174 *
@@ -188,6 +190,7 @@ testBit (char *bitArray, unsigned int bitIdx)
188 return GNUNET_NO; 190 return GNUNET_NO;
189} 191}
190 192
193
191/** 194/**
192 * Sets a bit active in the bitArray and increments 195 * Sets a bit active in the bitArray and increments
193 * bit-specific usage counter on disk (but only if 196 * bit-specific usage counter on disk (but only if
@@ -238,6 +241,7 @@ incrementBit (char *bitArray,
238 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); 241 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
239} 242}
240 243
244
241/** 245/**
242 * Clears a bit from bitArray if the respective usage 246 * Clears a bit from bitArray if the respective usage
243 * counter on the disk hits/is zero. 247 * counter on the disk hits/is zero.
@@ -302,6 +306,7 @@ decrementBit (char *bitArray,
302 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); 306 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
303} 307}
304 308
309
305#define BUFFSIZE 65536 310#define BUFFSIZE 65536
306 311
307/** 312/**
@@ -342,6 +347,7 @@ make_empty_file (const struct GNUNET_DISK_FileHandle *fh, size_t size)
342 return GNUNET_OK; 347 return GNUNET_OK;
343} 348}
344 349
350
345/* ************** GNUNET_CONTAINER_BloomFilter iterator ********* */ 351/* ************** GNUNET_CONTAINER_BloomFilter iterator ********* */
346 352
347/** 353/**
@@ -474,6 +480,7 @@ testBitCallback (void *cls,
474 return GNUNET_YES; 480 return GNUNET_YES;
475} 481}
476 482
483
477/* *********************** INTERFACE **************** */ 484/* *********************** INTERFACE **************** */
478 485
479/** 486/**
@@ -796,6 +803,7 @@ GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf,
796 return GNUNET_OK; 803 return GNUNET_OK;
797} 804}
798 805
806
799/** 807/**
800 * Or the entries of the given raw data array with the 808 * Or the entries of the given raw data array with the
801 * data of the given bloom filter. Assumes that 809 * data of the given bloom filter. Assumes that
@@ -854,6 +862,7 @@ GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf,
854 iterateBits (bf, &decrementBitCallback, bf, e); 862 iterateBits (bf, &decrementBitCallback, bf, e);
855} 863}
856 864
865
857/** 866/**
858 * Resize a bloom filter. Note that this operation 867 * Resize a bloom filter. Note that this operation
859 * is pretty costly. Essentially, the bloom filter 868 * is pretty costly. Essentially, the bloom filter
@@ -889,4 +898,5 @@ GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
889 GNUNET_CONTAINER_bloomfilter_add (bf, &hc); 898 GNUNET_CONTAINER_bloomfilter_add (bf, &hc);
890} 899}
891 900
901
892/* end of container_bloomfilter.c */ 902/* end of container_bloomfilter.c */
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index 9cbd54f49..ad362408e 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -35,7 +35,6 @@
35 __VA_ARGS__) 35 __VA_ARGS__)
36 36
37 37
38
39/** 38/**
40 * Try to compress the given block of data using libz. Only returns 39 * Try to compress the given block of data using libz. Only returns
41 * the compressed block if compression worked and the new block is 40 * the compressed block if compression worked and the new block is
diff --git a/src/util/crypto_abe.c b/src/util/crypto_abe.c
index 1fe648e5a..97ff01680 100644
--- a/src/util/crypto_abe.c
+++ b/src/util/crypto_abe.c
@@ -78,6 +78,7 @@ init_aes (element_t k, int enc,
78 return rc; 78 return rc;
79} 79}
80 80
81
81static int 82static int
82aes_128_cbc_encrypt (char*pt, 83aes_128_cbc_encrypt (char*pt,
83 int size, 84 int size,
@@ -116,6 +117,7 @@ aes_128_cbc_encrypt (char*pt,
116 return buf_size; 117 return buf_size;
117} 118}
118 119
120
119static int 121static int
120aes_128_cbc_decrypt (char*ct, 122aes_128_cbc_decrypt (char*ct,
121 int size, 123 int size,
@@ -149,6 +151,7 @@ aes_128_cbc_decrypt (char*ct,
149 return len; 151 return len;
150} 152}
151 153
154
152struct GNUNET_CRYPTO_AbeMasterKey* 155struct GNUNET_CRYPTO_AbeMasterKey*
153GNUNET_CRYPTO_cpabe_create_master_key (void) 156GNUNET_CRYPTO_cpabe_create_master_key (void)
154{ 157{
@@ -161,6 +164,7 @@ GNUNET_CRYPTO_cpabe_create_master_key (void)
161 return key; 164 return key;
162} 165}
163 166
167
164void 168void
165GNUNET_CRYPTO_cpabe_delete_master_key (struct GNUNET_CRYPTO_AbeMasterKey *key) 169GNUNET_CRYPTO_cpabe_delete_master_key (struct GNUNET_CRYPTO_AbeMasterKey *key)
166{ 170{
@@ -171,6 +175,7 @@ GNUNET_CRYPTO_cpabe_delete_master_key (struct GNUNET_CRYPTO_AbeMasterKey *key)
171 GNUNET_free (key); 175 GNUNET_free (key);
172} 176}
173 177
178
174struct GNUNET_CRYPTO_AbeKey* 179struct GNUNET_CRYPTO_AbeKey*
175GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key, 180GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key,
176 char **attrs) 181 char **attrs)
@@ -188,6 +193,7 @@ GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key,
188 return prv_key; 193 return prv_key;
189} 194}
190 195
196
191void 197void
192GNUNET_CRYPTO_cpabe_delete_key (struct GNUNET_CRYPTO_AbeKey *key, 198GNUNET_CRYPTO_cpabe_delete_key (struct GNUNET_CRYPTO_AbeKey *key,
193 int delete_pub) 199 int delete_pub)
@@ -199,6 +205,7 @@ GNUNET_CRYPTO_cpabe_delete_key (struct GNUNET_CRYPTO_AbeKey *key,
199 GNUNET_free (key); 205 GNUNET_free (key);
200} 206}
201 207
208
202ssize_t 209ssize_t
203write_cpabe (void **result, 210write_cpabe (void **result,
204 uint32_t file_len, 211 uint32_t file_len,
@@ -227,6 +234,7 @@ write_cpabe (void **result,
227 return 12 + cph_buf_len + aes_buf_len; 234 return 12 + cph_buf_len + aes_buf_len;
228} 235}
229 236
237
230ssize_t 238ssize_t
231read_cpabe (const void *data, 239read_cpabe (const void *data,
232 char**cph_buf, 240 char**cph_buf,
@@ -257,6 +265,7 @@ read_cpabe (const void *data,
257 return buf_len; 265 return buf_len;
258} 266}
259 267
268
260ssize_t 269ssize_t
261GNUNET_CRYPTO_cpabe_encrypt (const void *block, 270GNUNET_CRYPTO_cpabe_encrypt (const void *block,
262 size_t size, 271 size_t size,
@@ -290,6 +299,7 @@ GNUNET_CRYPTO_cpabe_encrypt (const void *block,
290 return result_len; 299 return result_len;
291} 300}
292 301
302
293ssize_t 303ssize_t
294GNUNET_CRYPTO_cpabe_decrypt (const void *block, 304GNUNET_CRYPTO_cpabe_decrypt (const void *block,
295 size_t size, 305 size_t size,
@@ -329,6 +339,7 @@ GNUNET_CRYPTO_cpabe_decrypt (const void *block,
329 return plt_len; 339 return plt_len;
330} 340}
331 341
342
332ssize_t 343ssize_t
333GNUNET_CRYPTO_cpabe_serialize_key (const struct GNUNET_CRYPTO_AbeKey *key, 344GNUNET_CRYPTO_cpabe_serialize_key (const struct GNUNET_CRYPTO_AbeKey *key,
334 void **result) 345 void **result)
@@ -351,6 +362,7 @@ GNUNET_CRYPTO_cpabe_serialize_key (const struct GNUNET_CRYPTO_AbeKey *key,
351 return len; 362 return len;
352} 363}
353 364
365
354struct GNUNET_CRYPTO_AbeKey* 366struct GNUNET_CRYPTO_AbeKey*
355GNUNET_CRYPTO_cpabe_deserialize_key (const void *data, 367GNUNET_CRYPTO_cpabe_deserialize_key (const void *data,
356 size_t len) 368 size_t len)
@@ -375,6 +387,7 @@ GNUNET_CRYPTO_cpabe_deserialize_key (const void *data,
375 return key; 387 return key;
376} 388}
377 389
390
378ssize_t 391ssize_t
379GNUNET_CRYPTO_cpabe_serialize_master_key (const struct 392GNUNET_CRYPTO_cpabe_serialize_master_key (const struct
380 GNUNET_CRYPTO_AbeMasterKey *key, 393 GNUNET_CRYPTO_AbeMasterKey *key,
@@ -398,6 +411,7 @@ GNUNET_CRYPTO_cpabe_serialize_master_key (const struct
398 return len; 411 return len;
399} 412}
400 413
414
401struct GNUNET_CRYPTO_AbeMasterKey* 415struct GNUNET_CRYPTO_AbeMasterKey*
402GNUNET_CRYPTO_cpabe_deserialize_master_key (const void *data, 416GNUNET_CRYPTO_cpabe_deserialize_master_key (const void *data,
403 size_t len) 417 size_t len)
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c
index acc4a8ab4..5b01d5efe 100644
--- a/src/util/crypto_crc.c
+++ b/src/util/crypto_crc.c
@@ -72,6 +72,7 @@ crc_init ()
72 } 72 }
73} 73}
74 74
75
75/* 76/*
76 * This computes the standard preset and inverted CRC, as used 77 * This computes the standard preset and inverted CRC, as used
77 * by most networking standards. Start by passing in an initial 78 * by most networking standards. Start by passing in an initial
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index 6b11cdada..0e5c3d1ca 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -640,8 +640,7 @@ GNUNET_CRYPTO_ecdhe_key_create2 (struct GNUNET_CRYPTO_EcdhePrivateKey *pk)
640 but should also be harmless. For libgcrypt < 1.7, using 'eddsa' 640 but should also be harmless. For libgcrypt < 1.7, using 'eddsa'
641 disables an expensive key testing routine. We do not want to run 641 disables an expensive key testing routine. We do not want to run
642 the expensive check for ECDHE, as we generate TONS of keys to 642 the expensive check for ECDHE, as we generate TONS of keys to
643 use for a very short time. */ 643 use for a very short time. */if (0 != (rc = gcry_sexp_build (&s_keyparam,
644 if (0 != (rc = gcry_sexp_build (&s_keyparam,
645 NULL, 644 NULL,
646 "(genkey(ecc(curve \"" CURVE "\")" 645 "(genkey(ecc(curve \"" CURVE "\")"
647 "(flags eddsa no-keytest)))"))) 646 "(flags eddsa no-keytest)))")))
@@ -735,6 +734,7 @@ GNUNET_CRYPTO_ecdsa_key_create ()
735 return priv; 734 return priv;
736} 735}
737 736
737
738/** 738/**
739 * Create a new private key. Caller must free return value. 739 * Create a new private key. Caller must free return value.
740 * 740 *
@@ -1651,6 +1651,7 @@ GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1651 return ret; 1651 return ret;
1652} 1652}
1653 1653
1654
1654/** 1655/**
1655 * @ingroup crypto 1656 * @ingroup crypto
1656 * Derive key material from a ECDSA public key and a private ECDH key. 1657 * Derive key material from a ECDSA public key and a private ECDH key.
@@ -1672,4 +1673,5 @@ GNUNET_CRYPTO_ecdh_ecdsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1672 key_material); 1673 key_material);
1673} 1674}
1674 1675
1676
1675/* end of crypto_ecc.c */ 1677/* end of crypto_ecc.c */
diff --git a/src/util/crypto_ecc_setup.c b/src/util/crypto_ecc_setup.c
index 0ce9f9d1e..b3d410b7a 100644
--- a/src/util/crypto_ecc_setup.c
+++ b/src/util/crypto_ecc_setup.c
@@ -497,4 +497,5 @@ GNUNET_CRYPTO_eddsa_setup_key (const char *cfg_name)
497 GNUNET_CONFIGURATION_destroy (cfg); 497 GNUNET_CONFIGURATION_destroy (cfg);
498} 498}
499 499
500
500/* end of crypto_ecc_setup.c */ 501/* end of crypto_ecc_setup.c */
diff --git a/src/util/crypto_hash_file.c b/src/util/crypto_hash_file.c
index 0dff6326c..e070918d3 100644
--- a/src/util/crypto_hash_file.c
+++ b/src/util/crypto_hash_file.c
@@ -239,4 +239,5 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc)
239 GNUNET_free (fhc); 239 GNUNET_free (fhc);
240} 240}
241 241
242
242/* end of crypto_hash_file.c */ 243/* end of crypto_hash_file.c */
diff --git a/src/util/crypto_hkdf.c b/src/util/crypto_hkdf.c
index fea4f9861..99a50a449 100644
--- a/src/util/crypto_hkdf.c
+++ b/src/util/crypto_hkdf.c
@@ -49,7 +49,6 @@
49#define DEBUG_HKDF 0 49#define DEBUG_HKDF 0
50 50
51 51
52
53#if GNUNET_BUILD 52#if GNUNET_BUILD
54#include "platform.h" 53#include "platform.h"
55#include "gnunet_crypto_lib.h" 54#include "gnunet_crypto_lib.h"
@@ -84,6 +83,7 @@ doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf,
84 return (const void *) gcry_md_read (mac, 0); 83 return (const void *) gcry_md_read (mac, 0);
85} 84}
86 85
86
87/** 87/**
88 * @brief Generate pseudo-random key 88 * @brief Generate pseudo-random key
89 * @param mac gcrypt HMAC handle 89 * @param mac gcrypt HMAC handle
@@ -122,6 +122,8 @@ dump (const char *src, const void *p, unsigned int l)
122 } 122 }
123 printf ("\n"); 123 printf ("\n");
124} 124}
125
126
125#endif 127#endif
126 128
127 129
@@ -302,4 +304,5 @@ GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo,
302 return ret; 304 return ret;
303} 305}
304 306
307
305/* end of crypto_hkdf.c */ 308/* end of crypto_hkdf.c */
diff --git a/src/util/crypto_kdf.c b/src/util/crypto_kdf.c
index ac881b055..43a9731ff 100644
--- a/src/util/crypto_kdf.c
+++ b/src/util/crypto_kdf.c
@@ -62,9 +62,7 @@ GNUNET_CRYPTO_kdf_v (void *result,
62 * hash function." 62 * hash function."
63 * 63 *
64 * http://eprint.iacr.org/2010/264 64 * http://eprint.iacr.org/2010/264
65 */ 65 */return GNUNET_CRYPTO_hkdf_v (result,
66
67 return GNUNET_CRYPTO_hkdf_v (result,
68 out_len, 66 out_len,
69 GCRY_MD_SHA512, 67 GCRY_MD_SHA512,
70 GCRY_MD_SHA256, 68 GCRY_MD_SHA256,
@@ -171,4 +169,5 @@ GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r,
171 } 169 }
172} 170}
173 171
172
174/* end of crypto_kdf.c */ 173/* end of crypto_kdf.c */
diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c
index 5f1b456a5..51a29ac7c 100644
--- a/src/util/crypto_mpi.c
+++ b/src/util/crypto_mpi.c
@@ -145,4 +145,5 @@ GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result,
145 } 145 }
146} 146}
147 147
148
148/* end of crypto_mpi.c */ 149/* end of crypto_mpi.c */
diff --git a/src/util/crypto_paillier.c b/src/util/crypto_paillier.c
index 75d607706..0a08509ba 100644
--- a/src/util/crypto_paillier.c
+++ b/src/util/crypto_paillier.c
@@ -246,8 +246,7 @@ GNUNET_CRYPTO_paillier_encrypt (const struct
246 number has the same length (or is smaller), by counting the 246 number has the same length (or is smaller), by counting the
247 number of possible operations. We essentially divide max_num by 247 number of possible operations. We essentially divide max_num by
248 2 until the result is no longer larger than 'm', incrementing the 248 2 until the result is no longer larger than 'm', incrementing the
249 maximum number of operations in each round, starting at -2 */ 249 maximum number of operations in each round, starting at -2 */for (possible_opts = -2; gcry_mpi_cmp (max_num, m) > 0; possible_opts++)
250 for (possible_opts = -2; gcry_mpi_cmp (max_num, m) > 0; possible_opts++)
251 gcry_mpi_div (max_num, 250 gcry_mpi_div (max_num,
252 NULL, 251 NULL,
253 max_num, 252 max_num,
@@ -481,4 +480,5 @@ GNUNET_CRYPTO_paillier_hom_get_remaining (const struct
481 return ntohl (c->remaining_ops); 480 return ntohl (c->remaining_ops);
482} 481}
483 482
483
484/* end of crypto_paillier.c */ 484/* end of crypto_paillier.c */
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index f70763757..ffcabd0df 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -70,6 +70,8 @@ glibc_weak_rand32 ()
70 glibc_weak_rand32_state = val; 70 glibc_weak_rand32_state = val;
71 return val; 71 return val;
72} 72}
73
74
73#endif 75#endif
74 76
75/** 77/**
@@ -331,7 +333,8 @@ w_check (const void *p)
331/** 333/**
332 * Initialize libgcrypt. 334 * Initialize libgcrypt.
333 */ 335 */
334void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init () 336void __attribute__ ((constructor))
337GNUNET_CRYPTO_random_init ()
335{ 338{
336 gcry_error_t rc; 339 gcry_error_t rc;
337 340
@@ -369,7 +372,8 @@ void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
369/** 372/**
370 * Nicely shut down libgcrypt. 373 * Nicely shut down libgcrypt.
371 */ 374 */
372void __attribute__ ((destructor)) GNUNET_CRYPTO_random_fini () 375void __attribute__ ((destructor))
376GNUNET_CRYPTO_random_fini ()
373{ 377{
374 gcry_set_progress_handler (NULL, NULL); 378 gcry_set_progress_handler (NULL, NULL);
375#ifdef GCRYCTL_CLOSE_RANDOM_DEVICE 379#ifdef GCRYCTL_CLOSE_RANDOM_DEVICE
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index edabcd6d5..5c18e0b15 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -1181,8 +1181,7 @@ GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash,
1181 * so the exchange is being malicious in an unfamilair way, maybe 1181 * so the exchange is being malicious in an unfamilair way, maybe
1182 * just trying to crash us. Arguably, we've only an internal error 1182 * just trying to crash us. Arguably, we've only an internal error
1183 * though because we should've detected this in our previous call 1183 * though because we should've detected this in our previous call
1184 * to GNUNET_CRYPTO_rsa_unblind. */ 1184 * to GNUNET_CRYPTO_rsa_unblind. */return GNUNET_NO;
1185 return GNUNET_NO;
1186 } 1185 }
1187 1186
1188 data = mpi_to_sexp (r); 1187 data = mpi_to_sexp (r);
diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c
index a6e22521a..51414b00e 100644
--- a/src/util/crypto_symmetric.c
+++ b/src/util/crypto_symmetric.c
@@ -258,4 +258,5 @@ GNUNET_CRYPTO_symmetric_derive_iv_v (struct
258 argp); 258 argp);
259} 259}
260 260
261
261/* end of crypto_symmetric.c */ 262/* end of crypto_symmetric.c */
diff --git a/src/util/disk.c b/src/util/disk.c
index 32667d554..47a0ed5c9 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -194,6 +194,7 @@ GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h)
194 return ((! h) || (h->fd == -1)) ? GNUNET_YES : GNUNET_NO; 194 return ((! h) || (h->fd == -1)) ? GNUNET_YES : GNUNET_NO;
195} 195}
196 196
197
197/** 198/**
198 * Get the size of an open file. 199 * Get the size of an open file.
199 * 200 *
@@ -1145,10 +1146,11 @@ GNUNET_DISK_filename_canonicalize (char *fn)
1145 { 1146 {
1146 c = *idx; 1147 c = *idx;
1147 1148
1148 if ((c == '/') ||(c == '\\') ||(c == ':') ||(c == '*') ||(c == '?') ||(c == 1149 if ((c == '/') || (c == '\\') || (c == ':') || (c == '*') || (c == '?') ||
1149 '"') 1150 (c ==
1151 '"')
1150 || 1152 ||
1151 (c == '<') ||(c == '>') ||(c == '|') ) 1153 (c == '<') || (c == '>') || (c == '|') )
1152 { 1154 {
1153 *idx = '_'; 1155 *idx = '_';
1154 } 1156 }
@@ -1465,6 +1467,7 @@ GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h,
1465 return (*m)->addr; 1467 return (*m)->addr;
1466} 1468}
1467 1469
1470
1468/** 1471/**
1469 * Unmap a file 1472 * Unmap a file
1470 * @param h mapping handle 1473 * @param h mapping handle
@@ -1662,6 +1665,7 @@ GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p,
1662 return ret; 1665 return ret;
1663} 1666}
1664 1667
1668
1665/** 1669/**
1666 * Detaches one of the ends from the pipe. 1670 * Detaches one of the ends from the pipe.
1667 * Detached end is a fully-functional FileHandle, it will 1671 * Detached end is a fully-functional FileHandle, it will
diff --git a/src/util/getopt.c b/src/util/getopt.c
index 8ec148e15..acc1b6535 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -203,6 +203,7 @@ my_index (const char *str, int chr)
203 return 0; 203 return 0;
204} 204}
205 205
206
206/* If using GCC, we can safely declare strlen this way. 207/* If using GCC, we can safely declare strlen this way.
207 If not using GCC, it is ok not to declare it. */ 208 If not using GCC, it is ok not to declare it. */
208#ifdef __GNUC__ 209#ifdef __GNUC__
@@ -213,6 +214,7 @@ my_index (const char *str, int chr)
213 and has done so at least since version 2.4.5. -- rms. */ 214 and has done so at least since version 2.4.5. -- rms. */
214extern int 215extern int
215strlen (const char *); 216strlen (const char *);
217
216#endif /* not __STDC__ */ 218#endif /* not __STDC__ */
217#endif /* __GNUC__ */ 219#endif /* __GNUC__ */
218 220
@@ -241,6 +243,7 @@ static int last_nonopt;
241#if defined(__STDC__) && __STDC__ 243#if defined(__STDC__) && __STDC__
242static void 244static void
243exchange (char **); 245exchange (char **);
246
244#endif 247#endif
245 248
246static void 249static void
@@ -300,11 +303,13 @@ exchange (char **argv)
300 last_nonopt = GNoptind; 303 last_nonopt = GNoptind;
301} 304}
302 305
306
303/* Initialize the internal data when the first call is made. */ 307/* Initialize the internal data when the first call is made. */
304 308
305#if defined(__STDC__) && __STDC__ 309#if defined(__STDC__) && __STDC__
306static const char * 310static const char *
307_getopt_initialize (int, char *const *, const char *); 311_getopt_initialize (int, char *const *, const char *);
312
308#endif 313#endif
309static const char * 314static const char *
310_getopt_initialize (int argc, char *const *argv, const char *optstring) 315_getopt_initialize (int argc, char *const *argv, const char *optstring)
@@ -339,6 +344,7 @@ _getopt_initialize (int argc, char *const *argv, const char *optstring)
339 return optstring; 344 return optstring;
340} 345}
341 346
347
342/* Scan elements of ARGV (whose length is ARGC) for option characters 348/* Scan elements of ARGV (whose length is ARGC) for option characters
343 given in OPTSTRING. 349 given in OPTSTRING.
344 350
@@ -408,7 +414,7 @@ GN_getopt_internal (int argc,
408 414
409 GNoptarg = NULL; 415 GNoptarg = NULL;
410 416
411 if ((GNoptind == 0)|| ! __getopt_initialized) 417 if ((GNoptind == 0) || ! __getopt_initialized)
412 { 418 {
413 if (GNoptind == 0) 419 if (GNoptind == 0)
414 GNoptind = 1; /* Don't scan ARGV[0], the program name. */ 420 GNoptind = 1; /* Don't scan ARGV[0], the program name. */
@@ -422,7 +428,7 @@ GN_getopt_internal (int argc,
422 * is only used when the used in the GNU libc. */ 428 * is only used when the used in the GNU libc. */
423#define NONOPTION_P (argv[GNoptind][0] != '-' || argv[GNoptind][1] == '\0') 429#define NONOPTION_P (argv[GNoptind][0] != '-' || argv[GNoptind][1] == '\0')
424 430
425 if ((nextchar == NULL)||(*nextchar == '\0')) 431 if ((nextchar == NULL) || (*nextchar == '\0'))
426 { 432 {
427 /* Advance to the next ARGV-element. */ 433 /* Advance to the next ARGV-element. */
428 434
@@ -438,7 +444,7 @@ GN_getopt_internal (int argc,
438 /* If we have just processed some options following some non-options, 444 /* If we have just processed some options following some non-options,
439 * exchange them so that the options come first. */ 445 * exchange them so that the options come first. */
440 446
441 if ((first_nonopt != last_nonopt) &&(last_nonopt != GNoptind) ) 447 if ((first_nonopt != last_nonopt) && (last_nonopt != GNoptind) )
442 exchange ((char **) argv); 448 exchange ((char **) argv);
443 else if (last_nonopt != GNoptind) 449 else if (last_nonopt != GNoptind)
444 first_nonopt = GNoptind; 450 first_nonopt = GNoptind;
@@ -459,7 +465,7 @@ GN_getopt_internal (int argc,
459 { 465 {
460 GNoptind++; 466 GNoptind++;
461 467
462 if ((first_nonopt != last_nonopt) &&(last_nonopt != GNoptind) ) 468 if ((first_nonopt != last_nonopt) && (last_nonopt != GNoptind) )
463 exchange ((char **) argv); 469 exchange ((char **) argv);
464 else if (first_nonopt == last_nonopt) 470 else if (first_nonopt == last_nonopt)
465 first_nonopt = GNoptind; 471 first_nonopt = GNoptind;
@@ -511,10 +517,8 @@ GN_getopt_internal (int argc,
511 * the ARGV-element is "-fu", do consider that an abbreviation of 517 * the ARGV-element is "-fu", do consider that an abbreviation of
512 * the long option, just like "--fu", and not "-f" with arg "u". 518 * the long option, just like "--fu", and not "-f" with arg "u".
513 * 519 *
514 * This distinction seems to be the most useful approach. */ 520 * This distinction seems to be the most useful approach. */if ((longopts != NULL) &&
515 521 ((argv[GNoptind][1] == '-') ||
516 if ((longopts != NULL)&&
517 ((argv[GNoptind][1] == '-')||
518 (long_only && 522 (long_only &&
519 (argv[GNoptind][2] || ! my_index (optstring, argv[GNoptind][1]))))) 523 (argv[GNoptind][2] || ! my_index (optstring, argv[GNoptind][1])))))
520 { 524 {
@@ -632,7 +636,7 @@ GN_getopt_internal (int argc,
632 * or the option starts with '--' or is not a valid short 636 * or the option starts with '--' or is not a valid short
633 * option, then it's an error. 637 * option, then it's an error.
634 * Otherwise interpret it as a short option. */ 638 * Otherwise interpret it as a short option. */
635 if (! long_only ||(argv[GNoptind][1] == '-') || 639 if (! long_only || (argv[GNoptind][1] == '-') ||
636 (my_index (optstring, *nextchar) == NULL) ) 640 (my_index (optstring, *nextchar) == NULL) )
637 { 641 {
638 if (GNopterr) 642 if (GNopterr)
@@ -667,7 +671,7 @@ GN_getopt_internal (int argc,
667 if (*nextchar == '\0') 671 if (*nextchar == '\0')
668 ++GNoptind; 672 ++GNoptind;
669 673
670 if ((temp == NULL)||(c == ':')) 674 if ((temp == NULL) || (c == ':'))
671 { 675 {
672 if (GNopterr) 676 if (GNopterr)
673 { 677 {
@@ -680,7 +684,7 @@ GN_getopt_internal (int argc,
680 return '?'; 684 return '?';
681 } 685 }
682 /* Convenience. Treat POSIX -W foo same as long option --foo */ 686 /* Convenience. Treat POSIX -W foo same as long option --foo */
683 if ((temp[0] == 'W')&&(temp[1] == ';')) 687 if ((temp[0] == 'W') && (temp[1] == ';'))
684 { 688 {
685 char *nameend; 689 char *nameend;
686 const struct GNoption *p; 690 const struct GNoption *p;
@@ -871,6 +875,7 @@ GNgetopt_long (int argc,
871 return GN_getopt_internal (argc, argv, options, long_options, opt_index, 0); 875 return GN_getopt_internal (argc, argv, options, long_options, opt_index, 0);
872} 876}
873 877
878
874/* ******************** now the GNUnet specific modifications... ********************* */ 879/* ******************** now the GNUnet specific modifications... ********************* */
875 880
876/** 881/**
@@ -1008,4 +1013,5 @@ GNUNET_GETOPT_run (const char *binaryOptions,
1008 return GNoptind; 1013 return GNoptind;
1009} 1014}
1010 1015
1016
1011/* end of getopt.c */ 1017/* end of getopt.c */
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index c225f8f1f..f101e8b61 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -337,4 +337,5 @@ main (int argc, char *const *argv)
337 return ret; 337 return ret;
338} 338}
339 339
340
340/* end of gnunet-config.c */ 341/* end of gnunet-config.c */
diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c
index 72e50b2a8..02d2020ad 100644
--- a/src/util/gnunet-ecc.c
+++ b/src/util/gnunet-ecc.c
@@ -115,8 +115,7 @@ create_keys (const char *fn, const char *prefix)
115 * n = 5/8 = 0 (bytes) 115 * n = 5/8 = 0 (bytes)
116 * rest = 5%8 = 5 (bits) 116 * rest = 5%8 = 5 (bits)
117 * mask = ~(2**(8 - 5) - 1) = ~(2**3 - 1) = ~(8 - 1) = ~b111 = b11111000 117 * mask = ~(2**(8 - 5) - 1) = ~(2**3 - 1) = ~(8 - 1) = ~b111 = b11111000
118 */ 118 */mask = ~((int) pow (2, 8 - rest) - 1);
119 mask = ~((int) pow (2, 8 - rest) - 1);
120 target_byte = ((unsigned char *) &target_pub)[n] & mask; 119 target_byte = ((unsigned char *) &target_pub)[n] & mask;
121 } 120 }
122 else 121 else
@@ -480,4 +479,5 @@ main (int argc, char *const *argv)
480 return ret; 479 return ret;
481} 480}
482 481
482
483/* end of gnunet-ecc.c */ 483/* end of gnunet-ecc.c */
diff --git a/src/util/gnunet-resolver.c b/src/util/gnunet-resolver.c
index 83329635a..d2f3acd45 100644
--- a/src/util/gnunet-resolver.c
+++ b/src/util/gnunet-resolver.c
@@ -182,4 +182,5 @@ main (int argc, char *const *argv)
182 return ret; 182 return ret;
183} 183}
184 184
185
185/* end of gnunet-resolver.c */ 186/* end of gnunet-resolver.c */
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index e5de0ba73..8d8451950 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -344,4 +344,5 @@ main (int argc, char *const *argv)
344 return ret; 344 return ret;
345} 345}
346 346
347
347/* end of gnunet-scrypt.c */ 348/* end of gnunet-scrypt.c */
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c
index d7d456fba..c82a18ab8 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -704,6 +704,7 @@ pack (const char *hostname,
704 return GNUNET_OK; 704 return GNUNET_OK;
705} 705}
706 706
707
707static void 708static void
708cache_answers (const char *name, 709cache_answers (const char *name,
709 struct GNUNET_DNSPARSER_Record *records, 710 struct GNUNET_DNSPARSER_Record *records,
@@ -738,6 +739,7 @@ cache_answers (const char *name,
738 } 739 }
739} 740}
740 741
742
741/** 743/**
742 * We got a result from DNS. Add it to the cache and 744 * We got a result from DNS. Add it to the cache and
743 * see if we can make our client happy... 745 * see if we can make our client happy...
@@ -1366,12 +1368,15 @@ GNUNET_SERVICE_MAIN (
1366/** 1368/**
1367 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1369 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1368 */ 1370 */
1369void __attribute__ ((constructor)) GNUNET_RESOLVER_memory_init () 1371void __attribute__ ((constructor))
1372GNUNET_RESOLVER_memory_init ()
1370{ 1373{
1371 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1374 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1372 mallopt (M_TOP_PAD, 1 * 1024); 1375 mallopt (M_TOP_PAD, 1 * 1024);
1373 malloc_trim (0); 1376 malloc_trim (0);
1374} 1377}
1378
1379
1375#endif 1380#endif
1376 1381
1377 1382
diff --git a/src/util/gnunet-timeout.c b/src/util/gnunet-timeout.c
index cd6707db8..f650475cb 100644
--- a/src/util/gnunet-timeout.c
+++ b/src/util/gnunet-timeout.c
@@ -116,4 +116,5 @@ main (int argc, char *argv[])
116 exit (-1); 116 exit (-1);
117} 117}
118 118
119
119/* end of timeout_watchdog.c */ 120/* end of timeout_watchdog.c */
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index a80ac0997..84100ff56 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -188,4 +188,5 @@ main (int argc, char *const *argv)
188 return ((GNUNET_OK == ret) && (0 == exit_code)) ? 0 : 1; 188 return ((GNUNET_OK == ret) && (0 == exit_code)) ? 0 : 1;
189} 189}
190 190
191
191/* end of gnunet-uri.c */ 192/* end of gnunet-uri.c */
diff --git a/src/util/helper.c b/src/util/helper.c
index 9ebbdb188..8c8fb7b6a 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -683,6 +683,7 @@ GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
683 return sh; 683 return sh;
684} 684}
685 685
686
686/** 687/**
687 * Cancel a #GNUNET_HELPER_send operation. If possible, transmitting the 688 * Cancel a #GNUNET_HELPER_send operation. If possible, transmitting the
688 * message is also aborted, but at least 'cont' won't be 689 * message is also aborted, but at least 'cont' won't be
diff --git a/src/util/load.c b/src/util/load.c
index bab2f375e..cfbfa36d6 100644
--- a/src/util/load.c
+++ b/src/util/load.c
@@ -169,8 +169,7 @@ calculate_load (struct GNUNET_LOAD_Value *load)
169 * stddev = (sum (val_i - avg)^2) / (n-1) 169 * stddev = (sum (val_i - avg)^2) / (n-1)
170 * = (sum (val_i^2 - 2 avg val_i + avg^2) / (n-1) 170 * = (sum (val_i^2 - 2 avg val_i + avg^2) / (n-1)
171 * = (sum (val_i^2) - 2 avg sum (val_i) + n * avg^2) / (n-1) 171 * = (sum (val_i^2) - 2 avg sum (val_i) + n * avg^2) / (n-1)
172 */ 172 */sum_val_i = (double) load->cummulative_delay;
173 sum_val_i = (double) load->cummulative_delay;
174 n = ((double) load->cummulative_request_count); 173 n = ((double) load->cummulative_request_count);
175 nm1 = n - 1.0; 174 nm1 = n - 1.0;
176 avgdel = sum_val_i / n; 175 avgdel = sum_val_i / n;
@@ -254,5 +253,4 @@ GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data)
254} 253}
255 254
256 255
257
258/* end of load.c */ 256/* end of load.c */
diff --git a/src/util/mst.c b/src/util/mst.c
index a3f1368e4..7fe93c55c 100644
--- a/src/util/mst.c
+++ b/src/util/mst.c
@@ -415,5 +415,4 @@ GNUNET_MST_destroy (struct GNUNET_MessageStreamTokenizer *mst)
415} 415}
416 416
417 417
418
419/* end of server_mst.c */ 418/* end of server_mst.c */
diff --git a/src/util/nc.c b/src/util/nc.c
index 9db321b8c..49c95c14e 100644
--- a/src/util/nc.c
+++ b/src/util/nc.c
@@ -223,4 +223,5 @@ GNUNET_notification_context_get_size (struct GNUNET_NotificationContext *nc)
223 return num; 223 return num;
224} 224}
225 225
226
226/* end of nc.c */ 227/* end of nc.c */
diff --git a/src/util/network.c b/src/util/network.c
index ce4f2f896..99de5a7aa 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -323,6 +323,8 @@ socket_set_nosigpipe (const struct GNUNET_NETWORK_Handle *h)
323 return GNUNET_SYSERR; 323 return GNUNET_SYSERR;
324 return GNUNET_OK; 324 return GNUNET_OK;
325} 325}
326
327
326#endif 328#endif
327 329
328 330
@@ -1385,4 +1387,5 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
1385 GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) ? NULL : &tv); 1387 GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) ? NULL : &tv);
1386} 1388}
1387 1389
1390
1388/* end of network.c */ 1391/* end of network.c */
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index a4ef199cc..7aa4d1254 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -207,6 +207,8 @@ get_path_from_proc_exe ()
207 lnk[size] = '\0'; 207 lnk[size] = '\0';
208 return GNUNET_strdup (lnk); 208 return GNUNET_strdup (lnk);
209} 209}
210
211
210#endif 212#endif
211 213
212 214
@@ -292,6 +294,8 @@ get_path_from_dyld_image ()
292 } 294 }
293 return NULL; 295 return NULL;
294} 296}
297
298
295#endif 299#endif
296 300
297 301
diff --git a/src/util/os_network.c b/src/util/os_network.c
index e310455e0..9ee26f0a9 100644
--- a/src/util/os_network.c
+++ b/src/util/os_network.c
@@ -381,6 +381,8 @@ try_ip (GNUNET_OS_NetworkInterfaceProcessor proc,
381 pclose (f); 381 pclose (f);
382 return GNUNET_OK; 382 return GNUNET_OK;
383} 383}
384
385
384#endif 386#endif
385 387
386 388
@@ -403,7 +405,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
403 { 405 {
404 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next) 406 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next)
405 { 407 {
406 if ((ifa_ptr->ifa_name != NULL) &&(ifa_ptr->ifa_addr != NULL) && 408 if ((ifa_ptr->ifa_name != NULL) && (ifa_ptr->ifa_addr != NULL) &&
407 ( (ifa_ptr->ifa_flags & IFF_UP) != 0) ) 409 ( (ifa_ptr->ifa_flags & IFF_UP) != 0) )
408 { 410 {
409 if ((ifa_ptr->ifa_addr->sa_family != AF_INET) && 411 if ((ifa_ptr->ifa_addr->sa_family != AF_INET) &&
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index ad510a9b3..3b4858ca4 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -293,7 +293,6 @@ GNUNET_OS_process_destroy (struct GNUNET_OS_Process *proc)
293} 293}
294 294
295 295
296
297/** 296/**
298 * Open '/dev/null' and make the result the given 297 * Open '/dev/null' and make the result the given
299 * file descriptor. 298 * file descriptor.
diff --git a/src/util/peer.c b/src/util/peer.c
index 3216f1a57..257922f36 100644
--- a/src/util/peer.c
+++ b/src/util/peer.c
@@ -250,5 +250,4 @@ GNUNET_PEER_resolve2 (GNUNET_PEER_Id id)
250} 250}
251 251
252 252
253
254/* end of peer.c */ 253/* end of peer.c */
diff --git a/src/util/perf_crypto_asymmetric.c b/src/util/perf_crypto_asymmetric.c
index 1f2182909..7594733b0 100644
--- a/src/util/perf_crypto_asymmetric.c
+++ b/src/util/perf_crypto_asymmetric.c
@@ -128,4 +128,5 @@ main (int argc, char *argv[])
128 return 0; 128 return 0;
129} 129}
130 130
131
131/* end of perf_crypto_asymmetric.c */ 132/* end of perf_crypto_asymmetric.c */
diff --git a/src/util/perf_crypto_ecc_dlog.c b/src/util/perf_crypto_ecc_dlog.c
index 106b07026..8a0e4676b 100644
--- a/src/util/perf_crypto_ecc_dlog.c
+++ b/src/util/perf_crypto_ecc_dlog.c
@@ -173,4 +173,5 @@ main (int argc, char *argv[])
173 return 0; 173 return 0;
174} 174}
175 175
176
176/* end of perf_crypto_ecc_dlog.c */ 177/* end of perf_crypto_ecc_dlog.c */
diff --git a/src/util/perf_crypto_hash.c b/src/util/perf_crypto_hash.c
index 95eca8e7a..3bd483639 100644
--- a/src/util/perf_crypto_hash.c
+++ b/src/util/perf_crypto_hash.c
@@ -110,4 +110,5 @@ main (int argc, char *argv[])
110 return 0; 110 return 0;
111} 111}
112 112
113
113/* end of perf_crypto_hash.c */ 114/* end of perf_crypto_hash.c */
diff --git a/src/util/perf_crypto_paillier.c b/src/util/perf_crypto_paillier.c
index dd5622108..35e6cce16 100644
--- a/src/util/perf_crypto_paillier.c
+++ b/src/util/perf_crypto_paillier.c
@@ -91,4 +91,5 @@ main (int argc, char *argv[])
91 return 0; 91 return 0;
92} 92}
93 93
94
94/* end of perf_crypto_paillier.c */ 95/* end of perf_crypto_paillier.c */
diff --git a/src/util/perf_crypto_rsa.c b/src/util/perf_crypto_rsa.c
index c65739f1f..d652e8d4e 100644
--- a/src/util/perf_crypto_rsa.c
+++ b/src/util/perf_crypto_rsa.c
@@ -88,8 +88,7 @@ eval (unsigned int len)
88 64 * 1024 / (1 + 88 64 * 1024 / (1 +
89 GNUNET_TIME_absolute_get_duration 89 GNUNET_TIME_absolute_get_duration
90 (start).rel_value_us / 1000LL), "keys/ms"); 90 (start).rel_value_us / 1000LL), "keys/ms");
91 */ 91 */start = GNUNET_TIME_absolute_get ();
92 start = GNUNET_TIME_absolute_get ();
93 GNUNET_CRYPTO_hash ("test", 4, &hc); 92 GNUNET_CRYPTO_hash ("test", 4, &hc);
94 for (i = 0; i < 10; i++) 93 for (i = 0; i < 10; i++)
95 { 94 {
diff --git a/src/util/perf_crypto_symmetric.c b/src/util/perf_crypto_symmetric.c
index c05700155..8176361ba 100644
--- a/src/util/perf_crypto_symmetric.c
+++ b/src/util/perf_crypto_symmetric.c
@@ -73,4 +73,5 @@ main (int argc, char *argv[])
73 return 0; 73 return 0;
74} 74}
75 75
76
76/* end of perf_crypto_aes.c */ 77/* end of perf_crypto_aes.c */
diff --git a/src/util/perf_malloc.c b/src/util/perf_malloc.c
index 3682777bd..727e15979 100644
--- a/src/util/perf_malloc.c
+++ b/src/util/perf_malloc.c
@@ -62,4 +62,5 @@ main (int argc, char *argv[])
62 return 0; 62 return 0;
63} 63}
64 64
65
65/* end of perf_malloc.c */ 66/* end of perf_malloc.c */
diff --git a/src/util/program.c b/src/util/program.c
index 630ec6205..5ad069edd 100644
--- a/src/util/program.c
+++ b/src/util/program.c
@@ -318,8 +318,7 @@ GNUNET_PROGRAM_run2 (int argc,
318 specified in the configuration, remember the command-line option 318 specified in the configuration, remember the command-line option
319 in "cfg". This is typically really only having an effect if we 319 in "cfg". This is typically really only having an effect if we
320 are running code in src/arm/, as obviously the rest of the code 320 are running code in src/arm/, as obviously the rest of the code
321 has little business with ARM-specific options. */ 321 has little business with ARM-specific options. */if (GNUNET_YES != GNUNET_CONFIGURATION_have_value (cfg, "arm", "CONFIG"))
322 if (GNUNET_YES != GNUNET_CONFIGURATION_have_value (cfg, "arm", "CONFIG"))
323 { 322 {
324 if (NULL != cc.cfgfile) 323 if (NULL != cc.cfgfile)
325 GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", cc.cfgfile); 324 GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", cc.cfgfile);
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 89dba3799..48a3f04ce 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -1380,6 +1380,8 @@ check_fd (struct GNUNET_SCHEDULER_Task *t, int raw_fd)
1380 } 1380 }
1381 } 1381 }
1382} 1382}
1383
1384
1383#endif 1385#endif
1384 1386
1385 1387
@@ -1564,6 +1566,7 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
1564 task, task_cls); 1566 task, task_cls);
1565} 1567}
1566 1568
1569
1567/** 1570/**
1568 * Schedule a new task to be run with a specified delay or when the 1571 * Schedule a new task to be run with a specified delay or when the
1569 * specified file descriptor is ready. The delay can be 1572 * specified file descriptor is ready. The delay can be
@@ -1857,8 +1860,7 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1857 * this case gracefully because some libraries such as libmicrohttpd 1860 * this case gracefully because some libraries such as libmicrohttpd
1858 * only provide a hint what the maximum FD number in an FD set might be 1861 * only provide a hint what the maximum FD number in an FD set might be
1859 * and not the exact FD number (see e.g. gnunet-rest-service.c) 1862 * and not the exact FD number (see e.g. gnunet-rest-service.c)
1860 */ 1863 */int no_fds_extracted = (0 == read_nhandles_len) &&
1861 int no_fds_extracted = (0 == read_nhandles_len) &&
1862 (0 == read_fhandles_len) && 1864 (0 == read_fhandles_len) &&
1863 (0 == write_nhandles_len) && 1865 (0 == write_nhandles_len) &&
1864 (0 == write_fhandles_len); 1866 (0 == write_fhandles_len);
@@ -2024,8 +2026,7 @@ GNUNET_SCHEDULER_do_work (struct GNUNET_SCHEDULER_Handle *sh)
2024 * 2026 *
2025 * It might also mean we are busy-waiting because of a programming 2027 * It might also mean we are busy-waiting because of a programming
2026 * error in the external event loop. 2028 * error in the external event loop.
2027 */ 2029 */LOG (GNUNET_ERROR_TYPE_DEBUG,
2028 LOG (GNUNET_ERROR_TYPE_DEBUG,
2029 "GNUNET_SCHEDULER_do_work did not find any ready " 2030 "GNUNET_SCHEDULER_do_work did not find any ready "
2030 "tasks and timeout has not been reached yet.\n"); 2031 "tasks and timeout has not been reached yet.\n");
2031 } 2032 }
diff --git a/src/util/signal.c b/src/util/signal.c
index fd7eecdd3..8b9a9a291 100644
--- a/src/util/signal.c
+++ b/src/util/signal.c
@@ -72,6 +72,7 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler)
72 return ret; 72 return ret;
73} 73}
74 74
75
75void 76void
76GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx) 77GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx)
77{ 78{
diff --git a/src/util/socks.c b/src/util/socks.c
index c2e012f1c..756be753a 100644
--- a/src/util/socks.c
+++ b/src/util/socks.c
@@ -387,8 +387,7 @@ transmit_ready (void *cls, size_t size, void *buf)
387 * connection.c tells us nothing itself, but mostly its timouts. 387 * connection.c tells us nothing itself, but mostly its timouts.
388 * Initially, we'll simply ignore this and leave massive timeouts, but 388 * Initially, we'll simply ignore this and leave massive timeouts, but
389 * maybe that should change for error handling pruposes. It appears that 389 * maybe that should change for error handling pruposes. It appears that
390 * successful operations, including DNS resolution, do not use this. */ 390 * successful operations, including DNS resolution, do not use this. */if (NULL == buf)
391 if (NULL == buf)
392 { 391 {
393 if (0 == ih->step) 392 if (0 == ih->step)
394 { 393 {
@@ -629,7 +628,7 @@ GNUNET_SOCKS_do_connect (const char *service_name,
629 port0 = 9050; 628 port0 = 9050;
630 /* A typical Tor client should usually try port 9150 for the TBB too, but 629 /* A typical Tor client should usually try port 9150 for the TBB too, but
631 * GNUnet can probably assume a system Tor installation. */ 630 * GNUnet can probably assume a system Tor installation. */
632 if ((port0 > 65535)||(port0 <= 0)) 631 if ((port0 > 65535) || (port0 <= 0))
633 { 632 {
634 LOG (GNUNET_ERROR_TYPE_WARNING, 633 LOG (GNUNET_ERROR_TYPE_WARNING,
635 _ ( 634 _ (
@@ -686,4 +685,5 @@ GNUNET_SOCKS_do_connect (const char *service_name,
686 return GNUNET_SOCKS_run_handshake (ih, socks5); 685 return GNUNET_SOCKS_run_handshake (ih, socks5);
687} 686}
688 687
688
689/* socks.c */ 689/* socks.c */
diff --git a/src/util/speedup.c b/src/util/speedup.c
index 81fdab48a..3d9e82319 100644
--- a/src/util/speedup.c
+++ b/src/util/speedup.c
@@ -115,4 +115,5 @@ GNUNET_SPEEDUP_stop_ ()
115 "Stopped execution speed up\n"); 115 "Stopped execution speed up\n");
116} 116}
117 117
118
118/* end of speedup.c */ 119/* end of speedup.c */
diff --git a/src/util/strings.c b/src/util/strings.c
index 3442a6bf7..4e7451283 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -754,9 +754,7 @@ GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t)
754 * As for msvcrt, use the wide variant, which always returns utf16 754 * As for msvcrt, use the wide variant, which always returns utf16
755 * (otherwise we'd have to detect current codepage or use W32API character 755 * (otherwise we'd have to detect current codepage or use W32API character
756 * set conversion routines to convert to UTF8). 756 * set conversion routines to convert to UTF8).
757 */ 757 */strftime (buf, sizeof(buf), "%a %b %d %H:%M:%S %Y", tp);
758
759 strftime (buf, sizeof(buf), "%a %b %d %H:%M:%S %Y", tp);
760 758
761 return buf; 759 return buf;
762} 760}
@@ -1052,9 +1050,9 @@ GNUNET_STRINGS_parse_uri (const char *path,
1052 pp_state += 1; 1050 pp_state += 1;
1053 continue; 1051 continue;
1054 } 1052 }
1055 if (! (((path[i] >= 'A') &&(path[i] <= 'Z') ) || 1053 if (! (((path[i] >= 'A') && (path[i] <= 'Z') ) ||
1056 ((path[i] >= 'a') &&(path[i] <= 'z') ) || 1054 ((path[i] >= 'a') && (path[i] <= 'z') ) ||
1057 ((path[i] >= '0') &&(path[i] <= '9') ) ||(path[i] == '+') || 1055 ((path[i] >= '0') && (path[i] <= '9') ) || (path[i] == '+') ||
1058 (path[i] == '-') || (path[i] == '.'))) 1056 (path[i] == '-') || (path[i] == '.')))
1059 end = 1; 1057 end = 1;
1060 break; 1058 break;
@@ -1898,6 +1896,7 @@ GNUNET_STRINGS_base64_encode (const void *in, size_t len, char **output)
1898 return ret; 1896 return ret;
1899} 1897}
1900 1898
1899
1901#define cvtfind(a) \ 1900#define cvtfind(a) \
1902 ((((a) >= 'A') && ((a) <= 'Z')) \ 1901 ((((a) >= 'A') && ((a) <= 'Z')) \
1903 ? (a) - 'A' \ 1902 ? (a) - 'A' \
diff --git a/src/util/test_bio.c b/src/util/test_bio.c
index 180cada76..8ff93c168 100644
--- a/src/util/test_bio.c
+++ b/src/util/test_bio.c
@@ -76,6 +76,7 @@ test_normal_rw ()
76 return 0; 76 return 0;
77} 77}
78 78
79
79static int 80static int
80test_nullstring_rw () 81test_nullstring_rw ()
81{ 82{
@@ -103,6 +104,7 @@ test_nullstring_rw ()
103 return 0; 104 return 0;
104} 105}
105 106
107
106static int 108static int
107test_emptystring_rw () 109test_emptystring_rw ()
108{ 110{
@@ -130,6 +132,7 @@ test_emptystring_rw ()
130 return 0; 132 return 0;
131} 133}
132 134
135
133static int 136static int
134test_bigstring_rw () 137test_bigstring_rw ()
135{ 138{
@@ -159,6 +162,7 @@ test_bigstring_rw ()
159 return 0; 162 return 0;
160} 163}
161 164
165
162static int 166static int
163test_bigmeta_rw () 167test_bigmeta_rw ()
164{ 168{
@@ -192,6 +196,7 @@ test_bigmeta_rw ()
192 return 0; 196 return 0;
193} 197}
194 198
199
195static int 200static int
196test_directory_r () 201test_directory_r ()
197{ 202{
@@ -212,6 +217,7 @@ test_directory_r ()
212 return 0; 217 return 0;
213} 218}
214 219
220
215static int 221static int
216test_nullfile_rw () 222test_nullfile_rw ()
217{ 223{
@@ -287,6 +293,7 @@ test_fullfile_rw ()
287 return 0; 293 return 0;
288} 294}
289 295
296
290static int 297static int
291test_fakestring_rw () 298test_fakestring_rw ()
292{ 299{
@@ -315,6 +322,7 @@ test_fakestring_rw ()
315 return 0; 322 return 0;
316} 323}
317 324
325
318static int 326static int
319test_fakemeta_rw () 327test_fakemeta_rw ()
320{ 328{
@@ -345,6 +353,7 @@ test_fakemeta_rw ()
345 return 0; 353 return 0;
346} 354}
347 355
356
348static int 357static int
349test_fakebigmeta_rw () 358test_fakebigmeta_rw ()
350{ 359{
@@ -375,6 +384,7 @@ test_fakebigmeta_rw ()
375 return 0; 384 return 0;
376} 385}
377 386
387
378static int 388static int
379check_string_rw () 389check_string_rw ()
380{ 390{
@@ -385,6 +395,7 @@ check_string_rw ()
385 return 0; 395 return 0;
386} 396}
387 397
398
388static int 399static int
389check_metadata_rw () 400check_metadata_rw ()
390{ 401{
@@ -394,6 +405,7 @@ check_metadata_rw ()
394 return 0; 405 return 0;
395} 406}
396 407
408
397static int 409static int
398check_file_rw () 410check_file_rw ()
399{ 411{
@@ -404,6 +416,7 @@ check_file_rw ()
404 return 0; 416 return 0;
405} 417}
406 418
419
407int 420int
408main (int argc, char *argv[]) 421main (int argc, char *argv[])
409{ 422{
@@ -414,4 +427,5 @@ main (int argc, char *argv[])
414 return 0; 427 return 0;
415} 428}
416 429
430
417/* end of test_bio.c */ 431/* end of test_bio.c */
diff --git a/src/util/test_client.c b/src/util/test_client.c
index fafb967b4..ef5765fff 100644
--- a/src/util/test_client.c
+++ b/src/util/test_client.c
@@ -192,4 +192,5 @@ main (int argc,
192 return global_ret; 192 return global_ret;
193} 193}
194 194
195
195/* end of test_client.c */ 196/* end of test_client.c */
diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c
index 1c41a10bc..e2fc29e82 100644
--- a/src/util/test_common_allocation.c
+++ b/src/util/test_common_allocation.c
@@ -150,4 +150,5 @@ main (int argc, char *argv[])
150 return ret; 150 return ret;
151} 151}
152 152
153
153/* end of test_common_allocation.c */ 154/* end of test_common_allocation.c */
diff --git a/src/util/test_common_endian.c b/src/util/test_common_endian.c
index 0fc23fb44..10a85a1bb 100644
--- a/src/util/test_common_endian.c
+++ b/src/util/test_common_endian.c
@@ -39,4 +39,5 @@ main (int argc, char *argv[])
39 return 0; 39 return 0;
40} 40}
41 41
42
42/* end of test_common_endian.c */ 43/* end of test_common_endian.c */
diff --git a/src/util/test_common_logging.c b/src/util/test_common_logging.c
index d905a3bf3..7d7656ed8 100644
--- a/src/util/test_common_logging.c
+++ b/src/util/test_common_logging.c
@@ -36,7 +36,6 @@ my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component,
36} 36}
37 37
38 38
39
40int 39int
41main (int argc, char *argv[]) 40main (int argc, char *argv[])
42{ 41{
@@ -96,4 +95,5 @@ main (int argc, char *argv[])
96 return 0; 95 return 0;
97} /* end of main */ 96} /* end of main */
98 97
98
99/* end of test_common_logging.c */ 99/* end of test_common_logging.c */
diff --git a/src/util/test_common_logging_dummy.c b/src/util/test_common_logging_dummy.c
index 9a08714ec..ffcad888e 100644
--- a/src/util/test_common_logging_dummy.c
+++ b/src/util/test_common_logging_dummy.c
@@ -62,6 +62,8 @@ expensive_func ()
62{ 62{
63 return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY); 63 return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY);
64} 64}
65
66
65#endif 67#endif
66 68
67 69
@@ -116,4 +118,5 @@ main (int argc, char *argv[])
116 return 0; 118 return 0;
117} /* end of main */ 119} /* end of main */
118 120
121
119/* end of test_common_logging_dummy.c */ 122/* end of test_common_logging_dummy.c */
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index b82138492..2f5efa198 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -113,8 +113,8 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2,
113 j = 0; 113 j = 0;
114 int stage = 0; 114 int stage = 0;
115 115
116 if (! ((phase >= phase_from1)&&(phase <= phase_to1)) && 116 if (! ((phase >= phase_from1) && (phase <= phase_to1)) &&
117 ! ((phase >= phase_from2)&&(phase <= phase_to2))) 117 ! ((phase >= phase_from2) && (phase <= phase_to2)))
118 return p; 118 return p;
119#if 0 119#if 0
120 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 120 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -196,6 +196,7 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2,
196 return &r[i]; 196 return &r[i];
197} 197}
198 198
199
199/** 200/**
200 * Up to 8 non-skipped GNUNET_log() calls 201 * Up to 8 non-skipped GNUNET_log() calls
201 * + extra line with delay for each one 202 * + extra line with delay for each one
@@ -259,10 +260,9 @@ read_call (void *cls)
259 * | 7D * * * * * * * * 260 * | 7D * * * * * * * *
260 * | 8 * * * * 261 * | 8 * * * *
261 * | 9 * * * * 262 * | 9 * * * *
262 */ 263 */char *p = buf;
263 char *p = buf;
264 264
265 if ((bytes == LOG_BUFFER_SIZE)|| 265 if ((bytes == LOG_BUFFER_SIZE) ||
266 ! (p = 266 ! (p =
267 read_output_line (0, 3, 4, 9, 'L', "ERROR", -1, 267 read_output_line (0, 3, 4, 9, 'L', "ERROR", -1,
268 1, phase, p, 268 1, phase, p,
@@ -453,4 +453,5 @@ main (int argc, char *argv[])
453 return ok; 453 return ok;
454} 454}
455 455
456
456/* end of test_common_logging_runtime_loglevels.c */ 457/* end of test_common_logging_runtime_loglevels.c */
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c
index c3a773ab6..6227a28db 100644
--- a/src/util/test_configuration.c
+++ b/src/util/test_configuration.c
@@ -123,7 +123,7 @@ diffsCallBack (void *cls, const char *section, const char *option,
123 option, &diffValue); 123 option, &diffValue);
124 if (NULL != diffValue) 124 if (NULL != diffValue)
125 { 125 {
126 if ((ret == GNUNET_SYSERR) ||(strcmp (diffValue, value) != 0) ) 126 if ((ret == GNUNET_SYSERR) || (strcmp (diffValue, value) != 0) )
127 cbData->status = 1; 127 cbData->status = 1;
128 } 128 }
129 else 129 else
@@ -204,6 +204,7 @@ editConfiguration (struct GNUNET_CONFIGURATION_Handle *cfg, int option)
204 return diffsCB.cfgDiffs; 204 return diffsCB.cfgDiffs;
205} 205}
206 206
207
207/** 208/**
208 * Checking configuration diffs 209 * Checking configuration diffs
209 */ 210 */
@@ -349,6 +350,7 @@ testConfig ()
349 return 0; 350 return 0;
350} 351}
351 352
353
352static const char *want[] = { 354static const char *want[] = {
353 "/Hello", 355 "/Hello",
354 "/File Name", 356 "/File Name",
@@ -371,6 +373,7 @@ check (void *data, const char *fn)
371 return GNUNET_SYSERR; 373 return GNUNET_SYSERR;
372} 374}
373 375
376
374static int 377static int
375testConfigFilenames () 378testConfigFilenames ()
376{ 379{
diff --git a/src/util/test_container_bloomfilter.c b/src/util/test_container_bloomfilter.c
index 0217bad44..67fbaf38b 100644
--- a/src/util/test_container_bloomfilter.c
+++ b/src/util/test_container_bloomfilter.c
@@ -40,6 +40,7 @@ nextHC (struct GNUNET_HashCode *hc)
40 GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, hc); 40 GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, hc);
41} 41}
42 42
43
43static int 44static int
44add_iterator (void *cls, struct GNUNET_HashCode *next) 45add_iterator (void *cls, struct GNUNET_HashCode *next)
45{ 46{
@@ -53,6 +54,7 @@ add_iterator (void *cls, struct GNUNET_HashCode *next)
53 return GNUNET_YES; 54 return GNUNET_YES;
54} 55}
55 56
57
56int 58int
57main (int argc, char *argv[]) 59main (int argc, char *argv[])
58{ 60{
diff --git a/src/util/test_container_dll.c b/src/util/test_container_dll.c
index b5c238511..33671d00b 100644
--- a/src/util/test_container_dll.c
+++ b/src/util/test_container_dll.c
@@ -109,4 +109,5 @@ main (int argc, char **argv)
109 return 0; 109 return 0;
110} 110}
111 111
112
112/* end of test_container_heap.c */ 113/* end of test_container_heap.c */
diff --git a/src/util/test_container_heap.c b/src/util/test_container_heap.c
index 2530f3dbc..c83c7810f 100644
--- a/src/util/test_container_heap.c
+++ b/src/util/test_container_heap.c
@@ -35,6 +35,7 @@ iterator_callback (void *cls,
35 return GNUNET_OK; 35 return GNUNET_OK;
36} 36}
37 37
38
38static int 39static int
39nstrcmp (const char *a, const char *b) 40nstrcmp (const char *a, const char *b)
40{ 41{
@@ -43,6 +44,7 @@ nstrcmp (const char *a, const char *b)
43 return strcmp (a, b); 44 return strcmp (a, b);
44} 45}
45 46
47
46static int 48static int
47check () 49check ()
48{ 50{
@@ -287,4 +289,5 @@ main (int argc, char **argv)
287 return check (); 289 return check ();
288} 290}
289 291
292
290/* end of test_container_heap.c */ 293/* end of test_container_heap.c */
diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c
index 1d82bd701..bd9e7af31 100644
--- a/src/util/test_container_multihashmap.c
+++ b/src/util/test_container_multihashmap.c
@@ -120,6 +120,7 @@ testMap (int i)
120 return 0; 120 return 0;
121} 121}
122 122
123
123int 124int
124main (int argc, char *argv[]) 125main (int argc, char *argv[])
125{ 126{
@@ -134,4 +135,5 @@ main (int argc, char *argv[])
134 return 0; 135 return 0;
135} 136}
136 137
138
137/* end of test_container_multihashmap.c */ 139/* end of test_container_multihashmap.c */
diff --git a/src/util/test_container_multihashmap32.c b/src/util/test_container_multihashmap32.c
index 81b941d5e..92aac6eeb 100644
--- a/src/util/test_container_multihashmap32.c
+++ b/src/util/test_container_multihashmap32.c
@@ -90,6 +90,7 @@ testMap (int i)
90 return 0; 90 return 0;
91} 91}
92 92
93
93int 94int
94main (int argc, char *argv[]) 95main (int argc, char *argv[])
95{ 96{
@@ -104,4 +105,5 @@ main (int argc, char *argv[])
104 return 0; 105 return 0;
105} 106}
106 107
108
107/* end of test_container_multihashmap.c */ 109/* end of test_container_multihashmap.c */
diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c
index 19cd67080..9aeead56c 100644
--- a/src/util/test_container_multipeermap.c
+++ b/src/util/test_container_multipeermap.c
@@ -120,6 +120,7 @@ testMap (int i)
120 return 0; 120 return 0;
121} 121}
122 122
123
123int 124int
124main (int argc, char *argv[]) 125main (int argc, char *argv[])
125{ 126{
@@ -134,4 +135,5 @@ main (int argc, char *argv[])
134 return 0; 135 return 0;
135} 136}
136 137
138
137/* end of test_container_multipeermap.c */ 139/* end of test_container_multipeermap.c */
diff --git a/src/util/test_crypto_ecc_dlog.c b/src/util/test_crypto_ecc_dlog.c
index b3b2a7480..a2c02a94e 100644
--- a/src/util/test_crypto_ecc_dlog.c
+++ b/src/util/test_crypto_ecc_dlog.c
@@ -164,7 +164,6 @@ test_math (struct GNUNET_CRYPTO_EccDlogContext *edc)
164} 164}
165 165
166 166
167
168int 167int
169main (int argc, char *argv[]) 168main (int argc, char *argv[])
170{ 169{
@@ -192,4 +191,5 @@ main (int argc, char *argv[])
192 return 0; 191 return 0;
193} 192}
194 193
194
195/* end of test_crypto_ecc_dlog.c */ 195/* end of test_crypto_ecc_dlog.c */
diff --git a/src/util/test_crypto_ecdhe.c b/src/util/test_crypto_ecdhe.c
index 5e5b34c43..6f91be746 100644
--- a/src/util/test_crypto_ecdhe.c
+++ b/src/util/test_crypto_ecdhe.c
@@ -69,4 +69,5 @@ main (int argc, char *argv[])
69 return 0; 69 return 0;
70} 70}
71 71
72
72/* end of test_crypto_ecdhe.c */ 73/* end of test_crypto_ecdhe.c */
diff --git a/src/util/test_crypto_ecdsa.c b/src/util/test_crypto_ecdsa.c
index d6f406b47..826097d52 100644
--- a/src/util/test_crypto_ecdsa.c
+++ b/src/util/test_crypto_ecdsa.c
@@ -174,6 +174,8 @@ testSignPerformance ()
174 GNUNET_YES)); 174 GNUNET_YES));
175 return ok; 175 return ok;
176} 176}
177
178
177#endif 179#endif
178 180
179 181
@@ -245,4 +247,5 @@ main (int argc, char *argv[])
245 return 0; 247 return 0;
246} 248}
247 249
250
248/* end of test_crypto_ecdsa.c */ 251/* end of test_crypto_ecdsa.c */
diff --git a/src/util/test_crypto_eddsa.c b/src/util/test_crypto_eddsa.c
index f51316463..ac991cef5 100644
--- a/src/util/test_crypto_eddsa.c
+++ b/src/util/test_crypto_eddsa.c
@@ -119,6 +119,8 @@ testSignPerformance ()
119 GNUNET_YES)); 119 GNUNET_YES));
120 return ok; 120 return ok;
121} 121}
122
123
122#endif 124#endif
123 125
124 126
@@ -210,4 +212,5 @@ main (int argc, char *argv[])
210 return 0; 212 return 0;
211} 213}
212 214
215
213/* end of test_crypto_eddsa.c */ 216/* end of test_crypto_eddsa.c */
diff --git a/src/util/test_crypto_hash.c b/src/util/test_crypto_hash.c
index 0118dd754..12e1324dd 100644
--- a/src/util/test_crypto_hash.c
+++ b/src/util/test_crypto_hash.c
@@ -49,6 +49,7 @@ test (int number)
49 return 0; 49 return 0;
50} 50}
51 51
52
52static int 53static int
53testEncoding () 54testEncoding ()
54{ 55{
@@ -60,6 +61,7 @@ testEncoding ()
60 return 0; 61 return 0;
61} 62}
62 63
64
63static int 65static int
64testArithmetic () 66testArithmetic ()
65{ 67{
@@ -99,6 +101,7 @@ testArithmetic ()
99 return 0; 101 return 0;
100} 102}
101 103
104
102static void 105static void
103finished_task (void *cls, const struct GNUNET_HashCode *res) 106finished_task (void *cls, const struct GNUNET_HashCode *res)
104{ 107{
@@ -156,4 +159,5 @@ main (int argc, char *argv[])
156 return 0; 159 return 0;
157} 160}
158 161
162
159/* end of hashingtest.c */ 163/* end of hashingtest.c */
diff --git a/src/util/test_crypto_hash_context.c b/src/util/test_crypto_hash_context.c
index d744b52b4..8c652595f 100644
--- a/src/util/test_crypto_hash_context.c
+++ b/src/util/test_crypto_hash_context.c
@@ -27,7 +27,8 @@
27 27
28#define LEN 1234 28#define LEN 1234
29 29
30int main () 30int
31main ()
31{ 32{
32 char data[1234]; 33 char data[1234];
33 struct GNUNET_HashCode hc1; 34 struct GNUNET_HashCode hc1;
diff --git a/src/util/test_crypto_hkdf.c b/src/util/test_crypto_hkdf.c
index c41c3362b..85be5bb80 100644
--- a/src/util/test_crypto_hkdf.c
+++ b/src/util/test_crypto_hkdf.c
@@ -60,6 +60,7 @@ tc1 ()
60 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 60 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
61} 61}
62 62
63
63void 64void
64tc2 () 65tc2 ()
65{ 66{
@@ -107,6 +108,7 @@ tc2 ()
107 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 108 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
108} 109}
109 110
111
110void 112void
111tc3 () 113tc3 ()
112{ 114{
@@ -129,6 +131,7 @@ tc3 ()
129 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 131 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
130} 132}
131 133
134
132void 135void
133tc4 () 136tc4 ()
134{ 137{
@@ -156,6 +159,7 @@ tc4 ()
156 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 159 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
157} 160}
158 161
162
159void 163void
160tc5 () 164tc5 ()
161{ 165{
@@ -202,6 +206,7 @@ tc5 ()
202 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 206 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
203} 207}
204 208
209
205void 210void
206tc6 () 211tc6 ()
207{ 212{
@@ -224,6 +229,7 @@ tc6 ()
224 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 229 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
225} 230}
226 231
232
227void 233void
228tc7 () 234tc7 ()
229{ 235{
@@ -277,6 +283,7 @@ tc7 ()
277 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 283 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
278} 284}
279 285
286
280void 287void
281tc8 () 288tc8 ()
282{ 289{
@@ -309,6 +316,7 @@ tc8 ()
309 GNUNET_assert (memcmp (result + l, "\0", 2) == 0); 316 GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
310} 317}
311 318
319
312int 320int
313main () 321main ()
314{ 322{
diff --git a/src/util/test_crypto_paillier.c b/src/util/test_crypto_paillier.c
index 755d0ff38..64c9569cb 100644
--- a/src/util/test_crypto_paillier.c
+++ b/src/util/test_crypto_paillier.c
@@ -243,4 +243,5 @@ main (int argc,
243 return ret; 243 return ret;
244} 244}
245 245
246
246/* end of test_crypto_paillier.c */ 247/* end of test_crypto_paillier.c */
diff --git a/src/util/test_crypto_random.c b/src/util/test_crypto_random.c
index e0a8fb72a..5e159d949 100644
--- a/src/util/test_crypto_random.c
+++ b/src/util/test_crypto_random.c
@@ -56,6 +56,7 @@ test (enum GNUNET_CRYPTO_Quality mode)
56 return 0; 56 return 0;
57} 57}
58 58
59
59int 60int
60main (int argc, char *argv[]) 61main (int argc, char *argv[])
61{ 62{
diff --git a/src/util/test_crypto_symmetric.c b/src/util/test_crypto_symmetric.c
index 0d83d5aa1..9f6cd5ed0 100644
--- a/src/util/test_crypto_symmetric.c
+++ b/src/util/test_crypto_symmetric.c
@@ -171,4 +171,5 @@ main (int argc, char *argv[])
171 return 0; 171 return 0;
172} 172}
173 173
174
174/* end of test_crypto_aes.c */ 175/* end of test_crypto_aes.c */
diff --git a/src/util/test_disk.c b/src/util/test_disk.c
index 7ed61c332..6969e49e6 100644
--- a/src/util/test_disk.c
+++ b/src/util/test_disk.c
@@ -105,6 +105,7 @@ testOpenClose ()
105 return 0; 105 return 0;
106} 106}
107 107
108
108static int ok; 109static int ok;
109 110
110 111
diff --git a/src/util/test_os_network.c b/src/util/test_os_network.c
index 8e4e31f2e..cca29df0f 100644
--- a/src/util/test_os_network.c
+++ b/src/util/test_os_network.c
@@ -87,4 +87,5 @@ main (int argc, char *argv[])
87 return ret; 87 return ret;
88} 88}
89 89
90
90/* end of test_os_network.c */ 91/* end of test_os_network.c */
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index fbcfa6729..2bdca5c9d 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -296,4 +296,5 @@ main (int argc, char *argv[])
296 return ret; 296 return ret;
297} 297}
298 298
299
299/* end of test_os_start_process.c */ 300/* end of test_os_start_process.c */
diff --git a/src/util/test_peer.c b/src/util/test_peer.c
index 5a7203507..320746c76 100644
--- a/src/util/test_peer.c
+++ b/src/util/test_peer.c
@@ -104,8 +104,7 @@ check ()
104 * Attempt to convert pid = 0 (which is reserved) 104 * Attempt to convert pid = 0 (which is reserved)
105 * into a peer identity object, the peer identity memory 105 * into a peer identity object, the peer identity memory
106 * is expected to be set to zero 106 * is expected to be set to zero
107 */ 107 */GNUNET_log_skip (1, GNUNET_YES);
108 GNUNET_log_skip (1, GNUNET_YES);
109 GNUNET_PEER_resolve (0, &res); 108 GNUNET_PEER_resolve (0, &res);
110 GNUNET_assert (0 == 109 GNUNET_assert (0 ==
111 GNUNET_is_zero (&res)); 110 GNUNET_is_zero (&res));
@@ -137,4 +136,5 @@ main ()
137 return 0; 136 return 0;
138} 137}
139 138
139
140/* end of test_peer.c */ 140/* end of test_peer.c */
diff --git a/src/util/test_plugin.c b/src/util/test_plugin.c
index d93af8db1..c0eb717d6 100644
--- a/src/util/test_plugin.c
+++ b/src/util/test_plugin.c
@@ -65,4 +65,5 @@ main (int argc, char *argv[])
65 return 0; 65 return 0;
66} 66}
67 67
68
68/* end of test_plugin.c */ 69/* end of test_plugin.c */
diff --git a/src/util/test_plugin_plug.c b/src/util/test_plugin_plug.c
index b754c4c4d..39c8774b1 100644
--- a/src/util/test_plugin_plug.c
+++ b/src/util/test_plugin_plug.c
@@ -31,6 +31,7 @@ libgnunet_plugin_test_init (void *arg)
31 return NULL; 31 return NULL;
32} 32}
33 33
34
34void * 35void *
35libgnunet_plugin_test_done (void *arg) 36libgnunet_plugin_test_done (void *arg)
36{ 37{
@@ -39,4 +40,5 @@ libgnunet_plugin_test_done (void *arg)
39 return NULL; 40 return NULL;
40} 41}
41 42
43
42/* end of test_plugin_plug.c */ 44/* end of test_plugin_plug.c */
diff --git a/src/util/test_program.c b/src/util/test_program.c
index 5362c61cc..912a581a5 100644
--- a/src/util/test_program.c
+++ b/src/util/test_program.c
@@ -134,4 +134,5 @@ main (int argc, char *argv[])
134 return ok; 134 return ok;
135} 135}
136 136
137
137/* end of test_program.c */ 138/* end of test_program.c */
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 2fe8f6f5c..02a70a560 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -289,4 +289,5 @@ main (int argc, char *argv[])
289 return ret; 289 return ret;
290} 290}
291 291
292
292/* end of test_scheduler.c */ 293/* end of test_scheduler.c */
diff --git a/src/util/test_scheduler_delay.c b/src/util/test_scheduler_delay.c
index 7dfb36291..003fac196 100644
--- a/src/util/test_scheduler_delay.c
+++ b/src/util/test_scheduler_delay.c
@@ -91,4 +91,5 @@ main (int argc, char *argv[])
91 return 0; 91 return 0;
92} 92}
93 93
94
94/* end of test_scheduler_delay.c */ 95/* end of test_scheduler_delay.c */
diff --git a/src/util/test_service.c b/src/util/test_service.c
index 6db8471bd..61afc0cc5 100644
--- a/src/util/test_service.c
+++ b/src/util/test_service.c
@@ -234,4 +234,5 @@ main (int argc,
234 return ret; 234 return ret;
235} 235}
236 236
237
237/* end of test_service.c */ 238/* end of test_service.c */
diff --git a/src/util/test_socks.c b/src/util/test_socks.c
index b813937c2..f7e0596eb 100644
--- a/src/util/test_socks.c
+++ b/src/util/test_socks.c
@@ -253,4 +253,5 @@ main (int argc, char *argv[])
253 return ok; 253 return ok;
254} 254}
255 255
256
256/* end of test_socks.c */ 257/* end of test_socks.c */
diff --git a/src/util/test_speedup.c b/src/util/test_speedup.c
index dfb8db915..bca6886aa 100644
--- a/src/util/test_speedup.c
+++ b/src/util/test_speedup.c
@@ -122,4 +122,5 @@ main (int argc, char *argv[])
122 return 1; 122 return 1;
123} 123}
124 124
125
125/* end of test_speedup.c */ 126/* end of test_speedup.c */
diff --git a/src/util/test_tun.c b/src/util/test_tun.c
index ecb3dd664..ad4a5c19e 100644
--- a/src/util/test_tun.c
+++ b/src/util/test_tun.c
@@ -63,8 +63,10 @@ test_udp (size_t pll,
63 } 63 }
64} 64}
65 65
66int main (int argc, 66
67 char **argv) 67int
68main (int argc,
69 char **argv)
68{ 70{
69 test_udp (4, 3, 22439); 71 test_udp (4, 3, 22439);
70 test_udp (4, 1, 23467); 72 test_udp (4, 1, 23467);
diff --git a/src/util/time.c b/src/util/time.c
index 5b4833511..a07801922 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -342,6 +342,7 @@ GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future)
342 return ret; 342 return ret;
343} 343}
344 344
345
345/** 346/**
346 * Compute the time difference between the given start and end times. 347 * Compute the time difference between the given start and end times.
347 * Use this function instead of actual subtraction to ensure that 348 * Use this function instead of actual subtraction to ensure that
@@ -363,6 +364,7 @@ GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
363 return ret; 364 return ret;
364} 365}
365 366
367
366/** 368/**
367 * Get the duration of an operation as the 369 * Get the duration of an operation as the
368 * difference of the current time and the given start time "whence". 370 * difference of the current time and the given start time "whence".
@@ -926,9 +928,11 @@ GNUNET_TIME_absolute_get_monotonic (
926/** 928/**
927 * Destructor 929 * Destructor
928 */ 930 */
929void __attribute__ ((destructor)) GNUNET_util_time_fini () 931void __attribute__ ((destructor))
932GNUNET_util_time_fini ()
930{ 933{
931 (void) GNUNET_TIME_absolute_get_monotonic (NULL); 934 (void) GNUNET_TIME_absolute_get_monotonic (NULL);
932} 935}
933 936
937
934/* end of time.c */ 938/* end of time.c */
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index a716a770d..50c990b3a 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -2999,7 +2999,7 @@ run (void *cls,
2999 if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg, 2999 if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg,
3000 "VPN", 3000 "VPN",
3001 "IPV6ADDR", 3001 "IPV6ADDR",
3002 &ipv6addr))|| 3002 &ipv6addr)) ||
3003 (1 != inet_pton (AF_INET6, ipv6addr, &v6)))) 3003 (1 != inet_pton (AF_INET6, ipv6addr, &v6))))
3004 { 3004 {
3005 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, 3005 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
@@ -3051,7 +3051,7 @@ run (void *cls,
3051 if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg, 3051 if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg,
3052 "vpn", 3052 "vpn",
3053 "IPV4ADDR", 3053 "IPV4ADDR",
3054 &ipv4addr))|| 3054 &ipv4addr)) ||
3055 (1 != inet_pton (AF_INET, ipv4addr, &v4)))) 3055 (1 != inet_pton (AF_INET, ipv4addr, &v4))))
3056 { 3056 {
3057 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, 3057 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
@@ -3067,7 +3067,7 @@ run (void *cls,
3067 if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg, 3067 if (((GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg,
3068 "vpn", 3068 "vpn",
3069 "IPV4MASK", 3069 "IPV4MASK",
3070 &ipv4mask))|| 3070 &ipv4mask)) ||
3071 (1 != inet_pton (AF_INET, ipv4mask, &v4)))) 3071 (1 != inet_pton (AF_INET, ipv4mask, &v4))))
3072 { 3072 {
3073 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, 3073 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c
index 3b5ea9257..3f7d9d000 100644
--- a/src/vpn/vpn_api.c
+++ b/src/vpn/vpn_api.c
@@ -547,4 +547,5 @@ GNUNET_VPN_disconnect (struct GNUNET_VPN_Handle *vh)
547 GNUNET_free (vh); 547 GNUNET_free (vh);
548} 548}
549 549
550
550/* end of vpn_api.c */ 551/* end of vpn_api.c */
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index a5b21f4a3..c5aab8d92 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -330,8 +330,7 @@ calculate_put_interval ()
330 * If no records are known (startup) or none present 330 * If no records are known (startup) or none present
331 * we can safely set the interval to the value for a single 331 * we can safely set the interval to the value for a single
332 * record 332 * record
333 */ 333 */target_iteration_velocity_per_record = zone_publish_time_window;
334 target_iteration_velocity_per_record = zone_publish_time_window;
335 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 334 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
336 "No records in namestore database.\n"); 335 "No records in namestore database.\n");
337 } 336 }