GNUnet  0.10.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

Table with our interned peer IDs.

Definition at line 54 of file peer.c.

Referenced by dfa_merge_nondistinguishable_states(), rfc4034_mnemonic_to_value(), and rfc4398_mnemonic_to_value().

◆ 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 61 of file peer.c.

◆ size

unsigned int size
static

Size of the "table".

Definition at line 66 of file peer.c.

Referenced by aes_128_cbc_encrypt(), announce_id(), auth_key_to_string(), block_plugin_fs_create_group(), 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_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_recv(), check_rename_message(), check_reply(), check_response(), check_revoke_ticket_message(), check_search(), check_search_response(), check_set_default_message(), check_ssl_certificate(), check_statistics_value(), check_watch(), compose_address_iterate_response_message(), consider_for_advertising(), decode_and_send(), dht_get_string_handler(), do_shutdown(), dump_my_hello(), env_delete_notify(), extract_files(), GCT_handle_encrypted(), GDS_CLIENTS_process_get_resp(), GDS_CLIENTS_process_put(), gen_rsh_args(), GNUNET_ABE_cpabe_create_key(), GNUNET_BANDWIDTH_tracker_consume(), GNUNET_BANDWIDTH_tracker_get_delay(), GNUNET_BANDWIDTH_value_get_delay_for(), GNUNET_BLOCK_GROUP_compute_bloomfilter_size(), GNUNET_CONFIGURATION_write(), GNUNET_CONNECTION_notify_transmit_ready(), GNUNET_CONTAINER_bloomfilter_init(), GNUNET_CONTAINER_bloomfilter_load(), GNUNET_CONTAINER_bloomfilter_or(), GNUNET_CONTAINER_bloomfilter_or2(), GNUNET_CONTAINER_bloomfilter_resize(), GNUNET_CONTAINER_meta_data_serialize(), GNUNET_CREDENTIAL_credential_issue(), GNUNET_CREDENTIAL_credential_serialize(), GNUNET_CRYPTO_cpabe_create_key(), GNUNET_CRYPTO_mpi_print_unsigned(), GNUNET_CRYPTO_symmetric_decrypt(), GNUNET_CRYPTO_symmetric_encrypt(), GNUNET_DISK_file_copy(), GNUNET_FRAGMENT_context_create(), GNUNET_FS_publish_ublock_(), GNUNET_FS_unindex_start(), GNUNET_JSON_spec_fixed(), GNUNET_JSON_spec_varsize(), GNUNET_MQ_msg_copy(), GNUNET_MQ_msg_nested_mh_(), GNUNET_MST_from_buffer(), GNUNET_NAT_AUTO_autoconfig_start(), GNUNET_OS_init(), GNUNET_PEER_change_rc(), GNUNET_PEER_decrement_rcs(), GNUNET_PEER_intern(), GNUNET_PEER_resolve(), GNUNET_PEER_resolve2(), GNUNET_PEERSTORE_store(), GNUNET_SCALARPRODUCT_accept_computation(), GNUNET_SCALARPRODUCT_start_computation(), GNUNET_SERVER_client_set_user_context_(), GNUNET_SERVER_inject(), GNUNET_SERVER_mst_receive(), GNUNET_SQ_bind(), GNUNET_TESTBED_forward_operation_msg_(), GNUNET_TESTBED_hosts_load_from_file(), GNUNET_TESTBED_queue_message_(), GNUNET_TIME_absolute_get_monotonic(), GNUNET_xgrow_(), GNUNET_xmalloc_unchecked_(), GNUNET_xmemdup_(), GSC_CLIENTS_deliver_message(), GSC_TYPEMAP_get_from_message(), GST_cache_init(), GST_connection_pool_init(), GST_neighbours_calculate_receive_delay(), GST_neighbours_notify_data_sent(), GST_validation_handle_pong(), handle_add_address(), handle_client_audio_message(), handle_communicator_available(), handle_connection_create(), handle_core_disconnect(), handle_create(), handle_dht_local_get(), handle_dht_local_get_result_seen(), handle_dht_local_put(), handle_dht_reply(), handle_dv_box(), handle_encrypted(), handle_estimate(), handle_get(), handle_icmp_back(), handle_identity_result_code(), 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(), ibf_create(), ibf_read_slice(), ibf_write_slice(), interrupt(), listenAndDistribute(), main(), make_empty_file(), message_sent_cont(), message_token(), mst_receive(), mylog(), next_rnd(), no_more_local_results(), parse_rsa_signature(), parse_variable_data(), plugin_session_info_cb(), post_extract_rsa_public_key(), post_extract_rsa_signature(), post_extract_string(), post_extract_varsize_blob(), print_hex(), process_local_reply(), process_notify(), process_payload(), publish_content(), read_dns4(), read_dns6(), regex_found_handler(), REGEX_INTERNAL_get_first_key(), REGEX_INTERNAL_search(), regex_iterator(), rfn_create(), ril_cut_from_vector(), run(), save(), select_write_cb(), send_ack(), send_hello_beacon(), send_lookup_response(), send_response(), stat_iterator(), stats_iterator(), store_peer_presistently_iterator(), stun_read_task(), tofile_(), transmit(), transmit_fragment(), transmit_next(), try_handle_plaintext(), udp_select_read(), unindex_process(), unix_real_send(), update_hello(), and wlan_plugin_send().

◆ 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 72 of file peer.c.

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