GNUnet debian-0.24.3-29-g453fda2cf
 
Loading...
Searching...
No Matches
messenger_api_room.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2025 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#include "messenger_api_room.h"
27
28#include "gnunet_common.h"
31#include "gnunet_time_lib.h"
32#include "gnunet_util_lib.h"
33
34#include "messenger_api.h"
36#include "messenger_api_epoch.h"
43
44#include <stdint.h>
45#include <string.h>
46
49 const union GNUNET_MESSENGER_RoomKey *key)
50{
51 struct GNUNET_MESSENGER_Room *room;
52
53 GNUNET_assert ((handle) && (key));
54
55 room = GNUNET_new (struct GNUNET_MESSENGER_Room);
56 room->handle = handle;
57
58 GNUNET_memcpy (&(room->key), key, sizeof(*key));
59
60 memset (&(room->last_message), 0, sizeof(room->last_message));
61 memset (&(room->last_epoch), 0, sizeof(room->last_epoch));
62
63 room->joined = GNUNET_NO;
64 room->opened = GNUNET_NO;
67
68 room->sender_id = NULL;
69
70 init_list_tunnels (&(room->entries));
71
76
80
81 init_queue_messages (&(room->queue));
82 room->queue_task = NULL;
83
84 room->request_task = NULL;
85
86 room->control = create_message_control (room);
87
88 return room;
89}
90
91
94 const struct GNUNET_HashCode *key,
95 void *value)
96{
97 struct GNUNET_MESSENGER_RoomAction *action;
98
100
101 action = value;
102
103 if (action->task)
104 GNUNET_SCHEDULER_cancel (action->task);
105
106 GNUNET_free (action);
107 return GNUNET_YES;
108}
109
110
113 const struct GNUNET_HashCode *key,
114 void *value)
115{
117
119
120 entry = value;
121
122 destroy_message (entry->message);
123 GNUNET_free (entry);
124 return GNUNET_YES;
125}
126
127
130 const struct GNUNET_HashCode *key,
131 void *value)
132{
133 struct GNUNET_HashCode *hash;
134
136
137 hash = value;
138
139 GNUNET_free (hash);
140 return GNUNET_YES;
141}
142
143
146 const struct GNUNET_ShortHashCode *key,
147 void *value)
148{
149 struct GNUNET_MESSENGER_RoomSubscription *subscription;
150
152
153 subscription = value;
154
155 if (subscription->task)
156 GNUNET_SCHEDULER_cancel (subscription->task);
157
158 if (subscription->message)
159 destroy_message (subscription->message);
160
161 GNUNET_free (subscription);
162 return GNUNET_YES;
163}
164
165
168 const struct GNUNET_HashCode *key,
169 void *value)
170{
171 struct GNUNET_MESSENGER_Epoch *epoch;
172
174
175 epoch = value;
176
177 destroy_epoch (epoch);
178 return GNUNET_YES;
179}
180
181
182void
184{
186
188
189 if (room->actions)
190 {
193
195 }
196
197 if (room->request_task)
199
200 if (room->queue_task)
202
205
206 if (room->requests)
208
209 if (room->epochs)
210 {
213 NULL);
214
216 }
217
218 if (room->subscriptions)
219 {
222 NULL);
223
225 }
226
227 if (room->messages)
228 {
231
233 }
234
235 if (room->members)
237
238 if (room->links)
239 {
242
244 }
245
246 if (room->sender_id)
248
250}
251
252
253const struct GNUNET_HashCode*
255{
256 GNUNET_assert (room);
257
258 return &(room->key.hash);
259}
260
261
264{
265 GNUNET_assert (room);
266
267 return room->key.code.public_bit? GNUNET_YES : GNUNET_NO;
268}
269
270
273{
274 GNUNET_assert (entry);
275
277 return GNUNET_YES;
278 else
279 return GNUNET_NO;
280}
281
282
283static struct GNUNET_MESSENGER_Epoch*
285 const struct GNUNET_HashCode *hash,
287 entry,
288 const struct GNUNET_MESSENGER_Contact *contact)
289{
290 struct GNUNET_MESSENGER_Epoch *room_epoch;
291
292 GNUNET_assert ((room) && (hash) && (entry));
293
294 room_epoch = get_room_epoch (
295 room, &(entry->epoch),
297
298 if (! room_epoch)
299 return NULL;
300
302 return NULL;
303
305 room_epoch,
307 return NULL;
308
310 room_epoch, contact? contact : entry->sender))
311 return NULL;
312
313 return room_epoch;
314}
315
316
317static void
319 const struct GNUNET_HashCode *hash,
321 entry)
322{
323 const struct GNUNET_HashCode *target_hash;
325
326 target_hash = &(entry->message->body.deletion.hash);
327
329 {
330 struct GNUNET_TIME_Relative delay;
331
332 delay = get_message_timeout (entry->message);
333
334 link_room_deletion (room, target_hash, delay, delete_room_message);
335 }
336
337 target = GNUNET_CONTAINER_multihashmap_get (room->messages, target_hash);
338 if (! target)
339 return;
340
341 if ((target->sender != entry->sender) &&
342 (! (GNUNET_MESSENGER_FLAG_SENT & entry->flags)))
343 return;
344
346 callback_room_message (room, target_hash);
347
348 switch (target->message->header.kind)
349 {
351 {
352 struct GNUNET_MESSENGER_Epoch *epoch;
353 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
354
355 epoch = get_room_message_epoch (room, target_hash);
356
357 if (! epoch)
358 break;
359
360 announcement = get_epoch_announcement (
361 epoch,
363 GNUNET_NO);
364
365 if (! announcement)
366 break;
367
369 announcement,
370 target_hash,
371 target->message,
372 target->sender);
373 break;
374 }
375 default:
376 break;
377 }
378
380 room->messages, target_hash, target))
381 {
382 destroy_message (target->message);
383 GNUNET_free (target);
384 }
385}
386
387
388static void
390 const struct GNUNET_HashCode *hash,
391 const struct
393{
394 struct GNUNET_MESSENGER_Epoch *epoch;
395 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
397
398 GNUNET_assert ((room) && (hash) && (entry));
399
400 epoch = get_room_availble_epoch_entry (room, hash, entry, NULL);
401
402 if (! epoch)
403 return;
404
405 identifier = &(entry->message->body.announcement.identifier);
406
408 sent = GNUNET_YES;
409 else
410 sent = GNUNET_NO;
411
412 if (identifier->code.group_bit)
413 {
414 struct GNUNET_MESSENGER_EpochGroup *group;
415
417
418 if (! group)
419 return;
420
422 group,
423 entry->message,
424 hash,
425 entry->sender,
426 sent);
427 }
428 else
429 {
430 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
431
433
434 if (! announcement)
435 return;
436
438 announcement,
439 entry->message,
440 hash,
441 entry->sender,
442 sent);
443 }
444}
445
446
447static void
449 const struct GNUNET_HashCode *hash,
451 entry)
452{
453 const struct GNUNET_MESSENGER_RoomMessageEntry *event_entry;
454 struct GNUNET_MESSENGER_Epoch *epoch;
455 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
456 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
458
459 GNUNET_assert ((room) && (hash) && (entry));
460
462 room->messages, &(entry->message->body.appeal.event));
463
464 if (! event_entry)
465 return;
466
468 return;
469
471 room, hash, event_entry, entry->sender);
472
473 if (! epoch)
474 return;
475
476 identifier = &(event_entry->message->body.announcement.identifier);
477
478 if (identifier->code.group_bit)
479 return;
480
481 announcement = get_epoch_announcement (epoch, identifier, GNUNET_NO);
482
483 if (! announcement)
484 return;
485
487 return;
488
489 if (GNUNET_YES != is_epoch_member (epoch, entry->sender))
490 return;
491
492 if (GNUNET_YES == is_epoch_announcement_member (announcement, entry->sender))
493 return;
494
495 key = get_epoch_announcement_key (announcement);
496
497 if (! key)
498 return;
499
500 send_epoch_announcement_access (announcement, hash);
501}
502
503
504static void
506 const struct GNUNET_HashCode *hash)
507{
508 const struct GNUNET_MESSENGER_RoomMessageEntry *entry;
509
510 GNUNET_assert ((room) && (hash));
511
512 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
513
514 if ((! entry) || (! entry->message))
515 return;
516
517 if ((entry->flags & GNUNET_MESSENGER_FLAG_UPDATE) ||
519 goto skip_delayed_handling;
520
521 switch (entry->message->header.kind)
522 {
524 handle_room_delayed_deletion (room, hash, entry);
525 break;
527 handle_room_delayed_announcement (room, hash, entry);
528 break;
530 handle_room_delayed_appeal (room, hash, entry);
531 break;
532 default:
533 break;
534 }
535
536skip_delayed_handling:
538 callback_room_message (room, hash);
539}
540
541
542static void
544{
545 struct GNUNET_MESSENGER_RoomAction *action;
546 struct GNUNET_MESSENGER_Room *room;
547
548 GNUNET_assert (cls);
549
550 action = cls;
551 action->task = NULL;
552
553 room = action->room;
554
556 room->actions, &(action->hash), action))
557 handle_room_delayed_action (room, &(action->hash));
558
559 GNUNET_free (action);
560}
561
562
563void
565 const struct GNUNET_HashCode *hash,
566 const struct GNUNET_TIME_Relative delay)
567{
568 struct GNUNET_MESSENGER_RoomAction *action;
569
570 GNUNET_assert ((room) && (hash));
571
572 action = GNUNET_new (struct GNUNET_MESSENGER_RoomAction);
573
574 if (! action)
575 return;
576
578 room->actions, hash, action,
580 {
581 GNUNET_free (action);
582 return;
583 }
584
585 GNUNET_memcpy (&(action->hash), hash, sizeof(action->hash));
586
587 action->room = room;
589 delay,
592 action);
593}
594
595
596void
610
611
621
624 const struct GNUNET_HashCode *hash,
625 void *value)
626{
628 struct GNUNET_MESSENGER_RoomAction *action;
629 struct GNUNET_MESSENGER_Room *room;
630 const struct GNUNET_MESSENGER_Message *message;
631
632 GNUNET_assert ((cls) && (hash) && (value));
633
634 cancel = cls;
635 action = value;
636 room = action->room;
637
638 message = get_room_message (room, hash);
639
640 if ((! message) || (message->header.kind != cancel->kind))
641 return GNUNET_YES;
642
643 if (cancel->epoch_hash)
644 {
645 const struct GNUNET_MESSENGER_Epoch *epoch;
646
648
649 if ((! epoch) || (0 != GNUNET_CRYPTO_hash_cmp (&(epoch->hash), cancel->
650 epoch_hash)))
651 return GNUNET_YES;
652 }
653
654 if (cancel->identifier)
655 {
656 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
657
658 identifier = get_room_message_epoch_identifier (room, hash);
659
660 if ((! identifier) || (0 != GNUNET_memcmp (identifier, cancel->identifier)))
661 return GNUNET_YES;
662 }
663
664 if ((cancel->contact) && (cancel->contact != get_room_sender (room, hash)))
665 return GNUNET_YES;
666
669 return GNUNET_YES;
670}
671
672
675 const struct GNUNET_HashCode *hash,
676 void *value)
677{
678 struct GNUNET_MESSENGER_Room *room;
679
680 GNUNET_assert ((cls) && (hash));
681
682 room = cls;
683
684 cancel_room_action (room, hash);
685 return GNUNET_YES;
686}
687
688
689void
692 const struct GNUNET_HashCode *epoch_hash,
693 const union GNUNET_MESSENGER_EpochIdentifier *identifier
694 ,
695 const struct GNUNET_MESSENGER_Contact *contact)
696{
698
699 GNUNET_assert (room);
700
701 cancel.kind = kind;
702 cancel.epoch_hash = epoch_hash;
703 cancel.identifier = identifier;
704 cancel.contact = contact;
705
707
708 if (! cancel.map)
709 return;
710
713 &cancel);
714
717 room);
718
720}
721
722
725{
726 GNUNET_assert (room);
727
728 if (! get_room_sender_id (room))
729 return GNUNET_NO;
730
731 if ((GNUNET_YES == room->opened) || (room->entries.head))
732 return GNUNET_YES;
733 else
734 return GNUNET_NO;
735}
736
737
740{
741 GNUNET_assert (room);
742
743 return room->handle;
744}
745
746
747const struct GNUNET_ShortHashCode*
749{
750 GNUNET_assert (room);
751
752 return room->sender_id;
753}
754
755
756void
758 const struct GNUNET_ShortHashCode *id)
759{
760 GNUNET_assert (room);
761
762 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Set member id for room: %s\n",
763 GNUNET_h2s (get_room_key (room)));
764
765 if (! id)
766 {
767 if (room->sender_id)
768 GNUNET_free (room->sender_id);
769
770 room->sender_id = NULL;
771 return;
772 }
773
774 if (! room->sender_id)
776
777 GNUNET_memcpy (room->sender_id, id, sizeof(struct GNUNET_ShortHashCode));
778}
779
780
783 const struct GNUNET_HashCode *hash,
784 enum GNUNET_GenericReturnValue recent)
785{
786 struct GNUNET_MESSENGER_Epoch *epoch;
787
788 GNUNET_assert ((room) && (hash));
789
790 if (GNUNET_is_zero (hash))
791 return NULL;
792
794
795 if (epoch)
796 return epoch;
797
798 if (GNUNET_YES == recent)
799 epoch = create_new_epoch (room, hash);
800 else
801 epoch = create_epoch (room, hash);
802
803 if (! epoch)
804 return NULL;
805
807 hash,
808 epoch,
810 {
811 destroy_epoch (epoch);
812 return NULL;
813 }
814
815 return epoch;
816}
817
818
819void
821 struct GNUNET_MESSENGER_Epoch *epoch,
823 announcement)
824{
825 struct GNUNET_MESSENGER_EpochAnnouncement *epoch_announcement;
826
827 GNUNET_assert ((room) && (epoch) && (announcement) && (! (*announcement)));
828
829 epoch_announcement = create_epoch_announcement (epoch, NULL, GNUNET_YES);
830
831 if (! epoch_announcement)
832 return;
833
835 &(epoch_announcement->
837 epoch_announcement,
839 {
840 destroy_epoch_announcement (epoch_announcement);
841 return;
842 }
843
844 if (! get_epoch_announcement_key (epoch_announcement))
845 set_epoch_announcement_key (epoch_announcement, NULL, GNUNET_YES);
846
847 *announcement = epoch_announcement;
848
849 send_epoch_announcement (epoch_announcement);
850}
851
852
855 const struct GNUNET_HashCode *hash)
856{
858
859 GNUNET_assert ((room) && (hash));
860
861 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
862
863 if (! entry)
864 return NULL;
865
866 return get_room_epoch (room, &(entry->epoch),
868}
869
870
873 const struct GNUNET_HashCode *hash)
874{
876
877 GNUNET_assert ((room) && (hash));
878
879 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
880
881 if ((! entry) || (! entry->message))
882 return NULL;
883
884 switch (entry->message->header.kind)
885 {
887 return &(entry->message->body.announcement.identifier);
889 return &(entry->message->body.secret.identifier);
892 &(entry->message->body.appeal.
893 event));
896 &(entry->message->body.access.
897 event));
899 return &(entry->message->body.revolution.identifier);
901 return &(entry->message->body.group.identifier);
903 return &(entry->message->body.authorization.identifier);
904 default:
905 return NULL;
906 }
907}
908
909
910const struct GNUNET_MESSENGER_Message*
912 const struct GNUNET_HashCode *hash)
913{
915
916 GNUNET_assert ((room) && (hash));
917
918 if (! (room->messages))
919 return NULL;
920
921 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
922
923 if ((! entry) || (GNUNET_YES != entry->completed))
924 return NULL;
925
926 return entry->message;
927}
928
929
932 const struct GNUNET_HashCode *hash)
933{
935
936 GNUNET_assert ((room) && (hash));
937
938 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
939
940 if (! entry)
941 return GNUNET_SYSERR;
942
944 return GNUNET_YES;
945 else
946 return GNUNET_NO;
947}
948
949
952 const struct GNUNET_HashCode *hash)
953{
955
956 GNUNET_assert ((room) && (hash));
957
958 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
959
960 if ((! entry) || (GNUNET_YES != entry->completed))
961 return NULL;
962
963 return entry->sender;
964}
965
966
969 const struct GNUNET_HashCode *hash)
970{
972
973 GNUNET_assert ((room) && (hash));
974
975 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
976
977 if ((! entry) || (GNUNET_YES != entry->completed))
978 return NULL;
979
980 return entry->recipient;
981}
982
983
984const struct GNUNET_HashCode*
986 const struct GNUNET_HashCode *hash)
987{
989
990 GNUNET_assert ((room) && (hash));
991
992 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
993
994 if (! entry)
995 return NULL;
996
997 return &(entry->epoch);
998}
999
1000
1001void
1003 const struct GNUNET_HashCode *hash,
1004 const struct GNUNET_TIME_Relative delay)
1005{
1006 struct GNUNET_MESSENGER_Message *message;
1007
1008 GNUNET_assert ((room) && (hash));
1009
1010 message = create_message_deletion (hash, delay);
1011
1012 if (! message)
1013 {
1015 "Sending deletion aborted: Message creation failed!\n");
1016 return;
1017 }
1018
1019 enqueue_message_to_room (room, NULL, message, NULL, GNUNET_NO);
1020}
1021
1022
1023void
1025 const struct GNUNET_HashCode *hash)
1026{
1029
1030 GNUNET_assert ((room) && (hash));
1031
1032 handle = room->handle;
1033 if (! handle)
1034 return;
1035
1036 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
1037 if (! entry)
1038 return;
1039
1040 if (handle->msg_callback)
1041 handle->msg_callback (handle->msg_cls, room,
1042 entry->sender,
1043 entry->recipient,
1044 entry->message,
1045 hash,
1046 entry->flags);
1047
1050}
1051
1052
1053static enum GNUNET_GenericReturnValue
1055 identifier,
1056 const union GNUNET_MESSENGER_EpochIdentifier *other)
1057{
1058 uint32_t level, other_level;
1059
1060 GNUNET_assert ((identifier) && (other));
1061
1062 level = (uint32_t) identifier->code.level_bits;
1063 other_level = (uint32_t) other->code.level_bits;
1064
1065 if (level > other_level)
1066 return GNUNET_YES;
1067 else
1068 return GNUNET_NO;
1069}
1070
1071
1072static enum GNUNET_GenericReturnValue
1074 const struct GNUNET_HashCode *key,
1075 void *value)
1076{
1077 struct GNUNET_MESSENGER_Room *room;
1078
1079 GNUNET_assert ((cls) && (key));
1080
1081 room = cls;
1083
1084 return GNUNET_YES;
1085}
1086
1087
1088static void
1090{
1091 struct GNUNET_MESSENGER_Room *room;
1092
1093 GNUNET_assert (cls);
1094
1095 room = cls;
1096 room->request_task = NULL;
1097
1098 if ((GNUNET_YES != room->joined) || (! get_room_sender_id (room)))
1099 {
1100 struct GNUNET_TIME_Relative delay;
1102 delay = GNUNET_TIME_relative_multiply (delay, 100);
1103
1105 delay,
1108 room);
1109 return;
1110 }
1111
1113 room->requests,
1115 room);
1116
1118}
1119
1120
1121void
1123 const struct GNUNET_HashCode *hash)
1124{
1125 GNUNET_assert ((room) && (hash));
1126
1127 if (GNUNET_is_zero (hash))
1128 return;
1129
1130 if (get_room_message (room, hash))
1131 return;
1132
1134 room->requests,
1135 hash, NULL,
1137 return;
1138
1139 if (room->request_task)
1140 return;
1141
1145 room);
1146}
1147
1148
1149static void
1151 const struct GNUNET_HashCode *hash,
1152 struct GNUNET_MESSENGER_RoomMessageEntry *entry);
1153
1154
1155static void
1157 const struct GNUNET_HashCode *hash,
1159{
1160 GNUNET_assert ((room) && (hash) && (entry));
1161
1162 if (! entry->sender)
1163 {
1164 struct GNUNET_MESSENGER_ContactStore *store;
1165 struct GNUNET_HashCode context;
1166
1167 store = get_handle_contact_store (room->handle);
1168
1170 &(entry->message->header.sender_id),
1171 &context);
1172
1173 entry->sender = get_store_contact (store, &context,
1174 &(entry->message->body.join.key));
1175 }
1176
1178 room->members, &(entry->message->header.sender_id), entry->sender)) &&
1180 room->members,
1181 &(entry->message->header.sender_id),
1182 entry->sender,
1184 increase_contact_rc (entry->sender);
1185
1186 if ((get_room_sender_id (room)) &&
1187 (0 == GNUNET_memcmp (&(entry->message->header.sender_id),
1188 get_room_sender_id (room))) &&
1189 (0 == GNUNET_memcmp (&(entry->message->body.join.key), get_handle_pubkey (
1190 room->handle))))
1191 room->joined = GNUNET_YES;
1192
1193 require_message_from_room (room, &(entry->message->body.join.epoch));
1194}
1195
1196
1197static enum GNUNET_GenericReturnValue
1199 const struct GNUNET_HashCode *key,
1200 void *value)
1201{
1202 struct GNUNET_MESSENGER_Contact *contact;
1203 struct GNUNET_MESSENGER_Epoch *epoch;
1204
1205 GNUNET_assert ((cls) && (value));
1206
1207 contact = cls;
1208 epoch = value;
1209
1210 invalidate_epoch_keys_by_member (epoch, contact);
1211 return GNUNET_YES;
1212}
1213
1214
1215static void
1217 const struct GNUNET_HashCode *hash,
1219{
1220 GNUNET_assert ((room) && (hash) && (entry));
1221
1222 if ((! entry->sender) ||
1224 room->members,
1225 &(entry->message->header.sender_id),
1226 entry->sender)))
1227 return;
1228
1232 entry->sender);
1233
1234 if (GNUNET_YES == decrease_contact_rc (entry->sender))
1236 "A contact does not share any room with you anymore!\n");
1237
1239}
1240
1241
1242static void
1244 const struct GNUNET_HashCode *hash,
1246{
1247 GNUNET_assert ((room) && (hash) && (entry));
1248
1249 if (GNUNET_MESSENGER_FLAG_SENT & entry->flags)
1250 {
1251 const char *handle_name;
1252
1254 "Set rule for using handle name in room: %s\n",
1256
1257 handle_name = get_handle_name (room->handle);
1258
1259 if ((handle_name) && (0 == strcmp (handle_name,
1260 entry->message->body.name.name)))
1262 }
1263
1264 if (! entry->sender)
1265 return;
1266
1267 set_contact_name (entry->sender, entry->message->body.name.name);
1268}
1269
1270
1271static void
1273 const struct GNUNET_HashCode *hash,
1275{
1276 struct GNUNET_HashCode context;
1277 struct GNUNET_MESSENGER_ContactStore *store;
1278
1279 GNUNET_assert ((room) && (hash) && (entry));
1280
1281 if (! entry->sender)
1282 return;
1283
1285 get_room_key (room),
1286 &(entry->message->header.sender_id),
1287 &context);
1288
1289 store = get_handle_contact_store (room->handle);
1290
1291 update_store_contact (store, entry->sender, &context, &context,
1292 &(entry->message->body.key.key));
1293}
1294
1295
1296static void
1298 const struct GNUNET_HashCode *hash,
1300{
1301 struct GNUNET_HashCode context, next_context;
1302 struct GNUNET_MESSENGER_ContactStore *store;
1303
1304 GNUNET_assert ((room) && (hash) && (entry));
1305
1306 if (GNUNET_MESSENGER_FLAG_SENT & entry->flags)
1307 set_room_sender_id (room, &(entry->message->body.id.id));
1308
1309 if ((! entry->sender) ||
1311 room->members, &(entry->message->header.sender_id),
1312 entry->sender)) ||
1314 room->members, &(entry->message->body.id.id),
1315 entry->sender,
1317 return;
1318
1320 sender_id),
1321 &context);
1323 &next_context);
1324
1325 store = get_handle_contact_store (room->handle);
1326
1327 update_store_contact (store, entry->sender, &context, &next_context,
1328 get_contact_key (entry->sender));
1329}
1330
1331
1332static void
1334 const struct GNUNET_HashCode *hash,
1336{
1337 struct GNUNET_MESSENGER_ListTunnel *match;
1338
1339 GNUNET_assert ((room) && (hash) && (entry));
1340
1341 if (0 == (GNUNET_MESSENGER_FLAG_SENT & entry->flags))
1342 return;
1343
1344 match = find_list_tunnels (
1345 &(room->entries),
1346 &(entry->message->body.miss.peer),
1347 NULL);
1348
1349 if (match)
1350 remove_from_list_tunnels (&(room->entries), match);
1351}
1352
1353
1354static void
1356 const struct GNUNET_HashCode *hash,
1358{
1359 GNUNET_assert ((room) && (hash) && (entry));
1360
1361 require_message_from_room (room, &(entry->message->body.merge.epochs[0]));
1362 require_message_from_room (room, &(entry->message->body.merge.epochs[1]));
1363}
1364
1365
1366static void
1368 const struct GNUNET_HashCode *hash,
1370{
1371 struct GNUNET_MESSENGER_Message *private_message;
1372
1373 GNUNET_assert ((room) && (hash) && (entry));
1374
1375 private_message = copy_message (entry->message);
1376
1377 if (! private_message)
1378 return;
1379
1381 private_message, get_handle_key (room->handle)))
1382 {
1383 destroy_message (private_message);
1384 private_message = NULL;
1385 }
1386
1387 if (! private_message)
1388 return;
1389
1390 destroy_message (entry->message);
1391
1392 entry->recipient = get_handle_contact (room->handle, get_room_key (room));
1393
1394 entry->message = private_message;
1396
1397 if ((entry->sender) && (entry->recipient))
1398 handle_message (room, hash, entry);
1399}
1400
1401
1402static void
1404 const struct GNUNET_HashCode *hash,
1406{
1407 struct GNUNET_TIME_Relative delay;
1408
1409 GNUNET_assert ((room) && (hash) && (entry));
1410
1411 delay = get_message_timeout (entry->message);
1412
1413 delay_room_action (room, hash, delay);
1414}
1415
1416
1417static void
1419 const struct GNUNET_HashCode *hash,
1421{
1422 const struct GNUNET_HashCode *original_hash;
1423 struct GNUNET_MESSENGER_RoomMessageEntry *original;
1424 struct GNUNET_MESSENGER_Message *original_message;
1425
1426 GNUNET_assert ((room) && (hash) && (entry));
1427
1428 if (! (GNUNET_MESSENGER_FLAG_SENT & entry->flags))
1429 return;
1430
1431 original_hash = &(entry->message->body.transcript.hash);
1432
1433 original = GNUNET_CONTAINER_multihashmap_get (room->messages, original_hash);
1434
1435 if (original)
1436 goto read_transcript;
1437
1439
1440 if (! original)
1441 return;
1442
1443 original->sender = NULL;
1444 original->recipient = NULL;
1445
1446 original->message = NULL;
1448 original->completed = GNUNET_NO;
1449
1451 room->messages, original_hash, original,
1453 {
1454 GNUNET_free (original);
1455 return;
1456 }
1457
1458read_transcript:
1459 original_message = copy_message (entry->message);
1460
1461 if (! original_message)
1462 return;
1463
1464 if (GNUNET_YES != read_transcript_message (original_message))
1465 {
1466 destroy_message (original_message);
1467 return;
1468 }
1469
1470 {
1471 struct GNUNET_MESSENGER_ContactStore *store;
1472
1473 store = get_handle_contact_store (room->handle);
1474 original->recipient = get_store_contact (
1475 store, NULL,
1476 &(entry->message->body.transcript.key));
1477 }
1478
1479 if (original->message)
1480 {
1483
1484 copy_message_header (original_message, &(original->message->header));
1485 destroy_message (original->message);
1486 }
1487
1488 original->message = original_message;
1489
1490 link_room_message (room, hash, original_hash);
1491 link_room_message (room, original_hash, hash);
1492
1493 if ((original->sender) && (original->recipient))
1494 {
1496 handle_message (room, original_hash, original);
1497 }
1498}
1499
1500
1501static void
1503 const struct GNUNET_HashCode *hash,
1505{
1506 struct GNUNET_MESSENGER_Epoch *epoch;
1507 const union GNUNET_MESSENGER_EpochNonce *nonce;
1508 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
1509 enum GNUNET_GenericReturnValue sent;
1510
1511 GNUNET_assert ((room) && (hash) && (entry));
1512
1513 epoch = get_room_availble_epoch_entry (room, hash, entry, NULL);
1514
1515 if (! epoch)
1516 return;
1517
1518 nonce = &(entry->message->body.announcement.nonce);
1519
1521 epoch->nonces, &(nonce->hash)))
1522 {
1524 "Unsafe announcement: Nonce (%s) has already been used in this epoch! [%s]\n",
1525 GNUNET_sh2s (&(nonce->hash)), GNUNET_h2s (&(epoch->hash)));
1526 return;
1527 }
1528
1529 GNUNET_CONTAINER_multishortmap_put (epoch->nonces, &(nonce->hash), NULL,
1531
1532 identifier = &(entry->message->body.announcement.identifier);
1533
1534 if (GNUNET_MESSENGER_FLAG_SENT & entry->flags)
1535 sent = GNUNET_YES;
1536 else
1537 sent = GNUNET_NO;
1538
1539 if (identifier->code.group_bit)
1540 {
1541 struct GNUNET_MESSENGER_EpochGroup *group;
1542
1544
1545 if (! group)
1546 return;
1547
1549 group,
1550 entry->message,
1551 hash,
1552 entry->sender,
1553 sent);
1554 }
1555 else
1556 {
1557 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
1558
1560
1561 if (! announcement)
1562 return;
1563
1565 announcement,
1566 entry->message,
1567 hash,
1568 entry->sender,
1569 sent);
1570 }
1571}
1572
1573
1574static void
1576 const struct GNUNET_HashCode *hash,
1578{
1579 struct GNUNET_MESSENGER_Epoch *epoch;
1580 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
1581 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
1582
1583 GNUNET_assert ((room) && (hash) && (entry));
1584
1585 epoch = get_room_availble_epoch_entry (room, hash, entry, NULL);
1586
1587 if (! epoch)
1588 return;
1589
1591
1593 return;
1594
1596
1597 if (! announcement)
1598 return;
1599
1601 announcement, entry->message, hash);
1602}
1603
1604
1605static void
1607 const struct GNUNET_HashCode *hash,
1609{
1610 const struct GNUNET_MESSENGER_RoomMessageEntry *event_entry;
1611 struct GNUNET_MESSENGER_Epoch *epoch;
1612 const struct GNUNET_MESSENGER_Contact *contact;
1613 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
1614 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
1616
1617 GNUNET_assert ((room) && (hash) && (entry));
1618
1619 event_entry = GNUNET_CONTAINER_multihashmap_get (
1620 room->messages, &(entry->message->body.appeal.event));
1621
1622 if (! event_entry)
1623 return;
1624
1626 return;
1627
1629 room, hash, event_entry, entry->sender);
1630
1631 if (! epoch)
1632 return;
1633
1634 contact = get_handle_contact (room->handle, get_room_key (room));
1635
1636 if (! contact)
1637 return;
1638
1639 if (GNUNET_YES != is_epoch_member (epoch, contact))
1640 return;
1641
1642 identifier = &(event_entry->message->body.announcement.identifier);
1643
1644 if (identifier->code.group_bit)
1645 return;
1646
1647 announcement = get_epoch_announcement (epoch, identifier, GNUNET_NO);
1648
1649 if (! announcement)
1650 return;
1651
1652 if (GNUNET_YES == is_epoch_announcement_member (announcement, entry->sender))
1653 {
1655 "Appealing contact is already member of epoch announcement! [%s]\n",
1656 GNUNET_sh2s (&(identifier->hash)));
1657 return;
1658 }
1659
1660 if (contact == event_entry->sender)
1662 else
1663 {
1665
1667 return;
1668
1670 timeout, get_epoch_position_factor (epoch, contact, NULL));
1671 }
1672
1673 if (GNUNET_MESSENGER_FLAG_SENT & entry->flags)
1674 set_epoch_announcement_appeal (announcement,
1675 get_message_timeout (entry->message));
1676
1677 delay_room_action (room, hash, timeout);
1678}
1679
1680
1681static void
1683 const struct GNUNET_HashCode *hash,
1685{
1686 const struct GNUNET_MESSENGER_RoomMessageEntry *event_entry;
1687 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
1688 struct GNUNET_MESSENGER_Epoch *epoch;
1689
1690 GNUNET_assert ((room) && (hash) && (entry));
1691
1692 if (! (GNUNET_MESSENGER_FLAG_RECENT & entry->flags))
1693 return;
1694
1695 event_entry = GNUNET_CONTAINER_multihashmap_get (
1696 room->messages, &(entry->message->body.access.event));
1697
1698 if (! event_entry)
1699 return;
1700
1701 switch (event_entry->message->header.kind)
1702 {
1704 {
1705 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
1706 enum GNUNET_GenericReturnValue appealed;
1707
1708 if (GNUNET_MESSENGER_FLAG_SENT & event_entry->flags)
1709 appealed = GNUNET_YES;
1710 else
1711 appealed = GNUNET_NO;
1712
1713 event_entry = GNUNET_CONTAINER_multihashmap_get (room->messages,
1714 &(event_entry->message->
1715 body.appeal.event));
1716
1717 if (! event_entry)
1718 return;
1719
1721 kind)
1722 return;
1723
1724 identifier = &(event_entry->message->body.announcement.identifier);
1725 epoch = get_room_availble_epoch_entry (room, hash, event_entry, entry->
1726 sender);
1727
1728 if (! epoch)
1729 return;
1730
1732
1733 if (! announcement)
1734 return;
1735
1736 if (GNUNET_YES != appealed)
1737 {
1738 const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key;
1739
1740 shared_key = get_epoch_announcement_key (announcement);
1741
1742 if ((shared_key) && (GNUNET_OK == verify_message_by_key (entry->message,
1743 shared_key)))
1744 cancel_room_action (room, &(entry->message->body.access.event));
1745
1746 return;
1747 }
1748
1749 handle_epoch_announcement_access (announcement, entry->message, hash);
1750 break;
1751 }
1753 {
1754 struct GNUNET_MESSENGER_EpochGroup *group;
1755 const struct GNUNET_HashCode *partner_hash;
1756 const struct GNUNET_MESSENGER_RoomMessageEntry *init_entry;
1757
1758 identifier = &(event_entry->message->body.group.identifier);
1759 epoch = get_room_availble_epoch_entry (room, hash, event_entry, entry->
1760 sender);
1761
1762 if (! epoch)
1763 return;
1764
1765 if ((epoch->main_announcement) &&
1766 (GNUNET_YES != is_epoch_identifier_upper (identifier, &(epoch->
1767 main_announcement
1768 ->identifier))
1769 ))
1770 return;
1771
1772 if ((epoch->main_group) &&
1773 (GNUNET_YES != is_epoch_identifier_upper (identifier, &(epoch->
1774 main_group->
1775 identifier))))
1776 return;
1777
1778 partner_hash = &(event_entry->message->body.group.partner);
1779 init_entry = GNUNET_CONTAINER_multihashmap_get (room->messages,
1780 &(event_entry->message->
1781 body.group.initiator));
1782
1783 if ((! init_entry) || (event_entry->sender != init_entry->sender))
1784 return;
1785
1787 )
1788 return;
1789
1790 event_entry = GNUNET_CONTAINER_multihashmap_get (room->messages,
1791 partner_hash);
1792
1793 if (! event_entry)
1794 return;
1795
1797 kind)
1798 return;
1799
1800 if (! (GNUNET_MESSENGER_FLAG_SENT & event_entry->flags))
1801 return;
1802
1803 {
1804 struct GNUNET_HashCode main_hash;
1805 enum GNUNET_GenericReturnValue has_hash;
1806
1807 if (epoch->main_group)
1808 has_hash = get_epoch_group_member_hash (epoch->main_group, &main_hash,
1809 GNUNET_NO);
1810 else if (epoch->main_announcement)
1811 has_hash = get_epoch_announcement_member_hash (epoch->
1812 main_announcement, &
1813 main_hash, GNUNET_NO);
1814 else
1815 return;
1816
1817 if ((GNUNET_OK != has_hash) ||
1818 (0 != GNUNET_CRYPTO_hash_cmp (&main_hash, partner_hash)))
1819 return;
1820 }
1821
1822 group = get_epoch_group (epoch, identifier, GNUNET_NO);
1823
1824 if (! group)
1825 return;
1826
1827 handle_epoch_group_access (group, entry->message, hash);
1828 break;
1829 }
1830 default:
1831 return;
1832 }
1833}
1834
1835
1836static void
1838 const struct GNUNET_HashCode *hash,
1840{
1841 struct GNUNET_MESSENGER_Epoch *epoch;
1842 const union GNUNET_MESSENGER_EpochNonce *nonce;
1843 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
1844
1845 GNUNET_assert ((room) && (hash) && (entry));
1846
1847 epoch = get_room_availble_epoch_entry (room, hash, entry, entry->sender);
1848
1849 if (! epoch)
1850 return;
1851
1852 nonce = &(entry->message->body.announcement.nonce);
1853
1855 nonce->hash)))
1856 {
1858 "Unsafe revolution: Nonce (%s) has already been used in this epoch! [%s]\n",
1859 GNUNET_sh2s (&(nonce->hash)), GNUNET_h2s (&(epoch->hash)));
1860 return;
1861 }
1862
1863 GNUNET_CONTAINER_multishortmap_put (epoch->nonces, &(nonce->hash), NULL,
1865
1866 identifier = &(entry->message->body.revolution.identifier);
1867
1868 if (identifier->code.group_bit)
1869 {
1870 struct GNUNET_MESSENGER_EpochGroup *group;
1872
1873 group = get_epoch_group (epoch, identifier, GNUNET_YES);
1874
1875 if (! group)
1876 return;
1877
1878 key = get_epoch_group_key (group);
1879
1880 if (! key)
1881 return;
1882
1883 if (GNUNET_OK != verify_message_by_key (entry->message, key))
1884 return;
1885
1886 invalidate_epoch_group (group, NULL);
1887 }
1888 else
1889 {
1890 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
1892
1893 announcement = get_epoch_announcement (epoch, identifier, GNUNET_YES);
1894
1895 if (! announcement)
1896 return;
1897
1898 key = get_epoch_announcement_key (announcement);
1899
1900 if (! key)
1901 return;
1902
1903 if (GNUNET_OK != verify_message_by_key (entry->message, key))
1904 return;
1905
1906 invalidate_epoch_announcement (announcement, NULL);
1907 }
1908}
1909
1910
1911static void
1913 const struct GNUNET_HashCode *hash,
1915{
1916 struct GNUNET_MESSENGER_Epoch *epoch;
1917 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
1918 struct GNUNET_MESSENGER_EpochGroup *group;
1919
1920 GNUNET_assert ((room) && (hash) && (entry));
1921
1922 epoch = get_room_availble_epoch_entry (room, hash, entry, entry->sender);
1923
1924 if (! epoch)
1925 return;
1926
1927 identifier = &(entry->message->body.group.identifier);
1929
1930 if (! (GNUNET_MESSENGER_FLAG_SENT & entry->flags))
1931 return;
1932
1934
1935 set_epoch_group_key (group, NULL, GNUNET_YES);
1936 send_epoch_group_access (group, hash);
1937}
1938
1939
1940static void
1942 const struct GNUNET_HashCode *hash,
1944{
1945 struct GNUNET_MESSENGER_Epoch *epoch;
1946 const union GNUNET_MESSENGER_EpochIdentifier *identifier;
1947 struct GNUNET_MESSENGER_EpochGroup *auth_group;
1948 const struct GNUNET_CRYPTO_SymmetricSessionKey *group_key;
1949 const struct GNUNET_MESSENGER_RoomMessageEntry *event_entry;
1950 struct GNUNET_CRYPTO_SymmetricSessionKey shared_key;
1951
1952 GNUNET_assert ((room) && (hash) && (entry));
1953
1954 epoch = get_room_availble_epoch_entry (room, hash, entry, entry->sender);
1955
1956 if (! epoch)
1957 return;
1958
1959 identifier = &(entry->message->body.authorization.identifier);
1960 auth_group = get_epoch_group (epoch, identifier, GNUNET_NO);
1961
1962 if (! auth_group)
1963 return;
1964
1965 group_key = get_epoch_group_key (auth_group);
1966
1967 if (! group_key)
1968 return;
1969
1970 event_entry = GNUNET_CONTAINER_multihashmap_get (
1971 room->messages, &(entry->message->body.authorization.event));
1972
1973 if (! event_entry)
1974 return;
1975
1976 switch (event_entry->message->header.kind)
1977 {
1979 {
1980 identifier = &(event_entry->message->body.announcement.identifier);
1981
1982 if (0 == GNUNET_memcmp (identifier, &(auth_group->identifier)))
1983 return;
1984
1985 if (identifier->code.group_bit)
1986 {
1987 struct GNUNET_MESSENGER_EpochGroup *group;
1988 uint32_t next_level;
1989
1991 identifier, &(auth_group->identifier)))
1992 return;
1993
1995
1996 if (! group)
1997 return;
1998
1999 next_level = get_epoch_group_level (auth_group) + 1;
2000
2001 if (next_level != get_epoch_group_level (group))
2002 return;
2003
2005 entry->message, group_key, &shared_key))
2006 return;
2007
2008 if (get_epoch_group_key (group))
2009 return;
2010
2013 }
2014 else
2015 {
2016 struct GNUNET_MESSENGER_EpochAnnouncement *announcement;
2017
2019
2020 if (! announcement)
2021 return;
2022
2024 entry->message, group_key, &shared_key))
2025 return;
2026
2028 event_entry->message, &shared_key))
2029 return;
2030
2031 if (get_epoch_announcement_key (announcement))
2032 return;
2033
2035 send_epoch_announcement (announcement);
2036 }
2037
2038 break;
2039 }
2041 {
2042 struct GNUNET_MESSENGER_EpochGroup *group;
2043 const struct GNUNET_HashCode *announcement_hash;
2044 uint32_t next_level;
2045
2046 identifier = &(event_entry->message->body.group.identifier);
2047
2048 if ((0 == GNUNET_memcmp (identifier, &(auth_group->identifier))) ||
2049 (GNUNET_YES != is_epoch_identifier_upper (identifier, &(auth_group->
2050 identifier))))
2051 return;
2052
2053 if (! (identifier->code.group_bit))
2054 return;
2055
2056 group = get_epoch_group (epoch, identifier, GNUNET_NO);
2057
2058 if (! group)
2059 return;
2060
2061 next_level = get_epoch_group_level (auth_group) + 1;
2062
2063 if (next_level != get_epoch_group_level (group))
2064 return;
2065
2066 if (event_entry->sender == entry->sender)
2067 announcement_hash = &(event_entry->message->body.group.initiator);
2068 else
2069 announcement_hash = &(event_entry->message->body.group.partner);
2070
2071 event_entry = GNUNET_CONTAINER_multihashmap_get (room->messages,
2072 announcement_hash);
2073
2074 if (! event_entry)
2075 return;
2076
2078 kind)
2079 return;
2080
2081 identifier = &(event_entry->message->body.announcement.identifier);
2082
2083 if (0 != GNUNET_memcmp (identifier, &(auth_group->identifier)))
2084 return;
2085
2087 entry->message, group_key, &shared_key))
2088 return;
2089
2090 if (get_epoch_group_key (group))
2091 return;
2092
2093 set_epoch_group_key (group, &shared_key, GNUNET_YES);
2095 break;
2096 }
2097 default:
2098 break;
2099 }
2100}
2101
2102
2103static void
2105 const struct GNUNET_HashCode *hash,
2107{
2108 GNUNET_assert ((room) && (hash) && (entry));
2109
2110 switch (entry->message->header.kind)
2111 {
2113 handle_join_message (room, hash, entry);
2114 break;
2116 handle_leave_message (room, hash, entry);
2117 break;
2119 handle_name_message (room, hash, entry);
2120 break;
2122 handle_key_message (room, hash, entry);
2123 break;
2125 handle_id_message (room, hash, entry);
2126 break;
2128 handle_miss_message (room, hash, entry);
2129 break;
2131 handle_merge_message (room, hash, entry);
2132 break;
2134 handle_private_message (room, hash, entry);
2135 break;
2137 handle_delete_message (room, hash, entry);
2138 break;
2140 handle_transcript_message (room, hash, entry);
2141 break;
2143 handle_announcement_message (room, hash, entry);
2144 break;
2146 handle_secret_message (room, hash, entry);
2147 break;
2149 handle_appeal_message (room, hash, entry);
2150 break;
2152 handle_access_message (room, hash, entry);
2153 break;
2155 handle_revolution_message (room, hash, entry);
2156 break;
2158 handle_group_message (room, hash, entry);
2159 break;
2161 handle_authorization_message (room, hash, entry);
2162 break;
2163 default:
2164 break;
2165 }
2166
2167 if (GNUNET_YES == is_epoch_message (entry->message))
2168 {
2169 struct GNUNET_MESSENGER_Epoch *epoch;
2170
2171 epoch = get_room_epoch (room, &(entry->epoch), GNUNET_NO);
2172
2173 if ((! epoch) || (get_epoch_size (epoch)))
2174 return;
2175
2176 reset_epoch_size (epoch);
2177 }
2178
2181}
2182
2183
2184void
2186 struct GNUNET_MESSENGER_Contact *sender,
2187 const struct GNUNET_MESSENGER_Message *message,
2188 const struct GNUNET_HashCode *hash,
2189 const struct GNUNET_HashCode *epoch,
2191{
2193
2194 GNUNET_assert ((room) && (message) && (hash));
2195
2196 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
2197
2198 if (entry)
2199 goto update_entry;
2200
2202
2203 if (! entry)
2204 return;
2205
2206 entry->sender = NULL;
2207 entry->recipient = NULL;
2208
2209 entry->message = NULL;
2210
2211 GNUNET_memcpy (&(entry->epoch), epoch, sizeof (entry->epoch));
2212
2214 entry->completed = GNUNET_NO;
2215
2217 room->messages, hash, entry,
2219 {
2220 GNUNET_free (entry);
2221 return;
2222 }
2223
2224update_entry:
2225 entry->sender = sender;
2226 entry->flags = flags;
2227
2228 if (entry->message)
2229 {
2232
2234 }
2235 else
2236 entry->message = copy_message (message);
2237
2238 entry->completed = GNUNET_YES;
2239 handle_message (room, hash, entry);
2240}
2241
2242
2245 const struct GNUNET_HashCode *hash)
2246{
2248
2249 GNUNET_assert ((room) && (hash));
2250
2251 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
2252
2253 if ((! entry) || (! entry->message))
2254 return GNUNET_SYSERR;
2255
2257 return GNUNET_NO;
2258
2260 handle_message (room, hash, entry);
2261 return GNUNET_YES;
2262}
2263
2264
2267 const struct GNUNET_HashCode *hash,
2269 enum GNUNET_GenericReturnValue update)
2270{
2272 struct GNUNET_MESSENGER_Message *secret_message;
2273
2274 GNUNET_assert ((room) && (hash) && (key));
2275
2276 entry = GNUNET_CONTAINER_multihashmap_get (room->messages, hash);
2277
2278 if ((! entry) || (! entry->message) ||
2280 return GNUNET_SYSERR;
2281
2282 secret_message = copy_message (entry->message);
2283
2284 if (! secret_message)
2285 return GNUNET_NO;
2286
2287 if (GNUNET_YES != decrypt_secret_message (secret_message, key))
2288 {
2289 destroy_message (secret_message);
2290 secret_message = NULL;
2291 }
2292
2293 if (! secret_message)
2294 return GNUNET_NO;
2295
2296 destroy_message (entry->message);
2297
2298 entry->message = secret_message;
2300
2301 if (GNUNET_YES == update)
2303
2304 if (entry->sender)
2305 handle_message (room, hash, entry);
2306
2307 return GNUNET_YES;
2308}
2309
2310
2311void
2313 const struct GNUNET_HashCode *hash,
2314 const struct GNUNET_HashCode *epoch)
2315{
2316 GNUNET_assert ((room) && (hash) && (epoch));
2317
2318 GNUNET_memcpy (&(room->last_message), hash, sizeof(room->last_message));
2319
2320 if (epoch)
2321 GNUNET_memcpy (&(room->last_epoch), epoch, sizeof(room->last_epoch));
2322}
2323
2324
2325void
2327 struct GNUNET_HashCode *hash)
2328{
2329 GNUNET_assert (room);
2330
2331 GNUNET_memcpy (hash, &(room->last_message), sizeof(room->last_message));
2332}
2333
2334
2341
2342static enum GNUNET_GenericReturnValue
2344 const struct GNUNET_ShortHashCode *key,
2345 void *value)
2346{
2348 struct GNUNET_MESSENGER_Contact *contact;
2349
2350 GNUNET_assert ((cls) && (value));
2351
2352 call = cls;
2353 contact = value;
2354
2355 return call->callback (call->cls, call->room, contact);
2356}
2357
2358
2359int
2362 void *cls)
2363{
2365
2367
2368 if (! callback)
2370
2371 call.room = room;
2372 call.callback = callback;
2373 call.cls = cls;
2374
2376
2379 &call);
2380}
2381
2382
2388
2389static enum GNUNET_GenericReturnValue
2391 const struct GNUNET_ShortHashCode *key,
2392 void *value)
2393{
2394 struct GNUNET_MESSENGER_MemberFind *find;
2395 struct GNUNET_MESSENGER_Contact *contact;
2396
2397 GNUNET_assert ((cls) && (value));
2398
2399 find = cls;
2400 contact = value;
2401
2402 if (contact == find->contact)
2403 {
2404 find->result = GNUNET_YES;
2405 return GNUNET_NO;
2406 }
2407
2408 return GNUNET_YES;
2409}
2410
2411
2414 const struct GNUNET_MESSENGER_Contact *contact)
2415{
2416 struct GNUNET_MESSENGER_MemberFind find;
2417
2418 GNUNET_assert (room);
2419
2420 find.contact = contact;
2421 find.result = GNUNET_NO;
2422
2424 room->members, iterate_find_member, &find);
2425
2426 return find.result;
2427}
2428
2429
2430static enum GNUNET_GenericReturnValue
2432 const struct GNUNET_HashCode *key,
2433 void *value)
2434{
2435 const struct GNUNET_HashCode **result;
2436 struct GNUNET_HashCode *hash;
2437
2438 GNUNET_assert ((cls) && (value));
2439
2440 result = cls;
2441 hash = value;
2442
2443 if (0 == GNUNET_CRYPTO_hash_cmp (hash, *result))
2444 {
2445 *result = NULL;
2446 return GNUNET_NO;
2447 }
2448
2449 return GNUNET_YES;
2450}
2451
2452
2453void
2455 const struct GNUNET_HashCode *hash,
2456 const struct GNUNET_HashCode *other)
2457{
2458 const struct GNUNET_HashCode **result;
2459 struct GNUNET_HashCode *value;
2460
2461 GNUNET_assert ((room) && (hash) && (other));
2462
2463 result = &other;
2466
2467 if (! *result)
2468 return;
2469
2470 value = GNUNET_memdup (other, sizeof(struct GNUNET_HashCode));
2471 if (! value)
2472 return;
2473
2475 room->links, hash, value,
2478}
2479
2480
2487
2488
2489static enum GNUNET_GenericReturnValue
2491 const struct GNUNET_HashCode *key,
2492 void *value)
2493{
2494 struct GNUNET_HashCode **linked;
2495 struct GNUNET_HashCode *hash;
2496
2497 GNUNET_assert ((cls) && (value));
2498
2499 linked = cls;
2500 hash = value;
2501
2502 if (0 != GNUNET_CRYPTO_hash_cmp (*linked, hash))
2503 return GNUNET_YES;
2504
2505 *linked = hash;
2506 return GNUNET_NO;
2507}
2508
2509
2510static enum GNUNET_GenericReturnValue
2512 const struct GNUNET_HashCode *key,
2513 void *value)
2514{
2516 struct GNUNET_HashCode *hash;
2517 struct GNUNET_HashCode key_value;
2518 struct GNUNET_HashCode *linked;
2519
2520 GNUNET_assert ((cls) && (key) && (value));
2521
2522 info = cls;
2523 hash = value;
2524
2525 GNUNET_memcpy (&key_value, key, sizeof (key_value));
2526
2527 linked = &key_value;
2529 clear_linked_hash, &linked);
2530
2531 if ((linked != &key_value) &&
2533 hash, linked)))
2534 GNUNET_free (linked);
2535
2536 if (info->deletion)
2537 info->deletion (info->room, hash, info->delay);
2538
2539 GNUNET_free (hash);
2540 return GNUNET_YES;
2541}
2542
2543
2544void
2546 const struct GNUNET_HashCode *hash,
2547 const struct GNUNET_TIME_Relative delay,
2549{
2551
2552 GNUNET_assert ((room) && (hash));
2553
2554 info.room = room;
2555 info.delay = delay;
2556 info.deletion = deletion;
2557
2561}
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
Definition gnunet-arm.c:118
static struct GNUNET_CONVERSATION_Call * call
Call handle (for active outgoing call).
struct GNUNET_HashCode key
The key used in the DHT.
static pa_context * context
Pulseaudio context.
static char * value
Value of the record to add/remove.
static int result
Global testing status.
#define info
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition gnunet-vpn.c:35
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
API to schedule computations using continuation passing style.
Functions related to time.
int GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
Compare function for HashCodes, producing a total ordering of all hashcodes.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
int GNUNET_CONTAINER_multihashmap_remove_all(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Remove all entries for the given key from the map.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
int GNUNET_CONTAINER_multishortmap_contains_value(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Check if the map contains the given value under the given key.
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
unsigned int GNUNET_CONTAINER_multihashmap_clear(struct GNUNET_CONTAINER_MultiHashMap *map)
Remove all entries from the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
int GNUNET_CONTAINER_multishortmap_remove(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Remove the given key-value pair from the map.
int GNUNET_CONTAINER_multishortmap_contains(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE
If a value with the given key exists, replace it.
#define GNUNET_is_zero(a)
Check that memory in a is all zeros.
#define GNUNET_log(kind,...)
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
@ GNUNET_SCHEDULER_PRIORITY_HIGH
Run with high priority (important requests).
@ GNUNET_SCHEDULER_PRIORITY_BACKGROUND
Run as background job (higher than idle, lower than default).
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
@ GNUNET_SYSERR
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_memdup(buf, size)
Allocate and initialize a block of memory.
GNUNET_MESSENGER_MessageKind
Enum for the different supported kinds of messages.
GNUNET_MESSENGER_MessageFlags
Enum for the different supported flags used by message handling.
enum GNUNET_GenericReturnValue(* GNUNET_MESSENGER_MemberCallback)(void *cls, struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *contact)
Method called for each member in a room during iteration.
@ GNUNET_MESSENGER_KIND_MISS
The miss kind.
@ GNUNET_MESSENGER_KIND_AUTHORIZATION
The authorization kind.
@ GNUNET_MESSENGER_KIND_ANNOUNCEMENT
The announcement kind.
@ GNUNET_MESSENGER_KIND_PRIVATE
The private kind.
@ GNUNET_MESSENGER_KIND_APPEAL
The appeal kind.
@ GNUNET_MESSENGER_KIND_NAME
The name kind.
@ GNUNET_MESSENGER_KIND_ACCESS
The access kind.
@ GNUNET_MESSENGER_KIND_LEAVE
The leave kind.
@ GNUNET_MESSENGER_KIND_REVOLUTION
The revolution kind.
@ GNUNET_MESSENGER_KIND_TRANSCRIPT
The transcript kind.
@ GNUNET_MESSENGER_KIND_KEY
The key kind.
@ GNUNET_MESSENGER_KIND_SECRET
The secret kind.
@ GNUNET_MESSENGER_KIND_JOIN
The join kind.
@ GNUNET_MESSENGER_KIND_DELETION
The deletion kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
@ GNUNET_MESSENGER_KIND_GROUP
The group kind.
@ GNUNET_MESSENGER_KIND_ID
The id kind.
@ GNUNET_MESSENGER_FLAG_SECRET
The secret flag.
@ GNUNET_MESSENGER_FLAG_PRIVATE
The private flag.
@ GNUNET_MESSENGER_FLAG_SENT
The sent flag.
@ GNUNET_MESSENGER_FLAG_UPDATE
The update flag.
@ GNUNET_MESSENGER_FLAG_NONE
The none flag.
@ GNUNET_MESSENGER_FLAG_DELETE
The delete flag.
@ GNUNET_MESSENGER_FLAG_RECENT
The recent flag.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition scheduler.c:980
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed_with_priority(struct GNUNET_TIME_Relative delay, enum GNUNET_SCHEDULER_Priority priority, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition scheduler.c:1207
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified priority.
Definition scheduler.c:1231
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero_(void)
Return relative time of 0ms.
Definition time.c:133
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_millisecond_(void)
Return relative time of 1ms.
Definition time.c:160
bool GNUNET_TIME_relative_is_zero(struct GNUNET_TIME_Relative rel)
Test if rel is zero.
Definition time.c:664
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply_double(struct GNUNET_TIME_Relative rel, double factor)
Multiply relative time by a given factor.
Definition time.c:506
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition time.c:486
void enqueue_message_to_room(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *epoch, struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Message *transcript, enum GNUNET_GenericReturnValue sync)
Enqueus a message and its optional transcript for sending it to a given room and epoch.
void request_message_from_room(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Requests a specific message from a given room which can be identified by its hash.
enum GNUNET_GenericReturnValue decrease_contact_rc(struct GNUNET_MESSENGER_Contact *contact)
Decreases the reference counter if possible (can not underflow!) of a given contact and returns GNUNE...
const struct GNUNET_CRYPTO_PublicKey * get_contact_key(const struct GNUNET_MESSENGER_Contact *contact)
Returns the public key of a given contact.
void set_contact_name(struct GNUNET_MESSENGER_Contact *contact, const char *name)
Changes the current name of a given contact by copying it from the parameter name.
void increase_contact_rc(struct GNUNET_MESSENGER_Contact *contact)
Increases the reference counter of a given contact which is zero as default.
void get_context_from_member(const struct GNUNET_HashCode *key, const struct GNUNET_ShortHashCode *id, struct GNUNET_HashCode *context)
Calculates the context hash of a member in a room and returns it.
void update_store_contact(struct GNUNET_MESSENGER_ContactStore *store, struct GNUNET_MESSENGER_Contact *contact, const struct GNUNET_HashCode *context, const struct GNUNET_HashCode *next_context, const struct GNUNET_CRYPTO_PublicKey *pubkey)
Moves a contact from the store to another location matching a given public key and member context.
struct GNUNET_MESSENGER_Contact * get_store_contact(struct GNUNET_MESSENGER_ContactStore *store, const struct GNUNET_HashCode *context, const struct GNUNET_CRYPTO_PublicKey *pubkey)
Returns a contact using a specific public key.
void invalidate_epoch_keys_by_member(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact)
Invalidates all announced epoch and group keys by a specific contact inside a given epoch.
uint32_t get_epoch_size(const struct GNUNET_MESSENGER_Epoch *epoch)
Returns the amount of members by a given epoch or zero as long as it's not fully initialized yet.
struct GNUNET_MESSENGER_Epoch * create_new_epoch(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Creates and allocates a new epoch in a given room which can be identified by a specific hash.
struct GNUNET_MESSENGER_Epoch * create_epoch(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Creates and allocates an epoch in a given room which can be identified by a specific hash.
struct GNUNET_MESSENGER_EpochGroup * get_epoch_group(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
Returns the epoch group of a given epoch using a specific unique identifier or NULL.
enum GNUNET_GenericReturnValue delay_epoch_message_for_its_members(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_HashCode *hash)
Adds a message with a given hash to a list that can be delayed in processing for the members of a spe...
enum GNUNET_GenericReturnValue is_epoch_member(const struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is member of a given epoch.
void set_epoch_proposal_group(struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_HashCode *hash)
Sets the current group of proposal for a given epoch to the group specified by a message identified b...
void destroy_epoch(struct GNUNET_MESSENGER_Epoch *epoch)
Destroys an epoch and frees its memory fully from the client API.
struct GNUNET_MESSENGER_EpochAnnouncement * get_epoch_announcement(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
Returns the epoch announcement of a given epoch using a specific unique identifier or NULL.
void reset_epoch_size(struct GNUNET_MESSENGER_Epoch *epoch)
Resets the amount of members by a given epoch to recalculate the exact amount.
double get_epoch_position_factor(const struct GNUNET_MESSENGER_Epoch *epoch, const struct GNUNET_MESSENGER_Contact *contact, const struct GNUNET_MESSENGER_EpochMembership *membership)
Returns a relative member positon of a specific contact inside a given epoch in relation to its list ...
enum GNUNET_GenericReturnValue send_epoch_announcement_access(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *event)
Tries to send an access message by the client responding to a previous event in regards to a given ep...
enum GNUNET_GenericReturnValue send_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Tries to send an announcement message by the client for a given epoch announcement using its secret k...
enum GNUNET_GenericReturnValue get_epoch_announcement_member_hash(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue other)
Provides an announcement hash of a member from a given epoch announcement.
void set_epoch_announcement_appeal(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, struct GNUNET_TIME_Relative timeout)
Sets a specified timeout for a given epoch announcement of the client for its own appeal of the annou...
struct GNUNET_MESSENGER_EpochAnnouncement * create_epoch_announcement(struct GNUNET_MESSENGER_Epoch *epoch, const union GNUNET_MESSENGER_EpochIdentifier *identifier, enum GNUNET_GenericReturnValue valid)
Creates and allocates a new epoch announcement for a given epoch using a specific announcement identi...
const struct GNUNET_CRYPTO_SymmetricSessionKey * get_epoch_announcement_key(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Returns the secret key of a given epoch announcement or NULL.
void set_epoch_announcement_key(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, enum GNUNET_GenericReturnValue write_record)
Sets the secret key of a given epoch announcement to a shared key.
enum GNUNET_GenericReturnValue revoke_epoch_announcement_member(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Contact *contact)
Revokes an announcement message with its hash from a given epoch announcement removing the caused con...
void destroy_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement)
Destroys a given epoch announcement and frees its resources.
enum GNUNET_GenericReturnValue is_epoch_announcement_member(const struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
Returns whether a specific contact is confirmed member of a given epoch announcement.
void handle_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch announcement as first ...
void invalidate_epoch_announcement(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Contact *contact)
Invalidates a given epoch announcement by a specific contact.
void handle_epoch_announcement_access(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles an access message with hash from its sender inside a given epoch announcement.
void handle_epoch_announcement_message(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles an encrypted message with hash by a given epoch announcement using its secret key for decrypt...
void handle_epoch_announcement_delay(struct GNUNET_MESSENGER_EpochAnnouncement *announcement, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch announcement as second...
enum GNUNET_GenericReturnValue send_epoch_group_announcement(struct GNUNET_MESSENGER_EpochGroup *group)
Tries to send an announcement message by the client for a given epoch group using its secret key.
void handle_epoch_group_announcement_delay(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch group as second stage ...
void invalidate_epoch_group(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Contact *contact)
Invalidates a given epoch group by a specific contact.
void handle_epoch_group_access(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles an access message with hash from its sender inside a given epoch group.
enum GNUNET_GenericReturnValue send_epoch_group_access(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_HashCode *event)
Tries to send an access message by the client responding to a previous event in regards to a given ep...
uint32_t get_epoch_group_level(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the group level of a given epoch group.
void set_epoch_group_key(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key, enum GNUNET_GenericReturnValue write_record)
Sets the secret key of a given epoch group to a shared key.
void handle_epoch_group_announcement(struct GNUNET_MESSENGER_EpochGroup *group, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Contact *sender, enum GNUNET_GenericReturnValue sent)
Handles an announcement message with hash from its sender inside a given epoch group as first stage.
const struct GNUNET_CRYPTO_SymmetricSessionKey * get_epoch_group_key(const struct GNUNET_MESSENGER_EpochGroup *group)
Returns the secret key of a given epoch group or NULL.
enum GNUNET_GenericReturnValue get_epoch_group_member_hash(const struct GNUNET_MESSENGER_EpochGroup *group, struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue other)
Provides an announcement hash of a member from a given epoch group.
struct GNUNET_MESSENGER_ContactStore * get_handle_contact_store(struct GNUNET_MESSENGER_Handle *handle)
Returns the used contact store of a given handle.
struct GNUNET_MESSENGER_Contact * get_handle_contact(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Returns the contact of a given handle in a room identified by a given key.
const char * get_handle_name(const struct GNUNET_MESSENGER_Handle *handle)
Returns the current name of a given handle or NULL if no valid name was assigned yet.
const struct GNUNET_CRYPTO_PrivateKey * get_handle_key(const struct GNUNET_MESSENGER_Handle *handle)
Returns the private key of a given handle.
const struct GNUNET_CRYPTO_PublicKey * get_handle_pubkey(const struct GNUNET_MESSENGER_Handle *handle)
Returns the public key of a given handle.
void init_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Initializes list of tunnels peer identities as empty list.
struct GNUNET_MESSENGER_ListTunnel * find_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer, size_t *index)
Searches linearly through the list of tunnels peer identities for matching a specific peer identity a...
void clear_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Clears the list of tunnels peer identities.
struct GNUNET_MESSENGER_ListTunnel * remove_from_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, struct GNUNET_MESSENGER_ListTunnel *element)
Removes a specific element from the list of tunnels peer identities and returns the next element in t...
struct GNUNET_TIME_Relative get_message_timeout(const struct GNUNET_MESSENGER_Message *message)
Return the relative timeout of the content from a given message that controls when a delayed handling...
enum GNUNET_GenericReturnValue verify_message_by_key(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Verifies the hmac of a given message body with a specific shared key.
struct GNUNET_MESSENGER_Message * copy_message(const struct GNUNET_MESSENGER_Message *message)
Creates and allocates a copy of a given message.
enum GNUNET_GenericReturnValue extract_authorization_message_key(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key, struct GNUNET_CRYPTO_SymmetricSessionKey *shared_key)
Extracts the shared epoch or group key from an authorization message using a previously exchanged sha...
enum GNUNET_GenericReturnValue is_epoch_message(const struct GNUNET_MESSENGER_Message *message)
Returns whether a certain kind of message from storage contains some specific details that might be r...
enum GNUNET_GenericReturnValue decrypt_message(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_PrivateKey *key)
Decrypts a private message using a given private key and replaces its body and kind with the inner en...
enum GNUNET_GenericReturnValue decrypt_secret_message(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_CRYPTO_SymmetricSessionKey *key)
Decrypts a secret message using a given shared key and replaces its body and kind with the inner encr...
void copy_message_header(struct GNUNET_MESSENGER_Message *message, const struct GNUNET_MESSENGER_MessageHeader *header)
Copy message header details from another message to a given message.
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
enum GNUNET_GenericReturnValue read_transcript_message(struct GNUNET_MESSENGER_Message *message)
Read the original message from a transcript message and replaces its body and kind with the inner enc...
struct GNUNET_MESSENGER_MessageControl * create_message_control(struct GNUNET_MESSENGER_Room *room)
Creates and allocates a new message control for a room of the client API.
void destroy_message_control(struct GNUNET_MESSENGER_MessageControl *control)
Destroys a message control and frees its memory fully from the client API.
struct GNUNET_MESSENGER_Message * create_message_deletion(const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Creates and allocates a new deletion message containing the hash of a message to delete after a speci...
void init_queue_messages(struct GNUNET_MESSENGER_QueueMessages *messages)
Initializes queue of messages as empty queue.
void clear_queue_messages(struct GNUNET_MESSENGER_QueueMessages *messages)
Clears the queue of messages.
static enum GNUNET_GenericReturnValue is_epoch_identifier_upper(const union GNUNET_MESSENGER_EpochIdentifier *identifier, const union GNUNET_MESSENGER_EpochIdentifier *other)
static void handle_name_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue iterate_room_request(void *cls, const struct GNUNET_HashCode *key, void *value)
enum GNUNET_GenericReturnValue find_room_member(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *contact)
Checks through all members of a given room if a specific contact is found and returns a result depend...
struct GNUNET_MESSENGER_Epoch * get_room_message_epoch(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns the epoch of a local message with a given hash in a room.
void generate_room_epoch_announcement(struct GNUNET_MESSENGER_Room *room, struct GNUNET_MESSENGER_Epoch *epoch, struct GNUNET_MESSENGER_EpochAnnouncement **announcement)
Generate a new announcement for a given epoch in a room under a random and unique announcement identi...
struct GNUNET_MESSENGER_Room * create_room(struct GNUNET_MESSENGER_Handle *handle, const union GNUNET_MESSENGER_RoomKey *key)
Creates and allocates a new room for a handle with a given key for the client API.
void copy_room_last_message(const struct GNUNET_MESSENGER_Room *room, struct GNUNET_HashCode *hash)
Copies the last message hash of a room into a given hash variable.
static enum GNUNET_GenericReturnValue iterate_destroy_epoch(void *cls, const struct GNUNET_HashCode *key, void *value)
static enum GNUNET_GenericReturnValue delete_linked_hash(void *cls, const struct GNUNET_HashCode *key, void *value)
void cancel_room_actions_by(struct GNUNET_MESSENGER_Room *room, enum GNUNET_MESSENGER_MessageKind kind, const struct GNUNET_HashCode *epoch_hash, const union GNUNET_MESSENGER_EpochIdentifier *identifier, const struct GNUNET_MESSENGER_Contact *contact)
Searches queued actions to handle messages of a specific message kind in a room with any delay and ca...
static void handle_appeal_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_authorization_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_id_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
struct GNUNET_MESSENGER_Contact * get_room_sender(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns a messages sender locally stored from a map for a given hash in a room.
void set_room_sender_id(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_ShortHashCode *id)
Sets the member id of the room's sender to a specific id or NULL.
void handle_room_message(struct GNUNET_MESSENGER_Room *room, struct GNUNET_MESSENGER_Contact *sender, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *epoch, enum GNUNET_MESSENGER_MessageFlags flags)
Handles a message with a given hash in a room for the client API to update members and its informatio...
void link_room_deletion(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay, GNUNET_MESSENGER_RoomLinkDeletion deletion)
Delete all remaining links to a certain message identified by its hash inside a given room and cause ...
void cancel_room_action(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Cancels the delayed handling of a message in a room under a given hash in case it has been queued usi...
enum GNUNET_GenericReturnValue is_room_message_sent(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns whether a message is sent by the handle of the given room itself or another client that is us...
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.
static void handle_secret_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
struct GNUNET_MESSENGER_Epoch * get_room_epoch(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue recent)
Returns the epoch in a given room from a specific epoch hash that represents the exact message the ep...
enum GNUNET_GenericReturnValue update_room_secret_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_SymmetricSessionKey *key, enum GNUNET_GenericReturnValue update)
Updates a secret message with a given hash in a room for the client API trying to decrypt it with the...
static enum GNUNET_GenericReturnValue iterate_destroy_subscription(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
static enum GNUNET_GenericReturnValue iterate_cancel_action_by(void *cls, const struct GNUNET_HashCode *hash, void *value)
static void handle_announcement_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
enum GNUNET_GenericReturnValue update_room_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Updates any message with a given hash in a room for the client API to force handling the message agai...
static void handle_access_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_private_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_room_request_task(void *cls)
enum GNUNET_GenericReturnValue is_room_public(const struct GNUNET_MESSENGER_Room *room)
Returns whether a given room is public or using epoch keys to encrypt private traffic and sync those ...
static void handle_group_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue iterate_destroy_action(void *cls, const struct GNUNET_HashCode *key, void *value)
static enum GNUNET_GenericReturnValue iterate_find_member(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
static void handle_room_delayed_announcement(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry)
void delete_room_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Deletes a message with a given hash inside a room under a specific delay.
void update_room_last_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *epoch)
Updates the last message hash and its epoch of a room for the client API so that new messages can poi...
static struct GNUNET_MESSENGER_Epoch * get_room_availble_epoch_entry(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry, const struct GNUNET_MESSENGER_Contact *contact)
static void handle_revolution_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
enum GNUNET_GenericReturnValue is_room_available(const struct GNUNET_MESSENGER_Room *room)
Checks whether a room is available to send messages.
void callback_room_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Executes the message callback for a given hash in a room.
const union GNUNET_MESSENGER_EpochIdentifier * get_room_message_epoch_identifier(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns the epoch identifier a local message with a given hash is targeting in a room with its specif...
static void handle_join_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_room_action_task(void *cls)
static void handle_leave_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_miss_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_transcript_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue iterate_destroy_link(void *cls, const struct GNUNET_HashCode *key, void *value)
static enum GNUNET_GenericReturnValue is_message_entry_recent(const struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_key_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue iterate_room_epoch_member_invalidation(void *cls, const struct GNUNET_HashCode *key, void *value)
static void handle_delete_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
const struct GNUNET_HashCode * get_room_key(const struct GNUNET_MESSENGER_Room *room)
Return a the hash representation of a given room.
static enum GNUNET_GenericReturnValue iterate_cancel_action(void *cls, const struct GNUNET_HashCode *hash, void *value)
static enum GNUNET_GenericReturnValue iterate_destroy_message(void *cls, const struct GNUNET_HashCode *key, void *value)
struct GNUNET_MESSENGER_Handle * get_room_handle(struct GNUNET_MESSENGER_Room *room)
Returns the messenger handle of the room.
static void handle_room_delayed_appeal(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry)
const struct GNUNET_ShortHashCode * get_room_sender_id(const struct GNUNET_MESSENGER_Room *room)
Returns the member id of the room's sender.
static void handle_room_delayed_deletion(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static void handle_room_delayed_action(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
static void handle_merge_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_RoomMessageEntry *entry)
static enum GNUNET_GenericReturnValue clear_linked_hash(void *cls, const struct GNUNET_HashCode *key, void *value)
static enum GNUNET_GenericReturnValue iterate_local_members(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
void link_room_message(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_HashCode *other)
Links a message identified by its hash inside a given room with another message identified by its oth...
const struct GNUNET_HashCode * get_room_epoch_hash(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns the messages epoch hash that is locally stored for a message of a given hash in a room.
void delay_room_action(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Enqueues delayed handling of a message in a room under a given hash once a specific delay has timed o...
int iterate_room_members(struct GNUNET_MESSENGER_Room *room, GNUNET_MESSENGER_MemberCallback callback, void *cls)
Iterates through all members of a given room to forward each of them to a selected callback with a cu...
void destroy_room(struct GNUNET_MESSENGER_Room *room)
Destroys a room and frees its memory fully from the client API.
static enum GNUNET_GenericReturnValue find_linked_hash(void *cls, const struct GNUNET_HashCode *key, void *value)
struct GNUNET_MESSENGER_Contact * get_room_recipient(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns a messages recipient locally stored from a map for a given hash in a room.
void require_message_from_room(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Requires a specific message in a given room which can be identified by its hash.
void(* GNUNET_MESSENGER_RoomLinkDeletion)(struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Internal representation of the hash map.
A 512-bit hashcode.
struct GNUNET_CRYPTO_SymmetricSessionKey * shared_key
union GNUNET_MESSENGER_EpochIdentifier identifier
struct GNUNET_CRYPTO_SymmetricSessionKey * shared_key
struct GNUNET_MESSENGER_Epoch * epoch
union GNUNET_MESSENGER_EpochIdentifier identifier
struct GNUNET_MESSENGER_Room * room
struct GNUNET_CONTAINER_MultiShortmap * announcements
struct GNUNET_MESSENGER_EpochGroup * main_group
struct GNUNET_CONTAINER_MultiShortmap * nonces
struct GNUNET_MESSENGER_EpochAnnouncement * main_announcement
struct GNUNET_HashCode hash
struct GNUNET_MESSENGER_ListTunnel * head
GNUNET_MESSENGER_MemberCallback callback
struct GNUNET_MESSENGER_Room * room
const struct GNUNET_MESSENGER_Contact * contact
enum GNUNET_GenericReturnValue result
struct GNUNET_HashCode event
The hash of the linked announcement or group message event.
union GNUNET_MESSENGER_EpochNonce nonce
The nonce of the announcement.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
struct GNUNET_HashCode event
The hash of the linked announcement message event.
struct GNUNET_HashCode event
The hash of the linked group message event.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the group in an epoch.
struct GNUNET_MESSENGER_MessageAnnouncement announcement
struct GNUNET_MESSENGER_MessageGroup group
struct GNUNET_MESSENGER_MessageSecret secret
struct GNUNET_MESSENGER_MessageDeletion deletion
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_MESSENGER_MessageId id
struct GNUNET_MESSENGER_MessageName name
struct GNUNET_MESSENGER_MessageLeave leave
struct GNUNET_MESSENGER_MessageTranscript transcript
struct GNUNET_MESSENGER_MessageRevolution revolution
struct GNUNET_MESSENGER_MessageKey key
struct GNUNET_MESSENGER_MessageAccess access
struct GNUNET_MESSENGER_MessageAuthorization authorization
struct GNUNET_MESSENGER_MessageAppeal appeal
struct GNUNET_MESSENGER_MessageMiss miss
struct GNUNET_MESSENGER_MessageJoin join
struct GNUNET_HashCode hash
The hash of the message to delete.
struct GNUNET_HashCode initiator
The hash of the initiator group announcement.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the group in an epoch.
struct GNUNET_HashCode partner
The hash of the partner group announcement.
enum GNUNET_MESSENGER_MessageKind kind
The kind of the message.
struct GNUNET_ShortHashCode sender_id
The senders id inside of the room the message was sent in.
struct GNUNET_ShortHashCode id
The new id which will replace the senders id in a room.
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_CRYPTO_PublicKey key
The senders public key to verify its signatures.
struct GNUNET_CRYPTO_PublicKey key
The new public key which replaces the current senders public key.
struct GNUNET_HashCode epoch
The previous epoch the message was sent from.
struct GNUNET_HashCode epochs[2]
The previous epochs the message was sent from.
struct GNUNET_PeerIdentity peer
The peer identity of a disconnected door to a room.
char * name
The new name which replaces the current senders name.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
union GNUNET_MESSENGER_EpochIdentifier identifier
The identifier of the announcement in an epoch.
struct GNUNET_HashCode hash
The hash of the original message.
struct GNUNET_CRYPTO_PublicKey key
The key from the recipient of the original message.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_HashCode hash
struct GNUNET_MESSENGER_Room * room
const struct GNUNET_HashCode * epoch_hash
const struct GNUNET_MESSENGER_Contact * contact
enum GNUNET_MESSENGER_MessageKind kind
const union GNUNET_MESSENGER_EpochIdentifier * identifier
struct GNUNET_CONTAINER_MultiHashMap * map
struct GNUNET_MESSENGER_Room * room
GNUNET_MESSENGER_RoomLinkDeletion deletion
struct GNUNET_MESSENGER_Contact * recipient
enum GNUNET_MESSENGER_MessageFlags flags
struct GNUNET_MESSENGER_Message * message
struct GNUNET_MESSENGER_Contact * sender
enum GNUNET_GenericReturnValue completed
struct GNUNET_SCHEDULER_Task * task
struct GNUNET_MESSENGER_Message * message
struct GNUNET_CONTAINER_MultiHashMap * links
struct GNUNET_CONTAINER_MultiShortmap * subscriptions
struct GNUNET_MESSENGER_Handle * handle
enum GNUNET_GenericReturnValue opened
union GNUNET_MESSENGER_RoomKey key
enum GNUNET_GenericReturnValue wait_for_sync
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_MessageControl * control
struct GNUNET_SCHEDULER_Task * request_task
struct GNUNET_CONTAINER_MultiHashMap * requests
struct GNUNET_SCHEDULER_Task * queue_task
struct GNUNET_CONTAINER_MultiHashMap * epochs
struct GNUNET_HashCode last_epoch
struct GNUNET_CONTAINER_MultiHashMap * messages
struct GNUNET_CONTAINER_MultiHashMap * actions
enum GNUNET_GenericReturnValue use_handle_name
struct GNUNET_MESSENGER_QueueMessages queue
enum GNUNET_GenericReturnValue joined
struct GNUNET_MESSENGER_ListTunnels entries
struct GNUNET_ShortHashCode * sender_id
struct GNUNET_HashCode last_message
A 256-bit hashcode.
Time for relative time used by GNUnet, in microseconds.
An epoch identifier unifies an epoch identifier code and its 256bit hash representation.
struct GNUNET_MESSENGER_EpochIdentifierCode code
An epoch nonce unifies the epoch nonce data and its 256bit hash representation.
struct GNUNET_ShortHashCode hash
A room key unifies a room key code and its 512bit hash representation.
struct GNUNET_MESSENGER_RoomKeyCode code