2 This file is part of GNUnet.
3 (C) 2009, 2010 Christian Grothoff (and other contributing authors)
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 2, 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., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file fs/gnunet-service-fs_indexing.h
23 * @brief indexing for the file-sharing service
24 * @author Christian Grothoff
26 #ifndef GNUNET_SERVICE_FS_INDEXING_H
27 #define GNUNET_SERVICE_FS_INDEXING_H
29 #include "gnunet_core_service.h"
30 #include "gnunet_datastore_service.h"
31 #include "gnunet_peer_lib.h"
32 #include "gnunet_protocols.h"
33 #include "gnunet_signatures.h"
34 #include "gnunet_util_lib.h"
38 * We've received an on-demand encoded block from the datastore.
39 * Attempt to do on-demand encoding and (if successful), call the
40 * continuation with the resulting block. On error, clean up and ask
41 * the datastore for more results.
43 * @param key key for the content
44 * @param size number of bytes in data
45 * @param data content stored
46 * @param type type of the content
47 * @param priority priority of the content
48 * @param anonymity anonymity-level for the content
49 * @param expiration expiration time for the content
50 * @param uid unique identifier for the datum;
51 * maybe 0 if no unique identifier is available
52 * @param cont function to call with the actual block (at most once, on success)
53 * @param cont_cls closure for cont
54 * @return GNUNET_OK on success
57 GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key,
63 struct GNUNET_TIME_Absolute
64 expiration, uint64_t uid,
65 GNUNET_DATASTORE_Iterator cont,
69 * Handle INDEX_START-message.
72 * @param client identification of the client
73 * @param message the actual message
76 GNUNET_FS_handle_index_start (void *cls,
77 struct GNUNET_SERVER_Client *client,
78 const struct GNUNET_MessageHeader *message);
82 * Handle INDEX_LIST_GET-message.
85 * @param client identification of the client
86 * @param message the actual message
89 GNUNET_FS_handle_index_list_get (void *cls,
90 struct GNUNET_SERVER_Client *client,
91 const struct GNUNET_MessageHeader *message);
95 * Handle UNINDEX-message.
98 * @param client identification of the client
99 * @param message the actual message
102 GNUNET_FS_handle_unindex (void *cls,
103 struct GNUNET_SERVER_Client *client,
104 const struct GNUNET_MessageHeader *message);
110 * Initialize the indexing submodule.
112 * @param s scheduler to use
113 * @param c configuration to use
114 * @return GNUNET_OK on success
117 GNUNET_FS_indexing_init (struct GNUNET_SCHEDULER_Handle *s,
118 const struct GNUNET_CONFIGURATION_Handle *c);