GNUnet 0.22.2
gnunet-service-cadet.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2001-2013, 2017 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
35#include "gnunet_util_lib.h"
36#include "cadet.h"
47#include "gnunet_constants.h"
48
49
50#define LOG(level, ...) GNUNET_log (level, __VA_ARGS__)
51
52
57{
62
67
73
78
83
89
95
99 unsigned int id;
100};
101
102
103/******************************************************************************/
104/*********************** GLOBAL VARIABLES ****************************/
105/******************************************************************************/
106
107/****************************** Global variables ******************************/
108
113
118
123
128
133
138
143
148
152static unsigned int next_client_id;
153
159
166
171
177
181unsigned long long ratchet_messages;
182
187
192
196unsigned long long drop_percent;
197
198
205void
207 struct GNUNET_MQ_Envelope *env)
208{
209 GNUNET_MQ_send (c->mq,
210 env);
211}
212
213
220const char *
222{
223 static char buf[32];
224
225 GNUNET_snprintf (buf,
226 sizeof(buf),
227 "Client(%u)",
228 c->id);
229 return buf;
230}
231
232
240static struct CadetChannel *
243{
245 ntohl (ccn.channel_of_client));
246}
247
248
257{
258 struct GNUNET_CADET_ClientChannelNumber ccn = c->next_ccn;
259
260 /* increment until we have a free one... */
261 while (NULL !=
263 ccn))
264 {
266 = htonl (1 + (ntohl (ccn.channel_of_client)));
267 if (ntohl (ccn.channel_of_client) >=
269 ccn.channel_of_client = htonl (0);
270 }
271 c->next_ccn.channel_of_client
272 = htonl (1 + (ntohl (ccn.channel_of_client)));
273 return ccn;
274}
275
276
291 struct CadetChannel *ch,
292 struct CadetPeer *dest,
293 const struct GNUNET_HashCode *port,
294 uint32_t options)
295{
296 struct GNUNET_MQ_Envelope *env;
299
300 ccn = client_get_next_ccn (c);
303 ntohl (
305 ch,
308 "Accepting incoming %s from %s on open port %s (%u), assigning ccn %X\n",
309 GCCH_2s (ch),
310 GCP_2s (dest),
312 (uint32_t) ntohl (options),
313 (uint32_t) ntohl (ccn.channel_of_client));
314 /* notify local client about incoming connection! */
315 env = GNUNET_MQ_msg (cm,
317 cm->ccn = ccn;
318 cm->port = *port;
319 cm->opt = htonl (options);
320 cm->peer = *GCP_get_id (dest);
322 env);
323 return ccn;
324}
325
326
336static int
338 const struct GNUNET_PeerIdentity *pid,
339 void *value)
340{
341 struct CadetPeer *cp = value;
342 struct CadetTunnel *t = GCP_get_tunnel (cp,
343 GNUNET_NO);
344
345 if (NULL != t)
347 return GNUNET_OK;
348}
349
350
360static int
362 const struct GNUNET_PeerIdentity *pid,
363 void *value)
364{
365 struct CadetPeer *cp = value;
366
368 return GNUNET_OK;
369}
370
371
375static void
377{
378 if (NULL != stats)
379 {
381 GNUNET_NO);
382 stats = NULL;
383 }
384 /* Destroy tunnels. Note that all channels must be destroyed first! */
386 NULL);
387 /* All tunnels, channels, connections and CORE must be down before this point. */
389 NULL);
390 /* All paths, tunnels, channels, connections and CORE must be down before this point. */
392 if (NULL != open_ports)
393 {
395 open_ports = NULL;
396 }
397 if (NULL != loose_channels)
398 {
400 loose_channels = NULL;
401 }
402 if (NULL != peers)
403 {
405 peers = NULL;
406 }
407 if (NULL != connections)
408 {
410 connections = NULL;
411 }
412 if (NULL != transport)
413 {
415 transport = NULL;
416 }
417 GCD_shutdown ();
418 GCH_shutdown ();
420 my_private_key = NULL;
421}
422
423
429static void
430shutdown_task (void *cls)
431{
433 "Shutting down\n");
435 GCO_shutdown ();
436 if (NULL == clients_head)
437 shutdown_rest ();
438}
439
440
450static int
452 const struct GNUNET_HashCode *port,
453 void *value)
454{
455 struct OpenPort *op = cls;
456 struct CadetChannel *ch = value;
457
458 GCCH_bind (ch,
459 op->c,
460 &op->port);
463 &op->h_port,
464 ch));
465 return GNUNET_YES;
466}
467
468
478static void
480 const struct GNUNET_CADET_PortMessage *pmsg)
481{
482 struct CadetClient *c = cls;
483 struct OpenPort *op;
484
486 "Open port %s requested by %s\n",
487 GNUNET_h2s (&pmsg->port),
488 GSC_2s (c));
489 if (NULL == c->ports)
491 GNUNET_NO);
492 op = GNUNET_new (struct OpenPort);
493 op->c = c;
494 op->port = pmsg->port;
495 GCCH_hash_port (&op->h_port,
496 &pmsg->port,
497 &my_full_id);
498 if (GNUNET_OK !=
500 &op->port,
501 op,
503 {
504 GNUNET_break (0);
506 return;
507 }
509 &op->h_port,
510 op,
513 &op->h_port,
515 op);
517}
518
519
529static void
531 const struct GNUNET_CADET_PortMessage *pmsg)
532{
533 struct CadetClient *c = cls;
534 struct OpenPort *op;
535
537 "Closing port %s as requested by %s\n",
538 GNUNET_h2s (&pmsg->port),
539 GSC_2s (c));
540 if (NULL == c->ports)
541 {
542 /* Client closed a port despite _never_ having opened one? */
543 GNUNET_break (0);
545 return;
546 }
548 &pmsg->port);
549 if (NULL == op)
550 {
551 GNUNET_break (0);
553 return;
554 }
557 &op->port,
558 op));
561 &op->h_port,
562 op));
563 GNUNET_free (op);
565}
566
567
574static void
577{
578 struct CadetClient *c = cls;
579 struct CadetChannel *ch;
580
582 {
583 /* Channel ID not in allowed range. */
584 LOG (GNUNET_ERROR_TYPE_DEBUG,"Channel ID not in allowed range.");
585 GNUNET_break (0);
587 return;
588 }
589 ch = lookup_channel (c,
590 tcm->ccn);
591 if (NULL != ch)
592 {
593 /* Channel ID already in use. Not allowed. */
594 LOG (GNUNET_ERROR_TYPE_DEBUG,"Channel ID already in use. Not allowed.");
595 GNUNET_break (0);
597 return;
598 }
600 "New channel to %s at port %s requested by %s\n",
601 GNUNET_i2s (&tcm->peer),
602 GNUNET_h2s (&tcm->port),
603 GSC_2s (c));
604
605 /* Create channel */
607 tcm->ccn,
608 GCP_get (&tcm->peer,
609 GNUNET_YES),
610 &tcm->port,
611 ntohl (tcm->opt));
612 if (NULL == ch)
613 {
614 GNUNET_break (0);
616 return;
617 }
620 ntohl (
621 tcm->ccn.
622 channel_of_client),
623 ch,
625
627}
628
629
636static void
638 const struct
640{
641 struct CadetClient *c = cls;
642 struct CadetChannel *ch;
643
644 ch = lookup_channel (c,
645 msg->ccn);
646 if (NULL == ch)
647 {
648 /* Client attempted to destroy unknown channel.
649 Can happen if the other side went down at the same time.*/
651 "%s tried to destroy unknown channel %X\n",
652 GSC_2s (c),
653 (uint32_t) ntohl (msg->ccn.channel_of_client));
655 return;
656 }
658 "%s is destroying %s\n",
659 GSC_2s (c),
660 GCCH_2s (ch));
663 ntohl (
664 msg->ccn.
665 channel_of_client),
666 ch));
668 c,
669 msg->ccn);
671}
672
673
681static int
683 const struct GNUNET_CADET_LocalData *msg)
684{
685 size_t payload_size;
686 size_t payload_claimed_size;
687 const char *buf;
688 struct GNUNET_MessageHeader pa;
689
690 /* FIXME: what is the format we shall allow for @a msg?
691 ONE payload item or multiple? Seems current cadet_api
692 at least in theory allows more than one. Next-gen
693 cadet_api will likely no more, so we could then
694 simplify this mess again. *//* Sanity check for message size */payload_size = ntohs (msg->header.size) - sizeof(*msg);
695 buf = (const char *) &msg[1];
696 while (payload_size >= sizeof(struct GNUNET_MessageHeader))
697 {
698 /* need to memcpy() for alignment */
699 GNUNET_memcpy (&pa,
700 buf,
701 sizeof(pa));
702 payload_claimed_size = ntohs (pa.size);
703 if ((payload_size < payload_claimed_size) ||
704 (payload_claimed_size < sizeof(struct GNUNET_MessageHeader)) ||
705 (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE < payload_claimed_size))
706 {
707 GNUNET_break (0);
709 "Local data of %u total size had sub-message %u at %u with %u bytes\n",
710 ntohs (msg->header.size),
711 ntohs (pa.type),
712 (unsigned int) (buf - (const char *) &msg[1]),
713 (unsigned int) payload_claimed_size);
714 return GNUNET_SYSERR;
715 }
716 payload_size -= payload_claimed_size;
717 buf += payload_claimed_size;
718 }
719 if (0 != payload_size)
720 {
721 GNUNET_break_op (0);
722 return GNUNET_SYSERR;
723 }
724 return GNUNET_OK;
725}
726
727
735static void
737 const struct GNUNET_CADET_LocalData *msg)
738{
739 struct CadetClient *c = cls;
740 struct CadetChannel *ch;
741 size_t payload_size;
742 const char *buf;
743
744 ch = lookup_channel (c,
745 msg->ccn);
746 if (NULL == ch)
747 {
748 /* Channel does not exist (anymore) */
750 "Dropping payload for channel %u from client (channel unknown, other endpoint may have disconnected)\n",
751 (unsigned int) ntohl (msg->ccn.channel_of_client));
753 return;
754 }
755 payload_size = ntohs (msg->header.size) - sizeof(*msg);
757 "# payload received from clients",
758 payload_size,
759 GNUNET_NO);
760 buf = (const char *) &msg[1];
762 "Received %u bytes payload from %s for %s\n",
763 (unsigned int) payload_size,
764 GSC_2s (c),
765 GCCH_2s (ch));
766 if (GNUNET_OK !=
768 msg->ccn,
769 buf,
770 payload_size))
771 {
772 GNUNET_break (0);
774 return;
775 }
777}
778
779
786static void
788 const struct GNUNET_CADET_LocalAck *msg)
789{
790 struct CadetClient *c = cls;
791 struct CadetChannel *ch;
792
793 ch = lookup_channel (c,
794 msg->ccn);
795 if (NULL == ch)
796 {
797 /* Channel does not exist (anymore) */
799 "Ignoring local ACK for channel %u from client (channel unknown, other endpoint may have disconnected)\n",
800 (unsigned int) ntohl (msg->ccn.channel_of_client));
802 return;
803 }
805 "Got a local ACK from %s for %s\n",
806 GSC_2s (c),
807 GCCH_2s (ch));
809 msg->ccn);
811}
812
813
822static int
824 const struct GNUNET_PeerIdentity *peer,
825 void *value)
826{
827 struct CadetClient *c = cls;
828 struct CadetPeer *p = value;
829 struct GNUNET_MQ_Envelope *env;
831
834 msg->destination = *peer;
835 msg->paths = htons (GCP_count_paths (p));
836 msg->tunnel = htons (NULL != GCP_get_tunnel (p,
837 GNUNET_NO));
838 msg->best_path_length = htonl (0); // FIXME: get length of shortest known path!
839 GNUNET_MQ_send (c->mq,
840 env);
841 return GNUNET_YES;
842}
843
844
851static void
853 const struct GNUNET_MessageHeader *message)
854{
855 struct CadetClient *c = cls;
856 struct GNUNET_MQ_Envelope *env;
857 struct GNUNET_MessageHeader *reply;
858
860 c);
861 env = GNUNET_MQ_msg (reply,
863 GNUNET_MQ_send (c->mq,
864 env);
866}
867
868
879static int
881 struct CadetPeerPath *path,
882 unsigned int off)
883{
884 struct GNUNET_MQ_Handle *mq = cls;
885 struct GNUNET_MQ_Envelope *env;
886 struct GNUNET_CADET_LocalInfoPath *resp;
887 struct GNUNET_PeerIdentity *id;
888 size_t path_size;
889 unsigned int path_length;
890
891 path_length = GCPP_get_length (path);
892 path_size = sizeof(struct GNUNET_PeerIdentity) * path_length;
893 if (sizeof(*resp) + path_size > UINT16_MAX)
894 {
895 /* try just giving the relevant path */
896 path_length = GNUNET_MIN ((UINT16_MAX - sizeof(*resp)) / sizeof(struct
898 off);
899 path_size = sizeof(struct GNUNET_PeerIdentity) * path_length;
900 }
901 if (sizeof(*resp) + path_size > UINT16_MAX)
902 {
904 "Path of %u entries is too long for info message\n",
905 path_length);
906 return GNUNET_YES;
907 }
908 env = GNUNET_MQ_msg_extra (resp,
909 path_size,
911 id = (struct GNUNET_PeerIdentity *) &resp[1];
912
913 /* Don't copy first peer. First peer is always the local one. Last
914 * peer is always the destination (leave as 0, EOL).
915 */
916 for (unsigned int i = 0; i < path_length; i++)
917 id[i] = *GCP_get_id (GCPP_get_peer_at_offset (path,
918 i));
919 resp->off = htonl (off);
921 env);
922 return GNUNET_YES;
923}
924
925
932static void
935{
936 struct CadetClient *c = cls;
937 struct CadetPeer *p;
938 struct GNUNET_MQ_Envelope *env;
939 struct GNUNET_MessageHeader *resp;
940
941 p = GCP_get (&msg->peer,
942 GNUNET_NO);
943 if (NULL != p)
946 c->mq);
947 env = GNUNET_MQ_msg (resp,
949 GNUNET_MQ_send (c->mq,
950 env);
952}
953
954
963static int
965 const struct GNUNET_PeerIdentity *peer,
966 void *value)
967{
968 struct CadetClient *c = cls;
969 struct CadetPeer *p = value;
970 struct GNUNET_MQ_Envelope *env;
972 struct CadetTunnel *t;
973
974 t = GCP_get_tunnel (p,
975 GNUNET_NO);
976 if (NULL == t)
977 return GNUNET_YES;
980 msg->destination = *peer;
981 msg->channels = htonl (GCT_count_channels (t));
982 msg->connections = htonl (GCT_count_any_connections (t));
983 msg->cstate = htons (0);
984 msg->estate = htons (GCT_get_estate (t));
985 GNUNET_MQ_send (c->mq,
986 env);
987 return GNUNET_YES;
988}
989
990
997static void
999 const struct GNUNET_MessageHeader *message)
1000{
1001 struct CadetClient *c = cls;
1002 struct GNUNET_MQ_Envelope *env;
1003 struct GNUNET_MessageHeader *reply;
1004
1006 c);
1007 env = GNUNET_MQ_msg (reply,
1009 GNUNET_MQ_send (c->mq,
1010 env);
1012}
1013
1014
1021static void
1023 const struct GNUNET_CADET_RequestDropCadetMessage *message)
1024{
1025 struct CadetClient *c = cls;
1026 struct CadetChannel *ch;
1027
1028 ch = lookup_channel (c,
1029 message->ccn);
1030
1031 if (NULL != ch)
1032 GCCH_assign_type_to_drop (ch, message);
1033
1035}
1036
1037
1046static void *
1048 struct GNUNET_SERVICE_Client *client,
1049 struct GNUNET_MQ_Handle *mq)
1050{
1051 struct CadetClient *c;
1052
1053 c = GNUNET_new (struct CadetClient);
1054 c->client = client;
1055 c->mq = mq;
1056 c->id = next_client_id++; /* overflow not important: just for debug */
1057 c->channels
1061 c);
1063 "# clients",
1064 +1,
1065 GNUNET_NO);
1067 "%s connected\n",
1068 GSC_2s (c));
1069 return c;
1070}
1071
1072
1080void
1083 struct CadetChannel *ch)
1084{
1085 struct GNUNET_MQ_Envelope *env;
1087
1088 env = GNUNET_MQ_msg (tdm,
1090 tdm->ccn = ccn;
1092 env);
1095 ntohl (
1097 ch));
1098}
1099
1100
1101void
1103 struct CadetChannel *ch)
1104{
1107 h_port,
1108 ch));
1109}
1110
1111
1120static int
1122 uint32_t key,
1123 void *value)
1124{
1125 struct CadetClient *c = cls;
1127 struct CadetChannel *ch = value;
1128
1130 "Destroying %s, due to %s disconnecting.\n",
1131 GCCH_2s (ch),
1132 GSC_2s (c));
1133 ccn.channel_of_client = htonl (key);
1136 key,
1137 ch));
1139 c,
1140 ccn);
1141 return GNUNET_OK;
1142}
1143
1144
1153static int
1155 const struct GNUNET_HashCode *port,
1156 void *value)
1157{
1158 struct CadetClient *c = cls;
1159 struct OpenPort *op = value;
1160
1161 GNUNET_assert (c == op->c);
1163 "Closing port %s due to %s disconnect.\n",
1164 GNUNET_h2s (port),
1165 GSC_2s (c));
1168 &op->h_port,
1169 op));
1172 port,
1173 op));
1174 GNUNET_free (op);
1175 return GNUNET_OK;
1176}
1177
1178
1186static void
1188 struct GNUNET_SERVICE_Client *client,
1189 void *internal_cls)
1190{
1191 struct CadetClient *c = internal_cls;
1192
1193 GNUNET_assert (c->client == client);
1195 "%s is disconnecting.\n",
1196 GSC_2s (c));
1197 if (NULL != c->channels)
1198 {
1201 c);
1204 }
1205 if (NULL != c->ports)
1206 {
1209 c);
1211 }
1214 c);
1216 "# clients",
1217 -1,
1218 GNUNET_NO);
1219 GNUNET_free (c);
1220 if ((NULL == clients_head) &&
1222 shutdown_rest ();
1223}
1224
1225
1232static void
1233run (void *cls,
1234 const struct GNUNET_CONFIGURATION_Handle *c,
1236{
1237 cfg = c;
1238 if (GNUNET_OK !=
1240 "CADET",
1241 "RATCHET_MESSAGES",
1243 {
1245 "CADET",
1246 "RATCHET_MESSAGES",
1247 "needs to be a number");
1248 ratchet_messages = 64;
1249 }
1250 if (GNUNET_OK !=
1252 "CADET",
1253 "RATCHET_TIME",
1254 &ratchet_time))
1255 {
1257 "CADET",
1258 "RATCHET_TIME",
1259 "need delay value");
1261 }
1262 if (GNUNET_OK !=
1264 "CADET",
1265 "REFRESH_CONNECTION_TIME",
1267 {
1269 "CADET",
1270 "REFRESH_CONNECTION_TIME",
1271 "need delay value");
1273 }
1274 if (GNUNET_OK !=
1276 "CADET",
1277 "DROP_PERCENT",
1278 &drop_percent))
1279 {
1280 drop_percent = 0;
1281 }
1282 else
1283 {
1284 LOG (GNUNET_ERROR_TYPE_WARNING, "**************************************\n");
1285 LOG (GNUNET_ERROR_TYPE_WARNING, "Cadet is running with DROP enabled.\n");
1286 LOG (GNUNET_ERROR_TYPE_WARNING, "This is NOT a good idea!\n");
1287 LOG (GNUNET_ERROR_TYPE_WARNING, "Remove DROP_PERCENT from config file.\n");
1288 LOG (GNUNET_ERROR_TYPE_WARNING, "**************************************\n");
1289 }
1291 if (NULL == my_private_key)
1292 {
1293 GNUNET_break (0);
1295 return;
1296 }
1300 c);
1302 NULL);
1304 /* FIXME: optimize code to allow GNUNET_YES here! */
1306 GNUNET_NO);
1308 GNUNET_NO);
1310 GNUNET_YES);
1312 GNUNET_YES);
1313 GCH_init (c);
1314 GCD_init (c);
1315 GCO_init (c);
1317 "CADET started for peer %s\n",
1319}
1320
1321
1327 "cadet",
1329 &run,
1332 NULL,
1333 GNUNET_MQ_hd_fixed_size (port_open,
1336 NULL),
1337 GNUNET_MQ_hd_fixed_size (port_close,
1340 NULL),
1341 GNUNET_MQ_hd_fixed_size (channel_create,
1344 NULL),
1348 NULL),
1349 GNUNET_MQ_hd_var_size (local_data,
1352 NULL),
1353 GNUNET_MQ_hd_fixed_size (local_ack,
1355 struct GNUNET_CADET_LocalAck,
1356 NULL),
1359 struct GNUNET_MessageHeader,
1360 NULL),
1361 GNUNET_MQ_hd_fixed_size (show_path,
1364 NULL),
1365 GNUNET_MQ_hd_fixed_size (info_tunnels,
1367 struct GNUNET_MessageHeader,
1368 NULL),
1369 GNUNET_MQ_hd_fixed_size (drop_message,
1372 NULL),
1374
1375/* end of gnunet-service-cadet-new.c */
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
#define GNUNET_CADET_LOCAL_CHANNEL_ID_CLI
Minimum value for channel IDs of local clients.
Definition: cadet.h:70
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:143
static uint16_t port
Port number.
Definition: gnunet-bcd.c:146
static void get_peers(void *cls)
Call CADET's meta API, get all peers known to a peer.
Definition: gnunet-cadet.c:584
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
static char * value
Value of the record to add/remove.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
struct GNUNET_CONTAINER_MultiPeerMap * peers
Map from PIDs to struct CadetPeer entries.
struct GNUNET_CONTAINER_MultiShortmap * connections
Map from struct GNUNET_CADET_ConnectionTunnelIdentifier hash codes to struct CadetConnection objects.
static void handle_info_tunnels(void *cls, const struct GNUNET_MessageHeader *message)
Handler for client's GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS request.
static struct CadetClient * clients_tail
DLL with all the clients, tail.
struct GNUNET_PeerIdentity my_full_id
Local peer own ID.
void GSC_handle_remote_channel_destroy(struct CadetClient *c, struct GNUNET_CADET_ClientChannelNumber ccn, struct CadetChannel *ch)
A channel was destroyed by the other peer.
static void handle_channel_destroy(void *cls, const struct GNUNET_CADET_LocalChannelDestroyMessage *msg)
Handler for requests of destroying an existing channel.
static int channel_destroy_iterator(void *cls, uint32_t key, void *value)
Iterator for deleting each channel whose client endpoint disconnected.
static unsigned int next_client_id
Next ID to assign to a client.
GNUNET_SERVICE_MAIN(GNUNET_OS_project_data_gnunet(), "cadet", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_fixed_size(port_open, GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN, struct GNUNET_CADET_PortMessage, NULL), GNUNET_MQ_hd_fixed_size(port_close, GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE, struct GNUNET_CADET_PortMessage, NULL), GNUNET_MQ_hd_fixed_size(channel_create, GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE, struct GNUNET_CADET_LocalChannelCreateMessage, NULL), GNUNET_MQ_hd_fixed_size(channel_destroy, GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY, struct GNUNET_CADET_LocalChannelDestroyMessage, NULL), GNUNET_MQ_hd_var_size(local_data, GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, struct GNUNET_CADET_LocalData, NULL), GNUNET_MQ_hd_fixed_size(local_ack, GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK, struct GNUNET_CADET_LocalAck, NULL), GNUNET_MQ_hd_fixed_size(get_peers, GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS, struct GNUNET_MessageHeader, NULL), GNUNET_MQ_hd_fixed_size(show_path, GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH, struct GNUNET_CADET_RequestPathInfoMessage, NULL), GNUNET_MQ_hd_fixed_size(info_tunnels, GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS, struct GNUNET_MessageHeader, NULL), GNUNET_MQ_hd_fixed_size(drop_message, GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE, struct GNUNET_CADET_RequestDropCadetMessage, NULL), GNUNET_MQ_handler_end())
Define "main" method using service macro.
unsigned long long drop_percent
Set to non-zero values to create random drops to test retransmissions.
static void handle_port_open(void *cls, const struct GNUNET_CADET_PortMessage *pmsg)
Handle port open request.
static void handle_channel_create(void *cls, const struct GNUNET_CADET_LocalChannelCreateMessage *tcm)
Handler for requests for us creating a new channel to another peer and port.
struct GNUNET_STATISTICS_Handle * stats
Handle to the statistics service.
static void handle_show_path(void *cls, const struct GNUNET_CADET_RequestPathInfoMessage *msg)
Handler for client's GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH request.
static struct CadetChannel * lookup_channel(struct CadetClient *c, struct GNUNET_CADET_ClientChannelNumber ccn)
Lookup channel of client c by ccn.
const struct GNUNET_CONFIGURATION_Handle * cfg
Handle to our configuration.
struct GNUNET_TIME_Relative keepalive_period
How frequently do we send KEEPALIVE messages on idle connections?
static void handle_get_peers(void *cls, const struct GNUNET_MessageHeader *message)
Handler for client's INFO PEERS request.
static int get_all_tunnels_iterator(void *cls, const struct GNUNET_PeerIdentity *peer, void *value)
Iterator over all tunnels to send a monitoring client info about each tunnel.
static int bind_loose_channel(void *cls, const struct GNUNET_HashCode *port, void *value)
We had a remote connection value to port h_port before client cls opened port port.
void GSC_send_to_client(struct CadetClient *c, struct GNUNET_MQ_Envelope *env)
Send a message to a client.
static void shutdown_task(void *cls)
Task run during shutdown.
static int destroy_paths_now(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Callback invoked on all peers to destroy all tunnels that may still exist.
static void * client_connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Callback called when a client connects to the service.
int shutting_down
Signal that shutdown is happening: prevent recovery measures.
unsigned long long ratchet_messages
How many messages are needed to trigger an AXOLOTL ratchet advance.
static void run(void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service)
Setup CADET internals.
static int check_local_data(void *cls, const struct GNUNET_CADET_LocalData *msg)
Check for client traffic data message is well-formed.
static void handle_local_ack(void *cls, const struct GNUNET_CADET_LocalAck *msg)
Handler for client's ACKs for payload traffic.
static int client_release_ports(void *cls, const struct GNUNET_HashCode *port, void *value)
Remove client's ports from the global hashmap on disconnect.
struct GNUNET_TRANSPORT_ApplicationHandle * transport
Handle to Transport service.
static void handle_local_data(void *cls, const struct GNUNET_CADET_LocalData *msg)
Handler for client payload traffic to be send on a channel to another peer.
static void shutdown_rest()
Shutdown everything once the clients have disconnected.
static int path_info_iterator(void *cls, struct CadetPeerPath *path, unsigned int off)
Iterator over all paths of a peer to build an InfoPeer message.
static int get_all_peers_iterator(void *cls, const struct GNUNET_PeerIdentity *peer, void *value)
Iterator over all peers to send a monitoring client info about each peer.
#define LOG(level,...)
struct GNUNET_CONTAINER_MultiHashMap * open_ports
All ports clients of this peer have opened.
static struct CadetClient * clients_head
DLL with all the clients, head.
struct GNUNET_CADET_ClientChannelNumber GSC_bind(struct CadetClient *c, struct CadetChannel *ch, struct CadetPeer *dest, const struct GNUNET_HashCode *port, uint32_t options)
Bind incoming channel to this client, and notify client about incoming connection.
struct GNUNET_CONTAINER_MultiHashMap * loose_channels
Map from ports to channels where the ports were closed at the time we got the inbound connection.
struct GNUNET_CRYPTO_EddsaPrivateKey * my_private_key
Own private key.
static struct GNUNET_CADET_ClientChannelNumber client_get_next_ccn(struct CadetClient *c)
Obtain the next LID to use for incoming connections to the given client.
static void client_disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *internal_cls)
Callback called when a client disconnected from the service.
struct GNUNET_TIME_Relative ratchet_time
How long until we trigger a ratched advance due to time.
static void handle_drop_message(void *cls, const struct GNUNET_CADET_RequestDropCadetMessage *message)
Handler for client's GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE request.
static int destroy_tunnels_now(void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
Callback invoked on all peers to destroy all tunnels that may still exist.
static void handle_port_close(void *cls, const struct GNUNET_CADET_PortMessage *pmsg)
Handler for port close requests.
void GSC_drop_loose_channel(const struct GNUNET_HashCode *h_port, struct CadetChannel *ch)
A client that created a loose channel that was not bound to a port disconnected, drop it from the loo...
const char * GSC_2s(struct CadetClient *c)
Return identifier for a client as a string.
Information we track per peer.
static void channel_destroy(struct CadetChannel *ch)
Destroy the given channel.
int GCCH_handle_local_data(struct CadetChannel *ch, struct GNUNET_CADET_ClientChannelNumber sender_ccn, const char *buf, size_t buf_len)
Handle data given by a client.
void GCCH_bind(struct CadetChannel *ch, struct CadetClient *c, const struct GNUNET_HashCode *port)
A client is bound to the port that we have a channel open to.
const char * GCCH_2s(const struct CadetChannel *ch)
Get the static string for identification of the channel.
void GCCH_handle_local_ack(struct CadetChannel *ch, struct GNUNET_CADET_ClientChannelNumber client_ccn)
Handle ACK from client on local channel.
void GCCH_channel_local_destroy(struct CadetChannel *ch, struct CadetClient *c, struct GNUNET_CADET_ClientChannelNumber ccn)
Destroy locally created channel.
void GCCH_assign_type_to_drop(struct CadetChannel *ch, const struct GNUNET_CADET_RequestDropCadetMessage *message)
Assign type of message to drop.
struct CadetChannel * GCCH_channel_local_new(struct CadetClient *owner, struct GNUNET_CADET_ClientChannelNumber ccn, struct CadetPeer *destination, const struct GNUNET_HashCode *port, uint32_t options)
Create a new channel.
void GCCH_hash_port(struct GNUNET_HashCode *h_port, const struct GNUNET_HashCode *port, const struct GNUNET_PeerIdentity *listener)
Hash the port and initiator and listener to calculate the "challenge" h_port we send to the other pee...
GNUnet CADET service with encryption.
void GCO_shutdown()
Shut down the CORE subsystem.
void GCO_init(const struct GNUNET_CONFIGURATION_Handle *c)
Initialize the CORE subsystem.
cadet service; interaction with CORE service
void GCD_init(const struct GNUNET_CONFIGURATION_Handle *c)
Initialize the DHT subsystem.
void GCD_shutdown(void)
Shut down the DHT subsystem.
cadet service; dealing with DHT requests and results
void GCH_shutdown()
Shut down the hello subsystem.
void GCH_init(const struct GNUNET_CONFIGURATION_Handle *c)
Initialize the hello subsystem.
cadet service; dealing with hello messages
unsigned int GCPP_get_length(struct CadetPeerPath *path)
Return the length of the path.
struct CadetPeer * GCPP_get_peer_at_offset(struct CadetPeerPath *path, unsigned int off)
Obtain the peer at offset off in path.
const struct GNUNET_PeerIdentity * GCP_get_id(struct CadetPeer *cp)
Obtain the peer identity for a struct CadetPeer.
struct CadetPeer * GCP_get(const struct GNUNET_PeerIdentity *peer_id, int create)
Retrieve the CadetPeer structure associated with the peer.
struct CadetTunnel * GCP_get_tunnel(struct CadetPeer *cp, int create)
Get the tunnel towards a peer.
unsigned int GCP_count_paths(const struct CadetPeer *cp)
Count the number of known paths toward the peer.
void GCP_drop_owned_paths(struct CadetPeer *cp)
Drop all paths owned by this peer, and do not allow new ones to be added: We are shutting down.
unsigned int GCP_iterate_indirect_paths(struct CadetPeer *cp, GCP_PathIterator callback, void *callback_cls)
Iterate over the paths to a peer without direct link.
const char * GCP_2s(const struct CadetPeer *cp)
Get the static string for a peer ID.
void GCP_destroy_all_peers()
Clean up all entries about all peers.
void GCP_iterate_all(GNUNET_CONTAINER_PeerMapIterator iter, void *cls)
Iterate over all known peers.
Information we track per peer.
unsigned int GCT_count_any_connections(const struct CadetTunnel *t)
Counts the number of connections created for a tunnel, including busy connections.
unsigned int GCT_count_channels(struct CadetTunnel *t)
Returns the number of channels using a tunnel.
enum CadetTunnelEState GCT_get_estate(struct CadetTunnel *t)
Get the encryption state of a tunnel.
void GCT_destroy_tunnel_now(struct CadetTunnel *t)
Destroys the tunnel t now, without delay.
Information we track per tunnel.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static struct GNUNET_OS_Process * p
Helper process we started.
Definition: gnunet-uri.c:38
static struct GNUNET_SCHEDULER_Task * t
Main task.
API to create, modify and access statistics.
Bandwidth allocation API for applications to interact with.
void GNUNET_TRANSPORT_application_done(struct GNUNET_TRANSPORT_ApplicationHandle *ch)
Shutdown TRANSPORT application client.
struct GNUNET_TRANSPORT_ApplicationHandle * GNUNET_TRANSPORT_application_init(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the TRANSPORT application client handle.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
#define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE
Maximum message size that can be sent on CADET.
void GNUNET_CRYPTO_eddsa_key_get_public(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Extract the public key for the given private key.
Definition: crypto_ecc.c:201
struct GNUNET_CRYPTO_EddsaPrivateKey * GNUNET_CRYPTO_eddsa_key_create_from_configuration(const struct GNUNET_CONFIGURATION_Handle *cfg)
Create a new private key by reading our peer's key from the file specified in the configuration.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap32_put(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash 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.
struct GNUNET_CONTAINER_MultiHashMap32 * GNUNET_CONTAINER_multihashmap32_create(unsigned int len)
Create a 32-bit key multi hash map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
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.
unsigned int GNUNET_CONTAINER_multihashmap32_size(const struct GNUNET_CONTAINER_MultiHashMap32 *map)
Get the number of key-value pairs in 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).
void * GNUNET_CONTAINER_multihashmap32_get(const struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key)
Given a key find a value in the map matching the key.
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.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash 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).
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash 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.
void GNUNET_CONTAINER_multihashmap32_destroy(struct GNUNET_CONTAINER_MultiHashMap32 *map)
Destroy a 32-bit key hash map.
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_MultiHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define GNUNET_log(kind,...)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_MIN(a, b)
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
@ GNUNET_SYSERR
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
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.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
void GNUNET_log_config_invalid(enum GNUNET_ErrorType kind, const char *section, const char *option, const char *required)
Log error message about invalid configuration option value.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
@ GNUNET_ERROR_TYPE_INFO
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:305
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
Definition: gnunet_mq_lib.h:61
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:76
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE
Ask the cadet service to create a new channel.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS
Request local information about all peers known to the service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS
Local information about all tunnels of service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS_END
End of local information about all tunnels of service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK
Local ACK for data.
#define GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE
Request to drop a message of type X to peer y.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH_END
End of local information of service about a specific path.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH
Request local information of service about paths to specific peer.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS
Local information about all peers known to the service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS_END
End of local information about all peers known to the service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE
Stop listening on a port.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN
Start listening on a port.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH
Local information of service about a specific path.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS
Request local information about all tunnels of service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA
Payload client <-> service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY
Tell client that a channel was destroyed.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:567
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition: scheduler.c:1339
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
Definition: service.c:2418
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2389
@ GNUNET_SERVICE_OPTION_NONE
Use defaults.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
#define GNUNET_TIME_UNIT_HOURS
One hour.
#define GNUNET_TIME_UNIT_MINUTES
One minute.
Struct containing all information regarding a channel to a remote client.
Struct containing information about a client of the service.
struct GNUNET_MQ_Handle * mq
Handle to communicate with the client.
struct GNUNET_SERVICE_Client * client
Client handle.
struct CadetClient * prev
Linked list prev.
unsigned int id
ID of the client, mainly for debug messages.
struct GNUNET_CONTAINER_MultiHashMap * ports
Ports that this client has declared interest in.
struct GNUNET_CONTAINER_MultiHashMap32 * channels
Tunnels that belong to this client, indexed by local id, value is a struct CadetChannel.
struct GNUNET_CADET_ClientChannelNumber next_ccn
Channel ID to use for the next incoming channel for this client.
struct CadetClient * next
Linked list next.
Information regarding a possible path to reach a peer.
Struct containing all information regarding a given peer.
Struct containing all information regarding a tunnel to a peer.
Number uniquely identifying a channel of a client.
Definition: cadet.h:101
uint32_t channel_of_client
Values for channel numbering.
Definition: cadet.h:109
Message to allow the client send more data to the service (always service -> client).
Definition: cadet.h:280
Message for a client to create channels.
Definition: cadet.h:201
struct GNUNET_PeerIdentity peer
Channel's peer.
Definition: cadet.h:217
struct GNUNET_CADET_ClientChannelNumber ccn
ID of a channel controlled by this client.
Definition: cadet.h:212
struct GNUNET_HashCode port
Port of the channel.
Definition: cadet.h:222
Message for or to a client to destroy tunnel.
Definition: cadet.h:235
struct GNUNET_CADET_ClientChannelNumber ccn
ID of a channel controlled by this client.
Definition: cadet.h:244
Message for cadet data traffic.
Definition: cadet.h:252
Message to inform the client about one of the paths known to the service.
Definition: cadet.h:407
uint32_t off
Offset of the peer that was requested.
Definition: cadet.h:416
Message to inform the client about one of the peers in the service.
Definition: cadet.h:424
Message to inform the client about one of the tunnels in the service.
Definition: cadet.h:458
Message for a client to create and destroy channels.
Definition: cadet.h:181
struct GNUNET_HashCode port
Port to open/close.
Definition: cadet.h:193
Message to drop another message of specific type.
Definition: cadet.h:321
struct GNUNET_CADET_ClientChannelNumber ccn
ID of the channel we want to drop a message for.
Definition: cadet.h:336
Message to inform the client about channels in the service.
Definition: cadet.h:344
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
Private ECC key encoded for transmission.
A 512-bit hashcode.
Handle to a message queue.
Definition: mq.c:87
Header for all communications.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Handle to a client that is connected to a service.
Definition: service.c:249
Handle to a service.
Definition: service.c:116
Handle for the service.
Time for relative time used by GNUnet, in microseconds.
Handle to the TRANSPORT subsystem for application management.
Port opened by a client.
struct CadetClient * c
Client that opened the port.