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.
59 * @param type type of the block
60 * @param options routing options
61 * @param desired_replication_level desired replication count
62 * @param key key for the content
63 * @param xquery extended query
64 * @param xquery_size number of bytes in xquery
65 * @param reply_bf bloomfilter to filter duplicates
66 * @param reply_bf_mutator mutator for reply_bf
67 * @param peer_bf filter for peers not to select (again)
70 GST_NEIGHBOURS_handle_get (uint32_t type,
72 uint32_t desired_replication_level,
73 const GNUNET_HashCode *key,
76 const struct GNUNET_CONTAINER_BloomFilter *reply_bf,
77 uint32_t reply_bf_mutator,
78 const struct GNUNET_CONTAINER_BloomFilter *peer_bf);
82 * Handle a reply (route to origin).
84 * @param type type of the block
85 * @param options routing options
86 * @param expiration_time when does the content expire
87 * @param key key for the content
88 * @param put_path_length number of entries in put_path
89 * @param put_path peers the original PUT traversed (if tracked)
90 * @param get_path_length number of entries in put_path
91 * @param get_path peers this reply has traversed so far (if tracked)
92 * @param data payload of the reply
93 * @param data_size number of bytes in data
96 GST_NEIGHBOURS_handle_reply (uint32_t type,
98 GNUNET_TIME_Absolute expiration_time,
99 const GNUNET_HashCode *key,
100 unsigned int put_path_length,
101 struct GNUNET_PeerIdentity *put_path,
102 unsigned int get_path_length,
103 struct GNUNET_PeerIdentity *get_path,
109 * Initialize neighbours subsystem.
112 GST_NEIGHBOURS_init (void);
115 * Shutdown neighbours subsystem.
118 GST_NEIGHBOURS_done (void);