-fix (mostly harmless) use of uninitialized variable
[oweals/gnunet.git] / src / core / gnunet-service-core_neighbours.h
1 /*
2      This file is part of GNUnet.
3      (C) 2009-2014 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 core/gnunet-service-core_neighbours.h
23  * @brief code for managing low-level 'plaintext' connections with transport (key exchange may or may not be done yet)
24  * @author Christian Grothoff
25  */
26 #ifndef GNUNET_SERVICE_CORE_NEIGHBOURS_H
27 #define GNUNET_SERVICE_CORE_NEIGHBOURS_H
28
29 #include "gnunet_util_lib.h"
30
31 /**
32  * Transmit the given message to the given target.  Note that a
33  * non-control messages should only be transmitted after a
34  * 'GSC_SESSION_solicit' call was made (that call is always invoked
35  * when the message queue is empty).  Outbound quotas and memory
36  * bounds will then be enfoced (as GSC_SESSION_solicit is only called
37  * if sufficient banwdith is available).
38  *
39  * @param target peer that should receive the message (must be connected)
40  * @param msg message to transmit
41  * @param timeout by when should the transmission be done?
42  */
43 void
44 GSC_NEIGHBOURS_transmit (const struct GNUNET_PeerIdentity *target,
45                          const struct GNUNET_MessageHeader *msg,
46                          struct GNUNET_TIME_Relative timeout);
47
48
49 /**
50  * Check if the given neighbour has excess bandwidth available.
51  *
52  * @param target neighbour to check
53  * @return #GNUNET_YES if excess bandwidth is available, #GNUNET_NO if not
54  */
55 int
56 GSC_NEIGHBOURS_check_excess_bandwidth (const struct GNUNET_PeerIdentity *target);
57
58
59 /**
60  * Initialize neighbours subsystem.
61  */
62 int
63 GSC_NEIGHBOURS_init (void);
64
65
66 /**
67  * Shutdown neighbours subsystem.
68  */
69 void
70 GSC_NEIGHBOURS_done (void);
71
72
73 #endif