GNUnet 0.21.0
gnunet-service-messenger_room.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2024 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 "platform.h"
28
39
40#include "messenger_api_util.h"
41
42static void
44
47 const struct GNUNET_HashCode *key)
48{
49 GNUNET_assert ((handle) && (key));
50
51 struct GNUNET_MESSENGER_SrvRoom *room = GNUNET_new (struct
53
54 room->service = handle->service;
55 room->host = handle;
56 room->port = NULL;
57
58 GNUNET_memcpy (&(room->key), key, sizeof(struct GNUNET_HashCode));
59
61
66
67 init_list_tunnels (&(room->basement));
68 init_message_state (&(room->state));
69
70 room->peer_message = NULL;
71
73 room->idle = NULL;
74
75 if (room->service->dir)
76 load_srv_room (room);
77
80
81 return room;
82}
83
84
87 const struct GNUNET_PeerIdentity *key,
88 void *value)
89{
90 struct GNUNET_MESSENGER_SrvTunnel *tunnel = value;
91 destroy_tunnel (tunnel);
92 return GNUNET_YES;
93}
94
95
96static void
98
99static void
101
102void
104 enum GNUNET_GenericReturnValue deletion)
105{
107
108 if (room->idle)
109 {
111 room->idle = NULL;
112 }
113
115
117 NULL);
119
120 if (! (room->service->dir))
121 goto skip_saving;
122
123 if (GNUNET_YES == deletion)
125 else
127
128skip_saving:
133
137
138 if (room->peer_message)
140
142}
143
144
147{
148 GNUNET_assert (room);
149
150 return &(room->peer_store);
151}
152
153
156{
158
159 return &(room->member_store);
160}
161
162
165{
166 GNUNET_assert (room);
167
168 return &(room->message_store);
169}
170
171
174{
176
177 return &(room->operation_store);
178}
179
180
184 struct GNUNET_MESSENGER_SrvTunnel *tunnel)
185{
186 if ((! handle) || (! is_tunnel_connected (tunnel)))
187 return GNUNET_NO;
188
190 room->service));
191}
192
193
194static void*
196 struct GNUNET_CADET_Channel *channel,
197 const struct GNUNET_PeerIdentity *source)
198{
199 struct GNUNET_MESSENGER_SrvRoom *room = cls;
200
202
203 if ((tunnel) &&
205 tunnel,
207 {
208 destroy_tunnel (tunnel);
209 tunnel = NULL;
210 }
211
212 if (! tunnel)
213 {
215 return NULL;
216 }
217
218 bind_tunnel (tunnel, channel);
219
221 "New tunnel in room (%s) established to peer: %s\n",
223
224 if (GNUNET_YES == send_room_info (room, room->host, tunnel))
225 return tunnel;
226
227 disconnect_tunnel (tunnel);
228
230 tunnel))
231 destroy_tunnel (tunnel);
232
233 return NULL;
234}
235
236
240 struct GNUNET_MESSENGER_Member *member,
241 const struct GNUNET_ShortHashCode *id)
242{
243 GNUNET_assert ((room) && (handle) && (member));
244
245 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Joining room: %s (%s)\n", GNUNET_h2s (
247 GNUNET_sh2s (get_member_id (member)));
248
249 const struct GNUNET_ShortHashCode *member_id = get_member_id (member);
250
252 member_id))
253 return GNUNET_NO;
254
256 if ((! id) || (0 != GNUNET_memcmp (id, member_id)))
258 else
260
261 notify_srv_handle_member_id (handle, room, member_id, reset);
262 return GNUNET_YES;
263}
264
265
269{
270 const struct GNUNET_ShortHashCode *member_id = get_srv_handle_member_id (
271 handle, get_srv_room_key (room));
272
273 struct GNUNET_MESSENGER_MemberStore *member_store =
275 struct GNUNET_MESSENGER_Member *member = add_store_member (member_store,
276 member_id);
277
278 if (GNUNET_NO == join_room (room, handle, member, member_id))
279 return GNUNET_NO;
280
281 return GNUNET_YES;
282}
283
284
286check_tunnel_message (void *cls,
287 const struct GNUNET_MessageHeader *header);
288
289extern void
290handle_tunnel_message (void *cls,
291 const struct GNUNET_MessageHeader *header);
292
293extern void
295 const struct GNUNET_CADET_Channel *channel);
296
297
301{
302 GNUNET_assert (room);
303
304 if (handle)
305 room->host = handle;
306
307 if (room->port)
308 {
309 if (! handle)
310 return GNUNET_YES;
311
312 return join_room_locally (room, handle);
313 }
314
316 const struct GNUNET_HashCode *key = get_srv_room_key (room);
317
319 tunnel_message,
321 struct
324
325 struct GNUNET_HashCode port;
328 room, NULL, callback_tunnel_disconnect,
329 handlers);
330
331 if (room->port)
332 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Port of room (%s) was opened!\n",
334 else
336 "Port of room (%s) could not be opened!\n",
338
339 if (! handle)
340 goto complete_opening;
341
342 const struct GNUNET_ShortHashCode *member_id = get_srv_handle_member_id (
343 handle, get_srv_room_key (room));
344
345 struct GNUNET_MESSENGER_MemberStore *member_store =
347 struct GNUNET_MESSENGER_Member *member = add_store_member (member_store,
348 member_id);
349
350 if ((GNUNET_NO == join_room (room, handle, member, member_id)) &&
351 (room->port))
352 {
354 "You could not join the room, therefore it keeps closed!\n");
355
356 close_srv_room (room);
357 return GNUNET_NO;
358 }
359
360complete_opening:
361 if (! room->port)
362 return GNUNET_NO;
363
365 room->service));
366}
367
368
369static void
371{
372 GNUNET_assert (room);
373
374 if (! room->port)
375 return;
376
377 struct GNUNET_PeerIdentity peer;
378 if ((room->peer_message) &&
379 (GNUNET_OK == get_service_peer_identity (room->service, &peer)))
380 send_srv_room_message (room, room->host, create_message_miss (&peer));
381
383 room->port = NULL;
384}
385
386
390 const struct GNUNET_PeerIdentity *door)
391{
392 GNUNET_assert ((room) && (handle) && (door));
393
394 struct GNUNET_PeerIdentity peer;
395
396 if ((GNUNET_OK == get_service_peer_identity (room->service, &peer)) &&
397 (0 == GNUNET_memcmp (&peer, door)))
398 return join_room_locally (room, handle);
399
400 struct GNUNET_MESSENGER_SrvTunnel *tunnel =
402
403 if (! tunnel)
404 {
405 tunnel = create_tunnel (room, door);
406
408 tunnel,
410 {
412 "You could not connect to that door!\n");
413 destroy_tunnel (tunnel);
414 return GNUNET_NO;
415 }
416 }
417
418 if (GNUNET_SYSERR == connect_tunnel (tunnel))
419 {
421 "Connection failure during entrance!\n");
423 destroy_tunnel (tunnel);
424 return GNUNET_NO;
425 }
426
427 return join_room_locally (room, handle);
428}
429
430
431static void
433 struct GNUNET_MESSENGER_Message *message,
434 uint16_t length,
435 char *buffer,
436 const struct GNUNET_HashCode *hash)
437{
438 const struct GNUNET_MESSENGER_SrvHandle *handle = cls;
439
440 GNUNET_assert ((handle) && (handle->service));
441
442 sign_message_by_peer (message, length, buffer, hash, handle->service->config);
443}
444
445
446struct GNUNET_MQ_Envelope*
449 struct GNUNET_MESSENGER_Message *message,
450 struct GNUNET_HashCode *hash,
452{
453 GNUNET_assert ((room) && (handle) && (message) && (hash));
454
455 if (GNUNET_YES != is_peer_message (message))
456 return pack_message (message, hash, NULL, mode, NULL);
457
460
461 struct GNUNET_PeerIdentity peer;
462 if (GNUNET_OK != get_service_peer_identity (handle->service, &peer))
463 return NULL;
464
465 convert_peer_identity_to_id (&peer, &(message->header.sender_id));
466 get_message_state_chain_hash (&(room->state), &(message->header.previous));
467
469 "Packing message with peer signature: %s\n",
470 GNUNET_sh2s (&(message->header.sender_id)));
471
473 return pack_message (message, hash, sign_srv_room_message_by_peer, mode,
474 handle);
475}
476
477
479{
486};
487
490 const struct GNUNET_PeerIdentity *key,
491 void *value)
492{
493 struct GNUNET_MESSENGER_SrvTunnel *tunnel = value;
494
495 if ((! is_tunnel_connected (tunnel)) ||
497 return GNUNET_YES;
498
499 struct GNUNET_MESSENGER_ClosureSendRoom *closure = cls;
500
501 if (tunnel == closure->exclude)
502 return GNUNET_YES;
503
504 struct GNUNET_MQ_Envelope *env = NULL;
505
506 if (closure->packed == GNUNET_NO)
507 {
508 env = pack_srv_room_message (closure->room, closure->handle,
509 closure->message, closure->hash,
511
512 if (env)
513 closure->packed = GNUNET_YES;
514 }
515 else
516 env = pack_message (closure->message, NULL, NULL,
518
519 if (env)
520 send_tunnel_envelope (tunnel, env, closure->hash);
521
522 return GNUNET_YES;
523}
524
525
528 struct GNUNET_MESSENGER_Message *message,
529 const struct GNUNET_HashCode *hash);
530
531void
533 const struct GNUNET_MESSENGER_Message *message,
534 const struct GNUNET_HashCode *hash);
535
539 struct GNUNET_MESSENGER_Message *message)
540{
541 GNUNET_assert ((room) && (handle));
542
543 if (! message)
544 return GNUNET_NO;
545
547 "Sending message from handle in room: %s (%s)\n",
548 GNUNET_h2s (&(room->key)),
550
551 struct GNUNET_HashCode hash;
553
554 closure.room = room;
555 closure.handle = handle;
556 closure.exclude = NULL;
557 closure.message = message;
558 closure.hash = &hash;
559 closure.packed = GNUNET_NO;
560
562 iterate_send_room_message, &closure);
563
564 if (GNUNET_NO == closure.packed)
567
568 enum GNUNET_GenericReturnValue new_message;
569 new_message = update_room_message (room, message, &hash);
570
571 if (GNUNET_YES != new_message)
572 {
573 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Sending duplicate message failed!\n");
574 return GNUNET_SYSERR;
575 }
576
577 switch (message->header.kind)
578 {
581 break;
584 break;
587 break;
590 break;
593 break;
594 default:
595 break;
596 }
597
599 return GNUNET_YES;
600}
601
602
603void
605 struct GNUNET_MESSENGER_SrvTunnel *tunnel,
607 const struct GNUNET_HashCode *hash)
608{
609 GNUNET_assert ((room) && (tunnel));
610
611 if (! message)
612 return;
613
615 struct GNUNET_HashCode message_hash;
616
617 GNUNET_memcpy (&message_hash, hash, sizeof(struct GNUNET_HashCode));
618
619 closure.room = room;
620 closure.handle = NULL;
621 closure.exclude = tunnel;
622 closure.message = message;
623 closure.hash = &message_hash;
624 closure.packed = GNUNET_YES;
625
627 iterate_send_room_message, &closure);
628}
629
630
631void
633 struct GNUNET_MESSENGER_SrvTunnel *tunnel)
634{
635 if (! room->peer_message)
636 return;
637
638 struct GNUNET_MESSENGER_MessageStore *message_store =
640
641 const struct GNUNET_MESSENGER_Message *message = get_store_message (
642 message_store, room->peer_message);
643
644 if (! message)
645 {
647 room->peer_message = NULL;
648 return;
649 }
650
651 if (tunnel)
652 forward_tunnel_message (tunnel, message, room->peer_message);
653}
654
655
656void
659{
660 GNUNET_assert (room);
661
662 if (! handle)
663 return;
664
666 "Merging messages by handle in room: %s\n",
667 GNUNET_h2s (&(room->key)));
668
669 const struct GNUNET_HashCode *hash;
670
671merge_next:
672 hash = get_message_state_merge_hash (&(room->state));
673
674 if (! hash)
675 return;
676
678 goto merge_next;
679}
680
681
682void
684 const struct GNUNET_HashCode *hash)
685{
687 hash))
688 {
689 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Deletion of message failed! (%s)\n",
690 GNUNET_h2s (hash));
691 return;
692 }
693}
694
695
696void
698 const struct GNUNET_HashCode *hash)
699{
700 if (! room->host)
701 return;
702
703 send_srv_room_message (room, room->host, create_message_merge (hash));
704}
705
706
709 struct GNUNET_MESSENGER_MemberSession *session,
710 const struct GNUNET_HashCode *hash,
711 const struct GNUNET_TIME_Relative delay)
712{
713 GNUNET_assert ((room) && (session) && (hash));
714
715 const struct GNUNET_TIME_Relative forever =
717
718 if (0 == GNUNET_memcmp (&forever, &delay))
719 {
721 "Deletion is delayed forever: operation is impossible!\n");
722 return GNUNET_SYSERR;
723 }
724
725 struct GNUNET_MESSENGER_MessageStore *message_store =
727
728 const struct GNUNET_MESSENGER_Message *message = get_store_message (
729 message_store, hash);
730
731 if (! message)
732 return GNUNET_YES;
733
734 if (GNUNET_YES != check_member_session_history (session, hash, GNUNET_YES))
735 {
737 "Unpermitted request for deletion by member (%s) of message (%s)!\n",
739 hash));
740
741 return GNUNET_NO;
742 }
743
744 struct GNUNET_MESSENGER_OperationStore *operation_store =
746
747 if (GNUNET_OK != use_store_operation (operation_store, hash,
749 {
751 "Deletion has failed: operation denied!\n");
752 return GNUNET_SYSERR;
753 }
754
755 return GNUNET_YES;
756}
757
758
761{
762 GNUNET_assert (room);
763
764 return room->service->cadet;
765}
766
767
768const struct GNUNET_HashCode*
770{
771 GNUNET_assert (room);
772
773 return &(room->key);
774}
775
776
777const struct GNUNET_MESSENGER_SrvTunnel*
779 const struct GNUNET_PeerIdentity *peer)
780{
781 GNUNET_assert ((room) && (peer));
782
784}
785
786
789 const struct GNUNET_HashCode *hash,
790 const struct GNUNET_MESSENGER_MemberSession *session,
792 void *cls)
793{
794 const struct GNUNET_MESSENGER_Message *message;
795
796 struct GNUNET_MESSENGER_MessageStore *message_store =
798
800 message_store, hash, GNUNET_YES
801 );
802
803 if (! link)
804 goto forward;
805
807 "Requesting link of message with hash: %s\n",
808 GNUNET_h2s (hash));
809
811 result = request_room_message_step (room, &(link->first), session,
812 callback, cls);
813
814 if ((GNUNET_YES == link->multiple) &&
815 (GNUNET_YES == request_room_message_step (room, &(link->second), session,
816 callback, cls)))
817 return GNUNET_YES;
818 else
819 return result;
820
821forward:
822 message = get_store_message (message_store, hash);
823
824 if (! message)
825 {
827 "Requested message is missing in local storage: %s\n",
828 GNUNET_h2s (hash));
829 return GNUNET_NO;
830 }
831
832 if (GNUNET_YES != check_member_session_history (session, hash, GNUNET_NO))
834 "Unpermitted request for access by member (%s) of message (%s)!\n",
836 hash));
837 else if (callback)
838 callback (cls, room, message, hash);
839
840 return GNUNET_YES;
841}
842
843
846 const struct GNUNET_HashCode *hash,
847 const struct GNUNET_MESSENGER_MemberSession *session,
849 void *cls)
850{
851 GNUNET_assert ((room) && (hash));
852
854 result = request_room_message_step (room, hash, session, callback, cls);
855
856 if ((GNUNET_NO == result) && (callback))
857 callback (cls, room, NULL, hash);
858
859 return result;
860}
861
862
863void
865 void *cls)
866{
867 struct GNUNET_MESSENGER_SrvTunnel *tunnel = cls;
868
869 if (! room->host)
870 return;
871
874
876 &identity,
877 tunnel)) ||
879 &identity)))
880 return;
881
884
887 return;
888
889 struct GNUNET_MESSENGER_ListTunnel *element;
890 element = find_list_tunnels_alternate (&(room->basement), &identity);
891
892 if (! element)
893 return;
894
895 GNUNET_PEER_resolve (element->peer, &identity);
896 enter_srv_room_at (room, room->host, &identity);
897}
898
899
902 void *cls,
903 struct GNUNET_MESSENGER_Message *message,
904 struct GNUNET_HashCode *hash)
905{
907 {
909 "Message error: Kind is unknown! (%d)\n", message->header.kind);
910 return GNUNET_SYSERR;
911 }
912
913 struct GNUNET_MESSENGER_MessageStore *message_store =
915
916 const struct GNUNET_MESSENGER_Message *previous = get_store_message (
917 message_store, &(message->header.previous));
918
919 if (! previous)
920 goto skip_time_comparison;
921
923 message->header.timestamp);
925 previous->header.timestamp);
926
927 if (GNUNET_TIME_relative_get_zero_ ().rel_value_us !=
928 GNUNET_TIME_absolute_get_difference (timestamp, last).rel_value_us)
929 {
931 "Message warning: Timestamp does not check out!\n");
932 }
933
934skip_time_comparison:
935 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving message of kind: %s!\n",
937
938 return GNUNET_OK;
939}
940
941
942static void
944{
945 struct GNUNET_MESSENGER_SrvRoom *room = cls;
946
947 room->idle = NULL;
948
949 struct GNUNET_MESSENGER_OperationStore *operation_store =
951 const struct GNUNET_HashCode *hash = get_message_state_merge_hash (
952 &(room->state));
953
954 if ((hash) &&
956 hash)))
958 operation_store,
959 hash,
962 );
963
968 cls
969 );
970}
971
972
973void
975 const struct
976 GNUNET_CRYPTO_PublicKey *public_key,
977 const struct GNUNET_ShortHashCode *member_id,
978 struct GNUNET_TIME_Absolute timestamp)
979{
980 GNUNET_assert ((room) && (public_key) && (member_id));
981
982 struct GNUNET_MESSENGER_MemberStore *member_store =
984 struct GNUNET_MESSENGER_Member *member = get_store_member (member_store,
985 member_id);
986
987 if ((! member) || (1 >= GNUNET_CONTAINER_multihashmap_size (
988 member->sessions)))
989 return;
990
991 struct GNUNET_MESSENGER_ListHandles *handles = &(room->service->handles);
992 struct GNUNET_MESSENGER_ListHandle *element;
993
994 const struct GNUNET_CRYPTO_PublicKey *pubkey;
995
996 for (element = handles->head; element; element = element->next)
997 {
998 if (0 != GNUNET_memcmp (member_id, get_srv_handle_member_id (
999 element->handle, get_srv_room_key (room))))
1000 continue;
1001
1002 pubkey = get_srv_handle_key (element->handle);
1003
1004 if (0 == GNUNET_memcmp (public_key, pubkey))
1005 continue;
1006
1008 pubkey);
1009
1010 if (! session)
1011 continue;
1012
1014
1015 if (GNUNET_TIME_relative_get_zero_ ().rel_value_us !=
1016 GNUNET_TIME_absolute_get_difference (start, timestamp).rel_value_us)
1017 continue;
1018
1019 struct GNUNET_ShortHashCode random_id;
1020 generate_free_member_id (&random_id, member_store->members);
1021
1022 notify_srv_handle_member_id (element->handle, room, &random_id, GNUNET_NO);
1023 }
1024}
1025
1026
1027void
1029{
1030 GNUNET_assert (room);
1031
1032 struct GNUNET_PeerIdentity peer;
1033 size_t src;
1034
1035 if (GNUNET_OK != get_service_peer_identity (room->service, &peer))
1036 return;
1037
1038 size_t count = count_of_tunnels (&(room->basement));
1039
1040 if (! find_list_tunnels (&(room->basement), &peer, &src))
1041 return;
1042
1043 if ((count > room->service->min_routers) &&
1044 (GNUNET_NO == is_srv_handle_routing (room->host, &(room->key))) &&
1046 &peer,
1048 {
1049 close_srv_room (room);
1050 return;
1051 }
1052
1053 struct GNUNET_MESSENGER_ListTunnel *element = room->basement.head;
1054 struct GNUNET_MESSENGER_SrvTunnel *tunnel;
1055
1056 size_t dst = 0;
1057
1058 while (element)
1059 {
1060 GNUNET_PEER_resolve (element->peer, &peer);
1061
1063
1064 if (! tunnel)
1065 {
1066 element = remove_from_list_tunnels (&(room->basement), element);
1067 continue;
1068 }
1069
1070 if (GNUNET_YES == required_connection_between (count, src, dst))
1071 {
1072 if (GNUNET_SYSERR == connect_tunnel (tunnel))
1073 {
1074 element = remove_from_list_tunnels (&(room->basement), element);
1075 continue;
1076 }
1077 }
1078 else
1079 disconnect_tunnel (tunnel);
1080
1081 element = element->next;
1082 dst++;
1083 }
1084}
1085
1086
1087uint32_t
1089{
1091
1093}
1094
1095
1096uint32_t
1098{
1100
1102
1105
1106 return flags;
1107}
1108
1109
1110static void
1112{
1113 struct GNUNET_MESSENGER_MessageStore *message_store =
1115 struct GNUNET_MESSENGER_MemberStore *member_store =
1118 room);
1119
1120 while (room->handling.head)
1121 {
1122 struct GNUNET_MESSENGER_ListMessage *element = room->handling.head;
1123
1124 const struct GNUNET_MESSENGER_Message *message = get_store_message (
1125 message_store, &(element->hash));
1126
1127 if (! message)
1128 goto finish_handling;
1129
1130 struct GNUNET_MESSENGER_SenderSession session;
1131
1132 if (GNUNET_YES == is_peer_message (message))
1133 {
1134 session.peer = get_store_peer_of (peer_store, message, &(element->hash));
1135
1136 if (! session.peer)
1137 goto finish_handling;
1138 }
1139 else
1140 {
1142 member_store, message);
1143
1144 if (! member)
1145 goto finish_handling;
1146
1147 session.member = get_member_session_of (member, message,
1148 &(element->hash));
1149
1150 if (! session.member)
1151 goto finish_handling;
1152 }
1153
1154 handle_service_message (room->service, room, &session, message,
1155 &(element->hash));
1156
1157finish_handling:
1159 element);
1160 GNUNET_free (element);
1161 }
1162}
1163
1164
1167 struct GNUNET_MESSENGER_Message *message,
1168 const struct GNUNET_HashCode *hash)
1169{
1170 GNUNET_assert ((room) && (message) && (hash));
1171
1172 struct GNUNET_MESSENGER_OperationStore *operation_store =
1174
1175 enum GNUNET_GenericReturnValue requested;
1176 requested = (GNUNET_MESSENGER_OP_REQUEST ==
1177 get_store_operation_type (operation_store, hash)?
1179
1180 if (GNUNET_YES == requested)
1181 cancel_store_operation (operation_store, hash);
1182
1183 struct GNUNET_MESSENGER_MessageStore *message_store =
1185
1186 const struct GNUNET_MESSENGER_Message *old_message = get_store_message (
1187 message_store, hash);
1188
1189 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Handle a message in room (%s).\n",
1190 GNUNET_h2s (get_srv_room_key (room)));
1191
1192 if ((old_message) || (GNUNET_OK != put_store_message (message_store, hash,
1193 message)))
1194 {
1195 if (old_message != message)
1196 destroy_message (message);
1197
1198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Duplicate message got dropped!\n");
1199 return GNUNET_NO;
1200 }
1201
1202 update_message_state (&(room->state), requested, message, hash);
1203
1204 if ((GNUNET_YES == requested) ||
1205 (GNUNET_MESSENGER_KIND_INFO == message->header.kind) ||
1207 return GNUNET_YES;
1208
1209 if ((GNUNET_MESSENGER_KIND_MERGE == message->header.kind) &&
1211 &(message->body.
1212 merge.previous))))
1213 cancel_store_operation (operation_store, &(message->body.merge.previous));
1214
1216 &(message->header.
1217 previous)))
1218 cancel_store_operation (operation_store, &(message->header.previous));
1219
1220 return GNUNET_YES;
1221}
1222
1223
1225{
1228
1230};
1231
1233{
1235 const struct GNUNET_HashCode *hash;
1236
1239};
1240
1241static enum GNUNET_GenericReturnValue
1243 const struct
1244 GNUNET_CRYPTO_PublicKey *public_key,
1246{
1247 struct GNUNET_MESSENGER_MemberUpdate *update = cls;
1248
1249 update_member_session_history (session, update->message, update->hash);
1250
1251 if (GNUNET_YES == is_member_session_completed (session))
1252 {
1255 );
1256
1257 element->session = session;
1258
1259 GNUNET_CONTAINER_DLL_insert_tail (update->head, update->tail, element);
1260 }
1261
1262 return GNUNET_YES;
1263}
1264
1265
1266static void
1269
1270void
1272 const struct GNUNET_MESSENGER_Message *message,
1273 const struct GNUNET_HashCode *hash)
1274{
1275 GNUNET_assert ((room) && (message) && (hash));
1276
1278 room);
1279 struct GNUNET_MESSENGER_MemberStore *member_store =
1281
1282 struct GNUNET_MESSENGER_SenderSession session;
1283
1284 if (GNUNET_YES == is_peer_message (message))
1285 {
1286 session.peer = get_store_peer_of (peer_store, message, hash);
1287
1288 if (! session.peer)
1289 {
1291 "Message handling dropped: Peer is missing!\n");
1292 return;
1293 }
1294 }
1295 else
1296 {
1297 struct GNUNET_MESSENGER_Member *member = get_store_member_of (member_store,
1298 message);
1299
1300 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Callback for message (%s)\n",
1301 GNUNET_h2s (hash));
1302
1303 if (! member)
1304 {
1306 "Message handling dropped: Member is missing!\n");
1307 return;
1308 }
1309
1310 session.member = get_member_session_of (member, message, hash);
1311
1312 if (! session.member)
1313 {
1315 "Message handling dropped: Session is missing!\n");
1316 return;
1317 }
1318 }
1319
1320 struct GNUNET_MESSENGER_MemberUpdate update;
1321 update.message = message;
1322 update.hash = hash;
1323
1324 update.head = NULL;
1325 update.tail = NULL;
1326
1328
1329 while (update.head)
1330 {
1331 struct GNUNET_MESSENGER_MemberSessionCompletion *element = update.head;
1332
1333 remove_room_member_session (room, element->session);
1334
1335 GNUNET_CONTAINER_DLL_remove (update.head, update.tail, element);
1336 GNUNET_free (element);
1337 }
1338
1339 enum GNUNET_GenericReturnValue start_handle;
1340 start_handle = room->handling.head ? GNUNET_NO : GNUNET_YES;
1341
1342 add_to_list_messages (&(room->handling), hash);
1343
1344 switch (message->header.kind)
1345 {
1347 handle_message_join (room, &session, message, hash);
1348 break;
1350 handle_message_leave (room, &session, message, hash);
1351 break;
1353 handle_message_key (room, &session, message, hash);
1354 break;
1356 handle_message_peer (room, &session, message, hash);
1357 break;
1359 handle_message_id (room, &session, message, hash);
1360 break;
1362 handle_message_miss (room, &session, message, hash);
1363 break;
1365 handle_message_delete (room, &session, message, hash);
1366 break;
1368 handle_message_connection (room, &session, message, hash);
1369 break;
1370 default:
1371 break;
1372 }
1373
1374 if (GNUNET_YES == start_handle)
1375 handle_room_messages (room);
1376}
1377
1378
1379static void
1381 char **dir)
1382{
1383 GNUNET_assert ((room) && (dir));
1384
1385 GNUNET_asprintf (dir, "%s%s%c%s%c", room->service->dir, "rooms",
1388}
1389
1390
1391void
1393{
1394 GNUNET_assert (room);
1395
1396 char *room_dir;
1397 get_room_data_subdir (room, &room_dir);
1398
1399 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Load room from directory: %s\n",
1400 room_dir);
1401
1403 {
1404 char *peers_file;
1405 GNUNET_asprintf (&peers_file, "%s%s", room_dir, "peers.list");
1406
1407 load_peer_store (get_srv_room_peer_store (room), peers_file);
1408 GNUNET_free (peers_file);
1409
1413
1414 char *basement_file;
1415 GNUNET_asprintf (&basement_file, "%s%s", room_dir, "basement.list");
1416
1417 load_list_tunnels (&(room->basement), basement_file);
1418 GNUNET_free (basement_file);
1419
1420 load_message_state (&(room->state), room_dir);
1421 }
1422
1423 GNUNET_free (room_dir);
1424}
1425
1426
1427void
1429{
1430 GNUNET_assert (room);
1431
1432 char *room_dir;
1433 get_room_data_subdir (room, &room_dir);
1434
1435 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Save room to directory: %s\n",
1436 room_dir);
1437
1438 if ((GNUNET_YES == GNUNET_DISK_directory_test (room_dir, GNUNET_NO)) ||
1440 {
1441 char *peers_file;
1442 GNUNET_asprintf (&peers_file, "%s%s", room_dir, "peers.list");
1443
1444 save_peer_store (get_srv_room_peer_store (room), peers_file);
1445 GNUNET_free (peers_file);
1446
1450
1451 char *basement_file;
1452 GNUNET_asprintf (&basement_file, "%s%s", room_dir, "basement.list");
1453
1454 save_list_tunnels (&(room->basement), basement_file);
1455 GNUNET_free (basement_file);
1456
1457 save_message_state (&(room->state), room_dir);
1458 }
1459
1460 GNUNET_free (room_dir);
1461}
1462
1463
1464void
1466{
1467 GNUNET_assert (room);
1468
1469 char *room_dir;
1470 get_room_data_subdir (room, &room_dir);
1471
1472 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Remove room from directory: %s\n",
1473 room_dir);
1474
1477
1478 GNUNET_free (room_dir);
1479}
1480
1481
1482static void
1485{
1486 GNUNET_assert ((room) && (session));
1487
1489 "Remove member session from room: %s (%s)\n",
1491 GNUNET_h2s (get_srv_room_key (room)));
1492
1494
1495 const struct GNUNET_CRYPTO_PublicKey *public_key =
1497
1498 struct GNUNET_HashCode hash;
1499 GNUNET_CRYPTO_hash (public_key, sizeof(*public_key), &hash);
1500
1501 char *room_dir;
1502 get_room_data_subdir (room, &room_dir);
1503
1504 char *session_dir;
1506 &session_dir, "%s%s%c%s%c%s%c%s%c", room_dir,
1507 "members", DIR_SEPARATOR,
1509 "sessions", DIR_SEPARATOR,
1510 GNUNET_h2s (&hash), DIR_SEPARATOR
1511 );
1512
1513 GNUNET_free (room_dir);
1514
1515 GNUNET_DISK_directory_remove (session_dir);
1516 GNUNET_free (session_dir);
1517
1518 destroy_member_session (session);
1519}
struct GNUNET_MQ_MessageHandlers handlers[]
Definition: 003.c:1
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
static int forward
Search direction: forward.
Definition: gnunet-abd.c:162
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
static char * dir
Set to the directory where runtime files are stored.
Definition: gnunet-arm.c:89
static uint16_t port
Port number.
Definition: gnunet-bcd.c:147
struct GNUNET_HashCode key
The key used in the DHT.
static GstElement * source
Appsrc instance into which we write data for the pipeline.
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
static int reset
Reset argument.
static char * value
Value of the record to add/remove.
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
static int result
Global testing status.
static void destroy_tunnel(void *cls)
This tunnel is no longer used, destroy it.
static struct GNUNET_CADET_Handle * cadet
Handle for cadet.
enum GNUNET_GenericReturnValue required_connection_between(size_t count, size_t src, size_t dst)
Returns GNUNET_YES or GNUNET_NO to determine if the peers of index src and index dst should be connec...
size_t count_of_tunnels(const struct GNUNET_MESSENGER_ListTunnels *tunnels)
Returns the count of peers in a list (typically from the basement of a room).
enum GNUNET_GenericReturnValue change_srv_handle_member_id(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key, const struct GNUNET_ShortHashCode *unique_id)
Changes the member id of a given handle in a specific room to match a unique_id and returns GNUNET_OK...
void notify_srv_handle_member_id(struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_ShortHashCode *member_id, enum GNUNET_GenericReturnValue reset)
Notifies the handle that a new member id needs to be used.
const struct GNUNET_CRYPTO_PublicKey * get_srv_handle_key(const struct GNUNET_MESSENGER_SrvHandle *handle)
Returns the public key of a given handle.
const struct GNUNET_ShortHashCode * get_srv_handle_member_id(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns the member id of a given handle in a specific room.
enum GNUNET_GenericReturnValue is_srv_handle_routing(const struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Returns whether a given handle has enabled routing for a room using a specific key by opening that ro...
void init_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Initializes list of message hashes as empty list.
void add_to_list_messages(struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_HashCode *hash)
Adds a specific hash from a message to the end of the list.
const struct GNUNET_ShortHashCode * get_member_id(const struct GNUNET_MESSENGER_Member *member)
Returns the current id of a given member.
void remove_member_session(struct GNUNET_MESSENGER_Member *member, struct GNUNET_MESSENGER_MemberSession *session)
Removes a given member session from its member.
struct GNUNET_MESSENGER_MemberSession * get_member_session_of(struct GNUNET_MESSENGER_Member *member, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Returns the member session of a member using a public key which can verify the signature of a given m...
struct GNUNET_MESSENGER_MemberSession * get_member_session(const struct GNUNET_MESSENGER_Member *member, const struct GNUNET_CRYPTO_PublicKey *public_key)
Returns the member session of a member identified by a given public key.
void destroy_member_session(struct GNUNET_MESSENGER_MemberSession *session)
Destroys a member session and frees its memory fully.
const struct GNUNET_CRYPTO_PublicKey * get_member_session_public_key(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the public key of a given member session.
struct GNUNET_TIME_Absolute get_member_session_start(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the timestamp of the member session's start.
void update_member_session_history(struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Adds a given message to the history of a session using the messages hash.
const struct GNUNET_ShortHashCode * get_member_session_id(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the member id of a given member session.
enum GNUNET_GenericReturnValue check_member_session_history(const struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue ownership)
Checks the history of a session for a specific message which is identified by its hash and if the own...
enum GNUNET_GenericReturnValue is_member_session_completed(const struct GNUNET_MESSENGER_MemberSession *session)
Returns if the given member session has been completed.
struct GNUNET_MESSENGER_Member * get_store_member_of(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_MESSENGER_Message *message)
Returns the member of a store using a sender id of a given message.
int iterate_store_members(struct GNUNET_MESSENGER_MemberStore *store, GNUNET_MESSENGER_MemberIteratorCallback it, void *cls)
Iterate through all member sessions currently connected to the members of the given member store and ...
void save_member_store(struct GNUNET_MESSENGER_MemberStore *store, const char *directory)
Saves members from a member store into a directory.
void load_member_store(struct GNUNET_MESSENGER_MemberStore *store, const char *directory)
Loads members from a directory into a member store.
struct GNUNET_MESSENGER_Member * add_store_member(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Adds a member to a store under a specific id and returns it on success.
void init_member_store(struct GNUNET_MESSENGER_MemberStore *store, struct GNUNET_MESSENGER_SrvRoom *room)
Initializes a member store as fully empty connected to a room.
void clear_member_store(struct GNUNET_MESSENGER_MemberStore *store)
Clears a member store, wipes its content and deallocates its memory.
struct GNUNET_MESSENGER_Member * get_store_member(const struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Returns the member in a store identified by a given id.
void handle_message_id(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent id message to change a members id.
void handle_message_delete(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent delete message to delete a specific message from the store.
void handle_message_peer(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent peer message to make changes of the basement in the room.
void handle_message_join(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent join message to make changes of current member information.
void handle_message_key(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent key message to change the key of a member and rearrange the contacts accor...
void handle_message_leave(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent leave message to make changes of current member information.
void handle_message_connection(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent connection message to update connection information about a peer.
void handle_message_miss(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a received or sent miss message to drop a peer from the basement in the room.
struct GNUNET_MESSENGER_Message * create_message_info(struct GNUNET_MESSENGER_Service *service)
Creates and allocates a new info message containing the hosts service peer identity and version.
struct GNUNET_MESSENGER_Message * create_message_miss(const struct GNUNET_PeerIdentity *peer)
Creates and allocates a new miss message containing the missing peer identity.
struct GNUNET_MESSENGER_Message * create_message_peer(struct GNUNET_MESSENGER_Service *service)
Creates and allocates a new peer message containing a services peer identity.
struct GNUNET_MESSENGER_Message * create_message_merge(const struct GNUNET_HashCode *previous)
Creates and allocates a new merge message containing the hash of a second previous message besides th...
void send_message_id(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a sent id message to update the handles member id in the room.
void send_message_request(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a sent request message to trigger the request operation for this service.
void send_message_join(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a sent join message to ensure growth of the decentralized room structure.
void send_message_key(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a sent key message to ensure changes to the public key of the sending handle.
void send_message_peer(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a sent peer message to update the rooms peer message of this service.
const struct GNUNET_HashCode * get_message_state_merge_hash(const struct GNUNET_MESSENGER_MessageState *state)
void save_message_state(const struct GNUNET_MESSENGER_MessageState *state, const char *path)
void clear_message_state(struct GNUNET_MESSENGER_MessageState *state)
void get_message_state_chain_hash(const struct GNUNET_MESSENGER_MessageState *state, struct GNUNET_HashCode *hash)
void init_message_state(struct GNUNET_MESSENGER_MessageState *state)
void update_message_state(struct GNUNET_MESSENGER_MessageState *state, enum GNUNET_GenericReturnValue requested, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
void load_message_state(struct GNUNET_MESSENGER_MessageState *state, const char *path)
void save_message_store(struct GNUNET_MESSENGER_MessageStore *store, const char *directory)
Saves messages from a message store into a directory.
enum GNUNET_GenericReturnValue put_store_message(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash, struct GNUNET_MESSENGER_Message *message)
Stores a message into the message store.
void clear_message_store(struct GNUNET_MESSENGER_MessageStore *store)
Clears a message store, wipes its content and deallocates its memory.
enum GNUNET_GenericReturnValue delete_store_message(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash)
Deletes a message in the message store.
void init_message_store(struct GNUNET_MESSENGER_MessageStore *store)
Initializes a message store as fully empty.
void load_message_store(struct GNUNET_MESSENGER_MessageStore *store, const char *directory)
Loads messages from a directory into a message store.
const struct GNUNET_MESSENGER_MessageLink * get_store_message_link(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue deleted_only)
Returns the message link from a message store matching a given hash.
const struct GNUNET_MESSENGER_Message * get_store_message(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash)
Returns the message from a message store matching a given hash.
void cancel_store_operation(struct GNUNET_MESSENGER_OperationStore *store, const struct GNUNET_HashCode *hash)
Stops any active operation under a given hash in a specific operation store.
void save_operation_store(const struct GNUNET_MESSENGER_OperationStore *store, const char *directory)
Saves operations from an operation store into a directory.
void clear_operation_store(struct GNUNET_MESSENGER_OperationStore *store)
Clears an operation store, stops all operations and deallocates its memory.
void load_operation_store(struct GNUNET_MESSENGER_OperationStore *store, const char *directory)
Loads operations from a directory into an operation store.
enum GNUNET_MESSENGER_OperationType get_store_operation_type(const struct GNUNET_MESSENGER_OperationStore *store, const struct GNUNET_HashCode *hash)
Returns the type of the active operation under a given hash in a specific operation store.
void init_operation_store(struct GNUNET_MESSENGER_OperationStore *store, struct GNUNET_MESSENGER_SrvRoom *room)
Initializes an operation store as fully empty with a given room.
enum GNUNET_GenericReturnValue use_store_operation(struct GNUNET_MESSENGER_OperationStore *store, const struct GNUNET_HashCode *hash, enum GNUNET_MESSENGER_OperationType type, struct GNUNET_TIME_Relative delay)
Tries to use an operation under a given hash in a specific operation store.
struct GNUNET_PeerIdentity * get_store_peer_of(struct GNUNET_MESSENGER_PeerStore *store, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Returns the peer identity inside the store which verifies the signature of a given message as valid.
void load_peer_store(struct GNUNET_MESSENGER_PeerStore *store, const char *path)
Loads peer identities from a file into a peer store.
void clear_peer_store(struct GNUNET_MESSENGER_PeerStore *store)
Clears a peer store, wipes its content and deallocates its memory.
void save_peer_store(const struct GNUNET_MESSENGER_PeerStore *store, const char *path)
Saves peer identities from a peer store into a file.
void init_peer_store(struct GNUNET_MESSENGER_PeerStore *store, struct GNUNET_MESSENGER_Service *service)
Initializes a peer store as fully empty.
uint32_t get_srv_room_amount_of_tunnels(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns the amount of active tunnels of a given room.
static enum GNUNET_GenericReturnValue request_room_message_step(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_MemberSession *session, GNUNET_MESSENGER_MessageRequestCallback callback, void *cls)
static enum GNUNET_GenericReturnValue iterate_destroy_tunnels(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
const struct GNUNET_MESSENGER_SrvTunnel * get_srv_room_tunnel(const struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_PeerIdentity *peer)
Returns a tunnel inside of a room leading towards a given peer if such a tunnel exists,...
static void get_room_data_subdir(struct GNUNET_MESSENGER_SrvRoom *room, char **dir)
static enum GNUNET_GenericReturnValue join_room(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Member *member, const struct GNUNET_ShortHashCode *id)
enum GNUNET_GenericReturnValue update_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
struct GNUNET_MESSENGER_SrvRoom * create_srv_room(struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_HashCode *key)
Creates and allocates a new room for a handle with a given key.
void save_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
Saves the configuration for a given room of a service which contains the last messages hash and the r...
void rebuild_srv_room_basement_structure(struct GNUNET_MESSENGER_SrvRoom *room)
Rebuilds the decentralized structure for a room by ensuring all required connections are made dependi...
struct GNUNET_MESSENGER_MessageStore * get_srv_room_message_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used message store of a given room.
static void * callback_room_connect(void *cls, struct GNUNET_CADET_Channel *channel, const struct GNUNET_PeerIdentity *source)
static enum GNUNET_GenericReturnValue send_room_info(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_SrvTunnel *tunnel)
static void remove_room_member_session(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_MemberSession *session)
enum GNUNET_GenericReturnValue callback_verify_room_message(struct GNUNET_MESSENGER_SrvRoom *room, void *cls, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash)
static enum GNUNET_GenericReturnValue join_room_locally(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
enum GNUNET_GenericReturnValue enter_srv_room_at(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, const struct GNUNET_PeerIdentity *door)
Connects a tunnel to a hosting peer of a room through a so called door which is represented by a peer...
struct GNUNET_MESSENGER_PeerStore * get_srv_room_peer_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used peer store of a given room.
void handle_tunnel_message(void *cls, const struct GNUNET_MessageHeader *header)
static void idle_request_room_messages(void *cls)
void merge_srv_room_last_messages(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Reduces all current forks inside of the message history of a room to one remaining last message by me...
struct GNUNET_MQ_Envelope * pack_srv_room_message(const struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, enum GNUNET_MESSENGER_PackMode mode)
Packs a message depending on the selected mode into a newly allocated envelope.
void check_srv_room_peer_status(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Checks the current state of opening a given room from this peer and re-publishes it if necessary to a...
void remove_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
Removes the configuration for a given room of a service.
enum GNUNET_GenericReturnValue open_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle)
Tries to open a room for a given handle.
void destroy_srv_room(struct GNUNET_MESSENGER_SrvRoom *room, enum GNUNET_GenericReturnValue deletion)
Destroys a room and frees its memory fully.
static void sign_srv_room_message_by_peer(const void *cls, struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash)
void forward_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Forwards a message with a given hash to a specific tunnel inside of a room.
uint32_t get_srv_room_connection_flags(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns connection flags about connection information of a given room and the service managing it.
enum GNUNET_GenericReturnValue request_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash, const struct GNUNET_MESSENGER_MemberSession *session, GNUNET_MESSENGER_MessageRequestCallback callback, void *cls)
Requests a message from a room identified by a given hash.
enum GNUNET_GenericReturnValue check_tunnel_message(void *cls, const struct GNUNET_MessageHeader *header)
static void handle_room_messages(struct GNUNET_MESSENGER_SrvRoom *room)
void callback_room_handle_message(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
enum GNUNET_GenericReturnValue send_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_MESSENGER_Message *message)
Sends a message from a given handle into a room.
struct GNUNET_MESSENGER_OperationStore * get_srv_room_operation_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used operation store of a given room.
static enum GNUNET_GenericReturnValue iterate_send_room_message(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
static void close_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
void callback_tunnel_disconnect(void *cls, const struct GNUNET_CADET_Channel *channel)
void callback_room_deletion(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash)
void solve_srv_room_member_collisions(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_CRYPTO_PublicKey *public_key, const struct GNUNET_ShortHashCode *member_id, struct GNUNET_TIME_Absolute timestamp)
Checks for potential collisions with member ids and solves them changing active handles ids if they u...
struct GNUNET_CADET_Handle * get_srv_room_cadet(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the CADET handle from a rooms service.
enum GNUNET_GenericReturnValue delete_srv_room_message(struct GNUNET_MESSENGER_SrvRoom *room, struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash, const struct GNUNET_TIME_Relative delay)
Deletes a message from the room with a given hash in a specific delay if the provided member by its s...
const struct GNUNET_HashCode * get_srv_room_key(const struct GNUNET_MESSENGER_SrvRoom *room)
Returns the shared secret you need to access a room.
static enum GNUNET_GenericReturnValue iterate_update_member_sessions(void *cls, const struct GNUNET_CRYPTO_PublicKey *public_key, struct GNUNET_MESSENGER_MemberSession *session)
void callback_room_disconnect(struct GNUNET_MESSENGER_SrvRoom *room, void *cls)
void callback_room_merge(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_HashCode *hash)
struct GNUNET_MESSENGER_MemberStore * get_srv_room_member_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used member store of a given room.
void load_srv_room(struct GNUNET_MESSENGER_SrvRoom *room)
Loads the local configuration for a given room of a service which contains the last messages hash and...
#define GNUNET_MESSENGER_MERGE_DELAY
#define GNUNET_MESSENGER_IDLE_DELAY
void() GNUNET_MESSENGER_MessageRequestCallback(void *cls, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Method called whenever a message is found during a request in a room.
enum GNUNET_GenericReturnValue get_service_peer_identity(struct GNUNET_MESSENGER_Service *service, struct GNUNET_PeerIdentity *peer)
Tries to write the peer identity of the peer running a service on to the peer parameter.
void handle_service_message(struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_MESSENGER_SenderSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Sends a received or sent message with a given hash to each handle of a service which is currently mem...
void forward_tunnel_message(struct GNUNET_MESSENGER_SrvTunnel *tunnel, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Forwards a given message with a known hash through a tunnel.
void send_tunnel_envelope(struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_MQ_Envelope *env, const struct GNUNET_HashCode *hash)
Sends an envelope containing a message with a given hash through a tunnel.
enum GNUNET_GenericReturnValue is_tunnel_connected(const struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Returns the status of a currently bound channel of a tunnel.
void bind_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_CADET_Channel *channel)
Binds a CADET channel to a tunnel and replaces its channel the tunnel is currently bound to if necess...
uint32_t get_tunnel_messenger_version(const struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Returns the current messenger version the peer connected via a given tunnel has reported to be using ...
void get_tunnel_peer_identity(const struct GNUNET_MESSENGER_SrvTunnel *tunnel, struct GNUNET_PeerIdentity *peer)
Writes the peer identity of the peer connected via tunnel to this peer into the peer parameter.
struct GNUNET_MESSENGER_SrvTunnel * create_tunnel(struct GNUNET_MESSENGER_SrvRoom *room, const struct GNUNET_PeerIdentity *door)
Creates and allocates a tunnel of a room to a specific peer identity (called door).
void disconnect_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Disconnects and unbinds a channel from a tunnel.
enum GNUNET_GenericReturnValue connect_tunnel(struct GNUNET_MESSENGER_SrvTunnel *tunnel)
Tries to connect a tunnel by creating a new CADET channel and binding it.
enum GNUNET_GenericReturnValue send_tunnel_message(struct GNUNET_MESSENGER_SrvTunnel *tunnel, void *handle, struct GNUNET_MESSENGER_Message *message)
Sends a message by packing it automatically into an envelope and passing it through the tunnel.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
static enum @44 mode
Should we do a PUT (mode = 0) or GET (mode = 1);.
struct GNUNET_CADET_Port * GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, const struct GNUNET_HashCode *port, GNUNET_CADET_ConnectEventHandler connects, void *connects_cls, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Open a port to receive incoming MQ-based channels.
Definition: cadet_api.c:954
void GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p)
Close a port opened with GNUNET_CADET_open_port.
Definition: cadet_api.c:801
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_remove(const char *filename)
Remove all files in a directory (rm -rf).
Definition: disk.c:1087
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_test(const char *fil, int is_readable)
Test if fil is a directory and listable.
Definition: disk.c:403
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_create(const char *dir)
Implementation of "mkdir -p".
Definition: disk.c:496
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:41
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_contains(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Check if the map contains any value under the given key (including values that are NULL).
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
unsigned int GNUNET_CONTAINER_multipeermap_size(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Get the number of key-value pairs in the map.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
#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_PUBLIC_KEY_TYPE_EDDSA
EDDSA identity.
@ GNUNET_SCHEDULER_PRIORITY_IDLE
Run when otherwise idle.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
@ GNUNET_SYSERR
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#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_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
@ GNUNET_ERROR_TYPE_INFO
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
const char * GNUNET_MESSENGER_name_of_kind(enum GNUNET_MESSENGER_MessageKind kind)
Get the name of a message kind.
Definition: messenger_api.c:42
#define GNUNET_MESSENGER_VERSION
Version number of GNUnet Messenger API.
@ GNUNET_MESSENGER_KIND_INFO
The info kind.
@ GNUNET_MESSENGER_KIND_MISS
The miss kind.
@ GNUNET_MESSENGER_KIND_REQUEST
The request kind.
@ GNUNET_MESSENGER_KIND_LEAVE
The leave kind.
@ GNUNET_MESSENGER_KIND_PEER
The peer kind.
@ GNUNET_MESSENGER_KIND_UNKNOWN
The unknown kind.
@ GNUNET_MESSENGER_KIND_KEY
The key kind.
@ GNUNET_MESSENGER_KIND_JOIN
The join kind.
@ GNUNET_MESSENGER_KIND_DELETE
The delete kind.
@ GNUNET_MESSENGER_KIND_CONNECTION
The connection kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
@ GNUNET_MESSENGER_KIND_ID
The id kind.
@ GNUNET_MESSENGER_FLAG_CONNECTION_AUTO
The auto flag.
@ GNUNET_MESSENGER_FLAG_CONNECTION_NONE
The none flag.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
void GNUNET_PEER_resolve(GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
Convert an interned PID to a normal peer identity.
Definition: peer.c:220
#define GNUNET_MESSAGE_TYPE_CADET_CLI
Traffic (net-cat style) used by the Command Line Interface.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:975
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:1202
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:1226
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero_(void)
Return relative time of 0ms.
Definition: time.c:133
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
Definition: time.c:111
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_forever_(void)
Return "forever".
Definition: time.c:196
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
Definition: time.c:737
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute end)
Compute the time difference between the given start and end times.
Definition: time.c:421
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
Definition: time.c:638
void load_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const char *path)
Loads the list of tunnels peer identities from a file under a given path.
struct GNUNET_MESSENGER_ListTunnel * find_list_tunnels_alternate(struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer)
Searches linearly through the list of tunnels peer identities for matching against a specific peer id...
void init_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels)
Initializes list of tunnels peer identities as empty list.
void save_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const char *path)
Saves the list of tunnels peer identities to a file under a given path.
enum GNUNET_GenericReturnValue verify_list_tunnels_flag_token(const struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer, enum GNUNET_MESSENGER_ConnectionFlags flag)
Verifies that a specific tunnel selected by its peer identity in a list of tunnels is the first in or...
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.
enum GNUNET_GenericReturnValue contains_list_tunnels(struct GNUNET_MESSENGER_ListTunnels *tunnels, const struct GNUNET_PeerIdentity *peer)
Tests linearly if the list of tunnels peer identities contains a specific peer identity and returns G...
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...
enum GNUNET_GenericReturnValue is_peer_message(const struct GNUNET_MESSENGER_Message *message)
Returns whether a specific kind of message can be sent by the service without usage of a clients priv...
struct GNUNET_MQ_Envelope * pack_message(struct GNUNET_MESSENGER_Message *message, struct GNUNET_HashCode *hash, const GNUNET_MESSENGER_SignFunction sign, enum GNUNET_MESSENGER_PackMode mode, const void *cls)
Encodes the message to pack it into a newly allocated envelope if mode is equal to GNUNET_MESSENGER_P...
void destroy_message(struct GNUNET_MESSENGER_Message *message)
Destroys a message and frees its memory fully.
void sign_message_by_peer(struct GNUNET_MESSENGER_Message *message, uint16_t length, char *buffer, const struct GNUNET_HashCode *hash, const struct GNUNET_CONFIGURATION_Handle *cfg)
Signs the hash of a message with the peer identity of a given config and writes the signature into th...
GNUNET_MESSENGER_PackMode
@ GNUNET_MESSENGER_PACK_MODE_UNKNOWN
@ GNUNET_MESSENGER_PACK_MODE_ENVELOPE
enum GNUNET_GenericReturnValue generate_free_member_id(struct GNUNET_ShortHashCode *id, const struct GNUNET_CONTAINER_MultiShortmap *members)
Tries to generate an unused member id and store it into the id parameter.
void convert_messenger_key_to_port(const struct GNUNET_HashCode *key, struct GNUNET_HashCode *port)
Converts a Messenger service key of a room to the specific port which gets used for the CADET channel...
void convert_peer_identity_to_id(const struct GNUNET_PeerIdentity *identity, struct GNUNET_ShortHashCode *id)
Converts a peers identity to a short hash code which can be used as id to refer to a peer via sender ...
void delayed_disconnect_channel(struct GNUNET_CADET_Channel *channel)
Starts an urgent task to close a CADET channel asynchronously.
#define DIR_SEPARATOR
Definition: platform.h:165
Opaque handle to a channel.
Definition: cadet.h:116
Opaque handle to the service.
Definition: cadet_api.c:39
An identity key as per LSD0001.
uint32_t type
Type of signature.
A 512-bit hashcode.
struct GNUNET_MESSENGER_SrvHandle * handle
struct GNUNET_MESSENGER_Message * message
struct GNUNET_MESSENGER_SrvTunnel * exclude
struct GNUNET_MESSENGER_SrvRoom * room
struct GNUNET_MESSENGER_ListHandle * next
struct GNUNET_MESSENGER_SrvHandle * handle
struct GNUNET_MESSENGER_ListHandle * head
struct GNUNET_MESSENGER_ListMessage * head
struct GNUNET_MESSENGER_ListMessage * tail
struct GNUNET_MESSENGER_ListTunnel * next
struct GNUNET_MESSENGER_ListTunnel * head
struct GNUNET_MESSENGER_MemberSessionCompletion * prev
struct GNUNET_MESSENGER_MemberSession * session
struct GNUNET_MESSENGER_MemberSessionCompletion * next
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_MESSENGER_MemberSessionCompletion * head
const struct GNUNET_MESSENGER_Message * message
struct GNUNET_MESSENGER_MemberSessionCompletion * tail
struct GNUNET_CONTAINER_MultiHashMap * sessions
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_HashCode previous
The hash of the previous message from the senders perspective.
enum GNUNET_MESSENGER_MessageKind kind
The kind of the message.
struct GNUNET_CRYPTO_Signature signature
The signature of the senders private key.
struct GNUNET_TIME_AbsoluteNBO timestamp
The timestamp of the message.
struct GNUNET_ShortHashCode sender_id
The senders id inside of the room the message was sent in.
struct GNUNET_HashCode previous
The hash of a second previous message.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
struct GNUNET_MESSENGER_MemberSession * member
enum GNUNET_GenericReturnValue auto_routing
struct GNUNET_CADET_Handle * cadet
struct GNUNET_MESSENGER_ListHandles handles
enum GNUNET_GenericReturnValue auto_connecting
struct GNUNET_HashCode * peer_message
struct GNUNET_MESSENGER_PeerStore peer_store
struct GNUNET_CONTAINER_MultiPeerMap * tunnels
struct GNUNET_MESSENGER_MemberStore member_store
struct GNUNET_MESSENGER_Service * service
struct GNUNET_CADET_Port * port
struct GNUNET_MESSENGER_ListTunnels basement
struct GNUNET_SCHEDULER_Task * idle
struct GNUNET_MESSENGER_MessageStore message_store
struct GNUNET_MESSENGER_MessageState state
struct GNUNET_MESSENGER_ListMessages handling
struct GNUNET_MESSENGER_OperationStore operation_store
struct GNUNET_MESSENGER_SrvHandle * host
struct GNUNET_CADET_Channel * channel
struct GNUNET_MESSENGER_SrvRoom * room
Message handler for a specific message type.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
A 256-bit hashcode.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.