c627e7e2faea586785a4a1ae3fd6588905911da5
[oweals/gnunet.git] / src / transport / gnunet-service-transport_neighbours.h
1 /*
2      This file is part of GNUnet.
3      (C) 2010,2011 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 transport/gnunet-service-transport_neighbours.h
23  * @brief plugin management API
24  * @author Christian Grothoff
25  */
26 #ifndef GNUNET_SERVICE_TRANSPORT_NEIGHBOURS_H
27 #define GNUNET_SERVICE_TRANSPORT_NEIGHBOURS_H
28
29 #include "gnunet_statistics_service.h"
30 #include "gnunet_transport_service.h"
31 #include "gnunet_util_lib.h"
32
33
34 /**
35  *
36  */
37 void 
38 GST_neighbours_start (void *cls,
39                       GNUNET_TRANSPORT_NotifyConnect connect_cb,
40                       GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb);
41
42 /**
43  *
44  */
45 void
46 GST_neighbours_stop (void);
47
48 /**
49  *
50  */
51 void
52 GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target);
53
54 /**
55  *
56  */
57 int
58 GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target);
59
60 /**
61  *
62  */
63 void
64 GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target);
65
66
67 typedef void (*GST_NeighbourIterator)(void *cls,
68                                       const struct GNUNET_PeerIdentity *neighbour);
69
70
71 void
72 GST_neighbours_iterate (GST_NeighbourIterator cb,
73                         void *cb_cls);
74
75
76 /**
77  *
78  */
79 int
80 GST_neighbours_handle_pong (const struct GNUNET_PeerIdentity *sender,
81                             const struct GNUNET_MessageHeader *hdr,
82                             const char *plugin_name,
83                             const void *sender_address,
84                             size_t sender_address_len);
85
86 /**
87  *
88  */
89 int
90 GST_neighbours_handle_connect (const struct GNUNET_PeerIdentity *sender,
91                                const struct GNUNET_MessageHeader *hdr,
92                                const char *plugin_name,
93                                const void *sender_address,
94                                size_t sender_address_len);
95
96 /**
97  *
98  */
99 int
100 GST_neighbours_handle_disconnect (const struct GNUNET_PeerIdentity *sender,
101                                   const struct GNUNET_MessageHeader *hdr,
102                                   const char *plugin_name,
103                                   const void *sender_address,
104                                   size_t sender_address_len);
105
106
107
108
109 #endif
110 /* end of file gnunet-service-transport_neighbours.h */