aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_message_send.h
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2020-11-01 22:57:28 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2021-03-06 01:30:37 +0100
commit2925310d67483aca6e055e1ce0593c6463cd6c72 (patch)
tree2cc8aacafc25563cdccde2eee9a90f9ca257d405 /src/messenger/gnunet-service-messenger_message_send.h
parent82b864a64679b0a735201724907cdf2b7e4e16c3 (diff)
downloadgnunet-2925310d67483aca6e055e1ce0593c6463cd6c72.tar.gz
gnunet-2925310d67483aca6e055e1ce0593c6463cd6c72.zip
-added core functionality of the messenger service
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> formatting messenger code Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -completed core functionality of messenger service Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -code cleanup and reuse Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> +added structure to memberships of rooms Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -implemented member permission checks and deletion of messages Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -moved solving requests out of updating last messages (also forward before update) Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -reduced complexity of permisson check and changed load/save of rooms Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -added save/load for accessed keys and basement peers of a room Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -implemented save/load for members with their history and session Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -abstracted management of egos and contacts Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fix warning Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -abstracted management of members Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed and adjusted test case Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -separated handling of direct and anonymous contacts Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -messenger added member-sessions which fix multiple edge cases, also additional cleanup Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -updated docs and fixed memory leak Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -changed info messages and added protocol version exchange Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -adjusted client api to use contacts from sessions Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -added more logging and fixed wrong session usage Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -adjusted comm0 test case and removed adding members from checking messages Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed test-case for peer exchange Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -getting multiple peers connected in test-case with cadet Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed wrong assert and added tunnel version check -simplified handling and forwarding Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed merging last messages and cycling info messages Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -automated adding sessions and members Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -corrected use of identity keys and signatures Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -adding local joining on entering external room Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed test-case comm0 Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -added more test-cases with generic setup Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed multiple simultaneous channels blocking each other Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -making test-cases more precise Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -added check of members in test-cases, reduced merge messages Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -unified delayed operations: requests, deletions and merges Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -finished handling of operations Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed member session historystorage, added request permission check and padding for transmission Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -improved padding and removed automatic recursive requests Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -implemented filter for sending messages and added private messages to API level Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -wrong setups fixed with proper ego lookups Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -fixed problem with anonymous ego and changed to discrete-level padding Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -added links to replace deleted messages, added local deletion and fixed anonymous id changing Signed-off-by: TheJackiMonster <thejackimonster@gmail.com> -added session completion and removal through completion process Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/messenger/gnunet-service-messenger_message_send.h')
-rw-r--r--src/messenger/gnunet-service-messenger_message_send.h121
1 files changed, 21 insertions, 100 deletions
diff --git a/src/messenger/gnunet-service-messenger_message_send.h b/src/messenger/gnunet-service-messenger_message_send.h
index c1096205a..8e3ff4495 100644
--- a/src/messenger/gnunet-service-messenger_message_send.h
+++ b/src/messenger/gnunet-service-messenger_message_send.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 GNUnet e.V. 3 Copyright (C) 2020--2021 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
@@ -29,127 +29,48 @@
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_crypto_lib.h" 30#include "gnunet_crypto_lib.h"
31 31
32#include "gnunet-service-messenger_message_kind.h"
33
32#include "gnunet-service-messenger_tunnel.h" 34#include "gnunet-service-messenger_tunnel.h"
33#include "messenger_api_message.h" 35#include "messenger_api_message.h"
34 36
35/** 37/**
36 * Handles a sent info message to setup a tunnels linked member id.
37 * (if a tunnel has already got a member id linked to it, the connection will be closed)
38 *
39 * @param room Room of the message
40 * @param handle Sending handle
41 * @param tunnel Sending connection (may be NULL)
42 * @param message INFO-Message
43 * @param hash Hash of the message
44 */
45void
46send_message_info (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
47 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message,
48 const struct GNUNET_HashCode *hash);
49
50/**
51 * Handles a sent join message to ensure growth of the decentralized room structure. 38 * Handles a sent join message to ensure growth of the decentralized room structure.
52 * (if the service provides a peer message for this room currently, it will be forwarded) 39 * (if the service provides a peer message for this room currently, it will be forwarded)
53 * 40 *
54 * @param room Room of the message 41 * @param[in/out] room Room of the message
55 * @param handle Sending handle 42 * @param[in/out] handle Sending handle
56 * @param tunnel Sending connection (may be NULL) 43 * @param[in] message JOIN-Message
57 * @param message JOIN-Message 44 * @param[in] hash Hash of the message
58 * @param hash Hash of the message
59 */ 45 */
60void 46void
61send_message_join (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, 47send_message_join (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
62 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message, 48 const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
63 const struct GNUNET_HashCode *hash);
64
65/**
66 * Handles a sent leave message.
67 * @see handle_message_leave()
68 *
69 * @param room Room of the message
70 * @param handle Sending handle
71 * @param tunnel Sending connection (may be NULL)
72 * @param message LEAVE-Message
73 * @param hash Hash of the message
74 */
75void
76send_message_leave (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
77 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message,
78 const struct GNUNET_HashCode *hash);
79
80/**
81 * Handles a sent name message.
82 * @see handle_message_name()
83 *
84 * @param room Room of the message
85 * @param handle Sending handle
86 * @param tunnel Sending connection (may be NULL)
87 * @param message NAME-Message
88 * @param hash Hash of the message
89 */
90void
91send_message_name (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
92 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message,
93 const struct GNUNET_HashCode *hash);
94
95/**
96 * Handles a sent key message.
97 * @see handle_message_key()
98 *
99 * @param room Room of the message
100 * @param handle Sending handle
101 * @param tunnel Sending connection (may be NULL)
102 * @param message KEY-Message
103 * @param hash Hash of the message
104 */
105void
106send_message_key (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
107 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message,
108 const struct GNUNET_HashCode *hash);
109 49
110/** 50/**
111 * Handles a sent peer message to update the rooms peer message of this service. 51 * Handles a sent peer message to update the rooms peer message of this service.
112 * (a set peer message indicates this service being a part of the decentralized room structure) 52 * (a set peer message indicates this service being a part of the decentralized room structure)
113 * 53 *
114 * @param room Room of the message 54 * @param[in/out] room Room of the message
115 * @param handle Sending handle 55 * @param[in/out] handle Sending handle
116 * @param tunnel Sending connection (may be NULL) 56 * @param[in] message PEER-Message
117 * @param message PEER-Message 57 * @param[in] hash Hash of the message
118 * @param hash Hash of the message
119 */ 58 */
120void 59void
121send_message_peer (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, 60send_message_peer (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
122 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message, 61 const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
123 const struct GNUNET_HashCode *hash);
124
125/**
126 * Handles a sent id message.
127 * @see handle_message_id()
128 *
129 * @param room Room of the message
130 * @param handle Sending handle
131 * @param tunnel Sending connection (may be NULL)
132 * @param message ID-Message
133 * @param hash Hash of the message
134 */
135void
136send_message_id (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
137 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message,
138 const struct GNUNET_HashCode *hash);
139 62
140/** 63/**
141 * Handles a sent miss message. 64 * Handles a sent request message to trigger the request operation for this service.
142 * @see handle_message_miss() 65 * (the request operation will deactivate the possibility of spamming requests)
143 * 66 *
144 * @param room Room of the message 67 * @param[in/out] room Room of the message
145 * @param handle Sending handle 68 * @param[in/out] handle Sending handle
146 * @param tunnel Sending connection (may be NULL) 69 * @param[in] message PEER-Message
147 * @param message MISS-Message 70 * @param[in] hash Hash of the message
148 * @param hash Hash of the message
149 */ 71 */
150void 72void
151send_message_miss (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, 73send_message_request (struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle,
152 struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message, 74 const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash);
153 const struct GNUNET_HashCode *hash);
154 75
155#endif //GNUNET_SERVICE_MESSENGER_MESSAGE_SEND_H 76#endif //GNUNET_SERVICE_MESSENGER_MESSAGE_SEND_H