aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-01 09:36:22 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-01 09:36:22 +0000
commit48d9e46f09ea04e6c29acfa2a56c2ed336cdf380 (patch)
treed48b4156e02b0cb739bcf1286a6d6107cc12c872 /src/dht
parent507b204d9a3476bde912501ae76e3bc5001398a2 (diff)
downloadgnunet-48d9e46f09ea04e6c29acfa2a56c2ed336cdf380.tar.gz
gnunet-48d9e46f09ea04e6c29acfa2a56c2ed336cdf380.zip
-pass trail paths to callbacks
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-wdht_neighbours.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c
index c7e72862f..fe764dc3e 100644
--- a/src/dht/gnunet-service-wdht_neighbours.c
+++ b/src/dht/gnunet-service-wdht_neighbours.c
@@ -1320,12 +1320,16 @@ handle_dht_p2p_trail_destroy (void *cls,
1320 * 1320 *
1321 * @param cls closure (NULL) 1321 * @param cls closure (NULL)
1322 * @param trail_id path to the originator 1322 * @param trail_id path to the originator
1323 * @param trail_path path the message took on the trail, if available
1324 * @param trail_path_length number of entries on the @a trail_path
1323 * @param message the finger setup message 1325 * @param message the finger setup message
1324 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1326 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1325 */ 1327 */
1326static int 1328static int
1327handle_dht_p2p_successor_find (void *cls, 1329handle_dht_p2p_successor_find (void *cls,
1328 const struct GNUNET_HashCode *trail_id, 1330 const struct GNUNET_HashCode *trail_id,
1331 const struct GNUNET_PeerIdentity *trail_path,
1332 unsigned int trail_path_length,
1329 const struct GNUNET_MessageHeader *message) 1333 const struct GNUNET_MessageHeader *message)
1330{ 1334{
1331 const struct FindSuccessorMessage *fsm; 1335 const struct FindSuccessorMessage *fsm;
@@ -1347,12 +1351,16 @@ handle_dht_p2p_successor_find (void *cls,
1347 * 1351 *
1348 * @param cls closure (NULL) 1352 * @param cls closure (NULL)
1349 * @param trail_id path to the originator 1353 * @param trail_id path to the originator
1354 * @param trail_path path the message took on the trail, if available
1355 * @param trail_path_length number of entries on the @a trail_path
1350 * @param message the peer get message 1356 * @param message the peer get message
1351 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1357 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1352 */ 1358 */
1353static int 1359static int
1354handle_dht_p2p_peer_get (void *cls, 1360handle_dht_p2p_peer_get (void *cls,
1355 const struct GNUNET_HashCode *trail_id, 1361 const struct GNUNET_HashCode *trail_id,
1362 const struct GNUNET_PeerIdentity *trail_path,
1363 unsigned int trail_path_length,
1356 const struct GNUNET_MessageHeader *message) 1364 const struct GNUNET_MessageHeader *message)
1357{ 1365{
1358 const struct PeerGetMessage *pgm; 1366 const struct PeerGetMessage *pgm;
@@ -1378,12 +1386,16 @@ handle_dht_p2p_peer_get (void *cls,
1378 * 1386 *
1379 * @param cls closure (NULL) 1387 * @param cls closure (NULL)
1380 * @param trail_id path to the originator 1388 * @param trail_id path to the originator
1389 * @param trail_path path the message took on the trail, if available
1390 * @param trail_path_length number of entries on the @a trail_path
1381 * @param message the peer get result message 1391 * @param message the peer get result message
1382 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1392 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1383 */ 1393 */
1384static int 1394static int
1385handle_dht_p2p_peer_get_result (void *cls, 1395handle_dht_p2p_peer_get_result (void *cls,
1386 const struct GNUNET_HashCode *trail_id, 1396 const struct GNUNET_HashCode *trail_id,
1397 const struct GNUNET_PeerIdentity *trail_path,
1398 unsigned int trail_path_length,
1387 const struct GNUNET_MessageHeader *message) 1399 const struct GNUNET_MessageHeader *message)
1388{ 1400{
1389 const struct PeerGetResultMessage *pgrm; 1401 const struct PeerGetResultMessage *pgrm;
@@ -1414,12 +1426,16 @@ handle_dht_p2p_peer_get_result (void *cls,
1414 * 1426 *
1415 * @param cls closure (NULL) 1427 * @param cls closure (NULL)
1416 * @param trail_id path to the originator 1428 * @param trail_id path to the originator
1429 * @param trail_path path the message took on the trail, if available
1430 * @param trail_path_length number of entries on the @a trail_path
1417 * @param message the peer put message 1431 * @param message the peer put message
1418 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1432 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1419 */ 1433 */
1420static int 1434static int
1421handle_dht_p2p_peer_put (void *cls, 1435handle_dht_p2p_peer_put (void *cls,
1422 const struct GNUNET_HashCode *trail_id, 1436 const struct GNUNET_HashCode *trail_id,
1437 const struct GNUNET_PeerIdentity *trail_path,
1438 unsigned int trail_path_length,
1423 const struct GNUNET_MessageHeader *message) 1439 const struct GNUNET_MessageHeader *message)
1424{ 1440{
1425 const struct PeerGetResultMessage *pgrm; 1441 const struct PeerGetResultMessage *pgrm;
@@ -1459,12 +1475,16 @@ handle_dht_p2p_peer_put (void *cls,
1459 * 1475 *
1460 * @param cls closure 1476 * @param cls closure
1461 * @param trail_id trail identifier 1477 * @param trail_id trail identifier
1478 * @param trail_path path the message took on the trail, if available
1479 * @param trail_path_length number of entries on the @a trail_path
1462 * @param message the message we got 1480 * @param message the message we got
1463 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1481 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1464 */ 1482 */
1465typedef int 1483typedef int
1466(*TrailHandlerCallback)(void *cls, 1484(*TrailHandlerCallback)(void *cls,
1467 const struct GNUNET_HashCode *trail_id, 1485 const struct GNUNET_HashCode *trail_id,
1486 const struct GNUNET_PeerIdentity *trail_path,
1487 unsigned int trail_path_length,
1468 const struct GNUNET_MessageHeader *message); 1488 const struct GNUNET_MessageHeader *message);
1469 1489
1470 1490
@@ -1610,6 +1630,8 @@ handle_dht_p2p_trail_route (void *cls,
1610 (ntohs (payload->size) == th->message_size) ) 1630 (ntohs (payload->size) == th->message_size) )
1611 th->callback (th->cls, 1631 th->callback (th->cls,
1612 &trm->trail_id, 1632 &trm->trail_id,
1633 path,
1634 path_length,
1613 payload); 1635 payload);
1614 else 1636 else
1615 GNUNET_break_op (0); 1637 GNUNET_break_op (0);