2 This file is part of GNUnet.
3 (C) 2009, 2010, 2011 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 3, 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 dht/gnunet-service-dht_neighbours.h
23 * @brief GNUnet DHT routing code
24 * @author Christian Grothoff
25 * @author Nathan Evans
27 #ifndef GNUNET_SERVICE_DHT_NEIGHBOURS_H
28 #define GNUNET_SERVICE_DHT_NEIGHBOURS_H
32 * Perform a PUT operation.
34 * @param type type of the block
35 * @param options routing options
36 * @param desired_replication_level desired replication count
37 * @param expiration_time when does the content expire
38 * @param key key for the content
39 * @param put_path_length number of entries in put_path
40 * @param put_path peers this request has traversed so far (if tracked)
41 * @param data payload to store
42 * @param data_size number of bytes in data
45 GST_NEIGHBOURS_handle_put (uint32_t type,
47 uint32_t desired_replication_level,
48 GNUNET_TIME_Absolute expiration_time,
49 const GNUNET_HashCode *key,
50 unsigned int put_path_length,
51 struct GNUNET_PeerIdentity *put_path,
57 * Perform a GET operation.
60 * @param type type of the block
61 * @param options routing options
62 * @param desired_replication_level desired replication count
63 * @param key key for the content
64 * @param xquery extended query
65 * @param xquery_size number of bytes in xquery
66 * @param reply_bf bloomfilter to filter duplicates
67 * @param reply_bf_mutator mutator for reply_bf
68 * @param peer_bf filter for peers not to select (again)
71 GST_NEIGHBOURS_handle_get (uint32_t type,
73 uint32_t desired_replication_level,
74 const GNUNET_HashCode *key,
77 const struct GNUNET_CONTAINER_BloomFilter *reply_bf,
78 uint32_t reply_bf_mutator,
79 const struct GNUNET_CONTAINER_BloomFilter *peer_bf);
83 * Handle a reply (route to origin).
85 * @param type type of the block
86 * @param options routing options
87 * @param expiration_time when does the content expire
88 * @param key key for the content
89 * @param put_path_length number of entries in put_path
90 * @param put_path peers the original PUT traversed (if tracked)
91 * @param get_path_length number of entries in put_path
92 * @param get_path peers this reply has traversed so far (if tracked)
93 * @param data payload of the reply
94 * @param data_size number of bytes in data
97 GST_NEIGHBOURS_handle_reply (uint32_t type,
99 GNUNET_TIME_Absolute expiration_time,
100 const GNUNET_HashCode *key,
101 unsigned int put_path_length,
102 struct GNUNET_PeerIdentity *put_path,
103 unsigned int get_path_length,
104 struct GNUNET_PeerIdentity *get_path,
110 * Initialize neighbours subsystem.
113 GST_NEIGHBOURS_init (void);
116 * Shutdown neighbours subsystem.
119 GST_NEIGHBOURS_done (void);