GNUnet 0.22.1
gnunet-service-messenger_handle.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2024 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_SERVICE_MESSENGER_HANDLE_H
27#define GNUNET_SERVICE_MESSENGER_HANDLE_H
28
29#include "gnunet_util_lib.h"
30
33
35{
38
40
44
46};
47
57 struct GNUNET_MQ_Handle *mq);
58
64void
66
73void
75 const struct GNUNET_CRYPTO_PublicKey *key);
76
83const struct GNUNET_CRYPTO_PublicKey*
85
94void
96 const char *name,
97 char **dir);
98
108const struct GNUNET_ShortHashCode*
110 const struct GNUNET_HashCode *key);
111
125 const struct GNUNET_HashCode *key,
126 const struct GNUNET_ShortHashCode *unique_id);
127
138 const struct GNUNET_HashCode *key);
139
151 const struct GNUNET_PeerIdentity *door,
152 const struct GNUNET_HashCode *key);
153
164 const struct GNUNET_HashCode *key);
165
176 const struct GNUNET_HashCode *key);
177
178
190void
192 const struct GNUNET_HashCode *key,
193 const struct GNUNET_HashCode *prev,
194 struct GNUNET_HashCode *hash);
195
206 const struct GNUNET_HashCode *key,
207 const struct GNUNET_MESSENGER_Message *message);
208
219void
221 struct GNUNET_MESSENGER_SrvRoom *room,
222 const struct GNUNET_MESSENGER_SenderSession *session,
223 const struct GNUNET_MESSENGER_Message *message,
224 const struct GNUNET_HashCode *hash,
225 enum GNUNET_GenericReturnValue recent);
226
235void
237 struct GNUNET_MESSENGER_SrvRoom *room,
238 const struct GNUNET_ShortHashCode *member_id,
240
241#endif //GNUNET_SERVICE_MESSENGER_HANDLE_H
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
static char * dir
Set to the directory where runtime files are stored.
Definition: gnunet-arm.c:88
struct GNUNET_HashCode key
The key used in the DHT.
static char * name
Name (label) of the records to list.
static int reset
Reset argument.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
struct GNUNET_MESSENGER_SrvHandle * create_srv_handle(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MQ_Handle *mq)
Creates and allocates a new handle related to a service and using a given mq (message queue).
void set_srv_handle_key(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_CRYPTO_PublicKey *key)
Sets the public key of a given handle.
void notify_srv_handle_message(struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue recent)
Notifies the handle that a new message was received or sent.
enum GNUNET_GenericReturnValue change_srv_handle_member_id(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_ShortHashCode *unique_id)
Changes the member id of a given handle in a specific room to match a unique_id and returns GNUNET_OK...
enum GNUNET_GenericReturnValue close_srv_handle_room(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Removes the membership of the room using a specific key and closes it if no other handle from this se...
enum GNUNET_GenericReturnValue send_srv_handle_message(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_MESSENGER_Message *message)
Sends a message from a given handle to the room using a specific key.
void notify_srv_handle_member_id(struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *member_id, enum GNUNET_GenericReturnValue reset)
Notifies the handle that a new member id needs to be used.
enum GNUNET_GenericReturnValue entry_srv_handle_room(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key)
Makes a given handle a member of the room using a specific key and enters the room through a tunnel t...
const struct GNUNET_CRYPTO_PublicKey * get_srv_handle_key(const struct GNUNET_MESSENGER_SrvHandle *handle)
Returns the public key of a given handle.
void sync_srv_handle_messages(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_HashCode *prev, struct GNUNET_HashCode *hash)
Returns the latest merged hash from a room of a given handle using a specific key and the handles own...
const struct GNUNET_ShortHashCode * get_srv_handle_member_id(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns the member id of a given handle in a specific room.
enum GNUNET_GenericReturnValue is_srv_handle_routing(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns whether a given handle has enabled routing for a room using a specific key by opening that ro...
void get_srv_handle_data_subdir(const struct GNUNET_MESSENGER_SrvHandle *handle, const char *name, char **dir)
Writes the path of the directory for a given handle using a specific name to the parameter dir.
void destroy_srv_handle(struct GNUNET_MESSENGER_SrvHandle *handle)
Destroys a handle and frees its memory fully.
enum GNUNET_GenericReturnValue open_srv_handle_room(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Makes a given handle a member of the room using a specific key and opens the room from the handles se...
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
GNUNET_GenericReturnValue
Named constants for return values.
Internal representation of the hash map.
An identity key as per LSD0001.
A 512-bit hashcode.
struct GNUNET_SCHEDULER_Task * notify
struct GNUNET_CONTAINER_MultiHashMap * routing
struct GNUNET_MESSENGER_Service * service
struct GNUNET_CRYPTO_PublicKey * key
struct GNUNET_CONTAINER_MultiHashMap * next_ids
struct GNUNET_CONTAINER_MultiHashMap * member_ids
Handle to a message queue.
Definition: mq.c:87
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
Definition: scheduler.c:135
A 256-bit hashcode.