aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_message_handle.h
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2020-11-12 20:58:07 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2020-11-12 20:58:07 +0100
commitca912f85dae6b61dd80ab02d0e3f0b20a556da7c (patch)
tree788ebaf2ce0870bad875a7d910b6cd1b536a99c7 /src/messenger/gnunet-service-messenger_message_handle.h
parent5bdfe2001fbc68b06293b79dd6426156719d33c0 (diff)
downloadgnunet-ca912f85dae6b61dd80ab02d0e3f0b20a556da7c.tar.gz
gnunet-ca912f85dae6b61dd80ab02d0e3f0b20a556da7c.zip
-remerge branch 'jacki/messenger'
This reverts commit e11d1e59e4ae5f7d89c33df3ae9ca8f1ece990cf.
Diffstat (limited to 'src/messenger/gnunet-service-messenger_message_handle.h')
-rw-r--r--src/messenger/gnunet-service-messenger_message_handle.h128
1 files changed, 128 insertions, 0 deletions
diff --git a/src/messenger/gnunet-service-messenger_message_handle.h b/src/messenger/gnunet-service-messenger_message_handle.h
new file mode 100644
index 000000000..d091e1d11
--- /dev/null
+++ b/src/messenger/gnunet-service-messenger_message_handle.h
@@ -0,0 +1,128 @@
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 */
20/**
21 * @author Tobias Frisch
22 * @file src/messenger/gnunet-service-messenger_message_handle.h
23 * @brief GNUnet MESSENGER service
24 */
25
26#ifndef GNUNET_SERVICE_MESSENGER_MESSAGE_HANDLE_H
27#define GNUNET_SERVICE_MESSENGER_MESSAGE_HANDLE_H
28
29#include "platform.h"
30#include "gnunet_crypto_lib.h"
31
32#include "gnunet-service-messenger_message_kind.h"
33
34#include "gnunet-service-messenger_tunnel.h"
35#include "messenger_api_message.h"
36
37/**
38 * Handles a received or sent join message to make changes of current member information.
39 * (add matching member and clear member info)
40 *
41 * @param room Room of the message
42 * @param tunnel Receiving/sending connection (may be NULL)
43 * @param message JOIN-Message
44 * @param hash Hash of the message
45 */
46void
47handle_message_join (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel,
48 struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
49
50/**
51 * Handles a received or sent leave message to make changes of current member information.
52 * (remove matching member and clear member info)
53 *
54 * @param room Room of the message
55 * @param tunnel Receiving/sending connection (may be NULL)
56 * @param message LEAVE-Message
57 * @param hash Hash of the message
58 */
59void
60handle_message_leave (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel,
61 struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
62
63/**
64 * Handles a received or sent name message to rename a current member.
65 * (change name of matching member)
66 *
67 * @param room Room of the message
68 * @param tunnel Receiving/sending connection (may be NULL)
69 * @param message NAME-Message
70 * @param hash Hash of the message
71 */
72void
73handle_message_name (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel,
74 struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
75
76/**
77 * Handles a received or sent key message to change the key of a member and rearrange the contacts accordingly.
78 * (move the member in the contacts and change its key)
79 *
80 * @param room Room of the message
81 * @param tunnel Receiving/sending connection (may be NULL)
82 * @param message KEY-Message
83 * @param hash Hash of the message
84 */
85void
86handle_message_key (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel,
87 struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
88
89/**
90 * Handles a received or sent peer message to make changes of the basement in the room.
91 * (add a new peer to the basement and restructure connections based on updated list of peers)
92 *
93 * @param room Room of the message
94 * @param tunnel Receiving/sending connection (may be NULL)
95 * @param message PEER-Message
96 * @param hash Hash of the message
97 */
98void
99handle_message_peer (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel,
100 struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
101
102/**
103 * Handles a received or sent id message to change a members id.
104 * (change id of matching member)
105 *
106 * @param room Room of the message
107 * @param tunnel Receiving/sending connection (may be NULL)
108 * @param message ID-Message
109 * @param hash Hash of the message
110 */
111void
112handle_message_id (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel,
113 struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
114
115/**
116 * Handles a received or sent miss message to drop a peer from the basement in the room.
117 * (remove a peer from the basement and restructure connections based on updated list of peers)
118 *
119 * @param room Room of the message
120 * @param tunnel Receiving/sending connection (may be NULL)
121 * @param message MISS-Message
122 * @param hash Hash of the message
123 */
124void
125handle_message_miss (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel,
126 struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
127
128#endif //GNUNET_SERVICE_MESSENGER_MESSAGE_HANDLE_H