indentation
[oweals/gnunet.git] / src / fs / gnunet-service-fs_lc.h
1 /*
2      This file is part of GNUnet.
3      (C) 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 fs/gnunet-service-fs_lc.h
23  * @brief API to handle 'local clients'
24  * @author Christian Grothoff
25  */
26 #ifndef GNUNET_SERVICE_FS_LC_H
27 #define GNUNET_SERVICE_FS_LC_H
28
29 #include "gnunet-service-fs.h"
30
31
32 /**
33  * Look up a local client record or create one if it
34  * doesn't exist yet.
35  *
36  * @param client handle of the client
37  * @return handle to local client entry
38  */
39 struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client
40                                                   *client);
41
42
43 /**
44  * Handle START_SEARCH-message (search request from local client).
45  * Only responsible for creating the request entry itself and setting
46  * up reply callback and cancellation on client disconnect.  Does NOT
47  * execute the actual request strategy (planning).
48  *
49  * @param client identification of the client
50  * @param message the actual message
51  * @return pending request handle for the request, NULL on error
52  */
53 struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct
54                                                                    GNUNET_SERVER_Client
55                                                                    *client,
56                                                                    const struct
57                                                                    GNUNET_MessageHeader
58                                                                    *message);
59
60
61 /**
62  * Transmit a message to the given local client as soon as possible.
63  * If the client disconnects before transmission, the message is
64  * simply discarded.
65  *
66  * @param lc recipient
67  * @param msg message to transmit to client
68  */
69 void
70 GSF_local_client_transmit_ (struct GSF_LocalClient *lc,
71                             const struct GNUNET_MessageHeader *msg);
72
73
74 /**
75  * A client disconnected from us.  Tear down the local client record.
76  *
77  * @param cls unused
78  * @param client handle of the client
79  */
80 void
81 GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client);
82
83
84 #endif
85 /* end of gnunet-service-fs_lc.h */