aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_message_kind.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_kind.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_kind.h')
-rw-r--r--src/messenger/gnunet-service-messenger_message_kind.h58
1 files changed, 35 insertions, 23 deletions
diff --git a/src/messenger/gnunet-service-messenger_message_kind.h b/src/messenger/gnunet-service-messenger_message_kind.h
index dd89d0b2f..c098868c0 100644
--- a/src/messenger/gnunet-service-messenger_message_kind.h
+++ b/src/messenger/gnunet-service-messenger_message_kind.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
@@ -30,31 +30,32 @@
30#include "gnunet_container_lib.h" 30#include "gnunet_container_lib.h"
31#include "gnunet_crypto_lib.h" 31#include "gnunet_crypto_lib.h"
32#include "gnunet_identity_service.h" 32#include "gnunet_identity_service.h"
33#include "gnunet_time_lib.h"
33 34
34#include "messenger_api_message.h" 35#include "messenger_api_message.h"
35#include "gnunet-service-messenger_service.h" 36#include "gnunet-service-messenger_service.h"
36#include "messenger_api_ego.h" 37#include "messenger_api_ego.h"
37 38
38/** 39/**
39 * Creates and allocates a new info message containing the hosts public key and a newly generated unique member id. 40 * Creates and allocates a new info message containing the hosts EGO public key and a newly generated unique member id.
40 * (all values are stored as copy) 41 * (all values are stored as copy)
41 * 42 *
42 * @param ego EGO of the host 43 * @param[in] ego EGO of the host
43 * @param members Map of all assigned member ids 44 * @param[in] members Map of all assigned member ids
44 * @return New message 45 * @return New message
45 */ 46 */
46struct GNUNET_MESSENGER_Message* 47struct GNUNET_MESSENGER_Message*
47create_message_info (struct GNUNET_MESSENGER_Ego *ego, struct GNUNET_CONTAINER_MultiShortmap *members); 48create_message_info (const struct GNUNET_MESSENGER_Ego *ego);
48 49
49/** 50/**
50 * Creates and allocates a new join message containing the clients public key. 51 * Creates and allocates a new join message containing the clients EGO public key.
51 * (all values are stored as copy) 52 * (all values are stored as copy)
52 * 53 *
53 * @param ego EGO of the client 54 * @param[in] ego EGO of the client
54 * @return New message 55 * @return New message
55 */ 56 */
56struct GNUNET_MESSENGER_Message* 57struct GNUNET_MESSENGER_Message*
57create_message_join (struct GNUNET_MESSENGER_Ego *ego); 58create_message_join (const struct GNUNET_MESSENGER_Ego *ego);
58 59
59/** 60/**
60 * Creates and allocates a new leave message. 61 * Creates and allocates a new leave message.
@@ -68,17 +69,17 @@ create_message_leave ();
68 * Creates and allocates a new name message containing the <i>name</i> to change to. 69 * Creates and allocates a new name message containing the <i>name</i> to change to.
69 * (all values are stored as copy) 70 * (all values are stored as copy)
70 * 71 *
71 * @param name New name 72 * @param[in] name New name
72 * @return New message 73 * @return New message
73 */ 74 */
74struct GNUNET_MESSENGER_Message* 75struct GNUNET_MESSENGER_Message*
75create_message_name (const char *name); 76create_message_name (const char *name);
76 77
77/** 78/**
78 * Creates and allocates a new key message containing the public key to change to derived 79 * Creates and allocates a new key message containing the public <i>key</i> to change to derived
79 * from its private counterpart. (all values are stored as copy) 80 * from its private counterpart. (all values are stored as copy)
80 * 81 *
81 * @param key Private key of EGO 82 * @param[in] key Private key of EGO
82 * @return New message 83 * @return New message
83 */ 84 */
84struct GNUNET_MESSENGER_Message* 85struct GNUNET_MESSENGER_Message*
@@ -88,7 +89,7 @@ create_message_key (const struct GNUNET_IDENTITY_PrivateKey *key);
88 * Creates and allocates a new peer message containing a services peer identity. 89 * Creates and allocates a new peer message containing a services peer identity.
89 * (all values are stored as copy) 90 * (all values are stored as copy)
90 * 91 *
91 * @param service Service 92 * @param[in] service Service
92 * @return New message 93 * @return New message
93 */ 94 */
94struct GNUNET_MESSENGER_Message* 95struct GNUNET_MESSENGER_Message*
@@ -98,38 +99,38 @@ create_message_peer (const struct GNUNET_MESSENGER_Service *service);
98 * Creates and allocates a new id message containing the unique member id to change to. 99 * Creates and allocates a new id message containing the unique member id to change to.
99 * (all values are stored as copy) 100 * (all values are stored as copy)
100 * 101 *
101 * @param unique_id Unique member id 102 * @param[in] unique_id Unique member id
102 * @return New message 103 * @return New message
103 */ 104 */
104struct GNUNET_MESSENGER_Message* 105struct GNUNET_MESSENGER_Message*
105create_message_id (const struct GNUNET_ShortHashCode *unique_id); 106create_message_id (const struct GNUNET_ShortHashCode *unique_id);
106 107
107/** 108/**
108 * Creates and allocates a new miss message containing the missing peer identity. 109 * Creates and allocates a new miss message containing the missing <i>peer</i> identity.
109 * (all values are stored as copy) 110 * (all values are stored as copy)
110 * 111 *
111 * @param peer Missing peer identity 112 * @param[in] peer Missing peer identity
112 * @return New message 113 * @return New message
113 */ 114 */
114struct GNUNET_MESSENGER_Message* 115struct GNUNET_MESSENGER_Message*
115create_message_miss (const struct GNUNET_PeerIdentity *peer); 116create_message_miss (const struct GNUNET_PeerIdentity *peer);
116 117
117/** 118/**
118 * Creates and allocates a new merge message containing the hash of a second previous message 119 * Creates and allocates a new merge message containing the hash of a second <i>previous</i> message
119 * besides the regular previous message mentioned in a messages header. 120 * besides the regular previous message mentioned in a messages header.
120 * (all values are stored as copy) 121 * (all values are stored as copy)
121 * 122 *
122 * @param previous Hash of message 123 * @param[in] previous Hash of message
123 * @return New message 124 * @return New message
124 */ 125 */
125struct GNUNET_MESSENGER_Message* 126struct GNUNET_MESSENGER_Message*
126create_message_merge (const struct GNUNET_HashCode *previous); 127create_message_merge (const struct GNUNET_HashCode *previous);
127 128
128/** 129/**
129 * Creates and allocates a new request message containing the hash of a missing message. 130 * Creates and allocates a new request message containing the <i>hash</i> of a missing message.
130 * (all values are stored as copy) 131 * (all values are stored as copy)
131 * 132 *
132 * @param hash Hash of message 133 * @param[in] hash Hash of message
133 * @return New message 134 * @return New message
134 */ 135 */
135struct GNUNET_MESSENGER_Message* 136struct GNUNET_MESSENGER_Message*
@@ -140,21 +141,32 @@ create_message_request (const struct GNUNET_HashCode *hash);
140 * to a room using a given <i>key</i> as shared secret for communication. 141 * to a room using a given <i>key</i> as shared secret for communication.
141 * (all values are stored as copy) 142 * (all values are stored as copy)
142 * 143 *
143 * @param door Peer identity 144 * @param[in] door Peer identity
144 * @param key Shared secret of a room 145 * @param[in] key Shared secret of a room
145 * @return New message 146 * @return New message
146 */ 147 */
147struct GNUNET_MESSENGER_Message* 148struct GNUNET_MESSENGER_Message*
148create_message_invite (const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key); 149create_message_invite (const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key);
149 150
150/** 151/**
151 * Creates and allocates a new text message containing a string representing text. 152 * Creates and allocates a new <i>text message containing a string representing text.
152 * (all values are stored as copy) 153 * (all values are stored as copy)
153 * 154 *
154 * @param text Text 155 * @param[in] text Text
155 * @return New message 156 * @return New message
156 */ 157 */
157struct GNUNET_MESSENGER_Message* 158struct GNUNET_MESSENGER_Message*
158create_message_text (const char *text); 159create_message_text (const char *text);
159 160
161/**
162 * Creates and allocates a new delete message containing the <i>hash</i> of a message to delete after a specific <i>delay</i>.
163 * (all values are stored as copy)
164 *
165 * @param[in] hash Hash of message
166 * @param[in] delay Delay of deletion
167 * @return New message
168 */
169struct GNUNET_MESSENGER_Message*
170create_message_delete (const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay);
171
160#endif //GNUNET_SERVICE_MESSENGER_MESSAGE_KIND_H 172#endif //GNUNET_SERVICE_MESSENGER_MESSAGE_KIND_H