GNUnet 0.26.2-14-ga82e62fdc
 
Loading...
Searching...
No Matches
messenger_api_contact.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2025 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
26#ifndef GNUNET_MESSENGER_API_CONTACT_H
27#define GNUNET_MESSENGER_API_CONTACT_H
28
29#include "gnunet_common.h"
30#include "gnunet_util_lib.h"
31
41
51 size_t unique_id);
52
58void
60
67const char*
68get_contact_name (const struct GNUNET_MESSENGER_Contact *contact);
69
76void
78 const char *name);
79
87get_contact_key (const struct GNUNET_MESSENGER_Contact *contact);
88
99 const struct GNUNET_HashCode *key);
100
109void
111 const struct GNUNET_HashCode *key,
112 const struct GNUNET_CRYPTO_HpkePublicKey *
113 encryption_key);
114
120void
122
132
139size_t
140get_contact_id (const struct GNUNET_MESSENGER_Contact *contact);
141
149void
151 const struct GNUNET_ShortHashCode *id,
152 struct GNUNET_HashCode *context);
153
154#endif // GNUNET_MESSENGER_API_CONTACT_H
struct GNUNET_HashCode key
The key used in the DHT.
static pa_context * context
Pulseaudio context.
static char * name
Name (label) of the records to list.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
GNUNET_GenericReturnValue
Named constants for return values.
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 GNUNE...
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 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.
void destroy_contact(struct GNUNET_MESSENGER_Contact *contact)
Destroys a contact and frees its memory fully.
void increase_contact_rc(struct GNUNET_MESSENGER_Contact *contact)
Increases the reference counter of a given contact which is zero as default.
const struct GNUNET_CRYPTO_BlindablePublicKey * get_contact_key(const struct GNUNET_MESSENGER_Contact *contact)
Returns the blindable public key of a given contact.
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 it...
size_t get_contact_id(const struct GNUNET_MESSENGER_Contact *contact)
Returns the locally unique identifier of a given 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.
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.
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 roo...
Internal representation of the hash map.
An identity key as per LSD0001.
A public key used for encryption.
A 512-bit hashcode.
struct GNUNET_CONTAINER_MultiHashMap * encryption_keys
struct GNUNET_CRYPTO_BlindablePublicKey public_key
A 256-bit hashcode.