GNUnet  0.11.x
messenger_api_room.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2020 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
26 #ifndef GNUNET_MESSENGER_API_ROOM_H
27 #define GNUNET_MESSENGER_API_ROOM_H
28 
29 #include "platform.h"
30 #include "gnunet_container_lib.h"
31 #include "gnunet_crypto_lib.h"
32 
34 
36 #include "messenger_api_contact.h"
37 #include "messenger_api_message.h"
38 
40 {
43 
44  int opened;
45 
47 
50 
52 };
53 
63 
69 void
70 destroy_room (struct GNUNET_MESSENGER_Room *room);
71 
80 const struct GNUNET_MESSENGER_Message*
81 get_room_message (const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash);
82 
91 void
92 handle_room_message (struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Message *message,
93  const struct GNUNET_HashCode *hash);
94 
95 #endif //GNUNET_MESSENGER_API_ROOM_H
struct GNUNET_HashCode key
struct GNUNET_CONTAINER_MultiShortmap * members
Internal representation of the hash map.
struct GNUNET_CONTAINER_MultiHashMap * messages
struct GNUNET_MESSENGER_ListTunnels entries
A 256-bit hashcode.
cryptographic primitives for GNUnet
struct GNUNET_ShortHashCode * contact_id
struct GNUNET_MESSENGER_Room * create_room(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Creates and allocates a new room for a handle with a given key for the client API.
const struct GNUNET_MESSENGER_Message * get_room_message(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns a message locally stored from a map for a given hash in a room.
messenger api: client implementation of GNUnet MESSENGER service
A 512-bit hashcode.
struct GNUNET_MESSENGER_Handle * handle
Internal representation of the hash map.
messenger api: client and service implementation of GNUnet MESSENGER service
void handle_room_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a message with a given hash in a room for the client API to update members and its informatio...
void destroy_room(struct GNUNET_MESSENGER_Room *room)
Destroys a room and frees its memory fully from the client API.
messenger api: client and service implementation of GNUnet MESSENGER service