7c30344b25f35b6e69e3d210f216e9488eb26c28
[oweals/gnunet.git] / src / hostlist / gnunet-daemon-hostlist.h
1 /*
2      This file is part of GNUnet.
3      (C) 2009 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 2, 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 hostlist/gnunet-daemon-hostlist.h
23  * @brief common internal definitions for hostlist daemon
24  * @author Matthias Wachs
25  */
26 #include <stdlib.h>
27 #include "platform.h"
28 #include "hostlist-client.h"
29 #include "hostlist-server.h"
30 #include "gnunet_core_service.h"
31 #include "gnunet_getopt_lib.h"
32 #include "gnunet_protocols.h"
33 #include "gnunet_program_lib.h"
34 #include "gnunet_statistics_service.h"
35 #include "gnunet_strings_lib.h"
36 #include "gnunet_time_lib.h"
37 #include "gnunet_util_lib.h"
38
39 /**
40  * General hostlist daemon debugging.
41  */
42 #define DEBUG_HOSTLIST GNUNET_NO
43
44 /**
45  * A HOSTLIST_ADV message is used to exchange information about
46  * hostlist advertisements.  This struct is always
47  * followed by the actual url under which the hostlist can be obtained:
48  *
49  * 1) transport-name (0-terminated)
50  * 2) address-length (uint32_t, network byte order; possibly
51  *    unaligned!)
52  * 3) address expiration (GNUNET_TIME_AbsoluteNBO); possibly
53  *    unaligned!)
54  * 4) address (address-length bytes; possibly unaligned!)
55  */
56 struct GNUNET_HOSTLIST_ADV_Message
57 {
58   /**
59    * Type will be GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT.
60    */
61   struct GNUNET_MessageHeader header;
62
63   /**
64    * Always zero (for alignment).
65    */
66   uint32_t reserved GNUNET_PACKED;
67 };
68
69
70 /* end of gnunet-daemon-hostlist.h */