Go to the source code of this file.
Data Structures | |
| struct | GNUNET_MESSENGER_Contact |
Functions | |
| struct GNUNET_MESSENGER_Contact * | create_contact (const struct GNUNET_CRYPTO_BlindablePublicKey *key, size_t unique_id) |
| Creates and allocates a new contact with a given public key. | |
| void | destroy_contact (struct GNUNET_MESSENGER_Contact *contact) |
| Destroys a contact and frees its memory fully. | |
| const char * | get_contact_name (const struct GNUNET_MESSENGER_Contact *contact) |
| Returns the current name of a given contact or NULL if no valid name was assigned yet. | |
| void | set_contact_name (struct GNUNET_MESSENGER_Contact *contact, const char *name) |
| Changes the current name of a given contact by copying it from the parameter name. | |
| const struct GNUNET_CRYPTO_BlindablePublicKey * | get_contact_key (const struct GNUNET_MESSENGER_Contact *contact) |
| Returns the blindable public key of a given contact. | |
| const struct GNUNET_CRYPTO_HpkePublicKey * | get_contact_encryption_key (const struct GNUNET_MESSENGER_Contact *contact, const struct GNUNET_HashCode *key) |
| Returns the HPKE public key of a given contact for a specific room that is identified via its own room key. | |
| void | set_contact_encryption_key (struct GNUNET_MESSENGER_Contact *contact, const struct GNUNET_HashCode *key, const struct GNUNET_CRYPTO_HpkePublicKey *encryption_key) |
| Sets or replaces the encryption_key of a given contact for a specified room that is identified via its own room key. | |
| void | increase_contact_rc (struct GNUNET_MESSENGER_Contact *contact) |
| Increases the reference counter of a given contact which is zero as default. | |
| enum GNUNET_GenericReturnValue | decrease_contact_rc (struct GNUNET_MESSENGER_Contact *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. | |
| size_t | get_contact_id (const struct GNUNET_MESSENGER_Contact *contact) |
| Returns the locally unique identifier of a given contact. | |
| void | get_context_from_member (const struct GNUNET_HashCode *key, const struct GNUNET_ShortHashCode *id, struct GNUNET_HashCode *context) |
| Calculates the context hash of a member in a room and returns it. | |
| struct GNUNET_MESSENGER_Contact * create_contact | ( | const struct GNUNET_CRYPTO_BlindablePublicKey * | key, |
| size_t | unique_id | ||
| ) |
Creates and allocates a new contact with a given public key.
| [in] | key | Public key |
| [in] | unique_id | Locally unique identifier |
Definition at line 29 of file messenger_api_contact.c.
References GNUNET_MESSENGER_Contact::encryption_keys, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_MESSENGER_Contact::id, key, GNUNET_MESSENGER_Contact::name, GNUNET_MESSENGER_Contact::public_key, and GNUNET_MESSENGER_Contact::rc.
Referenced by get_store_contact().
| void destroy_contact | ( | struct GNUNET_MESSENGER_Contact * | contact | ) |
Destroys a contact and frees its memory fully.
| [in,out] | contact | Contact |
Definition at line 70 of file messenger_api_contact.c.
References GNUNET_MESSENGER_Contact::encryption_keys, GNUNET_assert, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_MESSENGER_Contact::id, iterate_free_contact_encryption_key(), and GNUNET_MESSENGER_Contact::name.
Referenced by get_store_contact(), iterate_destroy_contacts(), and remove_store_contact().
| const char * get_contact_name | ( | const struct GNUNET_MESSENGER_Contact * | contact | ) |
Returns the current name of a given contact or NULL if no valid name was assigned yet.
| [in] | contact | Contact |
Definition at line 90 of file messenger_api_contact.c.
References GNUNET_assert, and GNUNET_MESSENGER_Contact::name.
Referenced by GNUNET_MESSENGER_contact_get_name().
| void set_contact_name | ( | struct GNUNET_MESSENGER_Contact * | contact, |
| const char * | name | ||
| ) |
Changes the current name of a given contact by copying it from the parameter name.
| [in,out] | contact | Contact |
| [in] | name | Name |
Definition at line 99 of file messenger_api_contact.c.
References GNUNET_assert, GNUNET_free, GNUNET_strdup, name, and GNUNET_MESSENGER_Contact::name.
Referenced by handle_name_message().
| const struct GNUNET_CRYPTO_BlindablePublicKey * get_contact_key | ( | const struct GNUNET_MESSENGER_Contact * | contact | ) |
Returns the blindable public key of a given contact.
| [in] | contact | Contact |
Definition at line 112 of file messenger_api_contact.c.
References GNUNET_assert, and GNUNET_MESSENGER_Contact::public_key.
Referenced by get_epoch_member_position(), get_store_contact(), GNUNET_MESSENGER_contact_get_key(), GNUNET_MESSENGER_send_message(), handle_id_message(), remove_store_contact(), and update_store_contact().
| const struct GNUNET_CRYPTO_HpkePublicKey * get_contact_encryption_key | ( | const struct GNUNET_MESSENGER_Contact * | contact, |
| const struct GNUNET_HashCode * | key | ||
| ) |
Returns the HPKE public key of a given contact for a specific room that is identified via its own room key.
| [in] | contact | Contact |
| [in] | key | Room key |
Definition at line 121 of file messenger_api_contact.c.
References GNUNET_MESSENGER_Contact::encryption_keys, GNUNET_assert, GNUNET_CONTAINER_multihashmap_get(), and key.
Referenced by GNUNET_MESSENGER_send_message().
| void set_contact_encryption_key | ( | struct GNUNET_MESSENGER_Contact * | contact, |
| const struct GNUNET_HashCode * | key, | ||
| const struct GNUNET_CRYPTO_HpkePublicKey * | encryption_key | ||
| ) |
Sets or replaces the encryption_key of a given contact for a specified room that is identified via its own room key.
| [in,out] | contact | Contact |
| [in] | key | Room key |
| [in] | encryption_key | Public key of the contact for encrypted messages |
Definition at line 131 of file messenger_api_contact.c.
References GNUNET_MESSENGER_Contact::encryption_keys, GNUNET_assert, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_OK, GNUNET_YES, iterate_free_contact_encryption_key(), and key.
Referenced by handle_join_message(), and handle_key_message().
| void increase_contact_rc | ( | struct GNUNET_MESSENGER_Contact * | contact | ) |
Increases the reference counter of a given contact which is zero as default.
| [in,out] | contact | Contact |
Definition at line 175 of file messenger_api_contact.c.
References GNUNET_assert, and GNUNET_MESSENGER_Contact::rc.
Referenced by create_member_session(), handle_join_message(), reset_member_session(), and switch_member_session().
| enum GNUNET_GenericReturnValue decrease_contact_rc | ( | struct GNUNET_MESSENGER_Contact * | 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.
| [in,out] | contact | Contact |
Definition at line 184 of file messenger_api_contact.c.
References GNUNET_assert, GNUNET_NO, GNUNET_YES, and GNUNET_MESSENGER_Contact::rc.
Referenced by check_member_session_completion(), destroy_member_session(), and handle_leave_message().
| size_t get_contact_id | ( | const struct GNUNET_MESSENGER_Contact * | contact | ) |
Returns the locally unique identifier of a given contact.
| [in] | contact | contact Contact |
Definition at line 196 of file messenger_api_contact.c.
References GNUNET_assert, and GNUNET_MESSENGER_Contact::id.
Referenced by GNUNET_MESSENGER_contact_get_id().
| void get_context_from_member | ( | const struct GNUNET_HashCode * | key, |
| const struct GNUNET_ShortHashCode * | id, | ||
| struct GNUNET_HashCode * | context | ||
| ) |
Calculates the context hash of a member in a room and returns it.
| [in] | key | Key of room |
| [in] | id | Member id |
| [out] | context | Member context |
Definition at line 205 of file messenger_api_contact.c.
References context, GNUNET_assert, GNUNET_CRYPTO_hash(), GNUNET_CRYPTO_hash_xor(), and key.
Referenced by create_member_session(), get_handle_contact(), handle_id_message(), handle_join_message(), handle_key_message(), and switch_member_session().