![]() |
GNUnet
0.11.x
|
GNUnet MESSENGER service. More...
#include "gnunet-service-messenger_contact.h"
Go to the source code of this file.
Functions | |
struct GNUNET_MESSENGER_SrvContact * | create_contact (const struct GNUNET_IDENTITY_PublicKey *key) |
Creates and allocates a new contact with a given public key from an EGO. More... | |
void | destroy_contact (struct GNUNET_MESSENGER_SrvContact *contact) |
Destroys a contact and frees its memory fully. More... | |
const char * | get_contact_name (const struct GNUNET_MESSENGER_SrvContact *contact) |
Returns the current name of a given contact or NULL if no valid name was assigned yet. More... | |
void | set_contact_name (struct GNUNET_MESSENGER_SrvContact *contact, const char *name) |
Changes the current name of a given contact by copying it from the parameter name. More... | |
const struct GNUNET_IDENTITY_PublicKey * | get_contact_key (const struct GNUNET_MESSENGER_SrvContact *contact) |
Returns the public key of a given contact. More... | |
void | increase_contact_rc (struct GNUNET_MESSENGER_SrvContact *contact) |
Increases the reference counter of a given contact which is zero as default. More... | |
int | decrease_contact_rc (struct GNUNET_MESSENGER_SrvContact *contact) |
Decreases the reference counter if possible (can not underflow!) of a given contact and returns GNUNET_YES if the counter is equal to zero, otherwise GNUNET_NO. More... | |
const struct GNUNET_HashCode * | get_contact_id_from_key (const struct GNUNET_MESSENGER_SrvContact *contact) |
Returns the resulting hashcode of the public key from a given contact. More... | |
GNUnet MESSENGER service.
Definition in file gnunet-service-messenger_contact.c.
struct GNUNET_MESSENGER_SrvContact* create_contact | ( | const struct GNUNET_IDENTITY_PublicKey * | key | ) |
Creates and allocates a new contact with a given public key from an EGO.
key | Public key |
Definition at line 29 of file gnunet-service-messenger_contact.c.
Referenced by get_handle_contact_by_pubkey(), and get_service_contact_by_pubkey().
void destroy_contact | ( | struct GNUNET_MESSENGER_SrvContact * | contact | ) |
Destroys a contact and frees its memory fully.
contact | Contact |
Definition at line 42 of file gnunet-service-messenger_contact.c.
References GNUNET_free, and GNUNET_MESSENGER_SrvContact::name.
Referenced by get_handle_contact_by_pubkey(), get_service_contact_by_pubkey(), iterate_clear_members(), iterate_destroy_contact(), and iterate_destroy_contacts().
const char* get_contact_name | ( | const struct GNUNET_MESSENGER_SrvContact * | contact | ) |
Returns the current name of a given contact or NULL if no valid name was assigned yet.
contact | Contact |
Definition at line 51 of file gnunet-service-messenger_contact.c.
References GNUNET_MESSENGER_SrvContact::name.
Referenced by GNUNET_MESSENGER_contact_get_name().
void set_contact_name | ( | struct GNUNET_MESSENGER_SrvContact * | contact, |
const char * | name | ||
) |
Changes the current name of a given contact by copying it from the parameter name.
contact | Contact |
name | Valid name (may not be NULL!) |
Definition at line 57 of file gnunet-service-messenger_contact.c.
References GNUNET_assert, GNUNET_free, GNUNET_strdup, and GNUNET_MESSENGER_SrvContact::name.
Referenced by handle_message_name(), and handle_name_message().
const struct GNUNET_IDENTITY_PublicKey* get_contact_key | ( | const struct GNUNET_MESSENGER_SrvContact * | contact | ) |
Returns the public key of a given contact.
contact | Contact |
Definition at line 68 of file gnunet-service-messenger_contact.c.
References GNUNET_MESSENGER_SrvContact::public_key.
Referenced by callback_verify_room_message(), and GNUNET_MESSENGER_contact_get_key().
void increase_contact_rc | ( | struct GNUNET_MESSENGER_SrvContact * | contact | ) |
Increases the reference counter of a given contact which is zero as default.
contact | Contact |
Definition at line 74 of file gnunet-service-messenger_contact.c.
References GNUNET_MESSENGER_SrvContact::rc.
Referenced by add_room_contact().
int decrease_contact_rc | ( | struct GNUNET_MESSENGER_SrvContact * | contact | ) |
Decreases the reference counter if possible (can not underflow!) of a given contact and returns GNUNET_YES if the counter is equal to zero, otherwise GNUNET_NO.
contact | Contact |
Definition at line 80 of file gnunet-service-messenger_contact.c.
References GNUNET_NO, GNUNET_YES, and GNUNET_MESSENGER_SrvContact::rc.
Referenced by iterate_clear_members().
const struct GNUNET_HashCode* get_contact_id_from_key | ( | const struct GNUNET_MESSENGER_SrvContact * | contact | ) |
Returns the resulting hashcode of the public key from a given contact.
contact | Contact |
Definition at line 89 of file gnunet-service-messenger_contact.c.
References GNUNET_CRYPTO_hash(), id, and GNUNET_MESSENGER_SrvContact::public_key.
Referenced by iterate_clear_members(), swap_handle_contact_by_pubkey(), and swap_service_contact_by_pubkey().