#include "gnunet_transport_service.h"
#include "gnunet_dht_service.h"
#include "gnunet_statistics_service.h"
-#include "gnunet-service-xdht.h"
-#include "gnunet-service-xdht_clients.h"
-#include "gnunet-service-xdht_datacache.h"
-#include "gnunet-service-xdht_neighbours.h"
+#include "gnunet-service-dht.h"
+#include "gnunet-service-dht_datacache.h"
+#include "gnunet-service-dht_neighbours.h"
#include "gnunet-service-xdht_routing.h"
#include "dht.h"
tsrm->finger_identity = *finger;
tsrm->is_predecessor = htonl (is_predecessor);
tsrm->trail_id = *trail_id;
- tsrm->ultimate_destination_finger_value
+ tsrm->ultimate_destination_finger_value
= GNUNET_htonll (ultimate_destination_finger_value);
GNUNET_memcpy (&tsrm[1],
trail_peer_list,
trm->congestion_time = congestion_timeout;
trm->is_predecessor = htonl (is_predecessor);
trm->trail_id = *trail_id;
- trm->ultimate_destination_finger_value
+ trm->ultimate_destination_finger_value
= GNUNET_htonll (ultimate_destination_finger_value);
GNUNET_memcpy (&trm[1],
trail_peer_list,
GNUNET_break (0);
return;
}
-
+
GNUNET_assert (NULL !=
(target_friend =
GNUNET_CONTAINER_multipeermap_get (friend_peermap,
/**
* Handle the put request from the client.
*
- * @param key Key for the content
* @param block_type Type of the block
* @param options Routing options
* @param desired_replication_level Desired replication count
* @param expiration_time When does the content expire
+ * @param hop_count how many hops has this message traversed so far
+ * @param bf Bloom filter of peers this PUT has already traversed
+ * @param key Key for the content
+ * @param put_path_length number of entries in put_path
+ * @param put_path peers this request has traversed so far (if tracked)
* @param data Content to store
* @param data_size Size of content @a data in bytes
+ * @return #GNUNET_OK if the request was forwarded, #GNUNET_NO if not
*/
-void
-GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key,
- enum GNUNET_BLOCK_Type block_type,
+int
+GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type block_type,
enum GNUNET_DHT_RouteOption options,
uint32_t desired_replication_level,
struct GNUNET_TIME_Absolute expiration_time,
+ uint32_t hop_count,
+ struct GNUNET_CONTAINER_BloomFilter *bf,
+ const struct GNUNET_HashCode *key,
+ unsigned int put_path_length,
+ struct GNUNET_PeerIdentity *put_path,
const void *data,
size_t data_size)
{
key,
data,
data_size);
- return;
+ return GNUNET_NO;
}
/* In case we are sending the request to a finger, then send across all of its
trail.*/
expiration_time,
data,
data_size);
+ return GNUNET_OK;
}
struct GNUNET_MQ_Envelope *env;
struct FriendInfo *target_friend;
size_t msize;
-
+
msize = get_path_length * sizeof (struct GNUNET_PeerIdentity);
if (msize + sizeof (struct PeerGetMessage)
>= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
}
-/**
- * Handle the get request from the client file. If I am destination do
- * datacache put and return. Else find the target friend and forward message
- * to it.
- *
- * @param key Key for the content
- * @param block_type Type of the block
- * @param options Routing options
- * @param desired_replication_level Desired replication count
- */
-void
-GDS_NEIGHBOURS_handle_get (const struct GNUNET_HashCode *key,
- enum GNUNET_BLOCK_Type block_type,
- enum GNUNET_DHT_RouteOption options,
- uint32_t desired_replication_level)
-{
- struct Closest_Peer successor;
- struct GNUNET_PeerIdentity best_known_dest;
- struct GNUNET_HashCode intermediate_trail_id;
- uint64_t key_value;
-
- GNUNET_memcpy (&key_value,
- key,
- sizeof (uint64_t));
- key_value = GNUNET_ntohll (key_value);
- successor = find_local_best_known_next_hop (key_value,
- GDS_FINGER_TYPE_NON_PREDECESSOR);
- best_known_dest = successor.best_known_destination;
- intermediate_trail_id = successor.trail_id;
-
- /* I am the destination. I have the data. */
- if (0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity,
- &best_known_dest))
- {
- GDS_DATACACHE_handle_get (key,
- block_type,
- NULL,
- 0,
- NULL,
- 0,
- 1,
- &my_identity,
- NULL,
- &my_identity);
- return;
- }
-
- GDS_NEIGHBOURS_send_get (key,
- block_type,
- options,
- desired_replication_level,
- &best_known_dest,
- &intermediate_trail_id,
- &successor.next_hop,
- 0,
- 1,
- &my_identity);
-}
-
-
/**
* Send the get result to requesting client.
*
* @param key Key of the requested data.
- * @param type Block type
+ * @param block_type Block type
* @param target_peer Next peer to forward the message to.
* @param source_peer Peer which has the data for the key.
* @param put_path_length Number of peers in @a put_path
*/
void
GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *key,
- enum GNUNET_BLOCK_Type type,
+ enum GNUNET_BLOCK_Type block_type,
const struct GNUNET_PeerIdentity *target_peer,
const struct GNUNET_PeerIdentity *source_peer,
unsigned int put_path_length,
if (0 == current_path_index)
{
DEBUG ("GET_RESULT TO CLIENT KEY = %s, Peer = %s",
- GNUNET_h2s(key),
- GNUNET_i2s(&my_identity));
+ GNUNET_h2s (key),
+ GNUNET_i2s (&my_identity));
GDS_CLIENTS_handle_reply (expiration,
key,
get_path_length,
get_path,
put_path_length,
put_path,
- type,
+ block_type,
data_size,
data);
return;
}
+/**
+ * Handle a result for a GET operation.
+ *
+ * @param cls closure
+ * @param type type of the block
+ * @param expiration_time when does the content expire
+ * @param key key for the content
+ * @param put_path_length number of entries in @a put_path
+ * @param put_path peers the original PUT traversed (if tracked)
+ * @param get_path_length number of entries in @a get_path
+ * @param get_path peers this reply has traversed so far (if tracked)
+ * @param data payload of the reply
+ * @param data_size number of bytes in @a data
+ */
+static void
+get_cb (void *cls,
+ enum GNUNET_BLOCK_Type type,
+ struct GNUNET_TIME_Absolute expiration_time,
+ const struct GNUNET_HashCode *key,
+ unsigned int put_path_length,
+ const struct GNUNET_PeerIdentity *put_path,
+ unsigned int get_path_length,
+ const struct GNUNET_PeerIdentity *get_path,
+ const void *data,
+ size_t data_size)
+{
+ struct GNUNET_PeerIdentity *target_peer = cls;
+ // FIXME: inline?
+ GDS_NEIGHBOURS_send_get_result (key,
+ type,
+ target_peer,
+ &my_identity,
+ put_path_length,
+ put_path,
+ 1,
+ &my_identity,
+ expiration_time,
+ data,
+ data_size);
+}
+
+
+/**
+ * Perform a GET operation. Forwards the given request to other
+ * peers. Does not lookup the key locally. May do nothing if this is
+ * the only peer in the network (or if we are the closest peer in the
+ * network).
+ *
+ * @param block_type type of the block
+ * @param options routing options
+ * @param desired_replication_level desired replication count
+ * @param hop_count how many hops did this request traverse so far?
+ * @param key key for the content
+ * @param xquery extended query
+ * @param xquery_size number of bytes in @a xquery
+ * @param reply_bf bloomfilter to filter duplicates
+ * @param reply_bf_mutator mutator for @a reply_bf
+ * @param peer_bf filter for peers not to select (again, updated)
+ * @return #GNUNET_OK if the request was forwarded, #GNUNET_NO if not
+ */
+int
+GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type block_type,
+ enum GNUNET_DHT_RouteOption options,
+ uint32_t desired_replication_level,
+ uint32_t hop_count,
+ const struct GNUNET_HashCode *key,
+ const void *xquery, size_t xquery_size,
+ const struct GNUNET_CONTAINER_BloomFilter *reply_bf,
+ uint32_t reply_bf_mutator,
+ struct GNUNET_CONTAINER_BloomFilter *peer_bf)
+{
+ struct Closest_Peer successor;
+ struct GNUNET_PeerIdentity best_known_dest;
+ struct GNUNET_HashCode intermediate_trail_id;
+ uint64_t key_value;
+
+ GNUNET_memcpy (&key_value,
+ key,
+ sizeof (uint64_t));
+ key_value = GNUNET_ntohll (key_value);
+ successor = find_local_best_known_next_hop (key_value,
+ GDS_FINGER_TYPE_NON_PREDECESSOR);
+ best_known_dest = successor.best_known_destination;
+ intermediate_trail_id = successor.trail_id;
+
+ /* I am the destination. I have the data. */
+ if (0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity,
+ &best_known_dest))
+ {
+ GDS_DATACACHE_handle_get (key,
+ block_type,
+ NULL,
+ 0,
+ NULL,
+ 0,
+ &get_cb,
+ NULL);
+ return GNUNET_NO;
+ }
+
+ GDS_NEIGHBOURS_send_get (key,
+ block_type,
+ options,
+ desired_replication_level,
+ &best_known_dest,
+ &intermediate_trail_id,
+ &successor.next_hop,
+ 0,
+ 1,
+ &my_identity);
+ return GNUNET_OK;
+}
+
+
/**
* Randomly choose one of your friends (which is not congested and have not crossed
* trail threshold) from the friend_peermap
{
if (NULL == send_verify_successor_task)
{
- send_verify_successor_task
+ send_verify_successor_task
= GNUNET_SCHEDULER_add_now (&send_verify_successor_message,
NULL);
}
else
select_and_replace_trail (existing_finger,
finger_trail,
- finger_trail_length,
+ finger_trail_length,
finger_trail_id);
}
update_current_search_finger_index (finger_table_index);
return GNUNET_OK;
}
-
+
/**
* Core handler for P2P put messages.
*
static void
handle_dht_p2p_put (void *cls,
const struct PeerPutMessage *put)
-{
+{
struct GNUNET_PeerIdentity *put_path;
struct GNUNET_PeerIdentity current_best_known_dest;
struct GNUNET_PeerIdentity best_known_dest;
* @return #GNUNET_OK if @a get is well-formed
*/
static int
-check_dht_p2p_get (void *cls,
+check_dht_p2p_get (void *cls,
const struct PeerGetMessage *get)
{
uint32_t get_length;
* @param get the message
*/
static void
-handle_dht_p2p_get (void *cls,
+handle_dht_p2p_get (void *cls,
const struct PeerGetMessage *get)
{
const struct GNUNET_PeerIdentity *get_path;
0,
NULL,
0,
- 1,
- &my_identity,
- NULL,
- &my_identity);
+ &get_cb,
+ NULL);
}
else
{
0,
NULL,
0,
- get_length,
- gp,
- &gp[get_length - 2],
- &my_identity);
+ &get_cb,
+ &gp[get_length - 2]);
}
}
else
static void
handle_dht_p2p_get_result (void *cls,
const struct PeerGetResultMessage *get_result)
-{
+{
const struct GNUNET_PeerIdentity *get_path;
const struct GNUNET_PeerIdentity *put_path;
const void *payload;
* @return #GNUNET_OK if @a trail_setup is well-formed
*/
static int
-check_dht_p2p_trail_setup (void *cls,
+check_dht_p2p_trail_setup (void *cls,
const struct PeerTrailSetupMessage *trail_setup)
{
size_t msize;
* @param trail_setup the message
*/
static void
-handle_dht_p2p_trail_setup (void *cls,
+handle_dht_p2p_trail_setup (void *cls,
const struct PeerTrailSetupMessage *trail_setup)
{
struct FriendInfo *friend = cls;
trail_peer_list = (const struct GNUNET_PeerIdentity *) &trail_setup[1];
current_dest = trail_setup->best_known_destination;
trail_id = trail_setup->trail_id;
- final_dest_finger_val
+ final_dest_finger_val
= GNUNET_ntohll (trail_setup->final_destination_finger_value);
source = trail_setup->source_peer;
is_predecessor = ntohl (trail_setup->is_predecessor);
if ( (trail_length > 0) &&
(0 != memcmp (&trail_peer_list[trail_length-1],
friend->id,
- sizeof (struct GNUNET_PeerIdentity))) )
+ sizeof (struct GNUNET_PeerIdentity))) )
{
GNUNET_break_op (0);
return;
/* Is my routing table full? */
if (GNUNET_YES == GDS_ROUTING_threshold_reached ())
{
- target_friend
+ target_friend
= (trail_length > 0)
? GNUNET_CONTAINER_multipeermap_get (friend_peermap,
&trail_peer_list[trail_length - 1])
}
/* Get the next hop to forward the trail setup request. */
- struct Closest_Peer next_peer
+ struct Closest_Peer next_peer
= get_local_best_known_next_hop (final_dest_finger_val,
&intermediate_trail_id,
is_predecessor,
return;
}
- target_friend
+ target_friend
= (trail_length > 0)
? GNUNET_CONTAINER_multipeermap_get (friend_peermap,
&trail_peer_list[trail_length-1])
{
/* Add yourself to list of peers. */
struct GNUNET_PeerIdentity peer_list[trail_length + 1];
-
+
GNUNET_memcpy (peer_list,
trail_peer_list,
trail_length * sizeof (struct GNUNET_PeerIdentity));
* @return #GNUNET_OK if @a trail_result is well-formed
*/
static int
-check_dht_p2p_trail_setup_result (void *cls,
+check_dht_p2p_trail_setup_result (void *cls,
const struct PeerTrailSetupResultMessage *trail_result)
{
size_t msize;
}
return GNUNET_OK;
}
-
+
/**
* Core handle for p2p trail setup result messages.
* @param trail_result the message
*/
static void
-handle_dht_p2p_trail_setup_result (void *cls,
+handle_dht_p2p_trail_setup_result (void *cls,
const struct PeerTrailSetupResultMessage *trail_result)
{
struct FriendInfo *friend = cls;
finger_identity = trail_result->finger_identity;
trail_id = trail_result->trail_id;
trail_peer_list = (const struct GNUNET_PeerIdentity *) &trail_result[1];
- ultimate_destination_finger_value
+ ultimate_destination_finger_value
= GNUNET_ntohll (trail_result->ultimate_destination_finger_value);
/* Am I the one who initiated the query? */
GDS_NEIGHBOURS_send_trail_setup_result (&querying_peer,
&finger_identity,
target_friend,
- trail_length,
+ trail_length,
trail_peer_list,
is_predecessor,
ultimate_destination_finger_value,
*trail_src_to_curr_pred_length = trail_me_to_curr_pred_length - i;
trail_src_to_curr_pred = GNUNET_new_array (*trail_src_to_curr_pred_length,
struct GNUNET_PeerIdentity);
-
+
for (j = 0; j < *trail_src_to_curr_pred_length; i++,j++)
trail_src_to_curr_pred[j] = trail_me_to_curr_pred[i];
if (0 != (GNUNET_CRYPTO_cmp_peer_identity (¤t_predecessor.finger_identity,
&source_peer)))
{
- trail_src_to_curr_pred
+ trail_src_to_curr_pred
= get_trail_src_to_curr_pred (source_peer,
trail,
trail_length,
trail_src_to_curr_pred_len = trail_length;
trail_src_to_curr_pred = GNUNET_new_array (trail_src_to_curr_pred_len,
struct GNUNET_PeerIdentity);
-
+
for (unsigned int i = 0; i < trail_src_to_curr_pred_len; i++)
{
trail_src_to_curr_pred[i] = trail[i];
static void
handle_dht_p2p_verify_successor_result (void *cls,
const struct PeerVerifySuccessorResultMessage *vsrm)
-{
+{
enum GDS_ROUTING_trail_direction trail_direction;
struct GNUNET_PeerIdentity querying_peer;
struct GNUNET_HashCode trail_id;
if (NULL != send_verify_successor_retry_task)
{
struct VerifySuccessorContext *ctx;
-
+
ctx = GNUNET_SCHEDULER_cancel (send_verify_successor_retry_task);
GNUNET_free (ctx);
send_verify_successor_retry_task = NULL;
return GNUNET_OK;
}
-
+
/**
* Core handle for p2p notify new successor messages.
*
struct GNUNET_HashCode trail_id;
struct FriendInfo *target_friend;
const struct GNUNET_PeerIdentity *next_hop;
-
+
GNUNET_STATISTICS_update (GDS_stats,
gettext_noop ("# Bytes received from other peers"),
ntohs (notify_confirmation->header.size),
DHT_SEND_VERIFY_SUCCESSOR_INTERVAL.rel_value_us +
GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
DHT_SEND_VERIFY_SUCCESSOR_INTERVAL.rel_value_us);
- send_verify_successor_task
+ send_verify_successor_task
= GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time,
&send_verify_successor_message,
NULL);
}
return GNUNET_OK;
}
-
+
/**
* Core handler for P2P trail rejection message
static void
handle_dht_p2p_trail_setup_rejection (void *cls,
const struct PeerTrailRejectionMessage *trail_rejection)
-{
+{
struct FriendInfo *friend = cls;
unsigned int trail_length;
const struct GNUNET_PeerIdentity *trail_peer_list;
congestion_timeout = trail_rejection->congestion_time;
source = trail_rejection->source_peer;
trail_id = trail_rejection->trail_id;
- ultimate_destination_finger_value
+ ultimate_destination_finger_value
= GNUNET_ntohll (trail_rejection->ultimate_destination_finger_value);
/* First set the congestion time of the friend that sent you this message. */
target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap,
GNUNET_break(0);
return;
}
- target_friend->congestion_timestamp
+ target_friend->congestion_timestamp
= GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(),
congestion_timeout);
else
next_peer = trail[new_trail_length-1];
- target_friend
+ target_friend
= GNUNET_CONTAINER_multipeermap_get (friend_peermap,
&next_peer);
if (NULL == target_friend)
* @param trail_teardown the message
*/
static void
-handle_dht_p2p_trail_teardown (void *cls,
+handle_dht_p2p_trail_teardown (void *cls,
const struct PeerTrailTearDownMessage *trail_teardown)
{
enum GDS_ROUTING_trail_direction trail_direction;
* @return #GNUNET_OK if @a add_trail is well-formed
*/
static int
-check_dht_p2p_add_trail (void *cls,
+check_dht_p2p_add_trail (void *cls,
const struct PeerAddTrailMessage *add_trail)
{
size_t msize;
* @param add_trail the message
*/
static void
-handle_dht_p2p_add_trail (void *cls,
+handle_dht_p2p_add_trail (void *cls,
const struct PeerAddTrailMessage *add_trail)
-{
+{
struct FriendInfo *friend = cls;
const struct GNUNET_PeerIdentity *trail;
struct GNUNET_HashCode trail_id;
int
GDS_NEIGHBOURS_init (void)
{
- GNUNET_MQ_hd_var_size (dht_p2p_put,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT,
- struct PeerPutMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_get,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_GET,
- struct PeerGetMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_get_result,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT,
- struct PeerGetResultMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_trail_setup,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP,
- struct PeerTrailSetupMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_result,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT,
- struct PeerTrailSetupResultMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_verify_successor,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR,
- struct PeerVerifySuccessorMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_verify_successor_result,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT,
- struct PeerVerifySuccessorResultMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_notify_new_successor,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR,
- struct PeerNotifyNewSuccessorMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_rejection,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION,
- struct PeerTrailRejectionMessage);
- GNUNET_MQ_hd_fixed_size (dht_p2p_trail_teardown,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN,
- struct PeerTrailTearDownMessage);
- GNUNET_MQ_hd_var_size (dht_p2p_add_trail,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL,
- struct PeerAddTrailMessage);
- GNUNET_MQ_hd_fixed_size (dht_p2p_notify_succ_confirmation,
- GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_SUCCESSOR_CONFIRMATION,
- struct PeerNotifyConfirmationMessage);
struct GNUNET_MQ_MessageHandler core_handlers[] = {
- make_dht_p2p_put_handler (NULL),
- make_dht_p2p_get_handler (NULL),
- make_dht_p2p_get_result_handler (NULL),
- make_dht_p2p_trail_setup_handler (NULL),
- make_dht_p2p_trail_setup_result_handler (NULL),
- make_dht_p2p_verify_successor_handler (NULL),
- make_dht_p2p_verify_successor_result_handler (NULL),
- make_dht_p2p_notify_new_successor_handler (NULL),
- make_dht_p2p_trail_setup_rejection_handler (NULL),
- make_dht_p2p_trail_teardown_handler (NULL),
- make_dht_p2p_add_trail_handler (NULL),
- make_dht_p2p_notify_succ_confirmation_handler (NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_put,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT,
+ struct PeerPutMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_get,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_GET,
+ struct PeerGetMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_get_result,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT,
+ struct PeerGetResultMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_trail_setup,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP,
+ struct PeerTrailSetupMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_result,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT,
+ struct PeerTrailSetupResultMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_verify_successor,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR,
+ struct PeerVerifySuccessorMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_verify_successor_result,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT,
+ struct PeerVerifySuccessorResultMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_notify_new_successor,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR,
+ struct PeerNotifyNewSuccessorMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_rejection,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION,
+ struct PeerTrailRejectionMessage,
+ NULL),
+ GNUNET_MQ_hd_fixed_size (dht_p2p_trail_teardown,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN,
+ struct PeerTrailTearDownMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (dht_p2p_add_trail,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL,
+ struct PeerAddTrailMessage,
+ NULL),
+ GNUNET_MQ_hd_fixed_size (dht_p2p_notify_succ_confirmation,
+ GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_SUCCESSOR_CONFIRMATION,
+ struct PeerNotifyConfirmationMessage,
+ NULL),
GNUNET_MQ_handler_end ()
};
- core_api = GNUNET_CORE_connecT (GDS_cfg,
+ core_api = GNUNET_CORE_connect (GDS_cfg,
NULL,
&core_init,
&handle_core_connect,
if (NULL == core_api)
return;
- GNUNET_CORE_disconnecT (core_api);
+ GNUNET_CORE_disconnect (core_api);
core_api = NULL;
delete_finger_table_entries();
if (NULL != send_notify_new_successor_retry_task)
{
struct SendNotifyContext *notify_ctx;
-
+
notify_ctx = GNUNET_SCHEDULER_cancel (send_notify_new_successor_retry_task);
GNUNET_free (notify_ctx->successor_trail);
GNUNET_free (notify_ctx);
*
* @return my identity
*/
-struct GNUNET_PeerIdentity
-GDS_NEIGHBOURS_get_my_id (void)
+struct GNUNET_PeerIdentity *
+GDS_NEIGHBOURS_get_id (void)
{
- return my_identity;
+ return &my_identity;
}
/* end of gnunet-service-xdht_neighbours.c */