diff options
Diffstat (limited to 'src/service/messenger/gnunet-service-messenger_room.h')
-rw-r--r-- | src/service/messenger/gnunet-service-messenger_room.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/service/messenger/gnunet-service-messenger_room.h b/src/service/messenger/gnunet-service-messenger_room.h index fb2a88aea..e3e561d8b 100644 --- a/src/service/messenger/gnunet-service-messenger_room.h +++ b/src/service/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--2022 GNUnet e.V. | 3 | Copyright (C) 2020--2023 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 |
@@ -38,20 +38,20 @@ | |||
38 | #include "gnunet-service-messenger_list_messages.h" | 38 | #include "gnunet-service-messenger_list_messages.h" |
39 | 39 | ||
40 | #include "messenger_api_list_tunnels.h" | 40 | #include "messenger_api_list_tunnels.h" |
41 | #include "messenger_api_peer_store.h" | ||
41 | 42 | ||
42 | #include "gnunet-service-messenger_member_store.h" | 43 | #include "gnunet-service-messenger_member_store.h" |
43 | #include "gnunet-service-messenger_message_store.h" | 44 | #include "gnunet-service-messenger_message_store.h" |
44 | #include "gnunet-service-messenger_operation_store.h" | 45 | #include "gnunet-service-messenger_operation_store.h" |
45 | #include "messenger_api_ego.h" | ||
46 | 46 | ||
47 | #define GNUNET_MESSENGER_IDLE_DELAY GNUNET_TIME_relative_multiply \ | 47 | #define GNUNET_MESSENGER_IDLE_DELAY GNUNET_TIME_relative_multiply \ |
48 | (GNUNET_TIME_relative_get_second_ (), 5) | 48 | (GNUNET_TIME_relative_get_second_ (), 5) |
49 | 49 | ||
50 | #define GNUNET_MESSENGER_REQUEST_DELAY GNUNET_TIME_relative_multiply \ | 50 | #define GNUNET_MESSENGER_REQUEST_DELAY GNUNET_TIME_relative_multiply \ |
51 | (GNUNET_TIME_relative_get_minute_ (), 5) | 51 | (GNUNET_TIME_relative_get_minute_ (), 5) |
52 | 52 | ||
53 | #define GNUNET_MESSENGER_MERGE_DELAY GNUNET_TIME_relative_multiply \ | 53 | #define GNUNET_MESSENGER_MERGE_DELAY GNUNET_TIME_relative_multiply \ |
54 | (GNUNET_TIME_relative_get_second_ (), 30) | 54 | (GNUNET_TIME_relative_get_second_ (), 30) |
55 | 55 | ||
56 | struct GNUNET_MESSENGER_SrvTunnel; | 56 | struct GNUNET_MESSENGER_SrvTunnel; |
57 | struct GNUNET_MESSENGER_MemberSession; | 57 | struct GNUNET_MESSENGER_MemberSession; |
@@ -66,6 +66,7 @@ struct GNUNET_MESSENGER_SrvRoom | |||
66 | 66 | ||
67 | struct GNUNET_CONTAINER_MultiPeerMap *tunnels; | 67 | struct GNUNET_CONTAINER_MultiPeerMap *tunnels; |
68 | 68 | ||
69 | struct GNUNET_MESSENGER_PeerStore peer_store; | ||
69 | struct GNUNET_MESSENGER_MemberStore member_store; | 70 | struct GNUNET_MESSENGER_MemberStore member_store; |
70 | struct GNUNET_MESSENGER_MessageStore message_store; | 71 | struct GNUNET_MESSENGER_MessageStore message_store; |
71 | struct GNUNET_MESSENGER_OperationStore operation_store; | 72 | struct GNUNET_MESSENGER_OperationStore operation_store; |
@@ -88,7 +89,7 @@ struct GNUNET_MESSENGER_SrvRoom | |||
88 | */ | 89 | */ |
89 | struct GNUNET_MESSENGER_SrvRoom* | 90 | struct GNUNET_MESSENGER_SrvRoom* |
90 | create_srv_room (struct GNUNET_MESSENGER_SrvHandle *handle, | 91 | create_srv_room (struct GNUNET_MESSENGER_SrvHandle *handle, |
91 | const struct GNUNET_HashCode *key); | 92 | const struct GNUNET_HashCode *key); |
92 | 93 | ||
93 | /** | 94 | /** |
94 | * Destroys a room and frees its memory fully. | 95 | * Destroys a room and frees its memory fully. |
@@ -101,7 +102,16 @@ create_srv_room (struct GNUNET_MESSENGER_SrvHandle *handle, | |||
101 | */ | 102 | */ |
102 | void | 103 | void |
103 | destroy_srv_room (struct GNUNET_MESSENGER_SrvRoom *room, | 104 | destroy_srv_room (struct GNUNET_MESSENGER_SrvRoom *room, |
104 | int deletion); | 105 | int deletion); |
106 | |||
107 | /** | ||
108 | * Returns the used peer store of a given <i>room</i>. | ||
109 | * | ||
110 | * @param[in,out] room Room | ||
111 | * @return Peer store | ||
112 | */ | ||
113 | struct GNUNET_MESSENGER_PeerStore* | ||
114 | get_srv_room_peer_store (struct GNUNET_MESSENGER_SrvRoom *room); | ||
105 | 115 | ||
106 | /** | 116 | /** |
107 | * Returns the used member store of a given <i>room</i>. | 117 | * Returns the used member store of a given <i>room</i>. |
@@ -297,11 +307,11 @@ get_srv_room_tunnel (const struct GNUNET_MESSENGER_SrvRoom *room, | |||
297 | * @param[in] hash Hash of message | 307 | * @param[in] hash Hash of message |
298 | */ | 308 | */ |
299 | typedef void (GNUNET_MESSENGER_MessageRequestCallback) ( | 309 | typedef void (GNUNET_MESSENGER_MessageRequestCallback) ( |
300 | void *cls, | 310 | void *cls, |
301 | struct GNUNET_MESSENGER_SrvRoom *room, | 311 | struct GNUNET_MESSENGER_SrvRoom *room, |
302 | const struct GNUNET_MESSENGER_Message *message, | 312 | const struct GNUNET_MESSENGER_Message *message, |
303 | const struct GNUNET_HashCode *hash | 313 | const struct GNUNET_HashCode *hash |
304 | ); | 314 | ); |
305 | 315 | ||
306 | /** | 316 | /** |
307 | * Requests a message from a <i>room</i> identified by a given <i>hash</i>. If the message is found, | 317 | * Requests a message from a <i>room</i> identified by a given <i>hash</i>. If the message is found, |
@@ -323,7 +333,7 @@ request_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, | |||
323 | const struct GNUNET_HashCode *hash, | 333 | const struct GNUNET_HashCode *hash, |
324 | const struct GNUNET_MESSENGER_MemberSession *session, | 334 | const struct GNUNET_MESSENGER_MemberSession *session, |
325 | GNUNET_MESSENGER_MessageRequestCallback callback, | 335 | GNUNET_MESSENGER_MessageRequestCallback callback, |
326 | void* cls); | 336 | void *cls); |
327 | 337 | ||
328 | /** | 338 | /** |
329 | * Checks for potential collisions with member ids and solves them changing active handles ids if they | 339 | * Checks for potential collisions with member ids and solves them changing active handles ids if they |
@@ -336,7 +346,8 @@ request_srv_room_message (struct GNUNET_MESSENGER_SrvRoom *room, | |||
336 | */ | 346 | */ |
337 | void | 347 | void |
338 | solve_srv_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room, | 348 | solve_srv_room_member_collisions (struct GNUNET_MESSENGER_SrvRoom *room, |
339 | const struct GNUNET_CRYPTO_PublicKey *public_key, | 349 | const struct |
350 | GNUNET_CRYPTO_PublicKey *public_key, | ||
340 | const struct GNUNET_ShortHashCode *member_id, | 351 | const struct GNUNET_ShortHashCode *member_id, |
341 | struct GNUNET_TIME_Absolute timestamp); | 352 | struct GNUNET_TIME_Absolute timestamp); |
342 | 353 | ||