From 310b25e5a713d547aea2f34c76e7b3e35ded1ea5 Mon Sep 17 00:00:00 2001 From: Supriti Singh Date: Mon, 23 Jun 2014 13:30:07 +0000 Subject: [PATCH] -- New message type, GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT and GNUNET_MESSAGE_TYPE_XDHT_P2P_GET -- Changing name of all the messages of X-Vine by appending X in front of DHT. -- Not sending trail teardown in case next_hop or prev_hop is me (remove routing trail due to disconnected peer) --- src/dht/gnunet-service-xdht_datacache.c | 1 - src/dht/gnunet-service-xdht_neighbours.c | 101 ++++++++++++----------- src/dht/gnunet-service-xdht_routing.c | 32 +++++-- src/include/gnunet_protocols.h | 34 +++++--- 4 files changed, 100 insertions(+), 68 deletions(-) diff --git a/src/dht/gnunet-service-xdht_datacache.c b/src/dht/gnunet-service-xdht_datacache.c index fe27eec5e..ab1dedeab 100644 --- a/src/dht/gnunet-service-xdht_datacache.c +++ b/src/dht/gnunet-service-xdht_datacache.c @@ -311,7 +311,6 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key, if (next_hop != NULL) { memcpy (&(ctx.next_hop), next_hop, sizeof (struct GNUNET_PeerIdentity)); - GNUNET_free (next_hop); } unsigned int i = 0; ctx.head = NULL; diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index f4ecbab38..7ce0473cf 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c @@ -74,6 +74,13 @@ * basic - drop packet, ignore message. Not going to check for behaviour * where a peer changes the value as we handle that case everywhere. s */ +/** + 1. friend trails count in case it is finger, routing table trail + 2. select_closest_peer in compare and update predecessor and successor, + update_predecessor. + */ + + /** * Maximum possible fingers (including predecessor) of a peer */ @@ -139,7 +146,7 @@ GNUNET_NETWORK_STRUCT_BEGIN struct PeerPutMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_PUT + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT */ struct GNUNET_MessageHeader header; @@ -203,7 +210,7 @@ struct PeerPutMessage struct PeerGetMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_GET + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_GET */ struct GNUNET_MessageHeader header; @@ -260,7 +267,7 @@ struct PeerGetMessage struct PeerGetResultMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_GET_RESULT + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT */ struct GNUNET_MessageHeader header; @@ -309,7 +316,7 @@ struct PeerGetResultMessage struct PeerTrailSetupMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP */ struct GNUNET_MessageHeader header; @@ -359,7 +366,7 @@ struct PeerTrailSetupResultMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_RESULT + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT */ struct GNUNET_MessageHeader header; @@ -401,7 +408,7 @@ struct PeerTrailSetupResultMessage struct PeerVerifySuccessorMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR */ struct GNUNET_MessageHeader header; @@ -432,7 +439,7 @@ struct PeerVerifySuccessorMessage struct PeerVerifySuccessorResultMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR_RESULT + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT */ struct GNUNET_MessageHeader header; @@ -475,7 +482,7 @@ struct PeerVerifySuccessorResultMessage struct PeerNotifyNewSuccessorMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_NOTIFY_NEW_SUCCESSOR + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR */ struct GNUNET_MessageHeader header; @@ -507,7 +514,7 @@ struct PeerNotifyNewSuccessorMessage struct PeerTrailCompressionMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_COMPRESSION + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_COMPRESSION */ struct GNUNET_MessageHeader header; @@ -536,7 +543,7 @@ struct PeerTrailCompressionMessage struct PeerTrailTearDownMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_TEARDOWN + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN */ struct GNUNET_MessageHeader header; @@ -558,7 +565,7 @@ struct PeerTrailTearDownMessage struct PeerTrailRejectionMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_REJECTION + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION */ struct GNUNET_MessageHeader header; @@ -604,7 +611,7 @@ struct PeerTrailRejectionMessage struct PeerAddTrailMessage { /** - * Type: #GNUNET_MESSAGE_TYPE_DHT_P2P_ADD_TRAIL + * Type: #GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL */ struct GNUNET_MessageHeader header; @@ -1056,7 +1063,7 @@ GDS_NEIGHBOURS_send_trail_setup (struct GNUNET_PeerIdentity source_peer, tsm = (struct PeerTrailSetupMessage *) &pending[1]; pending->msg = &tsm->header; tsm->header.size = htons (msize); - tsm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP); + tsm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP); tsm->final_destination_finger_value = GNUNET_htonll (ultimate_destination_finger_value); tsm->source_peer = source_peer; tsm->best_known_destination = best_known_destination; @@ -1130,7 +1137,7 @@ GDS_NEIGHBOURS_send_trail_setup_result (struct GNUNET_PeerIdentity querying_peer tsrm = (struct PeerTrailSetupResultMessage *) &pending[1]; pending->msg = &tsrm->header; tsrm->header.size = htons (msize); - tsrm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_RESULT); + tsrm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT); tsrm->querying_peer = querying_peer; tsrm->finger_identity = finger; tsrm->is_predecessor = htonl (is_predecessor); @@ -1201,7 +1208,7 @@ GDS_NEIGHBOURS_send_trail_rejection (struct GNUNET_PeerIdentity source_peer, trm = (struct PeerTrailRejectionMessage *)&pending[1]; pending->msg = &trm->header; trm->header.size = htons (msize); - trm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_REJECTION); + trm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION); trm->source_peer = source_peer; trm->congested_peer = congested_peer; trm->congestion_time = congestion_timeout; @@ -1265,7 +1272,7 @@ GDS_NEIGHBOURS_send_verify_successor_message (struct GNUNET_PeerIdentity source_ vsm = (struct PeerVerifySuccessorMessage *) &pending[1]; pending->msg = &vsm->header; vsm->header.size = htons (msize); - vsm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR); + vsm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR); vsm->source_peer = source_peer; vsm->successor = successor; vsm->trail_id = trail_id; @@ -1326,7 +1333,7 @@ GDS_NEIGHBOURS_send_trail_teardown (struct GNUNET_HashCode trail_id, ttdm = (struct PeerTrailTearDownMessage *) &pending[1]; pending->msg = &ttdm->header; ttdm->header.size = htons (msize); - ttdm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_TEARDOWN); + ttdm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN); ttdm->trail_id = trail_id; ttdm->trail_direction = htonl (trail_direction); @@ -1389,7 +1396,7 @@ GDS_NEIGHBOURS_send_verify_successor_result (struct GNUNET_PeerIdentity querying vsmr = (struct PeerVerifySuccessorResultMessage *) &pending[1]; pending->msg = &vsmr->header; vsmr->header.size = htons (msize); - vsmr->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR_RESULT); + vsmr->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT); vsmr->querying_peer = querying_peer; vsmr->current_successor = current_successor; vsmr->probable_successor = probable_successor; @@ -1455,7 +1462,7 @@ GDS_NEIGHBOURS_send_notify_new_successor (struct GNUNET_PeerIdentity source_peer nsm = (struct PeerNotifyNewSuccessorMessage *) &pending[1]; pending->msg = &nsm->header; nsm->header.size = htons (msize); - nsm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_NOTIFY_NEW_SUCCESSOR); + nsm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR); nsm->new_successor = successor; nsm->source_peer = source_peer; nsm->trail_id = succesor_trail_id; @@ -1519,7 +1526,7 @@ GDS_NEIGHBOURS_send_add_trail (struct GNUNET_PeerIdentity source_peer, adm = (struct PeerAddTrailMessage *) &pending[1]; pending->msg = &adm->header; adm->header.size = htons (msize); - adm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_ADD_TRAIL); + adm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL); adm->source_peer = source_peer; adm->destination_peer = destination_peer; adm->trail_id = trail_id; @@ -1573,7 +1580,7 @@ GDS_NEIGHBOURS_send_trail_compression (struct GNUNET_PeerIdentity source_peer, tcm = (struct PeerTrailCompressionMessage *) &pending[1]; pending->msg = &tcm->header; tcm->header.size = htons (msize); - tcm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_COMPRESSION); + tcm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_COMPRESSION); tcm->source_peer = source_peer; tcm->new_first_friend = first_friend; tcm->trail_id = trail_id; @@ -2134,7 +2141,7 @@ GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key, ppm = (struct PeerPutMessage *) &pending[1]; pending->msg = &ppm->header; ppm->header.size = htons (msize); - ppm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_PUT); + ppm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT); ppm->options = htonl (options); ppm->block_type = htonl (block_type); ppm->hop_count = htonl (hop_count + 1); @@ -2252,7 +2259,7 @@ GDS_NEIGHBOURS_send_get (const struct GNUNET_HashCode *key, pgm = (struct PeerGetMessage *) &pending[1]; pending->msg = &pgm->header; pgm->header.size = htons (msize); - pgm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_GET); + pgm->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_GET); pgm->get_path_length = htonl (get_path_length); pgm->best_known_destination = local_best_known_dest; @@ -2339,7 +2346,7 @@ GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *key, get_result = (struct PeerGetResultMessage *)&pending[1]; pending->msg = &get_result->header; get_result->header.size = htons (msize); - get_result->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_GET_RESULT); + get_result->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT); get_result->key = *key; /* FIXME: check if you are passing the correct querying_peer as described in the get_result documentation. */ @@ -2693,12 +2700,12 @@ send_trail_teardown (struct FingerInfo *finger, then remove finger. */ /* We should decerement the friend trail count here. */ struct FriendInfo *friend; - + GNUNET_assert (NULL != (friend = - GNUNET_CONTAINER_multipeermap_get (friend_peermap, - &trail->trail_head->peer))); + GNUNET_CONTAINER_multipeermap_get (friend_peermap, + &trail->trail_head->peer))); - friend->trails_count--; + //friend->trails_count--; GDS_NEIGHBOURS_send_trail_teardown (trail->trail_id, GDS_ROUTING_SRC_TO_DEST, &trail->trail_head->peer); @@ -3304,7 +3311,7 @@ finger_table_add (struct GNUNET_PeerIdentity finger_identity, add_new_finger (finger_identity, updated_trail, updated_finger_trail_length, finger_trail_id, finger_table_index); update_current_search_finger_index (finger_identity, finger_table_index); - GNUNET_free (updated_trail); + GNUNET_free_non_null (updated_trail); return; } @@ -3330,7 +3337,7 @@ finger_table_add (struct GNUNET_PeerIdentity finger_identity, if (0 == GNUNET_CRYPTO_cmp_peer_identity (&(existing_finger->finger_identity), &my_identity)) { - GNUNET_free (updated_trail); + GNUNET_free_non_null (updated_trail); return; } /* If the existing finger is not a friend. */ @@ -3348,7 +3355,7 @@ finger_table_add (struct GNUNET_PeerIdentity finger_identity, } } update_current_search_finger_index (finger_identity, finger_table_index); - GNUNET_free (updated_trail); + GNUNET_free_non_null (updated_trail); return; } @@ -3502,6 +3509,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time), &(put->key),putlen, pp, ntohl (put->block_type), payload_size, payload); + GNUNET_free_non_null (next_hop); return GNUNET_YES; } else @@ -3855,8 +3863,7 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, &my_identity))) { /* If I was not the source of this message for which now I am destination */ - if ((0 != GNUNET_CRYPTO_cmp_peer_identity (&source, &my_identity)) || - (trail_length > 0)) + if (0 != GNUNET_CRYPTO_cmp_peer_identity (&source, &my_identity)) { GDS_ROUTING_add (trail_id, *peer, my_identity); } @@ -4991,6 +4998,7 @@ handle_dht_p2p_trail_teardown (void *cls, const struct GNUNET_PeerIdentity *peer struct GNUNET_PeerIdentity *next_hop; size_t msize; msize = ntohs (message->size); + /* Here we pass only the trail id. */ if (msize != sizeof (struct PeerTrailTearDownMessage)) { @@ -5136,7 +5144,7 @@ remove_matching_trails (const struct GNUNET_PeerIdentity *disconnected_friend, /* Number of trails with disconnected_friend as the first hop in the trail * to reach from me to remove_finger, NOT including endpoints. */ matching_trails_count = 0; - + /* Iterate over all the trails of finger. */ for (i = 0; i < remove_finger->trails_count; i++) { @@ -5329,6 +5337,7 @@ core_init (void *cls, FPRINTF (stderr,_("\nSUPU %s, %s, %d, my_identity = %s"), __FILE__, __func__,__LINE__, GNUNET_i2s (&my_identity)); #endif + } @@ -5360,20 +5369,20 @@ int GDS_NEIGHBOURS_init (void) { static struct GNUNET_CORE_MessageHandler core_handlers[] = { - {&handle_dht_p2p_put, GNUNET_MESSAGE_TYPE_DHT_P2P_PUT, 0}, - {&handle_dht_p2p_get, GNUNET_MESSAGE_TYPE_DHT_P2P_GET, 0}, - {&handle_dht_p2p_get_result, GNUNET_MESSAGE_TYPE_DHT_P2P_GET_RESULT, 0}, - {&handle_dht_p2p_trail_setup, GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP, 0}, - {&handle_dht_p2p_trail_setup_result, GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_RESULT, 0}, - {&handle_dht_p2p_verify_successor, GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR, 0}, - {&handle_dht_p2p_verify_successor_result, GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR_RESULT, 0}, - {&handle_dht_p2p_notify_new_successor, GNUNET_MESSAGE_TYPE_DHT_P2P_NOTIFY_NEW_SUCCESSOR, 0}, - {&handle_dht_p2p_trail_setup_rejection, GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_REJECTION, 0}, - {&handle_dht_p2p_trail_compression, GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_COMPRESSION, + {&handle_dht_p2p_put, GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT, 0}, + {&handle_dht_p2p_get, GNUNET_MESSAGE_TYPE_XDHT_P2P_GET, 0}, + {&handle_dht_p2p_get_result, GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT, 0}, + {&handle_dht_p2p_trail_setup, GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP, 0}, + {&handle_dht_p2p_trail_setup_result, GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT, 0}, + {&handle_dht_p2p_verify_successor, GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR, 0}, + {&handle_dht_p2p_verify_successor_result, GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT, 0}, + {&handle_dht_p2p_notify_new_successor, GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR, 0}, + {&handle_dht_p2p_trail_setup_rejection, GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION, 0}, + {&handle_dht_p2p_trail_compression, GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_COMPRESSION, sizeof (struct PeerTrailCompressionMessage)}, - {&handle_dht_p2p_trail_teardown, GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_TEARDOWN, + {&handle_dht_p2p_trail_teardown, GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN, sizeof (struct PeerTrailTearDownMessage)}, - {&handle_dht_p2p_add_trail, GNUNET_MESSAGE_TYPE_DHT_P2P_ADD_TRAIL, 0}, + {&handle_dht_p2p_add_trail, GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL, 0}, {NULL, 0, 0} }; diff --git a/src/dht/gnunet-service-xdht_routing.c b/src/dht/gnunet-service-xdht_routing.c index e320c2df9..102ea404b 100644 --- a/src/dht/gnunet-service-xdht_routing.c +++ b/src/dht/gnunet-service-xdht_routing.c @@ -166,17 +166,24 @@ static int remove_matching_trails (void *cls, const struct GNUNET_HashCode *key, void *value) { - struct RoutingTrail *remove_trail = cls; - struct GNUNET_PeerIdentity *disconnected_peer = value; + struct RoutingTrail *remove_trail = value; + struct GNUNET_PeerIdentity *disconnected_peer = cls; + struct GNUNET_HashCode trail_id = *key; + struct GNUNET_PeerIdentity my_identity; /* If disconnected_peer is next_hop, then send a trail teardown message through * prev_hop in direction from destination to source. */ if (0 == GNUNET_CRYPTO_cmp_peer_identity (&remove_trail->next_hop, disconnected_peer)) { - GDS_NEIGHBOURS_send_trail_teardown (remove_trail->trail_id, - GDS_ROUTING_DEST_TO_SRC, - &remove_trail->prev_hop); + my_identity = GDS_NEIGHBOURS_get_my_id (); + if (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, + &remove_trail->prev_hop)) + { + GDS_NEIGHBOURS_send_trail_teardown (trail_id, + GDS_ROUTING_DEST_TO_SRC, + &remove_trail->prev_hop); + } } /* If disconnected_peer is prev_hop, then send a trail teardown through @@ -184,14 +191,19 @@ static int remove_matching_trails (void *cls, if (0 == GNUNET_CRYPTO_cmp_peer_identity (&remove_trail->prev_hop, disconnected_peer)) { - GDS_NEIGHBOURS_send_trail_teardown (remove_trail->trail_id, - GDS_ROUTING_SRC_TO_DEST, - &remove_trail->next_hop); + my_identity = GDS_NEIGHBOURS_get_my_id (); + if (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, + &remove_trail->next_hop)) + { + GDS_NEIGHBOURS_send_trail_teardown (trail_id, + GDS_ROUTING_SRC_TO_DEST, + &remove_trail->next_hop); + } } GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove (routing_table, - &remove_trail->trail_id, + &trail_id, remove_trail)); GNUNET_free (remove_trail); return GNUNET_YES; @@ -239,6 +251,7 @@ GDS_ROUTING_test_print (void) void GDS_ROUTING_remove_trail_by_peer (const struct GNUNET_PeerIdentity *peer) { + GNUNET_assert (GNUNET_CONTAINER_multihashmap_size(routing_table) > 0); GNUNET_CONTAINER_multihashmap_iterate (routing_table, &remove_matching_trails, (void *)peer); } @@ -264,6 +277,7 @@ GDS_ROUTING_add (struct GNUNET_HashCode new_trail_id, new_entry->trail_id = new_trail_id; new_entry->next_hop = next_hop; new_entry->prev_hop = prev_hop; + return GNUNET_CONTAINER_multihashmap_put (routing_table, &new_trail_id, new_entry, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 77c6a6337..b24810110 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h @@ -2499,64 +2499,74 @@ extern "C" /** * Trail setup request is received by a peer. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP 880 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP 880 /** * Trail to a particular peer is returned to this peer. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_RESULT 881 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT 881 /** * Verify if your immediate successor is still your immediate successor. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR 882 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR 882 /** * Notify your new immediate successor that you are its new predecessor. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_NOTIFY_NEW_SUCCESSOR 883 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR 883 /** * Message which contains the immediate predecessor of requested successor */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_VERIFY_SUCCESSOR_RESULT 884 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT 884 /** * Message which contains the get result. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_GET_RESULT 885 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT 885 /** * Trail Rejection Message. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_SETUP_REJECTION 886 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION 886 /** * Trail Tear down Message. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_TEARDOWN 887 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN 887 /** * Routing table add message. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_ADD_TRAIL 888 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL 888 /** * Trail compression message. */ -#define GNUNET_MESSAGE_TYPE_DHT_P2P_TRAIL_COMPRESSION 889 +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_COMPRESSION 889 + +/** + * Client wants to store item in DHT. + */ +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT 890 + +/** + * Peer tries to find data in DHT. + */ +#define GNUNET_MESSAGE_TYPE_XDHT_P2P_GET 891 #if ENABLE_MALICIOUS /** * Turn X-VINE DHT service malicious */ -#define GNUNET_MESSAGE_TYPE_DHT_ACT_MALICIOUS 890 +#define GNUNET_MESSAGE_TYPE_DHT_ACT_MALICIOUS 892 #endif /*******************************************************************************/ /** - * Next available: 900 + * Next available: 902 */ /** -- 2.25.1