30#define LOG(kind, ...) GNUNET_log_from (kind, "util-peer", __VA_ARGS__)
128 for (
unsigned int i =
ret; i <
size; i++)
164 for (i = count - 1; i >= 0; i--)
static int ret
Final status code.
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_array_grow(arr, size, tsize)
Grow a well-typed (!) array.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void GNUNET_PEER_decrement_rcs(const GNUNET_PEER_Id *ids, unsigned int count)
Decrement multiple RCs of peer identities by one.
unsigned int GNUNET_PEER_Id
A GNUNET_PEER_Id is simply a shorter version of a "struct GNUNET_PeerIdentifier" that can be used ins...
GNUNET_PEER_Id GNUNET_PEER_search(const struct GNUNET_PeerIdentity *pid)
Search for a peer identity.
void GNUNET_PEER_change_rc(GNUNET_PEER_Id id, int delta)
Change the reference counter of an interned PID.
const struct GNUNET_PeerIdentity * GNUNET_PEER_resolve2(GNUNET_PEER_Id id)
Convert an interned PID to a normal peer identity.
void GNUNET_PEER_resolve(GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
Convert an interned PID to a normal peer identity.
GNUNET_PEER_Id GNUNET_PEER_intern(const struct GNUNET_PeerIdentity *pid)
Intern an peer identity.
static struct PeerEntry ** table
Table with our interned peer IDs.
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...
static struct GNUNET_CONTAINER_MultiPeerMap * map
Peermap of PeerIdentities to "struct PeerEntry" (for fast lookup).
static unsigned int size
Size of the "table".
static struct GNUNET_TIME_Relative delta
Internal representation of the hash map.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_PeerIdentity id
The identifier itself.
unsigned int rc
Reference counter, 0 if this slot is not used.
GNUNET_PEER_Id pid
Short version of the identifier; if the RC==0, then index of next free slot in table,...