GNUnet  0.11.x
gnunet-service-messenger_handle.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2020--2021 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 "platform.h"
30 #include "gnunet_cadet_service.h"
31 #include "gnunet_container_lib.h"
32 #include "gnunet_crypto_lib.h"
34 #include "gnunet_peer_lib.h"
35 #include "gnunet_mq_lib.h"
36 
39 
40 #include "messenger_api_ego.h"
41 #include "messenger_api_message.h"
42 
44 {
47 
48  char *name;
49 
50  const struct GNUNET_MESSENGER_Ego *ego;
51 
53 };
54 
64 
70 void
72 
81 void
82 get_handle_data_subdir (const struct GNUNET_MESSENGER_SrvHandle *handle, const char *name, char **dir);
83 
93 const struct GNUNET_ShortHashCode*
95 
107 int
109  const struct GNUNET_ShortHashCode *unique_id);
110 
117 void
119 
126 const struct GNUNET_MESSENGER_Ego*
128 
135 void
137 
144 void
146 
156 void
158 
167 int
169 
179 int
181  const struct GNUNET_HashCode *key);
182 
191 int
193 
202 int
204  const struct GNUNET_MESSENGER_Message *message);
205 
215 void
217  const struct GNUNET_MESSENGER_MemberSession *session,
218  const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
219 
226 void
228 
235 void
237 
238 #endif //GNUNET_SERVICE_MESSENGER_HANDLE_H
const struct GNUNET_MESSENGER_Ego * get_handle_ego(const struct GNUNET_MESSENGER_SrvHandle *handle)
Returns the EGO used by a given handle.
static char * dir
Set to the directory where runtime files are stored.
Definition: gnunet-arm.c:89
int entry_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...
void destroy_handle(struct GNUNET_MESSENGER_SrvHandle *handle)
Destroys a handle and frees its memory fully.
struct GNUNET_MESSENGER_Service * service
void setup_handle_name(struct GNUNET_MESSENGER_SrvHandle *handle, const char *name)
Tries to set the name and EGO key of a handle initially by looking up a specific name.
void save_handle_configuration(struct GNUNET_MESSENGER_SrvHandle *handle)
Saves member ids and other potential configuration from a given handle which depends on the given nam...
Internal representation of the hash map.
struct GNUNET_MESSENGER_SrvHandle * create_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)...
A 256-bit hashcode.
void set_handle_name(struct GNUNET_MESSENGER_SrvHandle *handle, const char *name)
Tries to rename the handle which implies renaming the EGO its using and moving all related data into ...
cryptographic primitives for GNUnet
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
int send_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.
A 512-bit hashcode.
GNUnet MESSENGER service.
int close_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...
struct GNUNET_HashCode key
The key used in the DHT.
void set_handle_ego(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Ego *ego)
Sets the EGO used by a given handle.
void update_handle(struct GNUNET_MESSENGER_SrvHandle *handle)
Tries to change the key pair of an EGO of a handle under the same name and informs all rooms about th...
const struct GNUNET_MESSENGER_Ego * ego
Handle to a message queue.
Definition: mq.c:85
The identity of the host (wraps the signing key of the peer).
void load_handle_configuration(struct GNUNET_MESSENGER_SrvHandle *handle)
Loads member ids and other potential configuration from a given handle which depends on the given nam...
void get_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...
struct GNUNET_CONTAINER_MultiHashMap * member_ids
int open_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...
int change_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...
GNUnet MESSENGER service.
messenger api: client and service implementation of GNUnet MESSENGER service
const struct GNUNET_ShortHashCode * get_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.
void notify_handle_message(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Notifies the handle that a new message was received or sent.