2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 #include "gnunet_util_lib.h"
24 #include "gnunet_statistics_service.h"
26 #include "mesh_protocol_enc.h"
28 #include "gnunet-service-mesh_tunnel.h"
29 #include "gnunet-service-mesh_connection.h"
30 #include "gnunet-service-mesh_channel.h"
31 #include "gnunet-service-mesh_peer.h"
32 #include "mesh_path.h"
34 #define LOG(level, ...) GNUNET_log_from(level,"mesh-tun",__VA_ARGS__)
37 /******************************************************************************/
38 /******************************** STRUCTS **********************************/
39 /******************************************************************************/
43 struct MeshTChannel *next;
44 struct MeshTChannel *prev;
45 struct MeshChannel *ch;
48 struct MeshTConnection
50 struct MeshTConnection *next;
51 struct MeshTConnection *prev;
52 struct MeshConnection *c;
56 * Struct containing all information regarding a tunnel to a peer.
61 * Endpoint of the tunnel.
63 struct MeshPeer *peer;
66 * State of the tunnel.
68 enum MeshTunnelState state;
71 * Local peer ephemeral private key
73 struct GNUNET_CRYPTO_EccPrivateKey *my_eph_key;
76 * Local peer ephemeral public key
78 struct GNUNET_CRYPTO_EccPublicSignKey *my_eph;
81 * Remote peer's public key.
83 struct GNUNET_CRYPTO_EccPublicSignKey *peers_eph;
86 * Encryption ("our") key.
88 struct GNUNET_CRYPTO_SymmetricSessionKey e_key;
91 * Decryption ("their") key.
93 struct GNUNET_CRYPTO_SymmetricSessionKey d_key;
96 * Paths that are actively used to reach the destination peer.
98 struct MeshTConnection *connection_head;
99 struct MeshTConnection *connection_tail;
102 * Next connection number.
107 * Channels inside this tunnel.
109 struct MeshTChannel *channel_head;
110 struct MeshTChannel *channel_tail;
113 * Channel ID for the next created channel.
115 MESH_ChannelNumber next_chid;
118 * Channel ID for the next incoming channel.
120 MESH_ChannelNumber next_local_chid;
123 * Pending message count.
125 int pending_messages;
128 * Destroy flag: if true, destroy on last message.
133 * Queued messages, to transmit once tunnel gets connected.
135 struct MeshTunnelQueue *tq_head;
136 struct MeshTunnelQueue *tq_tail;
141 * Struct used to queue messages in a tunnel.
143 struct MeshTunnelQueue
148 struct MeshTunnelQueue *next;
149 struct MeshTunnelQueue *prev;
154 struct MeshChannel *ch;
159 /* struct GNUNET_MessageHeader *msg; */
162 /******************************************************************************/
163 /******************************* GLOBALS ***********************************/
164 /******************************************************************************/
167 * Global handle to the statistics service.
169 extern struct GNUNET_STATISTICS_Handle *stats;
172 * Default TTL for payload packets.
174 static unsigned long long default_ttl;
177 * Local peer own ID (memory efficient handle).
179 static GNUNET_PEER_Id my_short_id;
182 * Local peer own ID (full value).
184 const static struct GNUNET_PeerIdentity *my_full_id;
189 const static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
192 /******************************************************************************/
193 /******************************** STATIC ***********************************/
194 /******************************************************************************/
197 * Get string description for tunnel state.
199 * @param s Tunnel state.
201 * @return String representation.
204 GMT_state2s (enum MeshTunnelState s)
206 static char buf[128];
210 case MESH_TUNNEL_NEW:
211 return "MESH_TUNNEL_NEW";
212 case MESH_TUNNEL_SEARCHING:
213 return "MESH_TUNNEL_SEARCHING";
214 case MESH_TUNNEL_WAITING:
215 return "MESH_TUNNEL_WAITING";
216 case MESH_TUNNEL_READY:
217 return "MESH_TUNNEL_READY";
218 case MESH_TUNNEL_RECONNECTING:
219 return "MESH_TUNNEL_RECONNECTING";
222 sprintf (buf, "%u (UNKNOWN STATE)", s);
229 * Search for a channel by global ID using full PeerIdentities.
231 * @param t Tunnel containing the channel.
232 * @param chid Public channel number.
234 * @return channel handler, NULL if doesn't exist
236 static struct MeshChannel *
237 get_channel (struct MeshTunnel3 *t, MESH_ChannelNumber chid)
239 struct MeshTChannel *iter;
244 for (iter = t->channel_head; NULL != iter; iter = iter->next)
246 if (GMCH_get_id (iter->ch) == chid)
250 return NULL == iter ? NULL : iter->ch;
255 * Pick a connection on which send the next data message.
257 * @param t Tunnel on which to send the message.
258 * @param fwd Is this a fwd message?
260 * @return The connection on which to send the next message.
262 static struct MeshConnection *
263 tunnel_get_connection (struct MeshTunnel3 *t, int fwd)
265 struct MeshTConnection *iter;
266 struct MeshConnection *best;
268 unsigned int lowest_q;
270 LOG (GNUNET_ERROR_TYPE_DEBUG, "tunnel_get_connection %s\n", GMP_2s (t->peer));
273 for (iter = t->connection_head; NULL != iter; iter = iter->next)
275 LOG (GNUNET_ERROR_TYPE_DEBUG, " connection %s: %u\n",
276 GNUNET_h2s (GMC_get_id (iter->c)), GMC_get_state (iter->c));
277 if (MESH_CONNECTION_READY == GMC_get_state (iter->c))
279 qn = GMC_get_qn (iter->c, fwd);
280 LOG (GNUNET_ERROR_TYPE_DEBUG, " q_n %u, \n", qn);
293 handle_data (struct MeshTunnel3 *t,
294 const struct GNUNET_MESH_Data *msg,
297 struct MeshChannel *ch;
302 size = ntohs (msg->header.size);
304 sizeof (struct GNUNET_MESH_Data) +
305 sizeof (struct GNUNET_MessageHeader))
310 type = ntohs (msg->header.type);
311 LOG (GNUNET_ERROR_TYPE_DEBUG, "got a %s message\n",
312 GNUNET_MESH_DEBUG_M2S (type));
313 LOG (GNUNET_ERROR_TYPE_DEBUG, " payload of type %s\n",
314 GNUNET_MESH_DEBUG_M2S (ntohs (msg[1].header.type)));
317 ch = get_channel (t, ntohl (msg->chid));
320 GNUNET_STATISTICS_update (stats, "# data on unknown channel",
322 LOG (GNUNET_ERROR_TYPE_DEBUG, "WARNING channel %u unknown\n",
327 GMT_change_state (t, MESH_TUNNEL_READY);
328 GMCH_handle_data (ch, msg, fwd);
332 handle_data_ack (struct MeshTunnel3 *t,
333 const struct GNUNET_MESH_DataACK *msg,
336 struct MeshChannel *ch;
340 size = ntohs (msg->header.size);
341 if (size != sizeof (struct GNUNET_MESH_DataACK))
348 ch = get_channel (t, ntohl (msg->chid));
351 GNUNET_STATISTICS_update (stats, "# data ack on unknown channel",
353 LOG (GNUNET_ERROR_TYPE_DEBUG, "WARNING channel %u unknown\n",
358 GMCH_handle_data_ack (ch, msg, fwd);
362 handle_ch_create (struct MeshTunnel3 *t,
363 const struct GNUNET_MESH_ChannelCreate *msg,
366 struct MeshTChannel *tch;
367 struct MeshChannel *ch;
371 size = ntohs (msg->header.size);
372 if (size != sizeof (struct GNUNET_MESH_ChannelCreate))
379 ch = get_channel (t, ntohl (msg->chid));
382 /* Probably a retransmission, safe to ignore */
383 LOG (GNUNET_ERROR_TYPE_DEBUG, " already exists...\n");
387 ch = GMCH_handle_create (msg, fwd);
390 tch = GNUNET_new (struct MeshTChannel);
392 GNUNET_CONTAINER_DLL_insert (t->channel_head, t->channel_tail, tch);
396 handle_ch_ack (struct MeshTunnel3 *t,
397 const struct GNUNET_MESH_ChannelManage *msg,
400 struct MeshChannel *ch;
404 size = ntohs (msg->header.size);
405 if (size != sizeof (struct GNUNET_MESH_ChannelManage))
412 ch = get_channel (t, ntohl (msg->chid));
415 GNUNET_STATISTICS_update (stats, "# channel ack on unknown channel",
417 LOG (GNUNET_ERROR_TYPE_DEBUG, "WARNING channel %u unknown\n",
422 GMCH_handle_ack (ch, msg, fwd);
426 handle_ch_destroy (struct MeshTunnel3 *t,
427 const struct GNUNET_MESH_ChannelManage *msg,
430 struct MeshChannel *ch;
434 size = ntohs (msg->header.size);
435 if (size != sizeof (struct GNUNET_MESH_ChannelManage))
442 ch = get_channel (t, ntohl (msg->chid));
445 /* Probably a retransmission, safe to ignore */
449 GMCH_handle_destroy (ch, msg, fwd);
452 /******************************************************************************/
453 /******************************** API ***********************************/
454 /******************************************************************************/
457 * Demultiplex by message type and call appropriate handler for a message
458 * towards a channel of a local tunnel.
460 * @param t Tunnel this message came on.
461 * @param msgh Message header.
462 * @param fwd Is this message fwd?
465 GMT_handle_decrypted (struct MeshTunnel3 *t,
466 const struct GNUNET_MessageHeader *msgh,
471 type = ntohs (msgh->type);
472 LOG (GNUNET_ERROR_TYPE_DEBUG,
473 "Got a %s message!\n",
474 GNUNET_MESH_DEBUG_M2S (type));
478 case GNUNET_MESSAGE_TYPE_MESH_DATA:
479 /* Don't send hop ACK, wait for client to ACK */
480 handle_data (t, (struct GNUNET_MESH_Data *) msgh, fwd);
483 case GNUNET_MESSAGE_TYPE_MESH_DATA_ACK:
484 handle_data_ack (t, (struct GNUNET_MESH_DataACK *) msgh, fwd);
487 case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE:
489 (struct GNUNET_MESH_ChannelCreate *) msgh,
493 case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_ACK:
495 (struct GNUNET_MESH_ChannelManage *) msgh,
499 case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY:
500 handle_ch_destroy (t,
501 (struct GNUNET_MESH_ChannelManage *) msgh,
507 LOG (GNUNET_ERROR_TYPE_DEBUG,
508 "end-to-end message not known (%u)\n",
515 * Cache a message to be sent once tunnel is online.
517 * @param t Tunnel to hold the message.
518 * @param ch Channel the message is about.
519 * @param msg Message itself (copy will be made).
520 * @param fwd Is this fwd?
523 GMT_queue_data (struct MeshTunnel3 *t,
524 struct MeshChannel *ch,
525 struct GNUNET_MessageHeader *msg,
528 struct MeshTunnelQueue *tq;
529 uint16_t size = ntohs (msg->size);
531 tq = GNUNET_malloc (sizeof (struct MeshTunnelQueue) + size);
534 memcpy (&tq[1], msg, size);
535 GNUNET_CONTAINER_DLL_insert_tail (t->tq_head, t->tq_tail, tq);
537 if (MESH_TUNNEL_READY == t->state)
538 GMT_send_queued_data (t, fwd);
543 * Send all cached messages that we can, tunnel is online.
545 * @param t Tunnel that holds the messages.
546 * @param fwd Is this fwd?
549 GMT_send_queued_data (struct MeshTunnel3 *t, int fwd)
551 struct MeshTunnelQueue *tq;
552 struct MeshTunnelQueue *next;
555 LOG (GNUNET_ERROR_TYPE_DEBUG,
556 "GMT_send_queued_data on tunnel %s\n",
558 room = GMT_get_buffer (t, fwd);
559 LOG (GNUNET_ERROR_TYPE_DEBUG, " buffer space: %u\n", room);
560 for (tq = t->tq_head; NULL != tq && room > 0; tq = next)
564 GNUNET_CONTAINER_DLL_remove (t->tq_head, t->tq_tail, tq);
565 GMCH_send_prebuilt_message ((struct GNUNET_MessageHeader *) &tq[1],
574 * Initialize the tunnel subsystem.
576 * @param c Configuration handle.
577 * @param id Peer identity.
578 * @param key ECC private key, to derive all other keys and do crypto.
581 GMT_init (const struct GNUNET_CONFIGURATION_Handle *c,
582 const struct GNUNET_PeerIdentity *id,
583 const struct GNUNET_CRYPTO_EccPrivateKey *key)
586 GNUNET_CONFIGURATION_get_value_number (c, "MESH", "DEFAULT_TTL",
589 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING,
590 "MESH", "DEFAULT_TTL", "USING DEFAULT");
594 my_private_key = key;
595 my_short_id = GNUNET_PEER_intern (my_full_id);
600 * Shut down the tunnel subsystem.
605 GNUNET_PEER_change_rc (my_short_id, -1);
615 struct MeshTunnel3 *t;
617 t = GNUNET_new (struct MeshTunnel3);
619 t->next_local_chid = GNUNET_MESH_LOCAL_CHANNEL_ID_SERV;
621 // GNUNET_CONTAINER_multihashmap_put (tunnels, tid, t,
622 // GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))
625 // tunnel_destroy (t);
629 // char salt[] = "salt";
630 // GNUNET_CRYPTO_kdf (&t->e_key, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
631 // salt, sizeof (salt),
632 // &t->e_key, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
633 // &my_full_id, sizeof (struct GNUNET_PeerIdentity),
634 // GNUNET_PEER_resolve2 (t->peer->id), sizeof (struct GNUNET_PeerIdentity),
636 // GNUNET_CRYPTO_kdf (&t->d_key, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
637 // salt, sizeof (salt),
638 // &t->d_key, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
639 // GNUNET_PEER_resolve2 (t->peer->id), sizeof (struct GNUNET_PeerIdentity),
640 // &my_full_id, sizeof (struct GNUNET_PeerIdentity),
649 * Change the tunnel state.
651 * @param t Tunnel whose state to change.
652 * @param state New state.
655 GMT_change_state (struct MeshTunnel3* t, enum MeshTunnelState state)
659 LOG (GNUNET_ERROR_TYPE_DEBUG,
660 "Tunnel %s state was %s\n",
662 GMT_state2s (t->state));
663 LOG (GNUNET_ERROR_TYPE_DEBUG,
664 "Tunnel %s state is now %s\n",
666 GMT_state2s (state));
672 * Add a connection to a tunnel.
675 * @param c Connection.
678 GMT_add_connection (struct MeshTunnel3 *t, struct MeshConnection *c)
680 struct MeshTConnection *aux;
682 for (aux = t->connection_head; aux != NULL; aux = aux->next)
686 aux = GNUNET_new (struct MeshTConnection);
688 GNUNET_CONTAINER_DLL_insert_tail (t->connection_head, t->connection_tail, aux);
693 * Remove a connection from a tunnel.
696 * @param c Connection.
699 GMT_remove_connection (struct MeshTunnel3 *t, struct MeshConnection *c)
701 struct MeshTConnection *aux;
703 for (aux = t->connection_head; aux != NULL; aux = aux->next)
706 GNUNET_CONTAINER_DLL_remove (t->connection_head, t->connection_tail, aux);
714 * Tunnel is empty: destroy it.
716 * Notifies all connections about the destruction.
718 * @param t Tunnel to destroy.
721 GMT_destroy_empty (struct MeshTunnel3 *t)
723 struct MeshTConnection *iter;
725 for (iter = t->connection_head; NULL != iter; iter = iter->next)
727 GMC_send_destroy (iter->c);
730 if (0 == t->pending_messages)
733 t->destroy = GNUNET_YES;
738 * Destroy tunnel if empty (no more channels).
740 * @param t Tunnel to destroy if empty.
743 GMT_destroy_if_empty (struct MeshTunnel3 *t)
745 if (1 < GMT_count_channels (t))
748 GMT_destroy_empty (t);
753 * Destroy the tunnel.
755 * This function does not generate any warning traffic to clients or peers.
758 * Cancel messages belonging to this tunnel queued to neighbors.
759 * Free any allocated resources linked to the tunnel.
761 * @param t The tunnel to destroy.
764 GMT_destroy (struct MeshTunnel3 *t)
766 struct MeshTConnection *iter;
767 struct MeshTConnection *next;
772 LOG (GNUNET_ERROR_TYPE_DEBUG, "destroying tunnel %s\n", GMP_2s (t->peer));
774 // if (GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (tunnels, &t->id, t))
777 for (iter = t->connection_head; NULL != iter; iter = next)
780 GMC_destroy (iter->c);
784 GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO);
785 GMP_set_tunnel (t->peer, NULL);
792 * Notifies a tunnel that a connection has broken that affects at least
793 * some of its peers. Sends a notification towards the root of the tree.
794 * In case the peer is the owner of the tree, notifies the client that owns
795 * the tunnel and tries to reconnect.
797 * FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
799 * @param t Tunnel affected.
800 * @param p1 Peer that got disconnected from p2.
801 * @param p2 Peer that got disconnected from p1.
803 * @return Short ID of the peer disconnected (either p1 or p2).
804 * 0 if the tunnel remained unaffected.
807 GMT_notify_connection_broken (struct MeshTunnel3* t,
808 GNUNET_PEER_Id p1, GNUNET_PEER_Id p2)
810 // if (myid != p1 && myid != p2) FIXME
815 // if (tree_get_predecessor (t->tree) != 0)
817 // /* We are the peer still connected, notify owner of the disconnection. */
818 // struct GNUNET_MESH_PathBroken msg;
819 // struct GNUNET_PeerIdentity neighbor;
821 // msg.header.size = htons (sizeof (msg));
822 // msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_PATH_BROKEN);
823 // GNUNET_PEER_resolve (t->id.oid, &msg.oid);
824 // msg.tid = htonl (t->id.tid);
825 // msg.peer1 = my_full_id;
826 // GNUNET_PEER_resolve (pid, &msg.peer2);
827 // GNUNET_PEER_resolve (tree_get_predecessor (t->tree), &neighbor);
828 // send_prebuilt_message (&msg.header, &neighbor, t);
834 * @brief Use the given path for the tunnel.
835 * Update the next and prev hops (and RCs).
836 * (Re)start the path refresh in case the tunnel is locally owned.
838 * @param t Tunnel to update.
839 * @param p Path to use.
841 * @return Connection created.
843 struct MeshConnection *
844 GMT_use_path (struct MeshTunnel3 *t, struct MeshPeerPath *p)
846 struct MeshConnection *c;
847 struct GNUNET_HashCode cid;
848 unsigned int own_pos;
850 if (NULL == t || NULL == p)
856 for (own_pos = 0; own_pos < p->length; own_pos++)
858 if (p->peers[own_pos] == my_short_id)
861 if (own_pos > p->length - 1)
867 GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_NONCE, &cid);
868 c = GMC_new (&cid, t, p, own_pos);
869 GMT_add_connection (t, c);
875 * FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
876 * Encrypt data with the tunnel key.
878 * @param t Tunnel whose key to use.
879 * @param dst Destination for the encrypted data.
880 * @param src Source of the plaintext.
881 * @param size Size of the plaintext.
882 * @param iv Initialization Vector to use.
883 * @param fwd Is this a fwd message?
886 GMT_encrypt (struct MeshTunnel3 *t,
887 void *dst, const void *src,
888 size_t size, uint64_t iv, int fwd)
890 memcpy (dst, src, size);
895 * FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
896 * Decrypt data with the tunnel key.
898 * @param t Tunnel whose key to use.
899 * @param dst Destination for the plaintext.
900 * @param src Source of the encrypted data.
901 * @param size Size of the encrypted data.
902 * @param iv Initialization Vector to use.
903 * @param fwd Is this a fwd message?
906 GMT_decrypt (struct MeshTunnel3 *t,
907 void *dst, const void *src,
908 size_t size, uint64_t iv, int fwd)
910 memcpy (dst, src, size);
915 * Count established (ready) connections of a tunnel.
917 * @param t Tunnel on which to count.
919 * @return Number of connections.
922 GMT_count_connections (struct MeshTunnel3 *t)
924 struct MeshTConnection *iter;
927 for (count = 0, iter = t->connection_head;
929 iter = iter->next, count++);
935 * Count channels of a tunnel.
937 * @param t Tunnel on which to count.
939 * @return Number of channels.
942 GMT_count_channels (struct MeshTunnel3 *t)
944 struct MeshTChannel *iter;
947 for (count = 0, iter = t->channel_head;
949 iter = iter->next, count++);
956 * Get the state of a tunnel.
960 * @return Tunnel's state.
963 GMT_get_state (struct MeshTunnel3 *t)
969 * Get the total buffer space for a tunnel.
972 * @param fwd Is this for FWD traffic?
974 * @return Buffer space offered by all connections in the tunnel.
977 GMT_get_buffer (struct MeshTunnel3 *t, int fwd)
979 struct MeshTConnection *iter;
982 iter = t->connection_head;
985 /* If terminal, return biggest channel buffer */
986 if (NULL == iter || GMC_is_terminal (iter->c, fwd))
988 struct MeshTChannel *iter_ch;
991 if (NULL == t->channel_head)
994 for (iter_ch = t->channel_head; NULL != iter_ch; iter_ch = iter_ch->next)
996 ch_buf = GMCH_get_buffer (iter_ch->ch, fwd);
1003 /* If not terminal, return sum of connection buffers */
1004 while (NULL != iter)
1006 if (GMC_get_state (iter->c) != MESH_CONNECTION_READY)
1012 buffer += GMC_get_buffer (iter->c, fwd);
1020 * Sends an already built message on a tunnel, choosing the best connection.
1022 * @param message Message to send. Function modifies it.
1023 * @param t Tunnel on which this message is transmitted.
1024 * @param ch Channel on which this message is transmitted.
1025 * @param fwd Is this a fwd message?
1028 GMT_send_prebuilt_message (struct GNUNET_MESH_Encrypted *msg,
1029 struct MeshTunnel3 *t,
1030 struct MeshChannel *ch,
1033 struct MeshConnection *c;
1036 LOG (GNUNET_ERROR_TYPE_DEBUG, "Send on Tunnel %s\n", GMP_2s (t->peer));
1037 c = tunnel_get_connection (t, fwd);
1040 GNUNET_break (GNUNET_YES == t->destroy);
1043 type = ntohs (msg->header.type);
1046 case GNUNET_MESSAGE_TYPE_MESH_FWD:
1047 case GNUNET_MESSAGE_TYPE_MESH_BCK:
1048 case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE:
1049 case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY:
1050 msg->cid = *GMC_get_id (c);
1051 msg->ttl = htonl (default_ttl);
1054 LOG (GNUNET_ERROR_TYPE_DEBUG, "unkown type %s\n",
1055 GNUNET_MESH_DEBUG_M2S (type));
1060 GMC_send_prebuilt_message (&msg->header, c, ch, fwd);