GNUnet debian-0.24.3-23-g589b01d60
gnunet-service-messenger_service.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_SERVICE_MESSENGER_SERVICE_H
27#define GNUNET_SERVICE_MESSENGER_SERVICE_H
28
29#include "gnunet_util_lib.h"
31
34
36
38
40{
43
45
47 char *dir;
48
53 unsigned long long min_routers;
54
57
59
61
63};
64
74 struct GNUNET_SERVICE_Handle *service_handle);
75
81void
83
92
102 struct GNUNET_MQ_Handle *mq);
103
110void
113
124 struct GNUNET_PeerIdentity *peer);
125
136 const struct GNUNET_HashCode *key);
137
150 const struct GNUNET_HashCode *key);
151
168 const struct GNUNET_PeerIdentity *door,
169 const struct GNUNET_HashCode *key);
170
187 const struct GNUNET_HashCode *key,
188 enum GNUNET_GenericReturnValue deletion);
189
202void
204 struct GNUNET_MESSENGER_SrvRoom *room,
205 const struct GNUNET_MESSENGER_SenderSession *session,
206 const struct GNUNET_MESSENGER_Message *message,
207 const struct GNUNET_HashCode *hash,
208 const struct GNUNET_HashCode *epoch,
209 enum GNUNET_GenericReturnValue recent);
210
211#endif // GNUNET_SERVICE_MESSENGER_SERVICE_H
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
struct GNUNET_HashCode key
The key used in the DHT.
const struct GNUNET_CONFIGURATION_Handle * config
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
void remove_service_handle(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle)
Removes a handle from a service and destroys it.
enum GNUNET_GenericReturnValue get_service_peer_identity(struct GNUNET_MESSENGER_Service *service, struct GNUNET_PeerIdentity *peer)
Tries to write the peer identity of the peer running a service on to the peer parameter.
struct GNUNET_MESSENGER_ContactStore * get_service_contact_store(struct GNUNET_MESSENGER_Service *service)
Returns the used contact store of a given service.
void destroy_service(struct GNUNET_MESSENGER_Service *service)
Destroys a service and frees its memory fully.
enum GNUNET_GenericReturnValue entry_service_room(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key)
Tries to enter a room using a given key for a service by a specific handle.
enum GNUNET_GenericReturnValue close_service_room(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, enum GNUNET_GenericReturnValue deletion)
Tries to close a room using a given key for a service by a specific handle.
void handle_service_message(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *epoch, enum GNUNET_GenericReturnValue recent)
Sends a received or sent message with a given hash to each handle of a service which is currently mem...
struct GNUNET_MESSENGER_SrvHandle * add_service_handle(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MQ_Handle *mq)
Creates and adds a new handle to a service using a given message queue.
struct GNUNET_MESSENGER_SrvRoom * get_service_room(const struct GNUNET_MESSENGER_Service *service, const struct GNUNET_HashCode *key)
Returns the room identified by a given key for a service.
struct GNUNET_MESSENGER_Service * create_service(const struct GNUNET_CONFIGURATION_Handle *config, struct GNUNET_SERVICE_Handle *service_handle)
Creates and allocates a new service using a given config and a GNUnet service handle.
enum GNUNET_GenericReturnValue open_service_room(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Tries to open a room using a given key for a service by a specific handle.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
API to create, modify and access statistics.
GNUNET_GenericReturnValue
Named constants for return values.
Opaque handle to the service.
Definition: cadet_api.c:39
Internal representation of the hash map.
A 512-bit hashcode.
struct GNUNET_MESSENGER_ContactStore contact_store
enum GNUNET_GenericReturnValue auto_routing
struct GNUNET_CONTAINER_MultiHashMap * rooms
struct GNUNET_SCHEDULER_Task * shutdown
struct GNUNET_CADET_Handle * cadet
struct GNUNET_MESSENGER_ListHandles handles
const struct GNUNET_CONFIGURATION_Handle * config
enum GNUNET_GenericReturnValue auto_connecting
struct GNUNET_PeerIdentity * peer
enum GNUNET_GenericReturnValue local_request
enum GNUNET_GenericReturnValue group_keys
struct GNUNET_STATISTICS_Handle * statistics
struct GNUNET_SERVICE_Handle * service
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:136
Handle to a service.
Definition: service.c:116
Handle for the service.