diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2020-10-01 21:13:43 +0200 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2020-11-12 16:57:45 +0100 |
commit | 8bf864c25bda97c1448b709a76a168834753ff86 (patch) | |
tree | 6ffccc18a3c112e035235c596006f8b13aca1be7 /src/messenger/gnunet-service-messenger_message_handle.h | |
parent | 8fd7531e5841c9d9f80f821a3490a05934fee933 (diff) | |
download | gnunet-8bf864c25bda97c1448b709a76a168834753ff86.tar.gz gnunet-8bf864c25bda97c1448b709a76a168834753ff86.zip |
adding the messenger service and its client-side library
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/messenger/gnunet-service-messenger_message_handle.h')
-rw-r--r-- | src/messenger/gnunet-service-messenger_message_handle.h | 128 |
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 | */ | ||
46 | void | ||
47 | handle_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 | */ | ||
59 | void | ||
60 | handle_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 | */ | ||
72 | void | ||
73 | handle_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 | */ | ||
85 | void | ||
86 | handle_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 | */ | ||
98 | void | ||
99 | handle_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 | */ | ||
111 | void | ||
112 | handle_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 | */ | ||
124 | void | ||
125 | handle_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 | ||