91c62a64b3488a6098f29e24799a47c86bc23c70
[oweals/gnunet.git] / src / statistics / gnunet-service-statistics.c
1 /*
2      This file is part of GNUnet.
3      (C) 2009, 2010 Christian Grothoff (and other contributing authors)
4
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.
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      General Public License for more details.
14
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.
19 */
20
21 /**
22  * @file statistics/gnunet-service-statistics.c
23  * @brief program that tracks statistics
24  * @author Christian Grothoff
25  * 
26  * TODO:
27  * - use BIO for IO operations
28  */
29 #include "platform.h"
30 #include "gnunet_container_lib.h"
31 #include "gnunet_disk_lib.h"
32 #include "gnunet_getopt_lib.h"
33 #include "gnunet_protocols.h"
34 #include "gnunet_service_lib.h"
35 #include "gnunet_statistics_service.h"
36 #include "gnunet_strings_lib.h"
37 #include "gnunet_time_lib.h"
38 #include "statistics.h"
39
40 /**
41  * Watch entry.
42  */
43 struct WatchEntry
44 {
45
46   struct WatchEntry *next;
47
48   struct WatchEntry *prev;
49
50   struct GNUNET_SERVER_Client *client;
51
52   uint64_t last_value;
53   
54   uint32_t wid;
55
56 };
57
58
59 /**
60  * Client entry.
61  */
62 struct ClientEntry
63 {
64
65   struct ClientEntry *next;
66
67   struct ClientEntry *prev;
68
69   struct GNUNET_SERVER_Client *client;
70   
71   uint32_t max_wid;
72
73 };
74
75 /**
76  * Entry in the statistics list.
77  */
78 struct StatsEntry
79 {
80   /**
81    * This is a linked list.
82    */
83   struct StatsEntry *next;
84
85   /**
86    * Name of the service, points into the
87    * middle of msg.
88    */
89   const char *service;
90
91   /**
92    * Name for the value, points into
93    * the middle of msg.
94    */
95   const char *name;
96
97   /**
98    * Message that can be used to set this value,
99    * stored at the end of the memory used by
100    * this struct.
101    */
102   struct GNUNET_STATISTICS_SetMessage *msg;
103
104   /**
105    * Watch context for changes to this
106    * value, or NULL for none.
107    */
108   struct WatchEntry *we_head;
109
110   /**
111    * Watch context for changes to this
112    * value, or NULL for none.
113    */
114   struct WatchEntry *we_tail;
115
116   /**
117    * Our value.
118    */
119   uint64_t value;
120
121   /**
122    * Unique ID.
123    */
124   uint32_t uid;
125
126   /**
127    * Is this value persistent?
128    */
129   int persistent;
130
131 };
132
133 /**
134  * Our configuration.
135  */
136 static const struct GNUNET_CONFIGURATION_Handle *cfg;
137
138 /**
139  * Linked list of our active statistics.
140  */
141 static struct StatsEntry *start;
142
143 static struct ClientEntry *client_head;
144
145 static struct ClientEntry *client_tail;
146
147 /**
148  * Our notification context.
149  */
150 static struct GNUNET_SERVER_NotificationContext *nc;
151
152 /**
153  * Counter used to generate unique values.
154  */
155 static uint32_t uidgen;
156
157
158 static void
159 inject_message (void *cls,
160                 void *client,
161                 const struct GNUNET_MessageHeader *msg)
162 {
163   struct GNUNET_SERVER_Handle *server = cls;
164
165   GNUNET_break (GNUNET_OK == GNUNET_SERVER_inject (server, NULL, msg));
166 }
167
168
169 /**
170  * Load persistent values from disk.  Disk format is
171  * exactly the same format that we also use for
172  * setting the values over the network.
173  *
174  * @param server handle to the server context
175  */
176 static void
177 load (struct GNUNET_SERVER_Handle *server)
178 {
179   char *fn;
180   struct GNUNET_DISK_FileHandle *fh;
181   struct GNUNET_DISK_MapHandle *mh;
182   struct stat sb;
183   char *buf;
184   struct GNUNET_SERVER_MessageStreamTokenizer *mst;
185
186   fn = GNUNET_DISK_get_home_filename (cfg,
187                                       "statistics", "statistics.data", NULL);
188   if (fn == NULL)
189     return;
190   if ((0 != stat (fn, &sb)) || (sb.st_size == 0))
191     {
192       GNUNET_free (fn);
193       return;
194     }
195   fh = GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ,
196                               GNUNET_DISK_PERM_NONE);
197   if (!fh)
198     {
199       GNUNET_free (fn);
200       return;
201     }
202   buf = GNUNET_DISK_file_map (fh, &mh, GNUNET_DISK_MAP_TYPE_READ, sb.st_size);
203   if (NULL == buf)
204     {
205       GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "mmap", fn);
206       GNUNET_break (GNUNET_OK == GNUNET_DISK_file_close (fh));
207       GNUNET_free (fn);
208       return;
209     }
210   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
211               _("Loading %llu bytes of statistics from `%s'\n"),
212               (unsigned long long) sb.st_size, fn);
213   mst = GNUNET_SERVER_mst_create (&inject_message,
214                                   server);
215   GNUNET_break (GNUNET_OK ==
216                 GNUNET_SERVER_mst_receive (mst,
217                                            NULL,
218                                            buf,
219                                            sb.st_size,
220                                            GNUNET_YES,
221                                            GNUNET_NO));
222   GNUNET_SERVER_mst_destroy (mst);
223   GNUNET_break (GNUNET_OK == GNUNET_DISK_file_unmap (mh));
224   GNUNET_break (GNUNET_OK == GNUNET_DISK_file_close (fh));
225   GNUNET_free (fn);
226 }
227
228 /**
229  * Write persistent statistics to disk.
230  */
231 static void
232 save ()       
233 {
234   struct StatsEntry *pos;
235   char *fn;
236   struct GNUNET_DISK_FileHandle *fh;
237   uint16_t size;
238   unsigned long long total;
239
240   fh = NULL;
241   fn = GNUNET_DISK_get_home_filename (cfg,
242                                       "statistics", "statistics.data", NULL);
243   if (fn != NULL)
244     fh = GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_WRITE
245         | GNUNET_DISK_OPEN_CREATE | GNUNET_DISK_OPEN_TRUNCATE,
246         GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE);
247   total = 0;
248   while (NULL != (pos = start))
249     {
250       start = pos->next;
251       if ((pos->persistent) && (NULL != fh))
252         {
253           size = htons (pos->msg->header.size);
254           if (size != GNUNET_DISK_file_write (fh, pos->msg, size))
255             {
256               GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
257                                         "write", fn);
258               GNUNET_DISK_file_close (fh);
259               fh = NULL;
260             }
261           else
262             total += size;
263         }
264       GNUNET_free (pos);
265     }
266   if (NULL != fh)
267     {
268       GNUNET_DISK_file_close (fh);
269       if (total == 0)
270         GNUNET_break (0 == UNLINK (fn));
271       else
272         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
273                     _("Wrote %llu bytes of statistics to `%s'\n"), total, fn);
274     }
275   GNUNET_free_non_null (fn);
276 }
277
278
279 /**
280  * Transmit the given stats value.
281  */
282 static void
283 transmit (struct GNUNET_SERVER_Client *client,
284           const struct StatsEntry *e)
285 {
286   struct GNUNET_STATISTICS_ReplyMessage *m;
287   size_t size;
288
289   size =
290     sizeof (struct GNUNET_STATISTICS_ReplyMessage) + strlen (e->service) + 1 +
291     strlen (e->name) + 1;
292   GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
293   m = GNUNET_malloc (size);
294   m->header.type = htons (GNUNET_MESSAGE_TYPE_STATISTICS_VALUE);
295   m->header.size = htons (size);
296   m->uid = htonl (e->uid);
297   if (e->persistent)
298     m->uid |= htonl (GNUNET_STATISTICS_PERSIST_BIT);
299   m->value = GNUNET_htonll (e->value);
300   size -= sizeof (struct GNUNET_STATISTICS_ReplyMessage);
301   GNUNET_assert (size == GNUNET_STRINGS_buffer_fill ((char *) &m[1],
302                                                      size,
303                                                      2, e->service, e->name));
304 #if DEBUG_STATISTICS
305   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
306               "Transmitting value for `%s:%s' (%d): %llu\n",
307               e->service, e->name,
308               e->persistent, e->value);
309 #endif
310   GNUNET_SERVER_notification_context_unicast (nc, client, &m->header, GNUNET_NO);
311   GNUNET_free (m);
312 }
313
314
315 /**
316  * Does this entry match the request?
317  */
318 static int
319 matches (const struct StatsEntry *e, const char *service, const char *name)
320 {
321   return ((0 == strlen (service)) ||
322           (0 == strcmp (service, e->service)))
323     && ((0 == strlen (name)) || (0 == strcmp (name, e->name)));
324 }
325
326
327 static struct ClientEntry *
328 make_client_entry (struct GNUNET_SERVER_Client *client)
329 {
330   struct ClientEntry *ce;
331
332   GNUNET_assert (client != NULL);
333   ce = client_head;
334   while (ce != NULL)
335     {
336       if (ce->client == client)
337         return ce;
338       ce = ce->next;
339     }
340   ce = GNUNET_malloc (sizeof (struct ClientEntry));
341   ce->client = client;
342   GNUNET_SERVER_client_keep (client);
343   GNUNET_CONTAINER_DLL_insert (client_head,
344                                client_tail,
345                                ce);
346   GNUNET_SERVER_notification_context_add (nc,
347                                           client);
348   return ce;
349 }
350
351
352 /**
353  * Handle GET-message.
354  *
355  * @param cls closure
356  * @param client identification of the client
357  * @param message the actual message
358  * @return GNUNET_OK to keep the connection open,
359  *         GNUNET_SYSERR to close it (signal serious error)
360  */
361 static void
362 handle_get (void *cls,
363             struct GNUNET_SERVER_Client *client,
364             const struct GNUNET_MessageHeader *message)
365 {
366   struct GNUNET_MessageHeader end;
367   char *service;
368   char *name;
369   struct StatsEntry *pos;
370   size_t size;
371
372   make_client_entry (client);
373   size = ntohs (message->size) - sizeof (struct GNUNET_MessageHeader);
374   if (size != GNUNET_STRINGS_buffer_tokenize ((const char *) &message[1],
375                                               size, 2, &service, &name))
376     {
377       GNUNET_break (0);
378       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
379       return;
380     }
381 #if DEBUG_STATISTICS
382   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
383               "Received request for statistics on `%s:%s'\n",
384               strlen (service) ? service : "*", strlen (name) ? name : "*");
385 #endif
386   pos = start;
387   while (pos != NULL)
388     {
389       if (matches (pos, service, name))
390         transmit (client, pos);
391       pos = pos->next;
392     }
393   end.size = htons (sizeof (struct GNUNET_MessageHeader));
394   end.type = htons (GNUNET_MESSAGE_TYPE_STATISTICS_END);
395   GNUNET_SERVER_notification_context_unicast (nc,
396                                               client,
397                                               &end,
398                                               GNUNET_NO);
399   GNUNET_SERVER_receive_done (client,
400                               GNUNET_OK);
401 }
402
403
404 static void
405 notify_change (struct StatsEntry *se)
406 {
407   struct GNUNET_STATISTICS_WatchValueMessage wvm;
408   struct WatchEntry *pos;
409
410   pos = se->we_head;
411   while (pos != NULL)
412     {
413       if (pos->last_value != se->value)
414         {
415           wvm.header.type = htons (GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE);
416           wvm.header.size = htons (sizeof (struct GNUNET_STATISTICS_WatchValueMessage));
417           wvm.flags = htonl (se->persistent ? GNUNET_STATISTICS_PERSIST_BIT : 0);
418           wvm.wid = htonl (pos->wid);
419           wvm.reserved = htonl (0);
420           wvm.value = GNUNET_htonll (se->value);
421           GNUNET_SERVER_notification_context_unicast (nc,
422                                                       pos->client,
423                                                       &wvm.header,
424                                                       GNUNET_NO);
425           pos->last_value = se->value;
426         }
427       pos = pos->next;
428     }
429 }
430
431 /**
432  * Handle SET-message.
433  *
434  * @param cls closure
435  * @param client identification of the client
436  * @param message the actual message
437  */
438 static void
439 handle_set (void *cls,
440             struct GNUNET_SERVER_Client *client,
441             const struct GNUNET_MessageHeader *message)
442 {
443   char *service;
444   char *name;
445   uint16_t msize;
446   uint16_t size;
447   const struct GNUNET_STATISTICS_SetMessage *msg;
448   struct StatsEntry *pos;
449   struct StatsEntry *prev;
450   uint32_t flags;
451   uint64_t value;
452   int64_t delta;
453   int changed;
454
455   make_client_entry (client);
456   msize = ntohs (message->size);
457   if (msize < sizeof (struct GNUNET_STATISTICS_SetMessage))
458     {
459       GNUNET_break (0);
460       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
461       return;
462     }
463   size = msize - sizeof (struct GNUNET_STATISTICS_SetMessage);
464   msg = (const struct GNUNET_STATISTICS_SetMessage *) message;
465
466   if (size != GNUNET_STRINGS_buffer_tokenize ((const char *) &msg[1],
467                                               size, 2, &service, &name))
468     {
469       GNUNET_break (0);
470       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
471       return;
472     }
473   flags = ntohl (msg->flags);
474   value = GNUNET_ntohll (msg->value);
475 #if DEBUG_STATISTICS
476   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
477               "Received request to update statistic on `%s:%s' (%u) to/by %llu\n",
478               service, name,
479               (unsigned int) flags,
480               (unsigned long long) value);
481 #endif
482   pos = start;
483   prev = NULL;
484   while (pos != NULL)
485     {
486       if (matches (pos, service, name))
487         {
488           if ((flags & GNUNET_STATISTICS_SETFLAG_RELATIVE) == 0)
489             {
490               changed = (pos->value != value);
491               pos->value = value;
492             }
493           else
494             {
495               delta = (int64_t) value;
496               if ((delta < 0) && (pos->value < -delta))
497                 {
498                   changed = (pos->value != 0);
499                   pos->value = 0;
500                 }
501               else
502                 {
503                   changed = (delta != 0);
504                   GNUNET_break ((delta <= 0) ||
505                                 (pos->value + delta > pos->value));
506                   pos->value += delta;
507                 }
508             }
509           pos->msg->value = GNUNET_htonll (pos->value);
510           pos->msg->flags = msg->flags;
511           pos->persistent =
512             (0 != (flags & GNUNET_STATISTICS_SETFLAG_PERSISTENT));
513           if (prev != NULL)
514             {
515               /* move to front for faster setting next time! */
516               prev->next = pos->next;
517               pos->next = start;
518               start = pos;
519             }
520 #if DEBUG_STATISTICS
521           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
522                       "Statistic `%s:%s' updated to value %llu.\n",
523                       service, name, pos->value);
524 #endif
525           if (changed) 
526             notify_change (pos);
527           GNUNET_SERVER_receive_done (client, GNUNET_OK);
528           return;
529         }
530       prev = pos;
531       pos = pos->next;
532     }
533   pos = GNUNET_malloc (sizeof (struct StatsEntry) + msize);
534   pos->next = start;
535   if (((flags & GNUNET_STATISTICS_SETFLAG_RELATIVE) == 0) ||
536       (0 < (int64_t) GNUNET_ntohll (msg->value)))
537     pos->value = GNUNET_ntohll (msg->value);
538   pos->uid = uidgen++;
539   pos->persistent = (0 != (flags & GNUNET_STATISTICS_SETFLAG_PERSISTENT));
540   pos->msg = (void *) &pos[1];
541   memcpy (pos->msg, message, ntohs (message->size));
542   pos->service = (const char *) &pos->msg[1];
543   pos->name = &pos->service[strlen (pos->service) + 1];
544
545   start = pos;
546 #if DEBUG_STATISTICS
547   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
548               "New statistic on `%s:%s' with value %llu created.\n",
549               service, name, pos->value);
550 #endif
551   GNUNET_SERVER_receive_done (client, GNUNET_OK);
552 }
553
554
555 /**
556  * Handle WATCH-message.
557  *
558  * @param cls closure
559  * @param client identification of the client
560  * @param message the actual message
561  */
562 static void
563 handle_watch (void *cls,
564               struct GNUNET_SERVER_Client *client,
565               const struct GNUNET_MessageHeader *message)
566 {
567   char *service;
568   char *name;
569   uint16_t msize;
570   uint16_t size;
571   struct StatsEntry *pos;
572   struct ClientEntry *ce;
573   struct WatchEntry *we;
574   size_t slen;
575
576   ce = make_client_entry (client);
577   msize = ntohs (message->size);
578   if (msize < sizeof (struct GNUNET_MessageHeader))
579     {
580       GNUNET_break (0);
581       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
582       return;
583     }
584   size = msize - sizeof (struct GNUNET_MessageHeader);
585   if (size != GNUNET_STRINGS_buffer_tokenize ((const char *) &message[1],
586                                               size, 2, &service, &name))
587     {
588       GNUNET_break (0);
589       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
590       return;
591     }
592 #if DEBUG_STATISTICS
593   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
594               "Received request to watch statistic on `%s:%s'\n",
595               service, name);
596 #endif
597   pos = start;
598   while (pos != NULL)
599     {
600       if (matches (pos, service, name))
601         break;
602       pos = pos->next;
603     }
604   if (pos == NULL)
605     {
606       pos = GNUNET_malloc (sizeof (struct StatsEntry) + 
607                            sizeof (struct GNUNET_STATISTICS_SetMessage) + 
608                            size);
609       pos->next = start;
610       pos->uid = uidgen++;
611       pos->msg = (void *) &pos[1];
612       pos->msg->header.size = htons (sizeof (struct GNUNET_STATISTICS_SetMessage) + 
613                                      size);
614       pos->msg->header.type = htons (GNUNET_MESSAGE_TYPE_STATISTICS_SET);
615       pos->service = (const char *) &pos->msg[1];
616       slen = strlen (service) + 1;
617       memcpy ((void*) pos->service, service, slen);
618       pos->name = &pos->service[slen];
619       memcpy ((void*) pos->name, name, strlen (name)+1);
620       start = pos;
621     }
622   we = GNUNET_malloc (sizeof (struct WatchEntry));
623   we->client = client;
624   GNUNET_SERVER_client_keep (client);
625   we->wid = ce->max_wid++;
626   GNUNET_CONTAINER_DLL_insert (pos->we_head,
627                                pos->we_tail,
628                                we);
629   if (pos->value != 0)
630     notify_change (pos);
631   GNUNET_SERVER_receive_done (client,
632                               GNUNET_OK);
633 }
634
635
636 /**
637  * Task run during shutdown.
638  *
639  * @param cls unused
640  * @param tc unused
641  */
642 static void
643 shutdown_task (void *cls,
644                const struct GNUNET_SCHEDULER_TaskContext *tc)
645 {
646   struct ClientEntry *ce;
647   struct WatchEntry *we;
648   struct StatsEntry *se;
649
650   save ();
651   GNUNET_SERVER_notification_context_destroy (nc);
652   nc = NULL;
653   while (NULL != (ce = client_head))
654     {
655       GNUNET_SERVER_client_drop (ce->client);
656       GNUNET_CONTAINER_DLL_remove (client_head,
657                                    client_tail,
658                                    ce);
659       GNUNET_free (ce);
660     }
661   while (NULL != (se = start))
662     {
663       start = se->next;
664       while (NULL != (we = se->we_head))
665         {
666           GNUNET_SERVER_client_drop (we->client);
667           GNUNET_CONTAINER_DLL_remove (se->we_head,
668                                        se->we_tail,
669                                        we);
670           GNUNET_free (we);
671         }
672       GNUNET_free (se);
673     }
674 }
675
676
677 /**
678  * A client disconnected.  Remove all of its data structure entries.
679  *
680  * @param cls closure, NULL
681  * @param client identification of the client
682  */
683 static void
684 handle_client_disconnect (void *cls,
685                           struct GNUNET_SERVER_Client
686                           * client)
687 {
688   struct ClientEntry *ce;
689   struct WatchEntry *we;
690   struct WatchEntry *wen;
691   struct StatsEntry *se;
692   
693   ce = client_head;
694   while (NULL != ce)
695     {
696       if (ce->client == client)
697         {
698           GNUNET_SERVER_client_drop (ce->client);
699           GNUNET_CONTAINER_DLL_remove (client_head,
700                                        client_tail,
701                                        ce);
702           GNUNET_free (ce);
703           break;
704         }
705       ce = ce->next;
706     }
707   se = start;
708   while (NULL != se)
709     {
710       wen = se->we_head;
711       while (NULL != (we = wen))
712         {
713           wen = we->next;
714           if (we->client != client)
715             continue;
716           GNUNET_SERVER_client_drop (we->client);
717           GNUNET_CONTAINER_DLL_remove (se->we_head,
718                                        se->we_tail,
719                                        we);
720           GNUNET_free (we);
721         }
722       se = se->next;
723     }
724 }
725
726
727 /**
728  * Process statistics requests.
729  *
730  * @param cls closure
731  * @param sched scheduler to use
732  * @param server the initialized server
733  * @param c configuration to use
734  */
735 static void
736 run (void *cls,
737      struct GNUNET_SCHEDULER_Handle *sched,
738      struct GNUNET_SERVER_Handle *server,
739      const struct GNUNET_CONFIGURATION_Handle *c)
740 {
741   static const struct GNUNET_SERVER_MessageHandler handlers[] = {
742     {&handle_set, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_SET, 0},
743     {&handle_get, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_GET, 0},
744     {&handle_watch, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_WATCH, 0},
745     {NULL, NULL, 0, 0}
746   };
747   cfg = c;
748   GNUNET_SERVER_add_handlers (server, handlers);
749   nc = GNUNET_SERVER_notification_context_create (server, 16);
750   GNUNET_SERVER_disconnect_notify (server, 
751                                    &handle_client_disconnect,
752                                    NULL);
753   load (server);
754   GNUNET_SCHEDULER_add_delayed (sched,
755                                 GNUNET_TIME_UNIT_FOREVER_REL,
756                                 &shutdown_task,
757                                 NULL);
758 }
759
760
761 /**
762  * The main function for the statistics service.
763  *
764  * @param argc number of arguments from the command line
765  * @param argv command line arguments
766  * @return 0 ok, 1 on error
767  */
768 int
769 main (int argc, char *const *argv)
770 {
771   return (GNUNET_OK ==
772           GNUNET_SERVICE_run (argc,
773                               argv,
774                               "statistics",
775                               GNUNET_SERVICE_OPTION_NONE,
776                               &run, NULL)) ? 0 : 1;
777 }
778
779 /* end of gnunet-service-statistics.c */