2 This file is part of GNUnet.
3 Copyright (C) 2009-2014 GNUnet e.V.
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.
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.
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., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
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
26 #ifndef GNUNET_SERVICE_CORE_NEIGHBOURS_H
27 #define GNUNET_SERVICE_CORE_NEIGHBOURS_H
29 #include "gnunet_util_lib.h"
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 bandwidth is available).
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?
44 GSC_NEIGHBOURS_transmit (const struct GNUNET_PeerIdentity *target,
45 const struct GNUNET_MessageHeader *msg,
46 struct GNUNET_TIME_Relative timeout);
50 * Check if the given neighbour has excess bandwidth available.
52 * @param target neighbour to check
53 * @return #GNUNET_YES if excess bandwidth is available, #GNUNET_NO if not
56 GSC_NEIGHBOURS_check_excess_bandwidth (const struct GNUNET_PeerIdentity *target);
60 * Check how many messages are queued for the given neighbour.
62 * @param target neighbour to check
63 * @return number of items in the message queue
66 GSC_NEIGHBOURS_get_queue_size (const struct GNUNET_PeerIdentity *target);
70 * Initialize neighbours subsystem.
73 GSC_NEIGHBOURS_init (void);
77 * Shutdown neighbours subsystem.
80 GSC_NEIGHBOURS_done (void);