GNUnet  0.11.x
Data Structures | Macros | Functions | Variables
peer.c File Reference

peer-ID table that assigns integer IDs to peer-IDs to save memory More...

#include "platform.h"
#include "gnunet_peer_lib.h"
Include dependency graph for peer.c:

Go to the source code of this file.

Data Structures

struct  PeerEntry
 Per-peer information. More...
 

Macros

#define LOG(kind, ...)   GNUNET_log_from (kind, "util-peer", __VA_ARGS__)
 

Functions

GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid)
 Search for a peer identity. More...
 
GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
 Intern an peer identity. More...
 
void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count)
 Decrement multiple RCs of peer identities by one. More...
 
void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta)
 Change the reference counter of an interned PID. More...
 
void GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
 Convert an interned PID to a normal peer identity. More...
 
const struct GNUNET_PeerIdentityGNUNET_PEER_resolve2 (GNUNET_PEER_Id id)
 Convert an interned PID to a normal peer identity. More...
 

Variables

static struct PeerEntry ** table
 Table with our interned peer IDs. More...
 
static struct GNUNET_CONTAINER_MultiPeerMapmap
 Peermap of PeerIdentities to "struct PeerEntry" (for fast lookup). More...
 
static unsigned int size
 Size of the "table". More...
 
static unsigned int free_list_start
 Index of the beginning of the free list in the table; set to "size" if no slots are free in the table. More...
 

Detailed Description

peer-ID table that assigns integer IDs to peer-IDs to save memory

Author
Christian Grothoff

Definition in file peer.c.

Macro Definition Documentation

◆ LOG

#define LOG (   kind,
  ... 
)    GNUNET_log_from (kind, "util-peer", __VA_ARGS__)

Definition at line 29 of file peer.c.

Variable Documentation

◆ table

struct PeerEntry** table
static

◆ map

struct GNUNET_CONTAINER_MultiPeerMap* map
static

Peermap of PeerIdentities to "struct PeerEntry" (for fast lookup).

NULL until the library is actually being used.

Definition at line 62 of file peer.c.

Referenced by GNUNET_PEER_change_rc(), GNUNET_PEER_decrement_rcs(), GNUNET_PEER_intern(), and GNUNET_PEER_search().

◆ size

unsigned int size
static

Size of the "table".

Definition at line 67 of file peer.c.

