utilities for managing (information about) peers More...
Go to the source code of this file.
Functions | |
struct CustomPeerMap * | CustomPeerMap_create (unsigned int len) |
Create an empty peermap. More... | |
unsigned int | CustomPeerMap_size (const struct CustomPeerMap *c_peer_map) |
Get the size of the custom peer map. More... | |
int | CustomPeerMap_put (const struct CustomPeerMap *c_peer_map, const struct GNUNET_PeerIdentity *peer) |
Insert peer into the custom peer map. More... | |
int | CustomPeerMap_contains_peer (const struct CustomPeerMap *c_peer_map, const struct GNUNET_PeerIdentity *peer) |
Check whether custom peer map contains a peer. More... | |
int | CustomPeerMap_remove_peer (const struct CustomPeerMap *c_peer_map, const struct GNUNET_PeerIdentity *peer) |
Remove peer from custom peer map. More... | |
struct GNUNET_PeerIdentity * | CustomPeerMap_get_peer_by_index (const struct CustomPeerMap *c_peer_map, uint32_t index) |
Get a peer by index. More... | |
int | CustomPeerMap_remove_peer_by_index (const struct CustomPeerMap *c_peer_map, uint32_t index) |
Remove peer from custom peer map by index. More... | |
void | CustomPeerMap_clear (const struct CustomPeerMap *c_peer_map) |
Clear the custom peer map. More... | |
void | CustomPeerMap_destroy (struct CustomPeerMap *c_peer_map) |
Destroy peermap. More... | |
utilities for managing (information about) peers
Definition in file gnunet-service-rps_custommap.h.
struct CustomPeerMap * CustomPeerMap_create | ( | unsigned int | len | ) |
Create an empty peermap.
len | the initial length for the internal maps |
Definition at line 79 of file gnunet-service-rps_custommap.c.
References GNUNET_CONTAINER_multihashmap32_create(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_new, GNUNET_NO, CustomPeerMap::hash_map, and CustomPeerMap::peer_map.
Referenced by new_sub().
unsigned int CustomPeerMap_size | ( | const struct CustomPeerMap * | c_peer_map | ) |
Get the size of the custom peer map.
c_peer_map | the custom peer map to look in |
Definition at line 99 of file gnunet-service-rps_custommap.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap32_size(), GNUNET_CONTAINER_multipeermap_size(), CustomPeerMap::hash_map, and CustomPeerMap::peer_map.
Referenced by CustomPeerMap_clear(), CustomPeerMap_put(), CustomPeerMap_remove_peer(), CustomPeerMap_remove_peer_by_index(), and do_round().
int CustomPeerMap_put | ( | const struct CustomPeerMap * | c_peer_map, |
const struct GNUNET_PeerIdentity * | peer | ||
) |
Insert peer into the custom peer map.
c_peer_map | the custom peer map to insert peer |
peer | the peer to insert |
Definition at line 117 of file gnunet-service-rps_custommap.c.
References CustomPeerMap_size(), GNUNET_assert, GNUNET_CONTAINER_multihashmap32_put(), GNUNET_CONTAINER_multihashmap32_size(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CONTAINER_multipeermap_contains(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_new, GNUNET_NO, GNUNET_OK, CustomPeerMap::hash_map, p, and CustomPeerMap::peer_map.
Referenced by handle_peer_pull_reply(), handle_peer_push(), and insert_in_pull_map().
int CustomPeerMap_contains_peer | ( | const struct CustomPeerMap * | c_peer_map, |
const struct GNUNET_PeerIdentity * | peer | ||
) |
Check whether custom peer map contains a peer.
c_peer_map | the custom peer map to look in |
peer | the peer to check for |
Definition at line 165 of file gnunet-service-rps_custommap.c.
References GNUNET_CONTAINER_multipeermap_contains(), and CustomPeerMap::peer_map.
Referenced by check_sending_channel_needed(), clean_peer(), CustomPeerMap_get_index_pointer(), and CustomPeerMap_remove_peer().
int CustomPeerMap_remove_peer | ( | const struct CustomPeerMap * | c_peer_map, |
const struct GNUNET_PeerIdentity * | peer | ||
) |
Remove peer from custom peer map.
c_peer_map | the custom peer map to remove the peer from |
peer | the peer to remove |
Definition at line 202 of file gnunet-service-rps_custommap.c.
References CustomPeerMap_contains_peer(), CustomPeerMap_get_index_pointer(), CustomPeerMap_size(), GNUNET_assert, GNUNET_CONTAINER_multihashmap32_get(), GNUNET_CONTAINER_multihashmap32_put(), GNUNET_CONTAINER_multihashmap32_remove_all(), GNUNET_CONTAINER_multihashmap32_size(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_remove_all(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_free, GNUNET_NO, GNUNET_OK, CustomPeerMap::hash_map, p, CustomPeerMap::peer_map, and ret.
Referenced by CustomPeerMap_remove_peer_by_index(), and remove_peer().
struct GNUNET_PeerIdentity * CustomPeerMap_get_peer_by_index | ( | const struct CustomPeerMap * | c_peer_map, |
uint32_t | index | ||
) |
Get a peer by index.
c_peer_map | the custom peer map to look in |
index | the index of the peer to get |
Definition at line 265 of file gnunet-service-rps_custommap.c.
References GNUNET_CONTAINER_multihashmap32_contains(), GNUNET_CONTAINER_multihashmap32_get(), GNUNET_YES, and CustomPeerMap::hash_map.
Referenced by CustomPeerMap_remove_peer_by_index(), and do_round().
int CustomPeerMap_remove_peer_by_index | ( | const struct CustomPeerMap * | c_peer_map, |
uint32_t | index | ||
) |
Remove peer from custom peer map by index.
c_peer_map | the custom peer map to remove the peer from |
index | the index of the peer to remove |
Definition at line 287 of file gnunet-service-rps_custommap.c.
References CustomPeerMap_get_index_pointer(), CustomPeerMap_get_peer_by_index(), CustomPeerMap_remove_peer(), CustomPeerMap_size(), GNUNET_assert, GNUNET_CONTAINER_multihashmap32_contains(), GNUNET_CONTAINER_multihashmap32_size(), GNUNET_CONTAINER_multipeermap_size(), GNUNET_NO, GNUNET_OK, CustomPeerMap::hash_map, and CustomPeerMap::peer_map.
Referenced by CustomPeerMap_clear().
void CustomPeerMap_clear | ( | const struct CustomPeerMap * | c_peer_map | ) |
Clear the custom peer map.
c_peer_map | the custom peer map to look in |
Definition at line 323 of file gnunet-service-rps_custommap.c.
References CustomPeerMap_remove_peer_by_index(), CustomPeerMap_size(), GNUNET_assert, GNUNET_CONTAINER_multihashmap32_contains(), GNUNET_OK, GNUNET_YES, and CustomPeerMap::hash_map.
Referenced by CustomPeerMap_destroy(), and do_round().
void CustomPeerMap_destroy | ( | struct CustomPeerMap * | c_peer_map | ) |
Destroy peermap.
c_peer_map | the map to destroy |
Definition at line 347 of file gnunet-service-rps_custommap.c.
References CustomPeerMap_clear(), GNUNET_CONTAINER_multihashmap32_destroy(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_free, CustomPeerMap::hash_map, and CustomPeerMap::peer_map.
Referenced by destroy_sub().