40f464e9b707b65ec7cf50b58156cd6586963395
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_paths.c
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2001-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 /**
19  * @file cadet/gnunet-service-cadet_paths.c
20  * @brief Information we track per path.    
21  * @author Bartlomiej Polot
22  * @author Christian Grothoff
23  */
24 #include "platform.h"
25 #include "gnunet-service-cadet_connection.h"
26 #include "gnunet-service-cadet_tunnels.h"
27 #include "gnunet-service-cadet_peer.h"
28 #include "gnunet-service-cadet_paths.h"
29
30
31 #define LOG(level, ...) GNUNET_log_from(level,"cadet-pat",__VA_ARGS__)
32
33
34 /**
35  * Information regarding a possible path to reach a peer.
36  */
37 struct CadetPeerPath
38 {
39
40   /**
41    * Array of all the peers on the path.  If @e hn is non-NULL, the
42    * last one is our owner.
43    */
44   struct CadetPeerPathEntry **entries;
45
46   /**
47    * Node of this path in the owner's heap.  Used to update our position
48    * in the heap whenever our @e desirability changes.
49    */
50   struct GNUNET_CONTAINER_HeapNode *hn;
51
52   /**
53    * Desirability of the path. How unique is it for the various peers
54    * on it?
55    */
56   GNUNET_CONTAINER_HeapCostType desirability;
57
58   /**
59    * Length of the @e entries array.
60    */
61   unsigned int entries_length;
62
63 };
64
65
66 /**
67  * Calculate the path's desirability score.
68  *
69  * @param path path to calculate the score for
70  */
71 static void
72 recalculate_path_desirability (struct CadetPeerPath *path)
73 {
74   double result = 0.0;
75
76   for (unsigned int i=0;i<path->entries_length;i++)
77   {
78     struct CadetPeer *cp = path->entries[i]->peer;
79
80     result += GCP_get_desirability_of_path (cp,
81                                             i);
82   }
83   path->desirability = (GNUNET_CONTAINER_HeapCostType) result;
84 }
85
86
87 /**
88  * Return how much we like keeping the path.  This is an aggregate
89  * score based on various factors, including the age of the path
90  * (older == better), and the value of this path to all of its ajacent
91  * peers.  For example, long paths that end at a peer that we have no
92  * shorter way to reach are very desirable, while long paths that end
93  * at a peer for which we have a shorter way as well are much less
94  * desirable.  Higher values indicate more valuable paths.  The
95  * returned value should be used to decide which paths to remember.
96  *
97  * @param path path to return the length for
98  * @return desirability of the path, larger is more desirable
99  */
100 GNUNET_CONTAINER_HeapCostType
101 GCPP_get_desirability (const struct CadetPeerPath *path)
102 {
103   return path->desirability;
104 }
105
106
107 /**
108  * Return connection to @a destination using @a path, or return
109  * NULL if no such connection exists.
110  *
111  * @param path path to traverse
112  * @param destination destination node to get to, must be on path
113  * @param off offset of @a destination on @a path
114  * @return NULL if we have no existing connection
115  *         otherwise connection from us to @a destination via @a path
116  */
117 struct CadetConnection *
118 GCPP_get_connection (struct CadetPeerPath *path,
119                      struct CadetPeer *destination,
120                      unsigned int off)
121 {
122   struct CadetPeerPathEntry *entry;
123
124   GNUNET_assert (off < path->entries_length);
125   entry = path->entries[off];
126   GNUNET_assert (entry->peer == destination);
127   return entry->cc;
128 }
129
130
131 /**
132  * Notify @a path that it is used for connection @a cc
133  * which ends at the path's offset @a off.
134  *
135  * @param path the path to remember the @a cc
136  * @param off the offset where the @a cc ends
137  * @param cc the connection to remember
138  */
139 void
140 GCPP_add_connection (struct CadetPeerPath *path,
141                      unsigned int off,
142                      struct CadetConnection *cc)
143 {
144   struct CadetPeerPathEntry *entry;
145
146   LOG (GNUNET_ERROR_TYPE_DEBUG,
147        "Adding %s to path %s at offset %u\n",
148        GCC_2s (cc),
149        GCPP_2s (path),
150        off);
151   GNUNET_assert (off < path->entries_length);
152   entry = path->entries[off];
153   GNUNET_assert (NULL == entry->cc);
154   GNUNET_assert (NULL != cc);
155   entry->cc = cc;
156 }
157
158
159
160 /**
161  * Notify @a path that it is no longer used for connection @a cc which
162  * ended at the path's offset @a off.
163  *
164  * @param path the path to forget the @a cc
165  * @param off the offset where the @a cc ended
166  * @param cc the connection to forget
167  */
168 void
169 GCPP_del_connection (struct CadetPeerPath *path,
170                      unsigned int off,
171                      struct CadetConnection *cc)
172 {
173   struct CadetPeerPathEntry *entry;
174
175   LOG (GNUNET_ERROR_TYPE_DEBUG,
176        "Removing connection %s to path %s at offset %u\n",
177        GCC_2s (cc),
178        GCPP_2s (path),
179        off);
180   GNUNET_assert (off < path->entries_length);
181   entry = path->entries[off];
182   GNUNET_assert (cc == entry->cc);
183   entry->cc = NULL;
184 }
185
186
187 /**
188  * Tries to attach @a path to a peer, working backwards from the end
189  * and stopping at @a stop_at. If path->hn is NULL on return then the
190  * path was not attached and you can assume that path->entries_length
191  * is equal to @a stop_at.
192  *
193  * @param path the path to attach
194  * @param stop_at the path length at which to stop trying
195  */
196 static void
197 attach_path (struct CadetPeerPath *path, unsigned int stop_at)
198 {
199   GNUNET_assert (NULL == path->hn);
200
201   /* Try to attach this path to a peer, working backwards from the end. */
202   while (path->entries_length > stop_at)
203   {
204     unsigned int end = path->entries_length - 1;
205     struct CadetPeerPathEntry *entry = path->entries[end];
206     int force = GNUNET_NO;
207
208     recalculate_path_desirability (path);
209     /* If the entry already has a connection using it, force attach. */
210     if (NULL != entry->cc)
211       force = GNUNET_YES;
212     path->hn = GCP_attach_path (entry->peer,
213                                 path,
214                                 end,
215                                 force);
216     if (NULL != path->hn)
217       break;
218
219     /* Attach failed, trim this entry from the path. */
220     GNUNET_assert (NULL == entry->cc);
221     GCP_path_entry_remove (entry->peer,
222                            entry,
223                            end);
224     GNUNET_free (entry);
225     path->entries[end] = NULL;
226     path->entries_length--;
227   }
228
229   /* Shrink array to actual path length. */
230   GNUNET_array_grow (path->entries,
231                      path->entries_length,
232                      path->entries_length);
233 }
234
235
236 /**
237  * The owning peer of this path is no longer interested in maintaining
238  * it, so the path should be discarded or shortened (in case a
239  * previous peer on the path finds the path desirable).
240  *
241  * @param path the path that is being released
242  */
243 void
244 GCPP_release (struct CadetPeerPath *path)
245 {
246   struct CadetPeerPathEntry *entry;
247
248   LOG (GNUNET_ERROR_TYPE_DEBUG,
249        "Owner releases path %s\n",
250        GCPP_2s (path));
251   path->hn = NULL;
252   entry = path->entries[path->entries_length - 1];
253   GNUNET_assert (path == entry->path);
254   GNUNET_assert (NULL == entry->cc);
255   /* cut 'off' end of path */
256   GCP_path_entry_remove (entry->peer,
257                          entry,
258                          path->entries_length - 1);
259   GNUNET_free (entry);
260   path->entries[path->entries_length - 1] = NULL;
261   path->entries_length--;
262   /* see if new peer at the end likes this path any better */
263   attach_path (path, 0);
264   if (NULL == path->hn)
265   {
266     /* nobody wants us, discard the path */
267     GNUNET_assert (0 == path->entries_length);
268     GNUNET_assert (NULL == path->entries);
269     GNUNET_free (path);
270   }
271 }
272
273
274 /**
275  * Updates the score for an entry on the path based
276  * on our experiences with using @a path.
277  *
278  * @param path the path to update
279  * @param off offset of the entry to update
280  * @param delta change in the score to apply
281  */
282 void
283 GCPP_update_score (struct CadetPeerPath *path,
284                    unsigned int off,
285                    int delta)
286 {
287   struct CadetPeerPathEntry *entry;
288
289   GNUNET_assert (off < path->entries_length);
290   entry = path->entries[off];
291
292   /* Add delta, with checks for overflows */
293   if (delta >= 0)
294   {
295     if (delta + entry->score < entry->score)
296       entry->score = INT_MAX;
297     else
298       entry->score += delta;
299   }
300   else
301   {
302     if (delta + entry->score > entry->score)
303       entry->score = INT_MIN;
304     else
305       entry->score += delta;
306   }
307   recalculate_path_desirability (path);
308 }
309
310
311 /**
312  * Closure for #find_peer_at() and #check_match().
313  */
314 struct CheckMatchContext
315 {
316
317   /**
318    * Set to a matching path, if any.
319    */
320   struct CadetPeerPath *match;
321
322   /**
323    * Array the combined paths.
324    */
325   struct CadetPeer **cpath;
326
327   /**
328    * How long is the @e cpath array?
329    */
330   unsigned int cpath_length;
331
332 };
333
334
335 /**
336  * Check if the given path is identical on all of the
337  * hops until @a off, and not longer than @a off.  If the
338  * @a path matches, store it in `match`.
339  *
340  * @param cls the `struct CheckMatchContext` to check against
341  * @param path the path to check
342  * @param off offset to check at
343  * @return #GNUNET_YES (continue to iterate), or if found #GNUNET_NO
344  */
345 static int
346 check_match (void *cls,
347              struct CadetPeerPath *path,
348              unsigned int off)
349 {
350   struct CheckMatchContext *cm_ctx = cls;
351
352   GNUNET_assert (path->entries_length > off);
353   if ( (path->entries_length != off + 1) &&
354        (off + 1 != cm_ctx->cpath_length) )
355   {
356     LOG (GNUNET_ERROR_TYPE_DEBUG,
357          "check_match missmatch because path %s is too long (%u vs. %u vs. %u)\n",
358          GCPP_2s (path),
359          path->entries_length,
360          off + 1,
361          cm_ctx->cpath_length);
362     return GNUNET_YES; /* too long, goes somewhere else already, thus cannot be useful */
363   }
364   for (unsigned int i=0;i<off;i++)
365     if (cm_ctx->cpath[i] !=
366         GCPP_get_peer_at_offset (path,
367                                  i))
368     {
369       LOG (GNUNET_ERROR_TYPE_DEBUG,
370            "check_match path %s missmatches at offset %u\n",
371            GCPP_2s (path),
372            i);
373       return GNUNET_YES; /* missmatch, ignore */
374     }
375   LOG (GNUNET_ERROR_TYPE_DEBUG,
376        "check_match found match with path %s\n",
377        GCPP_2s (path));
378   cm_ctx->match = path;
379   return GNUNET_NO; /* match, we are done! */
380 }
381
382
383 /**
384  * Extend path @a path by the @a num_peers from the @a peers
385  * array, assuming the owners past the current owner want it.
386  *
387  * @param path path to extend
388  * @param peers list of peers beyond the end of @a path
389  * @param num_peers length of the @a peers array
390  * @param force force attachment, even if we have other
391  *        paths already
392  */
393 static void
394 extend_path (struct CadetPeerPath *path,
395              struct CadetPeer **peers,
396              unsigned int num_peers,
397              int force)
398 {
399   unsigned int old_len = path->entries_length;
400   int i;
401
402   /* Expand path */
403   GNUNET_array_grow (path->entries,
404                      path->entries_length,
405                      old_len + num_peers);
406   for (i=num_peers-1;i >= 0;i--)
407   {
408     struct CadetPeerPathEntry *entry = GNUNET_new (struct CadetPeerPathEntry);
409
410     path->entries[old_len + i] = entry;
411     entry->peer = peers[i];
412     entry->path = path;
413   }
414   for (i=num_peers-1;i >= 0;i--)
415   {
416     struct CadetPeerPathEntry *entry = path->entries[old_len + i];
417
418     GCP_path_entry_add (entry->peer,
419                         entry,
420                         old_len + i);
421   }
422
423   /* If we extend an existing path, detach it from the
424      old owner and re-attach to the new one */
425   GCP_detach_path (path->entries[old_len-1]->peer,
426                    path,
427                    path->hn);
428   path->hn = NULL;
429   path->entries_length = old_len + num_peers;
430   if (GNUNET_YES == force)
431   {
432     int end = path->entries_length - 1;
433
434     path->hn = GCP_attach_path (path->entries[end]->peer,
435                                 path,
436                                 end,
437                                 GNUNET_YES);
438   } else {
439     attach_path (path, old_len);
440   }
441   if (NULL == path->hn)
442   {
443     /* none of the peers is interested in this path;
444        re-attach. */
445     GNUNET_assert (old_len == path->entries_length);
446     path->hn = GCP_attach_path (path->entries[old_len - 1]->peer,
447                                 path,
448                                 old_len - 1,
449                                 GNUNET_YES);
450     GNUNET_assert (NULL != path->hn);
451     return;
452   }
453   LOG (GNUNET_ERROR_TYPE_DEBUG,
454        "Extended path %s\n",
455        GCPP_2s (path));
456 }
457
458
459 /**
460  * Create a peer path based on the result of a DHT lookup.  If we
461  * already know this path, or one that is longer, simply return NULL.
462  * Otherwise, we try to extend an existing path, or create a new one
463  * if applicable.
464  *
465  * @param get_path path of the get request
466  * @param get_path_length lenght of @a get_path
467  * @param put_path path of the put request
468  * @param put_path_length length of the @a put_path
469  * @return a path through the network
470  */
471 void
472 GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path,
473                         unsigned int get_path_length,
474                         const struct GNUNET_PeerIdentity *put_path,
475                         unsigned int put_path_length)
476 {
477   struct CadetPeer *cpath[get_path_length + put_path_length];
478   struct CheckMatchContext cm_ctx;
479   struct CadetPeerPath *path;
480   unsigned int skip;
481   unsigned int total_len;
482
483   /* precompute 'cpath' so we can avoid doing the lookups lots of times */
484   skip = 0;
485   memset (cpath,
486           0,
487           sizeof (cpath)); /* Just to trigger harder errors later. */
488   total_len = get_path_length + put_path_length;
489   for (unsigned int off=0;off<total_len;off++)
490   {
491     const struct GNUNET_PeerIdentity *pid;
492
493     pid = (off < get_path_length)
494       ? &get_path[get_path_length - off - 1]
495       : &put_path[get_path_length + put_path_length - off - 1];
496     /* Check that I am not in the path */
497     if (0 == memcmp (&my_full_id,
498                      pid,
499                      sizeof (struct GNUNET_PeerIdentity)))
500     {
501       skip = off + 1;
502       continue;
503     }
504     cpath[off - skip] = GCP_get (pid,
505                                  GNUNET_YES);
506     /* Check that no peer is twice on the path */
507     for (unsigned int i=0;i<off - skip;i++)
508     {
509      if (cpath[i] == cpath[off - skip])
510       {
511         skip = off - i;
512         break;
513       }
514     }
515   }
516   if (skip >= total_len)
517   {
518     LOG (GNUNET_ERROR_TYPE_DEBUG,
519          "Path discovered from DHT is one big cycle?\n");
520     return;
521   }
522   total_len -= skip;
523
524   /* First figure out if this path is a subset of an existing path, an
525      extension of an existing path, or a new path. */
526   cm_ctx.cpath_length = total_len;
527   cm_ctx.cpath = cpath;
528   cm_ctx.match = NULL;
529   for (int i=total_len-1;i>=0;i--)
530   {
531     GCP_iterate_paths_at (cpath[i],
532                           (unsigned int) i,
533                           &check_match,
534                           &cm_ctx);
535     if (NULL != cm_ctx.match)
536     {
537       if (i == total_len - 1)
538       {
539         /* Existing path includes this one, nothing to do! */
540         LOG (GNUNET_ERROR_TYPE_DEBUG,
541              "Path discovered from DHT is already known\n");
542         return;
543       }
544       if (cm_ctx.match->entries_length == i + 1)
545       {
546         /* Existing path ends in the middle of new path, extend it! */
547         LOG (GNUNET_ERROR_TYPE_DEBUG,
548              "Trying to extend existing path %s by additional links discovered from DHT\n",
549              GCPP_2s (cm_ctx.match));
550         extend_path (cm_ctx.match,
551                      &cpath[i + 1],
552                      total_len - i - 1,
553                      GNUNET_NO);
554         return;
555       }
556     }
557   }
558
559   /* No match at all, create completely new path */
560   path = GNUNET_new (struct CadetPeerPath);
561   path->entries_length = total_len;
562   path->entries = GNUNET_new_array (path->entries_length,
563                                     struct CadetPeerPathEntry *);
564   for (int i=path->entries_length-1;i>=0;i--)
565   {
566     struct CadetPeerPathEntry *entry = GNUNET_new (struct CadetPeerPathEntry);
567
568     path->entries[i] = entry;
569     entry->peer = cpath[i];
570     entry->path = path;
571   }
572   for (int i=path->entries_length-1;i>=0;i--)
573   {
574     struct CadetPeerPathEntry *entry = path->entries[i];
575
576     GCP_path_entry_add (entry->peer,
577                         entry,
578                         i);
579   }
580
581   /* Finally, try to attach it */
582   attach_path (path, 0);
583   if (NULL == path->hn)
584   {
585     /* None of the peers on the path care about it. */
586     LOG (GNUNET_ERROR_TYPE_DEBUG,
587          "Path discovered from DHT is not interesting to us\n");
588     GNUNET_assert (0 == path->entries_length);
589     GNUNET_assert (NULL == path->entries);
590     GNUNET_free (path);
591     return;
592   }
593   LOG (GNUNET_ERROR_TYPE_DEBUG,
594        "Created new path %s based on information from DHT\n",
595        GCPP_2s (path));
596 }
597
598
599 /**
600  * We got an incoming connection, obtain the corresponding path.
601  *
602  * @param path_length number of segments on the @a path
603  * @param pids path through the network, in reverse order (we are at the end at index @a path_length)
604  * @return corresponding path object
605  */
606 struct CadetPeerPath *
607 GCPP_get_path_from_route (unsigned int path_length,
608                           const struct GNUNET_PeerIdentity *pids)
609 {
610   struct CheckMatchContext cm_ctx;
611   struct CadetPeer *cpath[path_length];
612   struct CadetPeerPath *path;
613
614   /* precompute inverted 'cpath' so we can avoid doing the lookups and
615      have the correct order */
616   for (unsigned int off=0;off<path_length;off++)
617     cpath[off] = GCP_get (&pids[path_length - 1 - off],
618                           GNUNET_YES);
619
620   /* First figure out if this path is a subset of an existing path, an
621      extension of an existing path, or a new path. */
622   cm_ctx.cpath = cpath;
623   cm_ctx.cpath_length = path_length;
624   cm_ctx.match = NULL;
625   for (int i=path_length-1;i>=0;i--)
626   {
627     GCP_iterate_paths_at (cpath[i],
628                           (unsigned int) i,
629                           &check_match,
630                           &cm_ctx);
631     if (NULL != cm_ctx.match)
632     {
633       if (i == path_length - 1)
634       {
635         /* Existing path includes this one, return the match! */
636         LOG (GNUNET_ERROR_TYPE_DEBUG,
637              "Returning existing path %s as inverse for incoming connection\n",
638              GCPP_2s (cm_ctx.match));
639         return cm_ctx.match;
640       }
641       if (cm_ctx.match->entries_length == i + 1)
642       {
643         /* Existing path ends in the middle of new path, extend it! */
644         LOG (GNUNET_ERROR_TYPE_DEBUG,
645              "Extending existing path %s to create inverse for incoming connection\n",
646              GCPP_2s (cm_ctx.match));
647         extend_path (cm_ctx.match,
648                      &cpath[i + 1],
649                      path_length - i - 1,
650                      GNUNET_YES);
651         /* Check that extension was successful */
652         GNUNET_assert (cm_ctx.match->entries_length == path_length);
653         return cm_ctx.match;
654       }
655       /* Eh, we found a match but couldn't use it? Something is wrong. */
656       GNUNET_break (0);
657     }
658   }
659
660   /* No match at all, create completely new path */
661   path = GNUNET_new (struct CadetPeerPath);
662   path->entries_length = path_length;
663   path->entries = GNUNET_new_array (path->entries_length,
664                                     struct CadetPeerPathEntry *);
665   for (int i=path_length-1;i>=0;i--)
666   {
667     struct CadetPeerPathEntry *entry = GNUNET_new (struct CadetPeerPathEntry);
668
669     path->entries[i] = entry;
670     entry->peer = cpath[i];
671     entry->path = path;
672   }
673   for (int i=path_length-1;i>=0;i--)
674   {
675     struct CadetPeerPathEntry *entry = path->entries[i];
676
677     GCP_path_entry_add (entry->peer,
678                         entry,
679                         i);
680   }
681   recalculate_path_desirability (path);
682   LOG (GNUNET_ERROR_TYPE_DEBUG,
683        "Created new path %s to create inverse for incoming connection\n",
684        GCPP_2s (path));
685   path->hn = GCP_attach_path (cpath[path_length - 1],
686                               path,
687                               path_length - 1,
688                               GNUNET_YES);
689   return path;
690 }
691
692
693 /**
694  * Return the length of the path.  Excludes one end of the
695  * path, so the loopback path has length 0.
696  *
697  * @param path path to return the length for
698  * @return number of peers on the path
699  */
700 unsigned int
701 GCPP_get_length (struct CadetPeerPath *path)
702 {
703   return path->entries_length;
704 }
705
706
707 /**
708  * Find peer's offset on path.
709  *
710  * @param path path to search
711  * @param cp peer to look for
712  * @return offset of @a cp on @a path, or UINT_MAX if not found
713  */
714 unsigned int
715 GCPP_find_peer (struct CadetPeerPath *path,
716                 struct CadetPeer *cp)
717 {
718   for (unsigned int off = 0;
719        off < path->entries_length;
720        off++)
721     if (cp == GCPP_get_peer_at_offset (path,
722                                        off))
723       return off;
724   return UINT_MAX;
725 }
726
727
728 /**
729  * Obtain the peer at offset @a off in @a path.
730  *
731  * @param path peer path to inspect
732  * @param off offset to return, must be smaller than path length
733  * @return the peer at offset @a off
734  */
735 struct CadetPeer *
736 GCPP_get_peer_at_offset (struct CadetPeerPath *path,
737                          unsigned int off)
738 {
739   GNUNET_assert (off < path->entries_length);
740   return path->entries[off]->peer;
741 }
742
743
744 /**
745  * Convert a path to a human-readable string.
746  *
747  * @param path path to convert
748  * @return string, to be freed by caller (unlike other *_2s APIs!)
749  */
750 const char *
751 GCPP_2s (struct CadetPeerPath *path)
752 {
753   static char buf[2048];
754   size_t off;
755   const unsigned int max_plen = (sizeof(buf) - 16) / 5 - 2; /* 5 characters per entry */
756
757   off = 0;
758   for (unsigned int i = 0;
759        i < path->entries_length;
760        i++)
761   {
762     if ( (path->entries_length > max_plen) &&
763          (i == max_plen / 2) )
764       off += GNUNET_snprintf (&buf[off],
765                               sizeof (buf) - off,
766                               "...-");
767     if ( (path->entries_length > max_plen) &&
768          (i > max_plen / 2) &&
769          (i < path->entries_length - max_plen / 2) )
770       continue;
771     off += GNUNET_snprintf (&buf[off],
772                             sizeof (buf) - off,
773                             "%s%s",
774                             GNUNET_i2s (GCP_get_id (GCPP_get_peer_at_offset (path,
775                                                                              i))),
776                             (i == path->entries_length -1) ? "" : "-");
777   }
778   GNUNET_snprintf (&buf[off],
779                    sizeof (buf) - off,
780                    "(%p)",
781                    path);
782   return buf;
783 }
784
785
786 /* end of gnunet-service-cadet-new_paths.c */