Referenced by ack_proc(), adjust(), aes_128_cbc_decrypt(), aes_128_cbc_encrypt(), announce_id(), api_send(), auth_key_to_string(), block_plugin_fs_create_group(), c2i(), callback_download(), check_address_add(), check_advertisement(), check_attribute_delete_message(), check_attribute_store_message(), check_backchannel_encapsulation(), check_client_address_to_string(), check_client_send(), check_communicator_available(), check_connection_create(), check_consume_ticket_message(), check_create_message(), check_credential_delete_message(), check_credential_store_message(), check_data(), check_delete_message(), check_dht_local_get_result_seen(), check_dv_box(), check_dv_learn(), check_encrypted(), check_fragment_box(), check_get(), check_get_default_message(), check_identity_set_default(), check_identity_update(), check_issue_ticket_message(), check_local_data(), check_p2p_revoke(), check_recv(), check_rename_message(), check_reply(), check_response(), check_revoke_message(), check_revoke_ticket_message(), check_search(), check_search_response(), check_set_default_message(), check_ssl_certificate(), check_statistics_value(), check_watch(), client_receive(), client_receive_put(), client_send_cb(), compose_address_iterate_response_message(), connect_handler(), consider_for_advertising(), curl_check_hdr(), curl_download_cb(), curl_upload_cb(), d2j(), database_setup(), datacache_get_successors_iterator(), decode_and_send(), dht_get_id_handler(), dht_get_string_accept_handler(), dht_get_string_handler(), do_decrypt(), do_encrypt(), do_restart_typemap_message(), do_send(), do_shutdown(), do_transmit(), download_cb(), dump_my_hello(), ecdsa_symmetric_decrypt(), ecdsa_symmetric_encrypt(), env_delete_notify(), expi_proc(), expired_processor(), extract_files(), full_recursive_download(), GCT_handle_encrypted(), GDS_CLIENTS_process_get_resp(), GDS_CLIENTS_process_put(), gen_rsh_args(), get_cb(), get_radiotap_header(), get_resp_callback(), get_result_iterator(), get_wlan_header(), getRadiotapHeader(), getWlanHeader(), GNUNET_ABD_delegate_issue(), GNUNET_ABD_delegate_serialize(), GNUNET_ABE_cpabe_create_key(), GNUNET_ABE_cpabe_encrypt(), GNUNET_BANDWIDTH_tracker_consume(), GNUNET_BIO_get_buffer_contents(), GNUNET_BIO_read_meta_data(), GNUNET_BIO_read_open_buffer(), GNUNET_BIO_read_spec_commit(), GNUNET_BIO_write_meta_data(), GNUNET_BLOCK_GROUP_compute_bloomfilter_size(), GNUNET_BLOCK_is_accepting(), GNUNET_buffer_reap(), GNUNET_CONFIGURATION_serialize(), GNUNET_CONNECTION_notify_transmit_ready(), GNUNET_CONTAINER_bloomfilter_get_raw_data(), GNUNET_CONTAINER_bloomfilter_init(), GNUNET_CONTAINER_bloomfilter_load(), GNUNET_CONTAINER_bloomfilter_or(), GNUNET_CONTAINER_bloomfilter_or2(), GNUNET_CONTAINER_bloomfilter_resize(), GNUNET_CONTAINER_meta_data_deserialize(), GNUNET_CONTAINER_meta_data_serialize(), GNUNET_CRYPTO_cpabe_create_key(), GNUNET_CRYPTO_cpabe_encrypt(), GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_context_read(), GNUNET_CRYPTO_mpi_print_unsigned(), GNUNET_CRYPTO_mpi_scan_unsigned(), GNUNET_CRYPTO_mpi_scan_unsigned_le(), GNUNET_CRYPTO_symmetric_decrypt(), GNUNET_CRYPTO_symmetric_encrypt(), GNUNET_DATASTORE_put(), GNUNET_DATASTORE_remove(), GNUNET_DHT_put(), GNUNET_FRAGMENT_context_create(), GNUNET_FS_directory_builder_finish(), GNUNET_FS_directory_list_contents(), GNUNET_FS_handle_on_demand_block(), GNUNET_FS_publish_ublock_(), GNUNET_FS_TEST_publish(), GNUNET_FS_tree_encoder_create(), GNUNET_FS_unindex_start(), GNUNET_HOSTLIST_server_start(), GNUNET_IDENTITY_decrypt(), GNUNET_IDENTITY_encrypt(), GNUNET_IDENTITY_private_key_from_string(), GNUNET_IDENTITY_public_key_to_string(), GNUNET_JSON_from_data(), GNUNET_MQ_msg_(), GNUNET_MQ_msg_copy(), GNUNET_MQ_msg_nested_mh_(), GNUNET_MST_from_buffer(), GNUNET_MY_result_spec_absolute_time(), GNUNET_NAT_AUTO_autoconfig_start(), GNUNET_PEER_change_rc(), GNUNET_PEER_decrement_rcs(), GNUNET_PEER_intern(), GNUNET_PEER_resolve(), GNUNET_PEER_resolve2(), GNUNET_PEERSTORE_store(), GNUNET_REVOCATION_proof_get_size(), GNUNET_SCALARPRODUCT_accept_computation(), GNUNET_SCALARPRODUCT_start_computation(), GNUNET_SERVER_client_get_user_context_(), GNUNET_SERVER_client_set_user_context_(), GNUNET_SERVER_inject(), GNUNET_SERVER_mst_receive(), GNUNET_SERVER_notify_transmit_ready(), GNUNET_snprintf(), GNUNET_SQ_bind(), GNUNET_STRINGS_buffer_fill(), GNUNET_STRINGS_buffer_tokenize(), GNUNET_STRINGS_byte_size_fancy(), GNUNET_STRINGS_check_filename(), GNUNET_STRINGS_data_to_string(), GNUNET_STRINGS_fancy_size_to_bytes(), GNUNET_TESTBED_compress_cfg_(), GNUNET_TESTBED_compress_config_(), GNUNET_TESTBED_forward_operation_msg_(), GNUNET_TESTBED_hosts_load_from_file(), GNUNET_TESTBED_LOGGER_write(), GNUNET_TESTBED_queue_message_(), GNUNET_xgrow_(), GNUNET_xmalloc_(), GNUNET_xmalloc_unchecked_(), GNUNET_xmemdup_(), GSC_CLIENTS_deliver_message(), GSC_TYPEMAP_get_from_message(), GST_cache_init(), GST_connection_pool_init(), GST_neighbours_notify_data_sent(), GST_validation_handle_pong(), handle_add_address(), handle_client_audio_message(), handle_communicator_available(), handle_connection_create(), handle_datastore_reply(), handle_dht_local_get(), handle_dht_local_get_result_seen(), handle_dht_local_put(), handle_dht_reply(), handle_dht_response(), handle_dht_result(), handle_dv_box(), handle_encrypted(), handle_estimate(), handle_get(), handle_icmp_back(), handle_identity_result_code(), handle_intermediate(), handle_lookup_block_response(), handle_put(), handle_raw_message(), handle_reply(), handle_response(), handle_search_result(), handle_set(), handle_statistics_value(), handle_tcp_back(), handle_udp_back(), handle_watch(), heap_plugin_get_closest(), heap_plugin_put(), heap_plugin_remove_key(), ibf_create(), ibf_read_slice(), ibf_write_slice(), interrupt(), listenAndDistribute(), load_file(), main(), make_empty_file(), message_token(), mst_receive(), mylog(), mysql_plugin_put(), mysql_plugin_remove_key(), notify_send_probe(), open_static_page(), parse_rsa_signature(), parse_variable_data(), peerstore_flat_store_record(), peerstore_sqlite_store_record(), plugin_session_info_cb(), post_data_iter(), post_extract_rsa_public_key(), post_extract_rsa_signature(), post_extract_varsize_blob(), postgres_plugin_del(), postgres_plugin_put(), postgres_plugin_remove_key(), prepare_ibf(), print_hex(), process_dht_put_content(), process_kblock(), process_kblock_for_unindex(), process_local_reply(), process_migration_content(), process_notify(), process_result(), process_result_with_request(), process_sblock(), publish_content(), publish_fs_connect_complete_cb(), put_callback(), put_cb(), put_continuation(), quota_processor(), read_dns4(), read_dns6(), REGEX_BLOCK_check(), REGEX_BLOCK_iterate(), regex_found_handler(), REGEX_INTERNAL_get_first_key(), REGEX_INTERNAL_search(), regex_iterator(), regex_next_edge(), REGEX_TEST_read_from_file(), remove_continuation(), repl_proc(), rfn_create(), run(), save(), select_write_cb(), send_ack(), send_hello_beacon(), send_intermediate_response(), send_lookup_response(), send_response(), sqlite_plugin_get(), sqlite_plugin_get_closest(), sqlite_plugin_get_random(), sqlite_plugin_put(), sqlite_plugin_remove_key(), stat_iterator(), stats_iterator(), store_peer_presistently_iterator(), stun_read_task(), t_ax_decrypt(), t_ax_decrypt_and_validate(), t_ax_encrypt(), t_hmac(), template_plugin_put(), template_plugin_remove_key(), tmt_rdy_ping(), tmt_rdy_pong(), tofile_(), transmit(), transmit_fragment(), transmit_item(), transmit_next(), transmit_ready(), transmit_ready_callback_wrapper(), try_handle_plaintext(), try_old_ax_keys(), udp_broadcast_receive(), udp_select_read(), unindex_process(), unix_plugin_get_network(), update_hello(), wlan_plugin_send(), write_all(), and write_test().

◆ free_list_start

unsigned int free_list_start
static

Index of the beginning of the free list in the table; set to "size" if no slots are free in the table.

Definition at line 73 of file peer.c.

Referenced by GNUNET_PEER_change_rc(), GNUNET_PEER_decrement_rcs(), and GNUNET_PEER_intern().