stuff
[oweals/gnunet.git] / src / transport / gnunet-service-transport_clients.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_clients.h
23  * @brief plugin management API
24  * @author Christian Grothoff
25  */
26 #ifndef GNUNET_SERVICE_TRANSPORT_CLIENTS_H
27 #define GNUNET_SERVICE_TRANSPORT_CLIENTS_H
28
29 #include "gnunet_statistics_service.h"
30 #include "gnunet_util_lib.h"
31
32
33 /**
34  * Start handling requests from clients.
35  *
36  * @param server server used to accept clients from.
37  */
38 void 
39 GST_clients_start (struct GNUNET_SERVER_Handle *server);
40
41
42 /**
43  * Stop processing clients.
44  */
45 void
46 GST_clients_stop (void);
47
48
49 /**
50  * Initialize a normal client.  We got a start message from this
51  * client, add him to the list of clients for broadcasting of inbound
52  * messages.
53  *
54  * @param cls unused
55  * @param client the client
56  * @param message the start message that was sent
57  */
58 void
59 GST_clients_handle_start (void *cls,
60                           struct GNUNET_SERVER_Client *client,
61                           const struct GNUNET_MessageHeader *message);
62
63
64 /**
65  * Client sent us a HELLO.  Process the request.
66  *
67  * @param cls unused
68  * @param client the client
69  * @param message the HELLO message
70  */
71 void
72 GST_clients_handle_hello (void *cls,
73                           struct GNUNET_SERVER_Client *client,
74                           const struct GNUNET_MessageHeader *message);
75
76
77 /**
78  * Client asked for transmission to a peer.  Process the request.
79  *
80  * @param cls unused
81  * @param client the client
82  * @param message the send message that was sent
83  */
84 void
85 GST_clients_handle_send (void *cls,
86                          struct GNUNET_SERVER_Client *client,
87                          const struct GNUNET_MessageHeader *message);
88
89
90 /**
91  * Client asked for a quota change for a particular peer.  Process the request.
92  *
93  * @param cls unused
94  * @param client the client
95  * @param message the quota changing message
96  */
97 void
98 GST_clients_handle_set_quota (void *cls,
99                               struct GNUNET_SERVER_Client *client,
100                               const struct GNUNET_MessageHeader *message);
101
102
103 /**
104  * Client asked to resolve an address.  Process the request.
105  *
106  * @param cls unused
107  * @param client the client
108  * @param message the resolution request
109  */
110 void
111 GST_clients_handle_address_lookup (void *cls,
112                                    struct GNUNET_SERVER_Client *client,
113                                    const struct GNUNET_MessageHeader *message);
114
115
116 /**
117  * Client asked to obtain information about a peer's addresses.
118  * Process the request.
119  *
120  * @param cls unused
121  * @param client the client
122  * @param message the peer address information request
123  */
124 void
125 GST_clients_handle_peer_address_lookup (void *cls,
126                                         struct GNUNET_SERVER_Client *client,
127                                         const struct GNUNET_MessageHeader *message);
128
129
130 /**
131  * Client asked to obtain information about all addresses.
132  * Process the request.
133  *
134  * @param cls unused
135  * @param client the client
136  * @param message the peer address information request
137  */
138 void
139 GST_clients_handle_address_iterate (void *cls,
140                                     struct GNUNET_SERVER_Client *client,
141                                     const struct GNUNET_MessageHeader *message);
142
143
144 /**
145  * Broadcast the given message to all of our clients.
146  *
147  * @param msg message to broadcast
148  * @param may_drop GNUNET_YES if the message can be dropped
149  */
150 void
151 GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
152                        int may_drop);
153
154
155 /**
156  * Send the given message to a particular client
157  *
158  * @param client target of the message
159  * @param msg message to transmit
160  * @param may_drop GNUNET_YES if the message can be dropped
161  */
162 void
163 GST_clients_unicast (struct GNUNET_SERVER_Client *client,
164                      const struct GNUNET_MessageHeader *msg,
165                      int may_drop);
166
167
168
169 #endif
170 /* end of file gnunet-service-transport_clients.h */