aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_datacache.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-25 22:16:20 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-25 22:16:20 +0000
commit858f4546a0044b3ea9abdfbe6dda2e95d7c04dc1 (patch)
treeb0f0c65692214a9cf4c24f4bc1e03ec41247cfa6 /src/dht/gnunet-service-dht_datacache.h
parent1990307349dce4eda6b576097d516b9e0342d98d (diff)
downloadgnunet-858f4546a0044b3ea9abdfbe6dda2e95d7c04dc1.tar.gz
gnunet-858f4546a0044b3ea9abdfbe6dda2e95d7c04dc1.zip
wild hxing
Diffstat (limited to 'src/dht/gnunet-service-dht_datacache.h')
-rw-r--r--src/dht/gnunet-service-dht_datacache.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-dht_datacache.h b/src/dht/gnunet-service-dht_datacache.h
new file mode 100644
index 000000000..0501e9e4c
--- /dev/null
+++ b/src/dht/gnunet-service-dht_datacache.h
@@ -0,0 +1,84 @@
1/*
2 This file is part of GNUnet.
3 (C) 2009, 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 dht/gnunet-service-dht_datacache.h
23 * @brief GNUnet DHT service's datacache integration
24 * @author Christian Grothoff
25 * @author Nathan Evans
26 */
27#ifndef GNUNET_SERVICE_DHT_DATACACHE_H
28#define GNUNET_SERVICE_DHT_DATACACHE_H
29
30/**
31 * Handle a datum we've received from another peer. Cache if
32 * possible.
33 *
34 * @param expiration when will the reply expire
35 * @param key the query this reply is for
36 * @param put_path_length number of peers in 'put_path'
37 * @param put_path path the reply took on put
38 * @param type type of the reply
39 * @param data_size number of bytes in 'data'
40 * @param data application payload data
41 */
42void
43GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration,
44 const GNUNET_HashCode *key,
45 unsigned int put_path_length,
46 const struct GNUNET_PeerIdentity *put_path,
47 uint32_t type,
48 size_t data_size,
49 const void *data);
50
51
52/**
53 * Handle a GET request we've received from another peer.
54 *
55 * @param key the query
56 * @param type requested data type
57 * @param xquery extended query
58 * @param xquery_size number of bytes in xquery
59 * @param reply_bf where the reply bf is (to be) stored, possibly updated!, can be NULL
60 * @param reply_bf_mutator mutation value for reply_bf
61 */
62void
63GDS_DATACACHE_handle_get (const GNUNET_HashCode *key,
64 uint32_t type,
65 const void *xquery,
66 size_t xquery_size,
67 struct GNUNET_CONTAINER_BloomFilter **reply_bf,
68 uint32_t reply_bf_mutator);
69
70
71/**
72 * Initialize datacache subsystem.
73 */
74void
75GDS_DATACACHE_init (void);
76
77
78/**
79 * Shutdown datacache subsystem.
80 */
81void
82GDS_DATACACHE_done (void);
83
84#endif