+/**
+ * Send keepalive packets for a peer
+ *
+ * @param cls Closure (tunnel for which to send the keepalive).
+ * @param tc Notification context.
+ *
+ * TODO: implement explicit multicast keepalive?
+ */
+void
+path_refresh (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct MeshTunnel *t = cls;
+ struct GNUNET_MessageHeader *payload;
+ struct GNUNET_MESH_Multicast *msg;
+ size_t size;
+
+ t->path_refresh_task = GNUNET_SCHEDULER_NO_TASK;
+ if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
+ {
+ return;
+ }
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: sending keepalive for tunnel %d\n",
+ t->id.tid);
+
+ size = sizeof(struct GNUNET_MESH_Multicast) +
+ sizeof(struct GNUNET_MessageHeader);
+ msg = GNUNET_malloc (size);
+ msg->header.size = htons (size);
+ msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_MULTICAST);
+ msg->oid = my_full_id;
+ msg->tid = htonl(t->id.tid);
+ payload = (struct GNUNET_MessageHeader *) &msg[1];
+ payload->size = htons (sizeof(struct GNUNET_MessageHeader));
+ payload->type = htons (GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE);
+ handle_mesh_data_multicast (NULL, &my_full_id, &msg->header, NULL);
+
+ GNUNET_free (msg);
+ t->path_refresh_task =
+ GNUNET_SCHEDULER_add_delayed (t->tree->refresh, &path_refresh, t);
+ return;
+}
+
+