![]() |
GNUnet
0.11.x
|
messenger api: client and service implementation of GNUnet MESSENGER service More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_MESSENGER_ListTunnel |
struct | GNUNET_MESSENGER_ListTunnels |
Functions | |
void | init_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels) |
Initializes list of tunnels peer identities as empty list. More... | |
void | clear_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels) |
Clears the list of tunnels peer identities. More... | |
void | add_to_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer) |
Adds a specific peer from a tunnel to the end of the list. More... | |
struct GNUNET_MESSENGER_ListTunnel * | find_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer, size_t *index) |
Searches linearly through the list of tunnels peer identities for matching a specific peer identity and returns the matching element of the list. More... | |
int | contains_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer) |
Tests linearly if the list of tunnels peer identities contains a specific peer identity and returns GNUNET_YES on success, otherwise GNUNET_NO. More... | |
struct GNUNET_MESSENGER_ListTunnel * | remove_from_list_tunnels (struct GNUNET_MESSENGER_ListTunnels *tunnels, struct GNUNET_MESSENGER_ListTunnel *element) |
Removes a specific element from the list of tunnels peer identities and returns the next element in the list. More... | |
messenger api: client and service implementation of GNUnet MESSENGER service
Definition in file messenger_api_list_tunnels.h.
void init_list_tunnels | ( | struct GNUNET_MESSENGER_ListTunnels * | tunnels | ) |
Initializes list of tunnels peer identities as empty list.
tunnels | List of peer identities |
Definition at line 29 of file messenger_api_list_tunnels.c.
References GNUNET_assert, GNUNET_MESSENGER_ListTunnels::head, and GNUNET_MESSENGER_ListTunnels::tail.
Referenced by create_room().
void clear_list_tunnels | ( | struct GNUNET_MESSENGER_ListTunnels * | tunnels | ) |
Clears the list of tunnels peer identities.
tunnels | List of peer identities |
Definition at line 38 of file messenger_api_list_tunnels.c.
References GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_PEER_change_rc(), GNUNET_MESSENGER_ListTunnels::head, GNUNET_MESSENGER_ListTunnel::peer, and GNUNET_MESSENGER_ListTunnels::tail.
Referenced by destroy_room().
void add_to_list_tunnels | ( | struct GNUNET_MESSENGER_ListTunnels * | tunnels, |
const struct GNUNET_PeerIdentity * | peer | ||
) |
Adds a specific peer from a tunnel to the end of the list.
tunnels | List of peer identities |
peer | Peer identity of tunnel |
Definition at line 63 of file messenger_api_list_tunnels.c.
References compare_list_tunnels(), GNUNET_CONTAINER_DLL_insert_sorted, GNUNET_new, GNUNET_PEER_intern(), GNUNET_MESSENGER_ListTunnels::head, GNUNET_MESSENGER_ListTunnel::peer, and GNUNET_MESSENGER_ListTunnels::tail.
Referenced by entry_handle_room_at(), and handle_message_peer().
struct GNUNET_MESSENGER_ListTunnel* find_list_tunnels | ( | struct GNUNET_MESSENGER_ListTunnels * | tunnels, |
const struct GNUNET_PeerIdentity * | peer, | ||
size_t * | index | ||
) |
Searches linearly through the list of tunnels peer identities for matching a specific peer identity and returns the matching element of the list.
If no matching element is found, NULL gets returned.
If index is not NULL, index will be overriden with the numeric index of the found element in the list. If no matching element is found, index will contain the total amount of elements in the list.
tunnels | List of peer identities | |
peer | Peer identity of tunnel | |
[out] | index | Index of found element (optional) |
Definition at line 74 of file messenger_api_list_tunnels.c.
References GNUNET_memcmp, GNUNET_PEER_resolve(), GNUNET_MESSENGER_ListTunnels::head, GNUNET_MESSENGER_ListTunnel::next, and GNUNET_MESSENGER_ListTunnel::peer.
Referenced by contains_list_tunnels(), handle_message_miss(), handle_miss_message(), and rebuild_room_basement_structure().
int contains_list_tunnels | ( | struct GNUNET_MESSENGER_ListTunnels * | tunnels, |
const struct GNUNET_PeerIdentity * | peer | ||
) |
Tests linearly if the list of tunnels peer identities contains a specific peer identity and returns GNUNET_YES on success, otherwise GNUNET_NO.
tunnels | List of peer identities |
peer | Peer identity of tunnel |
Definition at line 97 of file messenger_api_list_tunnels.c.
References find_list_tunnels(), GNUNET_NO, and GNUNET_YES.
Referenced by callback_room_disconnect(), and handle_message_peer().
struct GNUNET_MESSENGER_ListTunnel* remove_from_list_tunnels | ( | struct GNUNET_MESSENGER_ListTunnels * | tunnels, |
struct GNUNET_MESSENGER_ListTunnel * | element | ||
) |
Removes a specific element from the list of tunnels peer identities and returns the next element in the list.
tunnels | List of peer identities |
element | Element of the list |
Definition at line 103 of file messenger_api_list_tunnels.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_PEER_change_rc(), GNUNET_MESSENGER_ListTunnels::head, GNUNET_MESSENGER_ListTunnel::next, GNUNET_MESSENGER_ListTunnel::peer, and GNUNET_MESSENGER_ListTunnels::tail.
Referenced by handle_message_miss(), handle_miss_message(), and rebuild_room_basement_structure().