aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-06-07 22:09:43 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2022-06-07 22:09:43 +0200
commit79eff4349f89d13a8cc707550f6bb7d5fe8c99c3 (patch)
treee9f8aba91b4611187aaf67b5a16ff4d7548aaa18
parent3f811502ea804c4c3e8031d50dc27db210152337 (diff)
downloadgnunet-79eff4349f89d13a8cc707550f6bb7d5fe8c99c3.tar.gz
gnunet-79eff4349f89d13a8cc707550f6bb7d5fe8c99c3.zip
-fix duplicate naming of functions in messenger
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--src/messenger/gnunet-service-messenger.c32
-rw-r--r--src/messenger/gnunet-service-messenger_ego_store.c2
-rw-r--r--src/messenger/gnunet-service-messenger_handle.c114
-rw-r--r--src/messenger/gnunet-service-messenger_handle.h70
-rw-r--r--src/messenger/gnunet-service-messenger_list_handles.c6
-rw-r--r--src/messenger/gnunet-service-messenger_member_session.c4
-rw-r--r--src/messenger/gnunet-service-messenger_member_store.c4
-rw-r--r--src/messenger/gnunet-service-messenger_message_handle.c16
-rw-r--r--src/messenger/gnunet-service-messenger_message_recv.c16
-rw-r--r--src/messenger/gnunet-service-messenger_message_send.c8
-rw-r--r--src/messenger/gnunet-service-messenger_room.c228
-rw-r--r--src/messenger/gnunet-service-messenger_room.h96
-rw-r--r--src/messenger/gnunet-service-messenger_service.c32
-rw-r--r--src/messenger/gnunet-service-messenger_tunnel.c14
14 files changed, 321 insertions, 321 deletions
diff --git a/src/messenger/gnunet-service-messenger.c b/src/messenger/gnunet-service-messenger.c
index 31bffec18..506ab7443 100644
--- a/src/messenger/gnunet-service-messenger.c
+++ b/src/messenger/gnunet-service-messenger.c
@@ -56,7 +56,7 @@ handle_create (void *cls,
56 56
57 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Handle created with name: %s\n", name); 57 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Handle created with name: %s\n", name);
58 58
59 setup_handle_name (msg_client->handle, strlen (name) > 0 ? name : NULL); 59 setup_srv_handle_name (msg_client->handle, strlen (name) > 0 ? name : NULL);
60 60
61 GNUNET_SERVICE_client_continue (msg_client->client); 61 GNUNET_SERVICE_client_continue (msg_client->client);
62} 62}
@@ -67,7 +67,7 @@ handle_update (void *cls,
67{ 67{
68 struct GNUNET_MESSENGER_Client *msg_client = cls; 68 struct GNUNET_MESSENGER_Client *msg_client = cls;
69 69
70 update_handle (msg_client->handle); 70 update_srv_handle (msg_client->handle);
71 71
72 GNUNET_SERVICE_client_continue (msg_client->client); 72 GNUNET_SERVICE_client_continue (msg_client->client);
73} 73}
@@ -99,7 +99,7 @@ handle_set_name (void *cls,
99 99
100 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Handles name is now: %s\n", name); 100 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Handles name is now: %s\n", name);
101 101
102 set_handle_name (msg_client->handle, name); 102 set_srv_handle_name (msg_client->handle, name);
103 103
104 GNUNET_SERVICE_client_continue (msg_client->client); 104 GNUNET_SERVICE_client_continue (msg_client->client);
105} 105}
@@ -112,9 +112,9 @@ handle_room_open (void *cls,
112 112
113 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Opening room: %s\n", GNUNET_h2s (&(msg->key))); 113 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Opening room: %s\n", GNUNET_h2s (&(msg->key)));
114 114
115 if (GNUNET_YES == open_handle_room (msg_client->handle, &(msg->key))) 115 if (GNUNET_YES == open_srv_handle_room (msg_client->handle, &(msg->key)))
116 { 116 {
117 const struct GNUNET_ShortHashCode *member_id = get_handle_member_id (msg_client->handle, &(msg->key)); 117 const struct GNUNET_ShortHashCode *member_id = get_srv_handle_member_id (msg_client->handle, &(msg->key));
118 118
119 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Opening room with member id: %s\n", GNUNET_sh2s (member_id)); 119 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Opening room with member id: %s\n", GNUNET_sh2s (member_id));
120 120
@@ -139,9 +139,9 @@ handle_room_entry (void *cls,
139 139
140 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Entering room: %s, %s\n", GNUNET_h2s (&(msg->key)), GNUNET_i2s (&(msg->door))); 140 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Entering room: %s, %s\n", GNUNET_h2s (&(msg->key)), GNUNET_i2s (&(msg->door)));
141 141
142 if (GNUNET_YES == entry_handle_room (msg_client->handle, &(msg->door), &(msg->key))) 142 if (GNUNET_YES == entry_srv_handle_room (msg_client->handle, &(msg->door), &(msg->key)))
143 { 143 {
144 const struct GNUNET_ShortHashCode *member_id = get_handle_member_id (msg_client->handle, &(msg->key)); 144 const struct GNUNET_ShortHashCode *member_id = get_srv_handle_member_id (msg_client->handle, &(msg->key));
145 145
146 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Entering room with member id: %s\n", GNUNET_sh2s (member_id)); 146 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Entering room with member id: %s\n", GNUNET_sh2s (member_id));
147 147
@@ -168,7 +168,7 @@ handle_room_close (void *cls,
168 168
169 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Closing room: %s\n", GNUNET_h2s (&(msg->key))); 169 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Closing room: %s\n", GNUNET_h2s (&(msg->key)));
170 170
171 if (GNUNET_YES == close_handle_room (msg_client->handle, &(msg->key))) 171 if (GNUNET_YES == close_srv_handle_room (msg_client->handle, &(msg->key)))
172 { 172 {
173 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Closing room succeeded: %s\n", GNUNET_h2s (&(msg->key))); 173 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Closing room succeeded: %s\n", GNUNET_h2s (&(msg->key)));
174 174
@@ -271,7 +271,7 @@ handle_send_message (void *cls,
271 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sending message: %s to %s\n", 271 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sending message: %s to %s\n",
272 GNUNET_MESSENGER_name_of_kind (message.header.kind), GNUNET_h2s (key)); 272 GNUNET_MESSENGER_name_of_kind (message.header.kind), GNUNET_h2s (key));
273 273
274 if (GNUNET_YES != send_handle_message (msg_client->handle, key, &message)) 274 if (GNUNET_YES != send_srv_handle_message (msg_client->handle, key, &message))
275 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Sending message failed: %s to %s\n", 275 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Sending message failed: %s to %s\n",
276 GNUNET_MESSENGER_name_of_kind (message.header.kind), GNUNET_h2s (key)); 276 GNUNET_MESSENGER_name_of_kind (message.header.kind), GNUNET_h2s (key));
277 277
@@ -291,11 +291,11 @@ callback_found_message (void *cls,
291 291
292 if (!message) 292 if (!message)
293 { 293 {
294 send_room_message(room, msg_client->handle, create_message_request(hash)); 294 send_srv_room_message(room, msg_client->handle, create_message_request(hash));
295 return; 295 return;
296 } 296 }
297 297
298 struct GNUNET_MESSENGER_MemberStore *store = get_room_member_store(room); 298 struct GNUNET_MESSENGER_MemberStore *store = get_srv_room_member_store(room);
299 299
300 struct GNUNET_MESSENGER_Member *member = get_store_member_of(store, message); 300 struct GNUNET_MESSENGER_Member *member = get_store_member_of(store, message);
301 301
@@ -308,7 +308,7 @@ callback_found_message (void *cls,
308 struct GNUNET_MESSENGER_MemberSession *session = get_member_session_of(member, message, hash); 308 struct GNUNET_MESSENGER_MemberSession *session = get_member_session_of(member, message, hash);
309 309
310 if (session) 310 if (session)
311 notify_handle_message (msg_client->handle, room, session, message, hash); 311 notify_srv_handle_message (msg_client->handle, room, session, message, hash);
312} 312}
313 313
314static void 314static void
@@ -327,9 +327,9 @@ handle_get_message (void *cls,
327 goto end_handling; 327 goto end_handling;
328 } 328 }
329 329
330 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 330 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
331 331
332 struct GNUNET_MESSENGER_Member *member = get_store_member(member_store, get_handle_member_id( 332 struct GNUNET_MESSENGER_Member *member = get_store_member(member_store, get_srv_handle_member_id(
333 msg_client->handle, &(msg->key) 333 msg_client->handle, &(msg->key)
334 )); 334 ));
335 335
@@ -339,7 +339,7 @@ handle_get_message (void *cls,
339 goto end_handling; 339 goto end_handling;
340 } 340 }
341 341
342 struct GNUNET_MESSENGER_MemberSession *session = get_member_session(member, &(get_handle_ego(msg_client->handle)->pub)); 342 struct GNUNET_MESSENGER_MemberSession *session = get_member_session(member, &(get_srv_handle_ego(msg_client->handle)->pub));
343 343
344 if (!session) 344 if (!session)
345 { 345 {
@@ -347,7 +347,7 @@ handle_get_message (void *cls,
347 goto end_handling; 347 goto end_handling;
348 } 348 }
349 349
350 request_room_message (room, &(msg->hash), session, callback_found_message, msg_client); 350 request_srv_room_message (room, &(msg->hash), session, callback_found_message, msg_client);
351 351
352end_handling: 352end_handling:
353 GNUNET_SERVICE_client_continue (msg_client->client); 353 GNUNET_SERVICE_client_continue (msg_client->client);
diff --git a/src/messenger/gnunet-service-messenger_ego_store.c b/src/messenger/gnunet-service-messenger_ego_store.c
index 60a4d7bfc..8250d0902 100644
--- a/src/messenger/gnunet-service-messenger_ego_store.c
+++ b/src/messenger/gnunet-service-messenger_ego_store.c
@@ -132,7 +132,7 @@ iterate_create_ego (void *cls,
132 void *value) 132 void *value)
133{ 133{
134 struct GNUNET_MESSENGER_SrvHandle *handle = value; 134 struct GNUNET_MESSENGER_SrvHandle *handle = value;
135 set_handle_ego (handle, (struct GNUNET_MESSENGER_Ego*) cls); 135 set_srv_handle_ego (handle, (struct GNUNET_MESSENGER_Ego*) cls);
136 return GNUNET_YES; 136 return GNUNET_YES;
137} 137}
138 138
diff --git a/src/messenger/gnunet-service-messenger_handle.c b/src/messenger/gnunet-service-messenger_handle.c
index 218482e45..a4fa81623 100644
--- a/src/messenger/gnunet-service-messenger_handle.c
+++ b/src/messenger/gnunet-service-messenger_handle.c
@@ -31,8 +31,8 @@
31#include "messenger_api_util.h" 31#include "messenger_api_util.h"
32 32
33struct GNUNET_MESSENGER_SrvHandle* 33struct GNUNET_MESSENGER_SrvHandle*
34create_handle (struct GNUNET_MESSENGER_Service *service, 34create_srv_handle (struct GNUNET_MESSENGER_Service *service,
35 struct GNUNET_MQ_Handle *mq) 35 struct GNUNET_MQ_Handle *mq)
36{ 36{
37 GNUNET_assert((service) && (mq)); 37 GNUNET_assert((service) && (mq));
38 38
@@ -60,12 +60,12 @@ iterate_free_member_ids (void *cls,
60} 60}
61 61
62void 62void
63destroy_handle (struct GNUNET_MESSENGER_SrvHandle *handle) 63destroy_srv_handle (struct GNUNET_MESSENGER_SrvHandle *handle)
64{ 64{
65 GNUNET_assert(handle); 65 GNUNET_assert(handle);
66 66
67 if (handle->service->dir) 67 if (handle->service->dir)
68 save_handle_configuration (handle); 68 save_srv_handle_configuration (handle);
69 69
70 if (handle->name) 70 if (handle->name)
71 { 71 {
@@ -83,9 +83,9 @@ destroy_handle (struct GNUNET_MESSENGER_SrvHandle *handle)
83} 83}
84 84
85void 85void
86get_handle_data_subdir (const struct GNUNET_MESSENGER_SrvHandle *handle, 86get_srv_handle_data_subdir (const struct GNUNET_MESSENGER_SrvHandle *handle,
87 const char *name, 87 const char *name,
88 char **dir) 88 char **dir)
89{ 89{
90 GNUNET_assert((handle) && (dir)); 90 GNUNET_assert((handle) && (dir));
91 91
@@ -124,8 +124,8 @@ create_handle_member_id (const struct GNUNET_MESSENGER_SrvHandle *handle,
124} 124}
125 125
126const struct GNUNET_ShortHashCode* 126const struct GNUNET_ShortHashCode*
127get_handle_member_id (const struct GNUNET_MESSENGER_SrvHandle *handle, 127get_srv_handle_member_id (const struct GNUNET_MESSENGER_SrvHandle *handle,
128 const struct GNUNET_HashCode *key) 128 const struct GNUNET_HashCode *key)
129{ 129{
130 GNUNET_assert((handle) && (key)); 130 GNUNET_assert((handle) && (key));
131 131
@@ -133,9 +133,9 @@ get_handle_member_id (const struct GNUNET_MESSENGER_SrvHandle *handle,
133} 133}
134 134
135int 135int
136change_handle_member_id (struct GNUNET_MESSENGER_SrvHandle *handle, 136change_srv_handle_member_id (struct GNUNET_MESSENGER_SrvHandle *handle,
137 const struct GNUNET_HashCode *key, 137 const struct GNUNET_HashCode *key,
138 const struct GNUNET_ShortHashCode *unique_id) 138 const struct GNUNET_ShortHashCode *unique_id)
139{ 139{
140 GNUNET_assert((handle) && (key) && (unique_id)); 140 GNUNET_assert((handle) && (key) && (unique_id));
141 141
@@ -214,7 +214,7 @@ change_handle_ego (struct GNUNET_MESSENGER_SrvHandle *handle,
214 214
215 handle->ego = ego; 215 handle->ego = ego;
216 216
217 ego = get_handle_ego (handle); 217 ego = get_srv_handle_ego (handle);
218 218
219 const uint16_t length = GNUNET_IDENTITY_key_get_length(&(ego->pub)); 219 const uint16_t length = GNUNET_IDENTITY_key_get_length(&(ego->pub));
220 220
@@ -244,14 +244,14 @@ iterate_send_message (void *cls,
244{ 244{
245 struct GNUNET_MESSENGER_MessageHandle *msg_handle = cls; 245 struct GNUNET_MESSENGER_MessageHandle *msg_handle = cls;
246 246
247 send_handle_message (msg_handle->handle, key, msg_handle->message); 247 send_srv_handle_message (msg_handle->handle, key, msg_handle->message);
248 248
249 return GNUNET_YES; 249 return GNUNET_YES;
250} 250}
251 251
252void 252void
253set_handle_ego (struct GNUNET_MESSENGER_SrvHandle *handle, 253set_srv_handle_ego (struct GNUNET_MESSENGER_SrvHandle *handle,
254 const struct GNUNET_MESSENGER_Ego *ego) 254 const struct GNUNET_MESSENGER_Ego *ego)
255{ 255{
256 GNUNET_assert((handle) && (ego)); 256 GNUNET_assert((handle) && (ego));
257 257
@@ -268,7 +268,7 @@ set_handle_ego (struct GNUNET_MESSENGER_SrvHandle *handle,
268} 268}
269 269
270const struct GNUNET_MESSENGER_Ego* 270const struct GNUNET_MESSENGER_Ego*
271get_handle_ego (const struct GNUNET_MESSENGER_SrvHandle *handle) 271get_srv_handle_ego (const struct GNUNET_MESSENGER_SrvHandle *handle)
272{ 272{
273 GNUNET_assert(handle); 273 GNUNET_assert(handle);
274 274
@@ -302,12 +302,12 @@ callback_setup_handle_name (void *cls,
302 change_handle_ego (handle, ego); 302 change_handle_ego (handle, ego);
303 303
304 if (handle->service->dir) 304 if (handle->service->dir)
305 load_handle_configuration (handle); 305 load_srv_handle_configuration (handle);
306} 306}
307 307
308void 308void
309setup_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle, 309setup_srv_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle,
310 const char *name) 310 const char *name)
311{ 311{
312 GNUNET_assert(handle); 312 GNUNET_assert(handle);
313 313
@@ -336,7 +336,7 @@ callback_update_handle (void *cls,
336} 336}
337 337
338void 338void
339update_handle (struct GNUNET_MESSENGER_SrvHandle *handle) 339update_srv_handle (struct GNUNET_MESSENGER_SrvHandle *handle)
340{ 340{
341 GNUNET_assert (handle); 341 GNUNET_assert (handle);
342 342
@@ -369,10 +369,10 @@ callback_set_handle_name (void *cls,
369 struct GNUNET_MESSENGER_EgoStore *store = get_service_ego_store(handle->service); 369 struct GNUNET_MESSENGER_EgoStore *store = get_service_ego_store(handle->service);
370 370
371 char *old_dir; 371 char *old_dir;
372 get_handle_data_subdir (handle, handle->name, &old_dir); 372 get_srv_handle_data_subdir (handle, handle->name, &old_dir);
373 373
374 char *new_dir; 374 char *new_dir;
375 get_handle_data_subdir (handle, name, &new_dir); 375 get_srv_handle_data_subdir (handle, name, &new_dir);
376 376
377 if ((GNUNET_YES == GNUNET_DISK_directory_test (new_dir, GNUNET_NO)) && 377 if ((GNUNET_YES == GNUNET_DISK_directory_test (new_dir, GNUNET_NO)) &&
378 (GNUNET_OK != GNUNET_DISK_directory_remove(new_dir))) 378 (GNUNET_OK != GNUNET_DISK_directory_remove(new_dir)))
@@ -403,8 +403,8 @@ free_dirs:
403} 403}
404 404
405void 405void
406set_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle, 406set_srv_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle,
407 const char *name) 407 const char *name)
408{ 408{
409 GNUNET_assert(handle); 409 GNUNET_assert(handle);
410 410
@@ -424,50 +424,50 @@ set_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle,
424} 424}
425 425
426int 426int
427open_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle, 427open_srv_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
428 const struct GNUNET_HashCode *key) 428 const struct GNUNET_HashCode *key)
429{ 429{
430 GNUNET_assert((handle) && (key)); 430 GNUNET_assert((handle) && (key));
431 431
432 if ((!get_handle_member_id (handle, key)) && (GNUNET_YES != create_handle_member_id (handle, key))) 432 if ((!get_srv_handle_member_id (handle, key)) && (GNUNET_YES != create_handle_member_id (handle, key)))
433 return GNUNET_NO; 433 return GNUNET_NO;
434 434
435 return open_service_room (handle->service, handle, key); 435 return open_service_room (handle->service, handle, key);
436} 436}
437 437
438int 438int
439entry_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle, 439entry_srv_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
440 const struct GNUNET_PeerIdentity *door, 440 const struct GNUNET_PeerIdentity *door,
441 const struct GNUNET_HashCode *key) 441 const struct GNUNET_HashCode *key)
442{ 442{
443 GNUNET_assert((handle) && (door) && (key)); 443 GNUNET_assert((handle) && (door) && (key));
444 444
445 if ((!get_handle_member_id (handle, key)) && (GNUNET_YES != create_handle_member_id (handle, key))) 445 if ((!get_srv_handle_member_id (handle, key)) && (GNUNET_YES != create_handle_member_id (handle, key)))
446 return GNUNET_NO; 446 return GNUNET_NO;
447 447
448 return entry_service_room (handle->service, handle, door, key); 448 return entry_service_room (handle->service, handle, door, key);
449} 449}
450 450
451int 451int
452close_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle, 452close_srv_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
453 const struct GNUNET_HashCode *key) 453 const struct GNUNET_HashCode *key)
454{ 454{
455 GNUNET_assert((handle) && (key)); 455 GNUNET_assert((handle) && (key));
456 456
457 if (!get_handle_member_id (handle, key)) 457 if (!get_srv_handle_member_id (handle, key))
458 return GNUNET_NO; 458 return GNUNET_NO;
459 459
460 return close_service_room (handle->service, handle, key); 460 return close_service_room (handle->service, handle, key);
461} 461}
462 462
463int 463int
464send_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle, 464send_srv_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
465 const struct GNUNET_HashCode *key, 465 const struct GNUNET_HashCode *key,
466 const struct GNUNET_MESSENGER_Message *message) 466 const struct GNUNET_MESSENGER_Message *message)
467{ 467{
468 GNUNET_assert((handle) && (key) && (message)); 468 GNUNET_assert((handle) && (key) && (message));
469 469
470 const struct GNUNET_ShortHashCode *id = get_handle_member_id (handle, key); 470 const struct GNUNET_ShortHashCode *id = get_srv_handle_member_id (handle, key);
471 471
472 if (!id) 472 if (!id)
473 { 473 {
@@ -487,7 +487,7 @@ send_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
487 487
488 GNUNET_memcpy(&(msg->header.sender_id), id, sizeof(*id)); 488 GNUNET_memcpy(&(msg->header.sender_id), id, sizeof(*id));
489 489
490 return send_room_message (room, handle, msg); 490 return send_srv_room_message (room, handle, msg);
491} 491}
492 492
493static const struct GNUNET_HashCode* 493static const struct GNUNET_HashCode*
@@ -506,15 +506,15 @@ get_handle_member_session (struct GNUNET_MESSENGER_SrvHandle *handle,
506{ 506{
507 GNUNET_assert((handle) && (room) && (key) && (handle->service)); 507 GNUNET_assert((handle) && (room) && (key) && (handle->service));
508 508
509 const struct GNUNET_ShortHashCode *id = get_handle_member_id(handle, key); 509 const struct GNUNET_ShortHashCode *id = get_srv_handle_member_id(handle, key);
510 510
511 if (!id) 511 if (!id)
512 return NULL; 512 return NULL;
513 513
514 struct GNUNET_MESSENGER_MemberStore *store = get_room_member_store(room); 514 struct GNUNET_MESSENGER_MemberStore *store = get_srv_room_member_store(room);
515 struct GNUNET_MESSENGER_Member *member = get_store_member(store, id); 515 struct GNUNET_MESSENGER_Member *member = get_store_member(store, id);
516 516
517 const struct GNUNET_MESSENGER_Ego *ego = get_handle_ego(handle); 517 const struct GNUNET_MESSENGER_Ego *ego = get_srv_handle_ego(handle);
518 518
519 if (!ego) 519 if (!ego)
520 return NULL; 520 return NULL;
@@ -523,17 +523,17 @@ get_handle_member_session (struct GNUNET_MESSENGER_SrvHandle *handle,
523} 523}
524 524
525void 525void
526notify_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle, 526notify_srv_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
527 struct GNUNET_MESSENGER_SrvRoom *room, 527 struct GNUNET_MESSENGER_SrvRoom *room,
528 const struct GNUNET_MESSENGER_MemberSession *session, 528 const struct GNUNET_MESSENGER_MemberSession *session,
529 const struct GNUNET_MESSENGER_Message *message, 529 const struct GNUNET_MESSENGER_Message *message,
530 const struct GNUNET_HashCode *hash) 530 const struct GNUNET_HashCode *hash)
531{ 531{
532 GNUNET_assert((handle) && (room) && (session) && (message) && (hash)); 532 GNUNET_assert((handle) && (room) && (session) && (message) && (hash));
533 533
534 const struct GNUNET_HashCode *key = get_room_key(room); 534 const struct GNUNET_HashCode *key = get_srv_room_key(room);
535 535
536 if ((!handle->mq) || (!get_handle_member_id (handle, key))) 536 if ((!handle->mq) || (!get_srv_handle_member_id (handle, key)))
537 { 537 {
538 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Notifying client about message requires membership!\n"); 538 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Notifying client about message requires membership!\n");
539 return; 539 return;
@@ -554,7 +554,7 @@ notify_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
554 { 554 {
555 private_message = copy_message(message); 555 private_message = copy_message(message);
556 556
557 if (GNUNET_YES != decrypt_message(private_message, &(get_handle_ego(handle)->priv))) 557 if (GNUNET_YES != decrypt_message(private_message, &(get_srv_handle_ego(handle)->priv)))
558 { 558 {
559 destroy_message(private_message); 559 destroy_message(private_message);
560 private_message = NULL; 560 private_message = NULL;
@@ -612,7 +612,7 @@ callback_scan_for_rooms (void *cls,
612 612
613 if ((GNUNET_OK == GNUNET_CONFIGURATION_get_data (cfg, "room", "key", &key, sizeof(key))) && 613 if ((GNUNET_OK == GNUNET_CONFIGURATION_get_data (cfg, "room", "key", &key, sizeof(key))) &&
614 (GNUNET_OK == GNUNET_CONFIGURATION_get_data (cfg, "room", "member_id", &member_id, sizeof(member_id)))) 614 (GNUNET_OK == GNUNET_CONFIGURATION_get_data (cfg, "room", "member_id", &member_id, sizeof(member_id))))
615 change_handle_member_id (handle, &key, &member_id); 615 change_srv_handle_member_id (handle, &key, &member_id);
616 } 616 }
617 617
618 GNUNET_CONFIGURATION_destroy (cfg); 618 GNUNET_CONFIGURATION_destroy (cfg);
@@ -620,12 +620,12 @@ callback_scan_for_rooms (void *cls,
620} 620}
621 621
622void 622void
623load_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle) 623load_srv_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle)
624{ 624{
625 GNUNET_assert(handle); 625 GNUNET_assert(handle);
626 626
627 char *id_dir; 627 char *id_dir;
628 get_handle_data_subdir (handle, handle->name, &id_dir); 628 get_srv_handle_data_subdir (handle, handle->name, &id_dir);
629 629
630 if (GNUNET_YES == GNUNET_DISK_directory_test (id_dir, GNUNET_YES)) 630 if (GNUNET_YES == GNUNET_DISK_directory_test (id_dir, GNUNET_YES))
631 { 631 {
@@ -650,7 +650,7 @@ iterate_save_rooms (void *cls,
650 struct GNUNET_ShortHashCode *member_id = value; 650 struct GNUNET_ShortHashCode *member_id = value;
651 651
652 char *id_dir; 652 char *id_dir;
653 get_handle_data_subdir (handle, handle->name, &id_dir); 653 get_srv_handle_data_subdir (handle, handle->name, &id_dir);
654 654
655 char *filename; 655 char *filename;
656 GNUNET_asprintf (&filename, "%s%s%c%s.cfg", id_dir, "rooms", DIR_SEPARATOR, GNUNET_h2s (key)); 656 GNUNET_asprintf (&filename, "%s%s%c%s.cfg", id_dir, "rooms", DIR_SEPARATOR, GNUNET_h2s (key));
@@ -687,12 +687,12 @@ iterate_save_rooms (void *cls,
687} 687}
688 688
689void 689void
690save_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle) 690save_srv_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle)
691{ 691{
692 GNUNET_assert(handle); 692 GNUNET_assert(handle);
693 693
694 char *id_dir; 694 char *id_dir;
695 get_handle_data_subdir (handle, handle->name, &id_dir); 695 get_srv_handle_data_subdir (handle, handle->name, &id_dir);
696 696
697 if ((GNUNET_YES == GNUNET_DISK_directory_test (id_dir, GNUNET_NO)) || (GNUNET_OK 697 if ((GNUNET_YES == GNUNET_DISK_directory_test (id_dir, GNUNET_NO)) || (GNUNET_OK
698 == GNUNET_DISK_directory_create (id_dir))) 698 == GNUNET_DISK_directory_create (id_dir)))
diff --git a/src/messenger/gnunet-service-messenger_handle.h b/src/messenger/gnunet-service-messenger_handle.h
index 4438570b9..8754716e9 100644
--- a/src/messenger/gnunet-service-messenger_handle.h
+++ b/src/messenger/gnunet-service-messenger_handle.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -60,8 +60,8 @@ struct GNUNET_MESSENGER_SrvHandle
60 * @return New handle 60 * @return New handle
61 */ 61 */
62struct GNUNET_MESSENGER_SrvHandle* 62struct GNUNET_MESSENGER_SrvHandle*
63create_handle (struct GNUNET_MESSENGER_Service *service, 63create_srv_handle (struct GNUNET_MESSENGER_Service *service,
64 struct GNUNET_MQ_Handle *mq); 64 struct GNUNET_MQ_Handle *mq);
65 65
66/** 66/**
67 * Destroys a handle and frees its memory fully. 67 * Destroys a handle and frees its memory fully.
@@ -69,7 +69,7 @@ create_handle (struct GNUNET_MESSENGER_Service *service,
69 * @param[in/out] handle Handle 69 * @param[in/out] handle Handle
70 */ 70 */
71void 71void
72destroy_handle (struct GNUNET_MESSENGER_SrvHandle *handle); 72destroy_srv_handle (struct GNUNET_MESSENGER_SrvHandle *handle);
73 73
74/** 74/**
75 * Writes the path of the directory for a given <i>handle</i> using a specific <i>name</i> to the parameter 75 * Writes the path of the directory for a given <i>handle</i> using a specific <i>name</i> to the parameter
@@ -80,7 +80,7 @@ destroy_handle (struct GNUNET_MESSENGER_SrvHandle *handle);
80 * @param[out] dir Path to store data 80 * @param[out] dir Path to store data
81 */ 81 */
82void 82void
83get_handle_data_subdir (const struct GNUNET_MESSENGER_SrvHandle *handle, 83get_srv_handle_data_subdir (const struct GNUNET_MESSENGER_SrvHandle *handle,
84 const char *name, 84 const char *name,
85 char **dir); 85 char **dir);
86 86
@@ -94,8 +94,8 @@ get_handle_data_subdir (const struct GNUNET_MESSENGER_SrvHandle *handle,
94 * @return Member id or NULL 94 * @return Member id or NULL
95 */ 95 */
96const struct GNUNET_ShortHashCode* 96const struct GNUNET_ShortHashCode*
97get_handle_member_id (const struct GNUNET_MESSENGER_SrvHandle *handle, 97get_srv_handle_member_id (const struct GNUNET_MESSENGER_SrvHandle *handle,
98 const struct GNUNET_HashCode *key); 98 const struct GNUNET_HashCode *key);
99 99
100/** 100/**
101 * Changes the member id of a given <i>handle</i> in a specific <i>room</i> to match a <i>unique_id</i> 101 * Changes the member id of a given <i>handle</i> in a specific <i>room</i> to match a <i>unique_id</i>
@@ -109,9 +109,9 @@ get_handle_member_id (const struct GNUNET_MESSENGER_SrvHandle *handle,
109 * @return GNUNET_OK on success, otherwise GNUNET_SYSERR 109 * @return GNUNET_OK on success, otherwise GNUNET_SYSERR
110 */ 110 */
111int 111int
112change_handle_member_id (struct GNUNET_MESSENGER_SrvHandle *handle, 112change_srv_handle_member_id (struct GNUNET_MESSENGER_SrvHandle *handle,
113 const struct GNUNET_HashCode *key, 113 const struct GNUNET_HashCode *key,
114 const struct GNUNET_ShortHashCode *unique_id); 114 const struct GNUNET_ShortHashCode *unique_id);
115 115
116/** 116/**
117 * Sets the EGO used by a given <i>handle</i>. 117 * Sets the EGO used by a given <i>handle</i>.
@@ -120,8 +120,8 @@ change_handle_member_id (struct GNUNET_MESSENGER_SrvHandle *handle,
120 * @param[in] ego EGO key pair 120 * @param[in] ego EGO key pair
121 */ 121 */
122void 122void
123set_handle_ego (struct GNUNET_MESSENGER_SrvHandle *handle, 123set_srv_handle_ego (struct GNUNET_MESSENGER_SrvHandle *handle,
124 const struct GNUNET_MESSENGER_Ego *ego); 124 const struct GNUNET_MESSENGER_Ego *ego);
125 125
126/** 126/**
127 * Returns the EGO used by a given <i>handle</i>. 127 * Returns the EGO used by a given <i>handle</i>.
@@ -130,7 +130,7 @@ set_handle_ego (struct GNUNET_MESSENGER_SrvHandle *handle,
130 * @return EGO key pair 130 * @return EGO key pair
131 */ 131 */
132const struct GNUNET_MESSENGER_Ego* 132const struct GNUNET_MESSENGER_Ego*
133get_handle_ego (const struct GNUNET_MESSENGER_SrvHandle *handle); 133get_srv_handle_ego (const struct GNUNET_MESSENGER_SrvHandle *handle);
134 134
135/** 135/**
136 * Tries to set the name and EGO key of a <i>handle</i> initially by looking up a specific <i>name</i>. 136 * Tries to set the name and EGO key of a <i>handle</i> initially by looking up a specific <i>name</i>.
@@ -139,8 +139,8 @@ get_handle_ego (const struct GNUNET_MESSENGER_SrvHandle *handle);
139 * @param[in] name Name (optionally: valid EGO name) 139 * @param[in] name Name (optionally: valid EGO name)
140 */ 140 */
141void 141void
142setup_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle, 142setup_srv_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle,
143 const char *name); 143 const char *name);
144 144
145/** 145/**
146 * Tries to change the key pair of an EGO of a <i>handle</i> under the same name and informs all rooms 146 * Tries to change the key pair of an EGO of a <i>handle</i> under the same name and informs all rooms
@@ -149,7 +149,7 @@ setup_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle,
149 * @param[in/out] handle Handle 149 * @param[in/out] handle Handle
150 */ 150 */
151void 151void
152update_handle (struct GNUNET_MESSENGER_SrvHandle *handle); 152update_srv_handle (struct GNUNET_MESSENGER_SrvHandle *handle);
153 153
154/** 154/**
155 * Tries to rename the handle which implies renaming the EGO its using and moving all related data into 155 * Tries to rename the handle which implies renaming the EGO its using and moving all related data into
@@ -161,8 +161,8 @@ update_handle (struct GNUNET_MESSENGER_SrvHandle *handle);
161 * @param[in] name New name 161 * @param[in] name New name
162 */ 162 */
163void 163void
164set_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle, 164set_srv_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle,
165 const char *name); 165 const char *name);
166 166
167/** 167/**
168 * Makes a given <i>handle</i> a member of the room using a specific <i>key</i> and opens the 168 * Makes a given <i>handle</i> a member of the room using a specific <i>key</i> and opens the
@@ -173,8 +173,8 @@ set_handle_name (struct GNUNET_MESSENGER_SrvHandle *handle,
173 * @return #GNUNET_YES on success, otherwise #GNUNET_NO 173 * @return #GNUNET_YES on success, otherwise #GNUNET_NO
174 */ 174 */
175int 175int
176open_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle, 176open_srv_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
177 const struct GNUNET_HashCode *key); 177 const struct GNUNET_HashCode *key);
178 178
179/** 179/**
180 * Makes a given <i>handle</i> a member of the room using a specific <i>key</i> and enters the room 180 * Makes a given <i>handle</i> a member of the room using a specific <i>key</i> and enters the room
@@ -186,9 +186,9 @@ open_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
186 * @return #GNUNET_YES on success, otherwise #GNUNET_NO 186 * @return #GNUNET_YES on success, otherwise #GNUNET_NO
187 */ 187 */
188int 188int
189entry_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle, 189entry_srv_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
190 const struct GNUNET_PeerIdentity *door, 190 const struct GNUNET_PeerIdentity *door,
191 const struct GNUNET_HashCode *key); 191 const struct GNUNET_HashCode *key);
192 192
193/** 193/**
194 * Removes the membership of the room using a specific <i>key</i> and closes it if no other handle 194 * Removes the membership of the room using a specific <i>key</i> and closes it if no other handle
@@ -199,8 +199,8 @@ entry_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
199 * @return #GNUNET_YES on success, otherwise #GNUNET_NO 199 * @return #GNUNET_YES on success, otherwise #GNUNET_NO
200 */ 200 */
201int 201int
202close_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle, 202close_srv_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
203 const struct GNUNET_HashCode *key); 203 const struct GNUNET_HashCode *key);
204 204
205/** 205/**
206 * Sends a <i>message</i> from a given <i>handle</i> to the room using a specific <i>key</i>. 206 * Sends a <i>message</i> from a given <i>handle</i> to the room using a specific <i>key</i>.
@@ -211,9 +211,9 @@ close_handle_room (struct GNUNET_MESSENGER_SrvHandle *handle,
211 * @return #GNUNET_YES on success, #GNUNET_NO or #GNUNET_SYSERR otherwise. 211 * @return #GNUNET_YES on success, #GNUNET_NO or #GNUNET_SYSERR otherwise.
212 */ 212 */
213int 213int
214send_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle, 214send_srv_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
215 const struct GNUNET_HashCode *key, 215 const struct GNUNET_HashCode *key,
216 const struct GNUNET_MESSENGER_Message *message); 216 const struct GNUNET_MESSENGER_Message *message);
217 217
218/** 218/**
219 * Notifies the handle that a new message was received or sent. 219 * Notifies the handle that a new message was received or sent.
@@ -225,11 +225,11 @@ send_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
225 * @param[in] hash Hash of message 225 * @param[in] hash Hash of message
226 */ 226 */
227void 227void
228notify_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle, 228notify_srv_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
229 struct GNUNET_MESSENGER_SrvRoom *room, 229 struct GNUNET_MESSENGER_SrvRoom *room,
230 const struct GNUNET_MESSENGER_MemberSession *session, 230 const struct GNUNET_MESSENGER_MemberSession *session,
231 const struct GNUNET_MESSENGER_Message *message, 231 const struct GNUNET_MESSENGER_Message *message,
232 const struct GNUNET_HashCode *hash); 232 const struct GNUNET_HashCode *hash);
233 233
234/** 234/**
235 * Loads member ids and other potential configuration from a given <i>handle</i> which 235 * Loads member ids and other potential configuration from a given <i>handle</i> which
@@ -238,7 +238,7 @@ notify_handle_message (struct GNUNET_MESSENGER_SrvHandle *handle,
238 * @param[out] handle Handle 238 * @param[out] handle Handle
239 */ 239 */
240void 240void
241load_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle); 241load_srv_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle);
242 242
243/** 243/**
244 * Saves member ids and other potential configuration from a given <i>handle</i> which 244 * Saves member ids and other potential configuration from a given <i>handle</i> which
@@ -247,6 +247,6 @@ load_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle);
247 * @param[in] handle Handle 247 * @param[in] handle Handle
248 */ 248 */
249void 249void
250save_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle); 250save_srv_handle_configuration (struct GNUNET_MESSENGER_SrvHandle *handle);
251 251
252#endif //GNUNET_SERVICE_MESSENGER_HANDLE_H 252#endif //GNUNET_SERVICE_MESSENGER_HANDLE_H
diff --git a/src/messenger/gnunet-service-messenger_list_handles.c b/src/messenger/gnunet-service-messenger_list_handles.c
index c0ae18716..f2daa2e70 100644
--- a/src/messenger/gnunet-service-messenger_list_handles.c
+++ b/src/messenger/gnunet-service-messenger_list_handles.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -46,7 +46,7 @@ clear_list_handles (struct GNUNET_MESSENGER_ListHandles *handles)
46 struct GNUNET_MESSENGER_ListHandle *element = handles->head; 46 struct GNUNET_MESSENGER_ListHandle *element = handles->head;
47 47
48 GNUNET_CONTAINER_DLL_remove(handles->head, handles->tail, element); 48 GNUNET_CONTAINER_DLL_remove(handles->head, handles->tail, element);
49 destroy_handle (element->handle); 49 destroy_srv_handle (element->handle);
50 GNUNET_free(element); 50 GNUNET_free(element);
51 } 51 }
52 52
@@ -97,7 +97,7 @@ find_list_handle_by_member (const struct GNUNET_MESSENGER_ListHandles *handles,
97 struct GNUNET_MESSENGER_ListHandle *element; 97 struct GNUNET_MESSENGER_ListHandle *element;
98 98
99 for (element = handles->head; element; element = element->next) 99 for (element = handles->head; element; element = element->next)
100 if (get_handle_member_id ((struct GNUNET_MESSENGER_SrvHandle*) element->handle, key)) 100 if (get_srv_handle_member_id ((struct GNUNET_MESSENGER_SrvHandle*) element->handle, key))
101 return element->handle; 101 return element->handle;
102 102
103 return NULL; 103 return NULL;
diff --git a/src/messenger/gnunet-service-messenger_member_session.c b/src/messenger/gnunet-service-messenger_member_session.c
index 6bd1d24b8..d71513046 100644
--- a/src/messenger/gnunet-service-messenger_member_session.c
+++ b/src/messenger/gnunet-service-messenger_member_session.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -101,7 +101,7 @@ check_member_session_completion (struct GNUNET_MESSENGER_MemberSession *session)
101 101
102 add_to_list_messages(&level, end); 102 add_to_list_messages(&level, end);
103 103
104 struct GNUNET_MESSENGER_MessageStore *store = get_room_message_store(session->member->store->room); 104 struct GNUNET_MESSENGER_MessageStore *store = get_srv_room_message_store(session->member->store->room);
105 105
106 struct GNUNET_MESSENGER_ListMessages list; 106 struct GNUNET_MESSENGER_ListMessages list;
107 init_list_messages(&list); 107 init_list_messages(&list);
diff --git a/src/messenger/gnunet-service-messenger_member_store.c b/src/messenger/gnunet-service-messenger_member_store.c
index e96ee3883..844130429 100644
--- a/src/messenger/gnunet-service-messenger_member_store.c
+++ b/src/messenger/gnunet-service-messenger_member_store.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -74,7 +74,7 @@ get_member_store_key (const struct GNUNET_MESSENGER_MemberStore *store)
74{ 74{
75 GNUNET_assert (store); 75 GNUNET_assert (store);
76 76
77 return get_room_key((const struct GNUNET_MESSENGER_SrvRoom*) store->room); 77 return get_srv_room_key((const struct GNUNET_MESSENGER_SrvRoom*) store->room);
78} 78}
79 79
80static int 80static int
diff --git a/src/messenger/gnunet-service-messenger_message_handle.c b/src/messenger/gnunet-service-messenger_message_handle.c
index 701d78c89..6016ce438 100644
--- a/src/messenger/gnunet-service-messenger_message_handle.c
+++ b/src/messenger/gnunet-service-messenger_message_handle.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -43,12 +43,12 @@ handle_message_join (struct GNUNET_MESSENGER_SrvRoom *room,
43 const struct GNUNET_HashCode *hash) 43 const struct GNUNET_HashCode *hash)
44{ 44{
45 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Member (%s) joins room (%s).\n", 45 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Member (%s) joins room (%s).\n",
46 GNUNET_sh2s (&(message->header.sender_id)), GNUNET_h2s(get_room_key(room))); 46 GNUNET_sh2s (&(message->header.sender_id)), GNUNET_h2s(get_srv_room_key(room)));
47 47
48 if (GNUNET_OK != reset_member_session(session, hash)) 48 if (GNUNET_OK != reset_member_session(session, hash))
49 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Resetting member session failed!\n"); 49 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Resetting member session failed!\n");
50 50
51 solve_room_member_collisions ( 51 solve_srv_room_member_collisions (
52 room, 52 room,
53 &(message->body.join.key), 53 &(message->body.join.key),
54 &(message->header.sender_id), 54 &(message->header.sender_id),
@@ -63,7 +63,7 @@ handle_message_leave (struct GNUNET_MESSENGER_SrvRoom *room,
63 const struct GNUNET_HashCode *hash) 63 const struct GNUNET_HashCode *hash)
64{ 64{
65 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Member (%s) leaves room (%s).\n", 65 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Member (%s) leaves room (%s).\n",
66 GNUNET_sh2s (&(message->header.sender_id)), GNUNET_h2s(get_room_key(room))); 66 GNUNET_sh2s (&(message->header.sender_id)), GNUNET_h2s(get_srv_room_key(room)));
67 67
68 close_member_session(session); 68 close_member_session(session);
69} 69}
@@ -101,7 +101,7 @@ handle_message_peer (struct GNUNET_MESSENGER_SrvRoom *room,
101 add_to_list_tunnels (&(room->basement), &(message->body.peer.peer)); 101 add_to_list_tunnels (&(room->basement), &(message->body.peer.peer));
102 102
103 if (room->peer_message) 103 if (room->peer_message)
104 rebuild_room_basement_structure (room); 104 rebuild_srv_room_basement_structure (room);
105} 105}
106 106
107void 107void
@@ -112,7 +112,7 @@ handle_message_id (struct GNUNET_MESSENGER_SrvRoom *room,
112{ 112{
113 handle_session_switch (session, message, hash); 113 handle_session_switch (session, message, hash);
114 114
115 solve_room_member_collisions ( 115 solve_srv_room_member_collisions (
116 room, 116 room,
117 get_member_session_public_key(session), 117 get_member_session_public_key(session),
118 &(message->body.id.id), 118 &(message->body.id.id),
@@ -134,7 +134,7 @@ handle_message_miss (struct GNUNET_MESSENGER_SrvRoom *room,
134 remove_from_list_tunnels (&(room->basement), element); 134 remove_from_list_tunnels (&(room->basement), element);
135 135
136 if (room->peer_message) 136 if (room->peer_message)
137 rebuild_room_basement_structure (room); 137 rebuild_srv_room_basement_structure (room);
138} 138}
139 139
140void 140void
@@ -149,5 +149,5 @@ handle_message_delete (struct GNUNET_MESSENGER_SrvRoom *room,
149 action = GNUNET_TIME_absolute_add (action, delay); 149 action = GNUNET_TIME_absolute_add (action, delay);
150 delay = GNUNET_TIME_absolute_get_difference (GNUNET_TIME_absolute_get (), action); 150 delay = GNUNET_TIME_absolute_get_difference (GNUNET_TIME_absolute_get (), action);
151 151
152 delete_room_message (room, session, &(message->body.deletion.hash), delay); 152 delete_srv_room_message (room, session, &(message->body.deletion.hash), delay);
153} 153}
diff --git a/src/messenger/gnunet-service-messenger_message_recv.c b/src/messenger/gnunet-service-messenger_message_recv.c
index bb6ee6f17..4e96cf552 100644
--- a/src/messenger/gnunet-service-messenger_message_recv.c
+++ b/src/messenger/gnunet-service-messenger_message_recv.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -36,7 +36,7 @@ forward_about_members (struct GNUNET_MESSENGER_SrvRoom *room,
36 if (session->prev) 36 if (session->prev)
37 forward_about_members (room, tunnel, session->prev, map); 37 forward_about_members (room, tunnel, session->prev, map);
38 38
39 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(room); 39 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(room);
40 struct GNUNET_MESSENGER_ListMessage *element; 40 struct GNUNET_MESSENGER_ListMessage *element;
41 41
42 for (element = session->messages.head; element; element = element->next) 42 for (element = session->messages.head; element; element = element->next)
@@ -92,7 +92,7 @@ recv_message_info (struct GNUNET_MESSENGER_SrvRoom *room,
92 92
93 if (room->host) 93 if (room->host)
94 { 94 {
95 const struct GNUNET_MESSENGER_Ego *ego = get_handle_ego(room->host); 95 const struct GNUNET_MESSENGER_Ego *ego = get_srv_handle_ego(room->host);
96 96
97 send_tunnel_message (tunnel, room->host, create_message_info(ego)); 97 send_tunnel_message (tunnel, room->host, create_message_info(ego));
98 } 98 }
@@ -102,12 +102,12 @@ recv_message_info (struct GNUNET_MESSENGER_SrvRoom *room,
102 102
103 if (GNUNET_YES != contains_list_tunnels(&(room->basement), &peer)) 103 if (GNUNET_YES != contains_list_tunnels(&(room->basement), &peer))
104 { 104 {
105 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 105 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
106 106
107 iterate_store_members(member_store, iterate_forward_members, tunnel); 107 iterate_store_members(member_store, iterate_forward_members, tunnel);
108 } 108 }
109 109
110 check_room_peer_status(room, tunnel); 110 check_srv_room_peer_status(room, tunnel);
111 111
112 return GNUNET_NO; 112 return GNUNET_NO;
113} 113}
@@ -142,7 +142,7 @@ callback_found_message (void *cls,
142 142
143 if (!message) 143 if (!message)
144 { 144 {
145 struct GNUNET_MESSENGER_OperationStore *operation_store = get_room_operation_store(room); 145 struct GNUNET_MESSENGER_OperationStore *operation_store = get_srv_room_operation_store(room);
146 146
147 use_store_operation( 147 use_store_operation(
148 operation_store, 148 operation_store,
@@ -165,7 +165,7 @@ recv_message_request (struct GNUNET_MESSENGER_SrvRoom *room,
165 const struct GNUNET_MESSENGER_Message *message, 165 const struct GNUNET_MESSENGER_Message *message,
166 const struct GNUNET_HashCode *hash) 166 const struct GNUNET_HashCode *hash)
167{ 167{
168 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 168 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
169 struct GNUNET_MESSENGER_Member *member = get_store_member_of(member_store, message); 169 struct GNUNET_MESSENGER_Member *member = get_store_member_of(member_store, message);
170 170
171 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Request for message (%s)\n", GNUNET_h2s (hash)); 171 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Request for message (%s)\n", GNUNET_h2s (hash));
@@ -178,7 +178,7 @@ recv_message_request (struct GNUNET_MESSENGER_SrvRoom *room,
178 if ((!session) || (GNUNET_YES != check_member_session_history(session, hash, GNUNET_NO))) 178 if ((!session) || (GNUNET_YES != check_member_session_history(session, hash, GNUNET_NO)))
179 return GNUNET_NO; 179 return GNUNET_NO;
180 180
181 if (GNUNET_NO == request_room_message(room, &(message->body.request.hash), session, callback_found_message, tunnel)) 181 if (GNUNET_NO == request_srv_room_message(room, &(message->body.request.hash), session, callback_found_message, tunnel))
182 return GNUNET_YES; 182 return GNUNET_YES;
183 183
184 return GNUNET_NO; 184 return GNUNET_NO;
diff --git a/src/messenger/gnunet-service-messenger_message_send.c b/src/messenger/gnunet-service-messenger_message_send.c
index 8cc2466d7..5cb3cd627 100644
--- a/src/messenger/gnunet-service-messenger_message_send.c
+++ b/src/messenger/gnunet-service-messenger_message_send.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -35,7 +35,7 @@ send_message_join (struct GNUNET_MESSENGER_SrvRoom *room,
35 const struct GNUNET_MESSENGER_Message *message, 35 const struct GNUNET_MESSENGER_Message *message,
36 const struct GNUNET_HashCode *hash) 36 const struct GNUNET_HashCode *hash)
37{ 37{
38 check_room_peer_status(room, NULL); 38 check_srv_room_peer_status(room, NULL);
39} 39}
40 40
41void 41void
@@ -56,7 +56,7 @@ send_message_id (struct GNUNET_MESSENGER_SrvRoom *room,
56 const struct GNUNET_MESSENGER_Message *message, 56 const struct GNUNET_MESSENGER_Message *message,
57 const struct GNUNET_HashCode *hash) 57 const struct GNUNET_HashCode *hash)
58{ 58{
59 change_handle_member_id (handle, get_room_key(room), &(message->body.id.id)); 59 change_srv_handle_member_id (handle, get_srv_room_key(room), &(message->body.id.id));
60} 60}
61 61
62void 62void
@@ -65,7 +65,7 @@ send_message_request (struct GNUNET_MESSENGER_SrvRoom *room,
65 const struct GNUNET_MESSENGER_Message *message, 65 const struct GNUNET_MESSENGER_Message *message,
66 const struct GNUNET_HashCode *hash) 66 const struct GNUNET_HashCode *hash)
67{ 67{
68 struct GNUNET_MESSENGER_OperationStore *operation_store = get_room_operation_store(room); 68 struct GNUNET_MESSENGER_OperationStore *operation_store = get_srv_room_operation_store(room);
69 69
70 use_store_operation( 70 use_store_operation(
71 operation_store, 71 operation_store,
diff --git a/src/messenger/gnunet-service-messenger_room.c b/src/messenger/gnunet-service-messenger_room.c
index 7a20d2191..068597f51 100644
--- a/src/messenger/gnunet-service-messenger_room.c
+++ b/src/messenger/gnunet-service-messenger_room.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -43,8 +43,8 @@ static void
43idle_request_room_messages (void *cls); 43idle_request_room_messages (void *cls);
44 44
45struct GNUNET_MESSENGER_SrvRoom* 45struct GNUNET_MESSENGER_SrvRoom*
46create_room (struct GNUNET_MESSENGER_SrvHandle *handle, 46create_srv_room (struct GNUNET_MESSENGER_SrvHandle *handle,
47 const struct GNUNET_HashCode *key) 47 const struct GNUNET_HashCode *key)
48{ 48{
49 GNUNET_assert((handle) && (key)); 49 GNUNET_assert((handle) && (key));
50 50
@@ -58,9 +58,9 @@ create_room (struct GNUNET_MESSENGER_SrvHandle *handle,
58 58
59 room->tunnels = GNUNET_CONTAINER_multipeermap_create (8, GNUNET_NO); 59 room->tunnels = GNUNET_CONTAINER_multipeermap_create (8, GNUNET_NO);
60 60
61 init_member_store(get_room_member_store(room), room); 61 init_member_store(get_srv_room_member_store(room), room);
62 init_message_store (get_room_message_store(room)); 62 init_message_store (get_srv_room_message_store(room));
63 init_operation_store(get_room_operation_store(room), room); 63 init_operation_store(get_srv_room_operation_store(room), room);
64 64
65 init_list_tunnels (&(room->basement)); 65 init_list_tunnels (&(room->basement));
66 init_message_state(&(room->state)); 66 init_message_state(&(room->state));
@@ -71,7 +71,7 @@ create_room (struct GNUNET_MESSENGER_SrvHandle *handle,
71 room->idle = NULL; 71 room->idle = NULL;
72 72
73 if (room->service->dir) 73 if (room->service->dir)
74 load_room (room); 74 load_srv_room (room);
75 75
76 room->idle = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, idle_request_room_messages, room); 76 room->idle = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, idle_request_room_messages, room);
77 77
@@ -92,8 +92,8 @@ static void
92handle_room_messages (struct GNUNET_MESSENGER_SrvRoom *room); 92handle_room_messages (struct GNUNET_MESSENGER_SrvRoom *room);
93 93
94void 94void
95destroy_room (struct GNUNET_MESSENGER_SrvRoom *room, 95destroy_srv_room (struct GNUNET_MESSENGER_SrvRoom *room,
96 int deletion) 96 int deletion)
97{ 97{
98 GNUNET_assert(room); 98 GNUNET_assert(room);
99 99
@@ -113,14 +113,14 @@ destroy_room (struct GNUNET_MESSENGER_SrvRoom *room,
113 goto skip_saving; 113 goto skip_saving;
114 114
115 if (GNUNET_YES == deletion) 115 if (GNUNET_YES == deletion)
116 remove_room (room); 116 remove_srv_room (room);
117 else 117 else
118 save_room (room); 118 save_srv_room (room);
119 119
120skip_saving: 120skip_saving:
121 clear_member_store (get_room_member_store(room)); 121 clear_member_store (get_srv_room_member_store(room));
122 clear_message_store (get_room_message_store(room)); 122 clear_message_store (get_srv_room_message_store(room));
123 clear_operation_store(get_room_operation_store(room)); 123 clear_operation_store(get_srv_room_operation_store(room));
124 124
125 GNUNET_CONTAINER_multipeermap_destroy (room->tunnels); 125 GNUNET_CONTAINER_multipeermap_destroy (room->tunnels);
126 clear_list_tunnels (&(room->basement)); 126 clear_list_tunnels (&(room->basement));
@@ -133,7 +133,7 @@ skip_saving:
133} 133}
134 134
135struct GNUNET_MESSENGER_MemberStore* 135struct GNUNET_MESSENGER_MemberStore*
136get_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room) 136get_srv_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room)
137{ 137{
138 GNUNET_assert(room); 138 GNUNET_assert(room);
139 139
@@ -141,7 +141,7 @@ get_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room)
141} 141}
142 142
143struct GNUNET_MESSENGER_MessageStore* 143struct GNUNET_MESSENGER_MessageStore*
144get_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room) 144get_srv_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room)
145{ 145{
146 GNUNET_assert(room); 146 GNUNET_assert(room);
147 147
@@ -149,7 +149,7 @@ get_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room)
149} 149}
150 150
151struct GNUNET_MESSENGER_OperationStore* 151struct GNUNET_MESSENGER_OperationStore*
152get_room_operation_store (struct GNUNET_MESSENGER_SrvRoom *room) 152get_srv_room_operation_store (struct GNUNET_MESSENGER_SrvRoom *room)
153{ 153{
154 GNUNET_assert(room); 154 GNUNET_assert(room);
155 155
@@ -164,7 +164,7 @@ send_room_info (struct GNUNET_MESSENGER_SrvRoom *room,
164 if ((!handle) || (!is_tunnel_connected (tunnel))) 164 if ((!handle) || (!is_tunnel_connected (tunnel)))
165 return GNUNET_NO; 165 return GNUNET_NO;
166 166
167 return send_tunnel_message (tunnel, handle, create_message_info (get_handle_ego (handle))); 167 return send_tunnel_message (tunnel, handle, create_message_info (get_srv_handle_ego (handle)));
168} 168}
169 169
170static void* 170static void*
@@ -193,7 +193,7 @@ callback_room_connect (void *cls,
193 bind_tunnel(tunnel, channel); 193 bind_tunnel(tunnel, channel);
194 194
195 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "New tunnel in room (%s) established to peer: %s\n", 195 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "New tunnel in room (%s) established to peer: %s\n",
196 GNUNET_h2s(get_room_key(room)), GNUNET_i2s (source)); 196 GNUNET_h2s(get_srv_room_key(room)), GNUNET_i2s (source));
197 197
198 if (GNUNET_YES == send_room_info (room, room->host, tunnel)) 198 if (GNUNET_YES == send_room_info (room, room->host, tunnel))
199 return tunnel; 199 return tunnel;
@@ -213,15 +213,15 @@ join_room (struct GNUNET_MESSENGER_SrvRoom *room,
213{ 213{
214 GNUNET_assert((room) && (handle) && (member)); 214 GNUNET_assert((room) && (handle) && (member));
215 215
216 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Joining room: %s (%s)\n", GNUNET_h2s (get_room_key (room)), 216 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Joining room: %s (%s)\n", GNUNET_h2s (get_srv_room_key (room)),
217 GNUNET_sh2s (get_member_id(member))); 217 GNUNET_sh2s (get_member_id(member)));
218 218
219 const struct GNUNET_ShortHashCode *member_id = get_member_id(member); 219 const struct GNUNET_ShortHashCode *member_id = get_member_id(member);
220 220
221 if (GNUNET_OK != change_handle_member_id (handle, get_room_key(room), member_id)) 221 if (GNUNET_OK != change_srv_handle_member_id (handle, get_srv_room_key(room), member_id))
222 return GNUNET_NO; 222 return GNUNET_NO;
223 223
224 struct GNUNET_MESSENGER_Message *message = create_message_join (get_handle_ego (handle)); 224 struct GNUNET_MESSENGER_Message *message = create_message_join (get_srv_handle_ego (handle));
225 225
226 if (!message) 226 if (!message)
227 { 227 {
@@ -231,7 +231,7 @@ join_room (struct GNUNET_MESSENGER_SrvRoom *room,
231 } 231 }
232 232
233 GNUNET_memcpy(&(message->header.sender_id), member_id, sizeof(*member_id)); 233 GNUNET_memcpy(&(message->header.sender_id), member_id, sizeof(*member_id));
234 return send_room_message (room, handle, message); 234 return send_srv_room_message (room, handle, message);
235} 235}
236 236
237struct GNUNET_MESSENGER_MemberNotify 237struct GNUNET_MESSENGER_MemberNotify
@@ -250,7 +250,7 @@ notify_about_members (struct GNUNET_MESSENGER_MemberNotify *notify,
250 if (session->prev) 250 if (session->prev)
251 notify_about_members (notify, session->prev, map, GNUNET_YES); 251 notify_about_members (notify, session->prev, map, GNUNET_YES);
252 252
253 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(notify->room); 253 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(notify->room);
254 struct GNUNET_MESSENGER_ListMessage *element; 254 struct GNUNET_MESSENGER_ListMessage *element;
255 255
256 for (element = session->messages.head; element; element = element->next) 256 for (element = session->messages.head; element; element = element->next)
@@ -269,7 +269,7 @@ notify_about_members (struct GNUNET_MESSENGER_MemberNotify *notify,
269 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, &(element->hash)); 269 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, &(element->hash));
270 270
271 if (message) 271 if (message)
272 notify_handle_message (notify->handle, notify->room, session, message, &(element->hash)); 272 notify_srv_handle_message (notify->handle, notify->room, session, message, &(element->hash));
273 } 273 }
274} 274}
275 275
@@ -295,15 +295,15 @@ static int
295join_room_locally (struct GNUNET_MESSENGER_SrvRoom *room, 295join_room_locally (struct GNUNET_MESSENGER_SrvRoom *room,
296 struct GNUNET_MESSENGER_SrvHandle *handle) 296 struct GNUNET_MESSENGER_SrvHandle *handle)
297{ 297{
298 const struct GNUNET_ShortHashCode *member_id = get_handle_member_id (handle, get_room_key(room)); 298 const struct GNUNET_ShortHashCode *member_id = get_srv_handle_member_id (handle, get_srv_room_key(room));
299 299
300 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 300 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
301 struct GNUNET_MESSENGER_Member *member = add_store_member(member_store, member_id); 301 struct GNUNET_MESSENGER_Member *member = add_store_member(member_store, member_id);
302 302
303 if (GNUNET_NO == join_room (room, handle, member)) 303 if (GNUNET_NO == join_room (room, handle, member))
304 return GNUNET_NO; 304 return GNUNET_NO;
305 305
306 const struct GNUNET_MESSENGER_Ego *ego = get_handle_ego(handle); 306 const struct GNUNET_MESSENGER_Ego *ego = get_srv_handle_ego(handle);
307 struct GNUNET_MESSENGER_MemberSession *session = get_member_session (member, &(ego->pub)); 307 struct GNUNET_MESSENGER_MemberSession *session = get_member_session (member, &(ego->pub));
308 308
309 if (!session) 309 if (!session)
@@ -318,7 +318,7 @@ join_room_locally (struct GNUNET_MESSENGER_SrvRoom *room,
318 notify.handle = handle; 318 notify.handle = handle;
319 notify.session = session; 319 notify.session = session;
320 320
321 iterate_store_members(get_room_member_store(room), iterate_notify_about_members, &notify); 321 iterate_store_members(get_srv_room_member_store(room), iterate_notify_about_members, &notify);
322 322
323 return GNUNET_YES; 323 return GNUNET_YES;
324} 324}
@@ -336,16 +336,16 @@ callback_tunnel_disconnect (void *cls,
336 const struct GNUNET_CADET_Channel *channel); 336 const struct GNUNET_CADET_Channel *channel);
337 337
338int 338int
339open_room (struct GNUNET_MESSENGER_SrvRoom *room, 339open_srv_room (struct GNUNET_MESSENGER_SrvRoom *room,
340 struct GNUNET_MESSENGER_SrvHandle *handle) 340 struct GNUNET_MESSENGER_SrvHandle *handle)
341{ 341{
342 GNUNET_assert((room) && (handle)); 342 GNUNET_assert((room) && (handle));
343 343
344 if (room->port) 344 if (room->port)
345 return join_room_locally (room, handle); 345 return join_room_locally (room, handle);
346 346
347 struct GNUNET_CADET_Handle *cadet = get_room_cadet (room); 347 struct GNUNET_CADET_Handle *cadet = get_srv_room_cadet (room);
348 const struct GNUNET_HashCode *key = get_room_key (room); 348 const struct GNUNET_HashCode *key = get_srv_room_key (room);
349 349
350 struct GNUNET_MQ_MessageHandler handlers[] = { GNUNET_MQ_hd_var_size(tunnel_message, GNUNET_MESSAGE_TYPE_CADET_CLI, 350 struct GNUNET_MQ_MessageHandler handlers[] = { GNUNET_MQ_hd_var_size(tunnel_message, GNUNET_MESSAGE_TYPE_CADET_CLI,
351 struct GNUNET_MessageHeader, NULL), 351 struct GNUNET_MessageHeader, NULL),
@@ -358,14 +358,14 @@ open_room (struct GNUNET_MESSENGER_SrvRoom *room,
358 358
359 if (room->port) 359 if (room->port)
360 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Port of room (%s) was opened!\n", 360 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Port of room (%s) was opened!\n",
361 GNUNET_h2s(get_room_key(room))); 361 GNUNET_h2s(get_srv_room_key(room)));
362 else 362 else
363 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Port of room (%s) could not be opened!\n", 363 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Port of room (%s) could not be opened!\n",
364 GNUNET_h2s(get_room_key(room))); 364 GNUNET_h2s(get_srv_room_key(room)));
365 365
366 const struct GNUNET_ShortHashCode *member_id = get_handle_member_id (handle, get_room_key(room)); 366 const struct GNUNET_ShortHashCode *member_id = get_srv_handle_member_id (handle, get_srv_room_key(room));
367 367
368 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 368 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
369 struct GNUNET_MESSENGER_Member *member = add_store_member(member_store, member_id); 369 struct GNUNET_MESSENGER_Member *member = add_store_member(member_store, member_id);
370 370
371 if ((GNUNET_NO == join_room (room, handle, member)) && (room->port)) 371 if ((GNUNET_NO == join_room (room, handle, member)) && (room->port))
@@ -380,13 +380,13 @@ open_room (struct GNUNET_MESSENGER_SrvRoom *room,
380 380
381 struct GNUNET_MESSENGER_Message *peer_msg = create_message_peer (room->service); 381 struct GNUNET_MESSENGER_Message *peer_msg = create_message_peer (room->service);
382 GNUNET_memcpy(&(peer_msg->header.sender_id), member_id, sizeof(*member_id)); 382 GNUNET_memcpy(&(peer_msg->header.sender_id), member_id, sizeof(*member_id));
383 return (room->port ? send_room_message (room, handle, peer_msg) : GNUNET_NO); 383 return (room->port ? send_srv_room_message (room, handle, peer_msg) : GNUNET_NO);
384} 384}
385 385
386int 386int
387enter_room_at (struct GNUNET_MESSENGER_SrvRoom *room, 387enter_srv_room_at (struct GNUNET_MESSENGER_SrvRoom *room,
388 struct GNUNET_MESSENGER_SrvHandle *handle, 388 struct GNUNET_MESSENGER_SrvHandle *handle,
389 const struct GNUNET_PeerIdentity *door) 389 const struct GNUNET_PeerIdentity *door)
390{ 390{
391 GNUNET_assert((room) && (handle) && (door)); 391 GNUNET_assert((room) && (handle) && (door));
392 392
@@ -423,24 +423,24 @@ enter_room_at (struct GNUNET_MESSENGER_SrvRoom *room,
423} 423}
424 424
425struct GNUNET_MQ_Envelope* 425struct GNUNET_MQ_Envelope*
426pack_room_message (const struct GNUNET_MESSENGER_SrvRoom *room, 426pack_srv_room_message (const struct GNUNET_MESSENGER_SrvRoom *room,
427 const struct GNUNET_MESSENGER_SrvHandle *handle, 427 const struct GNUNET_MESSENGER_SrvHandle *handle,
428 struct GNUNET_MESSENGER_Message *message, 428 struct GNUNET_MESSENGER_Message *message,
429 struct GNUNET_HashCode *hash, 429 struct GNUNET_HashCode *hash,
430 int mode) 430 int mode)
431{ 431{
432 GNUNET_assert((room) && (handle) && (message) && (hash)); 432 GNUNET_assert((room) && (handle) && (message) && (hash));
433 433
434 message->header.timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); 434 message->header.timestamp = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
435 435
436 const struct GNUNET_ShortHashCode *id = get_handle_member_id (handle, get_room_key(room)); 436 const struct GNUNET_ShortHashCode *id = get_srv_handle_member_id (handle, get_srv_room_key(room));
437 437
438 GNUNET_assert(id); 438 GNUNET_assert(id);
439 439
440 GNUNET_memcpy(&(message->header.sender_id), id, sizeof(struct GNUNET_ShortHashCode)); 440 GNUNET_memcpy(&(message->header.sender_id), id, sizeof(struct GNUNET_ShortHashCode));
441 get_message_state_chain_hash (&(room->state), &(message->header.previous)); 441 get_message_state_chain_hash (&(room->state), &(message->header.previous));
442 442
443 return pack_message (message, hash, get_handle_ego (handle), mode); 443 return pack_message (message, hash, get_srv_handle_ego (handle), mode);
444} 444}
445 445
446struct GNUNET_MESSENGER_ClosureSendRoom 446struct GNUNET_MESSENGER_ClosureSendRoom
@@ -473,7 +473,7 @@ iterate_send_room_message (void *cls,
473 473
474 if (closure->packed == GNUNET_NO) 474 if (closure->packed == GNUNET_NO)
475 { 475 {
476 env = pack_room_message (closure->room, closure->handle, closure->message, closure->hash, 476 env = pack_srv_room_message (closure->room, closure->handle, closure->message, closure->hash,
477 GNUNET_MESSENGER_PACK_MODE_ENVELOPE); 477 GNUNET_MESSENGER_PACK_MODE_ENVELOPE);
478 478
479 if (env) 479 if (env)
@@ -500,9 +500,9 @@ callback_room_handle_message (struct GNUNET_MESSENGER_SrvRoom *room,
500 const struct GNUNET_HashCode *hash); 500 const struct GNUNET_HashCode *hash);
501 501
502int 502int
503send_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 503send_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
504 struct GNUNET_MESSENGER_SrvHandle *handle, 504 struct GNUNET_MESSENGER_SrvHandle *handle,
505 struct GNUNET_MESSENGER_Message *message) 505 struct GNUNET_MESSENGER_Message *message)
506{ 506{
507 GNUNET_assert((room) && (handle)); 507 GNUNET_assert((room) && (handle));
508 508
@@ -510,10 +510,10 @@ send_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
510 return GNUNET_NO; 510 return GNUNET_NO;
511 511
512 if (GNUNET_YES == is_message_session_bound(message)) 512 if (GNUNET_YES == is_message_session_bound(message))
513 merge_room_last_messages(room, handle); 513 merge_srv_room_last_messages(room, handle);
514 514
515 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Sending message from handle with member id: %s\n", 515 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Sending message from handle with member id: %s\n",
516 GNUNET_sh2s(get_handle_member_id(handle, get_room_key(room)))); 516 GNUNET_sh2s(get_srv_handle_member_id(handle, get_srv_room_key(room))));
517 517
518 struct GNUNET_HashCode hash; 518 struct GNUNET_HashCode hash;
519 struct GNUNET_MESSENGER_ClosureSendRoom closure; 519 struct GNUNET_MESSENGER_ClosureSendRoom closure;
@@ -528,7 +528,7 @@ send_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
528 GNUNET_CONTAINER_multipeermap_iterate (room->tunnels, iterate_send_room_message, &closure); 528 GNUNET_CONTAINER_multipeermap_iterate (room->tunnels, iterate_send_room_message, &closure);
529 529
530 if (GNUNET_NO == closure.packed) 530 if (GNUNET_NO == closure.packed)
531 pack_room_message (room, handle, message, &hash, GNUNET_MESSENGER_PACK_MODE_UNKNOWN); 531 pack_srv_room_message (room, handle, message, &hash, GNUNET_MESSENGER_PACK_MODE_UNKNOWN);
532 532
533 const int new_message = update_room_message (room, message, &hash); 533 const int new_message = update_room_message (room, message, &hash);
534 534
@@ -558,10 +558,10 @@ send_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
558} 558}
559 559
560void 560void
561forward_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 561forward_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
562 struct GNUNET_MESSENGER_SrvTunnel *tunnel, 562 struct GNUNET_MESSENGER_SrvTunnel *tunnel,
563 struct GNUNET_MESSENGER_Message *message, 563 struct GNUNET_MESSENGER_Message *message,
564 const struct GNUNET_HashCode *hash) 564 const struct GNUNET_HashCode *hash)
565{ 565{
566 GNUNET_assert((room) && (tunnel)); 566 GNUNET_assert((room) && (tunnel));
567 567
@@ -584,13 +584,13 @@ forward_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
584} 584}
585 585
586void 586void
587check_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room, 587check_srv_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room,
588 struct GNUNET_MESSENGER_SrvTunnel *tunnel) 588 struct GNUNET_MESSENGER_SrvTunnel *tunnel)
589{ 589{
590 if (!room->peer_message) 590 if (!room->peer_message)
591 return; 591 return;
592 592
593 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(room); 593 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(room);
594 594
595 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, room->peer_message); 595 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, room->peer_message);
596 596
@@ -601,7 +601,7 @@ check_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room,
601 return; 601 return;
602 } 602 }
603 603
604 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 604 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
605 struct GNUNET_MESSENGER_Member *member = get_store_member_of(member_store, message); 605 struct GNUNET_MESSENGER_Member *member = get_store_member_of(member_store, message);
606 606
607 if (!member) 607 if (!member)
@@ -619,12 +619,12 @@ check_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room,
619 619
620resend_peer_message: 620resend_peer_message:
621 if (room->host) 621 if (room->host)
622 send_room_message (room, room->host, create_message_peer (room->service)); 622 send_srv_room_message (room, room->host, create_message_peer (room->service));
623} 623}
624 624
625void 625void
626merge_room_last_messages (struct GNUNET_MESSENGER_SrvRoom *room, 626merge_srv_room_last_messages (struct GNUNET_MESSENGER_SrvRoom *room,
627 struct GNUNET_MESSENGER_SrvHandle *handle) 627 struct GNUNET_MESSENGER_SrvHandle *handle)
628{ 628{
629 GNUNET_assert(room); 629 GNUNET_assert(room);
630 630
@@ -639,7 +639,7 @@ merge_next:
639 if (!hash) 639 if (!hash)
640 return; 640 return;
641 641
642 send_room_message (room, handle, create_message_merge (hash)); 642 send_srv_room_message (room, handle, create_message_merge (hash));
643 goto merge_next; 643 goto merge_next;
644} 644}
645 645
@@ -647,7 +647,7 @@ void
647callback_room_deletion (struct GNUNET_MESSENGER_SrvRoom *room, 647callback_room_deletion (struct GNUNET_MESSENGER_SrvRoom *room,
648 const struct GNUNET_HashCode *hash) 648 const struct GNUNET_HashCode *hash)
649{ 649{
650 if (GNUNET_OK != delete_store_message (get_room_message_store(room), hash)) 650 if (GNUNET_OK != delete_store_message (get_srv_room_message_store(room), hash))
651 { 651 {
652 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Deletion of message failed! (%s)\n", GNUNET_h2s(hash)); 652 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Deletion of message failed! (%s)\n", GNUNET_h2s(hash));
653 return; 653 return;
@@ -661,14 +661,14 @@ callback_room_merge (struct GNUNET_MESSENGER_SrvRoom *room,
661 if (!room->host) 661 if (!room->host)
662 return; 662 return;
663 663
664 send_room_message (room, room->host, create_message_merge (hash)); 664 send_srv_room_message (room, room->host, create_message_merge (hash));
665} 665}
666 666
667int 667int
668delete_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 668delete_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
669 struct GNUNET_MESSENGER_MemberSession *session, 669 struct GNUNET_MESSENGER_MemberSession *session,
670 const struct GNUNET_HashCode *hash, 670 const struct GNUNET_HashCode *hash,
671 const struct GNUNET_TIME_Relative delay) 671 const struct GNUNET_TIME_Relative delay)
672{ 672{
673 GNUNET_assert((room) && (session) && (hash)); 673 GNUNET_assert((room) && (session) && (hash));
674 674
@@ -680,7 +680,7 @@ delete_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
680 return GNUNET_SYSERR; 680 return GNUNET_SYSERR;
681 } 681 }
682 682
683 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(room); 683 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(room);
684 684
685 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, hash); 685 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, hash);
686 686
@@ -695,7 +695,7 @@ delete_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
695 return GNUNET_NO; 695 return GNUNET_NO;
696 } 696 }
697 697
698 struct GNUNET_MESSENGER_OperationStore *operation_store = get_room_operation_store(room); 698 struct GNUNET_MESSENGER_OperationStore *operation_store = get_srv_room_operation_store(room);
699 699
700 if (GNUNET_OK != use_store_operation(operation_store, hash, GNUNET_MESSENGER_OP_DELETE, delay)) 700 if (GNUNET_OK != use_store_operation(operation_store, hash, GNUNET_MESSENGER_OP_DELETE, delay))
701 { 701 {
@@ -707,7 +707,7 @@ delete_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
707} 707}
708 708
709struct GNUNET_CADET_Handle* 709struct GNUNET_CADET_Handle*
710get_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room) 710get_srv_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room)
711{ 711{
712 GNUNET_assert(room); 712 GNUNET_assert(room);
713 713
@@ -715,7 +715,7 @@ get_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room)
715} 715}
716 716
717const struct GNUNET_HashCode* 717const struct GNUNET_HashCode*
718get_room_key (const struct GNUNET_MESSENGER_SrvRoom *room) 718get_srv_room_key (const struct GNUNET_MESSENGER_SrvRoom *room)
719{ 719{
720 GNUNET_assert(room); 720 GNUNET_assert(room);
721 721
@@ -723,8 +723,8 @@ get_room_key (const struct GNUNET_MESSENGER_SrvRoom *room)
723} 723}
724 724
725const struct GNUNET_MESSENGER_SrvTunnel* 725const struct GNUNET_MESSENGER_SrvTunnel*
726get_room_tunnel (const struct GNUNET_MESSENGER_SrvRoom *room, 726get_srv_room_tunnel (const struct GNUNET_MESSENGER_SrvRoom *room,
727 const struct GNUNET_PeerIdentity *peer) 727 const struct GNUNET_PeerIdentity *peer)
728{ 728{
729 GNUNET_assert((room) && (peer)); 729 GNUNET_assert((room) && (peer));
730 730
@@ -738,7 +738,7 @@ request_room_message_step (struct GNUNET_MESSENGER_SrvRoom *room,
738 GNUNET_MESSENGER_MessageRequestCallback callback, 738 GNUNET_MESSENGER_MessageRequestCallback callback,
739 void* cls) 739 void* cls)
740{ 740{
741 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(room); 741 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(room);
742 742
743 const struct GNUNET_MESSENGER_MessageLink *link = get_store_message_link( 743 const struct GNUNET_MESSENGER_MessageLink *link = get_store_message_link(
744 message_store, hash, GNUNET_YES 744 message_store, hash, GNUNET_YES
@@ -771,11 +771,11 @@ forward:
771} 771}
772 772
773int 773int
774request_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 774request_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
775 const struct GNUNET_HashCode *hash, 775 const struct GNUNET_HashCode *hash,
776 const struct GNUNET_MESSENGER_MemberSession *session, 776 const struct GNUNET_MESSENGER_MemberSession *session,
777 GNUNET_MESSENGER_MessageRequestCallback callback, 777 GNUNET_MESSENGER_MessageRequestCallback callback,
778 void* cls) 778 void* cls)
779{ 779{
780 GNUNET_assert((room) && (hash)); 780 GNUNET_assert((room) && (hash));
781 781
@@ -804,7 +804,7 @@ callback_room_disconnect (struct GNUNET_MESSENGER_SrvRoom *room,
804 return; 804 return;
805 805
806 if (GNUNET_YES == contains_list_tunnels (&(room->basement), &identity)) 806 if (GNUNET_YES == contains_list_tunnels (&(room->basement), &identity))
807 send_room_message (room, room->host, create_message_miss (&identity)); 807 send_srv_room_message (room, room->host, create_message_miss (&identity));
808} 808}
809 809
810int 810int
@@ -819,7 +819,7 @@ callback_verify_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
819 return GNUNET_SYSERR; 819 return GNUNET_SYSERR;
820 } 820 }
821 821
822 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(room); 822 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(room);
823 823
824 const struct GNUNET_MESSENGER_Message *previous = get_store_message(message_store, &(message->header.previous)); 824 const struct GNUNET_MESSENGER_Message *previous = get_store_message(message_store, &(message->header.previous));
825 825
@@ -849,7 +849,7 @@ idle_request_room_messages (void *cls)
849 849
850 room->idle = NULL; 850 room->idle = NULL;
851 851
852 struct GNUNET_MESSENGER_OperationStore *operation_store = get_room_operation_store(room); 852 struct GNUNET_MESSENGER_OperationStore *operation_store = get_srv_room_operation_store(room);
853 const struct GNUNET_HashCode *hash = get_message_state_merge_hash(&(room->state)); 853 const struct GNUNET_HashCode *hash = get_message_state_merge_hash(&(room->state));
854 854
855 if ((hash) && 855 if ((hash) &&
@@ -870,14 +870,14 @@ idle_request_room_messages (void *cls)
870} 870}
871 871
872void 872void
873solve_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room, 873solve_srv_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room,
874 const struct GNUNET_IDENTITY_PublicKey *public_key, 874 const struct GNUNET_IDENTITY_PublicKey *public_key,
875 const struct GNUNET_ShortHashCode *member_id, 875 const struct GNUNET_ShortHashCode *member_id,
876 struct GNUNET_TIME_Absolute timestamp) 876 struct GNUNET_TIME_Absolute timestamp)
877{ 877{
878 GNUNET_assert ((room) && (public_key) && (member_id)); 878 GNUNET_assert ((room) && (public_key) && (member_id));
879 879
880 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 880 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
881 struct GNUNET_MESSENGER_Member *member = get_store_member(member_store, member_id); 881 struct GNUNET_MESSENGER_Member *member = get_store_member(member_store, member_id);
882 882
883 if ((!member) || (1 >= GNUNET_CONTAINER_multihashmap_size(member->sessions))) 883 if ((!member) || (1 >= GNUNET_CONTAINER_multihashmap_size(member->sessions)))
@@ -888,13 +888,13 @@ solve_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room,
888 888
889 for (element = handles->head; element; element = element->next) 889 for (element = handles->head; element; element = element->next)
890 { 890 {
891 if (0 != GNUNET_memcmp(member_id, get_handle_member_id(element->handle, get_room_key(room)))) 891 if (0 != GNUNET_memcmp(member_id, get_srv_handle_member_id(element->handle, get_srv_room_key(room))))
892 continue; 892 continue;
893 893
894 if (0 == GNUNET_memcmp(public_key, &(get_handle_ego(element->handle)->pub))) 894 if (0 == GNUNET_memcmp(public_key, &(get_srv_handle_ego(element->handle)->pub)))
895 continue; 895 continue;
896 896
897 struct GNUNET_MESSENGER_MemberSession *session = get_member_session(member, &(get_handle_ego(element->handle)->pub)); 897 struct GNUNET_MESSENGER_MemberSession *session = get_member_session(member, &(get_srv_handle_ego(element->handle)->pub));
898 898
899 if (!session) 899 if (!session)
900 continue; 900 continue;
@@ -907,12 +907,12 @@ solve_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room,
907 struct GNUNET_ShortHashCode random_id; 907 struct GNUNET_ShortHashCode random_id;
908 generate_free_member_id (&random_id, member_store->members); 908 generate_free_member_id (&random_id, member_store->members);
909 909
910 send_room_message(room, element->handle, create_message_id(&random_id)); 910 send_srv_room_message(room, element->handle, create_message_id(&random_id));
911 } 911 }
912} 912}
913 913
914void 914void
915rebuild_room_basement_structure (struct GNUNET_MESSENGER_SrvRoom *room) 915rebuild_srv_room_basement_structure (struct GNUNET_MESSENGER_SrvRoom *room)
916{ 916{
917 GNUNET_assert(room); 917 GNUNET_assert(room);
918 918
@@ -961,8 +961,8 @@ rebuild_room_basement_structure (struct GNUNET_MESSENGER_SrvRoom *room)
961static void 961static void
962handle_room_messages (struct GNUNET_MESSENGER_SrvRoom *room) 962handle_room_messages (struct GNUNET_MESSENGER_SrvRoom *room)
963{ 963{
964 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(room); 964 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(room);
965 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 965 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
966 966
967 while (room->handling.head) 967 while (room->handling.head)
968 { 968 {
@@ -996,7 +996,7 @@ update_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
996{ 996{
997 GNUNET_assert((room) && (message) && (hash)); 997 GNUNET_assert((room) && (message) && (hash));
998 998
999 struct GNUNET_MESSENGER_OperationStore *operation_store = get_room_operation_store(room); 999 struct GNUNET_MESSENGER_OperationStore *operation_store = get_srv_room_operation_store(room);
1000 1000
1001 const int requested = (GNUNET_MESSENGER_OP_REQUEST == get_store_operation_type(operation_store, hash)? 1001 const int requested = (GNUNET_MESSENGER_OP_REQUEST == get_store_operation_type(operation_store, hash)?
1002 GNUNET_YES : GNUNET_NO 1002 GNUNET_YES : GNUNET_NO
@@ -1005,11 +1005,11 @@ update_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
1005 if (GNUNET_YES == requested) 1005 if (GNUNET_YES == requested)
1006 cancel_store_operation(operation_store, hash); 1006 cancel_store_operation(operation_store, hash);
1007 1007
1008 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(room); 1008 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(room);
1009 1009
1010 const struct GNUNET_MESSENGER_Message *old_message = get_store_message (message_store, hash); 1010 const struct GNUNET_MESSENGER_Message *old_message = get_store_message (message_store, hash);
1011 1011
1012 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Handle a message in room (%s).\n", GNUNET_h2s (get_room_key(room))); 1012 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Handle a message in room (%s).\n", GNUNET_h2s (get_srv_room_key(room)));
1013 1013
1014 if ((old_message) || (GNUNET_OK != put_store_message (message_store, hash, message))) 1014 if ((old_message) || (GNUNET_OK != put_store_message (message_store, hash, message)))
1015 { 1015 {
@@ -1087,7 +1087,7 @@ callback_room_handle_message (struct GNUNET_MESSENGER_SrvRoom *room,
1087 const struct GNUNET_MESSENGER_Message *message, 1087 const struct GNUNET_MESSENGER_Message *message,
1088 const struct GNUNET_HashCode *hash) 1088 const struct GNUNET_HashCode *hash)
1089{ 1089{
1090 struct GNUNET_MESSENGER_MemberStore *member_store = get_room_member_store(room); 1090 struct GNUNET_MESSENGER_MemberStore *member_store = get_srv_room_member_store(room);
1091 struct GNUNET_MESSENGER_Member *member = get_store_member_of(member_store, message); 1091 struct GNUNET_MESSENGER_Member *member = get_store_member_of(member_store, message);
1092 1092
1093 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Callback for message (%s)\n", GNUNET_h2s (hash)); 1093 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Callback for message (%s)\n", GNUNET_h2s (hash));
@@ -1169,11 +1169,11 @@ get_room_data_subdir (struct GNUNET_MESSENGER_SrvRoom *room,
1169{ 1169{
1170 GNUNET_assert((room) && (dir)); 1170 GNUNET_assert((room) && (dir));
1171 1171
1172 GNUNET_asprintf (dir, "%s%s%c%s%c", room->service->dir, "rooms", DIR_SEPARATOR, GNUNET_h2s (get_room_key(room)), DIR_SEPARATOR); 1172 GNUNET_asprintf (dir, "%s%s%c%s%c", room->service->dir, "rooms", DIR_SEPARATOR, GNUNET_h2s (get_srv_room_key(room)), DIR_SEPARATOR);
1173} 1173}
1174 1174
1175void 1175void
1176load_room (struct GNUNET_MESSENGER_SrvRoom *room) 1176load_srv_room (struct GNUNET_MESSENGER_SrvRoom *room)
1177{ 1177{
1178 GNUNET_assert(room); 1178 GNUNET_assert(room);
1179 1179
@@ -1182,9 +1182,9 @@ load_room (struct GNUNET_MESSENGER_SrvRoom *room)
1182 1182
1183 if (GNUNET_YES == GNUNET_DISK_directory_test (room_dir, GNUNET_YES)) 1183 if (GNUNET_YES == GNUNET_DISK_directory_test (room_dir, GNUNET_YES))
1184 { 1184 {
1185 load_member_store (get_room_member_store(room), room_dir); 1185 load_member_store (get_srv_room_member_store(room), room_dir);
1186 load_message_store (get_room_message_store(room), room_dir); 1186 load_message_store (get_srv_room_message_store(room), room_dir);
1187 load_operation_store(get_room_operation_store(room), room_dir); 1187 load_operation_store(get_srv_room_operation_store(room), room_dir);
1188 1188
1189 char *basement_file; 1189 char *basement_file;
1190 GNUNET_asprintf (&basement_file, "%s%s", room_dir, "basement.list"); 1190 GNUNET_asprintf (&basement_file, "%s%s", room_dir, "basement.list");
@@ -1199,7 +1199,7 @@ load_room (struct GNUNET_MESSENGER_SrvRoom *room)
1199} 1199}
1200 1200
1201void 1201void
1202save_room (struct GNUNET_MESSENGER_SrvRoom *room) 1202save_srv_room (struct GNUNET_MESSENGER_SrvRoom *room)
1203{ 1203{
1204 GNUNET_assert(room); 1204 GNUNET_assert(room);
1205 1205
@@ -1209,9 +1209,9 @@ save_room (struct GNUNET_MESSENGER_SrvRoom *room)
1209 if ((GNUNET_YES == GNUNET_DISK_directory_test (room_dir, GNUNET_NO)) || 1209 if ((GNUNET_YES == GNUNET_DISK_directory_test (room_dir, GNUNET_NO)) ||
1210 (GNUNET_OK == GNUNET_DISK_directory_create (room_dir))) 1210 (GNUNET_OK == GNUNET_DISK_directory_create (room_dir)))
1211 { 1211 {
1212 save_member_store(get_room_member_store(room), room_dir); 1212 save_member_store(get_srv_room_member_store(room), room_dir);
1213 save_message_store (get_room_message_store(room), room_dir); 1213 save_message_store (get_srv_room_message_store(room), room_dir);
1214 save_operation_store(get_room_operation_store(room), room_dir); 1214 save_operation_store(get_srv_room_operation_store(room), room_dir);
1215 1215
1216 char *basement_file; 1216 char *basement_file;
1217 GNUNET_asprintf (&basement_file, "%s%s", room_dir, "basement.list"); 1217 GNUNET_asprintf (&basement_file, "%s%s", room_dir, "basement.list");
@@ -1226,7 +1226,7 @@ save_room (struct GNUNET_MESSENGER_SrvRoom *room)
1226} 1226}
1227 1227
1228void 1228void
1229remove_room (struct GNUNET_MESSENGER_SrvRoom *room) 1229remove_srv_room (struct GNUNET_MESSENGER_SrvRoom *room)
1230{ 1230{
1231 GNUNET_assert(room); 1231 GNUNET_assert(room);
1232 1232
diff --git a/src/messenger/gnunet-service-messenger_room.h b/src/messenger/gnunet-service-messenger_room.h
index 58edc4121..a6ae45275 100644
--- a/src/messenger/gnunet-service-messenger_room.h
+++ b/src/messenger/gnunet-service-messenger_room.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -89,7 +89,7 @@ struct GNUNET_MESSENGER_SrvRoom
89 * @return New room 89 * @return New room
90 */ 90 */
91struct GNUNET_MESSENGER_SrvRoom* 91struct GNUNET_MESSENGER_SrvRoom*
92create_room (struct GNUNET_MESSENGER_SrvHandle *handle, 92create_srv_room (struct GNUNET_MESSENGER_SrvHandle *handle,
93 const struct GNUNET_HashCode *key); 93 const struct GNUNET_HashCode *key);
94 94
95/** 95/**
@@ -102,7 +102,7 @@ create_room (struct GNUNET_MESSENGER_SrvHandle *handle,
102 * @param[in] deletion Flag to indicate context of destruction 102 * @param[in] deletion Flag to indicate context of destruction
103 */ 103 */
104void 104void
105destroy_room (struct GNUNET_MESSENGER_SrvRoom *room, 105destroy_srv_room (struct GNUNET_MESSENGER_SrvRoom *room,
106 int deletion); 106 int deletion);
107 107
108/** 108/**
@@ -112,7 +112,7 @@ destroy_room (struct GNUNET_MESSENGER_SrvRoom *room,
112 * @return Member store 112 * @return Member store
113 */ 113 */
114struct GNUNET_MESSENGER_MemberStore* 114struct GNUNET_MESSENGER_MemberStore*
115get_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room); 115get_srv_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room);
116 116
117/** 117/**
118 * Returns the used message store of a given <i>room</i>. 118 * Returns the used message store of a given <i>room</i>.
@@ -121,7 +121,7 @@ get_room_member_store (struct GNUNET_MESSENGER_SrvRoom *room);
121 * @return Message store 121 * @return Message store
122 */ 122 */
123struct GNUNET_MESSENGER_MessageStore* 123struct GNUNET_MESSENGER_MessageStore*
124get_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room); 124get_srv_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room);
125 125
126/** 126/**
127 * Returns the used operation store of a given <i>room</i>. 127 * Returns the used operation store of a given <i>room</i>.
@@ -130,7 +130,7 @@ get_room_message_store (struct GNUNET_MESSENGER_SrvRoom *room);
130 * @return Operation store 130 * @return Operation store
131 */ 131 */
132struct GNUNET_MESSENGER_OperationStore* 132struct GNUNET_MESSENGER_OperationStore*
133get_room_operation_store (struct GNUNET_MESSENGER_SrvRoom *room); 133get_srv_room_operation_store (struct GNUNET_MESSENGER_SrvRoom *room);
134 134
135/** 135/**
136 * Tries to open a <i>room</i> for a given <i>handle</i>. If the room has already been opened, the handle 136 * Tries to open a <i>room</i> for a given <i>handle</i>. If the room has already been opened, the handle
@@ -145,8 +145,8 @@ get_room_operation_store (struct GNUNET_MESSENGER_SrvRoom *room);
145 * @return #GNUNET_YES on success, #GNUNET_NO on failure. 145 * @return #GNUNET_YES on success, #GNUNET_NO on failure.
146 */ 146 */
147int 147int
148open_room (struct GNUNET_MESSENGER_SrvRoom *room, 148open_srv_room (struct GNUNET_MESSENGER_SrvRoom *room,
149 struct GNUNET_MESSENGER_SrvHandle *handle); 149 struct GNUNET_MESSENGER_SrvHandle *handle);
150 150
151/** 151/**
152 * Connects a tunnel to a hosting peer of a <i>room</i> through a so called <i>door</i> which is represented by 152 * Connects a tunnel to a hosting peer of a <i>room</i> through a so called <i>door</i> which is represented by
@@ -159,9 +159,9 @@ open_room (struct GNUNET_MESSENGER_SrvRoom *room,
159 * @return #GNUNET_YES on success, #GNUNET_NO on failure. 159 * @return #GNUNET_YES on success, #GNUNET_NO on failure.
160 */ 160 */
161int 161int
162enter_room_at (struct GNUNET_MESSENGER_SrvRoom *room, 162enter_srv_room_at (struct GNUNET_MESSENGER_SrvRoom *room,
163 struct GNUNET_MESSENGER_SrvHandle *handle, 163 struct GNUNET_MESSENGER_SrvHandle *handle,
164 const struct GNUNET_PeerIdentity *door); 164 const struct GNUNET_PeerIdentity *door);
165 165
166/** 166/**
167 * Packs a <i>message</i> depending on the selected <i>mode</i> into a newly allocated envelope. It will set the 167 * Packs a <i>message</i> depending on the selected <i>mode</i> into a newly allocated envelope. It will set the
@@ -181,11 +181,11 @@ enter_room_at (struct GNUNET_MESSENGER_SrvRoom *room,
181 * @return New envelope or NULL 181 * @return New envelope or NULL
182 */ 182 */
183struct GNUNET_MQ_Envelope* 183struct GNUNET_MQ_Envelope*
184pack_room_message (const struct GNUNET_MESSENGER_SrvRoom *room, 184pack_srv_room_message (const struct GNUNET_MESSENGER_SrvRoom *room,
185 const struct GNUNET_MESSENGER_SrvHandle *handle, 185 const struct GNUNET_MESSENGER_SrvHandle *handle,
186 struct GNUNET_MESSENGER_Message *message, 186 struct GNUNET_MESSENGER_Message *message,
187 struct GNUNET_HashCode *hash, 187 struct GNUNET_HashCode *hash,
188 int mode); 188 int mode);
189 189
190/** 190/**
191 * Sends a <i>message</i> from a given <i>handle</i> into a <i>room</i>. The <i>hash</i> parameter will be 191 * Sends a <i>message</i> from a given <i>handle</i> into a <i>room</i>. The <i>hash</i> parameter will be
@@ -203,9 +203,9 @@ pack_room_message (const struct GNUNET_MESSENGER_SrvRoom *room,
203 * @return #GNUNET_YES on success, #GNUNET_NO or #GNUNET_SYSERR otherwise. 203 * @return #GNUNET_YES on success, #GNUNET_NO or #GNUNET_SYSERR otherwise.
204 */ 204 */
205int 205int
206send_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 206send_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
207 struct GNUNET_MESSENGER_SrvHandle *handle, 207 struct GNUNET_MESSENGER_SrvHandle *handle,
208 struct GNUNET_MESSENGER_Message *message); 208 struct GNUNET_MESSENGER_Message *message);
209 209
210/** 210/**
211 * Forwards a <i>message</i> with a given <i>hash</i> to a specific <i>tunnel</i> inside of a <i>room</i>. 211 * Forwards a <i>message</i> with a given <i>hash</i> to a specific <i>tunnel</i> inside of a <i>room</i>.
@@ -216,10 +216,10 @@ send_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
216 * @param[in] hash Hash of message 216 * @param[in] hash Hash of message
217 */ 217 */
218void 218void
219forward_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 219forward_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
220 struct GNUNET_MESSENGER_SrvTunnel *tunnel, 220 struct GNUNET_MESSENGER_SrvTunnel *tunnel,
221 struct GNUNET_MESSENGER_Message *message, 221 struct GNUNET_MESSENGER_Message *message,
222 const struct GNUNET_HashCode *hash); 222 const struct GNUNET_HashCode *hash);
223 223
224/** 224/**
225 * Checks the current state of opening a given <i>room</i> from this peer and re-publishes it 225 * Checks the current state of opening a given <i>room</i> from this peer and re-publishes it
@@ -230,8 +230,8 @@ forward_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
230 * @param[in/out] tunnel Tunnel 230 * @param[in/out] tunnel Tunnel
231 */ 231 */
232void 232void
233check_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room, 233check_srv_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room,
234 struct GNUNET_MESSENGER_SrvTunnel *tunnel); 234 struct GNUNET_MESSENGER_SrvTunnel *tunnel);
235 235
236/** 236/**
237 * Reduces all current forks inside of the message history of a <i>room</i> to one remaining last message 237 * Reduces all current forks inside of the message history of a <i>room</i> to one remaining last message
@@ -241,8 +241,8 @@ check_room_peer_status (struct GNUNET_MESSENGER_SrvRoom *room,
241 * @param[in/out] handle Handle 241 * @param[in/out] handle Handle
242 */ 242 */
243void 243void
244merge_room_last_messages (struct GNUNET_MESSENGER_SrvRoom *room, 244merge_srv_room_last_messages (struct GNUNET_MESSENGER_SrvRoom *room,
245 struct GNUNET_MESSENGER_SrvHandle *handle); 245 struct GNUNET_MESSENGER_SrvHandle *handle);
246 246
247/** 247/**
248 * Deletes a message from the <i>room</i> with a given <i>hash</i> in a specific <i>delay</i> if 248 * Deletes a message from the <i>room</i> with a given <i>hash</i> in a specific <i>delay</i> if
@@ -255,10 +255,10 @@ merge_room_last_messages (struct GNUNET_MESSENGER_SrvRoom *room,
255 * @return #GNUNET_YES on success, #GNUNET_NO if permission gets denied, #GNUNET_SYSERR on operation failure 255 * @return #GNUNET_YES on success, #GNUNET_NO if permission gets denied, #GNUNET_SYSERR on operation failure
256 */ 256 */
257int 257int
258delete_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 258delete_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
259 struct GNUNET_MESSENGER_MemberSession *session, 259 struct GNUNET_MESSENGER_MemberSession *session,
260 const struct GNUNET_HashCode *hash, 260 const struct GNUNET_HashCode *hash,
261 const struct GNUNET_TIME_Relative delay); 261 const struct GNUNET_TIME_Relative delay);
262 262
263/** 263/**
264 * Returns the CADET handle from a rooms service. 264 * Returns the CADET handle from a rooms service.
@@ -267,7 +267,7 @@ delete_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
267 * @return CADET handle 267 * @return CADET handle
268 */ 268 */
269struct GNUNET_CADET_Handle* 269struct GNUNET_CADET_Handle*
270get_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room); 270get_srv_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room);
271 271
272/** 272/**
273 * Returns the shared secret you need to access a <i>room</i>. 273 * Returns the shared secret you need to access a <i>room</i>.
@@ -276,7 +276,7 @@ get_room_cadet (struct GNUNET_MESSENGER_SrvRoom *room);
276 * @return Shared secret 276 * @return Shared secret
277 */ 277 */
278const struct GNUNET_HashCode* 278const struct GNUNET_HashCode*
279get_room_key (const struct GNUNET_MESSENGER_SrvRoom *room); 279get_srv_room_key (const struct GNUNET_MESSENGER_SrvRoom *room);
280 280
281/** 281/**
282 * Returns a tunnel inside of a <i>room</i> leading towards a given <i>peer</i> if such a tunnel exists, 282 * Returns a tunnel inside of a <i>room</i> leading towards a given <i>peer</i> if such a tunnel exists,
@@ -287,8 +287,8 @@ get_room_key (const struct GNUNET_MESSENGER_SrvRoom *room);
287 * @return Tunnel or NULL 287 * @return Tunnel or NULL
288 */ 288 */
289const struct GNUNET_MESSENGER_SrvTunnel* 289const struct GNUNET_MESSENGER_SrvTunnel*
290get_room_tunnel (const struct GNUNET_MESSENGER_SrvRoom *room, 290get_srv_room_tunnel (const struct GNUNET_MESSENGER_SrvRoom *room,
291 const struct GNUNET_PeerIdentity *peer); 291 const struct GNUNET_PeerIdentity *peer);
292 292
293/** 293/**
294 * Method called whenever a <i>message</i> is found during a request in a <i>room</i>. 294 * Method called whenever a <i>message</i> is found during a request in a <i>room</i>.
@@ -321,11 +321,11 @@ typedef void (GNUNET_MESSENGER_MessageRequestCallback) (
321 * @return #GNUNET_YES if the request could be processed, otherwise #GNUNET_NO 321 * @return #GNUNET_YES if the request could be processed, otherwise #GNUNET_NO
322 */ 322 */
323int 323int
324request_room_message (struct GNUNET_MESSENGER_SrvRoom *room, 324request_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
325 const struct GNUNET_HashCode *hash, 325 const struct GNUNET_HashCode *hash,
326 const struct GNUNET_MESSENGER_MemberSession *session, 326 const struct GNUNET_MESSENGER_MemberSession *session,
327 GNUNET_MESSENGER_MessageRequestCallback callback, 327 GNUNET_MESSENGER_MessageRequestCallback callback,
328 void* cls); 328 void* cls);
329 329
330/** 330/**
331 * Checks for potential collisions with member ids and solves them changing active handles ids if they 331 * Checks for potential collisions with member ids and solves them changing active handles ids if they
@@ -337,10 +337,10 @@ request_room_message (struct GNUNET_MESSENGER_SrvRoom *room,
337 * @param[in] timestamp Timestamp 337 * @param[in] timestamp Timestamp
338 */ 338 */
339void 339void
340solve_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room, 340solve_srv_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room,
341 const struct GNUNET_IDENTITY_PublicKey *public_key, 341 const struct GNUNET_IDENTITY_PublicKey *public_key,
342 const struct GNUNET_ShortHashCode *member_id, 342 const struct GNUNET_ShortHashCode *member_id,
343 struct GNUNET_TIME_Absolute timestamp); 343 struct GNUNET_TIME_Absolute timestamp);
344 344
345/** 345/**
346 * Rebuilds the decentralized structure for a <i>room</i> by ensuring all required connections are made 346 * Rebuilds the decentralized structure for a <i>room</i> by ensuring all required connections are made
@@ -349,7 +349,7 @@ solve_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room,
349 * @param[in/out] room Room 349 * @param[in/out] room Room
350 */ 350 */
351void 351void
352rebuild_room_basement_structure (struct GNUNET_MESSENGER_SrvRoom *room); 352rebuild_srv_room_basement_structure (struct GNUNET_MESSENGER_SrvRoom *room);
353 353
354/** 354/**
355 * Loads the local configuration for a given <i>room</i> of a service which contains the last messages hash 355 * Loads the local configuration for a given <i>room</i> of a service which contains the last messages hash
@@ -358,7 +358,7 @@ rebuild_room_basement_structure (struct GNUNET_MESSENGER_SrvRoom *room);
358 * @param[out] room Room 358 * @param[out] room Room
359 */ 359 */
360void 360void
361load_room (struct GNUNET_MESSENGER_SrvRoom *room); 361load_srv_room (struct GNUNET_MESSENGER_SrvRoom *room);
362 362
363/** 363/**
364 * Saves the configuration for a given <i>room</i> of a service which contains the last messages hash 364 * Saves the configuration for a given <i>room</i> of a service which contains the last messages hash
@@ -367,7 +367,7 @@ load_room (struct GNUNET_MESSENGER_SrvRoom *room);
367 * @param[in] room Room 367 * @param[in] room Room
368 */ 368 */
369void 369void
370save_room (struct GNUNET_MESSENGER_SrvRoom *room); 370save_srv_room (struct GNUNET_MESSENGER_SrvRoom *room);
371 371
372/** 372/**
373 * Removes the configuration for a given <i>room</i> of a service. 373 * Removes the configuration for a given <i>room</i> of a service.
@@ -375,6 +375,6 @@ save_room (struct GNUNET_MESSENGER_SrvRoom *room);
375 * @param[in] room Room 375 * @param[in] room Room
376 */ 376 */
377void 377void
378remove_room (struct GNUNET_MESSENGER_SrvRoom *room); 378remove_srv_room (struct GNUNET_MESSENGER_SrvRoom *room);
379 379
380#endif //GNUNET_SERVICE_MESSENGER_ROOM_H 380#endif //GNUNET_SERVICE_MESSENGER_ROOM_H
diff --git a/src/messenger/gnunet-service-messenger_service.c b/src/messenger/gnunet-service-messenger_service.c
index 83d7632d8..3d5801b09 100644
--- a/src/messenger/gnunet-service-messenger_service.c
+++ b/src/messenger/gnunet-service-messenger_service.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -94,7 +94,7 @@ iterate_destroy_rooms (void *cls,
94 void *value) 94 void *value)
95{ 95{
96 struct GNUNET_MESSENGER_SrvRoom *room = value; 96 struct GNUNET_MESSENGER_SrvRoom *room = value;
97 destroy_room (room, GNUNET_NO); 97 destroy_srv_room (room, GNUNET_NO);
98 return GNUNET_YES; 98 return GNUNET_YES;
99} 99}
100 100
@@ -159,7 +159,7 @@ add_service_handle (struct GNUNET_MESSENGER_Service *service,
159{ 159{
160 GNUNET_assert((service) && (mq)); 160 GNUNET_assert((service) && (mq));
161 161
162 struct GNUNET_MESSENGER_SrvHandle *handle = create_handle (service, mq); 162 struct GNUNET_MESSENGER_SrvHandle *handle = create_srv_handle (service, mq);
163 163
164 if (handle) 164 if (handle)
165 { 165 {
@@ -179,7 +179,7 @@ remove_service_handle (struct GNUNET_MESSENGER_Service *service,
179 return; 179 return;
180 180
181 if (GNUNET_YES == remove_list_handle (&(service->handles), handle)) 181 if (GNUNET_YES == remove_list_handle (&(service->handles), handle))
182 destroy_handle (handle); 182 destroy_srv_handle (handle);
183} 183}
184 184
185int 185int
@@ -210,17 +210,17 @@ open_service_room (struct GNUNET_MESSENGER_Service *service,
210 struct GNUNET_MESSENGER_SrvRoom *room = get_service_room (service, key); 210 struct GNUNET_MESSENGER_SrvRoom *room = get_service_room (service, key);
211 211
212 if (room) 212 if (room)
213 return open_room (room, handle); 213 return open_srv_room (room, handle);
214 214
215 room = create_room (handle, key); 215 room = create_srv_room (handle, key);
216 216
217 if ((GNUNET_YES == open_room (room, handle)) && 217 if ((GNUNET_YES == open_srv_room (room, handle)) &&
218 (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (service->rooms, 218 (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (service->rooms,
219 key, room, 219 key, room,
220 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))) 220 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)))
221 return GNUNET_YES; 221 return GNUNET_YES;
222 222
223 destroy_room (room, GNUNET_YES); 223 destroy_srv_room (room, GNUNET_YES);
224 return GNUNET_NO; 224 return GNUNET_NO;
225} 225}
226 226
@@ -236,15 +236,15 @@ entry_service_room (struct GNUNET_MESSENGER_Service *service,
236 236
237 if (room) 237 if (room)
238 { 238 {
239 if (GNUNET_YES == enter_room_at (room, handle, door)) 239 if (GNUNET_YES == enter_srv_room_at (room, handle, door))
240 return GNUNET_YES; 240 return GNUNET_YES;
241 else 241 else
242 return GNUNET_NO; 242 return GNUNET_NO;
243 } 243 }
244 244
245 room = create_room (handle, key); 245 room = create_srv_room (handle, key);
246 246
247 if ((GNUNET_YES == enter_room_at (room, handle, door)) && 247 if ((GNUNET_YES == enter_srv_room_at (room, handle, door)) &&
248 (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (service->rooms, 248 (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (service->rooms,
249 key, room, 249 key, room,
250 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))) 250 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)))
@@ -253,7 +253,7 @@ entry_service_room (struct GNUNET_MESSENGER_Service *service,
253 } 253 }
254 else 254 else
255 { 255 {
256 destroy_room (room, GNUNET_YES); 256 destroy_srv_room (room, GNUNET_YES);
257 return GNUNET_NO; 257 return GNUNET_NO;
258 } 258 }
259 259
@@ -271,9 +271,9 @@ close_service_room (struct GNUNET_MESSENGER_Service *service,
271 if (!room) 271 if (!room)
272 return GNUNET_NO; 272 return GNUNET_NO;
273 273
274 send_room_message (room, handle, create_message_leave ()); 274 send_srv_room_message (room, handle, create_message_leave ());
275 275
276 const struct GNUNET_ShortHashCode *id = get_handle_member_id (handle, key); 276 const struct GNUNET_ShortHashCode *id = get_srv_handle_member_id (handle, key);
277 277
278 GNUNET_assert(id); 278 GNUNET_assert(id);
279 279
@@ -287,7 +287,7 @@ close_service_room (struct GNUNET_MESSENGER_Service *service,
287 { 287 {
288 if (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (service->rooms, key, room)) 288 if (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (service->rooms, key, room))
289 { 289 {
290 destroy_room (room, GNUNET_YES); 290 destroy_srv_room (room, GNUNET_YES);
291 return GNUNET_YES; 291 return GNUNET_YES;
292 } 292 }
293 else 293 else
@@ -313,7 +313,7 @@ handle_service_message (struct GNUNET_MESSENGER_Service *service,
313 313
314 while (element) 314 while (element)
315 { 315 {
316 notify_handle_message (element->handle, room, session, message, hash); 316 notify_srv_handle_message (element->handle, room, session, message, hash);
317 element = element->next; 317 element = element->next;
318 } 318 }
319} 319}
diff --git a/src/messenger/gnunet-service-messenger_tunnel.c b/src/messenger/gnunet-service-messenger_tunnel.c
index 45c10c1af..83973bbbe 100644
--- a/src/messenger/gnunet-service-messenger_tunnel.c
+++ b/src/messenger/gnunet-service-messenger_tunnel.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V. 3 Copyright (C) 2020--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -157,13 +157,13 @@ static void
157update_tunnel_last_message (struct GNUNET_MESSENGER_SrvTunnel *tunnel, 157update_tunnel_last_message (struct GNUNET_MESSENGER_SrvTunnel *tunnel,
158 const struct GNUNET_HashCode *hash) 158 const struct GNUNET_HashCode *hash)
159{ 159{
160 struct GNUNET_MESSENGER_OperationStore *operation_store = get_room_operation_store(tunnel->room); 160 struct GNUNET_MESSENGER_OperationStore *operation_store = get_srv_room_operation_store(tunnel->room);
161 161
162 const int requested = (GNUNET_MESSENGER_OP_REQUEST == get_store_operation_type(operation_store, hash)? 162 const int requested = (GNUNET_MESSENGER_OP_REQUEST == get_store_operation_type(operation_store, hash)?
163 GNUNET_YES : GNUNET_NO 163 GNUNET_YES : GNUNET_NO
164 ); 164 );
165 165
166 struct GNUNET_MESSENGER_MessageStore *message_store = get_room_message_store(tunnel->room); 166 struct GNUNET_MESSENGER_MessageStore *message_store = get_srv_room_message_store(tunnel->room);
167 167
168 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, hash); 168 const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, hash);
169 169
@@ -221,7 +221,7 @@ handle_tunnel_message (void *cls, const struct GNUNET_MessageHeader *header)
221 221
222 if (GNUNET_YES == forward_message) 222 if (GNUNET_YES == forward_message)
223 { 223 {
224 forward_room_message (tunnel->room, tunnel, &message, &hash); 224 forward_srv_room_message (tunnel->room, tunnel, &message, &hash);
225 callback_room_handle_message (tunnel->room, NULL, &message, &hash); 225 callback_room_handle_message (tunnel->room, NULL, &message, &hash);
226 } 226 }
227 227
@@ -241,8 +241,8 @@ connect_tunnel (struct GNUNET_MESSENGER_SrvTunnel *tunnel)
241 241
242 const struct GNUNET_PeerIdentity *door = GNUNET_PEER_resolve2 (tunnel->peer); 242 const struct GNUNET_PeerIdentity *door = GNUNET_PEER_resolve2 (tunnel->peer);
243 243
244 struct GNUNET_CADET_Handle *cadet = get_room_cadet (tunnel->room); 244 struct GNUNET_CADET_Handle *cadet = get_srv_room_cadet (tunnel->room);
245 const struct GNUNET_HashCode *key = get_room_key (tunnel->room); 245 const struct GNUNET_HashCode *key = get_srv_room_key (tunnel->room);
246 246
247 struct GNUNET_MQ_MessageHandler handlers[] = { GNUNET_MQ_hd_var_size(tunnel_message, GNUNET_MESSAGE_TYPE_CADET_CLI, 247 struct GNUNET_MQ_MessageHandler handlers[] = { GNUNET_MQ_hd_var_size(tunnel_message, GNUNET_MESSAGE_TYPE_CADET_CLI,
248 struct GNUNET_MessageHeader, NULL), 248 struct GNUNET_MessageHeader, NULL),
@@ -323,7 +323,7 @@ send_tunnel_message (struct GNUNET_MESSENGER_SrvTunnel *tunnel,
323 return GNUNET_NO; 323 return GNUNET_NO;
324 324
325 struct GNUNET_HashCode hash; 325 struct GNUNET_HashCode hash;
326 struct GNUNET_MQ_Envelope *env = pack_room_message ( 326 struct GNUNET_MQ_Envelope *env = pack_srv_room_message (
327 tunnel->room, (struct GNUNET_MESSENGER_SrvHandle*) handle, 327 tunnel->room, (struct GNUNET_MESSENGER_SrvHandle*) handle,
328 message, &hash, GNUNET_MESSENGER_PACK_MODE_ENVELOPE 328 message, &hash, GNUNET_MESSENGER_PACK_MODE_ENVELOPE
329 ); 329 );