aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_clients.h
blob: c18c051fb17562f228eb98a0b2e6f43360e1e18b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
     This file is part of GNUnet.
     (C) 2010,2011 Christian Grothoff (and other contributing authors)

     GNUnet is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published
     by the Free Software Foundation; either version 3, or (at your
     option) any later version.

     GNUnet is distributed in the hope that it will be useful, but
     WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with GNUnet; see the file COPYING.  If not, write to the
     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.
*/

/**
 * @file transport/gnunet-service-transport_clients.h
 * @brief plugin management API
 * @author Christian Grothoff
 */
#ifndef GNUNET_SERVICE_TRANSPORT_CLIENTS_H
#define GNUNET_SERVICE_TRANSPORT_CLIENTS_H

#include "gnunet_statistics_service.h"
#include "gnunet_util_lib.h"


/**
 * Start handling requests from clients.
 *
 * @param server server used to accept clients from.
 */
void 
GST_clients_start (struct GNUNET_SERVER_Handle *server);


/**
 * Stop processing clients.
 */
void
GST_clients_stop (void);


/**
 * Initialize a normal client.  We got a start message from this
 * client, add him to the list of clients for broadcasting of inbound
 * messages.
 *
 * @param cls unused
 * @param client the client
 * @param message the start message that was sent
 */
void
GST_clients_handle_start (void *cls,
			  struct GNUNET_SERVER_Client *client,
			  const struct GNUNET_MessageHeader *message);


/**
 * Client asked for transmission to a peer.  Process the request.
 *
 * @param cls unused
 * @param client the client
 * @param message the send message that was sent
 */
void
GST_clients_handle_send (void *cls,
			 struct GNUNET_SERVER_Client *client,
			 const struct GNUNET_MessageHeader *message);


/**
 * Client asked for a quota change for a particular peer.  Process the request.
 *
 * @param cls unused
 * @param client the client
 * @param message the quota changing message
 */
void
GST_clients_handle_set_quota (void *cls,
			      struct GNUNET_SERVER_Client *client,
			      const struct GNUNET_MessageHeader *message);


/**
 * Client asked to resolve an address.  Process the request.
 *
 * @param cls unused
 * @param client the client
 * @param message the resolution request
 */
void
GST_clients_handle_address_lookup (void *cls,
				   struct GNUNET_SERVER_Client *client,
				   const struct GNUNET_MessageHeader *message);


/**
 * Client asked to obtain information about a peer's addresses.
 * Process the request.
 *
 * @param cls unused
 * @param client the client
 * @param message the peer address information request
 */
void
GST_clients_handle_peer_address_lookup (void *cls,
					struct GNUNET_SERVER_Client *client,
					const struct GNUNET_MessageHeader *message);


/**
 * Client asked to obtain information about all addresses.
 * Process the request.
 *
 * @param cls unused
 * @param client the client
 * @param message the peer address information request
 */
void
GST_clients_handle_address_iterate (void *cls,
				    struct GNUNET_SERVER_Client *client,
				    const struct GNUNET_MessageHeader *message);


/**
 * Broadcast the given message to all of our clients.
 *
 * @param msg message to broadcast
 * @param may_drop GNUNET_YES if the message can be dropped
 */
void
GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
		       int may_drop);


/**
 * Send the given message to a particular client
 *
 * @param client target of the message
 * @param msg message to transmit
 * @param may_drop GNUNET_YES if the message can be dropped
 */
void
GST_clients_unicast (struct GNUNET_SERVER_Client *client,
		     const struct GNUNET_MessageHeader *msg,
		     int may_drop);



#endif
/* end of file gnunet-service-transport_clients.h */