first batch of license fixes (boring)
[oweals/gnunet.git] / src / transport / gnunet-service-transport_hello.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2010,2011 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU 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 /**
16  * @file transport/gnunet-service-transport_hello.h
17  * @brief hello API
18  * @author Christian Grothoff
19  */
20 #ifndef GNUNET_SERVICE_TRANSPORT_HELLO_H
21 #define GNUNET_SERVICE_TRANSPORT_HELLO_H
22
23 #include "gnunet_statistics_service.h"
24 #include "gnunet_transport_service.h"
25 #include "gnunet_util_lib.h"
26 #include "gnunet_hello_lib.h"
27
28
29 /**
30  * Signature of a function to call whenever our hello changes.
31  *
32  * @param cls closure
33  * @param hello updated HELLO
34  */
35 typedef void
36 (*GST_HelloCallback) (void *cls,
37                       const struct GNUNET_MessageHeader *hello);
38
39
40 /**
41  * Initialize the HELLO module.
42  *
43  * @param friend_only use a friend only hello
44  * @param cb function to call whenever our HELLO changes
45  * @param cb_cls closure for @a cb
46  */
47 void
48 GST_hello_start (int friend_only,
49                  GST_HelloCallback cb,
50                  void *cb_cls);
51
52
53 /**
54  * Shutdown the HELLO module.
55  */
56 void
57 GST_hello_stop (void);
58
59
60 /**
61  * Obtain this peers HELLO message.
62  *
63  * @return our HELLO message
64  */
65 const struct GNUNET_MessageHeader *
66 GST_hello_get (void);
67
68
69 /**
70  * Add or remove an address from this peer's HELLO message.
71  *
72  * @param addremove #GNUNET_YES to add, #GNUNET_NO to remove
73  * @param address address to add or remove
74  */
75 void
76 GST_hello_modify_addresses (int addremove,
77                             const struct GNUNET_HELLO_Address *address);
78
79
80 /**
81  * Test if a particular address is one of ours.
82  *
83  * @param address the address to test
84  * @param sig location where to cache PONG signatures for this address [set]
85  * @param sig_expiration how long until the current 'sig' expires?
86  *            (ZERO if sig was never created) [set]
87  * @return #GNUNET_YES if this is one of our addresses,
88  *         #GNUNET_NO if not
89  */
90 int
91 GST_hello_test_address (const struct GNUNET_HELLO_Address *address,
92                         struct GNUNET_CRYPTO_EddsaSignature **sig,
93                         struct GNUNET_TIME_Absolute **sig_expiration);
94
95
96 #endif
97 /* end of file gnunet-service-transport_hello.h */