44 for (element = tunnels->
head; element; element = tunnels->
head)
59 return ((
int) element0->
peer) - ((int) element1->
peer);
70 tunnels->
tail, element);
82 for (element = tunnels->
head; element; element = element->
next)
90 (*index) = (*index) + 1;
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
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 G...
#define GNUNET_CONTAINER_DLL_insert_sorted(TYPE, comparator, comparator_cls, head, tail, element)
Insertion sort of element into DLL from head to tail sorted by comparator.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
struct GNUNET_MESSENGER_ListTunnel * head
struct GNUNET_MESSENGER_ListTunnel * next
#define GNUNET_new(type)
Allocate a struct or union of the given type.
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.
void GNUNET_PEER_resolve(GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
Convert an interned PID to a normal peer identity.
static int compare_list_tunnels(void *cls, struct GNUNET_MESSENGER_ListTunnel *element0, struct GNUNET_MESSENGER_ListTunnel *element1)
void clear_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Clears the list of tunnels peer identities.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_MESSENGER_ListTunnel * tail
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
The identity of the host (wraps the signing key of the peer).
void init_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Initializes list of tunnels peer identities as empty list.
messenger api: client and service implementation of GNUnet MESSENGER service
void GNUNET_PEER_change_rc(GNUNET_PEER_Id id, int delta)
Change the reference counter of an interned PID.
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 a...
GNUNET_PEER_Id GNUNET_PEER_intern(const struct GNUNET_PeerIdentity *pid)
Intern an peer identity.
#define GNUNET_free(ptr)
Wrapper around free.
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 t...